Skip to content

Conversation

david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Nov 1, 2024

This more or less works already, but needs some tweaks to the route config to make it produce the correct results. The route config changes are simple, but they change the indentation, so the whitespace-hidden diff is much better.

image
  • Basic useMatches() thing works
  • Add Projects crumb
  • Add a mechanism for hiding crumbs for tab routes, or just remove the crumbs from the tabs

Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Nov 1, 2024 8:15pm

@david-crespo
Copy link
Collaborator Author

This is pretty good, though there are still a few weird things, mostly around route tabs. Also edit and create forms. I think we could do without crumbs for those. I just didn't want to change the route config too much yet.

2024-11-01-matches-breadcrumbs.mp4

Route tabs already had crumbs defined so they would show up in the page title. We can easily remove them, and I tried that, but then you end up with this weirdness with nested ones, where you can click into the router detail, where you clearly want the crumb, and then when you click back up, the crumb disappears:

2024-11-01-tab-breadcrumb-nesting.mp4

@david-crespo david-crespo marked this pull request as ready for review November 1, 2024 17:52
Copy link
Contributor

@charliepark charliepark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having trouble getting this to run locally, but the code looks good.

Edit: Seems like the tests are missing some Projects in the expected strings. I can add those in.

@david-crespo david-crespo merged commit ee3a658 into breadcrumbs Nov 1, 2024
5 of 8 checks passed
@david-crespo david-crespo deleted the match-powered-crumbs branch November 1, 2024 20:27
david-crespo added a commit that referenced this pull request Nov 10, 2024
* Most of the work to get breadcrumbs in place of top bar pickers

* Bot commit: format with prettier

* Refactor; add System page breadcrumbs

* proper arrow; spacing tweaks

* Tighten top bar by a few pixels

* No back arrow on root pages; no white link when only one item on page

* Update tests

* Style tweaks

* Fix current selected item icon alignment

* Cleanup

* Breadcrumbs powered by `useMatches()` (#2531)

* 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]>

* Update expected strings in e2e tests

* Fix multiple locator match issue, though we might change text on button

* use main to select connect button instead of connect breadcrumb

* slight refactor on system/silos crumb

* move Breadcrumbs into TopBar

* prop name systemOrSilo

* adjust main pane / footer height on serial console

* add titleOnly concept for form crumbs, apply to all routes

* --top-bar-height CSS var

* fix ssh keys and floating IP edit crumbs

* fix z-index on modal dialog overlay so it covers topbar

* Bot commit: format with prettier

* fix crumbs of pageless route nodes, very zany snapshot test for the crumbs

* use helpers to make everything a little cleaner

* write a test, find a bug!

funny how that works

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Leonard <[email protected]>
Co-authored-by: David Crespo <[email protected]>
Co-authored-by: David Crespo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants