Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 25, 2025

This PR fixes three related issues with the SearchWidget that were introduced with the "Press Enter to search" option and 500ms search delay:

Issues Fixed

1. Saved searches don't trigger search with "Press Enter to search" enabled

When the "Press Enter to search" option is enabled, clicking a saved search would only populate the search field but not actually perform the search. Users had to manually press Enter to trigger the search.

Root cause: The requestSearch signal was connected directly to setText(), which only updates the text field without triggering a search when "Press Enter to search" is enabled.

2. Save search button visibility issues

The save search button (disk icon) would only appear after a search was actually performed, not when typing text in the search field. Sometimes it wouldn't appear even after pressing Enter.

Root cause: Save button visibility was tied to search execution (startSearch()) rather than text presence in the field.

3. Unnecessary 500ms delay for saved searches

When "Press Enter to search" was disabled, clicking saved searches would still apply the 500ms typing delay, making the UI feel sluggish for programmatic search triggers.

Root cause: Saved searches went through the same timer logic designed for user typing.

Solution

The fix introduces two new methods and modifies the signal routing:

  1. performRequestedSearch(QString) - Handles saved searches with immediate execution:

    • Sets the search field text
    • Shows the save button
    • Triggers immediate search (bypasses timer delays and "Press Enter to search" logic)
  2. updateSaveButtonVisibility() - Shows save button whenever there's text:

    • Connected to textChanged() signal
    • Makes save button visible for any non-empty text
  3. Modified signal connection - Routes requestSearch to the new method:

    // Before: only sets text, no search triggered
    mx.connect(SIGNAL(requestSearch(QString)), m_ui->searchEdit, SLOT(setText(QString)));
    
    // After: sets text AND triggers immediate search  
    mx.connect(SIGNAL(requestSearch(QString)), this, SLOT(performRequestedSearch(QString)));

Behavior Changes

  • ✅ Saved searches now work immediately regardless of "Press Enter to search" setting
  • ✅ Save button appears when typing, not just after search execution
  • ✅ No delays for saved searches - they execute instantly
  • ✅ Normal typing behavior unchanged
  • ✅ All existing functionality preserved

Testing

  • Core functionality tests pass
  • Code compiles without errors
  • Formatting checks pass
  • Changes are minimal and surgical (only 20 lines added/modified)

Fixes #12313.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 184.155.130.134.in-addr.arpa
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • de.login.keepassxc.org
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • keepassxc.co.uk
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • keepassxc.org
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • login.keepassxc.co.uk
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • login.keepassxc.org
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • test.com
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Search issues with "Press Enter to search" option enabled and 500ms delay on saved searches Fix SearchWidget issues with saved searches and "Press Enter to search" option Jul 25, 2025
Copilot AI requested a review from droidmonkey July 25, 2025 16:30
@codecov
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.21%. Comparing base (7e3e2c1) to head (9f7b59c).
⚠️ Report is 34 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12314      +/-   ##
===========================================
- Coverage    64.22%   64.21%   -0.01%     
===========================================
  Files          377      377              
  Lines        39378    39386       +8     
===========================================
  Hits         25289    25289              
- Misses       14089    14097       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@droidmonkey droidmonkey added this to the v2.7.11 milestone Aug 24, 2025
@droidmonkey droidmonkey marked this pull request as ready for review September 7, 2025 15:39
Copilot AI review requested due to automatic review settings September 7, 2025 15:39
Copy link
Contributor

Copilot AI left a comment

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 fixes three interconnected issues with the SearchWidget related to saved searches and the "Press Enter to search" functionality. The main problem was that saved searches weren't working properly when the "Press Enter to search" option was enabled, and the save button visibility was tied to search execution rather than text presence.

Key changes:

  • Introduces immediate search execution for saved searches that bypasses timer delays and "Press Enter to search" logic
  • Updates save button visibility to show whenever there's text in the search field
  • Routes saved search requests through a new dedicated method instead of just setting text

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/gui/SearchWidget.h Adds two new private slot method declarations for handling requested searches and save button visibility
src/gui/SearchWidget.cpp Implements the new methods and updates signal connections to fix saved search behavior and save button visibility

@droidmonkey droidmonkey merged commit b12f6f0 into develop Sep 7, 2025
11 checks passed
@droidmonkey droidmonkey deleted the copilot/fix-12313 branch September 7, 2025 21:15
pull bot pushed a commit to blog2i2j/keepassxreboot.._..keepassxc that referenced this pull request Sep 7, 2025
…h" option (keepassxreboot#12314)

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
pull bot pushed a commit to surkin/keepassxc that referenced this pull request Sep 8, 2025
…h" option (keepassxreboot#12314)

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
pull bot pushed a commit to gburkhow/keepassxc that referenced this pull request Sep 26, 2025
…h" option (keepassxreboot#12314)

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
@droidmonkey droidmonkey added the pr: backported Pull request backported to previous release label Oct 25, 2025
droidmonkey added a commit that referenced this pull request Oct 26, 2025
…h" option (#12314)

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: droidmonkey <[email protected]>
@droidmonkey droidmonkey added the pr: ai-assisted Pull request contains significant contributions by generative AI label Nov 8, 2025
dragonekii pushed a commit to dragonekii/keepassxc-custom that referenced this pull request Dec 8, 2025
Release 2.7.11 (2025-11-23)

- Add image, HTML, Markdown preview, and text editing support to inline attachment viewer [keepassxreboot#12085, keepassxreboot#12244, keepassxreboot#12654]
- Add database merge confirmation dialog [keepassxreboot#10173]
- Add option to auto-generate a password for new entries [keepassxreboot#12593]
- Add support for group sync in KeeShare [keepassxreboot#11593]
- Add {UUID} placeholder for use in references [keepassxreboot#12511]
- Add “Wait for Enter” search option [keepassxreboot#12263]
- Add keyboard shortcut to “Jump to Group” from search results [keepassxreboot#12225]
- Add predefined search for TOTP entries [keepassxreboot#12199]
- Add confirmation when closing database via ESC key [keepassxreboot#11963]
- Add support for escaping placeholder expressions [keepassxreboot#11904]
- Reduce tab indentation width in notes fields [keepassxreboot#11919]
- Cap default Argon2 parallelism when creating a new database [keepassxreboot#11853]
- Database lock after inactivity now enabled by default and set to 900 seconds [keepassxreboot#12689, keepassxreboot#12609]
- Copying TOTP now opens setup dialog if none is configured for entry [keepassxreboot#12584]
- Make double click action configurable [keepassxreboot#12322]
- Remove unused “Last Accessed” from GUI [keepassxreboot#12602]
- Auto-Type: Add more granular confirmation settings [keepassxreboot#12370]
- Auto-Type: Add URL typing preset and add copy options to menu [keepassxreboot#12341]
- Browser: Do not allow sites automatically if entry added from browser extension [keepassxreboot#12413]
- Browser: Add options to restrict exposed groups [keepassxreboot#9852, keepassxreboot#12119]
- Bitwarden Import: Add support for timestamps and password history [keepassxreboot#12588]
- macOS: Add Liquid Glass icon [keepassxreboot#12642]
- macOS: Remove theme-based menubar icon toggle [keepassxreboot#12685]
- macOS: Add Window and Help menus [keepassxreboot#12357]
- Windows: Add option to add KeePassXC to PATH during installation [keepassxreboot#12171]

- Fix window geometry not being restored properly when KeePassXC starts in tray [keepassxreboot#12683]
- Fix potential database truncation when using direct write save method with YubiKeys [keepassxreboot#11841]
- Fix issue with database backup saving [keepassxreboot#11874]
- Fix UI lockups during startup with multiple tabs [keepassxreboot#12053]
- Fix keyboard shortcuts when menubar is hidden [keepassxreboot#12431]
- Fix clipboard being cleared on exit even if no password was copied [keepassxreboot#12603]
- Fix single-instance detection when username contains invalid filename characters [keepassxreboot#12559]
- Fix “Search Wait for Enter” setting not being save [keepassxreboot#12614]
- Fix hotkey accelerators not being escaped properly on database tabs [keepassxreboot#12630]
- Fix confusing error if user cancels out of key file edit dialog [keepassxreboot#12639]
- Fix issues with saved searches and “Press Enter to Search” option [keepassxreboot#12314]
- Fix URL wildcard matching [keepassxreboot#12257]
- Fix TOTP visibility on unlock and settings change [keepassxreboot#12220]
- Fix KeeShare entries with reference attributes not updating [keepassxreboot#11809]
- Fix sort order not being maintained when toggling filters in database reports [keepassxreboot#11849]
- Fix several UI font and layout issues [keepassxreboot#11967,  keepassxreboot#12102]
- Prevent mouse wheel scroll on edit username field [keepassxreboot#12398]
- Improve base translation consistency [keepassxreboot#12432]
- Improve inactivity timer [keepassxreboot#12246]
- Documentation improvements [keepassxreboot#12373, keepassxreboot#12506]
- Browser: Fix ordering of clientDataJSON in Passkey response object [keepassxreboot#12120]
- Browser: Fix URL matching for additional URLs [keepassxreboot#12196]
- Browser: Fix group settings inheritance [keepassxreboot#12368]
- Browser: Allow read-only native messaging config files [keepassxreboot#12236]
- Browser: Optimise entry iteration in browser access control dialog [keepassxreboot#11817]
- Browser: Fix “Do not ask permission for HTTP Basic Auth” option [keepassxreboot#11871]
- Browser: Fix native messaging path for Tor Browser launcher on Linux [keepassxreboot#12005]
- Auto-Type: Fix empty window behaviour [keepassxreboot#12622]
- Auto-Type: Take delays into account when typing TOTP [keepassxreboot#12691]
- SSH Agent: Fix out-of-memory crash with malformed SSH keys [keepassxreboot#12606]
- CSV Import: Fix modified and creation time import [keepassxreboot#12379]
- CSV Import: Fix duplication of root groups on import [keepassxreboot#12240]
- Proton Pass Import: Fix email addresses not being imported when no username set [keepassxreboot#11888]
- macOS: Fix secure input getting stuck [keepassxreboot#11928]
- Windows: Prevent launch as SYSTEM user from MSI installer [keepassxreboot#12705]
- Windows: Remove broken check for MSVC Redistributable from MSI installer [keepassxreboot#11950]
- Linux: Fix startup delay due to StartupNotify setting in desktop file [keepassxreboot#12306]
- Linux: Fix memory initialisation when --pw-stdin is used with a pipe [keepassxreboot#12050]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: ai-assisted Pull request contains significant contributions by generative AI pr: backported Pull request backported to previous release PRE-RELEASE BUG

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search issues with "Press Enter to search" option enabled and 500ms delay on saved searches

2 participants