Repository navigation
feat(app-shell,plugin-view,plugin-form): record task flows as derived overlays + return invariants (framework#2604 Step 2) - #2256
Merged
Conversation
…ys with return invariants (#2604) framework#2604 Step 2 (design in the issue thread; spec helper in framework#2622): - plugin-view: mirror deriveRecordFlowSurface (same consolidation TODO as the #2578 deriveRecordSurface mirror) + first unit tests for the whole recordSurface mirror. - app-shell create/edit: the global record form overlay is now URL-driven (?form=new / ?form=<id>) — browser Back closes the overlay instead of abandoning the origin route; field-heavy objects get modalSize 'full' from the flow-surface derivation. editMode:'page' opt-in unchanged. - Save invariant: edit never navigates (origin refetches in place via refreshKey); create lands on the new record's detail on ITS derived surface — drawer over the still-intact list for light objects, detail route for heavy ones (resolvePostCreateTarget, unit-tested); replace:true so Back skips the transient form entry. - Subtable (related list) child create/edit: overlay over the parent detail (never a route) — parent scroll/tab preserved, subtable refetches via notifyRelatedChanged on save; create pre-links the parent through initialValues[relationshipField]; overlay sizes to the CHILD object; ?childForm=1 marker makes Back close the overlay (payload stays in state so a refresh can never create an unlinked child). - Dirty guard: ModalForm's existing confirmOnDiscard covers Esc/X/backdrop on all of the above. Type-check 30/30 green; vitest 160 files / 1357 tests green (app-shell, plugin-form, plugin-detail, plugin-view). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019zKcAtbtxuF9SXYgSzjk9v
… record-form overlay via URL params (#2604) Browser dogfood of the first cut surfaced two defects; both fixed by moving the child task into the record-form URL contract instead of mounting a second ModalForm inside the detail page's renderer tree (which never committed its overlay): - AppContent record-form URL contract extended: ?formObject=<child> overrides the route object for the overlay; ?formLink=field:id pre-links the parent on create (refresh-safe — a reloaded child create is STILL parent-linked). The bridge's related-list New/Edit now just pushes these params; Back closes the overlay. - Child save must not go through crud_success: its refreshKey bump remounts the whole RecordDetailView and resets the active tab. Child saves now only toast + notifyRelatedChanged (subtable refetches via the existing related-changed listener) + strip the form params — the parent route, scroll and data stay untouched. - ModalForm: forward initialValues/initialData into the MasterDetailForm (subforms) branch — the parent pre-link was silently dropped for children with inline line items (e.g. invoice). Browser-verified end to end on showcase (5180 console + fresh backend): heavy create full-screen modal ?form=new, Esc/Back restore the intact list; light create-save lands on the detail drawer over the list; detail edit full modal saves back to the refetched view; account → contact child create pre-linked (Northwind chip), saves without leaving the parent route, subtable shows the child, Back closes the overlay. Dirty-guard alertdialog confirmed on Esc with typed input. Known boundary (pre-existing, filed separately): the detail page's tab strip is uncontrolled (PageTabsRenderer defaultValue), so ANY URL-param change that remounts the subtree resets it to Details — including opening/closing this overlay and the pre-existing ?recordId drawer. Durable fix is URL-driven tab state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019zKcAtbtxuF9SXYgSzjk9v
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
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
概述
framework#2604 的 Step 2(objectui 侧)。设计结论见 issue 评论(objectstack-ai/objectstack#2604 (comment));spec 侧单源派生
deriveRecordFlowSurface在 framework#2622(本 PR 用 plugin-view 本地镜像,沿用 #2578 先例,spec 发版后一起换回 import)。一句话:查看是"状态"可路由,新建/编辑是"任务"一律 overlay;取消回原地分毫不动,编辑保存不挪人,新建保存落到新记录,子表任务永不离开父详情。
变更
plugin-view
recordSurface.ts镜像新增deriveRecordFlowSurface(def, flow, opts)(view与 Dashboard-level filters follow-ups: showcase, more examples, docs, spec pairing (#2576 / framework#2501) #2578 已上线行为逐字一致;任务流永远 overlay,派生'page'⇒ 全屏 modalsize:'full';child-*按子对象定尺寸)+ 整个镜像的首批单测(补上既有缺口)。app-shell — 记录表单 URL 契约
?form=new/?form=<id>(打开压一条 history → 浏览器 Back = 关 overlay,列表滚动/筛选原样;deep link / 刷新可重开)。字段多的对象经派生得到modalSize:'full';轻对象保持既有 auto 尺寸。editMode:'page'逃生门不动。refreshKey);新建保存 → 进新记录详情(轻对象 = 列表之上的 drawer?recordId=,列表上下文天然保留;重对象 = 详情路由),replace:true让 Back 跳过临时表单态(resolvePostCreateTarget纯函数 + 单测)。navigate()到整页路由,改为推?form=…&formObject=<child>&formLink=<fk>:<parentId>—— 复用同一个全局 overlay:父记录预填(链接在 URL 里,刷新也不丢)、按子对象派生尺寸、保存后父详情路由/数据原地不动,仅子表经related-changed事件 refetch;Back 关 overlay 回父详情。plugin-form
ModalForm把initialValues/initialData转发进 master-detail(subforms)分支 —— 此前带行项目的子对象(如 invoice)会静默丢掉父预填。浏览器端到端验证(showcase,console dev :5180 + 全新后端)
field_zoo57 字段):全屏 modal(1368px=95vw、双列、textarea 整行);Esc/Back → 列表原样、参数清除product11 字段):auto 尺寸 modal;保存 →?recordId=…drawer 盖在原列表上 + 成功 toast?form=<id>全屏 modal;保存 → 回详情视图,改名即时可见confirmOnDiscard)单测:4 个包 160 文件 / 1357 全绿;turbo type-check 30/30。
已知边界(既有缺陷,另行立 issue)
详情页 tab 条(
PageTabsRenderer)是非受控defaultValue,任何 URL 参数变化引发的子树重挂载都会把 tab 重置回 Details —— 包括本 PR 的 overlay 参数,也包括早已存在的?recordId=drawer、?palette=1等。可持续修复是 tab 状态 URL 化(ADR-0054 C3),不在本 PR 范围。Refs framework#2604 · framework#2622 · framework#2578
🤖 Generated with Claude Code
https://claude.ai/code/session_019zKcAtbtxuF9SXYgSzjk9v
Generated by Claude Code