[PR #14] [MERGED] Add granular detection control with Settings dropdown #17

Closed
opened 2026-03-02 11:45:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karant-dev/AutoRedact/pull/14
Author: @Copilot
Created: 12/12/2025
Status: Merged
Merged: 12/12/2025
Merged by: @karant-dev

Base: mainHead: copilot/add-settings-sidebar-for-detection


📝 Commits (4)

  • 03d400e Initial plan
  • b27c5a8 Initial plan for granular detection control feature
  • f78553d Add granular detection control with Settings dropdown
  • 7af8d40 Refactor processImageForBatch to use options object

📊 Changes

9 files changed (+250 additions, -63 deletions)

View changed files

📝 package-lock.json (+0 -12)
📝 src/App.tsx (+9 -5)
📝 src/components/Header.tsx (+10 -1)
src/components/SettingsDropdown.tsx (+76 -0)
📝 src/hooks/useBatch.ts (+3 -3)
src/hooks/useDetectionSettings.ts (+49 -0)
📝 src/hooks/useOCR.ts (+40 -21)
📝 src/types/index.ts (+8 -0)
📝 src/utils/ocr.ts (+55 -21)

📄 Description

Users currently cannot selectively enable/disable detection types—AutoRedact redacts everything. This adds a Settings dropdown with toggles for each detection type, persisted to localStorage.

Changes

  • DetectionSettings type — Boolean flags for email, ip, creditCard, secret, pii
  • useDetectionSettings hook — Manages settings state with localStorage persistence
  • SettingsDropdown component — Header dropdown with checkboxes for each type
  • useOCR / useBatch hooks — Accept settings, filter pattern matching accordingly
  • processImageForBatch — Refactored to options object pattern: { onProgress, detectionSettings }

Usage

Settings are applied at detection time. Unchecking "IPv4 / IPv6" skips IP detection:

const { settings, updateSetting } = useDetectionSettings();
updateSetting('ip', false); // IPs will not be redacted

Screenshots

Settings dropdown with toggles:

Settings Dropdown

IPv4/IPv6 disabled:

Toggle Disabled

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feat]: Granular Detection Control (Settings)</issue_title>
<issue_description>### Is your feature request related to a problem?
I want to redact specific types of data (e.g. Passwords) but keep others visible (e.g. IPs) in the same screenshot. Currently, AutoRedact nukes everything.

Describe the solution you'd like

Add a Settings Sidebar/Modal/Dropdown with toggles for each detection type:

  • Emails
  • IPv4 / IPv6
  • Credit Cards
  • API Keys

Describe alternatives you've considered

Manually un-redacting items one by one (tedious).

Additional context

See design discussion: Selection should persist selection to localStorage.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karant-dev/AutoRedact/pull/14 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/12/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@karant-dev](https://github.com/karant-dev) **Base:** `main` ← **Head:** `copilot/add-settings-sidebar-for-detection` --- ### 📝 Commits (4) - [`03d400e`](https://github.com/karant-dev/AutoRedact/commit/03d400e99a2c9a740cdea1644f1743528870465d) Initial plan - [`b27c5a8`](https://github.com/karant-dev/AutoRedact/commit/b27c5a849bd50d1348c9c61d86bba8f3f1072d4f) Initial plan for granular detection control feature - [`f78553d`](https://github.com/karant-dev/AutoRedact/commit/f78553dce0847e898342117c613c074d453affab) Add granular detection control with Settings dropdown - [`7af8d40`](https://github.com/karant-dev/AutoRedact/commit/7af8d40fb5c6de58d8e8161d3f2f89404677e461) Refactor processImageForBatch to use options object ### 📊 Changes **9 files changed** (+250 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+0 -12) 📝 `src/App.tsx` (+9 -5) 📝 `src/components/Header.tsx` (+10 -1) ➕ `src/components/SettingsDropdown.tsx` (+76 -0) 📝 `src/hooks/useBatch.ts` (+3 -3) ➕ `src/hooks/useDetectionSettings.ts` (+49 -0) 📝 `src/hooks/useOCR.ts` (+40 -21) 📝 `src/types/index.ts` (+8 -0) 📝 `src/utils/ocr.ts` (+55 -21) </details> ### 📄 Description Users currently cannot selectively enable/disable detection types—AutoRedact redacts everything. This adds a Settings dropdown with toggles for each detection type, persisted to localStorage. ### Changes - **`DetectionSettings` type** — Boolean flags for `email`, `ip`, `creditCard`, `secret`, `pii` - **`useDetectionSettings` hook** — Manages settings state with localStorage persistence - **`SettingsDropdown` component** — Header dropdown with checkboxes for each type - **`useOCR` / `useBatch` hooks** — Accept settings, filter pattern matching accordingly - **`processImageForBatch`** — Refactored to options object pattern: `{ onProgress, detectionSettings }` ### Usage Settings are applied at detection time. Unchecking "IPv4 / IPv6" skips IP detection: ```typescript const { settings, updateSetting } = useDetectionSettings(); updateSetting('ip', false); // IPs will not be redacted ``` ### Screenshots **Settings dropdown with toggles:** ![Settings Dropdown](https://github.com/user-attachments/assets/6c05587c-6916-40d6-a989-a0d6fa1a3c63) **IPv4/IPv6 disabled:** ![Toggle Disabled](https://github.com/user-attachments/assets/31c9d0c9-a6a6-43c9-88a6-16ba2f39d4bd) <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Feat]: Granular Detection Control (Settings)</issue_title> > <issue_description>### Is your feature request related to a problem? > I want to redact specific types of data (e.g. Passwords) but keep others visible (e.g. IPs) in the same screenshot. Currently, AutoRedact nukes everything. > > ### Describe the solution you'd like > Add a Settings Sidebar/Modal/Dropdown with toggles for each detection type: > - [ ] Emails > - [ ] IPv4 / IPv6 > - [ ] Credit Cards > - [ ] API Keys > > ### Describe alternatives you've considered > Manually un-redacting items one by one (tedious). > > ### Additional context > See design discussion: Selection should persist selection to localStorage.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes karant-dev/AutoRedact#10 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 11:45:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AutoRedact#17
No description provided.