Repository navigation
Commit 941c78a
feat(spec)!: a field-heavy task flow on desktop derives a bounded modal; mobile keeps full-screen (#23747)
Fixes #23734
Clause-②: no
The spec half of objectstack-ai/objectui#12521 ruling `6203721639`
(letter B, maintainer 「B (推荐)」): `deriveRecordFlowSurface` now derives,
for a field-heavy task flow on desktop, a **bounded** modal (`size:
'auto'`, so the renderer's `lg` / `xl` bound applies); a mobile posture
keeps the full-screen modal.
## What changed
- `packages/spec/src/data/record-surface.ts`: the task-flow arm. When
the base derivation says `'page'` (field-heavy, or mobile), a task flow
(`create` / `edit` / `child-create` / `child-edit`) answers `{
container: 'overlay', surface: 'modal', size }` with `size: 'full'` only
for `viewport: 'mobile'` and `size: 'auto'` otherwise. No new parameter,
export or type member: the mobile posture was already the `viewport`
input, and `RecordFlowSurface.size` was already `'auto' | 'full'`. The
docblock states the viewport split and the no-subtable-split reading,
and carries a dated amendment line on the #2604 D1 statement it cites
(the original D1 sentence is kept, not rewritten).
- `packages/spec/src/data/record-surface.test.ts`: the pins that
asserted `size: 'full'` for a heavy desktop task flow are flipped to
assert `size: 'auto'` (heavy task flows, the fat `child-edit` child, the
`pageThreshold` case, now a full `toEqual`). Added: an explicit
`viewport: 'desktop'` leg, heavy-on-mobile stays `'full'`, and a heavy
form with an embedded line-items table (a `repeater` field) takes the
same bounded modal on desktop and full-screen on mobile.
- `.changeset/23734-heavy-flow-bounded-modal.md`: `@objectstack/spec`
minor, BREAKING line with the FROM / TO table and the one-line fix
(`navigation.size: 'full'` or `FormView.modalSize: 'full'` for an object
that genuinely needs full-screen on desktop), ADR-0087 disposition
`not-required (no-migration-prescription)`.
## Premise measured first (ruling item 2)
The ruling asked whether #2604 D1 chose full-screen for a field-heavy
task flow with an embedded child or line-items table. Read on
objectstack#2604 (design comment `4884632356`, the D1 table and its
scope note):
> | `'page'`(字段多) | 整页 **route** | **全屏 modal**(`size:'full'`)—— 同样大画布 +
overlay 返回语义 |
> (此处"子表" = 详情页 related list(`relatedList`,#2594);表单内写侧 `inlineEdit`
网格本就与父表单原子提交,不在本设计范围。)
D1 sized task flows by authorable field count alone, and its own scope
note puts the in-form `inlineEdit` (line-items) grid outside the design.
The derivation's input is the object def, so it never sees an embedded
grid either. D1 therefore never chose full-screen *for* that case: the
split the ruling conditions on does not apply, and the bounded modal
covers every field-heavy desktop task flow. A test states this. No fork
is reported to objectui#12521.
## Consumers swept
`git grep -n "deriveRecordFlowSurface"` across the repo (`packages`,
`examples`, `content/docs`, `skills`): the only callers are
`record-surface.ts` and its test. The other hits are the generated
`api-surface` / `export-origins` rosters (unchanged: no export moved)
and `content/docs/releases/v12.mdx` (release-owned, not edited). The
console consumer (objectui `AppContent.tsx`, keyed on `size === 'full'`)
is in objectui#12521 / objectui PR 12546; no objectui file is touched
here.
## Verification (at `c5defce`)
- `pnpm --filter @objectstack/spec build` :: exit 0; `pnpm --filter
@objectstack/spec typecheck` :: exit 0.
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
src/data/record-surface.test.ts` :: 15 passed.
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2`
(whole package) :: 21808 passed, 1 todo, exit 0.
- `pnpm --filter @objectstack/spec check:generated` :: all 14 generated
artifacts up to date (no regeneration needed: the docblock is not a
`.describe()`).
- Ablation, two legs, through `scripts/ablation-replace.mjs` (anchor hit
x1, blob changed, restored to the HEAD blob with `git diff HEAD` empty):
size forced to `'full'` everywhere: 4 failed / 11 passed; size forced to
`'auto'` everywhere: 2 failed / 13 passed (the mobile legs).
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 84 derived commands, run locally with exit
codes recorded; `--ran` reconciliation: 84 accounted, 83 run, 1 NOT
MEASURED. Three gates first exited 3 on prerequisites (shallow clone,
unbuilt `@objectstack/formula` / `@objectstack/objectql`) and were
re-run green after fetching the pinned fixture commit and building those
two packages. NOT MEASURED: `pnpm check:dual-build-cjs-loads` (needs
every package's `dist`; CI runs it).
## Acceptance notes
- `skills/objectstack-ui/rules/navigation.md` (Record Presentation,
"Surface (page vs drawer)") says a field-heavy object opens
create/edit/detail as a **full page**. That was already inexact before
this change (create/edit has been a full-screen modal since #2604), and
it is now a bounded modal on desktop. Not edited here: `skills/**` is a
governed surface outside this card's claimed file surface. Drift only,
no runtime or authoring consequence (the paragraph tells authors not to
set the surface). Carrier: none.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FaR7ExTuo2XxtaZH3xKJ1e)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01FaR7ExTuo2XxtaZH3xKJ1e
Co-authored-by: Claude <noreply@anthropic.com>1 parent 29c7157 commit 941c78a
3 files changed
Lines changed: 73 additions & 11 deletions
File tree
- .changeset
- packages/spec/src/data
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| |||
86 | 103 | | |
87 | 104 | | |
88 | 105 | | |
89 | | - | |
| 106 | + | |
90 | 107 | | |
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
94 | 111 | | |
95 | 112 | | |
96 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
97 | 117 | | |
98 | 118 | | |
99 | 119 | | |
100 | 120 | | |
101 | 121 | | |
102 | 122 | | |
103 | | - | |
| 123 | + | |
104 | 124 | | |
105 | | - | |
| 125 | + | |
106 | 126 | | |
107 | 127 | | |
108 | 128 | | |
109 | 129 | | |
110 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
111 | 133 | | |
112 | 134 | | |
113 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
| |||
145 | 160 | | |
146 | 161 | | |
147 | 162 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
151 | 169 | | |
152 | 170 | | |
0 commit comments