Repository navigation
fix(plugin-form): a section nav jump in a grouped dialog scrolls only the form - #35125
Conversation
An element scrollIntoView also scrolled the overflow-hidden dialog box when a short last section could not reach the scroller's top, moving the title and the section nav out of the dialog. The jump now scrolls the heading's nearest scroller (or the window) with scrollTo, keeping the heading's scroll margin; the dialog's form scroller is relative so absolutely positioned hidden inputs no longer overflow the dialog box. Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…lTop 0 Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 · 2026-11-18T06:00ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review (#35092) · 2026-11-18T06:03ZL1: REWORK (one must-fix, in the new e2e spec only) This is the first L1 on this PR. I read the full diff against the merge-base The fix, read against the card's 要做的.
Shape and scope.
Changeset.
Tests and evidence.
CI at this head, read from check-runs (57): 42 success, 15 skipped, none failed. But see M1: Must-fix
Should-fixNone. Notes
|
Called from page.evaluate, outside a React event, the unfold was not flushed before the next frame, so the old jump could run before the last section's hidden inputs mounted and find nothing to scroll. The harness now unfolds with flushSync, and both legs that run the old jump assert its frame saw the two hidden inputs. Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 delta · 2026-11-18T07:33ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 delta review (#35092) · 2026-11-18T07:35ZL1: ACCEPT This is a delta read from my REWORK 6970568129 at M1, closed.
CI at this head, read from check-runs (53): 40 success, 13 skipped, none failed, none in progress. Must-fixNone. Should-fixNone. Notes
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Landing · 2026-11-18T07:36Z
Open findings: notes N1, N2 of the first L1 only. State: ready + auto-merge armed by area o1-B (lease Dev-effort: medium · Rounds: 2 |
Requested by Warren · project thread
Fixes #35092
Clause-②: no
Metadata-protocol: none
维护者速读
scrollTo),不再用元素级scrollIntoView;弹窗表单区滚动盒加relative,让复选框、下拉框的隐藏原生 input 被它裁剪、随它滚动。ui/packages/plugin-form/src/FormSectionNav.tsx(新函数scrollToHeading的滚动距离计算)、ui/packages/plugin-form/src/ModalForm.tsx(表单区relative)、ui/e2e/form-section-nav-dialog-scroll-35092.spec.ts(缺陷复现腿)。What changes
FormSectionNav: a click scrolls the section heading's own scroller (the nearest ancestor whoseoverflow-yisautoorscroll, found by the file's existingscrollParentOf; the window when there is none) withscrollTo({ top, behavior: 'smooth' }). The distance is the heading's offset below the scroller's padding edge, less the heading'sscroll-margin-top(the heading'sscroll-mt-2) and the scroller'sscroll-padding-top, whichscrollIntoViewhonoured too. The element-levelscrollIntoViewis gone from the jump: it scrolls every scrollable ancestor, the dialog'soverflow: hiddenbox included, which is what moved the dialog off its title and navigation when the form's scroller could not bring a short last section to its top.ModalForm: the form body scroller isrelative. The absolutely positioned hidden inputs in a form (a Radix checkbox's native stand-in, a Radix select's hiddenselect) took the fixed dialog as their containing block, escaped the scroller's clipping and overflowed the dialog box; now they are clipped by the scroller and scroll with it. Card item 2 (the defence) is included: no regression found. Every otherabsolutein the field widgets sits inside its ownrelativewrapper (icons, counters), and popovers render through portals, so none of them changes containing block.atBottom/jumpedTo), section folding and the required counts.Tests
ui/packages/plugin-form/src/FormSectionNav.test.tsx: the existing jump assertions now pinscrollToon the form scroller (the ModalForm cases, with the scroller's and dialog box's overflow given inline because the test DOM loads no stylesheet) or on the window (the full-page ObjectForm case), each with the expected distance, andscrollIntoViewnever called. A new top-level describe pins, on the shared fixture now wrapped in anoverflow: hiddenbox: the distance from any scroll position, the kept scroll margin, and a short last section asking only the scroller.ui/e2e/form-section-nav-dialog-scroll-35092.spec.ts(Chromium, CI's E2E project): the realFormSectionNavbundled from source, the dialog's class strings read out ofmobile-dialog-content.tsx,ModalForm.tsxandform.tsx, real Tailwind. Six sections, the last four folded, the last one two checkboxes with Radix-style hidden inputs. Legs: the defect reproduced (old jump, scroller withoutrelative: dialog box overflows and scrolls, title moves); every entry in turn at a desktop and a zoomed-in viewport (dialogscrollTop0,scrollHeightequal toclientHeight, title, navigation and footer unmoved, highlight on the clicked entry); the last short section alone; and each half of the fix alone holding the dialog box at 0.Acceptance notes
ObjectForm, itssticky top-0navigation) was not measured in a browser, as on the card. The jump there now scrolls only the nearest scroller instead of every scrollable ancestor; the window case is pinned by the unit test.ui/AGENTS.mdcommandment 2 (README and docs page per feature): not applicable to this behaviour fix; no documented surface changes.Verification
All readings on head
fbeab193.Unit: FormSectionNav.test.tsx, 14/14
Ablation (unit): the jump put back to an element scrollIntoView, 6 red, restored
node scripts/ablation-replace.mjs --file ui/packages/plugin-form/src/FormSectionNav.tsx --anchor 'if (heading) scrollToHeading(heading);' --replacement 'heading?.scrollIntoView?.({ block: "start", behavior: "smooth" });'on the committed fix. The test imports the component by relative path (vitest resolves@object-ui/plugin-formtosrc), so no build sits between the mutation and the run.The six red: the three host cases (ModalForm jump, collapsed unfold, ObjectForm) and the three new #35092 cases.
E2E: 6/6 in Chromium; ablation of the jump reds the leg it should
Run locally with a throwaway config (no
webServer, Chromium from/opt/pw-browsers), deleted afterwards; CI runs it underplaywright.config.ts --project=chromium.Same ablation as above, under the e2e: only "either half alone is enough: the new jump without the positioned scroller leaves the dialog box at 0" goes red (5 passed, 1 failed), the expected direction, since the other legs keep the
relativescroller; restored to the HEAD blob.Gates
pnpm --filter @object-ui/plugin-form run type-check: exit 0 (tsconfig.test.jsonlistsFormSectionNav.test.tsx).node scripts/pm/dispatch-gates.mjs --commands: 38 derived families, all 38 run, each exit 0 (includingpnpm --dir ui exec vitest run scripts/: 171 files passed, 2 skipped);--ranreconciliation 38/38, 0 unrun.pnpm check:changeset-fixed: exit 0.node scripts/pm/overlap-check.mjs: clean.Authored by session_01JQwxbYRqkDAGuse5Wqbohi (seat repo:objectstack#1, account os-warren).
🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi