Skip to content

feat(pool): optional page preview capture on reassignment (0.3.7) - #58

Merged
markm39 merged 1 commit into
mainfrom
feat/pool-preview-capture-opt-out
Oct 2, 2026
Merged

markm39 merged 1 commit into
mainfrom
feat/pool-preview-capture-opt-out

Conversation

@markm39

@markm39 markm39 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Why

ContinuousEnginePool renders a PNG preview (getBase64PngData(0.5)) for every page it captures before reassigning a slot (added after 0.1.0). Hosts that never use previewUri pay a native render + PNG encode + bridge transfer on every page shift. MathNotes, upgrading 0.1.0 → 0.3.x for the selection crash fixes, is one: its capture handler ignores the preview.

Change

  • New capturePreviewOnReassign?: boolean on ContinuousEnginePool (default true, so InfiniteInkCanvas/OpenNotes are unchanged), threaded to PooledCanvasSlot through a ref like shouldCaptureBeforeReassign, and included in both memo comparators.
  • When false, page data is still captured and onSlotCaptureBeforeUnmount receives previewUri === undefined; no native preview render happens.

Evidence

New test: capture with previews off calls the handler with undefined preview and never calls getBase64PngData; the existing test still covers the default (preview included). jest 83/83, typecheck, test:release, package build pass.

Release

0.3.7 with CHANGELOG entry.

ContinuousEnginePool renders a PNG preview (getBase64PngData) for every
page it captures before reassigning a slot. Hosts that never use the
preview (MathNotes) paid a native render + PNG encode + bridge transfer
on every page shift for nothing. Add capturePreviewOnReassign (default
true, so existing hosts are unchanged). Release 0.3.7.
@markm39
markm39 merged commit 23dac12 into main Oct 2, 2026
1 check passed
@markm39
markm39 deleted the feat/pool-preview-capture-opt-out branch October 2, 2026 22:05
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