Skip to content

Comments

feat(auto-redact): move auto-redact to embedPDF#5746

Open
balazs-szucs wants to merge 11 commits intoStirling-Tools:mainfrom
balazs-szucs:embed-auto-redact
Open

feat(auto-redact): move auto-redact to embedPDF#5746
balazs-szucs wants to merge 11 commits intoStirling-Tools:mainfrom
balazs-szucs:embed-auto-redact

Conversation

@balazs-szucs
Copy link
Collaborator

@balazs-szucs balazs-szucs commented Feb 17, 2026

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:

  • Added a new SearchAndRedactControls component 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.
  • Updated RedactModeSelector to rename the "Automatic" mode to "Search & Redact" and adjust tooltips and enablement logic to match the new workflow.

Redaction Context and API Extensions:

  • Extended RedactionContext and RedactionAPI to include new async methods: searchText and redactText, with support for search options and result summaries. These methods are now available throughout the app.

Integration with PDF Plugins:

  • Updated RedactionAPIBridge to implement the new searchText and redactText methods 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 Redact tool, and integrated the new SearchAndRedactControls component.

image

Checklist

General

Documentation

Translations (if applicable)

UI Changes (if applicable)

  • Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • I have tested my changes locally. Refer to the Testing Guide for more details.

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>
@stirlingbot
Copy link
Contributor

stirlingbot bot commented Feb 17, 2026

🌐 TOML Translation Verification Summary

🔄 Reference Branch: pr-branch

📃 File Check: en-GB/translation.toml

  1. Test Status:Passed
  2. Test Status:Passed
  3. Test Status:Passed

✅ Overall Check Status: Success

Thanks @balazs-szucs for your help in keeping the translations up to date.

@stirlingbot stirlingbot bot added enhancement New feature or request Front End Issues or pull requests related to front-end development Translation labels Feb 17, 2026
@balazs-szucs balazs-szucs marked this pull request as ready for review February 17, 2026 18:28
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines ignoring generated files. label Feb 17, 2026
Copilot AI review requested due to automatic review settings February 19, 2026 16:08
@balazs-szucs
Copy link
Collaborator Author

/deploypr

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / RedactionAPI and implemented the new methods in RedactionAPIBridge using 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.

@stirlingbot stirlingbot bot added the pr-deployed Pull request has been deployed to a test environment label Feb 19, 2026
@stirlingbot
Copy link
Contributor

stirlingbot bot commented Feb 19, 2026

🚀 PR Test Deployment

Your PR has been deployed for testing!

🔗 Test URL: http://23.22.230.180:5746
Security Disabled

This deployment will be automatically cleaned up when the PR is closed.

@ConnorYoh
Copy link
Contributor

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.

@balazs-szucs
Copy link
Collaborator Author

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.

balazs-szucs and others added 4 commits February 21, 2026 13:01
@balazs-szucs balazs-szucs requested a review from Ludy87 as a code owner February 22, 2026 14:11
@stirlingbot stirlingbot bot added the Java Pull requests that update Java code label Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Front End Issues or pull requests related to front-end development Java Pull requests that update Java code pr-deployed Pull request has been deployed to a test environment size:XL This PR changes 500-999 lines ignoring generated files. Translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants