Skip to content

feat: rectangle-draw redaction + strict sanitation flags#66

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

feat: rectangle-draw redaction + strict sanitation flags#66
theodubus merged 2 commits into
feat/graphic_selection_dev2from
codex/add-page-censoring-feature

Conversation

@theodubus

Copy link
Copy Markdown
Owner

Motivation

  • Allow manual rectangle redactions to behave like full-page redactions by applying image/graphics removal and stronger sanitation.
  • Add UI affordances to draw rectangles and add page-level redaction rules.
  • Avoid over-tightening vertically when a rect is very tall (e.g. full-page) and add a test to cover full-page rectangle redaction.

Description

  • Frontend: add rectangle drawing UI and page controls by extending PdfViewer, RulesSection, RulesList, EditRuleModal, and related types in frontend/src/* to support page and rectangle rule kinds and drawing interaction.
  • Frontend API: extend redactApply signature in frontend/src/api.ts to include sanitizeMetadata, removeAnnotations, and removeAttachments, and include these fields in the posted payload.options.
  • Submit behavior: App.tsx now sets applyImages/applyGraphics when a rectangle rule exists and always sends sanitizeMetadata: true, removeAnnotations: true, and removeAttachments: true in the /redact/apply payload.
  • Styles/locales: add CSS for drawing state and labels and add locale strings for page/rectangle UI.
  • Backend: adjust _tighten_rect_vertical in backend/app/redaction.py to skip aggressive vertical tightening for large rectangles (h > 24.0) to avoid breaking full-page (or very tall) redactions.
  • Tests: add an integration test test_redact_rectangles_full_page_rect_redacts_target in backend/tests/test_redact_rectangles.py to verify a full-page rectangle redacts the target and returns an audit pass.

Testing

  • Ran the frontend production build via npm run build in frontend/ and it completed successfully.
  • No backend test suite was executed in this rollout (new pytest integration test was added but not run here).

Codex Task

@theodubus theodubus merged commit be0bb32 into feat/graphic_selection_dev2 Feb 23, 2026
1 check failed
@theodubus theodubus deleted the codex/add-page-censoring-feature branch February 23, 2026 21:10
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