Repository navigation
feat(plugin-form): section navigation for stacked sectioned forms - #34642
Conversation
The form renderer reports the section headings it draws (anchor id, per-section error count, collapsed state) through a new host-slot context; ModalForm draws the strip between the header and the body, ObjectForm above the sections. Shown with two or more visible sections only; tabbed forms keep their tab strip. Claude-Session: https://claude.ai/code/session_01WGufzgTZ8JB6JZFffVhT7R Co-authored-by: Claude <noreply@anthropic.com>
…ing strip Claude-Session: https://claude.ai/code/session_01WGufzgTZ8JB6JZFffVhT7R Co-authored-by: Claude <noreply@anthropic.com>
…ion navigation repeats above it Claude-Session: https://claude.ai/code/session_01WGufzgTZ8JB6JZFffVhT7R Co-authored-by: Claude <noreply@anthropic.com>
…m, which the section navigation repeats above it Claude-Session: https://claude.ai/code/session_01WGufzgTZ8JB6JZFffVhT7R Co-authored-by: Claude <noreply@anthropic.com>
…t test Claude-Session: https://claude.ai/code/session_01WGufzgTZ8JB6JZFffVhT7R Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 (seat 3, L1-a) · 2026-11-17T05:08ZL1: REWORK The code, tests, changeset and CI all hold. The one must-fix is paper only, the same kind as #34624's and #34641's: one changed file is outside the claim's file surface. No push is needed for it. Separately, the Clause-② widening includes a new Must-fix (paper only, no code change)
Should-fixNone. Readings that hold
Notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: ① Derived judgmentsPublic-surface changes the diff publishes, each judged:
② Semver level
③ Boundary flagsThe os-dev-report's
Other checks:
No must-fix, no should-fix. Nits: N1, N2, N3. Implemented-by: VERDICT: PASS |
…-a9r6j4 # Conflicts: # ui/packages/plugin-form/src/ModalForm.tsx
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 delta (seat 3, L1-a) · 2026-11-17T07:02ZL1: ACCEPT The one must-fix from 6939117084 was paper only and is now closed, and the L2 face I handed to the seat has passed. This head comes from two merges of Must-fixNone. Should-fixNone. Readings that hold
Notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Nits: N1, N2, N3. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs Landing · area o3-B (card thread #34605 hands back) · 2026-11-17T07:06Z
State change: ready for review + auto-merge (merge queue). Card #34605 closes on merge via |
Keeps the section nav strip (#34642) and the maximize switch side by side: the flat arm's header drops its bottom rule when the nav strip draws one. Claude-Session: https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzgTZ8JB6JZFffVhT7R
Fixes #34605
Clause-②: yes (widening — one @object-ui/components export + new @object-ui/i18n locale keys; no FormSchema or spec key)
Metadata-protocol: none
维护者速读
@object-ui/components(表单渲染器上报分组列表、分组标题行加稳定 id)和@object-ui/plugin-form(导航组件,接入 ModalForm / ObjectForm),外加两个 i18n 键;不动元数据、契约和服务端,也没有作者配置。只有 2 个及以上可见分组才显示;tab 布局与向导不受影响。回滚即 revert 本 PR。ui/packages/plugin-form/src/FormSectionNav.tsx(导航、滚动高亮、点击跳转);②ui/packages/components/src/renderers/form/form.tsx中sectionNavItems与SectionNavReporter(哪些分组上报、错误怎么按分组计数);③ModalForm.tsx与ObjectForm.tsx的接入点。pnpm --dir ui exec vitest run packages/plugin-form/src/FormSectionNav.test.tsx packages/components/src/renderers/form/__tests__/form-section-nav-34605.test.tsx,预期 14 个测试全部通过。What changes
@object-ui/components(ui/packages/components/src/renderers/form/):section-nav-context.ts:FormSectionNavContext(a sink,nullby default) and theFormSectionNavItem/FormSectionNavSinktypes, exported from the package index besideSuggestedFieldsContext.form.tsx: each drawn section heading row (section-divider) now carries a stableid(scoped to the form instance) anddata-form-section="<divider name>", withscroll-mt-2. When a sink is provided, the renderer reports the headings it actually draws in the stacked layout: key, label, anchor id, collapsed state, anexpand()that goes through the row's own toggle, and the count of fields in that section holding a react-hook-form error. Membership reads each divider'sfieldsclaim, falling back to position assplitAtUntitledRunsdoes; a headingless run counts for no entry. A heading itsvisibleWhenhides is not drawn, so not reported. A tabbed form reports nothing. The renderer providesnullto its own descendants, so a nested form never reports into the host's sink. Unmounting reportsnull. No sink: nothing changes, andformState.errorsis not subscribed.@object-ui/plugin-form:FormSectionNav.tsx:useFormSectionNav()(a sink plus the reported items) and<FormSectionNav items>, which renders nothing below two items. Otherwise a<nav aria-label="Form sections">strip of buttons; the current entry carriesaria-current="true", an entry with errors carriesdata-errorand· N(with screen-reader text "Fields to fix: N"). Click: expand if collapsed, thenscrollIntoViewthe heading row on the next frame; the clicked entry turns current and the scroll spy is held off briefly so it does not flicker through the sections in between. Scroll spy: the nearest scrolling ancestor, rAF-throttled; at the bottom the last entry is current. In a narrow dialog the strip scrolls horizontally and keeps the current entry in view.ModalForm.tsx: the plain (non-subform) dialog provides the sink and draws the strip betweenDialogHeaderand the scrolling body (the header drops its bottom border while the strip is drawn).ObjectForm.tsx(sectioned simple form): the strip sits above the form,sticky top-0.@object-ui/i18n:form.sectionNavandform.sectionNavErrorsin all 11 locales.No FormSchema, view or spec key; nothing is configured.
Why
The card: a long sectioned form refuses a submit and the user cannot tell which section holds the problem. The navigation makes each section one click away and marks the sections that need fixing.
Acceptance notes
FormSectionNav.test.tsx(four entries under the dialog title, the third scrolls to the third section's heading row; an empty required field in section two shows1after submit; one section draws no strip), and read in a browser (below).getByText, which now finds two matches (the strip repeats the names). Each is scoped to the form (within(form)), test-only; one of them is in@object-ui/app-shell(DataPillar.formViewLayout-30057.test.tsx), widened by the seat.Verification
Readings against head
3e9036363c(base8dd8192c, merged forward withorigin/mainat31096af8).Before / after (browser)
A throwaway probe page served by the console's Vite dev server (not committed) mounting
ModalFormandObjectFormwith an in-memory data source: a five-section create dialog "New Deal" (Overview / Forecast / Qualification / Description / Sales Strategy, the last collapsed;forecastrequired). Chromium 1280×800, driven with Playwright.8dd8192cno section strip exists in the code; the dialog header sits directly over the scrolling body, and a refused submit marks the field only inside its section.forecastempty → the Forecast entry shows· 1; filling the field clears it.Tests
Run from the repository root with
ui/as vitest root, underscripts/pm/os-verify-lock.sh.pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-form/ packages/components/src/renderers/form/ packages/i18n/ packages/app-shell/src/views/studio-design/DataPillar.formViewLayout-30057.test.tsx→Test Files 424 passed (424),Tests 5113 passed | 31 skipped (5144), lockVERDICT command-exit 0.packages/plugin-form/src/FormSectionNav.test.tsx(7: acceptance 1–3,visibleWhen, collapsed unfold, tabbed none, ObjectForm) andpackages/components/src/renderers/form/__tests__/form-section-nav-34605.test.tsx(7: report order and DOM ids, predicate-admitted heading, per-section error counts with a headingless run, collapsed + expand, tabbed none, nested form kept out, unmount → null).@object-ui/components,@object-ui/plugin-form,@object-ui/i18n→ lockVERDICT command-exit 0.Ablation
Through
node scripts/ablation-replace.mjs, each restored with an emptygit diff HEAD:nodes[j] != null), so hidden headings are reported → 2 tests red.null) to the renderer's descendants → the nested-form test red.Derived gates
node scripts/pm/dispatch-gates.mjs --commands(26 paths vs merge base31096af83), then--ran→40 derived famil(ies) accounted for — 40 run, 0 NOT-MEASURED.check:test-source-aliaswas red on the first run (the new components test reached@object-ui/react-runtimethrough a dynamic import); fixed with a module-top import and re-run green.node scripts/pm/check-governed-merges.mjs --branch HEAD→0 of 26 path(s) hit the register, NOT governed; size +867 / −24.Human Minimum
packages/specholds no runtime logic. (packages/specuntouched.)pnpm lintpasses. (eslint on the touched files: 0 errors.)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzgTZ8JB6JZFffVhT7R