Repository navigation
fix(plugin-form): the grouped dialog section bar is a jump bar, hidden when the sections fit - #35988
Merged
objectstack-fleet[bot] merged 3 commits intoNov 21, 2026
Conversation
…den when the sections fit Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
…click marks its section Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
Contributor
Author
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对ACCEPT · head
No required item at L1. Flip ready and land. |
Contributor
Author
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Landing · area ux-2 · 2026-11-21T05:03Z
State: draft → ready + auto-merge (merge queue). |
objectstack-fleet
Bot
deleted the
claude/issue-35472-create-form-group-tabs
branch
November 21, 2026 05:25
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 21, 2026
…ts field group (#36009) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuFchBCV6Umg5wxjoKhT7QkV)_ repo:objectstack#1 · os-sales · session_01L6bhgXUMw7b8gUmNsyoXHR Fixes #35889 Slice S2 of #35889 (S1 = #35921, merged as f3c9d42). Claim 7057842463. Area b1-R2. ## 维护者速读 - **用户看到的变化**:主对象的字段分组指定了主从子表(例如报销单的「Expense Lines」分组排在「Report」和「Totals」之间)时,新建和编辑表单里这张明细表现在就出现在这个分组的位置,和记录页一致;以前(S1)它总是排在所有字段的最下面。 - **分组导航条**:表单顶部按分组跳转的导航条,现在也在明细表这一站停(例如 Report / Expense Lines / Totals)。 - **分页签表单**:明细表在分组的位置单独成一个页签,页签名用分组的名字。**向导表单**:主从向导本来就按简单表单画,跟简单表单一样放到分组位置。 - **不变的**:没有分组指定的子表(表单视图自己写的 subforms)、以及 sections 跟字段分组对不上的表单,明细表照旧在最下面;主记录和明细一次保存、合计在表单底部、展开一行的编辑框跟着明细表走。不改任何元数据写法。 - 本 PR 收尾 #35889(`Fixes`)。 ## What changes A master-detail collection that a field group of the parent places (`fieldGroups[].relatedList`) is now drawn at that group in the parent's create and edit forms, where the record page draws it, instead of below every field of the record. - **Form slots** (`ui/packages/plugin-form/src/formSlots.ts`, new). `MasterDetailForm` hands its header `ObjectForm` a runtime-only list of its collections (package-local hand-off type, not on the `ObjectFormSchema` authoring face). `placeFormSlots` lays them out among the form's sections by the record page's rule (`bodyTablePlacement`): after the sections of the groups declared before the placing group, before those declared after it; a section that names no declared group (the ungrouped bucket) counts as after every group. A layout none of whose sections names a declared group places nothing. - **Simple form** (`ObjectForm.tsx`): each placed collection becomes a `form-slot` row in the one field list, between the sections. The form renderer (`ui/packages/components/src/renderers/form/form.tsx`) draws that row as an empty full-width element; no new export. - **The slot's controls are not the header form's**: the slot element sits inside the header's `<form>`, so `FormSlotPlacement` wraps the portaled collection in a form of its own (`noValidate`, a disabled hidden default button, submit prevented). The header's `requestSubmit()` then validates only its own fields (a line cell's bad input never blocks Save with a browser bubble), a line button without a `type` (the shared `Button` sets none) never submits the header, and Enter in a line cell submits nothing: the lines behave as they did below the form, owned by no header form. The renderer's reveal of an errored field (`fieldWrapper`) skips what a host drew into this form's slot rows, while an editor inside a slot still finds its own fields. - **Section bar**: a slot row carries its group's (translated) label, once per group, and the form renderer reports a labelled slot to the host's section navigation (`FormSectionNavContext`, #34605) between the headings around it, with the slot element as its anchor. An unlabelled slot is no stop. - **Tabbed form** (`TabbedForm.tsx`): a placed collection is a tab of its own at its group's position, labelled with the group's (translated) label. A master-detail wizard is already drawn as the simple form (`ObjectForm`'s master-detail route), so it places the same way. - **The collection is drawn by `MasterDetailForm`** into the slot through a portal (`FormSlotPlacement`, a `FormSlotStore` per form in a ref), so the lines stay out of the header's React tree: a header keystroke still never re-renders them and they never re-render the header. The header reports which collections its drawn layout claims (never while it is loading), so a collection no layout claims stays in its old place below the fields, and a remounting header (after a create) does not make the lines jump below and back. An expanded row's editor opens in the same slot, beside its collection. The header scrape for the lines' `parent.*` rules skips the slot's inputs. The document totals stay at the foot of the form. - **Texts S1 left** ("below the record's fields until the form places it at the group"): `ObjectFieldGroupSchema.relatedList` describe and jsdoc, `FieldSchema.relatedList` jsdoc, the `related-list-body-table.ts` header and its describe pin, the regenerated `content/docs/references/data/object.mdx`, the acceptance line of migration entry `semantic/18.master-detail-related-list-tab-by-default`, and S1's changeset line. **ADR-0035**: one add-only note after the third note; S1's sentences are left as written (the note says which one it supersedes). - `object.form.ts`'s group help ("The parent's create and edit forms inline the table too …") makes no position claim, so it is unchanged and its bundles are not regenerated. ## Why Card #35889, acceptance line 2: 「同一个对象,加一个指向这张子表的分组并排在第二位:记录页字段区的第二个分组位置出现这张表;新建、编辑表单同一位置出现;页签里仍有它。」 S1 delivered the record page half; this delivers the form half, as agreed in the split. ## Verification Head 97afed5: main merged in after #35984 landed (three keep-both hunks in `MasterDetailForm.tsx`, nothing else). The reviews below were read at 84dc199. On the merged tree, `tsc` in plugin-form is clean and the plugin-form + form-renderer suites pass (332 files, 3354 passed / 18 skipped). - **Form ownership (L1-c should-fix)**: a DOM pin asserts every control in the slot has a form other than the header's and clicking each line button fires no header `submit` (red without the wrapper); `form-invalid-scroll.test.tsx` pins that the reveal of an errored field lands on the form's own field, not a same-named field drawn into a slot (red without the filter). Real browser (`owner-check.cjs`): 12 slot controls, 0 owned by the header; Enter in a cell and Add line make no header submit and no write; with letters in a line's Amount cell (`validity.badInput`), Create reaches the app's own check ("Amount is required", bad cells marked) with no browser bubble. Suites after the fix: 331 files, 3343 passed / 18 skipped; `tsc` clean in plugin-form and components. - **New pins (13)**: `formSlots.test.ts` (placement order, a group declared last, entry reading, nothing placed, slot store), `MasterDetailForm.groupPlacement-35889.test.tsx` (simple form between the groups around its group, an unplaced collection below the form, placed last, edit mode with loaded lines at the group and drawn once, save batch, tabbed form tab order with the collection in its tab), and one case in `form-section-nav-34605.test.tsx` (a labelled slot is a section-bar stop between the headings, an unlabelled one is not). - **Ablation**: dropping the placement (the header claims nothing) turns 4 of the DOM pins red; dropping the slot from the section-bar report turns the nav pin red. Restored, green. - **Suites**: `vitest run packages/plugin-form packages/components/src/renderers/form` 331 files, 3335 passed / 18 skipped; after merging main, `FormSectionNav` (#35988) + `ModalForm` + the new pins 8 files / 63 passed. `packages/spec` tests green; `check:generated` clean after the object.mdx regeneration. - **Static**: `tsc --noEmit` clean in plugin-form and components; eslint on the changed files 0 errors. - **Browser** (real Console on the showcase expense report, New form; light and dark at 1280 px, light at 375 px): - default form: Report section, then the Expense Lines grid inside the form; - with a temporary, uncommitted Totals field: Report, Expense Lines, Totals in that order, and the section bar reads Report / Expense Lines / Totals; - temporary tabbed form view: tabs Report / Expense Lines / Totals, the grid in the Expense Lines tab; - temporary wizard form view: drawn as the simple form, same order. All temporary edits were reverted before commit. Clause-②: no Metadata-protocol: none ## DELIBERATE CORRECTION (pending release note) `Check Changeset` is red by design: this PR rewrites one line of a pending release note it did not add, because the behaviour that line describes is the behaviour this PR changes. Restoring it would republish a false sentence. - Note: `.changeset/35889-master-detail-tab-by-default.md` (S1, #35921, unreleased). - Before: "In the entry form a placed table still sits below the record's fields, where `inlineEdit` tables sit today. Moving it to its group's place in the form is a follow-up." - After: "In the entry form a placed table sits at its group's place too: between the sections of the groups around it, or in a tab of its own (labelled with the group) in a tabbed form. A form whose sections name no field group keeps it below the record's fields." No other line of that note changes. The seat confirms this through its same-head contract-review record (landing-operations.md). ## Follow-ups (not in this PR) - `bodyTablePlacement` (plugin-detail) and `placeFormSlots` (plugin-form) now spell the same ordering rule twice; a shared pure helper would need a new export (spec or a shared ui package), so it is left as a candidate card rather than widening this PR. - A form section that references the placing group itself (`sections: [{ group: 'lines' }]`) still resolves to nothing (the group holds no fields); unchanged here. - After a jump, the section bar's brief highlight (`data-section-jumped`, #35988) styles heading rows only, so a jump to the table scrolls to it without the flash. - Neighbours: #35984 also edits `MasterDetailForm.tsx` (textual conflict, whichever lands second merges); #35923 edits `docs/adr/0035`. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [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: its generated artifacts are regenerated and committed. - [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. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgXUMw7b8gUmNsyoXHR <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgXUMw7b8gUmNsyoXHR --> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35472
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Which row it is (A1). The row is not the
tabbedcontent layout. With no authored form view, the console's layout resolver returns nocontentLayout(only atabbedform view maps to'tabbed'), soModalFormtakes the stacked arm: each group becomes asection-dividerheading in one form, and the form renderer reports the drawn headings intoFormSectionNavContext.ModalFormdrawsFormSectionNavfrom that report between the header and the scrolling body whenever two or more headings are reported. That component is a scroll-anchor jump bar (its own docblock: "A click scrolls to the section"; the 35092 fix made the jump scroll only the form's scroller). It was styled as underlined tabs, and when every group fit the body the jump had nothing to scroll, so only the highlight moved.Choice: (a), a jump bar made honest. The derived default is meant to stack every group (the stacked arm, the scroll spy, the error counts per section, the collapse of a trailing group); the tab strip with mounted panels already exists for an authored
tabbedlayout and is untouched. So:FormSectionNavis drawn as jump links: a#glyph and a rounded pill per entry, the current one filled, instead of underlined tabs on a baseline.scrollHeightnot aboveclientHeight), re-read through aResizeObserveron the form's field grid and the scroller plus window resize, so it comes back when a section unfolds or the window shrinks. An unmeasured box (height 0) is never judged to fit. The fit is read in a layout effect, so a fitting dialog never paints the bar first.data-section-jumpedforJUMP_MARK_MS(1.6 s); the heading row inform.tsxstyles that attribute (primary underline, tinted band, fading). A jump to a heading already in view therefore still shows where it went.ModalFormtakes the header's separator decision from the bar (onDrawnChange), so a fitting dialog keeps its header line.ObjectFormbar, so the same rules apply there.Unchanged: the authored
tabbedlayout (renderer-ownedfieldTabs, panels force-mounted), the record detail page (it rendersplugin-detailsections and never mountsFormSectionNavor the formSectionDivider), collapsed groups, the scroll spy and the error counts.Tests
ui/packages/plugin-form/src/FormSectionNav.test.tsx, a new top-level describe in the shared harness, with a recordingResizeObserverstub (the test DOM does no layout):JUMP_MARK_MS;border-bback, all four headings still drawn;ui/e2e/form-section-nav-dialog-scroll-35092.spec.ts: only the harness class list is updated for the bar's new classes (the spec compiles Tailwind for the classes it names).Acceptance notes
console:builddist.Browser reading (A4)
Headless Chromium, 1280x900, deviceScaleFactor 2, showcase app, own backend on a random port with
--fresh, Console Vite dev server pointed at it. The "before" leg swapped the three changed source files back to theirorigin/mainblobs (hash-checked) and restored them (git diff HEADempty afterwards). Screenshots:/mnt/project-files/objectstack-seat5/area-ux/ux-2/a4-35472/.showcase_category(2 groups, no authored form)showcase_categoryshowcase_account(4 groups)showcase_accountThe origin/main category reading is the card's defect: a tab-looking row whose click changes only the highlight because the body has nothing to scroll.
Verification
All readings on head
2183374funless stated.Unit: 5 affected files, 50/50
Red on origin/main (A2): new pins against the base blobs of the three source files, 5 red
The collapsed CONTROL is red on main only for its mark assertion (the fold half holds); the tabbed CONTROL is green on both trees. Restored:
git diff HEADempty.Ablation: the fit gate removed, 2 red, restored
The test imports the component by relative path (vitest resolves
@object-ui/plugin-formtosrc), so no build sits between mutation and run.E2E 35092 spec: 6/6 in Chromium
Throwaway config (no webServer, Chromium from
/opt/pw-browsers), deleted afterwards:6 passed (21.3s).Gates
pnpm --filter @object-ui/plugin-form run type-check,pnpm --filter @object-ui/components run type-check: exit 0 (tsconfig.test.jsoncompiles the test file).node scripts/pm/dispatch-gates.mjs --commands: 38 derived families, all run, each exit 0 (pnpm --dir ui exec vitest run scripts/: 172 files passed, 2 skipped;check:query-options-erasurefirst hit a 300 s local timeout under box load, rerun exit 0);--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.Authored by session_01Utp6CZrgaiMgTJCnswR6jQ (seat repo:objectstack#5, account os-bill).
Generated by Claude Code