feat(auto-redact): move auto-redact to embedPDF#5746
feat(auto-redact): move auto-redact to embedPDF#5746balazs-szucs wants to merge 11 commits intoStirling-Tools:mainfrom
Conversation
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…act tools Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…s in tests Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
🌐 TOML Translation Verification Summary🔄 Reference Branch:
|
|
/deploypr |
There was a problem hiding this comment.
Pull request overview
This PR shifts the “auto redaction” experience to an EmbedPDF viewer-based “Search & Redact” workflow, adding UI + context/bridge APIs to search across a PDF and bulk-create redaction annotations.
Changes:
- Added a new sidebar workflow (
SearchAndRedactControls) for searching text and redacting all matches in the viewer. - Extended
RedactionContext/RedactionAPIand implemented the new methods inRedactionAPIBridgeusing EmbedPDF search + annotation plugins. - Updated mode selector labeling/enablement (“Automatic” → “Search & Redact”) and adjusted translations/tests accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/core/tools/Redact.tsx | Reworks the Redact tool flow to route both modes into the viewer and show the new Search & Redact sidebar controls. |
| frontend/src/core/contexts/RedactionContext.tsx | Adds searchText / redactText APIs to the shared redaction context and proxies calls to the viewer bridge. |
| frontend/src/core/components/viewer/RedactionAPIBridge.tsx | Implements the new search/redact bridge methods via EmbedPDF search + annotation plugins and caches search results. |
| frontend/src/core/components/tools/redact/SearchAndRedactControls.tsx | New UI for query entry, options, results display, bulk redaction creation, and saving changes. |
| frontend/src/core/components/tools/redact/RedactSingleStepSettings.test.tsx | Updates tests to reflect the new “Search & Redact” mode label. |
| frontend/src/core/components/tools/redact/RedactModeSelector.tsx | Renames the “automatic” option label to “Search & Redact” and changes enablement to depend on workbench file presence. |
| frontend/public/locales/en-GB/translation.toml | Adds/updates translation keys for the new mode label and Search & Redact UI strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/src/core/components/tools/redact/SearchAndRedactControls.tsx
Outdated
Show resolved
Hide resolved
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://23.22.230.180:5746 This deployment will be automatically cleaned up when the PR is closed. |
|
Hi @balazs-szucs Thanks for this its working really well. I did have some issues with the search though. Upon clicking it a second time (without changing the search text) search results all go to 0. Also the search highlight annotations don't clear when I go off the tool having not applied the redaction. From a UX perspective I feel like I shouldn't have to hit search before hitting redact all matches. Final tiny niggle, is there a way of the first highlight not being orange? I assume this is because that is the first (active) highlight and it supports you navigating through them. I guess in future we could allow the user to quickly navigate them. |
|
Thanks for the review! Ah, yeah, I half expected that. For context; It's somewhat of hacky solution. I'll see what I can do particularly about those. |
… search execution and cleanup Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…ights and results Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Description of Changes
This pull request introduces a new "Search & Redact" workflow to the PDF redaction tool, allowing users to search for text across PDFs and redact all matches in bulk. The changes include UI updates, new context API methods, and integration with the underlying PDF annotation and search plugins.
The most important changes are:
Search & Redact Workflow Implementation:
SearchAndRedactControlscomponent that provides UI for searching text, configuring options (case sensitivity, whole word), previewing results, and redacting all matches at once. This includes color selection and error handling.RedactModeSelectorto rename the "Automatic" mode to "Search & Redact" and adjust tooltips and enablement logic to match the new workflow.Redaction Context and API Extensions:
RedactionContextandRedactionAPIto include new async methods:searchTextandredactText, with support for search options and result summaries. These methods are now available throughout the app.Integration with PDF Plugins:
Updated
RedactionAPIBridgeto implement the newsearchTextandredactTextmethods by integrating with the PDF search and annotation plugins. Search results are cached and used to create redaction annotations in bulk.UI and Codebase Cleanup:
Removed legacy controls and advanced settings related to the old "Automatic" redaction workflow from the main
Redacttool, and integrated the newSearchAndRedactControlscomponent.Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)