Document & image redaction#349
Open
level09 wants to merge 24 commits into
Open
Conversation
…le grid group, drawer shortcut
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…and add basic zoom support
- MediaRedactor: rename toolbar title to "Redaction Tool", add instruction hint bar (draw/move/delete/pan tips), improve copy name input label, replace "Create redacted copy" with "Save redacted copy" + disabled tooltip - MediaGrid: visually separate redacted copies behind a labeled divider instead of mixing them inline with primary media - MediaCard: expand redact button tooltip with description of what the tool does - Shrink resize handles from 10px to 7px
…corg/bayanat into document-redaction-prototype
## Description Adds delete button for redacted copies (confirm dialog, optimistic removal, rollback on error). Fixes media list not refreshing after saving a new redaction in both the drawer and edit dialog. Redact/delete icons are gated to Admin/DA only.
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.
Summary
In-app visual redaction for document and image media. An analyst draws boxes over a PDF or scan, Bayanat burns them in permanently and saves a clean redacted copy as a new Media row. The original is never modified.
How it works
enferno/utils/redaction_utils.py): PDFs via PyMuPDFadd_redact_annot+apply_redactions+scrub(destructive: content removed, not overlaid); images via Pillow flatten to JPEG (EXIF dropped).POST /api/media/<id>/redact(Admin/DA): reads source bytes, burns, writes a new file, creates the Media row plus amedia_redactionaudit row (source, regions, user), logs an Activity. Existing redactions can also be deleted (Support deleting redactions #354).e4f2a9c8d7b1(additivemedia_redactiontable) and68396035f041(original_media_idlink). Both additive with clean downgrades, no data risk.Status
Ready for review and merge. UX has been finalized with the team and the flow has been validated on staging (sta.bayanat.org).
Review focus
@roles_accepted("Admin","DA")+can_access).