Repository navigation
Fix blank PDF editor and simplify editing controls - #19
Merged
KibouAkari merged 16 commits intoOct 26, 2026
Merged
Conversation
…ent Fabric editing objects
…nd reliable page status
…he initial PDF rendering
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…itable objects cannot load
…al PDF text spans
…g original PDF contents
There was a problem hiding this comment.
🟡 Changes recommended
Native-image restoration still creates opaque overlays, and viewport clipping and zoom behavior need correction.
3 open issues
What changed in this PR
This PR addresses blank PDF editor pages by separating the rendered PDF from Fabric’s editing layer, while simplifying controls and strengthening browser regression checks.
Changes:
- Add a dedicated PDF image layer, transparent selection targets, and clearer loading status.
- Compact the editing toolbar and increase typesetting space for native text replacements.
- Add pixel-based Chromium checks and update editor documentation.
| File | Description |
|---|---|
tests/e2e/editor-viewport.mjs |
Check page-image pixels and update toolbar interactions. |
tests/e2e/editor-smoke.mjs |
Add rendering checks, screenshots, and export diagnostics. |
services/converter/tests/test_native_editor.py |
Cover replacement text in tight selection boxes. |
services/converter/editor_native.py |
Allow additional height for replacement text. |
README.md |
Describe the revised editor layers and controls. |
docs/TESTING.md |
Document visual regressions and manual validation. |
docs/EDITOR.md |
Explain rendering layers, controls, and backend responsibilities. |
apps/web/src/pages/tools/Editor.tsx |
Separate page rendering from editing and simplify controls. |
.github/workflows/editor-e2e.yml |
Validate screenshot pixels and retain screenshot diagnostics. |
Review effort: Balanced
Comment on lines
+402
to
+405
| object.spdfSrc = src; | ||
| // Never duplicate entire raster images as opaque editable overlays. | ||
| // The underlying PDF layer owns its visuals until an object changes. | ||
| canvas.add(object); |
| <Button size="sm" variant="secondary" onClick={() => void stepHistory(1)} title="Redo (Ctrl+Y)" aria-label="Redo"><Redo2 className="h-4 w-4" /></Button> | ||
| <Button size="sm" variant="secondary" onClick={deleteSelected} disabled={!selected} title="Delete selected (Del)" aria-label="Delete selected"><Trash2 className="h-4 w-4" /></Button> | ||
| <span className="mx-2 h-5 w-px bg-ink-600" aria-hidden="true" /> | ||
| <Button size="sm" variant="secondary" onClick={() => setZoom((v) => Math.max(0.2, +(v - 0.15).toFixed(2)))} title="Zoom out" aria-label="Zoom out"><ZoomOut className="h-4 w-4" /></Button> |
| <div className="relative shrink-0 overflow-hidden" style={{ width: pagePixels.width * zoom, height: pagePixels.height * zoom }}> | ||
| <div style={{ width: pagePixels.width, height: pagePixels.height, transform: `scale(${zoom})`, transformOrigin: "top left", pointerEvents: panMode ? "none" : "auto" }}> | ||
| <canvas ref={attachCanvas} className="rounded-sm shadow-lg" /> | ||
| <div className="relative shrink-0 rounded-sm bg-white shadow-lg" style={{ width: pagePixels.width * zoom, height: pagePixels.height * zoom }}> |
This branch was successfully deployed
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.

Scope
One focused PR, no direct production changes until validation.
Release criteria
GitHub CI + Chromium E2E green. Do not merge until the sample PDFs display readable content and exported edits remain valid. Complex PDFs and OCR have explicit limitations.