Repository navigation
Commit 9171bed
fix(app-shell): on a phone, the bottom bar pages scroll their last row out from under the bar (#37252)
Fixes #36792
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 手机用户在应用首页和审批页把长页面滚到底时,最后一行现在会完整停在底部导航栏上方;以前首页最底下约 33
像素被导航栏挡住、滚不出来(审批页末行压在导航栏边上约 0.67 像素)。
- 修的是手机底部导航栏下首页和审批两页的滚动留白,替手机端用户解决末行点不到、看不全的问题;通知页本来就在自己的列表里滚动,保持不变。
- 出错时最多是这两页底部多一段空白或页面布局变化;只是一处样式改动,可直接撤回。
- 无
## What changes
While the phone bottom bar is drawn (the app home, the inbox list and
the approvals inbox, below 768 px), the console inset, the element that
scrolls, keeps the bar's height as end padding. A scroll container's end
padding only follows its in-flow content. The route slot
(`data-testid="console-route"`) was a fixed `h-full` box. A page taller
than the inset (the phone app home with a long menu, or a long approvals
inbox) overflowed that slot. The scroll then ended at the page's own
bottom, and its last rows stayed under the bar.
`ConsoleLayout` now grows the route slot with its page on the bar's home
and approvals pages. The slot is a one-track grid (`grid h-auto
min-h-full grid-cols-[minmax(0,1fr)]`), so:
- it is never shorter than the inset, and a page root's `h-full` still
resolves against its stretched row. A short page or the empty state
fills the inset as before;
- it grows past the inset with a taller page. The slot is the inset's
in-flow content, so the inset's existing end padding lands after the
page's last row;
- `minmax(0,1fr)` keeps a wide page from widening the slot.
The inset's padding class is unchanged.
The inbox list keeps the fixed slot. It is an object list page: it
bounds itself and scrolls its rows in its own box (objectui#12463). A
growing slot would unbind a long list. I measured this: on a long object
list, a growing slot turned the list's own scroller into a page scroll.
Every route without the bar, and every route from 768 px up, also keeps
the fixed slot.
Responsibility:
- Whose code: the platform's own `@object-ui/app-shell` `ConsoleLayout`.
- Existing platform path: none.
- Who reaches it: phone users on a long natural-height page (the phone
app home, the approvals inbox).
Read first:
1. `ui/packages/app-shell/src/layout/ConsoleLayout.tsx`, the
`phoneSlotGrows` flag and the slot's `cn(...)`. This is the risky hunk:
it decides which bar routes grow.
2.
`ui/packages/app-shell/src/layout/__tests__/ConsoleLayout.phoneRecordOneBar-28483.test.tsx`,
the new top-level `describe` for objectstack#36792.
Two-minute check: open the showcase app home in iPhone 13 emulation and
scroll to the end. The menu's last row ends above the bottom bar's top
edge, and the bar no longer covers it.
## Tests
- The new top-level `describe('a phone bar page's end inset scrolls with
its content (objectstack#36792)')` sits in the existing ConsoleLayout
phone harness. It has three cases:
- At 375 px, the app root and the approvals inbox grow the slot (grid,
`min-h-full`, `h-auto`, no `h-full`, one `minmax(0,1fr)` track) inside
the padded `overflow-y-auto` scroller.
- The inbox list keeps the fixed slot.
- CONTROL: a list, a record page, a page route at 375 px, and bar routes
at 768 / 1440 px all keep the fixed slot.
- The existing objectstack#35882 pins assert the end padding on the
slot's parent. They are unchanged and still pass: the padding stays on
the scroller.
- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/layout/__tests__/ConsoleLayout.phoneRecordOneBar-28483.test.tsx`:
18/18 passed (15 existing + 3 new).
- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/layout/`: 164 files, 1424 tests passed.
- `pnpm --filter @object-ui/app-shell run type-check` (both tsc legs,
after building the closure `@object-ui/app-shell^...`): exit 0.
Ablation (one-off, `scripts/ablation-replace.mjs`): the fix commit is on
HEAD; the mutation reverts the flag to `const phoneSlotGrows = false &&
...`.
- Anchor x1 to x0, blob 2ae1531 to f5e6056d.
- The harness file went red: 1 failed / 17 passed, and the failing case
is the home-and-approvals grow case.
- Restored: blob 2ae1531 == HEAD, and `git diff HEAD` is empty.
## Acceptance notes
- The page root's own empty bottom padding (`pb-6` on the phone app
home) ends 1 px under the bar's top edge after the fix. The cause is
that the bar is 57 px tall (h-12, 4 px padding each side, plus its 1 px
top border), while the inset reserves 3.5rem (56 px). No content sits
there: the menu's last row ends 23 px above the bar. The same 1 px
applies to every bounded page on the bar routes today. Noted, not filed.
## Verification
Browser reading: the showcase stack (own `--fresh` backend, the
Console's Vite dev server reading `ui/` source), Chromium with
Playwright `devices['iPhone 13']` (viewport 390 x 664). On each route I
scrolled the inset to its end and read the rects. The bar spans 607 to
664 in every reading.
| Route | Reading | Before (origin/main a03c3d4) | After (this branch)
|
|---|---|---|---|
| App home | scrollHeight / clientHeight | 3037 / 616 (equals the page
height, no end padding) | 3093 / 616 (page + 56) |
| App home | menu box bottom | 640 (33 px under the bar top) | 584 (23
px above) |
| App home | page box bottom | 664 | 608 |
| Approvals inbox | scrollHeight | 753 | 809 |
| Approvals inbox | lowest drawn element bottom | 607.67 (under the bar
top) | 551.67 |
| Inbox list (control) | scrollHeight / footer "3 records" bottom | 616
/ 600 | 616 / 600 (unchanged) |
| Account list, no bar (control) | scrollHeight / slot height | 616 /
616 | 616 / 616 (unchanged) |
<details><summary>Gates (local, at b589350)</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 38 commands. All 38 were run, and
each exited 0 (exit captured per command before any pipe). The two named
in the dispatch's ui-scripts family:
- `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/`: VERDICT
command-exit 0.
- `pnpm check:type-check-debt`: exit 0, "surplus: none".
`--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.
`node scripts/pm/overlap-check.mjs
--branch=origin/claude/issue-36792-phone-bottom-inset-scroll` before
each push: VERDICT clean exit 0.
The CI-owned runs (Lint & Repo Gates, Test UI, Type Check UI, Build &
E2E UI, Live E2E UI and the rest) are this PR's check-runs.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D)_
<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYmRepQK9DkZeU7F53D -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent fc21674 commit 9171bed
3 files changed
Lines changed: 89 additions & 2 deletions
File tree
- .changeset
- ui/packages/app-shell/src/layout
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
198 | 207 | | |
199 | 208 | | |
200 | 209 | | |
| |||
393 | 402 | | |
394 | 403 | | |
395 | 404 | | |
396 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
397 | 413 | | |
398 | 414 | | |
399 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 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 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
231 | 292 | | |
232 | 293 | | |
233 | 294 | | |
| |||
0 commit comments