Skip to content

On-canvas confirm affordance, re-editable signature realism, pinch/drag exclusion - #157

Merged
JamesmarkeyUK merged 2 commits into
mainfrom
claude/draw-confirmation-emoji-qlegp4
Aug 7, 2026
Merged

On-canvas confirm affordance, re-editable signature realism, pinch/drag exclusion#157
JamesmarkeyUK merged 2 commits into
mainfrom
claude/draw-confirmation-emoji-qlegp4

Conversation

@JamesmarkeyUK

Copy link
Copy Markdown
Collaborator

Five editor changes, all verified by driving the real app in Chromium against the example PDF.

Confirm affordance beside Delete

Placement tools stay armed after dropping an object so the next click drops another — right when ticking a run of checkboxes, but it left no obvious way out except the toolbar. A green confirm button now sits next to the bin whenever a placement tool is still active; clicking it deselects and returns to Select. A placed mark has three outcomes in reach: confirm, delete, or click elsewhere for the next one. Selections made with Select / marquee / hand / select-text place nothing, so they keep the bin alone.

Realistic ink is re-editable after placement

The pad rasterised the pen strokes and discarded them, so the realism choice was frozen at draw time and the double-tap editor could only touch name and date. Signatures drawn in-app now keep their stroke path alongside the ink, and the editor offers the same "Make it look more realistic" toggle, re-rendering the ink and its colour from those strokes. The renderer moves to src/lib/renderInk.ts so the pad and the editor produce identical output. Imported pictures have no strokes and so get no toggle, rather than one that does nothing.

A pinch is only ever a zoom

The viewer's pinch handler and the annotation layer's pointer handling never spoke to each other, so a second finger landing mid-drag zoomed the page while the shape kept following finger one — and committed wherever it ended up. The viewer now publishes a pinching flag; the layer cancels the drag / stroke / rubber-band, puts the nodes back, refuses to start new ones, and drops its Transformer handles until every finger lifts. Hand-tool panning bows out too rather than fighting the zoom for the same scroll offsets.

Also handles pointercancel, which previously left stale pointer ids behind and made the next single touch look like multi-touch.

One deliberate exception: an in-flight resize is stopped where it stands rather than reverted — Konva's Transformer has no partial-transform undo, and stopping still beats tracking finger one while the zoom shifts underneath.

Placements capped at half the page

Sizes are chosen in display pixels so they look consistent at any zoom, which breaks down zoomed out: at 25% a signature landed 640pt wide on a 595pt page. Signature, image and tap-default request boxes now scale down to fit half the page with the aspect ratio intact, and the ghost preview matches what gets dropped. A dragged request box is kept exactly as swept, since that's explicit intent.

Send-to-sign shortcut on a "Sign here" box

Placing the box and emailing the sign request are two halves of one job, and the dialog won't mint a link without at least one box. A selected box now carries an envelope affordance that opens the dialog directly, instead of a trip back to Sign ▾ → Request → Send to sign.

Verification

Driven in a real browser, not just typechecked:

  • Ticked three boxes in a row with the tool staying armed; confirm returned to Select and left the marks in place; re-selecting with Select showed the bin alone.
  • Signature realism toggled on → off → on, ink switching between clean grey and blue variable-width each time.
  • Placed a signature at 25% zoom: 100px wide on a 198px page (was 160px).
  • Pinch guard measured against a control — a plain drag moves a mark 0.176 of the page; the same drag interrupted by a pinch moves it 0.000 while the zoom goes 75% → 135%.
  • Envelope affordance opens the Send to sign dialog.

npm run typecheck and npm run build both clean.


Generated by Claude Code

claude added 2 commits August 7, 2026 10:05
Placement tools stay armed after dropping an object so the next click
drops another — the right behaviour when ticking a run of checkboxes,
but it left no obvious way out other than going back to the toolbar.

Show a green confirm button next to the bin whenever a placement tool
is still active. Clicking it deselects and returns to the Select tool,
so a placed mark now has three outcomes in reach: confirm, delete, or
click elsewhere to place the next one. Selections made with Select /
marquee / hand / select-text place nothing, so they keep the bin alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iWy9RAfHbLnXzpLnGJhh9
…zing, send-to-sign shortcut

Realistic ink is re-editable. The pad rasterised the pen strokes and threw
them away, so the realism choice was frozen at draw time and the double-tap
editor could only touch the name and date. Signatures drawn in-app now keep
their stroke path alongside the ink, and the editor offers the same
"Make it look more realistic" toggle, re-rendering the ink (and its colour)
from those strokes. The renderer moves to lib/renderInk.ts so the pad and
the editor produce identical output. Imported pictures have no strokes, so
they don't get the toggle rather than getting one that does nothing.

A pinch is only ever a zoom. The viewer's pinch handler and the annotation
layer's pointer handling never spoke to each other, so a second finger
landing mid-drag zoomed the page while the shape kept following finger one
— and committed wherever it ended up. The viewer now publishes a `pinching`
flag; the layer cancels the drag / stroke / rubber-band and puts the nodes
back, refuses to start new ones, and drops its Transformer handles until
every finger lifts. Hand-tool panning bows out too, rather than fighting
the zoom for the same scroll offsets. Also handles `pointercancel`, which
previously left stale pointer ids behind and made the next single touch
look like multi-touch.

Placements are capped at half the page. Sizes are chosen in display pixels
so they look consistent at any zoom, which breaks down when zoomed out: at
25% a signature landed 640pt wide on a 595pt page. Signature, image and
tap-default request boxes now scale down to fit half the page, aspect ratio
intact, and the ghost preview matches what gets dropped.

Placing a "Sign here" box offers a send-to-sign shortcut. The box and the
sign request are two halves of one job — and the dialog won't mint a link
without at least one box — so a selected box carries an envelope affordance
that opens it, instead of a trip back to Sign > Request > Send to sign.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iWy9RAfHbLnXzpLnGJhh9
@JamesmarkeyUK
JamesmarkeyUK merged commit a9cab7e into main Aug 7, 2026
2 checks passed
@JamesmarkeyUK
JamesmarkeyUK deleted the claude/draw-confirmation-emoji-qlegp4 branch August 7, 2026 10:31
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.

2 participants