feat: add re-encrypt context menu for directories#1009
Conversation
|
CodeAnt AI is reviewing your PR. |
This comment has been minimized.
This comment has been minimized.
📝 WalkthroughWalkthroughAdded a "Re-encrypt" directory context-menu action in MainWindow that validates the selected folder, prompts the user for confirmation, disables UI interaction, and calls ImitatePass::reencryptPath() with the folder's absolute path to re-encrypt contained password files. Changes
Sequence DiagramsequenceDiagram
participant User as User
participant MW as MainWindow
participant Dlg as ConfirmationDialog
participant IP as ImitatePass
participant FS as FileSystem
User->>MW: Right-click folder + select "Re-encrypt"
MW->>FS: verify directory exists
alt not exists
MW->>User: show critical error
else exists
MW->>Dlg: show confirmation (warn about .gpg-id recipients)
User->>Dlg: confirm
MW->>MW: disable UI / tree
MW->>IP: reencryptPath(cleanedAbsoluteDir)
IP->>FS: re-encrypt files using .gpg-id recipients
IP-->>MW: completion
MW->>MW: re-enable UI / tree
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/mainwindow.cpp`:
- Around line 1347-1351: The code currently disables the entire MainWindow with
this->setEnabled(false) before calling
QtPassSettings::getImitatePass()->reencryptPath(...), but the re-enable path
uses setUiElementsEnabled(true), leaving the window permanently unresponsive;
change the disable call to setUiElementsEnabled(false) so the disable/enable
operations are symmetric with setUiElementsEnabled and match the re-enabling
done in endReencryptPath()/related completion handlers.
- Around line 1058-1059: The code captures a folder path into QString dirPath
via Util::getDir but does not normalize it before use; fix by calling
QDir::cleanPath(dirPath) immediately after assignment (mirroring the existing
pattern around QDir::cleanPath used elsewhere) and use that cleaned QString when
invoking the backend re-encryption call that consumes the folder path; update
references to dirPath in both the local scope and the function/method that sends
the path to the backend so the cleaned path is always passed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: ba61c2d0-b6f9-4f0f-820d-99d5d0ad14f9
📒 Files selected for processing (1)
src/mainwindow.cpp
|
CodeAnt AI finished reviewing your PR. |
c44e3d4 to
bf68e80
Compare
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1009 +/- ##
==========================================
- Coverage 27.27% 27.11% -0.17%
==========================================
Files 39 39
Lines 3314 3334 +20
==========================================
Hits 904 904
- Misses 2410 2430 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Implements feature request #269: - Add 'Re-encrypt' option to right-click context menu on folders - Show confirmation dialog with warning before re-encrypting - Use existing ImitatePass::reencryptPath() CLI implementation - Disable UI during operation to prevent double execution - Show status messages for progress feedback Fixes: - Use setUiElementsEnabled() instead of setEnabled() for symmetry - Normalize path with QDir::cleanPath() for cross-platform consistency Tests: - Add reencryptPathNormalization test - Add reencryptPathAbsolutePath test
bf68e80 to
5001365
Compare
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
annejan
left a comment
There was a problem hiding this comment.
I have tested this locally and it seems to work pretty well 👍🏼
Fixes: #269
This pull request introduces a new "Re-encrypt" context menu option for directories within the main application's tree view.
Key changes include:
reencryptPathfunction handles the re-encryption process..gpg-id, and that this action is not easily reversible.ImitatePassbackend for the specified directory.