Skip to content

feat(studio): open Studio's dashboards and reports in the app's edit state; × returns to the list - #37226

Draft
objectstack-fleet[bot] wants to merge 12 commits into
mainfrom
claude/issue-36906-dashboard-report-app-edit
Draft

objectstack-fleet[bot] wants to merge 12 commits into
mainfrom
claude/issue-36906-dashboard-report-app-edit

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36906

Clause-②: no
Metadata-protocol: none

维护者速读

  • 管理员在 Studio 的仪表盘、报表列表里点一项,会直接进入应用里的编辑状态(仪表盘进编辑态,报表打开构建器)。页头的 × 回到刚才的 Studio 列表,刷新后也一样。报表列表的「新建」进入应用的新建报表页。
  • 属于 Studio 重构专题:Studio 是某个应用的开发界面,这一步打通了 Studio 和应用之间的往返编辑。
  • 这一步也改了数据存放的位置:从 Studio 报表列表新建的报表现在存进该包(已安装的应用则存进它的定制包),回到列表就能看到,而不再存成环境级的元数据;出错会影响打开到哪里和新报表存在哪里,撤回后恢复原来的行为,已存的报表留在原处;只有草稿、还没发布的仪表盘和报表,以及已安装应用定制包里的仪表盘和报表,暂时仍打开 Studio 原来的详情页,后者等后续一张卡接入应用。
  • 无。

What changes

Epic #36890, decisions 3, 6, 13 and 15.

  • Studio opens a dashboard or a report in its app. A plain open of a dashboard or a report in Studio's list no longer shows the generic item page. It opens the item's page in an app, using the arrival state the design mode already uses: the dashboard opens in its edit state, the report opens its builder. The Studio address is replaced, not stacked, so browser Back from the app lands on the list.
  • Which app (decision 6). It is the app the author came from, when that app is one of the package's published apps, or when its menu opens the item. Otherwise it is the package's first published app. With no app, the item keeps the generic item page (decision 3). The same happens on the cross-package leg, and whenever the address asks the item page for one of its own tools (a tab, the draft review, a selection), so History and the draft door's review links still land there. The rule is shared with Studio's back link (studioBackTarget), so the two cannot disagree. It lives in a new pure module, studioAppEdit.ts, and the area's step is StudioAreaAppOpen.tsx.
  • × back to Studio (decision 15). The app address carries ?studio= with the Studio list it came from, filters and sort included. It is built and read only through studioAddress.ts (withStudioReturn, readStudioReturn) and registered as a reserved console param. The value is read as untrusted: only a Studio address on this origin is followed. While the param is present, the dashboard page and the report page draw a × that returns to that list, after a reload too. The report builder's own × does the same. Leaving unsaved edits asks first.
  • Report New (decision 13). Studio's report list New opens /apps/APP/reports/new in the app picked the same way. Its × goes back to the list, and the saved report's page keeps the way back. With no app, the area creates as before. Dashboard New is Studio 重构(3-4b):仪表盘列表的「新建」跳到应用的设计模式并直接打开「添加菜单项 → 仪表盘」(设计模式加一个到达入口) #36907's, untouched.
  • Where that new report is saved. Opened from Studio, the new-report page saves the report into the app's package, the way a new view made in an app is saved (resolveRuntimeCreatePackage): the package when it is writable, else its .custom pair through the ensure door; when neither can be had, naming no package, as views fall back. The draft, the publish and the discard of a refused publish all name that package (saveAndPublishInPackage), so the report is in the list × returns to. On a read-only base whose pair door is closed (walled, or a kernel package), report New no longer opens the app page: it goes back to the list, as every create there does.
  • An item with no published version keeps the generic item page. Before handing over, StudioAreaAppOpen reads the item once, as the app reads it (published, no draft preview, ?package= the open package). No published version (a draft only: an AI draft, a create whose publish was refused), or a failed read, keeps Studio's generic item page, which is the page that opens the draft. Only then are the package's apps read.
  • A dashboard made in Studio lands in its app, and Back skips the create page. The area's own create publishes and lands on the item, which the gate forwards to the app. In a package's area, for a dashboard or a report, that landing now replaces the create page's history entry (studioCreateLandsInApp, read by ResourceEditPage), so Back from the app lands on the list. Every other type, and Setup, land as before.
  • The report builder's × and the new-report page's × ask over unsaved edits outside Studio too. Both handlers already received dirty for the Studio leg; the ask now runs before either leg.
  • No dashboard edit on a phone. useDashboardEditOffered now also requires a window at least sm (640 px) wide, the width from which the edit state's side panel is drawn. Before, only the button's CSS hid it. A landing that asks for the edit state on a narrower window is cleared and opens nothing, so neither Studio nor the design mode can put a phone into the edit state.
  • New studioReturn strings in every bundled locale. zh-Hant is regenerated from zh-Hans by its generator.

Why

The maintainer asked that dashboards and reports listed in Studio open straight into the front end's design page (epic #36890). The epic's decisions fix which app, the fallback, the report New target and the address-borne way back.

Tests

  • New studioAppEdit.test.ts: decision 6, rule by rule; the new-report variant; agreement with the back link; the app addresses.
  • studioAddress.test.ts, new top-level describe: the ?studio= builder and reader, the refusals both ways (another origin, protocol-relative, /studiox, a backslash, javascript:), and the reserved-param registry.
  • New StudioAreaAppOpen-36906.test.tsx, through the real StudioMetadataArea routes: the app picked, the arrival carried, the return address (list context kept, item-only params dropped), the replace, and every open that keeps the item page (a tab, the review, no app, the cross-package leg, other types). Also report New, and its fallback.
  • DashboardView.inPageEdit-36372.test.tsx, new describe: landing from Studio, × target, × after a reload, the dirty prompt, the phone landing (cleared, no edit, no Edit button), and an off-Studio value drawing no ×.
  • ReportView.designModeExclusion-36692.test.tsx, new describe: landing in the builder, the builder × to Studio, its dirty prompt, the page × beside Edit, and the card's check: reached with the design mode already on, no builder and no Edit, while × still goes back.
  • ReportNewPage-36692.test.tsx, new describe: × to Studio, and Save keeping ?studio=. This round: Save from Studio names packageId: P on the draft and the publish; on a read-only base it names the pair (P.custom, asked of the ensure door); CONTROL: a refusing ensure door falls back to the package-less save. × over an edit asks; declining stays with nothing sent; agreeing goes back to the Studio list (and the clean × asks nothing). Outside Studio: Save names no package and asks no package door, and × over an edit asks.
  • StudioAreaAppOpen-36906.test.tsx, this round: a draft-only dashboard row keeps the item page and reads no app; so does a draft-only report and a failed read; the area's dashboard create → Save lands on the app's dashboard and Back lands on the list; studioCreateLandsInApp rule by rule. A read-only base (readOnly, customization handed in): its dashboard row opens in the base's app; a pair-row address (/studio/BASE.custom/metadata/dashboard/X?package=BASE.custom) keeps the generic page (the starting point of Studio:以 .custom 配对包打开时,仪表盘和报表经基础包的应用打开(而不是留在通用条目页) #37237); report New opens the base app's new-report page; with the pair door walled, or no customization, report New goes back to the list.
  • ReportView.designModeExclusion-36692.test.tsx, this round: outside Studio, a clean builder × closes without asking; over an edit it asks, declining keeps the builder, agreeing closes it.
  • Ablation (one, on the behaviour change the tests pin): with the phone gate removed from useDashboardEditOffered, the phone pin fails 1/1. Restored, its blob equals HEAD's and git diff HEAD is empty.
  • This round's ablations, each through scripts/ablation-replace.mjs (anchor 1 to 0, restore proven blob == HEAD and git diff HEAD empty), are listed under Verification.

Acceptance notes

  • Read first, by risk (this round): the save hunk of ReportNewPage.tsx (where a report made from Studio is written: the package, its pair, or none), the published-version read at the top of StudioAreaAppOpen.tsx's effect, and the replace on the create landing in ResourceEditPage.tsx (shared by every type; it reads studioCreateLandsInApp, true only for a dashboard or report in a package's area).
  • Read first, by risk (first round): StudioAreaAppOpen.tsx (async app pick and replace; the fallback), the useDashboardEditOffered and arrival hunks in DashboardInPageEditor.tsx and DashboardView.tsx (the phone gate now also governs the design mode's landing), and the ?studio= reader in studioAddress.ts (an address-bar value followed by a navigate).
  • StudioMetadataArea.tsx is kept narrow: one import, the item open wrapped in StudioAreaAppGate, and the create split. Open PRs feat(studio): a permission set opens full-screen at its metadata address; the sharing overview gets its own route #37089, feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168 and feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 edit the same file in other hunks. overlap-check merges cleanly with all three at this head. Whichever lands later merges main.
  • Callers of the persistence path. runtime-metadata-persistence.ts is not changed. The new-report page now also calls two of its existing exports: resolveRuntimeCreatePackage (other callers: createRuntimeMetadata and saveAndPublishRuntimeMetadata themselves, for views only) and saveAndPublishInPackage (other callers: saveInPlace, the in-page dashboard and report Save, and setup/publicForms.ts). saveAndPublishRuntimeMetadata's other callers (objectViewViewSharing.ts, objectViewViewCrud.tsx, setup/publicForms.ts) and createRuntimeMetadata's (objectViewViewCrud.tsx, ObjectDataPage.tsx) are untouched.
  • Outside Studio, a new report is saved where it was before. The new-report page reached from the app's own reports index still saves naming no package, and asks no package door (pinned). Only the page opened from Studio's report list resolves a package.
  • Draft-only check (M2): one read, not the list row's mark. The read covers every way into the item address: a list click, a typed or shared address, and the area's create landing on the item. The list row's draft mark would cover the click only. The read is asked as the app asks it, so the two cannot disagree.
  • A pending Studio draft over a published version. The item has a published version, so it opens in the app, which shows the published version. A dashboard's edit state then refuses to open, with the existing toast 「This dashboard has unpublished changes in Studio. Publish or discard them there, then edit it here.」, so the page stays a viewer. A report's page shows the published version, and its builder opens on the pending draft's content (the report's Edit reads the stored draft layer first, authoredBuffer); the builder's Save is then refused with 「This report has unpublished changes. Publish or discard them above, then save.」, and nothing is written over the draft (the first-write pin). Either way the draft stays Studio's to publish or discard. Read from the code at this head, not walked.
  • Reload (seat ruling: keep as shipped): after a reload, × back to the Studio list survives, but the editor does not reopen. A reloaded or shared address never opens an editor by itself; that is the arrival modules' rule.
  • Card item 5 (a dashboard saved on an installed app lands in .custom) is pinned at unit level by the existing case "an installed package saves into its customization pair". It is NOT MEASURED live on HotCRM: no HotCRM checkout is in this session. That leg carries to Studio 重构(4-2):新形态的端到端测试、总走查,更新平台测试清单、文档和技能里的 Studio 地址与说法 #36910.
  • Follow-up card filed: Studio:以 .custom 配对包打开时,仪表盘和报表经基础包的应用打开(而不是留在通用条目页) #37237. In this PR, a .custom pair's dashboards and reports keep the generic item page (decision 6, rule 3); Studio:以 .custom 配对包打开时,仪表盘和报表经基础包的应用打开(而不是留在通用条目页) #37237 resolves them through the base package's apps.

Verification

Two-minute check: open Studio for a writable package with a published app, go to Reports, press New, pick a data source and a measure, name it, and Save. Expected: the report's page in the app, with a 「Back to Studio」 ×; click it, and the new report is in the Studio list.

This round's readings are at head 08107d2f (this branch with origin/main d7f299c0 merged in) unless a line names 727300e5, a head with the same tree as 427168aa before that merge.

Live walk-through, this round (per-agent stack; CRM example plus one writable package)

The stack is a fresh examples/app-crm backend (pnpm dev:crm -- --fresh) with the Console served by Vite from this branch's ui/ source, driven by Playwright as the seeded admin, at 727300e5. In this stack the CRM package is a read-only code package, so it walks the read-only base leg. A second package, created writable through POST /api/v1/packages with one published app, walks the writable leg.

Writable package (11 PASS, 0 FAIL):

  • A dashboard staged as a draft only (PUT ?mode=draft), opened at its Studio row address, stays on Studio's generic item page.
  • Studio's dashboard New, then Save: lands on /apps/PKG/dashboard/NAME with the way back to the dashboard list. The app page shows the just-published dashboard in its edit state (no 「not found」). Browser Back from there lands on the dashboard list, not on the create page.
  • Studio's report New opens the app's new-report page. After picking a data source and a measure and saving, it lands on the report's page with the way back. GET /api/v1/meta/report/NAME?package=PKG answers 200 with packageId: PKG. × returns to the report list, and the new report is in it.
  • No page errors.

Read-only CRM package:

HotCRM: NOT MEASURED, carried to #36910.

Tests
  • At 08107d2f, the seven touched test files (ReportNewPage-36692, ReportView.designModeExclusion-36692, StudioAreaAppOpen-36906, studioAppEdit, studioAddress, DashboardView.inPageEdit-36372, urlParams): lock VERDICT command-exit 0, 7 files, 99 tests passed.
  • At 727300e5, the wider set: every DashboardView* and Report* test, every ResourceEditPage* test, every runtime-metadata-persistence* test, views/studio-design/, views/studio-detail/, src/__tests__/, src/preview/, urlParams.test.ts and packages/i18n/. Lock VERDICT command-exit 0, 585 of 585 files, 5,662 passed, 13 skipped.
  • pnpm --filter @object-ui/app-shell run type-check, both programs, at 08107d2f: exit 0, 0 error TS.
  • eslint on the nine changed ui files: 0 errors. The warnings are existing ones.
  • Ablations, each through scripts/ablation-replace.mjs under the lock (anchor 1 to 0; restore proven by blob == HEAD and git diff HEAD empty). ui tests resolve src directly, so no dist leg applies:
    1. New-report page, the ask removed: the two "x over unsaved edits" pins fail (2 of 13).
    2. New-report page, dirty && dropped (asks on a clean x): the two clean-x pins fail (2 of 13).
    3. New-report page, the package resolve replaced by null: the package pin, the pair pin and the refusing-door CONTROL fail (3 of 13). The CONTROL fails because no door is asked at all.
    4. Report builder, the ask removed: the Studio dirty pin and the new outside-Studio pin fail (2 of 8).
    5. StudioAreaAppOpen, the no-published-version fallback disabled: the two draft-only pins fail (2 of 16).
    6. studioCreateLandsInApp forced to false: the create-then-Back pin and the rule pin fail (2 of 16).
    7. Report New on a read-only base, the pair-door condition removed: the closed-door pin fails (1 of 16).
Local gates (`dispatch-gates.mjs --commands`, 73 families)

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the changed files locally; the repo-wide run is CI's.)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

…it state

A Studio list's dashboard or report opens its app's page with the edit
state (or the report builder) on arrival, in the app decision 6 picks;
the address carries ?studio= so the page's x returns to the list. The
report list's New opens /apps/APP/reports/new. No app: the generic
detail, as before. The dashboard edit is not offered below sm.

Claude-Session: https://claude.ai/code/session_01QSeKYmSqW1KzbiTWCnSN1K
Co-authored-by: Claude <noreply@anthropic.com>
…ne gate; changeset and docs

Claude-Session: https://claude.ai/code/session_01QSeKYmSqW1KzbiTWCnSN1K
Co-authored-by: Claude <noreply@anthropic.com>
…cross-package leg itself

Claude-Session: https://claude.ai/code/session_01QSeKYmSqW1KzbiTWCnSN1K
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head 0a2eaf12387a3c42e1ffe5d06dfa0a002ec2c71a · 2026-11-25T05:54Z

L1 for card #36906 (Studio 3-4: dashboards and reports open in the app's edit state; report New goes to the app's new-report page). It reads the os-dev report 7153618697 and the zone note 7154065677.

  • Review method: read-only. Nothing was built or run at the seat.
  • Size: 33 files, +1,223/−42. Not governed and not Tier H, so this self-lands after ACCEPT.

What holds on reading:

  • Done-when 1: the item open is wrapped in StudioAreaAppGate (StudioMetadataArea.tsx:154). It replaces the Studio address and carries the arrival.
  • Done-when 2 (decision 6): studioAppEditSegment is now shared with studioBackTarget. Pins: studioAppEdit.test rule by rule, plus the area cases for the remembered package app, another app whose menu opens the item, and Setup with no such menu landing in the package's app.
  • Done-when 3 (decision 15): ?studio= is built and read only in studioAddress.ts, with the same-origin refusals pinned. × survives a reload on the dashboard page and the report page (both pinned).
  • Done-when 4 (decision 13): routing is pinned in StudioAreaAppOpen-36906. Where the report is saved is wrong: see M1.
  • Acceptance checks: the design-mode exclusion reached from Studio is pinned in ReportView.designModeExclusion-36692. The phone gate is pinned, with the dev's ablation.
  • Red on revert: judged by reading, every pin above goes red when its hunk is reverted.
  • Seat directions, both declared in the PR body (seat edit at 2026-11-25T05:48Z):
  • Dev's third question (where × sits): A, right-aligned, accepted. Decision 15 fixes no position, so no new header slot is needed.
  • Old addresses and bookmarks:
  • i18n: clean. The PR only adds studioReturn.{close,closeLabel,leaveConfirm} in all 11 locales, and removes nothing. No 18.6.0 key is touched, so rulings 7153171432 / 7153326968 do not apply.
  • Docs: plugin-dashboard.mdx: all five added sentences are true at this head.

Open

  • M1 (must-fix) — A report made from Studio's report list is no longer saved in the package.
    • Before this PR: the area's own create saved into the package (?package=P). On a read-only base it saved into the base's .custom pair (AreaPairedCreate). Where the pair door is closed, it did not create at all.
    • Now: New opens /apps/APP/reports/new, and ReportNewPage saves through saveAndPublishRuntimeMetadata. That function gives a package only to views (runtime-metadata-persistence.ts:574: const app = type === 'view' ? ctx.app : null), so the report is written with no package and becomes environment metadata (ADR-0146 D11).
    • The effect: Studio's list keeps only the package's and its pair's rows (scopeListRows, metadataListState.ts:273-280). The report the author just made is missing from the list × returns to, on writable packages and read-only bases alike.
    • Why the walk missed it: the live walk checked the landing and the × only. The dev's "installed app, unmeasured" note is this same defect, and it can be settled by reading.
    • Fix: give the new-report save the app's package, as views get it (resolveRuntimeCreatePackage: the package when writable, else its pair through the ensure door).
    • Pins:
      • a report saved from /apps/APP/reports/new?studio=… names packageId: P;
      • on a read-only base it names the pair;
      • CONTROL: a refusing ensure door falls back as views do.
    • Then: reword 速读 bullet 3 (S3).
  • M2 (must-fix) — A dashboard or report with no published version opens in the app on 「not found」.
    • The cause: the gate sends every plain open to the app. Outside draft preview, the app reads only published metadata (DashboardView.tsx:208-237, ReportView.tsx:143-146).
    • Who hits it: a row in Studio's list that exists only as a draft, such as an AI draft or a create whose publish was refused. It now lands on 「Dashboard not found」 or 「Report not found」 instead of the generic page that opened the draft.
    • Related path, not measured: Studio's dashboard New is still the area's own create. Its Save publishes, then navigates to the item (ResourceEditPage.tsx:2265), and the gate forwards that to the app.
      • Nothing shows that the app already serves the just-published dashboard.
      • History there is list → new → app, so Back from a miss lands on an empty create page.
    • Fix: keep the generic item page when the item has no published version (one read in StudioAreaAppOpen, or the list row's draft mark).
    • Pins: a draft-only dashboard row keeps the item page; Studio's dashboard New → Save lands on the app's dashboard. Cover the second in a unit test or the walk.
  • S1 (should-fix) — The new-report page's × over unsaved edits is not pinned. ReportNewPage.tsx:108-117 asks before leaving, but only the clean × and Save are tested. Add: × over an edit asks; declining stays with nothing sent; agreeing goes back to the Studio list. Check: removing the dirty && ask turns it red.
  • S2 (should-fix) — The changeset uses internal wording. ?studio=, STUDIO_RETURN_PARAM (a symbol of the private app-shell package), /apps/APP/reports/new, "Tailwind's sm" and "reserved console param" go into the CHANGELOG. This is the class of feat(studio): ⌘K on every Studio design page lists the package's menu and items #37108 S4, feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168 S6 and feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 S6. Say it in user terms: "the app's New report page", "a phone-width window", "the page's address remembers the Studio list".
  • S3 (should-fix) — 维护者速读 bullet 3 is wrong at this head.
    • 「出错只影响打开到哪里,不改任何数据」 is false while M1 stands, and it stays a data-placement change after the fix.
    • It is also silent that an installed app's customizations keep the old Studio page until the follow-up.
    • Reword it in plain Chinese, with no bare card number.
  • S4 (should-fix) — The report builder's × outside Studio still drops unsaved edits without asking.
    • The PR now passes dirty into that close handler (ReportView.tsx:548-558) but asks only on the Studio leg. The non-Studio leg (handleCloseBuilder, :470) closes silently.
    • The dev noted this and did not file it. Because the handler is touched here, ask on both legs, with one pin.
  • S5 (should-fix) — No test drives a read-only base through the gate. This is the feat(studio): a permission set opens full-screen at its metadata address; the sharing overview gets its own route #37089 class. Add area cases with readOnly and customization:
  • N1 — HotCRM leg and card item 5 live: NOT MEASURED (no HotCRM checkout). They carry to Studio 重构(4-2):新形态的端到端测试、总走查,更新平台测试清单、文档和技能里的 Studio 地址与说法 #36910 under the 7147006586 precedent, and the seat posts the carried-leg note with the ACCEPT. On that basis Fixes #36906 stands.
  • N2 — Declare which version the app shows when an item has a pending Studio draft over a published one. By reading, it shows the published version, and the in-page Save then meets the pending draft.
  • N3 — Stray double blank line at StudioAreaAppOpen.tsx:131-132.
  • N4 — The zone note's 52/10 of 62 predates the 2026-11-25T05:48Z body edit. Its re-runs of "PR-body guards" and "Check Changeset" both pass.

Gates

Next: one patch round for M1–M2, S1–S5 and the nits. Then the seat reads the delta and self-lands (not Tier H).

…age; a draft-only item keeps Studio's page

The new-report page opened from Studio's report list saves into the app's
package (its pair on a read-only base), as a new view made in an app is.
A dashboard or report with no published version keeps the generic item
page; a create in a package's area replaces its own history entry. The
report builder's x and the new-report page's x ask over unsaved edits
outside Studio too.

Claude-Session: https://claude.ai/code/session_01QSeKYokyE3hgberJHmAFME
Co-authored-by: Claude <noreply@anthropic.com>
…e read-only base and the x asks

Claude-Session: https://claude.ai/code/session_01QSeKYokyE3hgberJHmAFME
Co-authored-by: Claude <noreply@anthropic.com>
…name the draft-only and save-placement rules

Claude-Session: https://claude.ai/code/session_01QSeKYokyE3hgberJHmAFME
Co-authored-by: Claude <noreply@anthropic.com>
…shboard-report-app-edit

Claude-Session: https://claude.ai/code/session_01QSeKYokyE3hgberJHmAFME
Co-authored-by: Claude <noreply@anthropic.com>
…shboard-report-app-edit

Claude-Session: https://claude.ai/code/session_01QSeKYokyE3hgberJHmAFME
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head 08107d2fc4783d0cc9ca371bd77d3f3a07c53530 · 2026-11-25T09:34Z

Delta L1 for card #36906 (Studio epic #36890, zone a4-S), from the REWORK L1 7154262162 at 0a2eaf12387a3c42e1ffe5d06dfa0a002ec2c71a to this head. It reads the dev's final report 7157110199 and the zone's head note 7157161432.

  • Review method: read-only, in a throwaway worktree under the scratchpad (removed after). At this head the seat installed deps, built the six @objectstack/* packages the ui tests import, ran the touched test files, and re-ran each closed finding's pin with its fix ablated. There was no live walk at the seat.
  • Size: 34 files, +1,627/−52 (1,679 lines). Not governed, Tier S, so it self-lands after ACCEPT.
  • The delta: four commits of the PR's own (d80d7da2 fix, 2058c0d4 tests, 116911fb docs and changeset, 427168aa test import), plus two merges of origin/main (5ff1d381, 08107d2f).
    • Both merges are pure. git merge-tree --write-tree of each merge's parents gives the merge's own tree (dcc8007f… and d66b66c7…).

Pins at this head: ReportNewPage-36692, ReportView.designModeExclusion-36692, StudioAreaAppOpen-36906, studioAppEdit, studioAddress and DashboardView.inPageEdit-36372 all pass: 6 files, 92 tests. The dev's 99 adds urlParams, which the seat did not run.

Closed findings, each re-run with its fix ablated (anchor replaced once, then restored; git diff --quiet HEAD clean after each):

  • M1: closed. ReportNewPage resolves the app's package only when ?studio= is present: resolveRuntimeCreatePackage(draftBarPackageOf(appName, apps)), then saveAndPublishInPackage. Otherwise it keeps the package-less saveAndPublishRuntimeMetadata.
    • This covers the package when it is writable, the pair through the ensure door otherwise, and null (package-less) when the package is not listed or the door refuses. runtime-metadata-persistence.ts is unchanged at this head.
    • Ablation, resolve → null: 3 failed of 13 (the package pin, the pair pin, and the refusing-door CONTROL).
    • Ablation, resolve outside Studio too: 1 failed of 13. "Outside Studio nothing changes" is therefore pinned, not only stated.
  • M2 (a): closed, except one unpinned call site (S1 below). StudioAreaAppOpen reads client.get(type, name, { packageId }) before reading apps. A null or failed read keeps the fallback. That read sends no state=draft, and adds preview=draft only when the client is already in draft preview, so it asks what the app asks.
    • Ablation, if (!published) → if (false): 2 failed of 16 (draft-only dashboard; draft-only report and a failed read).
    • studioCreateLandsInApp is true only for a dashboard or report with an area package. The pure rule is pinned.
  • S1 (× on the new-report page over unsaved edits): closed. The ask now runs before both legs. Ablation, ask removed: 2 failed of 13 (the Studio leg and the index leg).
  • S2 (changeset wording): closed. ?studio=, STUDIO_RETURN_PARAM, /apps/APP/reports/new, "Tailwind's sm" and "reserved console param" are gone. It now says "the app's New report page", "a phone-width window (narrower than 640 px)" and "the page's address remembers the Studio list". The remaining studioReturn names the strings' namespace, which is fair for a locale package.
  • S3 (速读 bullet 3): reworded, but it now states a false "before" (S2 below). It does now name the data-placement change, and the installed app's customization items staying on Studio's page (in Chinese, with no bare card number).
  • S4 (report builder × outside Studio): closed. handleBuilderClose asks before either leg. Ablation, ask removed: 2 failed of 8 (the Studio dirty pin and the new outside-Studio pin). The prompt string is neutral ("Leave without saving?…"), so it reads right outside Studio too.
  • S5 (read-only base through the gate): closed. Four cases under a read-only base:
    • a base dashboard row opens in the base's app;
    • a pair row keeps the generic page;
    • report New opens the base app's new-report page;
    • with the pair door closed, report New goes back to the list.
    • AreaCreate now routes report New to the app only when !host.readOnly || host.pairCreate. Ablation, that condition removed: 1 failed of 16.
  • N2: closed. The Acceptance-notes bullet "A pending Studio draft over a published version" declares it. It matches the code by reading: the published version opens in the app, and the in-page Save refuses while the draft is pending.
  • N3: closed. The double blank line in StudioAreaAppOpen.tsx is removed.
  • N1 (HotCRM): still NOT MEASURED, and it carries to Studio 重构(4-2):新形态的端到端测试、总走查,更新平台测试清单、文档和技能里的 Studio 地址与说法 #36910 as ruled. Fixes #36906 stands on that basis.

Seat rulings on the dev's two open questions (noted, not graded here):

Open

  • S1 (should-fix) — The create landing's replace in ResourceEditPage.tsx is not pinned. It is one of the PR's own three "Read first, by risk" hunks, on the save path every type shares.
    • What the pin really drives: StudioAreaAppOpen-36906 mocks MetadataResourceEditPage with a CreateStub. That stub reimplements the landing (navigate(…, { relative: 'path', replace: studioCreateLandsInApp(host?.packageId, type) })). So "dashboard New → Save … Back lands on the list" drives the stub, not the real page.
    • Seat ablation: replace: studioCreateLandsInApp(areaHost?.packageId, type) → replace: false in ResourceEditPage.tsx. StudioAreaAppOpen-36906 stays green, 16 of 16. So does every ResourceEditPage* test plus views/studio-design/: 366 files, 2,583 tests, all passed.
    • Why the dev's ablation 6 missed it: forcing the helper false reds the stub's copy and the pure rule. It does not reach the call site.
    • Coverage today: the live walk at 727300e5 covered Back once. Nothing keeps the call site from silently reverting.
    • Fix: one ResourceEditPage create case under a MetadataAreaHost with a packageId. A dashboard save navigates with replace: true. CONTROL: a view save, or no area host (Setup), pushes. Check: the call-site ablation above turns it red.
    • Body: correct the Tests bullet and ablation 6 so they say what they reach.
  • S2 (should-fix) — 维护者速读 bullet 3 describes a "before" that main never had.
    • What it says: 「从 Studio 报表列表新建的报表现在存进该包……而不再存成环境级的元数据」.
    • What main does: at d7f299c0, Studio's report New is the area's own create. It saves into the package (?package=), or into the pair through AreaPairedCreate, or goes back to the list where the pair door is closed.
    • The real difference: the package-less save existed only at this PR's first head. Against main, where the report lands is the same in every normal case. What changed is which page saves it (the app's new-report page). There is one new leg: the ensure door refuses at save time, and the report is then saved with no package.
    • Fix: reword bullet 3 in plain Chinese. For example: from Studio's report list, New now saves on the app's new-report page, still into the package (an installed app's into its customization package), as before. If this goes wrong, it affects where a new report is stored. It can be reverted directly, and reports already saved stay where they are.
    • Also: bullet 1 is three sentences. os-dev.md's 速读 rule is one sentence per line.
  • S3 (should-fix) — The first save case of ReportNewPage-36692 runs on a clock, and goes red on this head merged with main.
    • The cause: the case is 'the new-report page saves on its own' → "Save creates and publishes the report…". It pays handleSave's cold dynamic import (await loadHanRomanizer()) inside two setTimeout(0) flushes.
    • Measured on the merged tree (git merge-tree --write-tree origin/main HEAD, origin/main 9171bed0), with the six pin files under default workers: 2 failed of 92, in 3 of 3 runs. The case sees no saveAndPublish call, and the late save then lands in the next case, "Close goes back to the reports index, writing nothing".
    • It passes elsewhere: at this head the same run is green 3 of 3. It is also green with --maxWorkers=1, and with the file alone.
    • The cause is confirmed: paying loadHanRomanizer() once in a beforeAll (a throwaway edit) makes the merged run green.
    • Why it is this PR's to fix: the clock pattern dates from Design mode: creating a report inside it shows two Save/Cancel sets and can silently detach. Make report editing its own entry, mutually exclusive with design mode (Twenty's model) #36692, but this PR owns the file. This round already fixed the same class for @objectstack/lint (check:test-source-alias: a first load is paid at collection, never inside a case's clock).
    • Fix: pay the romanizer at collection too, or wait on the assertion instead of a fixed number of ticks. A local measurement only: CI's shards may not hit it, but merged main may.
  • N1 — The CONTROL leg (ensure door refuses at save) saves the report package-less without telling the user. A new view says so through onSavedOutsideApp. Only console.warn fires here, and it still says "the view is saved". The changeset's "so it appears in the list × goes back to" does not hold on that leg. It is rare, because pairCreate already keeps walled and kernel bases off this page. A one-line notice, or a changeset clause, would close it.
  • N2 — The live walk ran at 727300e5, before the d7f299c0 merge. That merge touches none of the PR's files (the seat checked: both merges are pure), so this is noted, not re-asked.

Gates

  • Check-runs at head: 66 runs, 54 success, 12 skipped, 0 failed, 0 pending. This matches the zone's count. The PR is still a draft.
  • Staleness: K = 6 (git rev-list --first-parent --count d7f299c0..origin/main, origin/main 9171bed0). feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168 landed since (merged 2026-11-25T08:40Z). It shares StudioMetadataArea.tsx, studioAddress.ts and studioAddress.test.ts with this PR.
    • git merge-tree --write-tree origin/main HEAD is clean. In the merged tree, AreaItem still wraps the open in StudioAreaAppGate, and AreaCreate still routes report New through StudioAreaAppOpen.
    • The six pin files on the merged tree: 2 failed of 92 with default workers, in 3 of 3 runs. See S3.
  • Changeset, sentence by sentence against the code: every bullet holds, except "so it appears in the list × goes back to" on N1's leg.
    • "On the list of every package" is the cross-package (~all) leg.
    • "Where the installed app's customization package cannot be used, New goes back to the list" is AreaCreate's pairCreate condition.
    • "now ask … everywhere" is S1/S4 above.
    • plugin-dashboard.mdx: the three reworded sentences hold at this head.
  • 维护者速读:
    • Bullet 1 holds: the open lands in the edit state or the builder; × survives a reload; New goes to the app's page.
    • Bullet 2 holds.
    • Bullet 3: the clause on drafts and the installed app's customization items holds; the "before" clause does not (S2).
    • Bullet 4 is 「无」, which is right.
  • Declarations:
    • Clause-②: no holds. @object-ui/app-shell is private.
    • The @object-ui/i18n diff from the merge base is +66/−0 across the 11 locales. It adds only studioReturn.{close,closeLabel,leaveConfirm}, which is not in 18.6.0. No released key is removed, so neither the 19.0.0 narrowing arm nor a 「Removed translation keys」 list is owed.
    • Metadata-protocol: none holds: no spec or protocol file is touched.
    • The delta touches no i18n file.
  • Overlap (git merge-tree --write-tree with this head):
  • L2: none owed. There is no contract face: no spec or protocol change, i18n is additive, and the package is private.

Next: one small patch round for S1–S3 (one ResourceEditPage pin, the romanizer paid at collection, and a body edit), with N1 at the dev's discretion. The seat then reads that delta and self-lands (not Tier H).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants