Add breadcrumb to rack detail#589
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM Findings[MEDIUM] Breadcrumb rack-sibling lookup repeats an org-wide rack scan on every poll
NotesNo auth, SQL injection, command injection, cryptostealing/pool hijack, protobuf wire-format, or XSS issues were evident in the scoped diff. The changed files are limited to the ProtoFleet rack overview page and its tests. Generated by Codex Security Review | |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 702199502d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (rackSiteId) { | ||
| rackBreadcrumbSegments.push({ label: "Sites", to: "/fleet/sites" }); | ||
| rackBreadcrumbSegments.push({ label: siteNameById.get(rackSiteId) ?? "Site", to: `/sites/${rackSiteId}` }); | ||
| if (rackBuildingId) { |
There was a problem hiding this comment.
Handle racks in buildings without sites
When a rack is assigned to a building whose building.siteId is unset (the API supports unassigned buildings), rackSiteId is undefined, so this top-level if (rackSiteId) sends it through the unassigned-rack fallback and never adds the building segment/link. That makes racks in unassigned buildings show Racks / rack instead of preserving their building context; branch on rackBuildingId separately so those pages still link to /buildings/:id.
Useful? React with 👍 / 👎.
Summary
Stack: this PR is based on #587 (
jmarr/breadcrumb-component) and only contains the rack-detail integration. It replaces the rack detail header's chevron back button with breadcrumb navigation and preserves the existing rack title, zone subtitle, and action buttons.How it works
RackOverviewPageloads site and building labels in parallel with the existing rack resolution. Assigned racks renderSites / {site} / {building} / {rack}when building context exists, orSites / {site} / {rack}for direct-to-site racks; unassigned racks fall back toRacks / {rack}.Diagrams
Areas of the code involved
client/src/protoFleet/features/fleetManagement/pages/RackOverviewPage.tsxclient/src/protoFleet/features/fleetManagement/pages/RackOverviewPage.test.tsxKey technical decisions & trade-offs
Testing & validation
vitest run src/protoFleet/features/fleetManagement/pages/RackOverviewPage.test.tsxpassed.client-typecheckis currently blocked by unrelated infra/maintenance TypeScript errors already present on the parent branch.