Skip to content

fix(frontend/backend): stabilize text selection and add full-page redaction support#64

Merged
theodubus merged 2 commits into
feat/graphic_selection_dev2from
codex/add-page-censoring-feature
Feb 15, 2026
Merged

fix(frontend/backend): stabilize text selection and add full-page redaction support#64
theodubus merged 2 commits into
feat/graphic_selection_dev2from
codex/add-page-censoring-feature

Conversation

@theodubus

Copy link
Copy Markdown
Owner

Motivation

  • Prevent unstable and flickering text selection in the PDF viewer caused by frequent rerenders when page-size callbacks change reference.
  • Support user-driven "full page" redaction rules in the UI and ensure backend redaction logic does not over-tighten full-page rectangles.

Description

  • Memoize page-size updater in App with useCallback and pass a stable onPageSizeChange to PdfViewer to avoid rerender churn during drag selection.
  • Enhance PdfViewer to report the current page (onCurrentPageChange), observe visible page via IntersectionObserver, call onPageSizeChange once per page load, and include page-level preview highlighting for page rules.
  • Add UI and types for page rules: UiRule now supports kind: "page", RulesSection exposes a "Redact page" button, RulesList and EditRuleModal were adjusted to handle page rules, and localization keys were added.
  • Propagate full-page application options through the frontend API payload with options.apply_images and options.apply_graphics.
  • Backend safety: _tighten_rect_vertical now skips aggressive vertical tightening for very large rectangles (height > 24pt) to avoid compressing full-page redactions.
  • Add an integration test test_redact_rectangles_full_page_rect_redacts_target exercising full-page rectangle redaction behavior.

Testing

  • Successfully built the frontend with npm run build (TypeScript + Vite) and the build completed without errors.
  • Started the dev server with npm run dev and verified the app by capturing a browser screenshot via a Playwright script.
  • A new backend integration test was added for full-page redaction, but no backend test suite was executed in this run.

Codex Task

@theodubus theodubus merged commit ac1706e into feat/graphic_selection_dev2 Feb 15, 2026
1 of 2 checks passed
@theodubus theodubus deleted the codex/add-page-censoring-feature branch February 15, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant