-
Notifications
You must be signed in to change notification settings - Fork 14
Bring back topbar breadcrumbs #2529
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Addressing some of the visual things now. As an aside, was looking into how a clickable back button might work...tricky and still not quite right. const matches = useMatches()
// Finds the next available route to jump to
// If there's no handle we have no breadcrumb
// and skip: true means we skip that route
const parentRoute =
matches
.filter(
(match) => !!match.handle || (match.handle && !(match.handle as RouteHandle).skip)
)
.map((match) => match.pathname)
.slice(0, -1)[0] || '' You then add a skip to routes you don't want to go back to – in this case we'd skip over the instance page since we're on a tab route. <Route
element={<InstancePage />}
loader={InstancePage.loader}
handle={{ skip: true }}
> I can get the parent route mostly okay, but the redirects make it a little funky. Must be a better way. |
app/components/TopBar.tsx
Outdated
@@ -38,7 +38,7 @@ export function TopBar({ children }: { children: React.ReactNode }) { | |||
{/* Height is governed by PageContainer grid */} | |||
{/* shrink-0 is needed to prevent getting squished by body content */} | |||
<div className="z-topBar border-b bg-default border-secondary"> | |||
<div className="mx-3 flex h-[60px] shrink-0 items-center justify-between"> | |||
<div className="mx-3 flex h-[54px] shrink-0 items-center justify-between"> |
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.
Was going to ask if it was worth making this a var, but that might only be worthwhile if we need to use it in more places.
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.
WELP
<div className="!mx-0 flex h-full max-h-[calc(100vh-60px)] !w-full flex-col"> |
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.
womp
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.
I dropped this down from 60 to 54, but this is technically for delineating between the body and the footer. @benjaminleonard do we want the serial console footer to match the header, at 54px? Or to stay at 60?
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.
I think in that case it's making the layout the full height of the screen, minus the size of the top bar. The bottom bar on the serial console seems a bit chunky but it's matching the instance create bottom bar. Might adjust elsewhere.
On the high contrast thing – I've set it to |
This version also has a problem with routes nested under route tabs I noted in my refactor, though it it's a little different — only the routers tab gets a crumb. 2024-11-01-routers-crumb-2.mp4 |
* first pass at matches-based breadcrumbs. route config changes required * kinda fix things in the route config * use-title.ts -> use-crumbs.ts * Update import --------- Co-authored-by: Charlie Park <[email protected]>
Here is me demoing approximately all the crumbs. They look pretty good except for the ones where there's a crumb that doesn't actually link to a page or that links to a route that redirects to the page you're already on, as @charliepark pointed out. (I also noticed issues on SSH key and floating IP pages, fixed in dfb3143). 2024-11-07-testing-out-crumbs.mp4And here is me having some fun with the top bar height CSS var. 2024-11-07-top-bar-height-var.mp4 |
I experimented with a |
One approach that would work for avoiding blank screen flashes on redirecting nodes is hacking in a way for the crumb for A more evil approach is to make the loaders for the - <Route path="projects/:project" element={<Navigate to="instances" replace />} />
+ <Route
+ path="projects/:project"
+ loader={(args) =>
+ Promise.all([ProjectLayout.loader(args), InstancesPage.loader(args)])
+ }
+ element={<Navigate to="instances" replace />}
+ /> |
4065ef0
to
4621a82
Compare
@@ -119,8 +115,6 @@ export const pb = { | |||
ipPoolEdit: (params: IpPool) => `${pb.ipPool(params)}/edit`, | |||
ipPoolRangeAdd: (params: IpPool) => `${pb.ipPool(params)}/ranges-add`, | |||
|
|||
inventory: () => '/system/inventory', | |||
rackInventory: () => '/system/inventory/racks', |
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.
The deleted ones in here were never used. Some were used to construct other paths but never used directly.
This is all looking great. |
funny how that works
4b8a524
to
9ded00f
Compare
oxidecomputer/console@6eeab20...9ef82ba * [9ef82bad](oxidecomputer/console@9ef82bad) oxidecomputer/console#2529 * [23beefea](oxidecomputer/console@23beefea) oxidecomputer/console#2537 * [48693a22](oxidecomputer/console@48693a22) oxidecomputer/console#2510 * [8da7b6d0](oxidecomputer/console@8da7b6d0) oxidecomputer/console#2539 * [5edf89ef](oxidecomputer/console@5edf89ef) oxidecomputer/console#2536 * [dcddc81f](oxidecomputer/console@dcddc81f) oxidecomputer/console#2538 * [6f83d416](oxidecomputer/console@6f83d416) oxidecomputer/console#2518 * [7dcd41c2](oxidecomputer/console@7dcd41c2) oxidecomputer/console#2511 * [b01ca85d](oxidecomputer/console@b01ca85d) bump omicron to latest main * [b4920b11](oxidecomputer/console@b4920b11) oxidecomputer/console#2530 * [0552b62e](oxidecomputer/console@0552b62e) oxidecomputer/console#2527 * [ca7f6e20](oxidecomputer/console@ca7f6e20) oxidecomputer/console#2528
oxidecomputer/console@6eeab20...9ef82ba * [9ef82bad](oxidecomputer/console@9ef82bad) oxidecomputer/console#2529 * [23beefea](oxidecomputer/console@23beefea) oxidecomputer/console#2537 * [48693a22](oxidecomputer/console@48693a22) oxidecomputer/console#2510 * [8da7b6d0](oxidecomputer/console@8da7b6d0) oxidecomputer/console#2539 * [5edf89ef](oxidecomputer/console@5edf89ef) oxidecomputer/console#2536 * [dcddc81f](oxidecomputer/console@dcddc81f) oxidecomputer/console#2538 * [6f83d416](oxidecomputer/console@6f83d416) oxidecomputer/console#2518 * [7dcd41c2](oxidecomputer/console@7dcd41c2) oxidecomputer/console#2511 * [b01ca85d](oxidecomputer/console@b01ca85d) bump omicron to latest main * [b4920b11](oxidecomputer/console@b4920b11) oxidecomputer/console#2530 * [0552b62e](oxidecomputer/console@0552b62e) oxidecomputer/console#2527 * [ca7f6e20](oxidecomputer/console@ca7f6e20) oxidecomputer/console#2528
This PR switches from the current topbar navigation — using dropdowns that are a little too clever — and moves to a more standard breadcrumb navigation.
I expect there'll be a few tweaks to make re: spacing / sizing, and making the element responsive / more intelligent about narrow viewports.
Closes #2509