Skip to content

feat: Add support to rename tags for all entries (#9142) - #13629

Open
braiscouce wants to merge 7 commits into
keepassxreboot:developfrom
braiscouce:feature/rename_tags
Open

braiscouce wants to merge 7 commits into
keepassxreboot:developfrom
braiscouce:feature/rename_tags

Conversation

@braiscouce

Copy link
Copy Markdown
Contributor

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

image image

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

  • New feature (change that adds functionality)

@droidmonkey

Copy link
Copy Markdown
Member

Nice work!

@droidmonkey droidmonkey added feature: Tags pr: new feature Pull request adds a new feature labels Aug 29, 2026
@droidmonkey droidmonkey added this to the v2.8.0 milestone Aug 29, 2026
@droidmonkey
droidmonkey requested a lite review from Copilot August 29, 2026 19:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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() (and hasTag()) 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 in tests/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.

Comment thread src/gui/tag/TagView.cpp Outdated
Comment thread src/core/Database.cpp
Comment thread src/core/Database.cpp
Comment thread tests/TestTags.cpp Outdated
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.
@phoerious phoerious modified the milestones: v2.8.0, v2.8.1 Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: Tags pr: new feature Pull request adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants