Skip to content

UXE-1560: Migrate Breadcrumbs to Via - #2123

Open
stephl3 wants to merge 5 commits into
evergreen-ci:mainfrom
stephl3:UXE-1560/migrate-breadcrumbs-to-via
Open

stephl3 wants to merge 5 commits into
evergreen-ci:mainfrom
stephl3:UXE-1560/migrate-breadcrumbs-to-via

Conversation

@stephl3

@stephl3 stephl3 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

UXE-1560

Description

Migrates Spruce's Breadcrumbs from LeafyGreen to Via. The Breadcrumb[] API is unchanged, so callers don't change.

  • The last crumb renders as the current page (includesCurrentPage).
  • Analytics onClicks fire through Via's onAction.
  • Labels over 30 characters keep the middle trim, with the full text in a Via Tooltip.
  • The separator is Via's / instead of a chevron.

The Tabs half of UXE-1560 is in #2124.

Screenshots

Story Before After
Default breadcrumbs-before breadcrumbs-after
Middle crumb truncated Screenshot 2026-11-19 at 4 16 14 PM Screenshot 2026-11-30 at 5 55 19 PM
Last crumb truncated Screenshot 2026-11-19 at 4 16 40 PM Screenshot 2026-11-30 at 5 55 09 PM

Ancestor links stay blue (overriding Via's secondary text color). The other visible changes are Via defaults: the separator is / instead of a chevron, and the current page is bold.

@stephl3 stephl3 added the spruce label Nov 19, 2026
@stephl3
stephl3 force-pushed the UXE-1560/migrate-breadcrumbs-to-via branch from 880e0a3 to 1ba7e19 Compare November 19, 2026 23:02
@stephl3
stephl3 marked this pull request as ready for review November 20, 2026 00:19
@stephl3
stephl3 requested a review from a team as a code owner November 20, 2026 00:19

@sophstad sophstad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wouldn't be surprised if we get feedback on the color change of the links 😅 looks nice though!!

text: "spruce",
to: "/project/spruce/waterfall",
onClick: () => actions("Clicked first link"),
onClick: action("Clicked first link"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] I know it's not new, but does this actually do anything? I couldn't find it on the storybook page.

Also could be nice to flesh out the stories a bit to reflect patches/tasks/execution tasks but not a requirement since this isn't your wheelhouse!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

does this actually do anything?

Yes! It just logs an action (in this case, a click action) in the "Actions" tab of the Storybook bottom panel. In my experience, I've mostly seen it used as an alternative to a dummy callback that fires a console.log()

align="center"
delay={0}
isDisabled={!shouldTrimMessage}
side="top"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is obviously pretty bonkers for a tooltip but it's not uncommon—anything we could do to improve this you think?

image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is this a new problem introduced by the Via Breadcrumbs? If not, I think we should handle in a separate ticket.

As for ideas, the breadcrumb text isn't intended to be for such a long string, and tooltip text is also intended to provide more concise, supplementary text. Given that, I can only think of a couple options:

  1. Is there another unique metadata param that can be used in place of task name that still fits the original requirement?
  2. Is it possible to create an abbreviated task name alongside the lengthier one when the task metadata object is created?

<ViaBreadcrumb
key={`breadcrumb-${text}`}
data-testid={dataTestId}
href={to}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, this change tipped me off to how navigation is now integrated with ViaProvider so we don't have to do all the manual as={Link} now. Wahoo!

@minnakt minnakt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry to be difficult but I want to push back on the breadcrumb color. Our manager also isn't too fond of this change. 😅 Could we style over the Via component to make the breadcrumb links blue?

@stephl3

stephl3 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

Sorry to be difficult but I want to push back on the breadcrumb color. Our manager also isn't too fond of this change. 😅 Could we style over the Via component to make the breadcrumb links blue?

Not difficult at all! Links are blue again: non-current crumbs use Via's link color and Link hover color, and the current page keeps Via's styling.

@stephl3
stephl3 requested review from minnakt and sophstad December 1, 2026 01:56
Render Via Breadcrumbs/Breadcrumb instead of LeafyGreen Tooltip plus a
hand-rolled chevron list. The Breadcrumb[] API stays the same, so the
Task and Version page callers don't change.

- The last crumb is always the current page in Spruce, so the trail
  sets includesCurrentPage.
- Analytics onClick handlers fire through Breadcrumbs onAction, keyed by
  crumb index, because Via's Breadcrumb has no onClick.
- Via truncates long labels with its own tooltip, so the 30-character
  middle trim and the breadcrumb-tooltip test id are gone. The e2e
  assertion that matched the trimmed text now matches the full message.
- The story used the actions() factory, which never logged; it now uses
  action().
Via only lets the last crumb shrink, so a long commit message in the
middle crumb overflowed the nav instead of truncating with a tooltip.
Let every crumb shrink until UXE-1485 fixes it in Via.

Click the link inside each crumb in e2e rather than the li centre, and
cover that the current-page crumb never fires its onClick.
Use @via-ds/components/breadcrumbs rather than the package root, matching the
other per-component imports in Spruce.
Labels over 30 characters are trimmed from the middle again, with the
full text in a hover tooltip, as before the migration. The tooltip is a
Via Tooltip inside the crumb; Via's own truncation tooltip never shows,
because a trimmed label doesn't overflow.

Trimmed labels can't overflow the nav, so the UXE-1485 flex-shrink
workaround is gone, and the e2e assertion matches the trimmed message
again.

The tooltip test moves the pointer once before hovering: React Aria
ignores the first pointer event in a document, which a real mouse
always generates before reaching a crumb.
Via Breadcrumbs renders every crumb link in text-secondary gray. Reviewers
want Spruce to keep the blue links it had with LeafyGreen, so non-current
crumbs use Via's link color and Link hover color. The current page keeps
Via's styling.
@stephl3
stephl3 force-pushed the UXE-1560/migrate-breadcrumbs-to-via branch from 49de733 to e339b02 Compare December 1, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants