Skip to content

fix(full-page): preserve large page rects and force image/graphics redaction#62

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

fix(full-page): preserve large page rects and force image/graphics redaction#62
theodubus merged 1 commit into
feat/graphic_selection_dev2from
codex/add-page-censoring-feature

Conversation

@theodubus

Copy link
Copy Markdown
Owner

Motivation

  • Some PDFs showed visible headers/logos after a full-page redaction because large page rectangles were being vertically tightened or non-text elements (images/vector graphics) were not removed. This produced rare but important visual leaks.
  • Add a regression test to ensure a full-page rectangle actually removes the target content in the exported PDF.

Description

  • Backend: avoid aggressive vertical tightening for large rectangles by skipping _tighten_rect_vertical when rectangle height exceeds 24.0 pt to preserve full-page rect coverage (backend/app/redaction.py).
  • Backend tests: add an integration test test_redact_rectangles_full_page_rect_redacts_target that posts a full-page rectangle to /redact/rectangles and asserts the secret is removed (backend/tests/test_redact_rectangles.py).
  • Frontend: include page rules' rects in the API payload and detect when at least one full-page rule exists (frontend/src/App.tsx and frontend/src/types/uiRules.ts).
  • Frontend API: send explicit options.apply_images and options.apply_graphics to /redact/apply when full-page rules are present so images and vector graphics are also redacted (frontend/src/api.ts).
  • Frontend UI: track current visible page via an IntersectionObserver in PdfViewer, expose onCurrentPageChange, render the page censor preview, and wire a "censor page" action to create page rules (frontend/src/components/PdfViewer.tsx, frontend/src/components/Rules/RulesSection.tsx, frontend/src/components/Rules/RulesList.tsx, frontend/src/components/Rules/EditRuleModal.tsx).
  • Localization: add rules.badge.page and rules.page.title translations for EN/FR (frontend/src/locales/en.json, frontend/src/locales/fr.json).

Testing

  • Frontend production build: ran npm run build in frontend/ and it completed successfully. ✅
  • Frontend dev + UI check: started the dev server and captured a browser screenshot with Playwright to validate the UI wiring and the page-redaction controls. ✅
  • Backend integration test: added test_redact_rectangles_full_page_rect_redacts_target to prevent regressions, but the new backend integration test was not executed in this environment due to missing test dependencies (the test harness dependency httpx / test client environment was not available). ⛔

Codex Task

@theodubus theodubus merged commit df57e68 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 18:58
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