Repository navigation
fix(app): keep dashboard tile menu on screen with many groups #3360
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
jordan-simonovski
merged 5 commits into
main
from
jordansimonovski/tile-menu-move-to-group
Oct 15, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6efc275
fix(app): keep dashboard tile menu on screen with many groups
jordan-simonovski c8b664f
test(app): cover tile menu overflow in e2e
jordan-simonovski 5aa49f1
test(app): keep assertions in tile menu e2e test bodies
jordan-simonovski 941f244
test(app): cover divider before a tabbed group in move submenu
jordan-simonovski c28bae4
Merge branch 'main' into jordansimonovski/tile-menu-move-to-group
jordan-simonovski 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,5 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| fix: Keep the dashboard tile menu on screen when a dashboard has many groups, by moving the group list into a scrollable "Move to group" submenu |
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
87 changes: 87 additions & 0 deletions
87
packages/app/src/components/dashboard/MoveToGroupSubmenu.tsx
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,87 @@ | ||
| import { Fragment } from 'react'; | ||
| import { DashboardContainer } from '@hyperdx/common-utils/dist/types'; | ||
| import { Menu } from '@mantine/core'; | ||
| import { IconCornerDownRight, IconFolderSymlink } from '@tabler/icons-react'; | ||
|
|
||
| export type MoveTarget = { | ||
| containerId: string; | ||
| tabId?: string; | ||
| label: string; | ||
| // Heading for the tabs of a multi-tab group | ||
| group?: string; | ||
| }; | ||
|
|
||
| export function buildMoveTargets( | ||
| containers: DashboardContainer[], | ||
| ): MoveTarget[] { | ||
| return containers.flatMap(c => { | ||
| const tabs = c.tabs ?? []; | ||
| if (tabs.length === 0) return [{ containerId: c.id, label: c.title }]; | ||
| if (tabs.length === 1) | ||
| return [{ containerId: c.id, tabId: tabs[0].id, label: tabs[0].title }]; | ||
| // A multi-tab group is named by its first tab, matching its header | ||
| return tabs.map(tab => ({ | ||
| containerId: c.id, | ||
| tabId: tab.id, | ||
| label: tab.title, | ||
| group: tabs[0].title, | ||
| })); | ||
| }); | ||
| } | ||
|
|
||
| // A submenu keeps the tile menu short however many groups the dashboard has. | ||
| export function MoveToGroupSubmenu({ | ||
| moveTargets, | ||
| containerId, | ||
| tabId, | ||
| onMoveToGroup, | ||
| }: { | ||
| moveTargets: MoveTarget[]; | ||
| containerId?: string; | ||
| tabId?: string; | ||
| onMoveToGroup: (containerId: string | undefined, tabId?: string) => void; | ||
| }) { | ||
| const targets = moveTargets.filter( | ||
| t => !(t.containerId === containerId && t.tabId === tabId), | ||
| ); | ||
|
|
||
| return ( | ||
| <Menu.Sub> | ||
| <Menu.Sub.Target> | ||
| <Menu.Sub.Item leftSection={<IconFolderSymlink size={14} />}> | ||
| Move to group | ||
| </Menu.Sub.Item> | ||
| </Menu.Sub.Target> | ||
| <Menu.Sub.Dropdown mah={320} style={{ overflowY: 'auto' }}> | ||
| {containerId && ( | ||
| <Menu.Item | ||
| leftSection={<IconCornerDownRight size={14} />} | ||
| onClick={() => onMoveToGroup(undefined)} | ||
| > | ||
| (Ungrouped) | ||
| </Menu.Item> | ||
| )} | ||
| {containerId && targets.length > 0 && <Menu.Divider role="separator" />} | ||
| {targets.map((t, i) => { | ||
| const prev = targets[i - 1]; | ||
| // Sections key on container, since default group names repeat | ||
| const newContainer = prev?.containerId !== t.containerId; | ||
| return ( | ||
| <Fragment key={`${t.containerId}-${t.tabId ?? ''}`}> | ||
| {prev && newContainer && (prev.group || t.group) && ( | ||
|
jordan-simonovski marked this conversation as resolved.
Resolved
|
||
| <Menu.Divider role="separator" /> | ||
| )} | ||
| {t.group && newContainer && <Menu.Label>{t.group}</Menu.Label>} | ||
| <Menu.Item | ||
| leftSection={<IconCornerDownRight size={14} />} | ||
| onClick={() => onMoveToGroup(t.containerId, t.tabId)} | ||
| > | ||
| {t.label} | ||
| </Menu.Item> | ||
| </Fragment> | ||
| ); | ||
| })} | ||
| </Menu.Sub.Dropdown> | ||
| </Menu.Sub> | ||
| ); | ||
| } | ||
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.
🔵 minor — Group display name is worked out a third time instead of reusing a shared helper
DashboardContainer.tsx:93(firstTab?.title ?? container.title) andDashboardTableOfContents.tsx:92already compute the group's display name. Move that into one exported helper (e.g.getContainerDisplayTitle(container)) and call it here and at both existing sites, so the submenu heading cannot drift from the group header the PR says it matches.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond