Skip to content

Studio 重构(3-4b):仪表盘列表的「新建」跳到应用的设计模式并直接打开「添加菜单项 → 仪表盘」(设计模式加一个到达入口) #36907

Description

@os-support-ai

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

③ topic child · Source: topic #36890. Maintainer 06:34Z decision card 「Studio 仪表盘、报表列表的『新建』怎么做?」 → 「新建跳到设计模式加菜单」 (dashboard half; the report half follows #36692, decision 13). Part of #36890.

为什么

专题 #36359 定过「新建仪表盘在设计模式的『添加菜单项』里做」,为的是不产生不在任何菜单里的仪表盘。Studio 的仪表盘列表要有「新建」,点了就走这条现成的流程。

今天(读代码确认,主干 0819cab)

  • AS/layout/designMode.tsx:52-53:「The mode has no address: no URL enters it.」模式由 ConsoleLayout 按应用持有,手机上永远不开。
  • 全仓只有 AS/layout/SidebarAppMenu.tsx:167, 238(useEnterDesignMode)进入;DesignModeMenu.tsx 不读任何 location.state 到达指令,只往外发 dashboardEditArrival(:493)。
  • PR fix(console): report editing is its own entry, mutually exclusive with design mode #36848 之后:仪表盘或报表处于编辑状态时 enter() 会被拒绝;「New dashboard…」保留,「New report…」删除。

要做的

  1. 仿照 designModeArrival.ts 加一个「到达即进入设计模式并打开添加菜单项的仪表盘一栏」的导航状态,由 ConsoleLayout 或 DesignModeMenu 读取后调用 enter()。
  2. Studio 仪表盘列表的「新建」用它,目标应用按决定 6 的规则选;建完落在菜单里,进入编辑(沿用 设计模式(三)在「添加菜单项」里新建仪表盘、新建报表:建完落在占好的位置,直接进入编辑 #36364 的行为)。
  3. 手机宽度不提供这个「新建」;目标应用找不到时不显示「新建」并说明原因。
  4. 和设计模式的在途工作(design mode: a menu rename in a non-source language is stored as that language's translation (console translation write path + source locale on /i18n/locales) #36504 / PR feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation #36858、设计模式改名:标签是内联多语言映射时,用源语言改名会把整个映射替换成一个字符串,其他语言的译文丢失 #36876、设计模式:暂存的记录按钮顺序只在页头预览,行菜单要保存后才跟上 #36820)协调,避免同时改 DesignModeMenu.tsx。

验收

  • 自建应用和 HotCRM 上,Studio 仪表盘列表点「新建」→ 应用设计模式、添加菜单项的仪表盘一栏已打开 → 建完挂在菜单上、进入编辑。

Blocked-by: #36906

Grading: area:ux · Feature · design mode entry point (no address enters it) · builders creating dashboards · evidence: read from code. Topic child ⇒ p2.
Dedupe: design mode arrival / useEnterDesignMode (no open card; #36359 children closed).
Reader: seat repo:objectstack#3, one os-dev card. Size M. Metadata-protocol: none. Wave 3.

Activity

  1. added
    enhancement
    priority:p2
    pm:blocked
    domain:ui
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: unblocked 2026-11-25T13:41Z

  3. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

    Held behind #37237 · zone a4-S hot-file serial

    Blocked-by: #37237

  5. added
    pm:blocked
    and removed
    pm:queue
    on Nov 25, 2026
  6. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

    Claim: PM loop round 3
    Session: session_01QSeKYkkwuF6UuFtu85Yd5H
    Account: os-justin
    Branch: claude/issue-36907-studio-new-dashboard-design-mode
    Worktree: cloud session (its own container)
    Domain: domain:ui
    Seat: repo:objectstack#4
    Area: a4-S
    File surface:

  8. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  9. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYoLfUxK6MRhuSp7nAt

    os-dev-report

    {
      "issue": 36907,
      "status": "done",
      "branch": "claude/issue-36907-studio-new-dashboard-design-mode",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37368",
      "session": "session_01QSeKYoLfUxK6MRhuSp7nAt",
      "premise_still_valid": true,
      "summary": "Studio's dashboard list New now opens the target app (decision 6 via studioAppCreateSegment, with the .custom pair leg from #37348) through a new navigation-state arrival (designModeAddDashboardArrival). ConsoleLayout reads it once via useDesignModeArrival, replaces the history entry without it, then calls the new enterOpening. DesignModeMenu takes that one-shot opening and opens the Add-menu-item picker on Dashboards. A refused enter() only toasts the mode's own reason, a phone does nothing, and no URL enters the mode. The created dashboard hangs in the menu and opens for editing with ?studio= back to the list. The list offers no New at phone width, and with no target app it shows none and says why (engine.list.dashboardNewNoApp, en and zh). The report New is unchanged. Riders: N1 (36906 test header) and N2 (changeset note on rule 1's menu leg for pairs). Small structural change: design mode's held-out count moved from state to a ref, so an editor opening in the same commit as the arrival is still judged (pinned). Shares StudioMetadataArea.tsx with in-flight branch claude/issue-36909-studio-pillar-dead-code and the studio en/zh namespace files with claude/issue-37139 and open PR #37362; all merge cleanly by merge-tree. The claim said no file was shared with #36909; AreaCreate lives in StudioMetadataArea.tsx, in a different hunk.",
      "tests": "Final head 6fbbdd9b (rebased on d5ae7a47, squashed to one commit). (1) vitest over DesignModeMenu-36363, designMode-36362, StudioAreaAppOpen-36906, ResourceListPage.pairCreate-36897: 'Test Files 4 passed (4) · Tests 114 passed (114)'. (2) pnpm --filter @object-ui/app-shell type-check (tsconfig + tsconfig.test): VERDICT command-exit 0. (3) On pre-rebase b0fc2e64, the 156 app-shell/i18n test files naming a touched surface: 'Test Files 156 passed (156) · Tests 1743 passed (1743)'. The incoming #37347 touches none of this PR's files. The full app-shell suite was left to CI Test UI, which is green 16/16. (4) Ablations, all through scripts/ablation-replace.mjs (WRAP mode, restore proven by blob == HEAD and git diff HEAD empty). Subjects resolve from source, so no dist leg applies. A1 enterOpening call removed: 6 failed | 50 passed. A2 setPickerKind(null): 2 failed. A3 no withStudioReturn: 1 failed. A4 consuming replace removed: 4 failed. A5 hold ignored: 2 failed. A5b getter that always reads 0: 2 failed. A5c render-time snapshot of the hold: same-commit pin red, prior-editor pin green. A6 AreaCreate dashboard branch off: StudioAreaAppOpen-36906 5 failed | 22 passed. A7 pair leg off (Studio): 2 failed. A7b pair leg off (list): 1 failed. A8 phone read as false: 1 failed. A9 canCreate ignores dashboardNew: 3 failed. A10 reason not drawn: 2 failed. (5) Browser walk on the showcase stack (pnpm dev --fresh on :38461, Console vite dev on :5180, Playwright). The showcase (read-only code package, HotCRM shape) lands with the Design layout bar and the picker on Dashboards, history.state.usr null; create opens /apps/com.example.showcase/dashboard/walk_showcase?studio=..., saved to com.example.showcase.custom; reload shows no design bar; × returns to the list. A self-built writable package (com.walk.selfbuilt with app walk_app) does the same, saved to com.walk.selfbuilt. A package with no app shows no New and the reason note. 390px width shows no New and no note. Servers torn down.",
      "gates": "Local, before push on 6fbbdd9b: pnpm check:test-source-alias exit 0; pnpm --dir ui check:i18n-keys exit 0; node scripts/pm/overlap-check.mjs 'VERDICT clean exit 0' (origin/main clean; #37362 shares studio en/zh and merges cleanly); merge-tree against claude/issue-37139-studio-package-menu and claude/issue-36909-studio-pillar-dead-code is clean for both. The 38 commands from dispatch-gates --commands all exit 0 (run on b0fc2e64; they include check:nul-bytes, check:cross-package-test-inputs, check:type-check-coverage/-debt, check:published-files, check:adr-anchors and pnpm --dir ui exec vitest run scripts/). PR check-runs on 6fbbdd9b: Lint & Repo Gates success; TypeScript Type Check success; Test Core success; Build Core skipped (path filter); Governed Surface Queue Guard success; Lint UI success; Type Check UI success; Test UI success (16/16 shards plus aggregate); Build & E2E UI success; Live E2E UI success; Dogfood Regression Gate success; Check Changeset success; PR-body guards success; Check PR Size success; Lint · ESLint success.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "10 — reads only: issue_read x2 (get, get_comments), pull_request_read x8 (get_files x2, get_check_runs x5, get_status x1); no MCP write tool used",
      "api_writes": "2 relay strokes: (1) pr_create through scripts/pm/fleet-write/dispatch.mjs (POST /repos/objectstack-ai/objectstack/dispatches → the relay ran POST /repos/objectstack-ai/objectstack/pulls (draft) and POST /repos/objectstack-ai/objectstack/issues/37368/assignees [os-justin]; read-back: body 12667 bytes sent = stored, assignees os-justin, labels none); (2) this os-dev-report comment through scripts/pm/post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/36907/comments). Plus 2 git pushes (not REST): the first push of the branch, then a --force-with-lease=branch:b0fc2e64 after rebase and squash, all five §3 conditions holding (claude/issue-*, created here, sole author, no PR yet, explicit lease).",
      "open_questions": [
        {
          "question": "An app whose menu is split into `areas` keeps its plain menu under design mode (UnifiedSidebar draws DesignModeMenu only when areas.length === 0). There the Studio New enters the mode, but no picker opens. Should the list withhold New for such an app?",
          "options": [
            "A: leave as is; no shipped example uses areas, and the mode itself does not edit areas (cost: none now; a builder with an areas app gets the bar without the picker)",
            "B: useStudioDashboardNew reads the picked app's `areas` and reports 'no-app' with its own reason (cost: about 20 lines plus a pin; one more condition in the list gate)",
            "C: file a card for design mode to edit area menus (larger; changes DesignModeMenu's scope)"
          ],
          "recommendation": "A now, and B as a follow-up only if an areas app shows up in a seat's walk. It is a pre-existing limit of design mode, not of this arrival."
        },
        {
          "question": "A customization pair's report New (`/studio/BASE.custom/metadata/report/new`) does not take the pair leg; it falls back to the area's own create. This is pinned as CONTROL because the dispatch said 'report 新建 unchanged'. Should it gain the leg, as the dashboard New and the item opens have?",
          "options": [
            "A: keep it as is (consistent with 'report New unchanged')",
            "B: one-line change, pairLeg = target.kind !== 'new-report' → true, plus a flipped pin (cost: S)"
          ],
          "recommendation": "B in a small follow-up, under the same rule as #37348's open question 1. It was kept out here to honour the explicit CONTROL."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: the arrival does not repeat the 「Design layout」 door's own gate (useStudioEntryGate and the customization wall). The Studio list gates New by canCreate (walled, pairCreate), and the server judges every write again. Recorded in the PR's Acceptance notes."
      ]
    }
  10. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

    Finalized head for L1 · 2026-11-26T00:42Z · 6fbbdd9b · zone a4-S (#36907 → PR #37368)

  11. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYoLfUxK6MRhuSp7nAt

    os-dev-report

    Addendum: REWORK round for L1 comment 7179410343 on PR #37368 (S1 fixed, N2 folded in).

    {
      "issue": 36907,
      "status": "done",
      "branch": "claude/issue-36907-studio-new-dashboard-design-mode",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37368",
      "head": "1ef76ecc2f (one commit on top of 6fbbdd9b; fast-forward push, no rewrite, no rebase)",
      "session": "session_01QSeKYoLfUxK6MRhuSp7nAt",
      "summary": "S1: ResourceListPage computes the empty state's hint once (emptyHint) and no longer falls through to engine.list.readOnlyHint for a withheld dashboard New. On a phone it reads a new studio key, engine.list.dashboardNewWiderScreen (en: 'A new dashboard is made in an app's design mode, on a wider screen.' / zh: '新仪表盘在应用的设计模式中创建,请在更宽的屏幕上操作。'). I chose a short hint over no hint. While the package's apps are read ('pending'), no description is drawn. no-app keeps the no-app reason; every other case is unchanged. N2: both guards are now pinned on their own. The changeset's 'When there is no New' bullet and its strings line now name the phone hint and the second key. The PR body is not patched: no sentence in it became false. Its 'Additive en and zh keys' line names only the first key, and the changeset names both.",
      "tests": "Head 1ef76ecc. vitest over DesignModeMenu-36363, designMode-36362, StudioAreaAppOpen-36906, ResourceListPage.pairCreate-36897: 'Test Files 4 passed (4) · Tests 119 passed (119)' (114 + 5 new). New pins: (1) 36897, 'on a phone it says a dashboard is made in an app's design mode on a wider screen' (empty-hint text = the new key, never readOnlyHint, no New). (2) 36897, 'while the package's apps are read it says nothing yet, then the create hint once the New is offered' (app read held: the empty title is drawn and there is no metadata-list-empty-hint; released: the create hint and the New). (3) 36897, CONTROL, no app → the no-app reason. (4) 36363, 'the arrival entry is replaced, not stacked: Back from it goes to the page before, and enters nothing'. (5) 36363, 'an arrival read on a phone holds nothing: the window widening later opens no mode'. Ablations through scripts/ablation-replace.mjs, each restored with blob == HEAD and git diff HEAD empty: S1a phone branch → falls to readOnlyHint: 1 failed | 13 passed (pin 1). S1b pending branch removed: 1 failed | 13 passed (pin 2). AP `if (enabled)` → `if (true)`: 1 failed | 57 passed (pin 5). A4′ `replace: true` → `replace: false`: 1 failed | 57 passed (pin 4). pnpm --filter @object-ui/app-shell type-check: VERDICT command-exit 0.",
      "gates": "Before push: pnpm check:test-source-alias exit 0; pnpm --dir ui check:i18n-keys exit 0; node scripts/pm/overlap-check.mjs against origin/main db77cc49 'VERDICT clean exit 0' (#37383 shares StudioMetadataArea.tsx; #37380 and #37362 share studio en/zh; all merge cleanly); pnpm check:nul-bytes OK. CI on 1ef76ecc, 58 check-runs, 0 failed, 0 pending: Lint & Repo Gates, TypeScript Type Check, Test UI (16/16 plus aggregate), Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset, PR-body guards, Check PR Size all success; the rest skipped by path filter.",
      "mcp_calls": "this round: 4 reads (pull_request_read get_comments x1, get_check_runs x3); no MCP write",
      "api_writes": "this round: 1 (this comment through post-stamped.mjs, the relay). Plus 1 git push (fast-forward).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  12. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYoLfUxK6MRhuSp7nAt

    os-dev-report

    Addendum: main merged into the branch, as the PM asked (merge, not rebase).

    • New head: cc7bb340. This is the merge of origin/main e8740c55 into 1ef76ecc, which was 21 commits behind. It is a fast-forward push; no history was rewritten.
    • Conflicts: none. The only files main and this branch both touched are the studio en.ts and zh.ts, which merged cleanly. fix(studio): every retired pillar address lands on its new page in one redirect; the pillar-era code with no reader goes #37383 (StudioPillarRedirect) is not on main yet, so no test needed wrapping. Its PR still merges cleanly over this head, per the overlap check. The PR's delta against main is unchanged: 15 files.
    • Local checks on cc7bb340, all exit 0:
    • CI on cc7bb340, 58 check runs, 0 failed, 0 pending. These passed: Lint & Repo Gates, TypeScript Type Check, Test UI (16/16 plus aggregate), Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset, PR-body guards and Check PR Size. The rest were skipped by path filter.
    • Writes this round: 1 git push and this comment through the relay. GitHub MCP calls were reads only.
  13. removed
    pm:dispatched
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions