Skip to content

fix(masthead): keep ~/anyplot.ai visible on xs for short breadcrumbs#7891

Merged
MarkusNeusinger merged 1 commit into
mainfrom
claude/palette-header-layout-80kAQ
May 28, 2026
Merged

fix(masthead): keep ~/anyplot.ai visible on xs for short breadcrumbs#7891
MarkusNeusinger merged 1 commit into
mainfrom
claude/palette-header-layout-80kAQ

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

Reported on /palette: the page looks empty up top because on mobile the masthead bar drops the ~/anyplot.ai root marker and leaves a single tiny "palette" label hanging in an otherwise empty row.

The xs-hide behavior exists so long breadcrumbs like scatter-basic-annotated · python · matplotlib don't truncate — but it's overkill for reserved single-segment pages (/palette, /about, /mcp, /stats, …).

Change

Compute the xs-effective length of the breadcrumb (using the short-form labels for lang/lib segments where applicable). When that total is under 15 chars and we're not on the landing page, keep the ~/anyplot.ai marker and its leading · separator visible on xs. Long breadcrumbs keep the existing compact behavior.

Threshold per user request: shorter than 15 chars ⇒ keep the prefix.

Examples

Route xs label length xs behavior
/palette 7 ~/anyplot.ai · palette
/about 5 ~/anyplot.ai · about
/mcp 3 ~/anyplot.ai · mcp
/scatter-basic 13 ~/anyplot.ai · scatter-basic
/scatter-basic-annotated 23 scatter-basic-annotated (compact, unchanged)
/scatter-basic/python/matplotlib 13+2+10 = 25 (with shorts) compact, unchanged

Test plan

  • yarn test src/components/MastheadRule.test.tsx — added 2 tests covering both branches (short ⇒ inline display, long ⇒ xs display:none media query)
  • yarn test — all 513 tests pass
  • yarn type-check — clean
  • yarn lint — clean (2 pre-existing warnings, unrelated)
  • Visual check on mobile viewport at /palette after deploy

https://claude.ai/code/session_01H3pPMxN66vWWiD1cYS1bcz


Generated by Claude Code

On mobile, the masthead hides the `~/anyplot.ai` root marker so the
breadcrumb has room for long spec-id + lang + lib chains. Reserved
pages like `/palette`, `/about`, `/mcp` have a single short label and
end up with a tiny lone breadcrumb floating in an otherwise empty bar.

Show the root marker (and its leading separator) on xs whenever the
xs-effective breadcrumb is under 15 chars. Long breadcrumbs keep the
existing compact behavior.
Copilot AI review requested due to automatic review settings May 28, 2026 16:41
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a mobile masthead issue where short single-segment routes like /palette would hide the ~/anyplot.ai root marker on xs viewports, leaving a nearly-empty bar. The fix computes the xs-effective breadcrumb length and keeps the root marker (and its trailing separator) visible when the total is under 15 characters.

Changes:

  • Added xsBreadcrumbLength / keepRootMarkerOnXs / rootMarkerDisplay computation in MastheadRule and applied to both root marker and first separator.
  • Updated inline comments to reflect new behavior.
  • Added two tests (short-breadcrumb keeps inline display, long-breadcrumb hides at xs) using a local renderAt helper and style-tag inspection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/src/components/MastheadRule.tsx Compute xs label length, conditionally keep root marker + first separator on xs
app/src/components/MastheadRule.test.tsx Add tests for both branches via Emotion style inspection

@MarkusNeusinger MarkusNeusinger merged commit 08bd5f3 into main May 28, 2026
10 checks passed
@MarkusNeusinger MarkusNeusinger deleted the claude/palette-header-layout-80kAQ branch May 28, 2026 16:50
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.

3 participants