Skip to content

fix(board): exclude frames from dbl-click text editor + style memory#142

Merged
winlp4ever merged 1 commit into
mainfrom
fix/frame-dbl-click
Jun 19, 2026
Merged

fix(board): exclude frames from dbl-click text editor + style memory#142
winlp4ever merged 1 commit into
mainfrom
fix/frame-dbl-click

Conversation

@winlp4ever

@winlp4ever winlp4ever commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Double-clicking a frame (canvas-harness's slide container, used by presentation mode) was popping the lib's inline text editor — an invisible caret on top of the slide chrome that turned any keystrokes into junk `node.content`. Frames have no own text body; the dbl-click should just select.

The two parity-paired exclusion sets — `CUSTOM_NODE_TYPES` (the dbl-click handler at harness-canvas.tsx:227 calls `store.cancelEdit()` for any type in this set) and `EXCLUDED_TYPES` (sticky style memory) — already had every Dim0 custom def + icon + image. Frame was the missing canvas-harness built-in.

Why both sets

The parity test at custom-node-types.test.ts:47 enforces that every entry in `CUSTOM_NODE_TYPES` is also non-stylable. Beyond satisfying the test, the style-memory exclusion is independently correct: frames have a fixed visual identity (slide chrome) and should never sponge styles from neighboring shapes nor donate styles back, same reasoning as folder/sheet/icon.

Test plan

  • `npm run type-check` clean
  • `npm test --run custom-node-types` — 5/5 green
  • Dbl-click a frame on the board: just selects, no text-caret appears
  • Style a rect, then create a new frame: frame doesn't inherit the rect's fill/stroke
  • Resize/move a frame: unaffected (this PR only changes dbl-click + style-memory dispatch)
  • Presentation mode: still steps through frames normally

Double-clicking a frame (canvas-harness's slide container, used by
presentation mode) was opening the lib's inline text editor — an
invisible caret on top of the slide chrome that turned any keystrokes
into junk node.content. Frames have no own text body; the dbl-click
should just select.

Add "frame" to the two parity-paired exclusion sets — CUSTOM_NODE_TYPES
(suppresses beginEdit) and use-style-memory's EXCLUDED_TYPES (frame
chrome is a fixed visual identity, shouldn't bleed styles in or out) —
plus the test fixture that locks the two sets in sync.
@winlp4ever winlp4ever merged commit 7c4c723 into main Jun 19, 2026
3 checks passed
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