Skip to content

V3: direct text editing - #169

Merged
git-chad merged 49 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-text-editing
Oct 1, 2026
Merged

git-chad merged 49 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-text-editing

Conversation

@git-chad

Copy link
Copy Markdown
Collaborator

Adds direct text editing (roadmap 2.2 and 2.3). Double-clicking the canvas edits the selected text layer in place, in its real font, size and position: Enter adds a line, Cmd+Enter or clicking away commits, Esc restores the previous text, and the whole edit is one undo step. Text layers get the same canvas handles as masks and shapes: the center handle moves the text (writing Offset), the X handle rotates it, the Y handle changes Font Size. The panel gains an Edit text button and a multiline Text field.

Typography: Font Size now goes down to 8 (was 48), plus Align (Follow anchor keeps the old behavior, or Left/Center/Right), Line Height and Rotation around the anchor point. Layout moved into a shared renderer/text-layout.ts used by both the editor and runtime passes after their own crop and anchor math. Single-line text with default values produces exactly the previous glyph positions, so the legacy PNG baselines are unchanged; hydration appends the new defaults to older files, mirrored in the existing-project expectation (which now prints per-layer diffs when it fails).

Position relies on the stable artboard from #167, so the in-place editor, handles, preview and export coincide.

Validation:

  • bun run check — passes; the same three preexisting lint warnings.
  • bun run test:composition — full suite passes, including tests/composition/text-editing.mjs: layout on both passes (line count and gaps, line height, top/bottom anchors, explicit alignment, 90° rotation about the anchor, 12px rendering, editor/runtime parity), offset/pivot geometry helpers, editability rules, hydration, export and reopened pixels. Legacy baselines untouched.
  • bun tests/composition/text-editing-ui.mjs — actual editor: handle move/rotate/resize with one-undo-per-drag, double-click in-place editing, Cmd+Enter commit, Escape cancel, sidebar textarea, Font Size down to 8. layer-masks-ui.mjs and shape-layers-ui.mjs pass after the shared-handles change.

Limits: wrapping is manual (Enter); very large rotated text can clip at the canvas edge as before; at tiny sizes the three handles overlap. Stacked on #168 (git-chad/v3-shape-layers), within integration #150. Nothing merges to main before V3 is complete. Focused user test: tests/composition/TEXT-EDITING-MANUAL-QA.md.

@vercel

vercel Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
shader-lab Ready Ready Preview Oct 1, 2026 7:06am UTC

@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

The PR is not yet safe to merge because cancelling a text resize does not restore the original size and rotated top/bottom-anchor editing is spatially incorrect.

Summary

This PR adds direct multiline text editing, canvas geometry handles, expanded typography controls, shared text layout, persistence coverage, and editor/runtime tests.

  • Text can be edited in place and committed or cancelled as one interactive operation.
  • Text rendering now supports alignment, line height, rotation, and smaller font sizes.
  • Shared geometry and layout helpers coordinate editor handles with runtime rendering.
  • Three interaction inconsistencies remain around resize cancellation, rotated anchored editing, and text-length enforcement.

Reviews (1) · Last reviewed commit: "Add direct text editing with multiline, ..."

Comment thread src/components/editor/text-handles-overlay.tsx
Comment thread src/components/editor/text-edit-overlay.tsx Outdated
Comment thread src/components/editor/text-edit-overlay.tsx Outdated
…roup failures

Media load callbacks now ignore replaced or removed passes and pending loads are cleared on disposal. Strict-mode pass failures are reported once at the originating pass instead of at every group boundary.
Publishing now drops every descendant of a hidden group and clears the
parentId of any retained layer (the audio source) whose parent was removed,
so the published scene passes hierarchy validation on reopen.
Cap the neighbor row and column search to two cells each side so the
worst-case cellAt count per fragment is 25 instead of unbounded in the
packed minimum-size, maximum-stroke configuration. Mirrored in the
runtime package.
…e on buttons

Clear the active paint layer when the layer stops being paintable (selection,
mode, visibility or lock change) so Paint never resumes without Edit Paint.
Only preventDefault on Space for non-interactive targets so focused buttons
and links still activate.
Create the .context artifact directory up front and pick the history shortcut modifier from the platform.
Importing a project now disarms the armed remix draft and clears the remix origin alongside the active draft, so later edits cannot autosave under the previous remix title.
…handle unmount

Mask coordinates are now measured against the composition crop frame in the
renderer and the handles overlay, so preview and export agree when the
viewport and composition aspect ratios differ.
Unmounting the handles mid-drag no longer writes the drag-start mask back,
which overwrote the result of an undo.
… imports

- Recompute outputSize from the restored scene config when applying a history snapshot
- Normalize Custom imports whose saved composition differs from the guide size, keeping fixed Custom documents intact
… UI test docs

- GeometryHandles: keep restore in a ref so rerenders during a drag no longer cancel it
- shape-pass (editor and runtime): atan2 returns +-PI on the negative axis when y is zero
- shader-export: add shape to SupportedShaderExportLayerType
- Document shape-layers-ui.mjs in SHAPE-LAYERS-MANUAL-QA.md
…th limit

- restore font size when a text handle resize is cancelled
- rotate the edit textarea around the anchor on both axes
- cap in-place text edits at the Text parameter's 600 characters
@git-chad
git-chad force-pushed the git-chad/v3-shape-layers branch from d9684d7 to 33e78c0 Compare October 1, 2026 07:04
@git-chad
git-chad force-pushed the git-chad/v3-text-editing branch from fbb0a86 to 70a3ff9 Compare October 1, 2026 07:05
@git-chad
git-chad changed the base branch from git-chad/v3-shape-layers to git-chad/shader-lab-v3-plan October 1, 2026 15:13
@git-chad
git-chad merged commit 70a3ff9 into git-chad/shader-lab-v3-plan Oct 1, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 70a3ff9c Deployed Oct 1, 2026 by vercel[bot]
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