Skip to content

fix(web): keep pen strokes when the browser lists no coalesced moves - #205

Merged
Yoshiofthewire merged 1 commit into
masterfrom
fix/ink-empty-coalesced
Nov 25, 2026
Merged

Yoshiofthewire merged 1 commit into
masterfrom
fix/ink-empty-coalesced

Conversation

@Yoshiofthewire

Copy link
Copy Markdown
Member

In one line: The pen and highlighter draw full strokes in Ladybird again; before, every stroke drew as a dot.

What changed

  • Ink now uses the pointer move itself when the browser's coalesced list is empty, not only when the method is missing.
  • Ladybird (2026.47.7) returns an empty getCoalescedEvents() list for every move, so strokes kept only their first point.
  • Chromium, Firefox and Safari behave exactly as before: they always list at least the move itself.
  • The bundle in internal/web/dist is rebuilt with Node 26 to match.

Review this: web/src/ink.ts samplesOf: it decides which points every stroke records. The rest is safe to skip: the dist files are the rebuild (CanvasPage/index carry the change; emoji-data and exportNotebook differ only in chunk-name references).
Checked: npm test (695 passed, including 2 new samplesOf cases); npm run build with Node 26.13.1, then CI's diff -qr web/dist internal/web/dist; go build, go vet, go test ./internal/web/.... In Ladybird 2026.47.7 over WebDriver, against an e2e/server.sh server: a 120×48 px mouse drag and pen drag drew 2 dots before this change and 2 strokes of 124×52 px after.
Not checked: a physical stylus in Ladybird (WebDriver pen input only). The Playwright e2e suite runs in CI and uses Chromium, which cannot show this bug.
You need to: nothing.

Detail

inkMove read samples with event.nativeEvent.getCoalescedEvents?.() ?? [event.nativeEvent]. The ?? only covers a missing method; an empty array skipped the loop, so draft kept the pointerdown point alone and perfect-freehand drew a dot.

Probe in Ladybird, a plain page logging each pointermove on an SVG overlay:

svg pointermove client=120,110 coalesced=[0]
svg pointermove client=140,120 coalesced=[0]
...

clientX/clientY, pointer capture, pen pointerType and pressure all arrive correctly; only the coalesced list is empty. The Pointer Events spec expects a trusted pointermove to list at least itself, so this is a Ladybird bug; a report to Ladybird is drafted for review. The fallback is still right for us: KyDrive's Excalidraw whiteboard never calls getCoalescedEvents() and works in Ladybird already.

🤖 Generated with Claude Code

Ladybird returns an empty getCoalescedEvents() list for every pointer
move. The ink loop only fell back to the move itself when the method was
missing, so every stroke kept just its first point and drew as a dot.
samplesOf now falls back on an empty list too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Yoshiofthewire

Copy link
Copy Markdown
Member Author

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪

🧪 PR contains tests

⚡ No major issues detected


⚠️ Review coverage: The following files were not included in this review because of the token budget:

  • internal/web/dist/assets/index-BqKtmCPh.js
  • internal/web/dist/assets/CanvasPage-f0oQsOxU.js

Advisory only: this comment never gates the pull request.
gpt-6.1-sol using pr-agent on behalf of Yoshi

@Yoshiofthewire

Copy link
Copy Markdown
Member Author

Security review - cleared

Detail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kynotes-server-205, where it is readable by the operator and expires seven days after the last post.

Review input was truncated; omitted changes were not reviewed.


gpt-6.1-sol using security-audit on behalf of Yoshi

@Yoshiofthewire

Copy link
Copy Markdown
Member Author

Autonomous review - 1/1 personas cleared

  • security: cleared

Merging remains a human decision; this bot never approves.


gpt-6.1-sol using security-audit on behalf of Yoshi

@Yoshiofthewire
Yoshiofthewire merged commit f03d74d into master Nov 25, 2026
14 checks passed
@Yoshiofthewire
Yoshiofthewire deleted the fix/ink-empty-coalesced branch November 25, 2026 22:58
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