Repository navigation
fix(app-shell): lone dashboard widget fills the preview; one Studio canvas frame (objectui#8219 item 1) - #10687
Conversation
…8219) RED against the unfixed preview: a lone dashboard widget keeps its authored half span inside a grid pinned to a 768px minimum, and the Studio canvas wraps the preview's own PreviewShell in a second bordered, padded card. Multi-widget layouts and shell-less canvas states are pinned unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
…anvas frame (objectui#8219) DashboardPreview renders a single-widget draft as a one-column grid, so the lone widget spans the full width, and keeps the 768px minimum only for several widgets. The Studio canvas wrapper drops its border and padding when it hosts a registered preview, which brings its own PreviewShell frame. Co-Authored-By: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
✅ ACCEPTED — PR objectui#10687 at
|
Part of #8219
This PR delivers item 1 of the card (canvas width), under the re-scoped claim on the card thread (comment 5836607808, seat answer 5836130195: B with A folded in). Item 3 (the AI "discussing" chip) is NOT in this PR and the card stays open: it hit a file-surface breach, described under "Item 3" below. Item 2 landed in objectui#10679; item 4 was measured correct there.
The breadcrumb and canvas-caption
titletooltips (the objectui#7254 ruling) and the part-1 Publish button are untouched.What changed
previews/DashboardPreview.tsx: a dashboard with ONE widget is rendered as a one-column grid, so the lone widget spans the full width. Themin-w-[768px]pin now applies only when there are several widgets. The override is preview-only: the draft sent throughonPatchis never the overridden copy.studio-design/StudioDesignSurface.tsx(the canvas wrapper only): the wrapper drops its ownrounded-lg border bg-background p-4card when it renders the registeredPreviewbranch, which brings its ownPreviewShellframe. The newcanvasHostsPreviewShellflag uses the same guards, in the same order, as that branch. Every other canvas state keeps the card: no app, nothing picked, loading, the studio-canvas records grid, and no designer.@object-ui/app-shell: patch.Height
The row height is set in
plugin-dashboard'sDashboardRenderer, not in the preview. The positioned grid usesgridAutoRows: minmax(5rem, auto), and each widget spans its authoredlayout.hrows. A row is a floor, not a fixed height: it grows with content. Charts render at a fixedmd:h-[300px]inside the card. So the lone chart card is 407 px high both before and after this change, which is taller than its 4-row floor of 368 px, so content decides the height. Nothing about height is overridden. Collapsing rows to content (auto-rows-min) is not an option for charts: the renderer's own comment explains that a ResponsiveContainer chart then reports a height of -1 and draws nothing.Who else renders DashboardPreview
It is reached only through the preview registry (
getMetadataPreview('dashboard')):InterfacesPillar): affected in the lone-widget case, and it also gets the one-frame change;ResourceEditPage): affected in the lone-widget case only;EmbeddedItemEditor: affected in the lone-widget case only;apps/console/src/preview-gallery.tsx): NOT affected, because its dashboard sample has three widgets.plugin-designer'sDashboardEditorhas its own, unrelated localDashboardPreviewfunction and is not affected.Measurements (live Chromium render)
These come from a real
StudioDesignSurfacebuilt from workspace src, served by a dev-only Vite page with a fetch stub. The page and driver were uncommitted and are now deleted. The fixture is one bar chart authored atw: 6, h: 4, as on the card. Chromium was at/opt/pw-browsers/chromium. For the before chain, the two source files were checked out atbb6db2791dand then restored to HEAD;git diff HEADwas empty and both blob hashes matched afterwards.Viewport 800 (the chain from the card):
Viewport 1512 with the inspector open:
The before chain reproduces the first dev report (comment 5836099192) exactly. At 800 the chart goes from 326 to 484 px (55 to 82 percent of main), and the horizontal scrollbar is gone.
Red, then green
63fcb6a53c(pins only, unfixed source), runningpnpm exec vitest run DashboardPreview.loneWidget.test.tsx StudioDesignSurface.canvasFrame.test.tsx, gaveTests 4 failed | 3 passed (7). The failures:expected 6 to be 12: the lone chart kept its half span; this happened twice, in design and in run preview;expected 1 widget cells, saw 0: a lone layout-less widget fell into the responsive flow grid and was never positioned;expected [...] to have a length of 1 but got 2: two bordered frames.20932c30c4(the fix): the same two files plussurfaceIdentity,interfacePolish,canvasMode,studioCanvasLeaf,designerRegistryPartialandselectionLeafScopegaveTest Files 8 passed (8),Tests 31 passed (31).Gates (at
20932c30c4)turbo run build --filter='@object-ui/app-shell^...' --concurrency=2: 28 of 28 tasks succeeded.pnpm --filter @object-ui/app-shell type-check(tsc --noEmit && tsc -p tsconfig.test.json): exit 0.--listFilesOnlyconfirms that the test project includes both new test files.vitest run packages/app-shell/src/views/studio-design/plus the machine-locale census gaveTest Files 64 passed (64),Tests 360 passed (360).vitest run packages/app-shell/src/views/metadata-admin/gaveTest Files 310 passed (310),Tests 3535 passed | 1 skipped.eslint --no-inline-config --format jsonread 4 files. The test files have 0 errors and 0 warnings.DashboardPreview.tsxhas 0 errors and 8 warnings.StudioDesignSurface.tsxhas 1 error and 20 warnings: the error isreact-hooks/static-components, far from this diff. These counts are identical to thebb6db2791dcopies linted through--stdin. No type-aware parser options are set, so the diff cannot move the verdict on any untouched file. The repo-widepnpm lintis left to CI.check:changeset-claims(its one report-only finding is.changeset/6681-declared-lazy-marketplace-routes.md, which namesStudioDesignSurface.tsxin a paragraph about chunk co-tenancy of marketplace imports; this diff changes no import, so the paragraph stays true),check:pending-changeset-literals,check:new-line-citations(0 new),check:control-bytes,check:i18n-keys(no key changed),check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:test-path-roots,check-changeset-presence.mjsandcheck-changeset-no-major.mjs.Item 3: file-surface breach, not changed
The seat answer says: "
AiChatPagepasses the artifact's display label, taking the one the Studio already holds and passing it throughsurfaceContext". The label cannot get there within the claimed files:surfaceContextis produced instudio-design/StudioAiCopilot.tsx(StudioCopilotConversation), from the URL alone: the:tabsegment plus?surface=type:name.InterfacesPillar's selected leaf (current.label). The chat dock is mounted by the outerStudioDesignSurfacecomponent, a different component from the one that holdscurrent.AiChatPage'sChatPanehas no metadata that carries that label. TheMetadataProvidercache does not loaddashboardeagerly (EAGER_TYPESis app and view), and reading it would start a new list request. The Studio's label is also the NAV label, which is not necessarily the dashboard's own metadata label.Carrying the label therefore needs
StudioAiCopilot.tsx, plus the dock mount and state outside the canvas wrapper inStudioDesignSurface.tsx. Both are outside the claim.surfaceContextis also sent to the agent ascontext.surface, so addinglabelthere would widen a wire shape the cloud agent reads (cloud#1610). The options are in the dev report on the card. Nothing for item 3 is in this PR.Clause-② note
The claim's Clause-② line covers the optional
surfaceContextTitleprop on@object-ui/plugin-chatbot. This PR does not add that prop and does not touchplugin-chatbot, so the line is not copied here. This PR widens no public surface.Authored by an os-dev subagent of seat
domain:ui#3, sessionhttps://claude.ai/code/session_01D486C1axmXnrkJMNUfz2eb.Generated by Claude Code