Skip to content

feat(console): build a new report from the design mode's Add menu item - #36657

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-bkjint
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-bkjint

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Requested by Warren · project thread
Fixes #36364
Clause-②: yes (widening) — three new @object-ui/i18n keys (designMode.menu.newReport, designMode.menu.newReportLeft, report.builder.addsToMenu) in all 11 locales; no spec, schema or public export change
Metadata-protocol: none

repo:objectstack#1 · os-warren · session_01JQwxbXq2Dxb31zZNmSqCtz

维护者速读

  • 用户能看到什么变化:管理员在设计模式里「添加菜单项 → 报表」,第一行是「新建报表…」,点了会占好菜单位置并打开报表搭建页;选好数据来源和指标、保存后,新报表出现在占好的位置,设计模式里的其他改动一起保存。
  • 为什么做:设计模式专题卡的报表这一半,按席位定的方案:报表必须先有数据来源和指标,所以从搭建页新建,而不是只填名字。
  • 出错会怎样:菜单保存失败时,刚建的报表会被删掉,设计模式和搭建页都保持打开;中途关闭搭建页或离开它,什么都不写、占位消失;可以直接撤回本次合并。
  • 要你做什么:不用做什么。

What changes

The report half of #36364, on top of the report builder (#36644), per the seat's ruling (option A, comment 7090058961): a report needs dataset and values, so 「New report…」 opens the builder, and the report and its menu entry are written only when the builder saves.

  • Picker (DesignModeMenu.tsx): the Reports list starts with 「New report…」. It holds the place (the dashed row now reads 「New report…」), offers a slot, and navigates to the app's reports/new. Nothing is written.
  • The slot (designModeReportSlot.ts, new): the menu lives in the sidebar and the builder in the page, with no shared tree, so a module-level store holds one slot { path, save, cancel }. It is keyed by the builder's address, not the app's name, because the console addresses an app by its route segment (the showcase app is /apps/com.example.showcase, its name showcase_app). This was found on the live run, and a page test pins it. The menu withdraws the slot when the place is dropped and when it unmounts (the design mode ended). Without a slot the builder is the plain new-report page, as before.
  • The builder page (ReportNewPage.tsx): when a slot waits on its address, it says 「Saving creates this report and adds it to the menu where you placed it, with your other design changes.」. Its Save hands (name, label, body) to the slot and writes nothing itself. A refused save keeps the builder open. Its Close cancels the place and goes back.
  • The save (designModeMenuCreate.ts): NewMenuItem gains a report arm carrying the builder's body. saveAppMenuWithNewItem runs the dashboard half's order unchanged: every menu-save check first, then the report saved and published in the menu's own package (saveAndPublishInPackage, the package-bound door saveDashboardInPlace now shares), then the menu written with the entry in the held place and every other staged edit (saveWith). On a refused menu the report is removed again.
  • Leaving the builder another way (a menu link, Back) drops the held place too, so no row waits for a builder that is gone.
  • The entry's label: a report entry with no label shows its machine name (only object, view and dashboard entries inherit their target's label, per the cloud#2021 ruling), so the new entry carries the report's label. The live run first showed hui_kuan_fenxi in the menu, and this fixes it.

Tests

  • pnpm --dir ui exec vitest run packages/app-shell/src/layout packages/app-shell/src/views/ReportNewPage at f3021225: Test Files 157 passed (157), Tests 1284 passed (1284). DesignModeMenu-36363.test.tsx was rerun at head ecbe0f66 after the label change: 38 passed. Earlier at f7737e36, packages/i18n gave 1978 passed, with the de quote-pairing count raised 128 → 129 for newReportLeft's „{{name}}“.
  • New pins:
    • designModeMenuCreate-36364.test.ts: 4 report cases. They cover the body, the package write order (ensure → save/publish report → save/publish app), a refused menu resetting the report, and an unlisted package creating nothing.
    • DesignModeMenu-36363.test.tsx: 5 report cases. They cover the picker row holding the place and writing nothing; the builder's Save writing the report, then the menu with the labelled entry and the other staged edit, then leaving the mode; a refused menu; the builder's Close; and leaving the builder.
    • ReportNewPage.menuSlot-36364.test.tsx: 5 cases. They cover Save going through the slot; a refused save staying open; Close cancelling and going back; a route segment other than the app's name; and another app's slot not being used.
  • Ablations (one-shot, not kept): without the page change, the page file went 3 failed | 1 passed. Without the menu change, all 5 menu report cases were red.
  • tsc --noEmit (app-shell) exit 0. ESLint on the changed files: 0 errors. check-i18n-call-site-keys exit 0.

Screenshots

Taken on the live showcase example (fresh backend, console dev server, zh-CN, deviceScaleFactor 2). They are stored with the seat's project files (issue-36364/):

  1. 「添加菜单项 → 报表」, with 「新建报表…」 first.
  2. The builder, with the held 「新建报表…」 row under 数据分析 and the 「adds to the menu」 line.
  3. The builder filled: Invoice Metrics, grouped by status, named 回款分析.
  4. After Save: the design mode is left, and 「回款分析」 sits in the held place, open.
  5. Cancel path: a second 「新建报表…」, closed from the builder. The page goes back, no held row is left, and the mode stays on.

Checked through the API after the run:

  • report/hui_kuan_fenxi is stored in com.example.showcase.custom, the menu's package (the same item Studio lists), with _diagnostics.valid: true.
  • The app's menu holds { id: nav_item_1, type: report, reportName: hui_kuan_fenxi, label: 回款分析 } under grp_analytics.
  • It is the only hui_kuan* report, so the cancelled build left nothing.

Overlap

overlap-check: merges cleanly with main, #36655 and #36525. With #36629 it conflicts only in de-quote-pairing-3876.test.ts, because both PRs raise the same German quote count. Whichever lands second re-adds 1 to the count.


Generated by Claude Code

…item

「Reports」 in the picker starts with 「New report…」: the place stays held
and the report builder opens; its Save creates the report in the menu's
package and saves the entry with every other staged design change, its
Close (or leaving it) drops the place and writes nothing.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbXq2Dxb31zZNmSqCtz
The console addresses an app by its route segment, which need not be its
name, so the builder page finds the place it fills by its own address.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbXq2Dxb31zZNmSqCtz
@os-warren os-warren self-assigned this Nov 23, 2026
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: TIER_DEFAULT
Head-sha: ecbe0f66cd19c4e6132ee6fe3d04ec49ca6dbee1
Local-runs: none
Scope: .changeset/36364-design-mode-new-report.md, ui/packages/app-shell/src/layout/DesignModeMenu.tsx, ui/packages/app-shell/src/layout/designModeMenuCreate.ts, ui/packages/app-shell/src/layout/designModeReportSlot.ts, ui/packages/app-shell/src/views/ReportNewPage.tsx, ui/packages/app-shell/src/views/runtime-metadata-persistence.ts, ui/packages/app-shell/src/layout/tests/DesignModeMenu-36363.test.tsx, ui/packages/app-shell/src/layout/tests/designModeMenuCreate-36364.test.ts, ui/packages/app-shell/src/views/ReportNewPage.menuSlot-36364.test.tsx, ui/packages/i18n/src/tests/de-quote-pairing-3876.test.ts, ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt-BR,ru,zh-Hans,zh-Hant}.ts + ui/packages/app-shell/src/layout/designMode.tsx, ui/packages/app-shell/src/views/ReportBuilderHost.tsx, ui/packages/app-shell/package.json, ui/packages/i18n/package.json, ui/packages/app-shell/src/index.ts, scripts/check-changeset-no-major.mjs, issue #36364 body, ruling comment 7090058961
Security-touching: yes
Rule-change-verified: none

① Derived judgments

  • Published surface is the three i18n keys. designMode.menu.newReport, designMode.menu.newReportLeft and report.builder.addsToMenu are added in all 11 locales, each with a real translation (no English copies in other locales).
  • No package export moves. @object-ui/app-shell exports only . and ./styles.css; src/index.ts re-exports none of the touched modules. The new saveAndPublishInPackage, designModeReportSlot and the NewMenuItem union are package-internal. @object-ui/i18n package.json is untouched.
  • No spec, schema or server file in the diff. Metadata-protocol: none is true. Clause-②: yes (widening) is true (new keys only, nothing removed or renamed).
  • Note: fr newReportLeft uses a straight ' and "retiré/retirez", while its sibling newItemLeft uses ’ and "supprimé/supprimez". No gate checks this; cosmetic.

② Semver level

  • Changeset grades @object-ui/app-shell and @object-ui/i18n both patch. Under Metadata-protocol: none, scripts/check-changeset-no-major.mjs wants every introduced entry patch. Consistent. No major.

③ Boundary flags

  • Orphan report on refused menu save: handled. saveAppMenuWithNewItem runs every menu check first (prepareAppMenuSave), creates and publishes the report, then writes the menu; on a refused menu it calls reset('report', name, { packageId: target }) and, if that is refused too, says newReportLeft. Same code path as the dashboard half. Pinned by designModeMenuCreate-36364.test.ts ("a refused menu removes the report") and the DesignModeMenu test (reset with the app's packageId; mode, held place and staged edits stay).
  • Package: the report goes to prepared.target via saveAndPublishInPackage (bound client) — the app package when writable, else <pkg>.custom. Both arms pinned in tests. Same rule as the dashboard half. Save and publish happen in one act (saveAndPublishRuntimeMetadata), matching the 专题:Studio 的保存方式和用词(人工修改保存即生效,草稿加整包发布只留给 AI;设置页说业务话;页签和顶部导航重排) #36510 rule.
  • Held slot: a module-level in-memory variable, not sessionStorage or any storage. It cannot cross tabs. It is keyed by ${basePath}/reports/new; another app's builder does not match (tested, including an app whose route segment is not its name). It is withdrawn when the held place drops (Close, a menu link, browser Back after the builder was reached) and when the menu unmounts (design mode ends, saved or cancelled). A later unrelated reports/new visit gets no slot. Note: if the design mode is cancelled while on the builder, the page falls back to the standalone builder and a later Save writes a report with no menu entry; this is an explicit, separate act on a page that no longer shows the "adds to menu" banner, and the changeset says so.
  • Admin gate: the entry is reachable only inside the design mode (admin + manage_metadata, useAppStudioEntry); ReportNewPage still renders the admin-only empty state for non-admins before any builder or Save.
  • Tests: no assertion removed or loosened. The only - line in the layout tests is an import widening. The de-quote counts move 128→129 (spans) and 128/128/0→129/129/0 (pairs), both still exact equalities, for exactly one new quoted span: de newReportLeft „{ {name} }“ (the name placeholder). A real count bump.
  • Server write authority: unchanged. No server code moves; every write goes through the existing metadata client doors (draft with ifNoneMatch: '*', publish, reset), which the server judges again.
  • Note: if Save is in flight and the reader leaves the builder, the save still completes (the navigation was computed before the await) and the page then navigates to the new report. The reader pressed Save, so this is acceptable.
  • Note: while a report is being built, the menu's other 「Add menu item」 rows still work; using one moves the held place (the picker stays hidden). The report then lands in the moved place. Harmless.

④ Design judgment

  • Matches ruling 7090058961 option A. 「New report…」 is the first row of 「Reports」. It holds the place (the dashed row reads "New report…") and opens the builder at reports/new in a create mode with a banner. Nothing is written until the builder's Save (the builder and server require dataset + measure). Save creates the report in the menu's package, puts its entry in the held place, saves every staged change, leaves the mode and opens the report. Close and any other departure drop the place and write nothing. A refused menu removes the report and keeps the builder open. Options B and C were not taken. Outside the design mode reports/new behaves as before (tested).
  • The slot bridge (sidebar menu ↔ page builder through a tiny external store) is a reasonable answer to two trees that cannot share a callback, and its lifetime is tied to the menu's mount.

No must-fix. No should-fix. Notes only.

Implemented-by: claude/project-thread-bkjint
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

在运行界面的设计模式里,「添加菜单项 → 报表」现在可以「新建报表…」。系统先在菜单里占好位置,再打开报表搭建页;选好数据和指标、点保存后,报表和菜单项一起生效。点关闭或离开,什么都不留下。
仪表盘那一半已经上线,这张卡到此做完。新加了 3 句界面文字,11 种语言都已翻译。
契约复核通过,CI 全绿,748 行,非受管面,席位落地。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head ecbe0f66 · 2026-11-23T09:50Z

  • Shape: Fixes #36364 (the report half; the dashboard half landed as feat(console): create a dashboard from the design mode's Add menu item #36606). Files: ui/packages/app-shell/src/layout/{DesignModeMenu.tsx,designModeMenuCreate.ts,designModeReportSlot.ts}, views/{ReportNewPage.tsx,runtime-metadata-persistence.ts}, tests, and 3 keys × 11 locales in @object-ui/i18n. Patch changeset. Tier S (check-governed-merges: not governed, +703/−45).
  • Ruling held: option A of seat ruling 7090058961. 「New report…」 holds the menu place and opens the builder at reports/new. The report and its menu entry are written only on the builder's Save, together with the other staged menu edits (saveAppMenuWithNewItem / saveWith), and saved live per epic 专题:Studio 的保存方式和用词(人工修改保存即生效,草稿加整包发布只留给 AI;设置页说业务话;页签和顶部导航重排) #36510. Close or leaving writes nothing and drops the place.
  • Contract review: Clause-②: yes (widening) (claim amended 7096731668). TIER_DEFAULT record 7096804089 at this head is a PASS with no must-fix or should-fix. The published surface is exactly the three i18n keys, all 11 locales translated, Metadata-protocol: none true. A refused menu save resets the new report in its target package (tested). The report goes into the menu's package (app package when writable, else its .custom pair; both tested). The held place is in memory only, keyed by the builder address, and withdrawn on Close, leave, and design-mode end. The entry is admin-only, and server write authority is unchanged. The de-quote count moves 128→129 for one real new quoted string, and the assertion stays exact.
  • Notes carried (non-blocking):
    • The French newReportLeft wording and apostrophe differ from the line beside it.
    • Cancelling design mode while the builder is open leaves a plain builder, whose Save writes a report with no menu entry. That is the plain builder's behaviour.
    • A second 「Add menu item」 row while the builder is open moves the held place.
  • Evidence: live run on showcase (fresh DB): report hui_kuan_fenxi stored in com.example.showcase.custom, menu entry labelled 回款分析 under grp_analytics, and Cancel left no report and no held row. Screenshots are in project files issue-36364/. Ablations go red without the page or menu change. Local: 157 app-shell files / 1284 tests, i18n 1978 tests, type-check and lint clean.
  • Gates: 58 check-runs on ecbe0f66: 45 success · 13 skipped · 0 failed (every Test UI shard included). GitHub reports mergeable, state clean. K = 0 first-parent commits behind main.
  • Landing: ready + auto-merge now. On merge 设计模式(三)在「添加菜单项」里新建仪表盘、新建报表:建完落在占好的位置,直接进入编辑 #36364 closes and the seat clears its pm:dispatched. Overlap: feat: an object's action layout per scope, pinned and more, set from the design mode (#36366) #36629 conflicts only on the de-quote count; whichever lands second rebases the number.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 09:51
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit d076975 Nov 23, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-bkjint branch November 23, 2026 10:12
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

设计模式(三)在「添加菜单项」里新建仪表盘、新建报表:建完落在占好的位置,直接进入编辑

2 participants