Skip to content

feat(#83): text element follow-ups — double-tap, mid-edit styling, multi-text merge, commit semantics#118

Merged
akshay2211 merged 5 commits into
mainfrom
feat/83-text-edit-followups
Jul 14, 2026
Merged

feat(#83): text element follow-ups — double-tap, mid-edit styling, multi-text merge, commit semantics#118
akshay2211 merged 5 commits into
mainfrom
feat/83-text-edit-followups

Conversation

@akshay2211

Copy link
Copy Markdown
Owner

Implements five of the six #83 follow-ups. Item #4 (rotation) is left out — it needs a repro/video, not a blind fix.

Changes

SDK (frozen surface additions — see RFC 0001)

Sample

drawbox-ui + sample

Docs

  • RFC 0001 (retroactive, Accepted) documents the text surface + these additions, per docs/rfcs/README.md. Backfills the RFC that the frozen-surface additions require.

Verification

Notes

Add Event.TextEditRequested(id) and Intent.RequestTextEditAt to the frozen
surface. DrawBox emits RequestTextEditAt on a double-tap in SELECT mode; the
controller also emits TextEditRequested when an already-sole-selected text is
tapped again (tldraw/Figma pattern). Reducer gains a hitTopmost passthrough so
the controller can resolve the edit target without duplicating pick logic.

Documents the text surface (shipped in 2.1.0-alpha01) + these additions in a
retroactive RFC 0001, per docs/rfcs/README.md.
- #83.3: text chips apply to every selected text and show a dimmed "mixed"
  state (ContextBarState.*Mixed) when the selection disagrees on a property.
- #83.1: while the inline editor is open, the selection context bar sits above
  the commit overlay and the overlay skips presses a chip already consumed —
  so tapping a chip restyles the element instead of committing.
- #83.5: Esc cancels the edit without committing (deleting a freshly inserted
  empty element); losing focus (IME dismiss / window blur / tap-away) commits.
The commit overlay was a full-screen catcher sitting ABOVE the ContextBar
and firing on pointer press, so tapping a style chip committed the editor
before the chip could handle the tap. Rework by composition order, no
zIndex: render the overlay BETWEEN the canvas and the toolbar layer, using
release-based detectTapGestures. Now a chip tap reaches the ContextBar and
restyles the element live; only a tap on empty canvas commits.

A fillMaxSize Box WITH a zIndex captures pointer events (an earlier attempt
to lift the toolbar layer that way silently broke element selection), so
this relies purely on composition order and keeps empty-area pass-through.

Also drop the focus-loss auto-commit: DrawBox re-grabs canvas focus on
press, which made it fire spuriously.

Verified on the JS web build: selection works, and tapping a size chip
while editing enlarges the text with the editor still open (no commit).
… handles

Add a `selectionStyle: SelectionChromeStyle` parameter to `DrawBox` for tuning
the selection chrome — `padding`, `handleSize`, `cornerRadius`, `strokeWidth`,
and `accent`. The selection box now draws with rounded corners; grips are hollow
rounded-corner squares (no fill) so the element shows through, and the box
outline plus rotation connector are clipped so no chrome line is drawn inside a
handle. Resize hit-testing tracks the padded box so grab targets stay aligned.
@akshay2211
akshay2211 merged commit 5f55bab into main Jul 14, 2026
3 checks passed
@akshay2211
akshay2211 deleted the feat/83-text-edit-followups branch July 14, 2026 03:26
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.

Text element follow-ups (mid-edit styling, double-tap, scoped overlay)

1 participant