Skip to content

Improve search - #13640

Open
HomesGH wants to merge 17 commits into
keepassxreboot:developfrom
HomesGH:feature/improve_search
Open

HomesGH wants to merge 17 commits into
keepassxreboot:developfrom
HomesGH:feature/improve_search

Conversation

@HomesGH

@HomesGH HomesGH commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)
  • ✅ New feature (change that adds functionality)
  • ✅ Breaking change (causes existing functionality to change)
  • ✅ Refactor (significant modification to existing code)
  • ✅ Documentation (non-code change)
    A little bit of everything

Overview

This PR tackles:

(Fixes #4696, Fixes #7967)

The search functionality is improved with this PR. The default search (without stating field specifier, e.g., u:) is extended to include almost all fields (title, username, password, url, notes, additional attributes, attachments (filename not content) or tags). The skipProtected variable, which was not really used until now, is renamed to includeProtected and connected to a new option ("Include protected fields"). Without this option set, the password and protected additional attributes are excluded from the default search. To clarify that search options are available, the symbol was changed.
Important: The default behavior was changed from including protected fields by default to NOT include protected fields when searching. When searching for passwords (p:XXX), the new option is not considered since stating p: explicity shows the user's wish to search the (protected) password field.

The behavior of * which served both as modifier and wildcard was changed by introducing a new option "Regular expression" so that * is now solely a wildcard. This prevents weird behavior like *test (regex) vs test* (wildcard).

New search terms for has: was introduced:

Added a default search for entries with passkey:
grafik

The documentation was adjusted accordingly and the already existing feature to search within a specific additional attribute using an underscore (_) was added to it.

Screenshots

grafik

Testing strategy

  • Manual testing on Linux
  • Unit tests

Open questions

  • Since the default behavior of including protected values changed, searching for * with the "Include protected fields" option NOT set, leads to an empty list. This is not the case for, e.g., t:*. The issue is here the parser in combination of the role of * being both a modifier and a wildcard. When just searching for *, it is a modifier. When prepending characters, * is a wildcard. It feels like a bug... --> Fixed by new option to set regex instead of * modifier.
  • The behavior of an empty term (e.g., t:) being related to the includeProtected variable seems a bit odd. --> Fixed to be independent of includeProtected setting
  • The unit tests TestEntrySearcher and TestGui need to be adapted

@droidmonkey

Copy link
Copy Markdown
Member

I would like to see the original search icon preserved and add the options icon to the right hand side where the help icon is.

@droidmonkey
droidmonkey marked this pull request as draft September 2, 2026 15:36
@droidmonkey droidmonkey added feature: Search pr: new feature Pull request adds a new feature labels Sep 2, 2026
@droidmonkey droidmonkey added this to the v2.8.0 milestone Sep 2, 2026
@HomesGH

HomesGH commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

I have moved the search options icon and menu to the right and reintroduced the search icon:
grafik

I have edited the initial PR description to reflect the current state of this PR.

@HomesGH
HomesGH marked this pull request as ready for review September 10, 2026 13:18
@phoerious phoerious modified the milestones: v2.8.0, v2.9.0 Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add has:expiration to search terms Ability to search *all* text, simply Attributes not searched by default?

3 participants