Repository navigation
fix(analytics): show only the hotspot label in the layer rail #2078
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -432,7 +432,24 @@ export function groupRows( rows, layerType, configIndex ) { | |
| // path the parent uses so a raw composite UUID never reaches | ||
| // the rail. Falls back to a generic ordinal "<TypeLabel> #N" | ||
| // when nothing usable. | ||
| const rawSubName = md.product_name || row.layer_name || ''; | ||
| let rawSubName = md.product_name || row.layer_name || ''; | ||
| // The hotspot tracker packs the parent layer name, a separator | ||
| // dash, and "Hotspot N" into layer_name. The rail's card title | ||
| // already shows the parent, so that prefix is pure repetition | ||
| // and, once the row is truncated, it hides the "Hotspot N" that | ||
| // actually names the row. Drop the parent prefix (and the | ||
| // separator after it), keeping only the hotspot's own label. | ||
| // Woo rows carry a bare product_name and never match this, so | ||
| // they are left alone. | ||
| if ( | ||
| ! md.product_name && | ||
| md.parent_layer_name && | ||
| rawSubName.startsWith( md.parent_layer_name ) | ||
| ) { | ||
| rawSubName = rawSubName | ||
| .slice( md.parent_layer_name.length ) | ||
| .replace( /^[\s\p{Pd}]+/u, '' ); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The separator cleanup is greedy across dashes, so it can also eat a dash that belongs to the hotspot's own label.
Anchoring the strip to a single separator occurrence keeps the label intact, e.g.: (or only strip when the composite actually matches
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in b91bdab. Went with your "only strip when the composite actually matches The separator is now a module constant |
||
| let subName; | ||
| if ( | ||
| rawSubName && | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.