Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(app-shell): Studio Interfaces pillar creates a page and opens it on source plus live preview (objectui#11823 step 3) - #11932

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-11823-page-create
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-11823-page-create

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11823

Clause-②: no

Step 3 of objectui#11823, the card's last item: Studio's Interfaces pillar creates a page in a writable package, links it from the open app's navigation, and opens it on its source beside a live preview (ADR-0084; objectstack docs/design/builder-ui.md §6: "source + live preview for react / html pages"). Steps 1 (bee5d6f, PR objectui#11868) and 2 (a49c4bd, PR objectui#11907) have landed, so this PR completes the card.

Dispatched by the domain:ui seat 3 PM (claim 6054175190, amendment 6054208157), session https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8.

What changed

  • New page on step 2's New menu, after New dashboard and New report, offered under the same conditions (a writable package, an app to link from, nav editing closed).
  • The dialog is the shared CreateItemDialog, unchanged; its existing extra slot asks for the source kind (PageCreateFields): HTML (the default) or React. React is offered only where the host runs react pages (isCapabilityEnabled(CAP_REACT_PAGES)): a deployment that set OS_PAGE_REACT=off would accept the page at the door, but the preview and the running app would only say react pages are disabled. The kind is asked here because the Studio cannot change it later (a source page's Properties tab edits no kind).
  • The handler is step 2's doCreateSurface, gaining the page kind with the same five steps: refuse a name any page already holds (published or draft, any package) and write nothing; save the draft (client.save('page', NAME, body, { mode: 'draft', packageId })); append the nav entry and send it through doNavSave; select the leaf; Design mode. For a page it also puts the rail on its Source tab and expands a collapsed rail, so the code editor shows whatever tab an earlier source page left the rail on.
  • The body (buildPageSkeleton in interfaceCreate.tsx, typed as the spec's Page): { name, label, type: 'app', kind, source }.
    • type: 'app' is written because PageSchema defaults an absent type to record (measured below), and a record page cannot be opened by a page nav entry: it needs a record id the entry cannot pass, and the nav editor's own picker leaves record pages out (isStaticPageOption).
    • source cannot be empty: the spec refuses an html or react page without one. The starter is one paragraph of text from the designer table (engine.studio.interfaces.create.pageStarter, en and zh), in the kind's own syntax: for html a flex column (direction col, gap 4) holding one p element; for react a function Page() returning a div with an inline style (flex column, gap 16) holding that p. No Tailwind class (ADR-0065). The deprecated jsx spelling of html is never written.
  • The nav entry is { id, type: 'page', pageName, label }. It carries the typed label, as a report entry does: the spec's label inheritance stops at object, view and dashboard targets, so a label-less page entry shows its pageName (measured below).
  • Strings: 12 new engine.studio.interfaces.create.* rows (en and zh), and the existing menuTitle row (en and zh) now names pages.

Untouched: CreateItemDialog.tsx, SourcePageEditor.tsx, PagePreview.tsx (import only), DashboardPreview.tsx, NavTree, StudioNavItemInspector, useDraftAutoSave, doPublish, index.ts, packages/i18n/**, packages/components/src/ui/**.

The brief's Zone 2, measured

  1. Step 2's shape holds as described; the page joins the same menu and handler with kind page.
  2. The skeleton. Installed @objectstack/spec 17.7.0 PageSchema: an html, react or jsx page with a non-empty source parses; an empty or missing source is refused at source ("A html page requires a non-empty source"); a page with no type parses as type: 'record'. The published 17.7.0 draft door (objectstack dev --fresh): the html starter answered 200 and read back with requires: ["ui"] stamped (the server compiled the starter's source); the react starter 200; an empty source 422 INVALID_METADATA at source; a page without type 200, read back as type: "record". Default kind: html, the parse-never-execute tier every deployment renders; react runs author code and a deployment may switch it off.
  3. Opening it. Selecting the new leaf opens the pillar's existing pair: SourcePageEditor mode="preview" on the canvas and mode="editor" in the rail's Source tab. Pinned, and read in a real browser below.
  4. The nav entry label must be carried: in the running app (17.7.0, published) a label-less page entry read team_board in the sidebar, the labelled one Team board.

Tests and gates (local HEAD da775d5: this branch with main 4ebc250 merged in, no rebase)

Command Exit Verdict
os-verify-lock: pnpm --workspace-concurrency=2 --filter "@object-ui/app-shell^..." build && pnpm --filter @object-ui/app-shell type-check 0 VERDICT command-exit 0 (29 of 47 projects; tsc --noEmit && tsc -p tsconfig.test.json)
tsc -p tsconfig.test.json --listFiles (app-shell, on b5e418a) 0 lists interfaceCreate.test.tsx and StudioDesignSurface.interfacesCreatePage-11823.test.tsx
pnpm exec vitest run --maxWorkers=2 the 65 studio-design/StudioDesignSurface.* files 0 Test Files 65 passed (65) / Tests 383 passed (383)
pnpm exec vitest run --maxWorkers=2 the other 68 studio-design test files 0 Test Files 68 passed (68) / Tests 465 passed (465)
pnpm exec vitest run --maxWorkers=2 56 tests outside studio-design that name a touched source or the designer table, or read the tree (incl. the i18n gate tests) 0 Test Files 56 passed (56) / Tests 1220 passed, 1 skipped (1221) (the skip is declared in an existing suite)
pnpm check:control-bytes / check:test-path-roots / check:changeset-claims / check:pending-changeset-literals 0 OK each
pnpm check:i18n-keys / check:i18n-drift / check:i18n-dead-keys / check:i18n-designer-parity 0 drift: Every changed designer-table en value was followed by its zh row.; parity: Every en row has a zh row, and every shared row carries the same placeholders.; no new key in the dead-keys report
pnpm check:new-line-citations / check:metadata-write-doors / check:unreferenced-sources / check:spec-symbols 0 0 new citation(s); 17 metadata write door(s) derived; Every shipped source file ... is reachable.
pnpm check:vi-mock-specifiers / check:vi-mock-inherit / check:vi-mock-override-shape 0 OK each
node scripts/check-changeset-presence.mjs / check-changeset-no-major.mjs 0 5 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s): .changeset/11823-page-create.md. / no major

The new pins:

  • StudioDesignSurface.interfacesCreatePage-11823.test.tsx (7 tests, the mounted pillar with the real SourcePageEditor and the runtime page renderer): New page saves an html page PageSchema parses and an app document AppSchema parses, with the labelled page entry appended; the rail shows the leaf; the rail's code editor holds the starter source and the canvas (not the rail) draws the starter paragraph; a React page is written and previewed the same way; the rail opens on Source even when an earlier source page left it on Properties; a page name taken in another package, or by a draft, is refused in the dialog with no write; controls: the menu reads New dashboard, New report, New page, and a read-only package shows no New.
  • interfaceCreate.test.tsx (+12 tests): both kinds parse as app pages and pass isStaticPageOption; controls: without type the spec reads a record page, and an empty source is refused at source; each locale's starter line holds none of the four characters the html parser stops at or JSX text refuses; the html starter compiles and renders through the runtime SchemaRenderer in en and zh, and the react starter runs and renders; the page entry carries its label and parses in an app document; PageCreateFields offers HTML and React starting on HTML, and only HTML when react pages are turned off.
  • Step 2's StudioDesignSurface.interfacesCreate-11823.test.tsx is unchanged and green (the dashboard and report flows).

Reverse checks (implementation committed first, HEAD b5e418a, through ablation-replace.mjs, restore proven by blob):

  • Drop only the page's nav entry (StudioDesignSurface.tsx: navigation: [...navigation, entry] becomes kind === 'page' ? navigation : [...navigation, entry]; anchor 1 to 0, blob 188223c to b132bd5). Predicted: the page create pin red, step 2's pins green. Observed Tests 1 failed | 16 passed (17): the saved navigation lacked nav_team_handbook; step 2's file 10 of 10 green. Restored: blob equals HEAD 188223c, git diff HEAD empty.
  • Drop the Source-tab reset (setInspectorTab('source') deleted; blob 188223c to a7e3b2e). Predicted: only the Properties-tab pin red. Observed Tests 1 failed | 6 passed (7), that pin. Restored: blob equals HEAD. A first attempt in replace mode was refused by the tool itself (the replacement is a substring of the anchor, so its count could not rise); no test ran, and its restore was proven the same way.

Lint, narrowed and measured: eslint --format json over the 5 touched TS files, under the root eslint.config.js (the only config; the package script is eslint .): 5 files, 0 errors, 21 warnings. StudioDesignSurface.tsx 13 warnings = 13 on main 4ebc250; interfaceCreate.tsx 8 react-refresh/only-export-components (5 on main: the module exports builders beside its components, as in step 2). The config sets no parserOptions.project or projectService, so linting is not type-aware and this diff cannot move a verdict on an untouched file. Repo-wide pnpm lint is CI's.

Published surface: after pnpm --filter @object-ui/app-shell build (da775d5, dist completeness 1022 files), walking relative imports from dist/index.d.ts reaches 174 declaration files, StudioDesignSurface.d.ts (control) included and interfaceCreate.d.ts / CreateItemDialog.d.ts not; StudioDesignSurface.d.ts does not name interfaceCreate. No export, prop or packages/i18n key is added.

Real browser (published @objectstack/* 17.7.0, Playwright/Chromium)

Server: objectstack dev --fresh in a scratch directory with a code package com.probe.code (an object, an html page, an app) and a writable package com.probe.ui with an app. Console: this branch under Vite, read on b5e418a and again on da775d5. Monaco's CDN loader is blocked in this container, so the rail's editor is SourcePageEditor's textarea fallback.

  • The New menu read New dashboard, New report, New page; the dialog's kind read HTML, React, on HTML.
  • New page "Team handbook": PUT /api/v1/meta/page/team_handbook?mode=draft&package=com.probe.ui 200 with {"name":"team_handbook","label":"Team handbook","type":"app","kind":"html","source":...}, then PUT .../meta/app/probe_ui_app?mode=draft&package=com.probe.ui 200 with {"id":"nav_team_handbook","type":"page","pageName":"team_handbook","label":"Team handbook"} appended. The canvas (Design) drew "A new page. Write its content in the source editor."; the rail's Source tab was selected and held the starter source; no compile error.
  • New page "Team board", React: PUT .../page/team_board 200 (kind react), the app 200; the canvas drew the starter through the react runtime.
  • Editing the source in the rail ("Welcome to the team handbook." and "Edited in Studio.") showed on the canvas at once and autosaved one PUT .../page/team_handbook 200 with the new source.
  • "Team handbook" again: refused in the dialog ("A page with the identifier “team_handbook” already exists. ..."), 0 writes.
  • Code package com.probe.code: no New menu.
  • After Publish (POST /api/v1/packages/com.probe.ui/publish-drafts, 3 published, 0 failed): the running app's sidebar listed Item, Team handbook, Team board; /apps/com.probe.ui/page/team_handbook showed the heading "Team handbook" and the edited body; Team board showed the react starter.

Acceptance notes

  • Studio's live preview omits the page title the running app shows. SourcePageEditor's preview hands the runtime renderer the draft without pageType (the runtime's PageView maps the spec's type to it), so the renderer treats every source page as a record page: no title heading, record width. Measured above: the Studio canvas shows no "Team handbook" heading; the running app does. SourcePageEditor is import-only on this claim; reported to the seat with the reproduction. It applies to every html or react page, not only new ones.
  • In the narrow folded layout (the chat dock open on a narrow viewport), a new page opens on the Canvas tab (the preview), and the editor is the Properties tab, as for any source page: two tabs, not side by side.
  • A second create in the same session sends the app document as the previous nav save left it, which carries the server's _packageId stamp; the 17.7.0 door accepted it (200) and AppSchema declares it. Step 2's path, unchanged here; noted only.

Overlap

git merge-tree of this head with each open objectui PR touching StudioDesignSurface.tsx, interfaceCreate.tsx or metadata-admin/i18n.ts (read 2026-10-08T08:21Z: only objectui#11931, which shares i18n.ts in other rows) is clean. Whoever lands second merges main.


Generated by Claude Code

claude added 3 commits October 8, 2026 07:03
… on source plus live preview (objectui#11823 step 3)

New page on the Interfaces pillar's New menu: the shared create dialog asks
for the source kind (html by default; react only where the deployment runs
react pages), the handler step 2 added saves an app page of that kind with a
short starter source, links it from the app's navigation with a labelled
page entry, and opens it with the code editor in the rail and the live
preview on the canvas.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
…ectui#11823 step 3)

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 336 chunks) 3306.7 KB 3307.0 KB
Main entry chunk (gzip) 71.3 KB 350 KB
Entry file index-Dye10YYF.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 17.82KB 6.58KB
app-shell (runtime-config.js) 22.59KB 7.89KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 586.28KB 141.14KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 240.39KB 67.09KB
fields (index.js) 266.92KB 67.47KB
i18n (LocalizationContext.js) 2.92KB 1.42KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.52KB 2.39KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 38.37KB 10.31KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.50KB 11.82KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.04KB 3.92KB
plugin-calendar (index.js) 53.39KB 15.52KB
plugin-charts (index.js) 84.71KB 23.25KB
plugin-chatbot (index.js) 199.63KB 47.46KB
plugin-dashboard (index.js) 144.82KB 39.17KB
plugin-designer (index.js) 231.46KB 48.87KB
plugin-detail (index.js) 248.57KB 65.47KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 176.62KB 45.75KB
plugin-gantt (index.js) 179.17KB 45.07KB
plugin-grid (index.js) 248.06KB 68.77KB
plugin-kanban (index.js) 52.17KB 16.37KB
plugin-list (index.js) 117.45KB 29.33KB
plugin-map (index.js) 27.24KB 9.03KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 39.10KB 11.81KB
plugin-tree (index.js) 15.07KB 5.33KB
plugin-view (index.js) 91.07KB 22.93KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 23.87KB 7.83KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 5.78KB 2.70KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (node-slots.js) 7.18KB 2.34KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 8, 2026 08:43
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 8, 2026 08:43
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit f3a0488 Oct 8, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11823-page-create branch October 8, 2026 09:00
os-bill pushed a commit that referenced this pull request Oct 8, 2026
…opens it on source plus live preview (objectui#11823 step 3) (#11932)"

This reverts commit f3a0488.

objectui#11937: with objectui#11931 reverted, main's console eager closure
still measured 66 gzip bytes over its ceiling, because objectui#11932 added
its own rows to the same eagerly loaded designer table. The seat ruled
route A: roll back both, so main returns to f1781be's tree.

Claude-Session: https://claude.ai/code/session_01MgfduSkFrfM3eorB3UGfAU
Co-authored-by: Claude <noreply@anthropic.com>
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Oct 9, 2026
…s bound, instead of drawing a red refusal (objectui#11910) (objectstack-ai#11948)

Fixes objectstack-ai#11910

Clause-②: no

## What this changes

On Studio's Interfaces page, *Add widget* on a dashboard in Design mode
no longer draws a red refusal before the author can bind the widget. The
new widget is held, as objectui#11786 holds an incomplete field or step
on the Data and Automations pages: it stays on the canvas, unsaved, the
widget inspector says what it needs, a neutral line names it, and
Publish refuses while it is held. A save of a finished widget that is
refused keeps objectui#11785's red strip.

- **The hold.** Before the leaf autosave of a dashboard sends, the
pillar asks `dashboardHeldEdit` (new, in `metadataError.ts`) about the
draft. It walks the widgets and, for each, asks the installed spec's own
`DashboardWidgetSchema` (`widgetMissingInputs`). A widget is held when
the spec refuses it and every issue it names is the absence of one of
the inputs the widget inspector's dataset binding offers (Dataset,
Dimensions, Values). The autosave is then `blocked`: the edit stays
dirty and nothing is sent.
- **The line.** Where the leaf's refusal strip goes, `StudioHeldNotice`
reads "Not saved yet: Dataset on the widget “New metric (kpi)” needs a
value. Your changes are kept here and saved once it is filled in." It
offers "Show me" when that widget's inspector is not the one open. Once
a dataset is picked, the line names Values (measures). Picking a measure
lets the next autosave go.
- **The inspector.** `DashboardWidgetInspector` shows the existing
"Required. Changes are saved once this has a value." row under the
Dataset picker, then under the measures editor, for exactly the inputs
`widgetMissingInputs` returns.
- **Publish.** `InterfacesPillar` takes the optional `onHeldEditChange`
the Data and Automations pillars already take, reports its held clause
through `useHeldEditReport`, and the shell's mount passes `setHeldEdit`.
While a widget is held, Publish shows "Not published: Dataset on the
widget “New metric (kpi)” needs a value, so that change is not saved
yet. Finish it, then publish." and publishes nothing.
- **Errors stay for finished work.** A widget the spec refuses for
anything else is sent, and its refusal shows as before. That covers a
value the author wrote wrong (a dataset name that is not an identifier,
two measures on a metric), a type outside the spec's, and a missing key
the inspector does not offer.

Nothing is added to the package entry: no export, prop, type member or
language-pack key. `InterfacesPillar` and `metadataError.ts` do not
reach `index.ts`. The one new string is a row of the metadata-admin
designer's own table, `engine.studio.held.widgetNeedsInput`, in en and
zh.

## Measured before acting (dispatch Zone 2)

- **H1, the pattern's parts.** Confirmed as the dispatch read them.
`InterfacesPillar`'s leaf autosave was blocked only on
`inspectorBlocking`, and its mount passed no `onHeldEditChange`. The new
predicate joins the same `StudioHeld` shape.
- **H2, incomplete vs wrong, read off the spec.** Measured on the
installed `@objectstack/spec` 17.7.0 with
`DashboardWidgetSchema.safeParse` on `{ id, type, title }`, as
`handleAddWidget` builds it, for all 11 types `AddWidgetPicker` offers
(`WIDGET_TYPE_META`). Every one is refused at exactly `dataset` and
`values` (invalid_type, received undefined), and `DashboardSchema` on
the whole dashboard names `widgets.N.dataset` and `widgets.N.values`,
the card's live 422 paths. No picker type needs no binding, so the
dispatch's control "a type that needs no binding saves at once" has no
subject on 17.7.0. It is replaced by "an edit to a dashboard whose
widgets are all bound saves at once". The reading is spec-derived: no
list of required keys lives in objectui. The one local list is which
inputs the inspector offers, so a widget is held only for an input the
author can reach. My choice on the not-verified half: hold only when the
spec's ONLY complaints are absences. A dataset name written wrong, with
measures still absent, is sent and draws the strip (pinned). Held, it
would show "needs measures", and a misnamed dataset offers none to pick.
`values: []` is a value, not an absence, so it is not held (pinned as a
boundary, see Acceptance notes).
- **H3, the target.** `{ kind: 'widget', id }`, as the canvas selects
it. "Show me" reopens that widget's inspector after it was closed
(pinned). The inspector did not mark Dataset or measures as required, so
the hint was needed. `DashboardPreview.tsx` did not need to change.
- **H4, more than one buffer.** Only the leaf autosave is held. With a
widget held, a nav entry added and bound in nav editing sends its app
save while the dashboard stays unsent (pinned).
- **A live reading.** NOT MEASURED: no published 17.7.0 server is
installed in this container. The spec parse above is the measurement,
and its paths match the live 422 the card measured.

## Pins

- `metadataError.heldWidget-11910.test.ts` (the predicate). Every held
case is paired with `DashboardSchema`'s verdict on the same dashboard,
and every not-held control with a dashboard that judge accepts or
refuses for something the author wrote. Covered: all 11 picker types
held for Dataset; Dataset bound, held for Values; complete, not held and
accepted; the first unfinished widget named; a map title read in the
designer locale (zh), an untitled widget named by its id. Controls, not
held: two measures on a metric, a dataset written wrong, `values: []`, a
type outside the spec's, a widget with no id, and a dashboard with every
widget bound or none.
- `InterfacesPillar.heldWidget-11910.test.tsx` (real `DashboardPreview`
and `DashboardWidgetInspector`, a client double that records saves).
*Add widget* → *Metric (KPI)*: no dashboard save after the debounce, no
red strip, the line names Dataset, the inspector hint sits under
Dataset, and the surface is told the clause. A dataset moves the line
and the hint to Values. A measure sends one save, which
`DashboardSchema` accepts, clears both, and reports `null`. "Show me"
reopens the widget. Controls: a finished widget the server refuses shows
the red strip and no held line; an edit to a dashboard whose widgets are
all bound saves at once; a held widget does not hold the nav save.
- `StudioDesignSurface.heldWidgetPublish-11910.test.tsx` (the real
surface on the real route). With a widget held, Publish refuses, naming
it, and publishes nothing. Once it is bound and saved, Publish goes.
With nothing held, Publish goes as before.

## Ablation (committed implementation, restore proven each leg)

Run through `ablation-replace` (anchor hit once, landed on disk,
restored) under the shared verify lock, before the merge of `main`:

- **A**, the held predicate removed from the leaf autosave's `blocked`:
`InterfacesPillar.heldWidget-11910` 3 failed of 6. First failure: "the
unbound widget is not sent: expected [ { name: 'sales_dash', …(2) } ] to
deeply equal []". The nav pin went red on its "the widget is still held"
half. Show me, the refusal control and the all-bound control stayed
green, as expected: they read the line or a finished widget.
- **B**, `widgetMissingInputs` told to skip a non-absence issue instead
of answering none: `metadataError.heldWidget-11910` 2 failed of 10 (the
wrong-dataset and off-type or no-id controls). "expected [ 'values' ] to
deeply equal []".
- **C**, the `InterfacesPillar` mount's `onHeldEditChange` set to
`undefined`: `StudioDesignSurface.heldWidgetPublish-11910` 1 failed of
3. "Publish must not go around the held widget: expected vi.fn() to not
be called at all, but actually been called 1 times". The first attempt
at C was a no-op: its replacement text was contained in its anchor, the
tool refused it ("the replacement count moved 1 -> 1"), and nothing ran.
It was re-run with a replacement that lands.
- Each restore: blob equal to HEAD, `git diff HEAD` empty.

## Tests and gates

Final head `53372bd` (this branch merged with `main` at `7241a81`, never
rebased; the code is unchanged since `fd53a82`, which round 1 measured).
Run from the worktree root:

- **Type-check** (locked), on `fd53a82`: `pnpm --filter
@object-ui/app-shell type-check` (`tsc --noEmit && tsc -p
tsconfig.test.json`) exits 0. `tsconfig.test.json` includes
`src/**/*.test.ts(x)`, and its first run went red on the new publish
pin's double signatures, which `fd53a82` fixes. Dependencies built with
`turbo run build --filter=@object-ui/app-shell^... --concurrency=2`, 28
of 28 (all from turbo's cache), exit 0.
- **Tests** (locked), `pnpm exec vitest run --maxWorkers=2`, on
`ed7dfa8`. `ed7dfa8` and `fd53a82` differ only in the publish pin's two
type annotations.
- `packages/app-shell/src/views/studio-design/` in full: 140 files, 892
tests passed, exit 0.
- Every other app-shell and console test that imports
`DashboardWidgetInspector`, `DashboardPreview`, `metadataError`,
`StudioDesignSurface`, the inspector registration or the metadata-admin
i18n table (derived by `git grep` on that head): 123 files, 1573 tests
passed, exit 0.
  - The three new pins again on `fd53a82`: 3 files, 19 tests passed.
- **Declared narrowing:** app-shell's full suite is CI's. The derived
set covers direct importers of the changed modules, and is blind to a
test that reaches them only transitively.
- **ESLint** on the 7 changed source and test files: 0 errors and 24
warnings, every one on a line `main` already carries (same rules, the
inspector's lines shifted by its one new import).
- **Gates**, all exit 0: control-bytes, test-path-roots,
changeset-claims ("No pending changeset names a file this change
touches."), pending-changeset-literals, i18n-keys, i18n-drift,
i18n-dead-keys (the new row not reported), i18n-designer-parity ("Every
en row has a zh row, and every shared row carries the same
placeholders."), new-line-citations, spec-symbols, vi-mock-specifiers,
vi-mock-inherit, vi-mock-override-shape, designer-field-key-parity,
phantom-deps, metadata-write-doors,
`scripts/check-changeset-presence.mjs`, and
`check-governed-queue-guard.mjs --test` ("NOT GOVERNED").

## Eager closure (objectui#11937 is open on `main`)

`Bundle Analysis` is red on `main` itself, so it will be red here too.
That is objectui#11937's work; nothing here touches the budget script or
a ceiling. This change's own delta, measured by a local `vite build` of
`apps/console` on both trees in this container
(`NODE_OPTIONS=--max-old-space-size=6144`, a full console build):

- base `f3a0488`: 3,386,819 bytes gzipped. `pnpm check:eager-closure`
reads "3307.4 KB gzipped across 336 chunks, 0.4 KB over the 3307.0 KB
budget".
- head (this branch's source): 3,387,202 bytes gzipped, "3307.8 KB … 0.8
KB over".
- Delta **+383 bytes gzipped** (+1,137 raw). Still 336 eager chunks of
2458. Per chunk: `src` +2,028 and `studioScope` −1,696, as
`metadataError.ts`'s code follows the eager widget inspector that now
imports it. `i18n` +41 for the two new rows. Five other chunks moved by
9 bytes or less.

Round 2: after main rolled back objectui#11931 and objectstack-ai#11932
(objectui#11956) and raised the ceiling (objectui#11949), Bundle
Analysis on `53372bd` passes: 3308.5 KB across 337 chunks, budget 3312.0
KB.

## Acceptance notes

- **File surface.** `StudioDesignSurface.tsx` carries two adjuncts
beside its two named regions: the `dashboardHeldEdit` import, and the
`onHeldEditChange` member of `InterfacesPillar`'s props, which the mount
line needs. `DashboardPreview.tsx` is untouched.
- **The inspector's hint outside Studio.** `DashboardWidgetInspector` is
also the registered inspector of metadata-admin's `ResourceEditPage`,
whose own autosave does not apply this hold. There, "Changes are saved
once this has a value" overstates what that page does. This is the same
boundary `FlowNodeInspector`'s objectui#11786 hint already has.
- **Same family, not done here: an empty measure list.** Removing a
widget's last measure writes `values: []`. The spec refuses that
(`min(1)`), and this hold does not cover it, because it is a value and
not an absence. The next autosave sends it and draws the red strip. It
is reported to the seat for the family's closing card, not fixed here.
- **Reported, not fixed here: a stale refusal strip.**
`InterfacesPillar`'s leaf `doSave` never clears `error` when a later
save lands. The Data and Automations pillars clear it at the start of
each save. After one refused dashboard save, the red strip stays on
screen through every later successful save, until the leaf reloads.
Measured with a one-off probe through the real pillar, which was not
committed.
- **Prose only, not carded.** The `engine.inspector.widget.datasetHint`
row still says the dataset "takes precedence over the inline object
query above". That query was removed from the inspector at ADR-0021.

The session that wrote this change:
`https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

studio(interfaces): create flows for list views, dashboards, reports and pages in a writable package (ADR-0084), after #11790's nav item types

2 participants