On-canvas confirm affordance, re-editable signature realism, pinch/drag exclusion - #157
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsso 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
pinchingflag; 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:
npm run typecheckandnpm run buildboth clean.Generated by Claude Code