feat(spec): deriveRecordFlowSurface — flow-aware record-surface derivation (#2604 Step 1)#2622
Merged
Merged
Conversation
…#2604) Decides the three open questions from #2604 (follow-up to #2578): - D1: create/edit are ALWAYS overlays, never routes — the derived 'page' surface maps to a full-screen modal (size 'full'); light objects keep a drawer. Deep-linkability belongs to state (detail route, shipped), not to transient tasks. - D2: detail → edit reuses the same edit overlay over the detail route — one edit surface everywhere; in-place field editing deferred, not rejected. - D3: subtable child create/edit = overlay over the parent detail, never a route; size derived from the CHILD object's own field count. Specifies the return-flow contract (cancel invariant, save invariant — edit never moves you, create lands on the record, child tasks never leave the parent — dirty guard, full-screen-modal history integration), the Step 1 spec helper deriveRecordFlowSurface as the one shared derivation (ADR-0085 §5), the objectui wiring plan, and the browser-verification matrix. Zero new authorable keys (ADR-0085 §2); docs-only, empty changeset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019zKcAtbtxuF9SXYgSzjk9v
…ation (#2604) Step 1 of #2604 (design decided in the issue thread; follow-up to #2578): - deriveRecordFlowSurface(def, flow, opts): 'view' keeps the shipped #2578 behavior verbatim (heavy → route/page, light → drawer overlay); task flows (create/edit/child-create/child-edit) are ALWAYS overlays — never routes — with derived 'page' mapped to a full-screen modal (size 'full'). child-* flows take the CHILD def; mobile task flows are full-screen modals. - One shared derivation (ADR-0085 §5); renderers use it as the DEFAULT only — explicit navigation.mode/size, FormView.type/modalSize, assigned page win. No new authorable key (ADR-0085 §2). - 6 new unit tests (threshold × flow × mobile × child independence × bare input); spec suite 6690 green; api-surface regenerated (+4 exports); minor changeset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019zKcAtbtxuF9SXYgSzjk9v
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 94 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
概述
#2604 的 Step 1(framework 侧),设计结论见 issue 评论(#2604 (comment)):create/edit/子表子记录一律 overlay、永不路由;派生的
'page'映射为全屏 modal。本 PR 把这张映射表落成 spec 里的单源纯函数(ADR-0085 §5 "one shared derivation"),供 objectui 侧(Step 2,另开 PR)消费。变更
packages/spec/src/data/record-surface.ts:新增deriveRecordFlowSurface(def, flow, opts)→{ container: 'route'|'overlay', surface, size: 'auto'|'full' }flow: 'view'→ 与 字段多的对象:自适应呈现表面 + 语义 field span(auto/full)+ 表单布局防呆 lint(AI-authored,ADR-0085 对齐) #2578 已上线行为逐字一致(字段多 →route/page,少 → drawer overlay);create/edit/child-create/child-edit)→ 永远 overlay:派生'page'⇒ 全屏 modal(size:'full'),轻对象 ⇒ drawer;child-*传子对象的 def(overlay 按被编辑的记录定尺寸,返回目标恒为父详情);移动端任务流一律全屏 modal;navigation.mode/size、FormView.type/modalSize、assigned Page 照旧优先。零新增可授权 key(ADR-0085 §2)。record-surface.test.ts14/14;spec 全量 6690 通过。api-surface.json再生成(+4 导出:RecordFlow、RecordFlowContainer、RecordFlowSurface、deriveRecordFlowSurface)。验证
pnpm vitest run src/data/record-surface.test.ts14/14pnpm test(spec)6690/6690pnpm build+gen:api-surface干净再生成Refs #2604 · #2578 · ADR-0085 §2/§5
🤖 Generated with Claude Code
https://claude.ai/code/session_019zKcAtbtxuF9SXYgSzjk9v
Generated by Claude Code