Skip to content

fix(app-shell): Studio holds an incomplete field or step as an unsaved edit with a hint, and Publish refuses while one is held (objectui#11786) - #11876

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-11786-autosave-incomplete-hold
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-11786-autosave-incomplete-hold

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11786

Clause-②: no

What this changes

On Studio's Data and Automations pages, the ordinary path through an incomplete field or step no longer passes through a red refusal. Such an edit is held: it stays on screen, unsaved, the inspector says what it needs, and Publish refuses while it is held. A save of a finished draft that is refused keeps objectui#11785's red strip.

  • Data page: Picklist or Radio before an option, Lookup or Master-detail before a target. Before its autosave sends, the pillar runs the object write guard (assertObjectMetadataWritable, the predicate the door itself runs) on the body it would send. When the guard would refuse, the autosave is held (blocked): the edit stays dirty and nothing is sent. The field inspector shows "Add at least one option. Changes are saved once the field has one." under the options editor, or "Pick the object to link to. …" under the related-object picker. Where the strip goes, a neutral line names the field by its label: "Not saved yet: the field “Status” needs at least one option. Your changes are kept here and saved once it is filled in." It offers "Show me" when that field's inspector is not the one open. Adding the option or picking the target lets the next autosave go.
  • Automations page: a step added before its required inputs are filled. Before its autosave sends, the pillar asks specRequiresField (inspectors/flow-required-keys.ts, reused unchanged) about each top-level step, for every input its inspector shows that the step leaves out. When one is required, the autosave is held. FlowNodeInspector shows "Required. Changes are saved once this has a value." under that input's required marker, and the same neutral line names the step and the input ("Title on the step “Notify” needs a value").
  • Publish. The open pillar reports the clause of its held edit to the surface through a new optional onHeldEditChange prop on DataPillar and AutomationsPillar, set at their three mounts in the surface. The pillar takes the report back on unmount. While an edit is held, the surface's publish shows "Not published: Title on the step “Notify” needs a value, so that change is not saved yet. Finish it, then publish." and publishes nothing.
  • Errors stay for finished work. A body neither predicate holds is sent exactly as before. Any refusal it draws, such as a server 422 or a transport failure, shows the objectui#11785 strip unchanged. The guard in @object-ui/data-objectstack is untouched and still holds the option-less and target-less save on purpose (objectui#11253).

Nothing is added to the package entry: no export, prop, type member or language-pack key. Only StudioDesignSurface and its props reach index.ts, and neither pillar does. The new strings are rows in the metadata-admin designer's own string table (en and zh), under engine.studio.held.* and designer.field.hint.*.

Measured before acting (dispatch Zone 2)

  • H1, which door. All three cases go through the Studio pillars' useDraftAutoSave. The inspector's type switch and the canvas's "add node" each call the pillar's onPatch, which raises the dirty flag the hook's timer reads. ResourceEditPage's own autosave is not on any of these paths. The pins hold each case at the hook, and the ablation below shows the hook sending without the hold.
  • H2, Picklist and Lookup never reach the network. Confirmed. The guard throws inside MetadataClient.save before any request: even with the predicate ablated, the transport double records no PUT. The red strip was doSave's catch. The not-verified part, naming a held edit whose field is not open: my choice is a neutral line in the strip's place (muted, not destructive), shown whenever an edit is held. It names the field or step, and "Show me" appears only when that input is not the one open. The reason: while an edit is held, the page's save status says nothing. There is no "Saving…", and "Saved HH:MM" is hidden while the buffer is dirty, so the line is the only statement that the change is kept but not sent.
  • H3, the Notify 422. Measured on the installed @objectstack/spec 17.7.0 with FlowSchema.safeParse, on the exact draft Studio sends: buildFlowSkeleton, plus a Notify added on the edge with the canvas seed channels: ['inbox'], recipients: []. The parse reports one issue, at nodes.2.config.title: "A notify node needs one content source: inline title (+ optional message), or a template reference … Neither was given, so there is nothing to deliver." An empty recipients list is not refused. The key is required, but an empty list is a value, so the "recipients and title" part of the hypothesis holds only for the title. This is the spec parse, not a live 422: no booted showcase was reachable here, because the sibling objectstack checkout has no install or build. So the hold asks the spec for each input, never a list. A missing recipients key is held (pinned). An empty list is not held, a blank title: '' is not held (the judge accepts it), and a template in place of title is not held.
  • H4, Publish with a held edit. Measured by ablation (run C below): with the surface's check removed, the sheet's publish calls publishPackageDrafts while the Notify edit is held. In other words, it publishes the saved drafts without the edit. Now Publish refuses and names the step. The signal crosses from pillar to header through the new optional prop and the three mount lines. No file outside the claim is touched.
  • H5, finished but wrong stays red. Pinned: a server 422 on a complete Data body shows the red strip naming the field, and no held line. AutomationsPillar.authorRefusal-11785.test.tsx (a save refused through the Enabled switch) is unchanged and green.

Pins

  • metadataError.heldEdit-11786.test.ts (the two predicates): each "held" case is paired with the judge's own verdict on the same body (the door refuses it, or FlowSchema names the key), and each "not held" control with a body that judge accepts. So the hold is never stricter than the contract. Covered: the measured Notify seed held for Title, a missing recipients key, an unlabelled step, the guard's order, an unnamed array field (not held, its refusal shows), and zh.
  • DataPillar.heldIncomplete-11786.test.tsx (real MetadataClient, transport double): Picklist sends nothing and shows no red strip, shows the line and the options hint, and one option sends the save and clears both. Lookup does the same with the target hint, and a typed target sends the save. "Show me" reopens a held field after its inspector was closed. Controls: a complete edit autosaves with no line, and a server 422 on a complete body shows the red strip.
  • AutomationsPillar.heldIncomplete-11786.test.tsx (real FlowPreview / FlowInspector): a Notify added on the edge sends no draft and shows no red strip. The line names "Title on the step “Notify”", and exactly one hint sits directly under Title. Filling Title sends the save and clears both. "Show me" reopens the step after deselecting it.
  • StudioDesignSurface.heldPublish-11786.test.tsx (the real surface): with a Notify held, Publish refuses naming it and publishes nothing. Once the step is filled and saved, Publish goes. With nothing held, Publish goes as before.
  • Updated, same claims: the Picklist case of DataPillar.authorRefusal-11785.test.tsx and both cases of DataPillar.choiceWithoutOptions-11253.test.tsx now read the held line, not a refusal strip. objectui#11785's requirements (the field named by its label, no developer text, "Show me" reopens it) and objectui#11253's wire claim (no request carries a choice without options, and one option lets the save go) are asserted unchanged. The guard's sentence with Details is still pinned at the view model, in metadataError.authorRefusal-11785.test.ts.

Ablation (committed implementation, restore proven each leg)

Run on 4996e5a through ablation-replace (anchor hit once, landed on disk, restored), under the shared verify lock:

  • A, the Data predicate removed from the autosave's blocked: DataPillar.heldIncomplete-11786 2 failed of 5 (Picklist and Lookup). First failure: "no red strip on the normal path: expected the refusal strip to be null". The guard's strip came back. The "Show me" pin stayed green: it reads the line, which the predicate still feeds, and the no-request half is the guard's own.
  • B, the flow predicate removed from blocked: AutomationsPillar.heldIncomplete-11786 2 failed of 2. "a step missing a required input is not sent: expected vi.fn() to not be called at all, but actually been called 1 times".
  • C, the surface's held check in publish disabled: StudioDesignSurface.heldPublish-11786 1 failed of 3. "Publish must not go around the held edit: … called 1 times". This is the H4 measurement.
  • Each restore: blob 0d81d740590c equal to HEAD, git diff HEAD empty. The final proof after all three legs gave the same result.

Tests and gates

Final head ed6cc52 (this branch merged with main at b0aa892, never rebased), from the worktree root:

  • Build and type-check (locked): turbo run build --filter=@object-ui/app-shell^... --concurrency=2, 28 of 28 tasks, exit 0. pnpm --filter @object-ui/app-shell type-check (tsc --noEmit && tsc -p tsconfig.test.json) exits 0. tsc -p tsconfig.test.json --listFiles lists all four new test files.
  • Tests (locked): pnpm exec vitest run --maxWorkers=2 on the union below, run on ed6cc52: 291 files passed, 3110 tests passed and 1 skipped (a skipIf that keys on the installed spec's version and was already there), exit 0.
    • packages/app-shell/src/views/studio-design/ in full, plus every app-shell and console test that imports StudioDesignSurface, metadataError, ObjectFieldInspector, FlowNodeInspector, FlowInspector or the built-in inspector registration, plus the metadata-admin i18n, flow and ResourceEditPage suites. The set is derived by git grep on this head.
    • 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 11 changed source and test files: 0 errors and 27 warnings, every one on a line this branch did not write (by git blame). The full pnpm lint is CI's.
  • Gates, all exit 0: control-bytes, test-path-roots, changeset-claims, pending-changeset-literals, i18n-keys, i18n-drift, i18n-dead-keys (none of the new rows reported), i18n-designer-parity ("Every en row has a zh row, and every shared row carries the same placeholders."), metadata-write-doors ("3 reach assertObjectMetadataWritable"), new-line-citations, spec-symbols, designer-field-key-parity, scripts/check-changeset-presence.mjs, and check-governed-queue-guard.mjs --test ("An ordinary pull request").
  • NOT MEASURED: check:eager-closure. PREREQUISITE NOT MET, because it reads a built console. Stand-in: the new imports in metadataError.ts (flow-required-keys.ts, flow-node-config.ts, @objectstack/spec/automation) are already in the package entry's eager closure, through register-builtins.ts → inspectors/index.ts → FlowInspector → FlowNodeInspector. So no module enters it. ObjectFieldInspector imports nothing new beyond more names from a module it already imported.
  • Cost: flowHeldEdit measured about 4 ms per draft change on a flow of 40 complete Notify steps (a shared-box reading, so ratio-only). It runs only while the buffer is dirty. No cache was added.
  • Real browser: not taken. No booted Studio was reachable (no objectstack install or build in this container), so the pins go through the real pillar components, as objectui#11785's did.

Acceptance notes

  • Two explicit saves still send an incomplete buffer, both outside this card's regions: the Data page's column drag-reorder (doReorderFields) and the Automations page's Enabled switch (toggleEnabled). Each saves the whole buffer at once. With a held field or step, it draws the guard's or the server's refusal as objectui#11785's red strip, naming it. Read from code; not reproduced in a browser. No one is carrying this.
  • Steps nested in a loop, parallel or try/catch region are not checked by the flow predicate. Their refusal shows as the server words it.
  • Leaving the Data or Automations page with a held edit discards it without a prompt, as an unsent (refused) edit was discarded before. Only the Access and Interfaces pillars report dirty state to the header's leave-confirm. Not changed here.
  • The inline hints also appear where the same inspectors serve the metadata-admin editors. They are worded to hold there too ("Changes are saved once …"), and that page's own save gate is unchanged.

Generated by Claude Code

claude added 3 commits October 8, 2026 02:27
…d edit with a hint, and Publish refuses while one is held

Switching a field to Picklist or Lookup, or adding a Notify step, drew a red
refusal before the author could fill the field or step in. The Data and
Automations pillars now ask the judge that would refuse the body before the
autosave sends it: the object write guard for fields, and specRequiresField
over each step's inspector inputs for flows. Such an edit stays dirty and
unsent, the inspector hints the input it needs, a neutral line names it with
"Show me", and Publish refuses naming it. A refused save of a finished body
keeps the red strip.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
ObjectFieldInspector.tsx: both sides edited the data-objectstack import; kept
this branch's guard symbols beside main's new @object-ui/i18n import.

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, 333 chunks) 3348.4 KB 3363.9 KB
Main entry chunk (gzip) 86.0 KB 350 KB
Entry file index-H1l93mAG.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) 584.59KB 140.69KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 235.31KB 65.44KB
fields (index.js) 266.88KB 67.46KB
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) 239.75KB 65.92KB
plugin-kanban (index.js) 52.17KB 16.37KB
plugin-list (index.js) 117.42KB 29.32KB
plugin-map (index.js) 25.60KB 8.62KB
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants