Skip to content

feat(canvas): default the spatialCanvas flag on - #934

Merged
h4yfans merged 3 commits into
mainfrom
canvas-default-on
Aug 3, 2026
Merged

feat(canvas): default the spatialCanvas flag on#934
h4yfans merged 3 commits into
mainfrom
canvas-default-on

Conversation

@h4yfans

@h4yfans h4yfans commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

What

  • Flips FEATURES_SETTINGS_DEFAULTS.spatialCanvas to true, so a fresh install gets the Canvases sidebar section and a Settings → Features → Canvas toggle that already reads On.
  • Adds promoteSpatialCanvas, a one-time per-vault pass at vault open that clears a collateral spatialCanvas: false left by pre-M7 writes.
  • Docs and the default-off test expectations follow; the two sidebar suites now mock SidebarCanvasList, which mounts for the first time under the on-by-default flag.

Why

M7 PR B — the default-on flip, per docs/superpowers/specs/2026-07-22-spatial-canvas-m7-rollout-design.md §7. Its prerequisites are on main: the split-view note lock, canvas_created / canvas_opened telemetry, X-Memry-Sync-Types negotiation, and the canvas user guide.

The default alone does not reach every install. writeGroupSettings persists the whole features group, so a user who toggled any other feature also wrote spatialCanvas: false to disk without ever deciding about canvas, and the stored value wins over the default. §8 of the design reads that as a deliberate opt-out; the mechanism cannot tell it apart from "turned Journal off once". The promotion pass rewrites only that case, marks the vault, and never runs again — so an opt-out made after this release survives.

Rollback: the one-line default plus its two test expectations; the promotion module and its vault/index.ts call are one file and one line to delete.

M7 PR B: the default-on flip. Canvas has been opt-in behind
FEATURES_SETTINGS_DEFAULTS.spatialCanvas: false since M0; the M7 rollout
gates are merged (split-view note lock, canvas_created/canvas_opened
telemetry, X-Memry-Sync-Types negotiation, canvas user guide), so new
installs now get the Canvases sidebar section and a Settings > Features
toggle that already reads On.

Backward compatible by construction: readGroupSettings merges the stored
blob over the defaults, so an install that persisted spatialCanvas: false
keeps it off. Rollback is the one-line default plus the two test
expectations.
Copilot AI review requested due to automatic review settings August 3, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request test labels Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 328bb64.

The CANVASES section was unreachable in these two suites while the flag
defaulted off, so their window.api fakes never needed the canvas event
APIs. With the flag on, SidebarCanvasList mounts and subscribes, and the
bare fakes throw 'window.api.onCanvasCreated is not a function'.

Preload does expose all three (preload/generated-rpc.ts:39-41), so this
is a test-fake gap, not a runtime one. Mocked the same way as the tag and
bookmark lists — a heavy child with its own sibling coverage in
sidebar-canvas-list.test.ts.
Copilot AI review requested due to automatic review settings August 3, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Flipping the default alone does not reach every install. writeGroupSettings
persists the whole 'features' group, so a user who toggled any other feature
also wrote spatialCanvas: false to disk without ever deciding about canvas —
and the stored value wins over the default. Those installs would silently
miss the surface this release announces.

promoteSpatialCanvas runs once per vault at open, rewriting only that
collateral false. It is not a re-enable loop: the marker key is written on
the first run whatever the outcome, so an opt-out made after the promotion
survives every later open. Fresh vaults, blobs without the key, and corrupt
blobs are all left alone — they already read as on through the defaults
merge.

Lives in its own module so settings/features.ts stays read-only by design,
and so the whole pass is one file to delete once the flip is well past.
Copilot AI review requested due to automatic review settings August 3, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@h4yfans
h4yfans marked this pull request as ready for review August 3, 2026 17:00
@h4yfans
h4yfans merged commit a3300bc into main Aug 3, 2026
14 of 15 checks passed
@h4yfans
h4yfans deleted the canvas-default-on branch August 3, 2026 17:00
h4yfans added a commit that referenced this pull request Aug 5, 2026
The spec asserted the sidebar section was absent "flag off (default)", but
#934 defaulted spatialCanvas ON and made it a real FEATURE_KEYS toggle, so
the section was there and the assertion could never hold.

Turn the flag off explicitly before asserting the gate — the same shape the
sibling test already uses — and raise the timeout for the extra reload.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants