Repository navigation
Commit 26e7c75
fix(app-shell): a narrow-window toast beside the record drawer no longer covers the record's Edit and more buttons (#26426)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9KTQJ7ZVwQKvdEnGAVkSedu)_
Fixes #26418
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:窄窗口(右侧抽屉旁放不下提示)时,提示条不再只躲开抽屉自己的标题栏,而是再往下躲开抽屉里第一排按钮(记录头的「编辑」「⋯」)。
- 为什么改:1024 宽窗口里新建记录后,「创建成功」提示正好盖在「编辑」上 4 秒,用户下一步要点的按钮点不到。
- 风险与回滚:只动 `ConsoleToaster.tsx` 的窄窗口分支;宽窗口(提示放在抽屉左侧)不变。回滚即还原这一个文件。
- 先看:`ConsoleToaster.tsx` 的 `firstControlRowBottom` /
`clearanceFor`;`ConsoleToaster.drawerActionsRow-26418.test.tsx`。
- 两分钟验证:把浏览器窗口拉到约 1024 宽,打开任一对象,新建 → 创建;预期提示出现在「编辑」按钮下方,不挡「编辑」和「⋯」。
- 需要你做的:无,席位落地。
## What changes
`ui/packages/app-shell/src/chrome/ConsoleToaster.tsx`, the
objectui#11685 fallback (no room for a toast beside an open right-edge
drawer): the toaster used to drop below the drawer's own header only, so
on a 1024px window with the 720px record drawer the create-success toast
sat at y 69–123 on top of the record header's Edit (93–129) and ⋯ menu.
It now drops below the drawer's **first row of controls** too.
- The row is measured, not assumed: the topmost visible control in the
drawer outside its header (`button`, `a[href]`, form fields, and the
button / link / menuitem / tab roles), widened by every control that
overlaps it vertically (the title's star button beside a taller Edit).
The toast's top is `max(header bottom, row bottom) + 24px` on desktop
and `+ 16px` on phones, where sonner spans the toaster across the window
and the same row was covered.
- Positions are layout offsets summed up the `offsetParent` chain, like
the existing header measurement: the slide-in transform does not skew
them, and `offsetTop` ignores the body's scroll position, so a toast
raised mid-scroll still clears the row once the user scrolls back
(measured in Chromium, below).
- A control hidden with `display: none` (no `offsetParent`) does not
count. A first control in the drawer's lower half is body or footer
content, not a header row, so it does not count either: dropping below
it would push the toast off the window.
- The record renders after the drawer opens, so the hook now also
observes each open drawer's subtree (`childList`) and re-measures when
the row arrives, coalesced to one measurement per animation frame as
before.
- Wide windows are unchanged: the toast stays in the strip left of the
drawer (objectui#11685).
**Why measuring, not the drawer's bottom-right corner.** The card
offered both. The bottom-right corner of the record drawer is where
`InlineEditSaveBar` sticks (`sticky bottom-0`, Save / Cancel
right-aligned), and a failed inline save raises its error toast exactly
while that bar is up, so the corner option would move the same defect
onto Save. It would also flip the toaster to a bottom anchor, the corner
objectui#7482 keeps toasts out of. Measuring the first control row
carries no page-specific pixel and follows whatever the drawer holds.
## Tests
New `ConsoleToaster.drawerActionsRow-26418.test.tsx` (happy-dom; sizes
assigned from the card's Chromium reading, as
`ConsoleToaster.drawerClearance-11685` does):
- 1024px window, 720px drawer: the toast's rect does not intersect the
Edit / ⋯ row; desktop and phone offsets sit below the row.
- Control: 1440px window, 864px drawer keeps the toast beside the drawer
(`--offset-right: 888px`, `--offset-top: 24px`).
- A record header appended after the drawer opened still moves the
toast.
- A hidden control and a control in the drawer's lower half do not move
the toast; the same drawer with a real header row then does
(non-vacuity).
No existing test was edited.
**Ablation 1, the fix reverted** (the whole source file restored from
the merge base `436d2840`, blob `252cf760`, then restored to HEAD blob
`24ccab6c`, `git diff HEAD` empty): the new file goes 3 failed / 1
passed. The three cases above the control go red; the wide-window
control stays green, as a control should. `drawerClearance-11685` stays
6/6 green both ways.
**Ablation 2, the drawer-subtree observer removed**
(`scripts/ablation-replace.mjs`, anchor 1 → 0, restored blob == HEAD):
the late-render case and the non-vacuity leg go red (2 failed / 2
passed), so the observer is load-bearing.
## Acceptance notes
- Real-layout reading, Chromium 1024×768 and 1440×768, the actual
`ConsoleToaster` (bundled from source) over a hand-built drawer shaped
like `NavigationOverlay` (45px header, scrolling body, record header
with Edit and ⋯ arriving after the drawer opened). It is a one-off probe
and nothing re-runs it.
- Merge base, 1024 / 720: toast 644–1000 × 69–123, which is the card's
reading exactly. It covers Edit, and `elementFromPoint` at Edit's centre
is the toast.
- This branch, 1024 / 720: toast 644–1000 × 129–183, clear of Edit
(69–105 in the probe) and ⋯. `elementFromPoint` at Edit's centre is
Edit. The same reading holds with the body scrolled 60px when the toast
is raised.
- Both, 1440 / 864: toast 195–551 × 24–78, beside the drawer, unchanged.
- In a drawer whose first control is a form field (a form sheet), the
toast now sits below that first field's row instead of on it. Neither
placement is a header row, and this card does not change that case.
- The probe did not run the full Console with a backend. The two-minute
check in the summary above is that reading.
## Verification
Local, at head `e8590370`:
- `pnpm exec vitest run packages/app-shell/src/chrome/ConsoleToaster
packages/app-shell/src/chrome/consoleToasterAnchor` (from `ui/`, under
the verify lock): 5 files / 21 tests passed.
- `pnpm --filter @object-ui/app-shell type-check` (both `tsc` passes,
after building the `^...` closure): exit 0. `tsconfig.test.json`
includes `src/**/*.test.tsx`, so the new test is compiled.
- `eslint` over the two touched files: exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 34 derived families, each run with its exit
captured before any pipe: 34 exit 0. `--ran` reconciliation: "34
derived, 34 run, 0 NOT-MEASURED, 0 UNRUN" (a derived zero, every line
carries its exit code).
The full app-shell suite and every repo-wide family are left to CI
(`Test UI`, `Type Check UI`, `Lint UI`, `Lint & Repo Gates`).
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No spec change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; eslint passes on the touched files.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the maintainer summary
is in Chinese by AGENTS.md's communication rule).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmQQBJvECrfY7vVyetV
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmQQBJvECrfY7vVyetV)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 75afeff commit 26e7c75
3 files changed
Lines changed: 279 additions & 7 deletions
File tree
- .changeset
- ui/packages/app-shell/src/chrome
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 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 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
54 | 69 | | |
55 | 70 | | |
56 | 71 | | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
61 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
| |||
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
90 | 146 | | |
91 | 147 | | |
92 | 148 | | |
93 | | - | |
| 149 | + | |
94 | 150 | | |
95 | 151 | | |
96 | 152 | | |
97 | | - | |
| 153 | + | |
| 154 | + | |
98 | 155 | | |
99 | 156 | | |
100 | 157 | | |
101 | | - | |
| 158 | + | |
102 | 159 | | |
103 | | - | |
104 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
105 | 163 | | |
106 | 164 | | |
107 | 165 | | |
| |||
111 | 169 | | |
112 | 170 | | |
113 | 171 | | |
| 172 | + | |
114 | 173 | | |
115 | 174 | | |
116 | 175 | | |
117 | 176 | | |
| 177 | + | |
118 | 178 | | |
119 | 179 | | |
120 | 180 | | |
121 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
122 | 185 | | |
123 | 186 | | |
124 | 187 | | |
| |||
141 | 204 | | |
142 | 205 | | |
143 | 206 | | |
| 207 | + | |
144 | 208 | | |
145 | 209 | | |
146 | 210 | | |
| |||
0 commit comments