Commit 60e1a10
fix(ui): mobile breadcrumb truncation + initial FAB lift (#7283)
## 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](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e10219b commit 60e1a10
2 files changed
Lines changed: 82 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
119 | 126 | | |
120 | 127 | | |
121 | | - | |
122 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
123 | 131 | | |
124 | 132 | | |
125 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | | - | |
87 | | - | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | | - | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
129 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
| |||
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
149 | 167 | | |
150 | 168 | | |
151 | 169 | | |
| |||
162 | 180 | | |
163 | 181 | | |
164 | 182 | | |
165 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
169 | 189 | | |
170 | | - | |
| 190 | + | |
171 | 191 | | |
172 | 192 | | |
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
176 | 196 | | |
177 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
178 | 200 | | |
179 | 201 | | |
180 | 202 | | |
| |||
198 | 220 | | |
199 | 221 | | |
200 | 222 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
212 | 231 | | |
213 | | - | |
214 | | - | |
| 232 | + | |
215 | 233 | | |
216 | 234 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
220 | 263 | | |
221 | 264 | | |
222 | 265 | | |
| |||
0 commit comments