Add pinned attributes to entry preview panel - #13574
eric-lemesre wants to merge 1 commit into
Conversation
|
Cool, this is a good solution to the request |
Allow pinning additional attributes (custom strings) so they show on the entry preview panel below the password field. Pinned attributes are stored per entry in CustomData under the KPXC_PINNED_ATTRIBUTES key as a compact JSON array, leaving the KDBX schema untouched. * Add a "Pin" checkbox next to "Protect" in the entry edit Advanced tab * Show pinned attributes on the preview General tab; protected values are masked with a reveal toggle, double click copies the value * Keep the pinned list in sync on attribute rename and removal; pinned names that no longer exist are silently ignored * Add TestEntry::testPinnedAttributes, extend TestGui::testEditEntry (pin, preview display, masking, rename and removal sync) * Document the feature in the user guide Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
e37b74d to
71afee1
Compare
|
Rebased onto current Two things that were not visible from the PR page:
Re-verified locally on the rebased head, not carried over from August:
(Edited — the paragraph that stood here reported that @droidmonkey you called this a good solution to the request back in August — is there a milestone it could target, or something you would like reworked first? The four design decisions listed in the body (read-only preview, double-click copying while masked, pinning writing entry |
|
@droidmonkey — the two red checks here are a macOS agent timeout, not the patch.
There are no compiler errors anywhere in the log, and the test step never ran. It looks agent-side rather than branch-specific. That run took 50 minutes to reach 261/612 targets, while recent macOS builds finish in 3–7 minutes on a warm ccache — so it was compiling cold. And 13 of the last 14 Every macOS build after mine has come back green in the usual 3–7 minutes, so a re-run would most likely go through. Could you kick one off when you get a chance? Or I can force-push to retrigger the chain instead if that's easier on your side — just say the word. The branch content is unchanged since your note that this is a good solution to the request: rebased onto develop |
There was a problem hiding this comment.
🟡 Changes recommended
Address accessibility labeling, passkey-key filtering, and double-click clipboard coverage before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds per-entry pinning of custom attributes, persisted in KDBX4 CustomData and shown in the read-only preview with masking, reveal, and copy behavior.
Changes:
- Adds pin controls with rename/removal synchronization.
- Adds preview rendering and persistence logic.
- Adds tests, translations, and documentation.
File summaries
| File | Summary |
|---|---|
tests/TestEntry.h |
Declares pinned-attribute tests. |
tests/TestEntry.cpp |
Tests JSON persistence and validation. |
tests/gui/TestGui.cpp |
Tests editor and preview integration. |
src/gui/EntryPreviewWidget.ui |
Adds the pinned-attributes layout. |
src/gui/EntryPreviewWidget.h |
Declares preview helpers. |
src/gui/EntryPreviewWidget.cpp |
Renders, masks, reveals, and copies pinned values. |
src/gui/entry/EditEntryWidgetAdvanced.ui |
Adds the Pin checkbox. |
src/gui/entry/EditEntryWidget.h |
Declares pinning controls and handlers. |
src/gui/entry/EditEntryWidget.cpp |
Persists pin state and synchronizes edits. |
src/core/Entry.h |
Adds pinned-attribute APIs. |
src/core/Entry.cpp |
Implements JSON encoding and decoding. |
src/core/CustomData.h |
Declares the custom-data key. |
src/core/CustomData.cpp |
Defines the custom-data key. |
share/translations/keepassxc_en.ts |
Adds new translation strings. |
docs/topics/DatabaseOperations.adoc |
Documents pinned attributes. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| auto button = new QToolButton(container); | ||
| button->setCheckable(true); | ||
| button->setChecked(false); | ||
| button->setIcon(icons()->onOffIcon("password-show", false)); |
| m_advancedUi->pinAttributeButton->setChecked(Entry::pinnedAttributes(m_customData.data()).contains(key)); | ||
| m_advancedUi->pinAttributeButton->setEnabled(!m_history); |
This PR adds the ability to pin additional attributes (custom strings) so they are displayed on the entry preview panel, below the password field.
CustomDataunder the keyKPXC_PINNED_ATTRIBUTES, as a compact JSON array of attribute names (JSON because attribute names may contain any character, including commas and quotes). The KDBX schema and the way custom strings are stored are unchanged.Design decisions we would like to flag explicitly for review:
CustomData, so a KDBX3 database will be upgraded to KDBX4 on save — the same behaviour as the browser integration settings.Note: this PR is independent of #13573 (
Entry::beginUpdate()CustomData fix), but that fix is required for the pinned state to be carried into and restored from entry history.Screenshots
Testing strategy
TestEntry::testPinnedAttributes: round-trip including names with commas/quotes/newlines/unicode, empty-name filtering, duplicate removal, empty list removing the key, malformed JSON tolerated, null-pointer safety.TestGui::testEditEntry: pin checkbox, persistence, preview panel display, masking and reveal toggle, rename sync, removal sync and section hiding.testentry,testmodified,testgroup,testkdbx2/3/4,testmerge,testcli,testbrowserand the fulltestguisuite — all passing.clang-formatclean; translation strings pushed vialupdate.Type of change
AI usage disclosure
Per the contribution guidelines: development was done with Claude Code (model: Claude Fable 5, Anthropic); an additional critical code review pass was performed with Kimi-k3. All changes were reviewed, built and tested locally by the submitter.
We would very much welcome your feedback: if there are changes you would like, or points we may have missed — naming, UX of the Pin checkbox, the design decisions above, or anything else — we will gladly rework them.
🤖 Generated with Claude Code