Repository navigation
fix(frontend): hide the host header when a host has no visible drives - #1062
Merged
Merged
Conversation
The dashboard groups drives by host and renders a header for each group, but the header was only gated on the host id being non-empty. Whether a drive renders is decided separately, per drive, further down the template. Nothing tied the two together, so a host whose drives were all archived kept its header with nothing underneath it. The two conditions drifted apart because the header guard predates archiving by three years and the archive feature only added the per-drive check. Putting the visibility rule in one method and calling it from both places stops them drifting again. This also covers the same header left behind after deleting the last drive on a host, since hostGroups keeps the entry until a reload.
kaysond
approved these changes
Aug 20, 2026
kaysond
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1060.
The problem
The dashboard groups drives by host and renders a header per group, but the header was only gated on the host id being non-empty:
Whether a drive renders is decided separately, further down, per drive:
Nothing tied those two conditions together, so a host whose drives were all archived kept its header with nothing underneath it.
The two drifted apart because the header guard came in with host grouping in 83839f7 (2022), and the archive feature in 600cd15 only added the per-drive check without revisiting the header. So rather than adding a second copy of the visibility rule, this puts it in one method and calls it from both places, which is what stops them drifting again.
The same guard also covers a second path to the same symptom:
hostGroupsis built once andonDeviceDeletedonly removes the drive fromsummaryData, so deleting the last drive on a host used to leave the header behind until a reload.hostId.keyis kept, since it still does its original job of suppressing the header for the default empty host id.Before
After
How I tested it
Ran the frontend locally with the dev mocks, flipping the one mock drive on
custom host idtoarchived: trueso that host has no visible drives. Same six drives in both shots, header gone in the second. Verified in the DOM too,document.querySelectorAll('h3')goes from["custom host id"]to[]whileapp-dashboard-devicestays at 6.Also added
dashboard.component.spec.tswith four cases for the new method: all archived, one not archived, all archived while showing archived, and every drive deleted. Full suite is green, 91 passing, up from 87 on master.Heads up that this adds
webapp/frontend/src/app/modules/dashboard/dashboard.component.spec.ts, which #1039 also creates. Whichever lands second needs a trivial rebase, happy to do that if this one goes second.AI usage disclosure
Per AI_POLICY.md: written with Claude Code, AI-assisted throughout. I reviewed every line, and the before/after above is a real local run rather than a hypothetical result.