Repository navigation
Commit e0050ba
fix(console): report editing is its own entry, mutually exclusive with design mode (#36848)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB9qsP28anD5tWRUHq8j1xSU)_
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`.
<details><summary>Local runs</summary>
- 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 #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.
</details>
## 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 #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](https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzhpykmQZe1yMupC2CU -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8f141a2 commit e0050ba
31 files changed
Lines changed: 1140 additions & 664 deletions
File tree
- .changeset
- ui/packages
- app-shell/src
- layout
- __tests__
- views
- __tests__
- i18n/src
- __tests__
- locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
183 | | - | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
| |||
503 | 501 | | |
504 | 502 | | |
505 | 503 | | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | 504 | | |
584 | 505 | | |
585 | 506 | | |
| |||
620 | 541 | | |
621 | 542 | | |
622 | 543 | | |
623 | | - | |
| 544 | + | |
624 | 545 | | |
625 | 546 | | |
626 | 547 | | |
| |||
641 | 562 | | |
642 | 563 | | |
643 | 564 | | |
644 | | - | |
| 565 | + | |
645 | 566 | | |
646 | 567 | | |
647 | 568 | | |
| |||
695 | 616 | | |
696 | 617 | | |
697 | 618 | | |
698 | | - | |
| 619 | + | |
699 | 620 | | |
700 | 621 | | |
701 | 622 | | |
702 | 623 | | |
703 | 624 | | |
704 | 625 | | |
705 | | - | |
706 | 626 | | |
707 | 627 | | |
708 | 628 | | |
| |||
794 | 714 | | |
795 | 715 | | |
796 | 716 | | |
797 | | - | |
| 717 | + | |
798 | 718 | | |
799 | 719 | | |
800 | 720 | | |
801 | 721 | | |
802 | | - | |
803 | | - | |
804 | | - | |
| 722 | + | |
805 | 723 | | |
806 | 724 | | |
807 | 725 | | |
| |||
998 | 916 | | |
999 | 917 | | |
1000 | 918 | | |
1001 | | - | |
1002 | 919 | | |
1003 | 920 | | |
1004 | 921 | | |
| |||
1007 | 924 | | |
1008 | 925 | | |
1009 | 926 | | |
1010 | | - | |
1011 | | - | |
1012 | 927 | | |
1013 | 928 | | |
1014 | 929 | | |
| |||
1133 | 1048 | | |
1134 | 1049 | | |
1135 | 1050 | | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | 1051 | | |
1150 | 1052 | | |
1151 | 1053 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
0 commit comments