Skip to content

fix(console): report editing is its own entry, mutually exclusive with design mode - #36848

Merged
objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/issue-36692-report-editing-own-entry
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/issue-36692-report-editing-own-entry

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #36692
Clause-②: no
Metadata-protocol: none

repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU

维护者速读

  • 管理员在应用里点「设计布局」时,添加菜单项的「报表」一栏只列已有报表,不再有「新建报表…」;新建报表改在报表列表页右上角的「新建报表」按钮;仪表盘或报表正在编辑时点「设计布局」会提示先保存或取消,设计布局开着时仪表盘和报表的「编辑」按钮不出现。
  • 落实维护者「照 Twenty 分开」的裁决:报表和仪表盘的编辑与设计布局是两个入口,屏幕上任何时候只有一套保存/取消。
  • 出错时管理员会看到两套保存按钮或点不出新建报表;本改动不碰任何已保存的数据,合并后可直接撤回。
  • 无

What changes

The maintainer's ruling on the decision card (2026-11-23 11:55Z): 「照 Twenty 分开」. Report and dashboard editing are their own entries, mutually exclusive with design mode, so the screen shows one Save/Cancel set at a time.

  1. Design mode stops hosting the report builder. The Reports list in 「Add menu item」 only links reports that exist. Removed: its 「New report…」 row, the cross-mode hand-off module designModeReportSlot.ts (deleted, not left unused), the slot block in DesignModeMenu, the slot branch in ReportNewPage, and the report kind of designModeMenuCreate.ts (a dashboard is again the one kind made from a name). 「New dashboard…」 is unchanged (change item 4).
  2. A report is created from its own entry. The reports index (AppReportIndexView) header offers 「New report」, linking to the app's reports/new. It is gated as the builder is (useWorkspaceAdminStatus: workspace admin, resolved) and shown on an empty index too. The builder's Save and Close in its own header are the only Save/Cancel set; Close goes back to the index.
  3. Two-way exclusion, through one hold on the shell's design-mode store (designMode.tsx):
    • useHoldDesignModeOut(open): a dashboard's or report's own editor holds the mode out while it is open (or opening). Wired into useDashboardInPageEdit, ReportView (builder and inspector panel) and ReportNewPage.
    • The mode's enter now answers boolean: while anything holds the mode out, it refuses with a toast, "Save or cancel your dashboard or report changes before designing the layout." (zh-Hans 「请先保存或取消仪表盘、报表的修改,再设计布局。」). 「Design layout」 in the app menu stays drawn and refuses through it.
    • While the mode is on, useDesignModeActive() hides the dashboard's Edit (useDashboardEditOffered), the report page's Edit, and the index's 「New report」.
    • ReportNewPage reached while the mode is on (an in-app navigation keeps the mode) draws no builder: an Empty says "Finish designing the layout first" / "A report is built outside the design mode. Save or cancel the layout, and the builder opens here." It holds the mode out only while it draws the builder, so the bar's Save or Cancel opens the builder in place (L1-a S1, 7122753474).
    • This also closes the path the card measured: the bar's Cancel ending design mode while a dashboard stays in edit. The bar can no longer appear while an editor is open.
  4. Strings: designMode.editorOpen, console.reportIndex.newReport, report.builder.designModeOnTitle and report.builder.designModeOn were added to all 11 packs (zh-Hant regenerated with gen:zh-hant). designMode.menu.newReport, designMode.menu.newReportLeft and report.builder.addsToMenu were removed from all 11 packs. The de quote-pair ledger drops 134 to 133 because newReportLeft is gone.

Untouched rulings: #36363 ruling (4) (menu labels) and designModeMenuCreate.ts ruling C / ADR-0146 D2 「定制都进 .custom」.

Docs and skills: neither content/docs nor skills/ teaches "New report… from design mode". The one New report hit, content/docs/data-modeling/analytics.mdx, is about Studio's dataset picker, so nothing is owed.

Read first (by risk):

  1. ui/packages/app-shell/src/layout/designMode.tsx: the heldOut counter, enter's refusal and useHoldDesignModeOut.
  2. ui/packages/app-shell/src/views/DashboardInPageEditor.tsx: useDashboardEditOffered now also reads the mode. The design mode's 「New dashboard…」 landing (dashboardEditArrival) still opens the edit state, because saveWith leaves the mode before it navigates and the arrival effect waits on editOffered.
  3. ui/packages/app-shell/src/layout/DesignModeMenu.tsx: the removed report block and picker row.

Two-minute check: as admin in the showcase app, open Reports. 「New report」 is at the top right. Open a dashboard, press Edit, then choose app menu, then 「Design layout」: a red toast says to save or cancel first, and no purple bar appears.

Tests

New pins go into each component's existing harness as a top-level describe where there is one (designMode-36362, SidebarAppMenu-36112, DesignModeMenu-36363, designModeMenuCreate-36364, DashboardView.inPageEdit-36372). New card-named files were added where the component has only per-card files: ReportView.designModeExclusion-36692, ReportNewPage-36692 and AppReportIndex.newReport-36692.

  • Exclusion while an editor is open: enter refuses with the prompt and the mode stays off. This is pinned on the store, on the 「Design layout」 door, on the dashboard edit state (no bar, so no bar Cancel), on the report builder, on the report inspector panel, and on the new-report builder. Two editors hold the mode out until both close, and an editor unmounted while open lets go.
  • Exclusion while the mode is on: no dashboard Edit, no report Edit, no 「New report」 on the index; each comes back once the mode is left.
  • The picker: Reports lists existing reports not yet in the menu and has no 「New report…」 row. Picking a report stages it with the mode, writes nothing and navigates nowhere.
  • ReportNewPage under the mode (round 2, ReportNewPage-36692): mode on at the index, then reports/new: the mode stays on, no builder, no Save, the prompt shows; then the bar's Cancel: the mode is off, the builder is drawn, and a later enter() is refused; control: mode off, reports/new draws the builder with Save and no prompt.
  • ReportNewPage saves on its own (the deleted ReportNewPage.menuSlot-36364 file's surviving case, ported), and Close goes back to the index.
  • Removed with the behaviour they pinned: the report-half cases in DesignModeMenu-36363 and designModeMenuCreate-36364, and ReportNewPage.menuSlot-36364.test.tsx.
Local runs
  • Pre-merge head 22dee19f5: @object-ui/app-shell full suite: Test Files 2474 passed, 1 skipped (2475); Tests 23314 passed, 9 skipped. @object-ui/i18n suite: 107 files, 2006 passed. type-check for both packages exited 0.
  • After merging origin/main (head 7ea3843ec, which carries fix(console): design mode menu save refuses a 404 read, pins its publish, and keeps own entries out of contributed groups #36821): the app-shell closure was rebuilt and type-check for both packages exited 0. @object-ui/i18n suite: 108 files, 2011 passed. Scoped app-shell run (src/layout/ plus the ReportView, ReportNewPage, DashboardView, AppReportIndex and reportBuilder files): 190 files, 1535 passed. This run was narrowed on purpose; CI's Test UI runs the full suite.
  • Ablation 1, committed fix, scripts/ablation-replace.mjs: in enter, if (heldOut > 0) { was changed to if (heldOut < 0) { (anchor 1 to 0, blob 473cab2c7389 to 7793aa4658ec). Result: 7 failed (every refusal pin across five files). Restored blob equals HEAD and git diff HEAD is empty.
  • Ablation 2: in useDashboardEditOffered, return gated && !designing; was changed to return gated;. Result: 1 failed ("while the mode is on, Edit is not offered"). Restored, blob equals HEAD.
  • Round 2, head cccd01739: ReportNewPage-36692 6/6. Ablation 3, committed fix: if (designing) { changed to if (false as boolean) { (blob f81d258a824f to fa265e66e744): 1 failed, 5 passed, the mode-on pin red; restored blob equals HEAD. Scoped run (packages/i18n/ plus app-shell src/layout/, ReportView, ReportNewPage, DashboardView, AppReportIndex, reportBuilder): 298 files, 3549 passed, 13 skipped. type-check for both packages exited 0.

Acceptance notes

  • Browser screenshots: showcase app as admin, console served by Vite from this branch's ui/ against a --seed-admin backend on its own port. The files are in the project files under issue-36692/:
    • 1-reports-index-new-report.png: the reports index with 「New report」.
    • 1b-builder-one-save-set.png: the builder it opens, showing only its own Discard/Save.
    • 2a-design-mode-index-no-new-report.png: design mode on, so no 「New report」.
    • 2b-design-mode-reports-picker.png: the design-mode Reports picker without 「New report…」. The showcase's reports are all in its menu already, so the picker reads "Nothing to add here".
    • 3-refusal-prompt.png: the dashboard in edit, and 「Design layout」 refused with the prompt.
    • 4-design-mode-dashboard-no-edit.png: design mode on, so the dashboard has no Edit.
  • A typed reports/new URL reloads the page, so the mode is gone. An in-app navigation to reports/new keeps the mode, and there the page now draws the prompt instead of the builder (round 2). The index link is hidden while the mode is on.
  • Open PR feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation #36858 overlaps this branch textually in DesignModeMenu.tsx and designModeMenuCreate.ts (this PR removes the report half there). Whichever lands second resolves it.
  • #36791 will conflict with this branch on the de quote-pair ledger counts (de-quote-pairing-3876.test.ts). Whichever lands second re-counts.

Verification

Derived gate families (dispatch-gates.mjs --commands at 7ea3843ec) were run locally; their results are in the report comment on the card. CI carries the full farm.


Generated by Claude Code

…ish, and keeps own entries out of contributed groups

WIP: implementation of objectstack#36538 items 1-4 and N10, N12-N16; tests follow.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…in the wired collision rule

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…(zh-Hant regenerated)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…ith design mode

Design mode's Reports picker links existing reports only: the New report
row, the report kind of the menu create, and the design-mode report slot
are removed. The reports index offers New report, gated as the builder.
The design mode's enter refuses, with a prompt, while a dashboard or report
editor holds it out; those editors are not offered while the mode is on.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…g and design mode

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…port-editing-own-entry

# Conflicts:
#	ui/packages/app-shell/src/layout/DesignModeMenu.tsx
@github-actions github-actions Bot added size/xl 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 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8

席位核对 — REWORK · repo:objectstack#3 · head 7ea3843 · 2026-11-24T05:13Z

L1 read of #36848 against card #36692 (the maintainer's ruling 「照 Twenty 分开」). Head 7ea3843ecf10e5c1ee1e27d8cc11f8ff88428557. Dev report 7122693249.

Face. l1-face.mjs --pr 36848 CLEAN (13 items read, none flagged). At this head: 45 checks succeed, 13 skip as expected, 0 fail. mergeable_state clean. check-governed-merges.mjs says NOT governed (0 of 31 paths; 1691 changed lines). Clause-②: no, Metadata-protocol: none.

Read and sound.

  • Slot removal: designModeReportSlot.ts and its 36364 test are deleted, not left unused. The report kind of designModeMenuCreate.ts, the slot block in DesignModeMenu.tsx and the slot branch in ReportNewPage.tsx are gone. No reader of designMode.menu.newReport, designMode.menu.newReportLeft, report.builder.addsToMenu or designModeReportSlot remains under ui/, apps/, packages/, content/ or skills/; the only hits are the history comments in de-quote-pairing-3876.test.ts. No docs or skills page teaches "New report…" from design mode, so Skills-docs is honestly not owed.
  • Index: 「New report」 sits in the PageHeader actions. It is gated isResolved && isAdmin && !designing, the same admin gate as the builder.
  • Exclusion, mode on → editors off: useDashboardEditOffered and the ReportView header Edit read useDesignModeActive(). The report-builder arrival is skipped while designing.
  • Exclusion, editor open → mode refused: holdOut() is a counter with an idempotent release. enter() returns false with the designMode.editorOpen toast while it is above 0. The dashboard edit state, the ReportView builder and panel (open or opening), and ReportNewPage each hold it through useHoldDesignModeOut, an effect whose cleanup lets go on close or unmount. The pins cover one editor, two editors and unmount-while-open. Ablation 1 (the heldOut > 0 test flipped) turns 7 pins red across 5 files.
  • The de-quote-pairing-3876 count moves 134→133 for the one retired newReportLeft pair. The textual overlap with feat(console): org basics in one form, optional rows, 「Get started」 sidebar pill #36791 is known; whichever PR lands second re-counts.

Finding.

  • S1. ReportNewPage drawn while the design mode is already on still shows two Save/Cancel sets, and the bar's Cancel ends the mode under the open builder. The page only holds the mode out, and a hold refuses only a later enter(). Nothing stops the builder from drawing when the mode is already on. Hiding the index's 「New report」 covers the link but not the address, and the module header says the mode goes along on a link to another page of the same app. A reachable path: open the builder from the index, Close (it pushes the index), enter 「Design layout」, then press the browser's Back. That lands on reports/new with the mode on, which is the card's double-bar screen, item 2. Two texts this round wrote are then untrue: the changeset sentence "so the design mode's 「Cancel」 can no longer end the mode under an editor left open", and the card's Expected, "At any moment the screen shows exactly one Save/Cancel set". The silent wrong result of item 3 is gone with the slot: a save now makes a plain report, which is what the builder says. The model the ruling points to closes this side: Twenty's useSetIsPageLayoutInEditMode ignores an edit request while customization is on. Fix (one route, dev's choice of wording): while useDesignModeActive() is true, ReportNewPage does not draw the builder. It can draw the same prompt as an Empty, or send the reader back to the reports index with it. Pin it with a "mode on, then reports/new mounts → no builder, no second Save" case and a control where the mode is off. ReportView's already-guarded Edit and arrival need nothing.

Notes (nit, no action required):

  • N1. While designing, ReportView skips the arrival without consuming it. If the mode ends while the reader is still on that report, the effect runs again and the builder opens then. That is arguably right (the arrival was for this report), but it isn't pinned.
  • N2. enter() now returns boolean. No caller outside SidebarAppMenu reads it today, so the widening is free.

Delta read owed on the head that carries S1.

…ode is on

Reached with the mode already on (the browser's Back to reports/new), the
page drew the builder under the design-mode bar: two Save/Cancel sets, and the
bar's Cancel ended the mode under the open builder. The page now draws a
prompt in place of the builder while the mode is on, holds the mode out only
while it draws the builder, and opens the builder once the mode is left.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8

席位核对 — ACCEPT · repo:objectstack#3 · head cccd017 · 2026-11-24T06:33Z

Delta read of #36848 (card #36692) against my REWORK 7122753474 @7ea3843e. New head cccd01739c9bcfc6cb1c512133d63455c935cf9d; the dev's delta report is 7123653672.

Delta. git diff 7ea3843e cccd0173 touches 14 files: ReportNewPage.tsx, its 36692 test, the changeset, and two keys in each of the 11 packs. Main was not merged, so everything read at 7ea3843 still stands.

  • S1: closed. ReportNewPage now reads useDesignModeActive(). While the mode is on it draws an Empty (report.builder.designModeOnTitle / designModeOn) in place of ReportBuilderHost, and it holds the mode out only while it draws the builder (isResolved && isAdmin && !designing). Reached by the browser's Back with the mode on, the page now shows the mode's bar and a prompt: one Save/Cancel set. Saving or cancelling the mode draws the builder in place, which then holds the mode out, so a later enter() refuses. The new guard sits after the loading and admin-only returns, so a non-admin still sees the admin-only text. Pins: mode on then mount (no builder, no second Save), then Cancel (builder drawn, a later enter() refused), plus a mode-off control. The ablation of if (designing) turns the mode-on pin red.
  • The changeset gains one bullet that matches the diff, and its key list now names the two new keys. The changeset sentence I flagged ("can no longer end the mode under an editor left open") is now true on every path I know of, including the address reached with the mode on.

Face. l1-face.mjs --pr 36848 CLEAN at this head. 47 checks succeed, 15 skip as expected, 0 fail. mergeable_state clean. It remains NOT governed.

No must-fix, no should-fix. N1 and N2 from 7122753474 stand as optional notes. #36858 is queued and overlaps in DesignModeMenu.tsx / designModeMenuCreate.ts. If it lands first, the merged head owes a short delta read limited to the merge resolution.

…port-editing-own-entry

Conflicts with #36858 (menu rename translation), resolved so both survive:
- designModeMenuCreate.ts: keep this branch's dashboard-only creator (no
  report kind, no saveAndPublishInPackage); take #36858's input type
  `AppMenuSaveInput & { item: NewMenuItem }` and its import, dropping the
  now-unused `Menu` import, so the dashboard path carries `labels`.
- DesignModeMenu.tsx: drop the report-slot block #36858 had edited to pass
  `labels`; the dashboard save keeps #36858's `labels`.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8

席位核对 — ACCEPT · repo:objectstack#3 · head 4ce5f1c · 2026-11-24T07:36Z

Merge-resolution read of #36848 (card #36692) after main was merged with #36858 (573a376). The new head 4ce5f1c41bac723344814555804ea212d303a1d3 is a merge commit with parents cccd0173 (my delta ACCEPT 7124071450) and 573a3765, not a rebase. The resolution note is 7124720950.

Resolution, read.

Checks. At 4ce5f1c: every check run is complete, none failed (latest run per name); l1-face reads as above. mergeable_state clean. It remains NOT governed.

No must-fix, no should-fix. My earlier reads (REWORK 7122753474, delta ACCEPT 7124071450) stand for the branch's own changes.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU

Landing · 2026-11-24T07:37Z · ACCEPT 7125185333 at head 4ce5f1c (merge-resolution read; delta ACCEPT 7124071450 at cccd017)

reading value
check-governed-merges.mjs --pr 36848 NOT governed · +1140/−664 (1804 ≤ 3000)
landing-k.mjs --pr 36848 CAN'T ANSWER (no Test Core shard ran on the merge head); K read via merge-base instead: merge-base 573a376 (#36858's merge), 3 first-parent commits on main 7a5ae65 since → K = 3 < 15
checks at 4ce5f1c 45 success, 13 expected skip, 0 failed or pending; mergeable clean

Open findings: nits only (L1 N1, N2 of 7122753474). #36858 overlap resolved in the merge commit (resolution note 7124720950). #36791 / #36869 overlap only on the de quote-pair ledger counts; whichever lands second re-counts. State: ready + auto-merge (Tier S). On MERGED, #36692 closes by Fixes; area ux-A removes pm:dispatched.

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