Skip to content

feat(malware): add quarantine management UI#62

Merged
dbfx merged 5 commits intomainfrom
feat/quarantine-management
Mar 24, 2026
Merged

feat(malware): add quarantine management UI#62
dbfx merged 5 commits intomainfrom
feat/quarantine-management

Conversation

@dbfx
Copy link
Contributor

@dbfx dbfx commented Mar 24, 2026

Summary

  • Adds a Quarantine tab to the Malware Scanner page so users can view, restore, or permanently delete quarantined files
  • Introduces a quarantine manifest (quarantine-manifest.json) to track original file paths, enabling reliable restore
  • New MALWARE_QUARANTINE_LIST IPC channel with listQuarantinedFiles() backend, preload bridge, and store state
  • Manifest is maintained on quarantine, restore, and delete operations for consistency
  • Gracefully handles pre-existing quarantined files (before manifest) by showing "Unknown" for original location

Test plan

  • All 779 existing tests pass
  • Quarantine a threat from the scanner, switch to Quarantine tab, verify it appears with correct filename/path/date/size
  • Select quarantined items and restore — verify files return to original location
  • Select quarantined items and delete permanently — verify files are removed
  • Verify empty state shows when no quarantined items exist
  • Verify badge count on Quarantine tab updates correctly

🤖 Generated with Claude Code

Quarantined files were stored on disk but there was no way to view,
restore, or permanently delete them from the app. This adds a
Quarantine tab to the Malware Scanner page with full management.

- Add quarantine manifest (JSON sidecar) to track original file paths
- Add MALWARE_QUARANTINE_LIST IPC channel and listQuarantinedFiles()
- Update quarantine/delete/restore to maintain manifest consistency
- Add Quarantine tab with item list, select-all, restore, and delete
- Extend malware store with quarantine state management

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix filename parsing to skip full 36-char UUID instead of stopping
  at second underscore (broke filenames containing underscores)
- Fix operator precedence: add parens around `??` / `||` mix (build error)
- Add per-item error detail to restore toast (shows which files failed)
- Fix loading spinner text falling back to scan-related string
- Load quarantine items on mount so badge count is accurate immediately
- Log warning on corrupt manifest JSON instead of silently swallowing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9602148bfe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

dbfx and others added 2 commits March 24, 2026 08:32
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbfx
Copy link
Contributor Author

dbfx commented Mar 24, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ff9fa22b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Both handleQuarantineRestore and handleQuarantineDelete could leave
quarantineStatus stuck in a busy state if the IPC call rejected.
Wrap in try/finally so status always resets to idle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbfx dbfx merged commit 1ecf642 into main Mar 24, 2026
9 checks passed
@dbfx dbfx deleted the feat/quarantine-management branch March 24, 2026 06:42
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4fad6d8823

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}

await writeManifest(manifest)

Choose a reason for hiding this comment

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

P2 Badge Keep quarantine result accurate when manifest write fails

This await writeManifest(manifest) runs after files may already have been moved by rename, and it is not handled as a partial failure. If persisting the manifest fails (for example due to disk-full or permission issues), the IPC call rejects and the renderer treats the whole action as failed even though some files were successfully quarantined, leaving UI state and on-disk state inconsistent.

Useful? React with 👍 / 👎.

Comment on lines +251 to +253
useEffect(() => {
if (viewMode === 'quarantine') loadQuarantineItems()
}, [viewMode, loadQuarantineItems])

Choose a reason for hiding this comment

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

P2 Badge Refresh quarantine badge after scanner-side quarantine

Quarantine items are only reloaded on mount and when viewMode changes to quarantine, so a successful quarantine action from the scanner tab does not refresh quarantineItems immediately. This leaves the tab badge count stale until the user switches tabs or reloads, which makes the new quarantine count inaccurate in normal scanner workflow.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant