Skip to content

refactor(editor): extract pure text-reinsertion helpers to text_reinsert module - #155

Merged
nelsonduarte merged 1 commit into
mainfrom
refactor/editor-text-reinsert
Aug 8, 2026
Merged

refactor(editor): extract pure text-reinsertion helpers to text_reinsert module#155
nelsonduarte merged 1 commit into
mainfrom
refactor/editor-text-reinsert

Conversation

@nelsonduarte

Copy link
Copy Markdown
Owner

Summary

Pure refactor (step R2 of the editor modularity plan). No behavior change.

Moves the typography / text-reinsertion helpers (constants + 13 functions) out of app/editor/tab.py and into a new pure module app/editor/text_reinsert.py.

  • app/editor/tab.py: 1806 -> 1472 lines
  • app/editor/text_reinsert.py: new pure module (no UI imports, no import cycle)
  • tests/test_editor_text_fidelity.py: import updated to point at the new module

Scope

  • 321 lines moved byte-identically (verified during adversarial review)
  • ZERO behavior change; the module is pure (no PySide6 / UI dependencies)

Testing

  • Suite: 559 passed / 2 skipped / 0 failed
  • Approved by adversarial review

Follow-up

Prepares the ground for R1 (extracting the _run dispatcher).

…ert module

Move the pure typographic-fidelity helpers (no Qt/UI/self state) out of
app/editor/tab.py into a dedicated app/editor/text_reinsert.py. Pure code
move, behaviour identical: fitz/doc/page are passed in as arguments so the
helpers stay unit-testable headless. tab.py now imports _reinsert_edited_text
from the new module; the now-unused `import html` is dropped from tab.py.
Test imports updated to app.editor.text_reinsert (logic untouched).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nelsonduarte
nelsonduarte merged commit 5df0c7c into main Aug 8, 2026
4 checks passed
@nelsonduarte
nelsonduarte deleted the refactor/editor-text-reinsert branch August 8, 2026 08:43
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