Repository navigation
feat(dashboards): cascading (faceted) filter values #2423
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
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2d4bc25
feat(dashboards): cascading (faceted) filter values
teeohhem a3e220d
Merge branch 'main' into la-paz
teeohhem e6a2ed4
fix(k8s-filters): escape filter regexes and memoize chart configs
teeohhem 0495e82
Merge branch 'main' into la-paz
teeohhem 38fef00
feat(dashboards): opt-in 'link filters' toggle with lazy faceting
teeohhem 2001d2a
Merge remote-tracking branch 'origin/la-paz' into la-paz
teeohhem 7235bc7
style(dashboards): use blue (not green) for active link-filters toggle
teeohhem d6e724a
style(dashboards): use themed 'secondary' variant for active link toggle
teeohhem aae0c25
style(dashboards): high-contrast inverted active state for link toggle
teeohhem d658d9a
refactor(dashboards): single-pass faceted filters via groupUniqArrayIf
teeohhem 138bc12
fix(dashboards): narrow Filter union when reading condition (tsc)
teeohhem 8d896bd
perf(dashboards): route faceted filter scans to a covering materializ…
teeohhem 52ee76d
Merge remote-tracking branch 'origin/main' into la-paz
teeohhem 99f5519
fix(dashboards): render faceting predicates like the keys they constrain
teeohhem 6fcfc1c
refactor(common-utils): key rendered expressions by raw key
teeohhem 5aebed8
Merge branch 'main' into la-paz
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| feat(dashboards): opt-in linked (faceted) filter values | ||
|
|
||
| Dashboard and Kubernetes filter bars gain a "link filters" toggle (the | ||
| bidirectional-arrow button at the end of the bar). When enabled, each filter | ||
| dropdown only shows values that co-occur with the other current selections — | ||
| e.g. picking a `cluster` narrows the `namespace` dropdown to namespaces in that | ||
| cluster (the K8s bar also factors in the free-text search). A filter never | ||
| constrains its own options, so multi-select still works. It is off by default | ||
| because contingent value lookups can't use the cheap per-key rollups and are | ||
| more expensive at scale; when on, all of a source's facets are computed in a | ||
| single `groupUniqArrayIf` scan rather than one query per filter. Search-page | ||
| filters are unaffected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import type { CSSProperties } from 'react'; | ||
| import { ActionIcon, Tooltip } from '@mantine/core'; | ||
| import { IconArrowsLeftRight } from '@tabler/icons-react'; | ||
|
|
||
| type FilterLinkToggleProps = { | ||
| linked: boolean; | ||
| onChange: (linked: boolean) => void; | ||
| 'data-testid'?: string; | ||
| }; | ||
|
|
||
| /** | ||
| * Opt-in toggle that "links" a set of filter dropdowns so each one's selectable | ||
| * values are narrowed by the others' current selections (faceted / filter-aware | ||
| * values). Off by default because contingent value lookups can't be served from | ||
| * the cheap per-key rollups and are far more expensive at scale. | ||
| */ | ||
| export function FilterLinkToggle({ | ||
| linked, | ||
| onChange, | ||
| 'data-testid': dataTestId = 'filter-link-toggle', | ||
| }: FilterLinkToggleProps) { | ||
| return ( | ||
| <Tooltip | ||
| withinPortal | ||
| multiline | ||
| w={250} | ||
| label={ | ||
| linked | ||
| ? 'Filters are linked: each dropdown only shows values that match the other selections. Click to unlink.' | ||
| : 'Link filters: narrow each dropdown to values that match the other selections (filter-aware). May be slower on large datasets.' | ||
| } | ||
| > | ||
| <ActionIcon | ||
| variant="subtle" | ||
| // Active state: a high-contrast inverted "pill" via theme tokens (never | ||
| // green, on any theme) so linked mode is clearly visible; off is the | ||
| // plain subtle icon. Overrides Mantine's ActionIcon CSS vars inline. | ||
| style={ | ||
| linked | ||
| ? ({ | ||
| '--ai-bg': 'var(--color-bg-inverted)', | ||
| '--ai-hover': 'var(--color-bg-inverted)', | ||
| '--ai-color': 'var(--color-text-inverted)', | ||
| } as CSSProperties) | ||
| : undefined | ||
| } | ||
| onClick={() => onChange(!linked)} | ||
| aria-label="Link filters" | ||
| aria-pressed={linked} | ||
| data-testid={dataTestId} | ||
| > | ||
| <IconArrowsLeftRight size={16} /> | ||
| </ActionIcon> | ||
| </Tooltip> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally, this could be stored (globally or at the dashboard level) in browser storage like the search page preference, so that a user doesn't have to set it on every dashboard page load.