Repository navigation
fix(app-shell): ⌘B / Ctrl+B does what the sidebar's expand / collapse button does - #36391
Merged
objectstack-fleet[bot] merged 4 commits intoNov 22, 2026
Merged
Conversation
…d / collapse button Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ Co-authored-by: Claude <noreply@anthropic.com>
…collapse button Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Final head for L1 · area f7-shell · 2026-11-22T09:47Z
|
Contributor
Author
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT · head 维护者速读
席位核对
|
247257110
pushed a commit
to 247257110/objectstack
that referenced
this pull request
Nov 22, 2026
…bjectstack-ai#36362) (objectstack-ai#36397) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jSr8sNCnJrK6Q9kEF5 Fixes objectstack-ai#36362 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:有权设计应用的管理员(工作区管理员、具备元数据管理权限、应用所在的包可写)在页头点「编辑应用」后,不再跳转到 Studio,而是在当前应用里进入设计模式:窗口顶部出现一条横栏,只有「设计模式」「取消」「保存」;切换到同一应用的其它页面时模式保持,换应用或在手机上不出现;进入后侧边栏不再显示个人收藏。只读包(例如已安装的应用)仍然是原来的「在 Studio 中查看」入口。 - 为什么做:这是「运行时设计模式」这条线的第一张卡,先把模式本身和统一的保存/取消机制立起来,后面的菜单编辑、页头按钮固定、从菜单新建仪表盘/报表都挂在它上面;这一版本身还没有任何可改的内容,所以「保存」一直是灰的。 - 出错会怎样:最坏情况是管理员进入设计模式后看到横栏却无事可做,点「取消」即可退出;模式不写任何数据,不影响普通成员,改动只在界面层,可直接撤回。 - 要你做什么:无。另有一个后续问题已交给席位:已安装的只读应用目前进不了设计模式(与原先进不了 Studio 编辑一致),下一张卡(菜单编辑)若要覆盖已安装应用,需要让这类应用也能进入,届时由席位提出。 ## What changes 「Edit app」 in the page header no longer opens Studio for an administrator who may design the app (`useAppStudioEntry`'s `edit` posture: workspace admin, `manage_metadata`, writable package). It turns on the shell's **design mode** for the app on screen, in place. - **The mode** (`layout/designMode.tsx`) is held by `ConsoleLayout` for the app it was entered in: it survives moving between pages of that app, goes off (and drops what it held) when the app changes, and is never drawn on a phone (`enabled: false` hides it and keeps what is staged). It has no address; no URL enters it. - **The bar** (`layout/DesignModeBar.tsx`) is drawn in the AppShell's top slot, across the window, while the mode is on: 「Design mode」 at its left, 「Cancel」 and 「Save」 at its right, nothing else. 「Save」 is off while nothing is staged. On desktop the sidebar sits below the bar while it is shown, and the page header hides its 「Edit app」 button. - **The extension point** `useDesignModeChange(key)`: a surface stages a change under a key together with its own `commit`. 「Save」 commits every staged change in the order first staged, then leaves; a failed commit stops there, keeps it and every later change staged, keeps the mode on and toasts the reason. 「Cancel」 drops all and commits none. Outside the mode nothing can be staged. This PR stages nothing yet; objectstack-ai#36363, objectstack-ai#36366 and objectstack-ai#36364 build on it. - **Leaving with something staged** goes through the existing unsaved-edits seam (`chrome/unsavedEdits.ts`), which gains an optional `keeps(url)` per registration: a link to another page of the same app does not ask (the mode goes along), a link out of the app and the app switcher ask, and a tab close or reload is held by the browser prompt. - **The sidebar in design mode** shows the app's own menu only: the Favorites section and its pin buttons are off, so the menu under edit is the app's, not the person's. - A read-only package's app keeps its eye entry 「Open APP in Studio」 unchanged; a member sees no entry, as before. - New i18n keys `designMode.title`, `designMode.leaveUnsaved`, `designMode.saveFailed` in every hand-written locale, zh-Hant generated. Read first, by risk: 1. `ui/packages/app-shell/src/layout/designMode.tsx` — the save loop (order, stop-on-failure, re-staged-while-sending) and the app-change reset. 2. `ui/packages/app-shell/src/chrome/unsavedEdits.ts` — `keeps` only narrows the click guard; `confirmUnsavedLeave` and `beforeunload` still ask for every registration. 3. `ui/packages/app-shell/src/layout/ConsoleLayout.tsx` / `UnifiedSidebar.tsx` — the header slot and the sidebar offset while the bar is on. ## Tests - New `layout/__tests__/designMode-36362.test.tsx`: the bar's contents; 「Save」 off until something is staged; commit order and exit; a failed commit keeps it and later ones, keeps the mode, toasts; 「Cancel」 commits none; nothing staged outside the mode; another app drops it; a phone hides it and keeps what is staged; `beforeunload` held only while staged; an in-app link asks nothing, a link to Home asks; `isPageOfApp` with a basename. - `ShellPageActions-36111.test.tsx`: in the `edit` posture 「Edit app」 is a button (not a link) that enters the mode and is hidden while it is on; a member sees nothing; the read-only eye entry is unchanged. - `UnifiedSidebar.favoritesMenu-12427.test.tsx`: the Favorites section is hidden in design mode and back after. - `unsavedEdits-13231.test.tsx`: the `keeps` option skips only the registrations that keep the URL. - `consoleTopBar.height-12639.test.ts`: the two source pins admit the design mode's arm (same slot, same 48 px; the sidebar below it on desktop). <details><summary>Readings at d78b61b</summary> - The touched test files: 57/57 passed; `consoleTopBar.height-12639`: 12/12 passed. - Related-test sweep (every test file naming `ConsoleLayout`, `UnifiedSidebar`, `ShellPageActions`, `unsavedEdits` or `designMode`, 184 files in 4 batches): 1,654 passed; the 2 reds (the top-bar source pins above) fixed in d78b61b and re-run green. - Ablation (the `keeps` check disabled in `unsavedEdits.ts`): 3 tests red; restored, `git status` clean. - `turbo type-check` for `@object-ui/app-shell` and `@object-ui/i18n`: 70/70 tasks green. `pnpm build`: exit 0. - `dispatch-gates.mjs --commands` derived 41 gates, all exit 0; `--ran` reconciliation: 41 derived, 41 run, 0 not measured. - `overlap-check.mjs`: origin/main and 8 open PRs sharing files (objectstack-ai#36391 shares `ConsoleLayout.tsx` and `UnifiedSidebar.tsx`; the rest share locale files) all merge cleanly. </details> ## Acceptance notes - **Reach.** The mode is entered from the `edit` posture only, the gate 「Edit app」 always had. Apps in read-only packages (the showcase, apps installed from the marketplace) show the eye entry and cannot enter the mode. objectstack-ai#36363 asks that installed apps' menus be editable through the customization layer; that needs the read-only posture to enter the mode too, and is raised with the card's seat rather than decided here. - The header's crowding (objectstack-ai#36201) is not addressed here: the mode only hides 「Edit app」 while it is on. - No docs page describes 「Edit app」 (`content/docs` has none), so no docs change. ## Verification Live run against a fresh local backend and the console (Vite), signed in as the seeded admin, on an app in a newly created writable package, at 1280 px and 1440 px: 「Edit app」 is shown in the page header; pressing it draws the bar (`Design modeCancelSave`, 「Save」 off), the sidebar moves below it; moving to another page of the app keeps the bar; 「Cancel」 removes it and 「Edit app」 comes back. Screenshots of both states at both widths are in the project files at `repo-objectstack-7/shots/36362/` (`before-1280.png`, `before-1440.png`, `design-1280.png`, `design-1440.png`). The card's 「PR 正文附截图」 is met by those files: a cloud container cannot upload images to the PR. Two minutes: as a workspace admin, open an app in a package you created in Studio, press 「Edit app」 in the page header: the blue bar appears with 「Cancel」 and a disabled 「Save」; open another page from the sidebar: the bar stays; press 「Cancel」: the bar goes and 「Edit app」 is back. Open an installed app: the header still offers 「Open APP in Studio」. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jSr8sNCnJrK6Q9kEF5 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…d-b-matches-button
Contributor
Author
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Landing · area f7-shell · 2026-11-22T14:12Z
State: ready + auto-merge into the merge queue. |
objectstack-fleet
Bot
deleted the
claude/issue-36347-cmd-b-matches-button
branch
November 22, 2026 14:32
247257110
pushed a commit
to 247257110/objectstack
that referenced
this pull request
Nov 23, 2026
…ck-ai#36363) (objectstack-ai#36437) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jSr8sNCnJrK6Q9kEF5 Fixes objectstack-ai#36363 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员进入设计模式后,左侧菜单变成可编辑:每个分组底部有「添加菜单项」,点了先在那个位置占一行虚线框,再弹出选择面板(搜索框,按对象、视图、仪表盘、报表、页面、链接分类,只列已经存在、还不在菜单里的);每一项鼠标移上去右边有「⋮」:上移、下移、移到分组、在前面或后面加一项、改名和图标、从菜单移除;也可以直接拖动。改动都等设计模式的「保存」一起写入并发布,所有成员都能看到;「取消」全部丢掉。安装来的应用(只读包)现在也能进入设计模式,改动存为本环境的定制。保存写的是应用存储的菜单,不是当前用户看到的那份:中文界面下保存不会把中文名写进菜单,管理员看不到的条目也原样保留,只改动管理员动过的那几项。改名只在部署的默认语言下开放(且该项显示名就是存储名),其他语言下名称框禁用并提示「菜单名称需在应用的源语言下修改」;新增、移动、图标在任何语言下都能改。其他包追加进菜单的条目(例如 HotCRM 收入模块的报价、产品)在这里不能移动、改名或移除,「⋮」里会说明要到那个包里改。有未保存的菜单改动时,切到别的应用、关闭或刷新页面会先弹出外壳原有的未保存提示(留在这里 / 放弃并离开),选「留在这里」改动还在;没有改动时照常直接切换。 - 为什么做:维护者要求菜单在运行界面里直接改,不再去 Studio;这是设计模式这条线的第二张卡。 - 出错会怎样:最坏情况是保存后菜单顺序或条目不是管理员想要的,再进设计模式改回即可;「移除」只是不在菜单显示,东西本身不删;若同一应用在 Studio 里有未发布的草稿,保存会拒绝并说明原因,不会覆盖别人的草稿。 - 要你做什么:无。翻译名称的写入(在非默认语言下改名)和服务端声明应用源语言是后续卡 objectstack-ai#36504,本 PR 不做。一处与 ADR-0146 D5 不同的地方已由席位记入修订卡:安装来的应用,管理员页头的入口从「在 Studio 中查看」变成「编辑应用」(进入设计模式),这是本卡第 7 条的要求。这只是过渡:按你新定的 objectstack-ai#36485,设计模式入口会移到左上角应用名菜单,页头这两个按钮会去掉,由那张卡来做;本 PR 只改了现有按钮的一个判断,没有新做按钮。 ## What changes While the design mode (objectstack-ai#36362) is on, the sidebar draws the app's menu with its editor (`layout/DesignModeMenu.tsx`), instead of the plain menu. - **Add menu item.** Each group, and the menu's top level, ends with 「Add menu item」. Pressing it holds a dashed row 「Choose a menu item…」 at that place and opens a picker: a search box over every kind, then the kinds Objects, Views, Dashboards, Reports, Pages and Link. A kind lists what exists and is not in the menu yet (`designModeMenu.ts` `targetKeyFor` / `entryForTarget`, one key per thing the menu opens); a record page is never offered. Picking one puts it in the held row. - **The entry's 「⋮」 menu**: move up, move down, move to group (a submenu of the other groups and the top level), add an item before or after, rename and icon, remove from the menu. Removing takes the entry off the menu only; the picker offers it again. - **Rename only in the source language** (seat ruling (4) on review 7081226692). The name field of 「Rename and icon」 is open when the session language is the deployment's default (`GET /api/v1/i18n/locales`, the descriptor marked `isDefault`; compared case-insensitively, `en` matching `en-US`) and the entry's shown label equals its stored label. Otherwise it is disabled with the hint 「Menu names are changed in the app's source language」, and only the icon is written. Adding, moving and the icon stay open in every language. The stored labels are taken to be in the default language because the server states no source language of its own: `/i18n/locales` exposes `isDefault` only, not `i18n.sourceLocale`. That gap, and the console's write path for a translation, are follow-up objectstack-ai#36504. - **Another package's entry** (its manifest's `navigationContributions`, appended to the app when it is served, found live on HotCRM) is not in the app's stored menu. Its 「⋮」 says 「Another package adds this item. It is moved, renamed or removed there.」, its move, rename and remove items are disabled, and it is not dragged; adding an item before or after it stays open. No entry is moved past it either: 「Move up」 or 「Move down」 into its place is off, and a drop onto it does nothing (its place is that package's). Such entries close their group when the app is served, so an own entry added or moved at or past them is stored and served before them; the editor draws it there too: the group's 「Add menu item」, 「Add an item after」 on such an entry, 「Move to group」 and a drop on the group's end land before them (L1-e review 7083961269 item 1). This holds once the editor's stored-menu read has landed, in a group the app's own menu holds; a group another package adds (N9) and the moment before that read (N10) are on follow-up objectstack-ai#36538. The click a drag ends with opens nothing (item 2, and review 7084606001): once a pointer drag is active, dnd-kit stops that click in the document's capture phase without cancelling it, so after a drop the editor refuses (onto another package's entry, which leaves the dragged link under the pointer) the link's default ran as a full page load and the mode was lost. The editor cancels that click on the window in the capture phase, which runs before dnd-kit's listener. An entry's link is also not natively draggable. The drag's end is also stamped from the pointer's own release on the window, and a new press clears it, because dnd-kit reports an end only after the start has rendered and a fast flick could otherwise leave every link shut (review 7085270448 S3). The save holds the same rule on its own, so it stands when the editor's stored read failed. Without this, a moved contributed entry would have been written into the app's menu and then served twice (the contribution is appended again, with no de-duplication), and a removed one would silently stay. - **Drag** moves an entry within its group or to another group (dnd-kit, pointer and keyboard). In the mode, Enter or Space on a focused entry picks it up for a keyboard move (dnd-kit's keyboard sensor) rather than opening its page; a click opens it. - **Staged with the mode.** Every edit is staged under one key (`app-menu:<app>`); 「Save」 writes it, 「Cancel」 drops it. The picker tells what is already in the menu by one key per thing it opens, spelled `kind/name` (`object/crm_lead`, `view/…`); they are compared only with each other and are no cache key. - **The save writes the stored menu, never the served one** (review 7081226692). The served app is translated for the reader (`translateApp`) and pruned of entries the reader may not open (`filterNav`), so writing it back would store the reader's language on every label and drop what the reader was not shown. The save reads the app as stored (the layered read, `/layers?package=…`, which serves a caller who may write the app its stored version, unpruned and untranslated: `effective ?? code`) and replays the edits on its navigation by entry id (`designModeMenu.ts` `rebaseMenuEdits`): an entry removed is removed; an entry added is put after the entry before it in the edited menu; an entry moved (to another group, or out of the order its group's other entries kept, found as the longest common run per group, so a removal beside an entry does not move it) is taken out and put back after the entry before it; an entry whose own keys changed has only those keys written. Every other stored entry, an entry the reader was never shown included, is the same object. A stored entry is matched to its served copy by id only when both name the same thing (type and target); otherwise, and for a stored entry without an id, by its group, type and target, in order (the editor gives served entries without an id the first free `nav_item_<n>` of what the reader was shown, which a stored entry pruned from the reader can already hold). Nothing the stored menu does not hold is ever written from its served copy: an entry another package contributes, or one that has left the stored menu since it was read, is not moved, patched or written, and takes no part in the order comparison; only an entry the served menu does not hold is an addition, and one whose id a stored entry holds is written under a fresh `nav_item_<n>` (the picker also mints ids against the stored menu). An entry naming no target is left out (`navPayloadOf`, as Studio's nav save). - **Where the save** (`designModeMenuSave.ts`) writes the app with its new `navigation` is where Studio's menu editing writes it (objectstack#30059, ADR-0146 D2/D3): the app's own package when the server lists it writable, else its paired customization package (asked of the ensure door, which creates it on first use), the body declaring the override at the base's listed version. The base's version is checked before the ensure door is asked, and a pair the server answers not writable is refused before anything is written to it. It is written by the runtime's confirmed-save rule: a draft with the first-write pin (a draft already pending, from Studio say, is refused and said, never overwritten nor published), then publish; a refused publish discards the draft this save wrote. A landed publish refreshes the console's metadata, so the menu re-reads. - **Installed apps enter the mode** (`ShellPageActions.tsx`): in the read-only (`view`) posture, 「Edit app」 now enters the mode where the customization door takes the caller; where it is walled off (a walled deployment, caller not the platform operator) the eye 「Open APP in Studio」 stays. This is kept, and kept minimal: one condition on the existing header button (about 10 lines), with no new button. The maintainer has since moved the mode's entry to the app-name menu and retired the header's 「Edit app」 and 「Open in Studio」 under objectstack-ai#36485 (card comment 7080271489). That later PR owns the installed-app path through the new entry; this PR lands first, so an installed app can enter the mode until then. - **Leaving with unsaved menu changes asks first** (the card's added requirement, comment 7079728193). Switching app from the app menu, a link out of the app, a reload or a tab close asks first while a menu change is staged; with nothing staged, nothing asks. This is the shell's one unsaved-changes prompt (`chrome/unsavedEdits.ts`: `confirmUnsavedLeave` and the `beforeunload` hold), which the design mode registers for every staged change since objectstack-ai#36362. The menu editor stages through the mode, so no code change was needed; the new tests pin it for the menu. That prompt offers two choices: stay, or leave and drop the changes. It has no 「Save」. The comment asks for the shell's prompt where one exists, so no three-button dialog was added. - **Outside the mode** the menu is as before: no 「Add menu item」, no editor 「⋮」. - An app whose menu is split in areas keeps its menu unedited in the mode (the picker and the moves work on one menu tree). - New i18n keys under `designMode.menu` in every hand-written locale, zh-Hant generated. Read first, by risk: 1. `ui/packages/app-shell/src/layout/designModeMenu.ts` `rebaseMenuEdits` / `staysInOrder` / `storedKeyer`: the edits replayed on the stored menu. 2. `ui/packages/app-shell/src/layout/designModeMenuSave.ts`: the stored read, the check order, where the write goes, and the pending-draft refusal. 3. `ui/packages/app-shell/src/layout/DesignModeMenu.tsx` `nameOpen` / `contributed`: the rename rule and another package's entries. 4. `ui/packages/app-shell/src/layout/ShellPageActions.tsx`: the read-only posture entering the mode, and the wall. ## Tests - New `layout/__tests__/designModeMenu-36363.test.ts`: move up/down stop at the group's ends; move to a group appends, never into itself; a drop lands before/after by direction; insert clamps; rename and icon patch; one key per thing; ids are unique. Added for the review: a view named without its object is keyed as that object's view (S1); no edit returns the stored menu itself; a removal beside an entry does not move it; a move to another group takes the stored entry there; a group the stored menu lacks puts the entry at the top level's end; an id-less stored entry is matched by its target. Added for review 7082970423: a move beside another package's entry (down past it, it up past one, it to the top) returns the stored menu itself (M1); an entry moved after it left the stored menu is not written back (M1); an added entry whose id a hidden stored entry holds is written under a fresh id, the hidden one kept (S2); a served entry given the id a hidden stored entry holds is matched by its target, so removing it removes it and not the hidden one (S2). All five were red against the previous `designModeMenu.ts`. - New `layout/__tests__/designModeMenuSave-36363.test.ts`: writable package saved and published; read-only package saved into its customization package declaring the override at the base's version; a base with no version refused before writing; an unlisted package refused; a pending draft not overwritten nor published; a refused publish discards the draft. Added for the review: a base with no version is refused before the ensure door is called (the calls are the layered read alone) (N1); a pair answered not writable is refused before anything is written to it; a move under a zh-CN-translated menu writes the stored English labels and the untouched entries as the same objects; an entry pruned from the reader stays where it was stored; a rename writes the one key it changed; id-less stored entries are matched and written without an id; an entry naming no target is left out (N3); the session language against the default one. Added for review 7082970423: a move beside another package's entry writes none of that package's entries (M1). - New `layout/__tests__/DesignModeMenu-36363.test.tsx`: 「Add menu item」 per group and the top level, 「⋮」 per entry; 「Move up」 staged and saved; 「Move to group」; the held row and a picker offering only what exists and is not in the menu; search over every kind, no record page; remove and offer again; rename; 「Cancel」 after three edits leaves the menu and writes nothing. Added for comment 7079728193: a moved entry not yet saved makes the app switch ask, staying keeps the move, and leaving goes on and writes nothing; a reload or a tab close is held while the move is unsaved, and released once it is saved; with nothing changed, switching asks nothing. Without the mode's registration, the first two go red. Added for the review: under zh-CN with English the default, the rename's name field is disabled with the hint, and the icon alone is saved, the stored English label kept; in the default language, an entry shown under a label other than its stored one is not renamed; adding and moving stay open under zh-CN; another package's entry says where it is changed and its move, rename and remove are disabled; dropping an entry on another group's end moves it there, dropped on an entry elsewhere it takes that place, and the save writes the result (N4, through `DndContext`'s `onDragEnd`). Added for review 7082970423: 「Move down」 above another package's entry is off and a drop on it does nothing; when the editor's stored read failed on entry (so another package's entry looked movable), moving it still writes none of it (M1). Added for review 7083961269: 「Add menu item」 at the end of a group that ends with another package's entry holds the row, and puts the pick, before it, and the save stores it there; 「Add an item after」 on that entry and 「Move to group」 into its group land before it; a drop on that group's end lands before it; an entry's link has `draggable="false"`, the browser's own drag of it is refused (`dragstart` default prevented), and after a drag refused on another package's entry the click it ends with leaves the address as it was, while a plain click still opens the entry's page. All four were red against the previous `DesignModeMenu.tsx`. Added for review 7084606001, on the real event order through dnd-kit's own pointer sensor: pointerdown on the link, moves past the 5 px activation distance, pointerup, then a click on the link; the click is stopped in the document (as in the browser) and its default is cancelled. It was red against d1522bf's `DesignModeMenu.tsx`, whose React click handler that click never reached. Its closing plain click now asserts that the entry's page opens (N11). Added for review 7085270448 S3: a drag whose end dnd-kit never reports, then the pointer's release, leaves the links open; red against effe780. - `ShellPageActions-36111.test.tsx`: a read-only package enters the mode; under the wall it keeps the eye; a writable package under the wall still enters. - `UnifiedSidebar.favoritesMenu-12427.test.tsx`: outside the mode no 「Add menu item」 and no editor 「⋮」. <details><summary>Readings at 71c8835</summary> - The touched test files and the objectstack-ai#36362 pins beside them: 78/78 passed. - Related-test sweep (every test file naming `UnifiedSidebar`, `ShellPageActions`, `DesignModeMenu`, `designModeMenu` or `useAppStudioEntry`, 84 files): 715 passed, 1 red: `sidebarGroupLabel.callSites-12795` wants every `SidebarGroupLabel` call site to declare the icon-mode hiding constant. Fixed in this PR (the editor's group label declares and passes it); the file re-run: 7/7. - `type-check` for `@object-ui/app-shell` and `@object-ui/i18n`: exit 0 (one `new Error(message, { cause })` under the package's ES2020 lib fixed first). - `dispatch-gates.mjs --commands` derived 41 gates (the same 41 at this head). 40 exit 0 at 4bc9854d3, this tree less three fixes in `ui/`. `pnpm --dir ui exec vitest run scripts/` was killed for memory on its first run; run alone it found 7 reds in three gates, all fixed here: a menu-kind i18n key built from a template (`check-i18n-call-site-keys`, `check-i18n-dead-keys`; now each key written whole) and a test mock binding the gate could not read as inheriting (`check-vi-mock-inherit`). The three files re-run: 381/381. The whole gate re-run at this head with two workers: 5,127 passed, 2 skipped, exit 0. `--ran` reconciliation: 41 derived, 41 run, 0 not measured, every line with its exit code. - `overlap-check.mjs`: origin/main and 10 open PRs sharing files (objectstack-ai#36391 shares `UnifiedSidebar.tsx`; the rest share locale files) all merge cleanly. At 6516005 (the follow-up fix): the i18n pack pins counted the new keys. The German icon hint quotes its example with „“ (`de-quote-pairing-3876`), the Korean picker's 로딩 중… is the pack's one rendering, and the Loading group counts `designMode.menu.loading` (`ellipsis-glyph-3878`). At 02d1fe6 (origin/main merged in, the PR was `dirty`): one conflict, the de quote-pair counts. Main's objectstack-ai#36286 took 124, so the menu editor's icon hint is the 125th pair. In the i18n package at the merge, 1,625 tests ran and all passed, the count pins included. 18 files could not load in the side worktree, because workspace packages were not linked there; CI runs them. `overlap-check.mjs` at the merge: origin/main and 7 open PRs sharing files all merge cleanly. At 1c271b1 (comment 7079728193, the leave prompt): `DesignModeMenu-36363.test.tsx` gains three cases: a moved entry asks when the app is left (stay keeps the move, leave goes on), the browser's reload or close is held while unsaved, and an untouched menu asks nothing. Each was checked red against its mutation (the registration taken out) before it went green. At def2f64 (CI red, `viewCacheInvalidation.guard`): the guard forbids a `view:`-prefixed template anywhere in app-shell. The menu editor's target keys, which are only an identity for "this entry is already in the menu" and no cache key, are now spelled `kind/name`. The four touched test files, the guard included: 33/33 passed. `dispatch-gates.mjs --commands` at this head derives the same 41 gates. `--ran`: 41 derived, 41 run, 0 not measured. 40 exit 0. One exits 1: `pnpm --dir ui exec vitest run scripts/` (two workers; the default run is killed for memory in this container), with 2 failures, both in `date-only-zone-pins-10183`. The child's case "control: an instant formats in the viewer's zone, 2026-09-01 03:00 here" in `FormulaFunctions.dateOnlyZone-10866` read 11:00, the Asia/Shanghai hour. That file run alone in the forked child passes 39/39. The child's node project runs with `isolate: false`, the pins set `process.env.TZ` and never put it back, and the suite-zone case passes no zone, so it reads whichever zone an earlier pin file in the same worker left. This PR touches no date, formula or zone code; it is an order dependence among the pins, filed as objectstack-ai#36492, not this change. `overlap-check.mjs`: origin/main and 5 of 6 open PRs sharing files merge cleanly; objectstack-ai#36411 conflicts only on the de quote-pair count line (both add a pair), which whichever lands second recounts. At aed9f08 (the rework for reviews 7081226692 and 7081253549, and ruling (4)): `type-check` for `@object-ui/app-shell`: exit 0 (after the workspace's dependency dists were rebuilt, `turbo run build --filter=@object-ui/app-shell^...`, 68 tasks). The three menu test files: 49 passed. `packages/i18n/` and `packages/app-shell/src/layout/` together: 261 files, 3,191 passed, 13 skipped. `dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41 derived, 41 run, 0 not measured. 40 exit 0. `pnpm --dir ui exec vitest run scripts/` (run as derived, default workers, completed this time) exits 1 with the same 2 failures in `date-only-zone-pins-10183` (objectstack-ai#36492, the TZ order dependence), and nothing else: 5,125 passed. The two changeset gates and `check:closed-ceremony-text` were run again after the changeset text changed: exit 0. `overlap-check.mjs`: origin/main merges cleanly; objectstack-ai#36351 merges cleanly; objectstack-ai#36411 conflicts only on the de quote-pair count line, as before. At 11b0e58 (CI's Type Check UI red at aed9f08): `designModeMenu-36363.test.ts(161,49) TS7053`. A new pin indexed `STORED[3].children`, which the test project types as `{}`. Only the package's main tsconfig had been run locally. The pin now casts it to `Menu`, as its siblings do. The package's whole `pnpm run type-check` (main and test tsconfigs) exits 0, and the file passes 29/29. The 41 derived gates were re-run at this head: `--ran` shows 41 of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only. All 16 Test UI shards were green at aed9f08. `overlap-check.mjs` is unchanged. At 5279122 (review 7082970423, M1 and S2): the three menu test files pass 56/56. The five new pure and save cases were run against the previous `designModeMenu.ts` first, and all five were red. `packages/app-shell/src/layout/` passes: 155 files, 1,219 tests. The package's whole `pnpm run type-check` (main and test tsconfigs) exits 0. `dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41 of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only. `overlap-check.mjs`: origin/main, objectstack-ai#36529, objectstack-ai#36525 and objectstack-ai#36351 all merge cleanly; objectstack-ai#36411 conflicts on the de quote-pair count line only, as before. At d1522bf (L1-e review 7083961269, items 1 and 2): `DesignModeMenu-36363.test.tsx` passes 22/22; the four new cases were run against the previous `DesignModeMenu.tsx` first, and all four were red. `packages/app-shell/src/layout/` passes: 155 files, 1,224 tests. The package's whole `pnpm run type-check` exits 0. `dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41 of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only (2 failures in `date-only-zone-pins-10183`, 5,125 passed). `overlap-check.mjs`: origin/main, objectstack-ai#36525 and objectstack-ai#36351 merge cleanly; objectstack-ai#36411 conflicts on the de quote-pair count line only, as before. At effe780 (L1-e review 7084606001 item 2, and the changeset sentence from review 7084744396): `DesignModeMenu-36363.test.tsx` passes 23/23; the new real-event-order case was red against d1522bf's `DesignModeMenu.tsx`. `packages/app-shell/src/layout/` passes: 155 files, 1,225 tests. The package's whole `pnpm run type-check` exits 0. `dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41 of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only (2 failures in `date-only-zone-pins-10183`, 5,125 passed). `overlap-check.mjs`: origin/main, objectstack-ai#36525 and objectstack-ai#36351 merge cleanly; objectstack-ai#36411 conflicts on the de quote-pair count line only, as before. At f68c14b (review 7085270448 S3 and N11): `DesignModeMenu-36363.test.tsx` passes 24/24; the new flick case was red against effe780's `DesignModeMenu.tsx`. `packages/app-shell/src/layout/` passes: 155 files, 1,226 tests. The package's whole `pnpm run type-check` exits 0. `dispatch-gates.mjs --commands` derives the same 41 gates. `--ran`: 41 of 41 accounted for, 40 exit 0, and `vitest run scripts/` exits 1 on objectstack-ai#36492 only (2 failures in `date-only-zone-pins-10183`, 5,125 passed). `overlap-check.mjs`: origin/main, objectstack-ai#36525 and objectstack-ai#36351 merge cleanly; objectstack-ai#36411 conflicts on the de quote-pair count line only, as before. At c0eb5d6 (CI's Lint UI red at f68c14b, `object-ui/no-synthetic-event-trigger`, ADR-0054 C1): the three new `dispatchEvent(new MouseEvent(...))` lines of `DesignModeMenu-36363.test.tsx` are `fireEvent.click` and `fireEvent.pointerUp(window)`, asserting the same. Only that test file changed. `eslint` over the PR's ui files: 0 errors (warnings as on main). The menu tests pass 24/24, and the flick case is still red against effe780's `DesignModeMenu.tsx`. The package's whole `pnpm run type-check` exits 0. The derived gate sweep was not re-run: no source file changed since f68c14b's sweep; it does not include ESLint, which is why it missed this red. </details> ## Acceptance notes - **ADR-0146 D5.** D5 draws the app → Studio bridge for a read-only package as a browse entry (the eye). For a caller the customization door takes, an installed app's 「Edit app」 now enters the design mode instead, as the card's item 7 asks (an installed app's menu is edited as this environment's customization). The seat records the D5 row on the ADR revision card objectstack-ai#36086. A member, and a caller behind the wall, see what they saw before. - **Card item 7 (installed apps enter the mode): this PR delivers it.** On main, HotCRM still shows 「Open in Studio」 because this PR is not merged yet. Once it merges, an installed app such as HotCRM shows 「Edit app」 to a caller the customization door takes, and pressing it enters the mode. Verified live on HotCRM in zh-CN (see Verification). - **Renames in another language are not offered** (seat ruling (4)). The rule takes the deployment's default language as the app's source language, because the server does not expose `i18n.sourceLocale`. A deployment whose default language differs from the language its apps are authored in would see the name field closed in every language until objectstack-ai#36504 adds `sourceLocale` to `/i18n/locales` and a console write path for a translation. - **Another package's menu entries are read-only here.** Moving or removing them belongs to the contributing package (or a later card for an override of a contribution). - **Left as they are, from reviews 7082970423 and 7083821939; follow-up objectstack-ai#36538.** The seat collected N6 through N10 on follow-up card objectstack-ai#36538 (N10, from review 7084744396: before the editor's stored-menu read lands, an entry added at a group's end is drawn after another package's entries). N7 (two id-less stored entries naming the same target), N8 (a layered read answering neither `effective` nor `code`) and N9 (another package's group listed in 「Move to group」) are the nits of review 7083821939 and are not changed here. N6: nothing pins the stored version between the save's layered read and its draft write, so a publish by someone else that lands in that window (the length of one request) is overwritten; the first-write pin refuses only a pending draft. N2's other half: while the tenancy posture is still being read, a walled deployment can briefly show 「Edit app」 to a tenant administrator; the posture hook answers `undefined` both while reading and on a deployment that reports none, so closing it there would also close the mode where no wall exists, and the server refuses the save behind a wall either way. N5 (a link's typed label stored as its base label in any language) is on objectstack-ai#36504. - **Where it is saved** is the same document Studio's menu editing saves, so a menu edited here shows in Studio, and the reverse. - An app whose menu is split in areas is not edited in the mode (its menu is drawn unedited); no such app is in the showcase or HotCRM. - Not in this PR, as the card says: new dashboard or report (objectstack-ai#36364), adding, removing or renaming groups, visibility conditions, personal favorites. - **The chain stops at this card, with one exception.** The maintainer ruled at 2026-11-22 13:52Z that only the current stage is finished, so objectstack-ai#36364 is not started from this chain. At 14:08Z the maintainer approved resuming objectstack-ai#36366, as its own PR after this one lands; no branch or PR is open for it yet. - No docs page describes the runtime menu editing, so no docs change. ## Verification **HotCRM, zh-CN, at this head** (review 7081226692 item (3)). HotCRM 6.5.0 (`pnpm dev`, a fresh database, `pnpm demo:staff`) on port 4001, this branch's console (Vite) proxied to it, a Chromium context in `zh-CN`, signed in as the seeded admin. `GET /api/v1/i18n/locales` marks `en` default. HotCRM's package `app.objectstack.hotcrm` is listed read-only. - The design mode drew the zh-CN menu (首页, 销售主页, 销售 › 线索, 客户, …, 35 entries). 「⋮ → 改名和图标」 on 线索: the name field disabled, the hint 「菜单名称需在应用的源语言下修改」. 「⋮」 on 报价 (the revenue module's contribution): 「此菜单项由另一个包添加,请在那个包中移动、改名或移除。」 - Edits: 「⋮ → 上移」 on 客户 (above 线索); 「添加菜单项」 under 数据洞察, 对象, picked 活动参与者 (`crm_event_attendee`). Saved; the bar went. - Network, in order: `GET /api/v1/i18n/locales` 200; `GET /api/v1/meta/app/crm_enterprise/layers?package=app.objectstack.hotcrm` 200 (on mount, and again in the save); `POST /api/v1/packages/app.objectstack.hotcrm/ensure-customization` 201; `PUT /api/v1/meta/app/crm_enterprise?mode=draft&package=app.objectstack.hotcrm.custom` 200; `POST /api/v1/meta/app/crm_enterprise/publish?package=app.objectstack.hotcrm.custom` 200. Every request carried `Accept-Language: zh-CN`. - The PUT body: `overrides: {package: app.objectstack.hotcrm, basedOn: 6.5.0}`; its `navigation` holds no CJK character; 34 stored entries plus the one added; none of the 8 contributed entries (报价, 产品, 价格表, 产品目录, 知识库, 回款节点, 收入手册, 订单与回款手册) written; no entry's own keys differ from the stored one; 销售 reads `nav_account, nav_lead, …` and 数据洞察 ends with `{id: nav_item_1, type: object, objectName: crm_event_attendee}`. - The stored menu after the save (layered read) equals the PUT body, and, with the two edits undone, equals the stored menu before, byte for byte. - An English reader (admin, `Accept-Language: en`): the served menu after the save, with the two edits undone, equals the served menu before, byte for byte. Labels read Accounts, Leads, Contacts, … - A member (`na.rep@objectos.ai`, demo staff): served in English and in zh-CN, 销售 starts with 客户 / Accounts then 线索 / Leads, and 数据洞察 ends with the added entry. Screenshot `hotcrm-06-member-zh-CN.png` shows the moved order in the member's sidebar. Files in the project files at `repo-objectstack-7/shots/36363/`: `hotcrm-01-design-mode-zh.png`, `hotcrm-02-rename-closed-zh.png`, `hotcrm-03-contributed-zh.png`, `hotcrm-04-edited-zh.png`, `hotcrm-05-saved-zh.png`, `hotcrm-06-member-en-US.png`, `hotcrm-06-member-zh-CN.png`, and the recorded requests `hotcrm-network.json`. **Earlier, on the showcase** (before the review): Live run against a fresh local backend and the console (Vite), signed in as the seeded admin, on the showcase app (an installed, read-only package), at 1440 px: - 「Edit app」 was shown (no eye) and entered the mode; the menu drew each entry with 「⋮」 and 9 「Add menu item」 rows. - 「⋮」 on an entry opened the menu with 「Move to group」's submenu; 「Add menu item」 held the dashed row and opened the picker; 「Objects」 offered 11 objects not in the menu (Announcement, Client Brief, Expense Line, …); picking Announcement put it in the row. - 「⋮ → Move up」 on Page Authoring moved it above Capability Map; 「Save」 was on, saved, and the bar went. - After a reload the menu read Page Authoring, Capability Map, My Work, Approvals, New Project (Wizard), Settings, Announcement, Projects: both edits kept, written into the showcase's customization package. - Added for comment 7079728193, on the same setup: entering the mode and 「⋮ → Move down」 on Capability Map, without saving, moved it below Page Authoring. Picking Setup from the app menu raised the browser's prompt 「Leave design mode? Your unsaved changes will be lost.」. Choosing to stay kept the address, the bar and the moved menu (Page Authoring, Capability Map, My Work, …). 「Cancel」 then left the mode. The run was on this branch's head with objectstack-ai#36366's commits stacked on it in the same tree; the leave prompt has not changed since objectstack-ai#36362. Screenshot `leave-app-menu.png` shows the app menu with the change staged. The browser's own prompt does not appear in a page screenshot. Screenshots are in the project files at `repo-objectstack-7/shots/36363/`: `m-design.png` (the editor), `m-actions.png` (the entry menu), `m-picker-kinds.png` and `m-picker-objects.png` (the picker), `m-staged.png`, `m-after-reload.png`. The card's 「PR 正文附截图」 is met by those files: a cloud container cannot upload images to the PR. Two minutes: as a workspace admin, open HotCRM, press 「Edit app」; under a group press 「Add menu item」, pick an object, press 「Save」; reload: the entry is there. Enter again, 「⋮ → Move up」 on an entry, then pick another app from the app menu: the prompt asks; stay, and the move is still there. 「Cancel」: the menu is as it was. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jSr8sNCnJrK6Q9kEF5 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
Requested by Steedos · project thread
Fixes #36347
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ
Clause-②: no
Metadata-protocol: none
Ruling-ref: 7074574380
维护者速读
What changes
Ruling 7074574380 on #36112 (B, 「B ⌘B 和按钮一样固定展开」): ⌘B / Ctrl+B does what a press on the sidebar's expand / collapse button does. This replaces the words "⌘B unchanged" of ruling 7069868269 (F1, on #36112) and the shortcut half of "on the top-bar trigger (and its shortcut)" in ruling 6973617688 on #35062; every other line of both stands.
useConsoleSidebarRailPanel(consoleSidebarRail.ts) now answers the chord itself from 768 px up, with the button's own action: the step a trigger click takes in the capture phase (beforeButtonToggle: on a narrow window, keep the narrow-window choice expanded before a dock) followed by the provider'stoggleSidebar, the same call the trigger makes. So the key and the button write the same choices by construction: the wide-window choice, the narrow-window choice and thesidebar_statecookie. While the menu floats, the chord docks it where it is (dockFloat), as the ruling's execution section says; focus does not move.documentin the bubble phase, after every element listener on the way (an editor that takes the chord still stops it there first), and stops propagation so the primitive's listener on thewindowdoes not toggle a second time. The pin "one ⌘B is one press" holds both halves: nothing reaches the window from 768 px up, and on a phone the primitive's listener still opens the drawer.@object-ui/componentsis not changed.ui/sidebar.tsx(a synced Shadcn primitive, a no-touch zone) keeps its default listener for every other host; the console overrides it from its own layer instead of changing the published default. The phone, and a sidebar with the console's collapse off, keep the primitive's toggle.toggleFloatsnote, thecommandopener and the focus-into-float branch it fed are gone (their only producer was ⌘B). Unchanged: the edge's hover and press float, Esc / a chosen entry / a press outside fold a float, the phone, the 1280 px threshold, the width, the head's collapse button inside a float (it folds the float, as before).SIDEBAR_TOGGLE_CHORD, one constant for the tooltip, the shortcuts dialog's advertisement and the matcher); comments inconsoleSidebarRail.ts,useResponsiveSidebar.ts,LocalizedSidebarTrigger.tsx,ConsoleLayout.tsx,advertisedShortcuts.tsandUnifiedSidebar.tsx; step 3 ofplatform-core.builtin-apps-nav-render(revision 19); a changeset.Read first, by risk:
ui/packages/app-shell/src/layout/consoleSidebarRail.ts— the document keydown effect anddockFloat(the stopPropagation is the load-bearing line).ui/packages/app-shell/src/layout/__tests__/UnifiedSidebar.hiddenCollapse-35062.test.tsx— the new top-level describe named for console sidebar: ⌘B / Ctrl+B should do what the expand/collapse button does (ruled B), not toggle the temporary float #36347.docs/qa/platform-checklist/areas/platform-core.json— step 3 wording and the revision 19 history row.Tests
UnifiedSidebar.hiddenCollapse-35062.test.tsxandUnifiedSidebar.railOverlay-27593.test.tsxthat floated with ⌘B now float from the left edge; the keyboard walk of a collapsed group docks with ⌘B and stays docked after Enter.UnifiedSidebar.recentThisApp-36112.test.tsxfires its phone ⌘B where a real key press lands (the body), not on the window.Readings at e374f63
vitest runof the three sidebar files:Test Files 3 passed (3),Tests 47 passed (47).vitest run packages/app-shell/src/layout packages/app-shell/src/chrome packages/app-shell/src/hooks:Test Files 280 passed (280),Tests 2229 passed (2229)(the shortcuts dialog's wired-only pin and the trigger's app-bar pin included).pnpm --filter @object-ui/app-shell run type-check(both tsconfigs, tests included): VERDICT command-exit 0.ablation-replaceanchor 1 → 0, blob a8a20742c48a → b3a7f2a5c15a;Tests 5 failed | 38 passed (43)— red: the 1024 px dock, the button-equals-key comparison, the float dock, the one-press pin, the keyboard group walk; restore: blob == HEAD (a8a20742c48a),git diff HEADempty. The 1600 px dock and collapse stay green under the ablation, as expected: there the provider's toggle alone already docks and collapses.Acceptance notes
platform-core.keyboard-shortcut-surface's source note still namesui/sidebar.tsxas the ⌘B handler; from 768 px up the console's handler answers now. Its steps ("⌘B and Ctrl+B toggle the sidebar") stay true; the note is outside this claim's file surface, so it is left for the next edit of that item.node scripts/pm/overlap-check.mjs: origin/main merges cleanly; fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223 (stale, last updated 2026-11-19) conflicts onplatform-core.jsonin the same item, and already conflicts with origin/main there.Verification
Two minutes: in the console at 1440 px, press ⌘B (Ctrl+B): the sidebar collapses; press it again: it comes back beside the page; reload: it stays there. Narrow the window below 1280 px and press ⌘B: the collapsed sidebar comes back beside the page instead of floating. Rest the pointer on the left edge of a collapsed sidebar: the menu floats; press ⌘B: it stays, docked.
Gates: the local derived subset and its readings are in the os-dev report on #36347; every family CI runs is read from this PR's check-runs.
Generated by Claude Code