Skip to content

fix(breadcrumb): keep the header trail on one line and readable on phones - #736

Draft
wemra3 wants to merge 3 commits into
mainfrom
fix/breadcrumb-narrow
Draft

wemra3 wants to merge 3 commits into
mainfrom
fix/breadcrumb-narrow

Conversation

@wemra3

@wemra3 wemra3 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of the mobile umbrella tailor-inc/platform-planning#2207 (Phase 2, "In GlobalHeaderLayout, the page title takes the space and the breadcrumb is only 15 to 30 px wide at 375 to 390 px").

In GlobalHeaderLayout.DefaultHeader the app title is shrink-0 and the breadcrumb wrapper is min-w-0 flex-1. At 375 px the title (171 px in the example) and the actions leave the breadcrumb 15 px. The list is flex-wrap, so the trail breaks into one or two characters per row and overflows the 56 px header into the content. SidebarLayout.DefaultHeader has no title, but its breadcrumb wraps the same way once the trail needs more than about 170 px.

Changes

  • GlobalHeader: the title and its divider get max-md:hidden. Below 768 px the breadcrumb has the whole left side. Cloudscape's top navigation does the same: the application name is removed on smaller screens.
  • DynamicBreadcrumb: when the trail has three or more segments, the ancestors get max-md:hidden, so phones show only the current page. Two-level trails keep both segments. This is a class on the existing wrapper, decided at render time from segments.length; no effect, observer or measurement.
  • BreadcrumbList is flex-nowrap (Carbon: "Breadcrumbs should never wrap onto a second line"). BreadcrumbItem, BreadcrumbLink and BreadcrumbPage get min-w-0 truncate, so a long title ellipsizes instead of pushing the trail out of the header. The separator is shrink-0.
  • BreadcrumbLink and BreadcrumbPage get py-0.5: the link is 24 px tall (WCAG 2.5.8 target size) around the unchanged 20 px line. The header stays 56 px.
  • Docs: one paragraph each on the GlobalHeaderLayout and DefaultHeader pages.
  • A patch changeset.

Behavior change at 768 px and wider: a trail that does not fit no longer wraps; its items shrink and truncate with an ellipsis.

Results

Measured with Playwright (Chrome, touch emulation, device scale 2) on the vite example, whose header has three action buttons (124 px). Depth 1 to 4 are /dashboard, /dashboard/orders, /dashboard/orders/ord-1001 and /dashboard/orders/ord-1001/activity.

Viewport Title (before → after) Breadcrumb box Rows at depth 1 / 2 / 3 / 4 (before → after) Visible at depth 4 (after) Link height
375 × 812 171 px → hidden 15 px → 211 px 1 / 2 / 3 / 4 → 1 / 1 / 1 / 1 "Order Activity" (91 px) 20 → 24 px
390 × 844 171 px → hidden 30 px → 226 px 1 / 2 / 3 / 4 → 1 / 1 / 1 / 1 "Order Activity" 20 → 24 px
768 × 1024 171 px (kept) 408 px (same) 1 / 1 / 1 / 1 (same) all four segments 20 → 24 px

Before, at 375 px the trail occupied y = −31 to 87 px of a 56 px header (shots/state2_phone375_header_dashboard_orders_ord-1001_activity.png in pr-a/before). After, every link is 24 px tall and sits inside the header.

Screenshots

375 px, depth 4: before (main) and after.
(pr-a/before/state2_phone375_header_dashboard_orders_ord-1001_activity.png, pr-a/after/state2_phone375_header_dashboard_orders_ord-1001_activity.png)

375 px, depth 2: both segments stay.
(pr-a/after/state2_phone375_header_dashboard_orders.png)

768 px, depth 4: unchanged except the 24 px links.
(pr-a/after/state2_tablet768_header_dashboard_orders_ord-1001_activity.png)

Checks

  • pnpm fmt, type-check, lint, test (3,092 core tests after merging main at c90cdf6), docs:sync and docs:check pass. check-dts not run (no declaration changes).
  • New tests in global-header-layout.test.tsx: a three-level route marks the title and the two ancestors with the responsive class and leaves the current page visible; a two-level route marks nothing; the list is flex-nowrap and the link has the 24 px padding. happy-dom has no layout, so the tests check the classes, and the widths above come from the Playwright run.
  • Not checked on a physical phone yet.

Not in this PR

  • Folding the hidden ancestors into a "…" menu next to the current page (Cloudscape, Carbon, Atlassian, MUI do this). On a phone the way up is the sidebar for now. Planned as the next PR once this one is in.
  • SidebarLayout measurements: the example app uses GlobalHeaderLayout only. The breadcrumb change applies to both headers.

🤖 Generated with Claude Code

Hiroki Uemura added 2 commits November 16, 2026 09:54
…ones

Below `md` the GlobalHeader hides the app title and its divider, and
DynamicBreadcrumb shows only the current page when the trail is three or
more segments deep. The breadcrumb list no longer wraps; a long page title
truncates with an ellipsis, and each link is 24px tall (WCAG 2.5.8).

Part of tailor-inc/platform-planning#2207 (Phase 2).
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (e4b5616) #736 (4dabdb5) +/-
Coverage 62.9% 62.9% -0.1%
Test Execution Time 4m29s 4m11s -18s
Details
  |                     | main (e4b5616) | #736 (4dabdb5) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          62.9% |          62.9% | -0.1% |
  |   Files             |            294 |            294 |     0 |
  |   Lines             |          13513 |          13517 |    +4 |
+ |   Covered           |           8505 |           8507 |    +2 |
+ | Test Execution Time |          4m29s |          4m11s |  -18s |

Code coverage of files in pull request scope (48.0% → 48.0%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
dist/auth-context-DKJ0CX7P.js 0.0% -46.2% - affected
packages/core/dist/auth-context-DmPZ5DAV.js 45.9% +45.9% - affected
packages/core/src/components/internals/breadcrumb/breadcrumb.tsx 87.5% 0.0% 100.0% modified
packages/core/src/components/sidebar/dynamic-breadcrumb.tsx 94.1% +0.7% 100.0% modified
packages/core/src/components/sidebar/global-header.tsx 100.0% 0.0% - modified

Reported by octocov

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

# Conflicts:
#	docs-manifest.json
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.

1 participant