Skip to content

fix(ui): mobile breadcrumb truncation + initial FAB lift#7283

Merged
MarkusNeusinger merged 3 commits into
mainfrom
fix/mobile-breadcrumbs-truncation
May 18, 2026
Merged

fix(ui): mobile breadcrumb truncation + initial FAB lift#7283
MarkusNeusinger merged 3 commits into
mainfrom
fix/mobile-breadcrumbs-truncation

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

Three small, related UI bugs the user hit on a single mobile session:

  1. Mobile breadcrumb truncated the lang/lib segments — at 375px the masthead showed ~/anyplot.ai · bar-tornado-sensitivi…, eating the very segments the user was currently looking at.
  2. Md+ overflow even with full breadcrumb — at 1280px on impl pages the breadcrumb still truncated to ~/anyplot.ai · bar-tornado-sensitivity · pyt… because the center """ specId.library """ echo claimed ~340px from the grid.
  3. FAB started elevated on deep links — opening a spec page directly made the quick-feedback FAB float ~hundreds of pixels above the corner for the first few hundred ms before settling.

Changes

MastheadRule.tsx

  • Grid stays 1fr auto auto until md. The center comment slot is display: none until md anyway, so giving it its own 1fr column at sm just wasted ~half the bar on whitespace.
  • Language and library segments carry a short label (py / p9 via the existing LANG_EXT and LIB_ABBREV maps used elsewhere in compact catalog tiles). Rendered with the NavBar dual-span pattern — short on xs+sm, full on md+. title= carries the full name for hover and screen readers.
  • The ~/anyplot.ai root marker (and its leading separator) is hidden on xs only. The NavBar logo any.plot() immediately below already anchors the brand.
  • The center """ specId.library """ echo is now hidden when the URL has all three segments (/:specId/:language/:library). The breadcrumb already shows all three parts; the echo is redundant and it was the load-bearing cause of the md overflow. Landing, spec hub, and language hub still show their center comment.

FeedbackWidget.tsx

The lift effect used footer.getBoundingClientRect().top to detect overlap and only recomputed on scroll / resize. Neither fires while React hydrates and the spec data + images stream in — so on deep links the footer briefly sat high in the layout and the FAB lifted dramatically before content arrived and pushed the footer below the fold. Add a ResizeObserver on document.body that re-runs the same RAF-batched update on layout changes.

Results

Viewport Route Before After
375 (xs) impl page ~/anyplot.ai · bar-tornado-sensitivi… bar-tornado-sensitivity · py · p9
700 (sm) impl page ~/anyplot.ai · bar-tornado-sensitivi… ~/anyplot.ai · bar-tornado-sensitivity · py · p9
1280 (md) impl page ~/anyplot.ai · bar-tornado-sensitivity · pyt… ~/anyplot.ai · bar-tornado-sensitivity · python · plotnine (center hidden)
1280 (md) spec hub unchanged unchanged (<!-- specId --> still shown)
any landing unchanged (xs hides logo, see below) xs: main · v2.3.0 / sm+: ~/anyplot.ai · main · v2.3.0

Verified

  • tsc --noEmit green
  • Playwright + computed-style probe at 375 / 700 / 1280 — no overflow on impl pages at any breakpoint
  • FAB at transform: none when footer is below fold; translateY(-54px) when footer enters viewport (test scrolling to bottom at 375×812)

Test plan

  • Open /<long-spec>/python/plotnine at iPhone width — breadcrumb shows full spec-id + py + p9, no ellipsis
  • Same route at tablet (~700px) — ~/anyplot.ai reappears, still abbreviated
  • Same route at desktop — full breadcrumb, no center echo
  • Spec hub /<spec> at desktop — center echo <!-- spec --> still visible
  • Landing on mobile — bar reads main · v2.x.x without the leading separator
  • Hard-refresh a deep link /<spec>/python/<lib> on mobile — FAB stays in the corner from the first paint (no jumpy elevation)

🤖 Generated with Claude Code

MarkusNeusinger and others added 2 commits May 18, 2026 22:35
## Breadcrumb (MastheadRule)

At 375px the masthead showed `~/anyplot.ai · bar-tornado-sensitivi…` —
ellipsis ate the language and library segments, i.e. exactly the parts the
user was currently looking at. Two reasons:

1. `gridTemplateColumns` switched to `1fr auto 1fr` at `sm`, but the center
   comment is `display: none` until `md`. The right `1fr` therefore claimed
   ~half the bar at sm just for the theme toggle, leaving the breadcrumb
   ~290px when it needed ~360px.
2. Language (`python`) + library (`plotnine`) were always rendered in full,
   competing with a long spec-id for the limited room.

Fix:

- Grid stays `1fr auto auto` until `md`, so xs+sm give the breadcrumb the
  full remaining width (toggle still hugs the right edge).
- Language and library carry a `short` label (`py` / `p9` via the existing
  `LANG_EXT` and `LIB_ABBREV` maps already used in compact catalog tiles).
  Rendered with the NavBar dual-span pattern: short on xs+sm, full on md+.
  `title=` carries the full name for hover/SR users.
- The `~/anyplot.ai` root marker (and its leading separator) is hidden on
  xs only. The NavBar logo `any.plot()` immediately below already anchors
  the brand; the masthead becomes a pure breadcrumb on mobile.

Result at 375px:
  before: `~/anyplot.ai · bar-tornado-sensitivi…`
  after:  `bar-tornado-sensitivity · py · p9`

## FAB lift (FeedbackWidget)

On a direct deep link to a spec page the FAB appeared elevated for ~hundreds
of ms before settling at the corner. The lift effect uses
`footer.getBoundingClientRect().top` to detect viewport overlap, and only
recomputes on `scroll` / `resize` — neither fires while React hydrates and
the spec data + images stream in. During that window the footer sits high in
the layout and the FAB lifts dramatically, then drops once content loads.

Watch the body with `ResizeObserver` (in addition to scroll/resize) and
re-run the same RAF-batched update — content growth now triggers a
recompute, so the FAB stays anchored at the corner during initial layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The center `""" specId.library """` echo at md+ steals ~340px from the
`auto` grid column, leaving the breadcrumb cramped enough that the full
`~/anyplot.ai · specId · language · library` truncates with `…` even on a
1280px viewport. The echo is also redundant on impl pages — the breadcrumb
already shows all three parts.

Hide the center cell once the URL has all three segments
(`/:specId/:language/:library`). Landing, spec hub, and language hub keep
their center comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 20:39
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 three small mobile/desktop UI bugs: the masthead breadcrumb truncating on small viewports, the center comment causing overflow on impl pages at md+, and the feedback FAB lifting prematurely on deep-link hydration.

Changes:

  • MastheadRule.tsx: hide root marker on xs, abbreviate language/library segments via existing LANG_EXT/LIB_ABBREV maps, shift center slot from sm to md, and hide the center echo when on an impl route.
  • FeedbackWidget.tsx: rename onScroll to schedule and add a ResizeObserver on document.body so the lift recomputes as content streams in.

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 Adds short labels and responsive visibility rules for breadcrumb segments; hides redundant center echo on impl pages.
app/src/components/FeedbackWidget.tsx Adds ResizeObserver-driven recompute of FAB lift to avoid initial jump on deep links.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
app/src/components/MastheadRule.tsx 18.75% 13 Missing ⚠️
app/src/components/FeedbackWidget.tsx 12.50% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

After hiding the center comment on impl pages the breadcrumb still
truncated between ~900–1100px viewports: the md grid stayed
`1fr auto 1fr`, so the right column claimed ~half the bar (~360px at
920px) just to hold the theme toggle. Switching to abbreviated `python` /
`plotnine` made the content wider than the cramped breadcrumb column.

Conditionally pick the md grid:
- center visible (landing / spec hub / lang hub): `1fr auto 1fr` — keeps
  the comment visually centred.
- center hidden (impl pages): `1fr auto auto` — breadcrumb claims the
  whole row width minus the toggle button.

At 920px the breadcrumb container now measures ~670px (was ~370px) and
`~/anyplot.ai · <spec-id> · python · plotnine` fits without `…`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MarkusNeusinger MarkusNeusinger merged commit 60e1a10 into main May 18, 2026
8 of 9 checks passed
@MarkusNeusinger MarkusNeusinger deleted the fix/mobile-breadcrumbs-truncation branch May 18, 2026 20:48
MarkusNeusinger added a commit that referenced this pull request May 18, 2026
Version bump for the v2.4.0 release. Release notes will be attached to
the tag once this lands.

## Highlights since v2.3.0

- **R / ggplot2 added as the 10th library** + multi-language pipeline
(#6944, #6961, #7052). 30 ggplot2 implementations landed across
foundational plot types.
- **In-app feedback widget** (#7143).
- **Stats page** with Plausible visitors chart + daily-impl timeline
(#6608).
- **Language across the site**: `/plots?lang=` filtering, cross-language
carousel, language in URLs and titles (#7141, #7142, #7144).
- **UI polish**: pseudo-function styling for 404 / footer / empty state
/ library card (#6436); mobile fixes for `/stats`, `/mcp`, breadcrumb +
FAB (#6902, #7283).
- **Pipeline**: review-retry listener + stuck-jobs watchdog (#6084);
daily-regen 2h → hourly (#6943).
- **Dependencies**: mypy 1.20→2.1, urllib3 2.6→2.7, authlib bump,
react/mui/python-minor groups.
- ~1200 implementation regenerations across all 10 libraries.

No SemVer-breaking changes.

**Full Changelog:**
v2.3.0...main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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