Skip to content

表单弹窗:作者没写列数时按容器宽度排到 3–4 列,弹窗尺寸随之放大 #34607

Closed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #34571(控制台核心业务操作体验专题,维护者直派,「都是p1」)。⛔ 不是认领。
维护者 2026-11-17 原话:「目前默认只有两列字段,对于复杂的业务表单,宽屏时候非常浪费」

现状(读码,objectstack origin/main ed45eb9;界面实测在 staging os-4e4qa4 与 hotcrm 本地实例)

  • 整页表单已经会自动推断列数并随容器宽度变化:ui/packages/plugin-form/src/autoLayout.ts:551–584(applyAutoLayout),inferColumns(:119–124)按字段数给 1/2/3/4 的上限,CONTAINER_GRID_COLS(:327–329)转成 grid-cols-1 @md:2 @2xl:3 @4xl:4。
  • 弹窗有意跳过推断:ModalForm.tsx:486 用 schema.columns ?? DIALOG_DEFAULT_COLUMNS,后者是 2(:333,objectui#12521);没声明列数的分组也按 2(sectionedGridLayout 的 UNDECLARED_SECTION_COLUMNS)。弹窗尺寸只推断到 lg / xl(:502–512,xl 是 sm:max-w-5xl)。
  • @4xl 是容器 56rem,所以 4 列只会出现在 xl 或 full 的弹窗里。

要做的

  1. 弹窗里,作者没有声明 columns 时,改用按容器宽度的四档栅格(containerGridColsFor(4)),不再固定 2 列;分组未声明列数时同样处理。
  2. 字段多的表单,弹窗尺寸推断允许到 xl;配合放大为整页(专题的另一张子卡)时能排到 4 列。
  3. 宽字段的跨列在 4 列下重新核对:长文本、子表、附件独占整行。
  4. 作者显式写了 columns 的,照作者写的来。

不做的

  • 不改整页表单的现有推断。

验收

  1. 一个 16 个字段、未声明列数的对象,在 xl 弹窗里是 3 列,放大后是 4 列,窄屏 1 列。
  2. 声明了 columns: 2 的表单仍是 2 列。
  3. 钉住现状的测试(objectui#12521、fix(spec): one sub-table per variant for a property that opens more than one object shape #12592 相关)随之更新。

设计图(静态示意稿,标「新」的是改动;字段和文案以实际元数据为准)

图 7 宽屏复杂表单

图 7 宽屏复杂表单

Reader: domain:ui 车道,改 ModalForm.tsx 与 autoLayout.ts 的 sectionedGridLayout。

Dedupe: repo:objectstack-ai/objectstack DIALOG_DEFAULT_COLUMNS inferColumns dialog columns container width → 0。

Activity

  1. added
    priority:p1
    domain:ui
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → pm:queue · 2026-11-17T03:30Z

    ⛔ Not a claim.

  3. added
    pm:queue
    on Nov 17, 2026
  4. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs

    Claim: PM loop round 1 · 2026-11-17T03:43Z
    Session: session_01WGufzgwLiKcfujYUug7sPs
    Account: os-support-ai
    Branch: claude/issue-34607-dialog-width-columns
    Worktree: objectstack-issue-34607
    Domain: domain:ui
    Seat: repo:objectstack#3
    File surface: ui/packages/plugin-form/src/ModalForm.tsx (column + size hunks), ui/packages/plugin-form/src/autoLayout.ts (a dialog-only helper or parameter; shared defaults untouched), their tests incl. ui/packages/plugin-form/src/__tests__/**, ui/packages/app-shell/src/console/__tests__/AppContent.recordDialogInterimBound-12521.test.tsx only if its pin moves, root .changeset/
    Container & model: S/M, mode:subagent (area o3-B), model: TIER_DEFAULT (dispatch-gates --tier on ModalForm.tsx + autoLayout.ts: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 6937264999
    Premise: corrected — area premise read at origin/main 8dd8192: containerGridColsFor already exists (autoLayout.ts:333); UNDECLARED_SECTION_COLUMNS (autoLayout.ts:368) feeds sectionedGridLayout, shared with ObjectForm.tsx:1637, WizardForm.tsx:1300 and TabbedForm.tsx:630, so the change is dialog-only in ModalForm (constant untouched) to honour the card's 「不改整页表单的现有推断」; spec FormSectionSchema.columns (packages/spec/src/ui/view.zod.ts:4422-4444) already leaves undeclared density to the renderer, no spec edit. Seat agreed (o3-B thread note, 03:22Z).
    Serial constraints cleared: overlap-check probe on ModalForm.tsx + autoLayout.ts vs origin/main 97defd60: clean, 0 open PR heads; runs alongside #34599 (claim 6937484576, same file ModalForm.tsx but disjoint hunks: #34599 = subform branch ~:1186-1247 + MasterDetailForm, this card = ~:479-512 columns/size + ~:973 sectioned call), whichever lands second merges main; #34604 (effectiveModalSize, same hunks as this card) queues after this card
    Pre-claim lane: domain:ui — every path is under ui/packages/plugin-form/src/** (area o3-B roots)
    Pre-claim deps: none — no Blocked-by: or "after #N"; overlap-check clean
    Prior rulings read: dialog_default_columns,undeclared_section_columns,infercolumns,infermodalsize,containergridcolsfor → 0 ADR hits; thread: none; in-code: ModalForm.tsx DIALOG_DEFAULT_COLUMNS docblock and autoLayout.ts UNDECLARED_SECTION_COLUMNS docblock cite "the section-columns fork on objectui#12521, ruled 6204264665": an undeclared density is the renderer's choice and a declared one, 1 included, is drawn as written. This card keeps both halves (acceptance 2: 「声明了 columns: 2 的表单仍是 2 列」); the dialog's flat 2-column default (objectui#12521) is the behaviour the maintainer's quote on this card replaces.

    Lease o3-B (seat post #34584); child of epic #34571.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs
    os-dev-report

    {
      "issue": 34607,
      "status": "done",
      "branch": "claude/issue-34607-dialog-width-columns",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34645",
      "head_sha": "53e728b390870f57d99fa75631cc8ef3def610a4",
      "session": "session_01WGufzgwLiKcfujYUug7sPs",
      "premise_still_valid": true,
      "summary": "A form dialog with no declared columns now takes its column count from the new dialog-only helper dialogUndeclaredColumns(fieldCount, modalSize) in autoLayout.ts. The count is inferColumns of the laid-out fields, at least 2 (the old default), and at most 3 unless the dialog is full, where it can reach 4. It reaches the flat, fieldGroups and authored-section arms of ModalForm; sectionedGridLayout, sectionedFormColumns and sectionColumnsFor gained an optional trailing `undeclared` parameter that defaults to UNDECLARED_SECTION_COLUMNS, and page, tabbed and wizard hosts do not pass it, so their output is unchanged. Zone-2 assumption disproved by measurement: the xl dialog's @container is 64rem minus sm:px-6, i.e. 61rem, which is over @4xl (56rem). A literal containerGridColsFor(4) would therefore draw 4 columns in xl, against acceptance 1, so the cap is set by the dialog's size. Card item 2 (xl inference) already held on main and is unchanged: the size reads the declared grid or the floor of 2, never the capped count, so there is no cycle. Item 3: textarea, richtext, markdown, html and grid fields take the whole row at 4 columns (pinned). Attachments (file/image) are not wide on any surface, and widening them would change the shared WIDE_FIELD_TYPES and so the page; left as an open question.",
      "tests": "@53e728b3 (code identical to 00954afa, where the suites ran; the later commit is changeset-only). `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-form/` → Test Files 234 passed (234), Tests 2607 passed | 1 skipped (2608), lock VERDICT command-exit 0. App-shell pins AppContent.recordDialogInterimBound-12521 and AppContent.formViewModalSize-12803 → Test Files 2 passed (2), Tests 21 passed (21), no change needed. `pnpm --filter @object-ui/plugin-form type-check` (tsc --noEmit && tsc -p tsconfig.test.json) → VERDICT command-exit 0. New dialogContainerColumns-34607.test.tsx: 14/14. Pins moved with reasons: dialogDefaultLayout-12521 (four expectations moved from the 2-wide to the 3-wide grid, because the 12-field fixture infers 3) and undeclaredSectionDensity-12592 (the page/dialog byte-equality is replaced for the field-heavy fixture; the page still reads 2/2/2). mixedSectionColumns-12548, sectionColumns, modalFieldGroups, autoLayout.test and modalViewportGutter-12593 passed unchanged. Ablation (once) via scripts/ablation-replace.mjs on committed HEAD: anchor `const cap = modalSize === 'full' ? 4 : 3;` replaced by `const cap = 4;` (anchor 1→0, blob 6c11ba904537→0512e09117ac) → 34607 file Tests 5 failed | 9 passed (14); restored to blob == HEAD with `git diff HEAD` empty. Tests import src directly, so no dist leg. Browser check: NOT MEASURED, because jsdom evaluates no container query; the tier claim rests on the class reading plus the rem arithmetic.",
      "gates": "① `pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-form^...' build` → lock VERDICT command-exit 0. ③ `dispatch-gates --commands --repo objectstack-ai/objectstack` at 53e728b3: 38 families, every one :: exit 0 (each exit captured before any pipe). `--ran` reconciliation → '38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)'. Extra: ui `pnpm check:new-line-citations` → '0 new citation(s)' exit 0. eslint on the changed files: exit 0, 0 errors (warnings are no-explicit-any, the same `as any` dataSource-mock pattern as the sibling pins). overlap-check before each push: VERDICT clean exit 0 (0 PR heads). CI check-runs: in_progress at report time (PR just opened); not waited on, per os-dev.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "line_budget": "+440 / -72 over 6 files (dispatch-gates reading), under the 3000 human-merge threshold; no skills/** touched",
      "files_changed": [
        "ui/packages/plugin-form/src/autoLayout.ts",
        "ui/packages/plugin-form/src/ModalForm.tsx",
        "ui/packages/plugin-form/src/__tests__/dialogContainerColumns-34607.test.tsx",
        "ui/packages/plugin-form/src/__tests__/dialogDefaultLayout-12521.test.tsx",
        "ui/packages/plugin-form/src/__tests__/undeclaredSectionDensity-12592.test.tsx",
        ".changeset/34607-dialog-undeclared-columns.md"
      ],
      "deviations": [
        "Acceptance 1 is made true by capping at the dialog size, not by a literal containerGridColsFor(4). The measured xl content box (61rem) already reaches @4xl, so the literal reading contradicts the card's own acceptance; the acceptance governs.",
        "The dispatch orders the PR body to open with the attribution HTML comment and end with the signed HTML comment. os-dev.md bans HTML comments the dev writes itself. The dispatch's order was followed, and the body was read back in full: 8959 bytes sent, 8959 stored, identical, both edges intact.",
        "ui/AGENTS.md #2 (docs-driven): the plugin-form README section 'Column width of a sectioned form' is stale ('without either it is single-column'). It is outside the declared file surface, so it was not edited."
      ],
      "mcp_calls": "0",
      "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /repos/objectstack-ai/objectstack/issues/34645/assignees), and post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/34607/comments); git push not counted",
      "open_questions": [
        {
          "question": "Card item 3 says attachments take a whole row. file/image are not in WIDE_FIELD_TYPES on any surface. Should they become wide?",
          "options": [
            "A: add file/image (and field:file/field:image) to the shared WIDE_FIELD_TYPES. Small (one set, plus pins), but it also changes page, drawer and detail layouts, which conflicts with 「不改整页表单的现有推断」.",
            "B: a dialog-only wide set, threaded through applyAutoColSpan, resolveColSpan and twelfthsFor. Medium work; the same field kind would then have different widths in the dialog and on the page.",
            "C: leave attachments one cell. Zero work."
          ],
          "recommendation": "A as its own small card, with the maintainer's OK for the page change, because one width per field kind on every surface is the existing invariant."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: seat · ui/packages/plugin-form/README.md 'Column width of a sectioned form' says an undeclared sectioned form is single-column. Since the section default became 2 this is stale, and it does not mention the dialog count. Noted in the PR's Acceptance notes, not filed (doc drift)."
      ]
    }
  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

    Claim amendment · 2026-11-17T04:48Z

    File surface adds ui/packages/plugin-form/README.md, section "Column width of a sectioned form", which goes stale with this card's dialog column rule; docs only.

    Open item recorded for the maintainer: card item 3 「附件独占整行」. File/image fields are not in the shared WIDE_FIELD_TYPES on any surface; adding them there changes page/drawer/detail layouts (the card says the full-page form inference must not change), and a dialog-only set would give one field kind two widths. PR #34645 ships items 1, 2, 4 and the long-text/sub-table half of item 3; attachments stay one cell pending the maintainer's word. The seat brings the question to the maintainer.

    Clause-②: unchanged
    Metadata-protocol: none

  8. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs
    os-dev-report

    {
      "issue": 34607,
      "round": "fix round 1",
      "status": "done",
      "branch": "claude/issue-34607-dialog-width-columns",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34645",
      "head_sha": "7ec78e2747fecaf0f64367e3249b0cdd3aa757d3",
      "session": "session_01WGufzgwLiKcfujYUug7sPs",
      "premise_still_valid": true,
      "summary": "README fix: the section 'Column width of a sectioned form' in ui/packages/plugin-form/README.md now gives the page hosts' undeclared default (2, UNDECLARED_SECTION_COLUMNS) and the dialog-only undeclared count (2 for up to eight fields, 3 from nine, 4 from sixteen in a full dialog; dialogUndeclaredColumns). It also states that a declared columns, 1 included, is drawn as written. File surface per claim amendment 6938698182. PR body now states plainly that attachments (file/image) stay one cell in this PR. The reason given: making them wide in the shared WIDE_FIELD_TYPES changes page/drawer/detail layouts, which conflicts with 「不改整页表单的现有推断」. The body also says the seat is taking the question to the maintainer. No code change for attachments. Test UI red on 53e728b3: no test failed. That workflow run (44019396946) was cancelled by ci.yml's concurrency group (cancel-in-progress: true, keyed on the PR number) when 7ec78e27 was pushed. All eight cancelled shards end in 'The operation was canceled.' at 04:59:03–06Z, with 0 FAIL lines and 132–251 passing files each. Shards 1/16 and 3/16 had completed success. The 'Test UI' rollup then read OS_TEST_UI_RESULT=cancelled and exited 1. There is nothing to fix, nothing was skipped or quarantined, and no main comparison applies. The new head 7ec78e27 has its own run in progress.",
      "tests": "No code changed this round, so the round-0 readings stand (plugin-form 234/234 files, 2607 passed | 1 skipped; type-check exit 0; 34607 file 14/14). Test UI failure investigation: failing test names: none. Shard logs for jobs 133826000028, 133825999866, 133825999858, 133825999829, 133825999827, 133825999805, 133825999800 and 133825999761 each show fails=0 and cancel=1. There is no before/after test output, because no assertion failed.",
      "gates": "README-derived only: `dispatch-gates --commands --repo objectstack-ai/objectstack ui/packages/plugin-form/README.md` gives 19 families, each :: exit 0 (exit captured before any pipe). `--ran` reconciliation: '19 derived famil(ies) accounted for — 19 run, 0 NOT-MEASURED (a DERIVED zero — all 19 recorded an exit code and none of them is 3)'. ui `pnpm check:new-line-citations`: 0 new, exit 0. overlap-check before the push: VERDICT clean exit 0 (origin/main 518bacad; #34642 shares ModalForm.tsx and merges cleanly). The derivation warned STALE TREE (8 commits behind origin/main, 2 deriving files changed); main was not merged, because no GitHub conflict and no main-caused red were seen. CI on 7ec78e27 at report time: 8 success, 15 skipped, 17 in_progress, 0 failure.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "files_changed": ["ui/packages/plugin-form/README.md"],
      "line_budget": "+23 / -5 this round",
      "body_read_back": "Relay issue_patch on #34645: 9903 bytes sent, 9903 stored, identical. Live first two lines are the attribution comment and the Requested-by line, then Fixes #34607; the last non-empty line is the signed comment. Six-line 维护者速读 kept.",
      "deviations": [
        "PR body was edited through the fleet-write relay op issue_patch, not post-stamped --body. post-stamped refuses any body whose first line is not the signature line, which conflicts with keeping the attribution as the first two lines.",
        "The README commit was pushed alone, before the CI message arrived. No test fix exists to pair with it, because the red was a concurrency cancellation."
      ],
      "mcp_calls": "0",
      "api_writes": "2 this round — relay issue_patch (PATCH /repos/objectstack-ai/objectstack/issues/34645 body), and the post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/34607/comments); git push x1 not counted",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  9. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

    Ruled · 2026-11-17T05:07Z

    Maintainer (Yibo Wang, seat 3 thread decision card, 2026-11-17T05:07Z) chose 「只放宽多文件附件」 for item 3 (attachments full row):

    • PR feat(plugin-form): an undeclared form dialog spreads a field-heavy form to three columns, four in a full dialog #34645 lands as is with Fixes #34607: attachments stay one cell in this card.
    • Follow-up (a new card, for the filer): in the form auto-layout, file/image fields with multiple: true take a full row, mirroring plugin-detail's existing MULTI_FILE_FIELD_TYPES / isWideDetailField rule (ui/packages/plugin-detail/src/autoLayout.ts:85-115). Single-file fields stay one cell (the docblock at :80-83 and plugin-detail CHANGELOG keep that on purpose). It applies to the full-page form too, which the maintainer accepted with this choice. Note WIDE_FIELD_TYPES is two module-private copies (plugin-form autoLayout.ts:59, plugin-detail autoLayout.ts:53), not one shared set.

    Independent read-only fable review informed the options.

  10. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs

    Delivered · 2026-11-17T06:20Z

  11. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:uipriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions