feat: Add support to rename tags for all entries (#9142) - #13629
Open
braiscouce wants to merge 7 commits into
Open
braiscouce wants to merge 7 commits into
braiscouce wants to merge 7 commits into
Conversation
Member
|
Nice work! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new “Rename Tag” operation for database-wide tag management. It extends the core Database tag API to support renaming a tag across all entries, wires it into the Tags sidebar context menu, and adds a unit test to validate the core behavior.
Changes:
- Add
Database::renameTag()(andhasTag()) to rename a tag across all entries with error reporting. - Add a “Rename Tag” entry to the tag context menu in the GUI (with user prompt + error display).
- Add new unit tests (
TestTags) and register them intests/CMakeLists.txt; update translation source strings.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/Database.h |
Exposes new tag-related APIs (hasTag, renameTag). |
src/core/Database.cpp |
Implements tag rename logic and tag existence checks. |
src/gui/tag/TagView.cpp |
Adds “Rename Tag” to the tag context menu and prompts for a new tag name. |
tests/TestTags.h |
Declares new unit test class for tag rename behavior. |
tests/TestTags.cpp |
Implements unit tests for rename success and error cases. |
tests/CMakeLists.txt |
Registers the new testtags unit test target. |
share/translations/keepassxc_en.ts |
Adds new translatable strings for rename-tag UX and errors. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Detected by Copilot in the code review
Detected by Copilot in the code review
Detected by Copilot in the code review: Database::hasTag() currently forces updateTagList() (full database scan + sort + tagListUpdated() emission) on every call, and the comment references a unit-test failure workaround. This makes a cheap query unexpectedly expensive and can trigger extra UI model resets. Prefer checking tags directly on entries without touching the cached tag list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes add support to rename tags for all entries (#9142). I have added a new entry in the contextual menu. When you click on it, you write the new name and confirm or cancel the operation.
The changes introduce new strings that require translations. I have executed the release-tool script but I have to modify it because it expects version 5.x but I have 6.x. Maybe this should be updated after the QT6 migration? I have not changed this in this PR.
Screenshots
Testing strategy
I have manually tested the changes including tags with spaces and mixed upper/lower case. I have also tested that you cannot rename to a existing tag name.
I have implemented automated tests for the core logic. There are no GUI tests for the GUI changes.
Type of change