Palm tests, erase fix, swipe-to-add, size dialog, grid settings, docs #12

Merged
reudy merged 6 commits from canvas-polish into main 2026-09-27 23:34:25 +02:00
Member

Covers points 4–9 from the recommendations list. One commit per item.

Palm tests for the plus button. The draw-or-navigate choice moved into touchIntent() in palm.ts, so tests can check the canvas's actual rule. New tests confirm a finger tap on the plus is accepted after writing and while the pen hovers. It is still rejected while the pen is down, for a palm-sized contact, and within 150 ms of the pen.

Cancelled erase is dropped. If the system cancels the pointer mid-drag (pointercancel), the eraser no longer applies the strokes it touched. Ink strokes already worked this way.

Swipe to add. A quick one-finger fling toward a free side of the active page highlights and pulses the plus on that side for 3 s. It only triggers once that edge is on screen. It never adds a page by itself; tapping the highlighted plus does. Fling detection lives in ink/fling.ts, with tests.

Page size dialog. prompt() is replaced by a dialog with mm fields, preset chips and a swap button. It validates the 50–5000 pt range. Presets and an unchanged size are kept exact rather than rounded to whole mm.

Grid settings. Settings → Appearance has a grid on/off toggle and subdivisions: none, 2×2, 4×4, 8×8 or 16×16. Subdivisions are fainter lines inside each page cell and are hidden when they'd be under 8 px apart.

Docs. spec.md §9 now describes the ink engine and palm rejection as built. The plus buttons, fling, grid and size dialog are documented, sync is marked GitHub-only, and the open items list is now current. The README's page instructions are updated too.

Checks. npm run check reports 0 errors and 0 warnings. npm test passes 35 tests. npm run build succeeds.

Browser smoke test. I ran the built app in headless Chromium with touch emulation:

  • The subdivided grid renders.
  • A synthetic finger fling highlights the right-hand plus.
  • A touch tap on it adds a page.
  • The size dialog opens; choosing A5 and swapping gives 210 × 148, and Apply closes it.

This is not yet tested on a real tablet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia

Covers points 4–9 from the recommendations list. One commit per item. **Palm tests for the plus button.** The draw-or-navigate choice moved into `touchIntent()` in `palm.ts`, so tests can check the canvas's actual rule. New tests confirm a finger tap on the plus is accepted after writing and while the pen hovers. It is still rejected while the pen is down, for a palm-sized contact, and within 150 ms of the pen. **Cancelled erase is dropped.** If the system cancels the pointer mid-drag (`pointercancel`), the eraser no longer applies the strokes it touched. Ink strokes already worked this way. **Swipe to add.** A quick one-finger fling toward a free side of the active page highlights and pulses the plus on that side for 3 s. It only triggers once that edge is on screen. It never adds a page by itself; tapping the highlighted plus does. Fling detection lives in `ink/fling.ts`, with tests. **Page size dialog.** `prompt()` is replaced by a dialog with mm fields, preset chips and a swap button. It validates the 50–5000 pt range. Presets and an unchanged size are kept exact rather than rounded to whole mm. **Grid settings.** Settings → Appearance has a grid on/off toggle and subdivisions: none, 2×2, 4×4, 8×8 or 16×16. Subdivisions are fainter lines inside each page cell and are hidden when they'd be under 8 px apart. **Docs.** `spec.md` §9 now describes the ink engine and palm rejection as built. The plus buttons, fling, grid and size dialog are documented, sync is marked GitHub-only, and the open items list is now current. The README's page instructions are updated too. **Checks.** `npm run check` reports 0 errors and 0 warnings. `npm test` passes 35 tests. `npm run build` succeeds. **Browser smoke test.** I ran the built app in headless Chromium with touch emulation: - The subdivided grid renders. - A synthetic finger fling highlights the right-hand plus. - A touch tap on it adds a page. - The size dialog opens; choosing A5 and swapping gives 210 × 148, and Apply closes it. This is not yet tested on a real tablet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
agent added 6 commits 2026-09-27 23:33:27 +02:00
Move the draw-or-navigate choice into touchIntent() so the rule the
canvas uses can be tested, and cover finger taps on the plus button:
accepted after writing and while the pen hovers, rejected while the
pen is down, for palm-sized contacts and right after pen activity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
A pointercancel (system gesture, notification, palm) used to apply the
strokes erased so far. Only a real pointerup commits the erase now, the
same as ink strokes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
A quick one-finger flick toward a free side of the active page, once
that edge is on screen, highlights and pulses the plus button on that
side for three seconds. It never adds a page by itself, so ordinary
panning can't create pages; a tap on the highlighted plus does.

Fling detection lives in ink/fling.ts with tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
window.prompt() looks out of place and behaves badly in an installed
PWA, especially on iPad. The new dialog has width/height fields in mm,
preset chips and a swap button, validates the 50–5000 pt range, and
keeps preset and unchanged sizes exact instead of rounding them to
whole millimetres.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
Appearance now has a toggle for the background grid and a choice of
subdivisions (none, 2×2 up to 16×16) that split each page-sized cell
into fainter lines. Subdivisions are left out when zoomed so far out
that they would be under 8 px apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
The spec still listed undo, the eraser, colours and smoothing as
missing. Describe the ink engine and palm rejection as built (draw vs
navigate intents, settings toggles, cancelled pointers), the plus
buttons, fling offer, grid and page size dialog, note that sync is
GitHub-only, and replace the stale open item with the real ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaoZtJQZwLXkEgWs8twCia
reudy merged commit 361e3e5e89 into main 2026-09-27 23:34:25 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/Papure#12
No description provided.