Skip to content

fix(edit-pdf): cover style changes with undo history - #215

Open
3ni8ma wants to merge 1 commit into
mithun-srinivas:mainfrom
3ni8ma:fix/edit-pdf-undo-styles
Open

fix(edit-pdf): cover style changes with undo history#215
3ni8ma wants to merge 1 commit into
mithun-srinivas:mainfrom
3ni8ma:fix/edit-pdf-undo-styles

Conversation

@3ni8ma

@3ni8ma 3ni8ma commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #21.

Root cause: patchSelected delegated to updateAnno, which writes via raw setAnnos and bypasses the history-recording commit. All five style controls (color, width, font family, font size, bold/italic) therefore skipped the undo stack.

Change: patchSelected now applies its patch through commit. updateAnno is intentionally left raw since it also serves AnnotationBox drag/resize onChange, where per-move commits would flood the undo stack.

Tests: eslint clean (0 errors, warnings unchanged pre/post), unit suite 40/40 pass, updater semantics simulated (style change then undo restores prior style).

Route patchSelected through commit so color/width/font/bold/italic
edits land in the undo stack. updateAnno stays raw since it also
serves drag/resize onChange.

Fixes mithun-srinivas#21
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@3ni8ma is attempting to deploy a commit to the Mithun Srinivas' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Edit PDF: Undo should cover style changes

1 participant