Skip to content

Improve searchbox UX: select text on Ctrl+F and add Enter / Shift+Enter navigation #1613

Description

@Joystick01

Is your feature request related to a problem? Please describe.
Searching for text across QualCoder currently has a few minor UX inconsistencies:

  1. No automatic text selection on Ctrl+F: In several screens (such as Text Coding, Journals, and Coding Reports), pressing Ctrl+F focuses the search box without selecting the existing text. The user has to manually press Ctrl+A or Backspace before pasting or typing a replacement query.
  2. Missing window-wide shortcut in some views: In Audio/Video coding (code_av), Media viewing (view_av), and summary reports, Ctrl+F is not bound at the window level to jump to the search box.
  3. Inconsistent search box keyboard navigation:
    • In Text Coding (code_text), pressing Shift+Enter in lineEdit_search triggers Qt's default returnPressed signal, which moves to the next result rather than the previous one.
    • In Journals and Audio/Video coding, pressing Enter or Shift+Enter inside the search box does not navigate results at all (requiring mouse clicks on the next/previous arrow buttons).

Describe the solution you'd like
A unified and consistent search keyboard interaction across the application:

  1. Ctrl+F selection: Pressing Ctrl+F anywhere in a dialog—or while already inside the search box—should focus the search box and call selectAll(), so that typing or pasting immediately replaces any previous search term.
  2. Enter for Next: Pressing Enter / Return inside the search box advances to the next search match.
  3. Shift+Enter for Previous: Pressing Shift+Enter / Shift+Return inside the search box navigates to the previous search match in screens supporting bidirectional search (code_text, code_pdf, code_av, view_av, journals, edit_textfile), and safely no-ops in forward-only report screens.
  4. Reusable helper: Centralize this behavior in src/qualcoder/helpers.py (e.g. setup_search_shortcuts()) to keep all screens consistent without duplicating event filter logic.

Describe alternatives you've considered

  • Using F3 / Shift+F3 for Next/Previous: Standard in some desktop text viewers, but in QualCoder coding views F3 is already globally assigned to "Code / Cat Memo" on the code tree widget. Keeping navigation to Enter and Shift+Enter inside the search box avoids keybinding conflicts.
  • Implementing per-dialog event filters: Leads to duplicated code across ~10 dialog classes and risks subtle differences in modifier handling.

Additional context
I have already implemented and tested this change locally across all coding views, journals, text editing, and report dialogs, along with a dedicated unit test suite (tests/test_search_shortcuts.py). I would be happy to submit a Pull Request if this feature is welcome!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions