Skip to content

Expose core-modal-open signal to extensions (shell.modalOpen) - #3865

Merged
mstomar125 merged 1 commit into
mainfrom
issue-3837-core-modal-signal
Oct 22, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-3837-core-modal-signal

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Refs #3837

What

Fix 2 of the issue: a signal for extensions that a core modal is open.

  • shell.modalOpen (new, in @nodespace/extension-api): a reactive boolean getter, true while any core modal is on screen. Reads in a $derived or a contribution's when() re-run when it flips.
  • Backing store stores/core-modal-presence.svelte.ts (a set of registrations, released at most once each) and a coreModal Svelte action (actions/core-modal.ts) that registers on mount and releases in destroy. The signal therefore follows the {#if} that shows the modal and cannot stick on after close, unmount or teardown. The action is deliberately not exported to extensions, so an extension's own focusTrap modal does not count as core's.
  • Registered: the first-launch onboarding wizard, delete-confirmation-modal, subtree-access-denied-modal (the three hand-rolled aria-modal overlays).

API addition, needs architect ack

shell / ExtensionShell is a new additive export of the host API (one readonly getter). No existing export changes.

Tests

tests/components/core-modal-signal.svelte.test.ts (6): registration semantics incl. double release, reactivity in a derivation, and each of the three modals on/off, plus unmount while open. Mutation-checked: removing use:coreModal from each modal fails its tests.

Not done

  • Fix 3 (docs): the extension points guide lives only in the nodespace-docs repo (architecture/extension-points.md), not edited here. Proposed text for a maintainer to add under the app-shell-modal slot:

    An app-shell-modal contribution shares the screen with core's own modals, such as the first-launch setup wizard (which is not in this slot). Core's modals are modal: a dialog opened over one takes its clicks and keyboard focus. Read shell.modalOpen from @nodespace/extension-api (for example in the contribution's when()) and wait until it is false before opening a dialog. It covers core's hand-rolled modals only, not dialogs an extension opens itself.

  • Core modals built on bits-ui Dialog/Sheet (import options, database name dialog, nested property modal, relationship viewer modal, play viewer, settings dialogs) do not register yet; the signal covers the three hand-rolled overlays named in the issue. They can adopt use:coreModal or an equivalent effect in a follow-up.
  • The base-node date picker (role=dialog, aria-modal) is a popover over the editor, not registered.
  • The extension-side dialog stacking order itself (issue's first point) is untouched.

🤖 Generated with Claude Code

Core's hand-rolled modals (first-launch wizard, delete confirmation,
subtree-access-denied) register through a coreModal action that releases
on destroy; the host API reads it through a reactive shell.modalOpen getter.

Refs #3837

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant