Skip to content

fix(app-shell): a node click on a read-only flow canvas selects the node and opens the inspector read-only (objectui#11546) - #11603

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-11546-readonly-canvas-select
Oct 4, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-11546-readonly-canvas-select

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11546

Clause-②: no

On a read-only package, a click on a flow canvas node in Studio → Automations now selects the node and opens the flow inspector read-only. Only the drag is withheld. No editable input appears.

Mechanism (measured in Chromium before the fix)

FlowCanvas's onNodePointerDown returned early on a read-only canvas (if (!editable || e.button !== 0) return;) before e.stopPropagation(). The press therefore reached the viewport's onBgPointerDown, which calls onSelect(null) and takes pointer capture on the viewport. A browser sends the pointerup and the click to the capturing element, so the click landed on the viewport and the node card's onClick (its select) never ran.

A scratch harness (untracked, deleted after use) mounted the registered FlowPreview exactly as the Automations pillar mounts it on a read-only package (editing: true, onSelectionChange, no onPatch), with the registered FlowInspector given readOnly: true. It was driven in Chromium (/opt/pw-browsers/chromium) at base 2e818d0 and again with the fix:

reading base 2e818d0 with the fix
read-only node click (page.click) selection none, inspector absent node:find, 7 inputs, 0 enabled
read-only node click (mouse.down / mouse.up) selection none node:find
event targets after a read-only node press pointerdown on the node card, gotpointercapture / pointerup / click on the viewport (role=application) pointerdown, pointerup and click on the node card
read-only press-and-drag on a node not moved not moved
read-only edge click edge:e_start_find, 3 inputs, 0 enabled same
editable node click / drag (control) node:find, 7 inputs, 7 enabled / moved same

Change

FlowCanvas onNodePointerDown: in design mode a node press stops propagation whether or not the canvas is editable, and only the drag start stays gated on editable. The Delete-key handler is untouched and still gated on editable. Outside design mode, where a node click selects nothing, a node press still falls through to the background pan, as before.

StudioDesignSurface.tsx is unchanged. The selection already opened the inspector with the pillar's real readOnly flag (objectui#11124's path). It was the selection that never happened.

Edges are a different mechanism and needed nothing. The edge hit-path and its branch-label pill stop propagation on pointer-down unconditionally whenever the edge is selectable (design mode with onSelectEdge). The table above shows a read-only edge click selecting the edge at base already. Nested region-tray nodes also stop propagation unconditionally.

Pins

  • New packages/app-shell/src/views/studio-design/StudioDesignSurface.automationsReadOnlySelect-11546.test.tsx, with the real AutomationsPillar, FlowPreview and FlowInspector:
    • "selects the clicked node and opens its inspector, with every input disabled": a read-only package; the rail's Label and ID are disabled, and no input, textarea, select, contenteditable, combobox, switch or checkbox in the rail is enabled. No save happens.
    • "the same click opens the inspector with editable inputs": the writable control. It also shows that the read-only test's "no enabled control" reading can fail.
  • FlowCanvas.test.tsx, a new describe block for objectui#11546: a read-only click selects that node and never calls onSelect(null); a read-only drag captures nothing, writes nothing and pans nothing; the editable designer (the control) still selects on click and commits position on drag; outside design mode a node press still pans.
  • New helper packages/app-shell/src/views/metadata-admin/previews/__tests__/browserClick.ts (browserClick, browserDrag). It sends the pointerup and the click to the element holding pointer capture, then releases capture, as a browser does. happy-dom records setPointerCapture but routes no event by it. That routing gap is why objectui#11124's pins stayed green on this defect: they send fireEvent.click straight to the node card, with no press. The helper sits under __tests__/, which app-shell's tsconfig.json excludes from the build. The dist check below confirms nothing of it ships.
  • objectui#11124's read-only-inputs pin, "opens the flow inspector read-only: the node inputs are disabled" in StudioDesignSurface.automationsReadOnly-11124.test.tsx, is untouched and green, together with the rest of that file.

Ablation (fix committed first; the subject resolves from src, so no build sits on the path)

The ablation used node /home/user/objectstack/scripts/ablation-replace.mjs under the verify lock. The anchor was the three fixed lines (if (!editable && !designMode) return; / e.stopPropagation(); / if (!editable) return;). They were replaced by the base order (if (!editable) return; / e.stopPropagation();). The tool reported: anchor hits 1 → 0, blob 82501d693e1d → 95126d94e35d.

  • Expected direction: the read-only pins turn red and the controls stay green. Observed: that direction. Tests 3 failed | 29 passed (32) over the new pin file, FlowCanvas.test.tsx and the objectui#11124 file. The 3 red were the host read-only pin (the inspector's Label never appears), the canvas read-only click (expected [ null ] to deeply equal [ 'b' ]) and the canvas read-only drag (the viewport captured the press). Every objectui#11124 pin stayed green under the defect.
  • Restore: git checkout HEAD -- PATH was run with PATH absolute. Blob after the restore = HEAD blob 82501d693e1d58384729c3cf61f9c29284399a98, and git diff HEAD is empty.

Gates (all at c47b708)

command exit verdict line
pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build (lock) 0 Scope: 29 of 47 workspace projects, VERDICT command-exit 0
pnpm --filter @object-ui/app-shell type-check (tsc --noEmit && tsc -p tsconfig.test.json) (lock) 0 silent tsc; --listFilesOnly on tsconfig.test.json lists the helper and both pin files (3)
pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/ packages/app-shell/src/views/studio-design/ + packages/app-shell/src/__tests__/spec-symbol-parity.test.ts, apps/console/src/__tests__/registry-inputs-spec-parity.test.ts, scripts/__tests__/{markdown-test-inputs,one-authority-per-exported-name-6273,check-lucide-icon-record-names}.test.ts (lock) 0 Test Files 472 passed (472), Tests 5352 passed / 1 skipped (5353)
pnpm --filter @object-ui/app-shell build, then a dist/ probe (lock) 0 FlowCanvas.js 1 (control, carries the fix); browserClick* 0; __tests__ paths 0; *11546* 0
node scripts/check-control-bytes.mjs 0 OK (scanned 7497 tracked text file(s)…)
node scripts/check-new-cross-file-line-citations.mjs 0 0 new citation(s)
node scripts/check-changeset-presence.mjs 0 1 changeset(s) added
node scripts/check-changeset-claims.mjs 0 No pending changeset names a file this change touches.
node scripts/check-pending-changeset-literals.mjs 0 No test source names a pending changeset.
node scripts/check-changeset-no-major.mjs / check-changeset-overwrite.mjs 0 / 0 No changeset declares a major bump. / No pre-existing changeset was modified or deleted.
node scripts/check-vi-mock-specifiers.mjs / check-vi-mock-inherit.mjs / check-vi-mock-override-shape.mjs 0 / 0 / 0 OK each
node scripts/check-test-path-roots.mjs 0 OK
node scripts/check-phantom-dependencies.mjs / check-published-tsconfig-tooling-exclude.mjs 0 / 0 Every in-scope i… / all 34 enforced package(s) carry the directory form

Test selection, narrowed: both touched directories in full, plus every test that imports or reads as source text a changed file or FlowCanvas. The selection was made by git grep for FlowCanvas / flow-canvas-parts / browserClick over test files, and by readFileSync / ?raw readers that name the previews path. The rest of app-shell and the whole-repo pnpm test are declared to CI.

Lint, a proven narrowing (not pnpm lint): npx eslint --format json was run from packages/app-shell, as its eslint . would be.

  1. Population: the diff's four .ts/.tsx files. eslint's own config answers the changeset .md with "File ignored because no matching configuration was supplied."
  2. Count: the JSON holds 4 results, 0 errors and 1 warning. The warning is react-hooks/exhaustive-deps on addNode's useCallback. The base file linted identically shows the same warning at the same place, so it is not this diff's.
  3. Invariance: eslint.config.js sets no parserOptions.project / projectService, so the linting is not type-aware. No rule under eslint-rules/ reads another file (zero readFileSync / readdirSync / globSync hits). This diff therefore cannot move the verdict on an untouched file.

NOT MEASURED: pnpm check:published-dist, reason: it builds the whole workspace (CI's run). The narrowed dist/ probe above covers this diff's helper. NOT MEASURED: full pnpm test / pnpm lint, reason: repository-wide runs owned by CI.

Acceptance notes

  • The react-hooks/exhaustive-deps warning on addNode (an unnecessary positionOf dependency) predates this branch and is left alone. It is out of scope and not a defect.
  • One-off evidence (the Chromium harness, the driver, the ablation) left no file in the tree.

Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2


Generated by Claude Code

…ode and opens the inspector read-only (objectui#11546)

On a read-only canvas FlowCanvas's node pointer-down returned before
stopping propagation, so the press reached the background: it cleared the
selection and took pointer capture on the viewport, and the browser fired
the click at the viewport, so the node's select never ran. In design mode a
node press now stops propagation whether or not the canvas is editable;
only the drag start stays gated on `editable`. Outside design mode a node
press still falls through to the background pan.

Pins route the press the way a browser does (pointerup and click to the
capturing element), which happy-dom does not do on its own: the Studio
Automations pillar on a read-only package (inspector opens, every input
disabled) with its writable control, and FlowCanvas cases for read-only
select, withheld drag, the editable designer and the non-design pan.

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

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 331 chunks) 3312.3 KB 3330.4 KB
Main entry chunk (gzip) 151.3 KB 350 KB
Entry file index-D7uMinnb.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.22KB 6.37KB
app-shell (runtime-config.js) 20.68KB 7.36KB
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.17KB 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) 572.97KB 137.34KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 232.57KB 64.51KB
fields (index.js) 261.62KB 66.20KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
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.24KB 2.27KB
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) 35.66KB 9.49KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 39.47KB 11.25KB
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.17KB 15.46KB
plugin-charts (index.js) 83.60KB 22.89KB
plugin-chatbot (index.js) 198.22KB 46.97KB
plugin-dashboard (index.js) 142.89KB 38.62KB
plugin-designer (index.js) 231.41KB 48.84KB
plugin-detail (index.js) 245.60KB 64.57KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 175.44KB 45.28KB
plugin-gantt (index.js) 179.16KB 45.06KB
plugin-grid (index.js) 235.63KB 64.77KB
plugin-kanban (index.js) 49.59KB 15.58KB
plugin-list (index.js) 116.46KB 28.93KB
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) 38.80KB 11.71KB
plugin-tree (index.js) 14.51KB 5.15KB
plugin-view (index.js) 90.23KB 22.73KB
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) 6.06KB 2.68KB
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) 21.42KB 7.05KB
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) 0.20KB 0.18KB
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.07KB 2.39KB
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 (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 4, 2026 09:16
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 4, 2026 09:16
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit 278d244 Oct 4, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11546-readonly-canvas-select branch October 4, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants