Repository navigation
feat(studio): a dashboard list's New opens the app's design mode on its dashboards - #37368
Draft
objectstack-fleet[bot] wants to merge 1 commit into
Draft
objectstack-fleet[bot] wants to merge 1 commit into
objectstack-fleet[bot] wants to merge 1 commit into
Conversation
…ts dashboards Studio's dashboard list New now opens the package's app (decision 6, the .custom pair leg included) with a one-time navigation-state arrival: ConsoleLayout reads it once, clears it from the history entry, and asks the design mode to enter with the Add menu item picker open on its dashboards. A refused entry does nothing more and says why; a phone does nothing. The dashboard created there opens for editing with ?studio= back to the list. The list offers no New at phone width, and none without a target app, saying why. The report New is unchanged. Claude-Session: https://claude.ai/code/session_01QSeKYoLfUxK6MRhuSp7nAt Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Nov 26, 2026
This branch has not been deployed
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.
Fixes #36907
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The Studio dashboard list's New now uses design mode's existing 「Add menu item → New dashboard…」 flow (#36364), the maintainer's 「新建跳到设计模式加菜单」 (dashboard half). The report half (decision 13) is unchanged.
The arrival (
layout/designModeArrival.ts,layout/useDesignModeArrival.ts). A second navigation-state arrival,designModeAddDashboard, sits besidedesignModeNewDashboardand carries the Studio list it came from.ConsoleLayoutreads it once per history entry throughuseDesignModeArrival. It first replaces the entry without the arrival, so a reload or Back enters nothing. Then it asks the mode toenterOpening({ column: 'dashboard', studioReturn }).?studio=and no mode.enterOpeningisenterplus a one-shot "opening" held in the mode store. Whereenterrefuses (an editor holds the mode out, PR fix(console): report editing is its own entry, mutually exclusive with design mode #36848), nothing is held and the mode's owndesignMode.editorOpentoast says why. On a phone the arrival is cleared and nothing more happens.enter()keeps its zero-argument contract: a click event is never an opening.DesignModeMenutakes the opening once (useDesignModeOpening). It opens the picker on 「Dashboards」 for an entry at the end of the top level, as that level's 「Add menu item」 would. A dashboard created from that picker navigates withwithStudioReturn(href, studioReturn), so the dashboard page's existing × goes back to the Studio list (?studio=). Closing that picker drops the return, and later adds are plain.Studio (
StudioAreaAppOpen.tsx,studioAppEdit.ts,StudioMetadataArea.tsx).StudioAreaAppTargetgains{ kind: 'new-dashboard' }.AreaCreatesendsdashboard/newthrough it, under the same condition the report leg uses (!readOnly || pairCreate). It replaces the Studio address with/apps/SEGMENT(appHomePath) and the arrival.studioAppCreateSegment..custompair leg from fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348 applies: a pair with no app of its own reads its base's apps. That reading is factored intoreadStudioTargetApps, which the item leg now shares too.The list (
ResourceListPage.tsx).useStudioDashboardNewgates the area's dashboard 新建 by the same reads. It never shows at phone width, and it is not drawn while the apps are being read. With no target app the header shows no 新建 and shows arole="note"reason instead (engine.list.dashboardNewNoApp); the empty state says the same.Riders from seat 4's L1 on PR #37348.
StudioAreaAppOpen-36906test header now says a pair row opens in the base's app.Additive en and zh keys:
engine.list.dashboardNewNoAppin thestudionamespace (it is en/zh only). No server, spec or route change.Read first
ui/packages/app-shell/src/layout/useDesignModeArrival.ts: the consume-then-enter order. Risk: it navigates (replace) in the same commitAppRootLanding's redirect may navigate. Child effects run first, so the landing redirect re-applies on the next render; see Acceptance notes.ui/packages/app-shell/src/layout/designMode.tsx:enterWith/enterOpening/takeOpening, andheldOutmoving to a ref.ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen.tsx: thenew-dashboardleg anduseStudioDashboardNew.Tests
Pins, each with an ablation that turned it red (and restored hash-verified through
scripts/ablation-replace.mjs). Every file below imports the subject from source, so no build or dist preflight applies:StudioAreaAppOpen-36906(dashboard list's New…),DesignModeMenu-36363(the arrival…)AreaCreatedashboard branch off → 5 red; A1enterOpeningcall removed → 6 red; A2 picker kindnull→ 2 redDesignModeMenu-36363withStudioReturndropped → 1 redCONTROL — the report listResourceListPage.pairCreate-36897(dashboard list's 「新建」…)no-app→ 3 red; A10 reason not drawn → 2 redenter()does nothingDesignModeMenu-36363StudioAreaAppOpen-36906,ResourceListPage.pairCreate-36897DesignModeMenu-36363Moved by this change, and re-pinned rather than deleted:
Local runs on the final head 6fbbdd9 (rebased on d5ae7a4)
cd ui && npx vitest run --maxWorkers=2over the 4 pinned files (DesignModeMenu-36363,designMode-36362,StudioAreaAppOpen-36906,ResourceListPage.pairCreate-36897) givesTest Files 4 passed (4) · Tests 114 passed (114).pnpm --filter @object-ui/app-shell type-check(bothtsconfig.jsonandtsconfig.test.json) gives lockVERDICT command-exit 0.b0fc2e64, givingTest Files 156 passed (156) · Tests 1743 passed (1743). The rebase brought in one commit, fix(studio): a permission set's review link opens the draft review on its matrix page #37347, which touches none of this PR's files. The full app-shell suite (2,431 files) is left to CI'sTest UI(a declared narrowing).node scripts/pm/dispatch-gates.mjs --commands: all 38 commands exit 0, run onb0fc2e64.6fbbdd9b:pnpm check:test-source-aliasexit 0,pnpm --dir ui check:i18n-keysexit 0,node scripts/pm/overlap-check.mjsgivesVERDICT clean exit 0. It reports one open PR, feat(console): a 「⋯」 package menu in Studio's top bar; Import on Setup → Packages #37362, that shares the studio en/zh namespace files and merges cleanly.git merge-tree:claude/issue-37139-studio-package-menumerges clean.claude/issue-36909-studio-pillar-dead-codemerges clean. It sharesStudioMetadataArea.tsxwith this PR, in different hunks.Ablations (each through scripts/ablation-replace.mjs, restored, git diff HEAD empty)
enterOpeningcall inuseDesignModeArrival→DesignModeMenu-36363: 6 failed | 50 passed.setPickerKind(null)→ 2 failed.withStudioReturn→ 1 failed.navigate(..., { replace: true })→ 4 failed.if (false)in place of the held-out check → 2 failed.heldOutAtRender) → only "the same refusal when the editor opens in the very commit the arrival lands in" fails among this card's pins. The prior-editor pin stays green.AreaCreate's dashboard branch never taken →StudioAreaAppOpen-36906: 5 failed | 22 passed.readNewDashboardSegment→ 2 failed. A7b (list) →ResourceListPage.pairCreate-36897: 1 failed.useStudioDashboardNewreads no phone → 1 failed.canCreateignoresdashboardNew→ 3 failed.Acceptance notes
useDesignModeArrivalreplaces the history entry it read, in the same commitAppRootLandingmay redirect to the app's landing. Child effects run first, so the landing redirect re-applies on the next render. In the browser, the showcase landed on its first page (/page/showcase_capability_map) with the mode on andhistory.state.usr === null. A self-built app whose menu holds only links stays on/apps/ID, with the same result.areaskeeps its plain menu under design mode, becauseUnifiedSidebardraws the editor only whenareas.length === 0. That predates this PR. There the arrival enters the mode but no picker opens. No example app usesareas. See the report's open question.useStudioEntryGateand the customization wall). The Studio list's 新建 is already gated bycanCreate(walled,pairCreate), and the server judges every write again.designMode.tsx). Nothing rendered from it;enteris the only reader. The existing 36692 pins pass unchanged.Verification
pnpm dev -- --fresh -p 38461(seeded admin), and the Console fromui/sources viapnpm --filter @object-ui/console devon :5180 pointed at it. Driven with Playwright from a scratch script, not committed.com.example.showcase, a read-only code package; the HotCRM shape): Studio › dashboard list › 新建 lands on/apps/com.example.showcase/page/showcase_capability_mapwith the Design layout bar and the 「Add menu item」 picker on Dashboards (「New dashboard…」 first). The history entry's state was cleared./apps/com.example.showcase/dashboard/walk_showcase?studio=/studio/com.example.showcase/metadata/dashboard?package=com.example.showcasein its edit state, with the × drawn. The entry is in the menu, and the dashboard was saved tocom.example.showcase.custom.com.walk.selfbuilt, created throughPOST /api/v1/packageswith one appwalk_app): 新建 lands on/apps/com.walk.selfbuiltwith the bar and picker. Create opens/apps/com.walk.selfbuilt/dashboard/walk_selfbuilt?studio=…, and the dashboard was saved tocom.walk.selfbuilt. × returns to the list.com.walk.noapp): no 新建, and the note reads "A new dashboard is made in an app's design mode, so that it hangs in a menu. This package has no app to make it in."Generated by Claude Code