Repository navigation
Commit 9212119
fix(components): a record page's stuck tab strip is a solid bar, flush with the page top (#35501)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg6v19uPsX6gX42G8tGcvvzb)_
Fixes #35414
repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户看到的变化:在记录页向下滚动时,吸在顶部的「明细 / 相关 /
互动」页签条是实底(与页面底色一致,浅色深色主题各用自己的底色),下边线保留;下面滚过的卡片不再透出来压在页签文字上,页签条上方也不再露出一截滚过的内容。
- 为什么:原来页签条是半透明加模糊,而且停在离页面顶边还有一段距离的位置,滚动时内容与页签文字叠在一起,深色主题下尤其明显。
- 如果判断错:只影响页签条吸顶时的底色和停靠位置;页签样式、顺序、竖排页签都不变,最坏情况是吸顶位置与原来一样。
- 需要您做的:无。
## What changes
All in the `page:tabs` renderer (`containers.tsx`), horizontal strips
only.
- **Solid fill.** The stuck strip's classes go from `sticky top-0 z-20
bg-background/95 backdrop-blur
supports-[backdrop-filter]:bg-background/60` to `sticky top-0 z-20
bg-background`: the theme token with no alpha and no blur, so the dark
theme gets its own page colour from the same token (no hard-coded
colour). The bottom rule (the strip's inset shadow) is untouched; tab
style, order and vertical tabs are untouched.
- **The strip above it — the cause.** The record page's scroller is
padded (`p-3 sm:p-4 lg:p-6` on the page scroller in `RecordDetailView`).
Chromium sticks a `top: 0` box at the scroll container's padding edge,
not its visible edge, so the stuck strip hung 12 to 24px below the top
and the cards scrolling past showed in that gap. Measured in the
preinstalled Chromium on a 24px-padded scroller scrolled 600px: scroller
top 50, sticky box top 74 with `top: 0`; 50 and 50 with `top: -24px`.
- **The fix for it, without moving other layouts.** A small hook,
`useStickyTopInset`, finds the strip's sticky scroll container (the
nearest ancestor whose overflow is not visible or clip, the same box the
browser sticks it in) and sets the strip's `top` to minus that
container's top padding, re-read on the container's resize and on window
resize (the padding changes at breakpoints). An unpadded host, or a page
that scrolls at the document root, measures 0 and the strip keeps plain
`top-0`, so nothing moves there. Before the first measure the strip is
at today's `top-0`. The offset only applies while the strip is stuck; at
rest the strip is where it was. The page scroller itself is not edited.
## Tests
<details><summary>Pins (a new top-level describe in the existing strip
harness)</summary>
`page-tabs-overflow-cue-27521.test.tsx`, describe "the stuck strip is a
solid bar flush with its scroller top":
- the horizontal strip carries `sticky`, `top-0`, `z-20`,
`bg-background`, no alpha-suffixed `bg-background` class, no `backdrop`
class, and keeps its bottom-rule shadow;
- inside a scroller with 24px top padding the strip's `top` is `-24px`;
- after the scroller's padding becomes 12px and the window resizes,
`top` is `-12px`;
- CONTROL: an unpadded scroller leaves `top` unset;
- CONTROL: a vertical strip is never sticky and never offset.
The file also gains the module-top `import '@object-ui/react-runtime'`
that `check:test-source-alias` prescribed for an edited harness reaching
`react-page`.
</details>
<details><summary>Runs</summary>
- Dependency closure: `pnpm --workspace-concurrency=2 --filter
'@object-ui/components^...' build` → lock `VERDICT command-exit 0`.
- `pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/`
then `pnpm --filter @object-ui/components run type-check` (tree
7de836e) → `Test Files 487 passed | 1 skipped (488)`, `Tests 4671
passed | 24 skipped (4695)`, type-check script echoed, lock `VERDICT
command-exit 0`.
- The harness file at head 14bc269 → `Tests 8 passed (8)`, lock
`VERDICT command-exit 0`.
- Ablation (fix committed, `scripts/ablation-replace.mjs`, each leg
restored to the HEAD blob with `git diff HEAD` empty): the `top` style
removed → the 24px and resize pins fail (`2 failed | 6 passed`); the old
translucent blurred class put back → the solid-fill pin fails (`1 failed
| 7 passed`).
</details>
## Acceptance notes
- When a strip has more tabs than fit, its existing edge-fade cue is a
`mask-image` on the strip itself, so in that fade band (2.5rem at the
hidden edge) the fill fades too and content under a stuck strip can show
through there. Desktop record pages with three tabs do not overflow; the
cue is not changed here. Noted, not filed.
- The card's other observation, that the strip spans only the left
column while the right column keeps scrolling beside it, is not in this
card's two items and is unchanged.
- The live record page in the running console was not driven in this
run; the geometry was read in real Chromium on a padded scroller
(above), and the pins drive the real renderer.
## Verification
<details><summary>Gates</summary>
- `node scripts/pm/dispatch-gates.mjs --commands` (tree 7de836e): 38
families, each run with its exit code recorded.
`check:test-source-alias` was red once (exit 1, the module-top import
above) and is green (exit 0) at 14bc269; the other 37 exit 0. `--ran`
reconciliation: `38 derived famil(ies) accounted for — 38 run, 0
NOT-MEASURED (a DERIVED zero ...)`.
- `pnpm check:new-line-citations` → `0 new citation(s)`.
- `node scripts/pm/overlap-check.mjs --branch=HEAD` → `VERDICT clean`.
- The wider run (lint, UI typecheck, full UI test shards, E2E, dogfood)
is left to CI.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 578d3b1 commit 9212119
3 files changed
Lines changed: 140 additions & 2 deletions
File tree
- .changeset
- ui/packages/components/src
- __tests__
- renderers/layout
| 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 | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
688 | 745 | | |
689 | 746 | | |
690 | 747 | | |
| |||
1162 | 1219 | | |
1163 | 1220 | | |
1164 | 1221 | | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1165 | 1232 | | |
1166 | 1233 | | |
1167 | 1234 | | |
| |||
1182 | 1249 | | |
1183 | 1250 | | |
1184 | 1251 | | |
1185 | | - | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1186 | 1258 | | |
1187 | 1259 | | |
1188 | 1260 | | |
| |||
1232 | 1304 | | |
1233 | 1305 | | |
1234 | 1306 | | |
1235 | | - | |
| 1307 | + | |
1236 | 1308 | | |
1237 | 1309 | | |
| 1310 | + | |
1238 | 1311 | | |
1239 | 1312 | | |
1240 | 1313 | | |
| |||
0 commit comments