Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [RUM-4908] Add only Link to Facet List in Developer Extension #2830

Merged
merged 18 commits into from
Feb 5, 2025

Conversation

cy-moi
Copy link
Contributor

@cy-moi cy-moi commented Jun 25, 2024

Motivation

Add only link to facet list in developer extension, so we don't need to click on every element to exclude everything.

Changes

Screen.Recording.2024-08-06.at.11.12.43.mov

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

Copy link

cit-pr-commenter bot commented Jun 25, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 147.04 KiB 147.04 KiB 0 B 0.00%
Logs 51.33 KiB 51.33 KiB 0 B 0.00%
Rum Slim 105.77 KiB 105.77 KiB 0 B 0.00%
Worker 24.50 KiB 24.50 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 0.000
addaction 0.037 0.036 -0.000
addtiming 0.001 0.001 0.000
adderror 0.045 0.049 0.004
startstopsessionreplayrecording 0.008 0.009 0.001
startview 0.376 0.379 0.003
logmessage 0.026 0.021 -0.006
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 30.06 KiB 27.49 KiB -2626 B
addaction 60.18 KiB 56.18 KiB -4098 B
addtiming 28.63 KiB 26.40 KiB -2284 B
adderror 62.42 KiB 61.58 KiB -859 B
startstopsessionreplayrecording 28.18 KiB 25.11 KiB -3137 B
startview 414.92 KiB 420.28 KiB 5.36 KiB
logmessage 57.41 KiB 56.03 KiB -1410 B

🔗 RealWorld

@cy-moi cy-moi marked this pull request as ready for review June 26, 2024 08:12
@cy-moi cy-moi requested a review from a team as a code owner June 26, 2024 08:12
@nulrich
Copy link
Contributor

nulrich commented Jun 27, 2024

There's a small bug when you click "only" on a children and then "only" to the parent. The selection is good but not the "only"/"all" labels.

Screenshot 2024-06-27 at 13 15 27

@cy-moi cy-moi force-pushed the congyao/RUM-4908-add-only-link-to-facet-list branch from c7f7816 to 14e36b9 Compare August 2, 2024 09:41
@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 88.63636% with 5 lines in your changes missing coverage. Please review.

Project coverage is 92.95%. Comparing base (8a7de5a) to head (f7782df).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nel/components/tabs/eventsTab/computeFacetState.ts 93.33% 2 Missing ⚠️
...xtension/src/panel/hooks/useEvents/eventFilters.ts 77.77% 2 Missing ⚠️
...tension/src/panel/hooks/useEvents/facetRegistry.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2830      +/-   ##
==========================================
- Coverage   93.50%   92.95%   -0.55%     
==========================================
  Files         290      297       +7     
  Lines        7703     7840     +137     
  Branches     1754     1785      +31     
==========================================
+ Hits         7203     7288      +85     
- Misses        500      552      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}) {
const isTopLevel = depth === 0
const isSelected = !excludedFacetValues[facet.path] || !excludedFacetValues[facet.path].includes(facetValue)
const facetSelectState = computeSelectionState(facetValuesFilter, facetRegistry, facet, facetValue, parentList)
const isCollapsed =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to the only feature but I would decorrelate collapse state from the filtering state and add icons to control collapsing manually.

For example, if I want to only select css and image I would start by unselecting resource and then clicking on both. But right now it will unselect and collapse resource.

Copy link
Contributor Author

@cy-moi cy-moi Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I actually do the opposite, I never unselect the parent first. Right now, I aim to mimick the web-ui facets, when selecting a child, we expand the parent and find the child to select. But I agree the collapsing is limited here as we are using a third party. Maybe we implement our own collapse component separately, because I worry this PR is growing a bit much.

@cy-moi cy-moi force-pushed the congyao/RUM-4908-add-only-link-to-facet-list branch from e613fc6 to 432e694 Compare December 30, 2024 16:43
@cy-moi cy-moi requested a review from nulrich January 6, 2025 09:12
)
)
)
const filteredEvents: SdkEvent[] = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 suggestion: ‏I would keep the filter approach which is maybe more clear.

Suggested change
const filteredEvents: SdkEvent[] = []
export function filterFacets(
events: SdkEvent[],
facetValuesFilter: FacetValuesFilter,
facetRegistry: FacetRegistry
): SdkEvent[] {
const filteredFacetValueEntries = Object.entries(facetValuesFilter.facetValues)
if (filteredFacetValueEntries.length === 0) {
return events
}
const isIncludeType = facetValuesFilter.type === 'include'
return events.filter((event) =>
filteredFacetValueEntries.some(([facetPath, filteredValues]) => {
const eventValue = facetRegistry.getFieldValueForEvent(event, facetPath)
return isIncludeType == filteredValues.includes(eventValue as string)
})
)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is way more clear!

@cy-moi cy-moi force-pushed the congyao/RUM-4908-add-only-link-to-facet-list branch 3 times, most recently from 3ca0ace to 5c1218c Compare February 4, 2025 13:52
@cy-moi cy-moi force-pushed the congyao/RUM-4908-add-only-link-to-facet-list branch from 5c1218c to 498fead Compare February 4, 2025 16:15
@cy-moi
Copy link
Contributor Author

cy-moi commented Feb 5, 2025

Notes: Some commits were not signed before multiple times of merging from main, hence rebase and cherry-pick were necessary.

@cy-moi cy-moi merged commit c907a82 into main Feb 5, 2025
19 checks passed
@cy-moi cy-moi deleted the congyao/RUM-4908-add-only-link-to-facet-list branch February 5, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants