Skip to content

feat(console): the design mode is entered from the app-name menu; the page header drops Edit app and Open in Studio (#36485) - #36621

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36485-design-entry-app-menu
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36485-design-entry-app-menu

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #36485
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:系统管理员在任何应用里点左上角应用名,应用列表下面、和「添加应用」同一组多了「编辑应用」,点了直接进入设计模式;页头右上角不再有「编辑应用」和「在 Studio 中查看 某应用」两个按钮,只剩 AI 助手和帮助。自建应用和安装来的应用一样;侧栏收起时从左边缘滑出的菜单里也能点到;普通成员看不到,手机上没有入口。
  • 为什么做:运行界面设计模式专题的一张子卡,按你「立卡」的那条建议,把设计入口集中到应用名菜单,页头只留每页自己的按钮。
  • 出错会怎样:最坏是管理员在页头找不到「编辑应用」,要去应用名菜单里点;设计模式本身和保存都没改,撤回本 PR 即恢复原来的按钮。
  • 要你做什么:无。

What changes

  • App-name menu (SidebarAppMenu): a new 「Edit app」 item (sidebar-app-menu-edit-app, the topbar.editApp key every locale already carries, no new i18n key) under the app list, in one group with 「Add app」 (one rule above the group, none between the two). Choosing it calls the shell's useDesignMode().enter for the app on screen: no navigation, no Studio.
  • Who sees it — the header button's condition, carried over unchanged, no new judgement: useStudioEntryGate (the gate useAppStudioEntry reads) answers non-null, i.e. useWorkspaceAdminStatus().isAdmin AND useCanAuthorMetadata() (the server-reported manage_metadata capability) AND the app's package is one GET /api/v1/packages lists (not a kernel package: Setup, Studio, Account get none); a read-only package (posture: 'view') only where the customization door takes the caller (!postureHasOrgWall(useTenancyPosture()) || user.isPlatformAdmin), as 设计模式(二)菜单编辑:添加已有的菜单项,上移下移、移到分组、移除、改名和图标 #36363 set it. It reads the app's own Studio path (appStudioDesignPath); the gate judges the package id only, so the answer is the one the header got on every route.
  • While the mode is on the item is not drawn (same as the header button was). Where no shell holds the mode it is not drawn either (the header used to fall back to a Studio link there; nothing in the console renders the sidebar outside ConsoleLayout's provider).
  • Collapsed sidebar: the float from the left edge is the same panel with the same head, so the item is there too (pinned and browser-measured).
  • Phone: the sidebar head with the app menu is drawn from 768 px up only, so no entry, as before.
  • Page header (ShellPageActions): EditAppButton is deleted: no 「Edit app」 and no 「Open {app} in Studio」 in the group on any route. The group now reads no Studio gate at all (useAppStudioEntry(false), app only, for the help menu's package). useAppStudioEntry stays: AppHeader (the top bar still drawn below 768 px and on docs pages) reads it.
  • Installed apps today: on main an installed (read-only) app already enters the mode (设计模式(二)菜单编辑:添加已有的菜单项,上移下移、移到分组、移除、改名和图标 #36363 landed), so in this PR an installed app's menu item behaves exactly as a self-built one's. Its one exception is the walled-deployment case above: there the item is absent (the header showed the eye into Studio; that eye is gone with the header buttons, so such a caller reaches Studio through the app switcher's row or Studio's landing).
  • Onboarding: there is no step pointing at 「Edit app」: chrome/OnboardingWalkthrough.tsx is a stub that renders nothing, and no other tour exists in the console.

Tests

Pins added or rewritten (vitest, root ui/)
  • SidebarAppMenu-36112.test.tsx, new top-level describe 「Edit app」 in the app menu enters the design mode: placement under the list with one rule before the group; choosing it turns the real useDesignModeController on and the item is gone while on; a read-only package's app has it and enters; walled + read-only gets none, walled + writable keeps it; controls: a member, an admin without manage_metadata, the Setup app (package not listed), no shell holding the mode. The package list is the stubbed fetch; the file-level beforeEach now stubs it for every test, since the menu reads the gate for admins.
  • ShellPageActions-36111.test.tsx: the group's order is comments then help; the old 「Edit app」 / eye / design-mode-button describes are replaced by one asserting neither entry (test id and accessible name) for writable and read-only packages, with and without a design-mode shell, walled, and for a member.
  • UnifiedSidebar.hiddenCollapse-35062.test.tsx, new top-level describe: sidebar collapsed at 1024 px, floated by a press on the left edge, the real Radix app menu opened from inside the float offers 「Edit app」, and choosing it turns the mode on.
Runs at f7d907a
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/layout/__tests__/ plus ObjectView.shellPageActions-36111, RecordDetailView.topBar-27524, PageView.consoleHeader-36111 (lock VERDICT command-exit 0): Test Files 157 passed (157), Tests 1255 passed (1255). Run at 2b4666e plus the test edits; the float pin and typing commit followed, re-run: the two harness files 36/36.
  • pnpm --filter @object-ui/app-shell type-check (both tsc --noEmit and tsconfig.test.json): VERDICT command-exit 0.
  • eslint on the five changed source and test files: 0 errors.
Ablation (one-shot, not kept)
  • Menu item: node scripts/ablation-replace.mjs --file ui/packages/app-shell/src/layout/SidebarAppMenu.tsx --anchor '{enterDesignMode && EDIT_APP_ITEM_ELEMENT}' --delete -- vitest … (anchor 1 → 0, blob 367de8db → 71946a69): 5 failed | 31 passed: every positive pin in both harnesses red, every control green; restored blob 367de8db = HEAD.
  • Header: ShellPageActions.tsx swapped for its base-commit text under an EXIT trap: 3 failed | 5 passed (the order pin and both no-entry pins red; the member control and the scope pins green); restored blob 2e640646 = HEAD, git status clean.

Acceptance notes

  • Browser, own stack (CRM example on its own port, --fresh; Console dev server pointed at it), 1440 px. HotCRM is not in this container: the CRM example's com.example.crm is a code package served read-only, so it stands in for the installed app; a writable app was made for the self-built case (POST /api/v1/packages com.acme.mine plus app my_sales saved into it).
    • Admin, read-only CRM app and writable My Sales app: header group children = help only, no 「in Studio」 text anywhere on the leads list, the accounts list and the pipeline dashboard; menu reads CRM · Setup · (My Sales) · Edit app · Add app; choosing 「Edit app」 draws the design-mode bar; reopening the menu in the mode shows no 「Edit app」; collapsed sidebar, floated from the edge: item present, choosing it draws the bar.
    • Member (created by the admin, no CRM permissions): menu reads CRM, no 「Edit app」.
    • 390 px: no app menu trigger and no 「Edit app」 anywhere.
    • Not measured in the browser: a report route and a custom page route (the CRM example has neither in its menu); the group is the same component on every route and PageView.consoleHeader-36111 / ObjectView.shellPageActions-36111 / RecordDetailView.topBar-27524 stayed green.
  • Screenshots (before = the two files at the base commit, served by the same dev server), in /mnt/project-files/objectstack-seat2/:
    • header before / after: 36485-before-crm-readonly-header.png, 36485-before-selfbuilt-writable-header.png / 36485-after-crm-readonly-header.png, 36485-after-selfbuilt-writable-header.png
    • app menu before / after: 36485-before-crm-readonly-app-menu.png / 36485-after-crm-readonly-app-menu.png, 36485-after-selfbuilt-writable-app-menu.png
    • in the mode: 36485-after-*-design-mode-on.png, 36485-after-*-app-menu-in-mode.png; float: 36485-after-*-float-app-menu.png, 36485-after-*-float-design-mode-on.png; member: 36485-after-member-app-menu.png
  • The top bar still drawn from 640 to 767 px and on an app's docs pages keeps its Studio pencil / eye (AppHeader, outside this card's file surface): it opens Studio, not the mode. Left as is; named in the report for the seat.
  • designMode.tsx's docblock still says the mode is entered from the page header's 「Edit app」 (ShellPageActions); the file is read-only here (open PR feat(console): create a dashboard from the design mode's Add menu item #36606 edits it). ui/packages/app-shell/README.md's "App → Studio reverse bridge" describes the top bar only and does not mention the mode's door; also outside the file surface. Both named in the report.
  • ADR-0146 D5 says the app bar entry draws as 「Open {app} in Studio」; the page header's copy of it is gone. The sentence goes to the seat's ADR-revision card, not this PR.

Verification

Read first:

  1. ui/packages/app-shell/src/layout/SidebarAppMenu.tsx, useEnterDesignMode: the gate carried over from the header; the risk is a viewer who saw the header button and now sees no menu item, or the reverse.
  2. ui/packages/app-shell/src/layout/ShellPageActions.tsx, ShellPageActionsGroup: the group no longer reads the gate.
  3. UnifiedSidebar.hiddenCollapse-35062.test.tsx, the new last describe: the float path.

Two-minute check: as an admin, open any app page at desktop width, click the app name at the top left: 「Edit app」 sits under the app list above 「Add app」; click it and the blue Design mode bar appears; the page header's top-right has only the AI and help buttons.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation 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 Author

repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm

Flake reading — PR #36621 @ f7d907a · 2026-11-23T04:18Z

  • Red: Test UI (8/16) (job 137479354705, run 45109579194). The only failing case is in DataPillar.panelHold-27629.test.tsx, ""Show me" reopens the action with its text, and fixing it there releases the hold": Unable to find an element by: [data-testid="studio-held-message"]. The other 304 files in the shard passed.
  • Not this PR: the case is in the Studio Data pillar's hold. This diff touches the app-name menu and the page header's button group. The same file flakes on main without any PR: the area measured 1 red in 12 runs on origin/main ed0edb1b50 for its sibling case. Filed as Test flake: DataPillar.panelHold-27629 'leaving the Actions tab keeps the hold' sometimes sees a save of the unparsable predicate (fails 1 in ~5–8 runs on main) #36619.
  • Action: one re-run of the failed jobs through the relay (rerun-failed.mjs). If it goes red a second time, the area treats it as real and reads it again.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm

席位核对

ACCEPT — PR #36621 @ f7d907a (head of record, full sha on the PR) · card #36485 · L1 first read by area s2-B (area order rule 9) · 2026-11-23T04:36Z · no contract review owed (Clause-②: no: no new export and no new i18n key; the item reuses topbar.editApp)

  • Shape: open, draft, base main; first line Fixes #36485, Clause-②: no, Metadata-protocol: none; no closing keyword near another card (l1-face.mjs --pr 36621 CLEAN).
  • Premise: held (claim 7090381896). On main the page header's group drew 「Edit app」 (writable) or 「Open {app} in Studio」 (read-only) and the app-name menu offered no way into the design mode; the seat's order puts the entry in the app-name menu and takes both header buttons out.
  • Scope: 6 files, 332+/224- (556 lines): SidebarAppMenu.tsx (the 「Edit app」 item in one group with 「Add app」, useDesignMode().enter), ShellPageActions.tsx (EditAppButton deleted; the group reads no Studio gate), three test files, one changeset. Not governed. Stays off 设计模式(四)页头按钮:选哪些动作固定在页头、哪些收进「更多」,可以拖动排序 #36366's files.
  • Diff read: the item's condition is the header button's, carried over: useStudioEntryGate non-null (workspace admin + manage_metadata + a package GET /api/v1/packages lists), a read-only package only where the customization door takes the caller (no org wall, or a platform admin). Not drawn while the mode is on, nor where no shell holds the mode. useAppStudioEntry stays for AppHeader (640–767 px and docs pages) and the app switcher row, both unchanged.
  • Changeset read against the diff: matches; patch per Metadata-protocol: none.
  • Tests and gates: new pins in SidebarAppMenu-36112 (placement, enter, hidden while on, read-only, walled, four controls), ShellPageActions-36111 (no entry on any posture), UnifiedSidebar.hiddenCollapse-35062 (collapsed float). Ablation: menu item removed ⇒ 5 red, controls green; header restored to base ⇒ 3 red; both restores blob-equal to HEAD. Browser (CRM example, 1440 px / 390 px, admin and member) with before/after screenshots in the PR body. CI at f7d907a: 39 success, 13 skipped, 0 failing; Test UI went red once on flake Test flake: DataPillar.panelHold-27629 'leaving the Actions tab keeps the hold' sometimes sees a save of the unparsable predicate (fails 1 in ~5–8 runs on main) #36619 (reading 7091478894) and passed on its one re-run.
  • Accepted deviations: none.
  • Out of scope: ADR-0146 D5's 「app bar entry」 sentence → carrier ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086 row 7091637629 (lands after this PR). The designMode.tsx docblock still names the header button as the gate's source → feat(console): create a dashboard from the design mode's Add menu item #36606.
  • Landing: non-governed, ≤3000 lines; K = 5 (<15) at this head ⇒ area lands it in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 04:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 45112953275 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (8/16) — 失败步骤: Run the ui tests (shard 8/16)

    × leaving the Actions tab keeps the hold, and the held line names the action 1086ms
    FAIL   dom  packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx > DataPillar — an action predicate that does not parse holds with the draft (objectstack#27629) > leaving the
      ↳ 失败原因: AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 8 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants