Skip to content

Usability/Keyboard: Add Ctrl+Shift+F shortcut to search the main tracks database#13200

Merged
ronso0 merged 17 commits into
mixxxdj:mainfrom
cr7pt0gr4ph7:search-in-tracks-shortcut
May 3, 2025
Merged

Usability/Keyboard: Add Ctrl+Shift+F shortcut to search the main tracks database#13200
ronso0 merged 17 commits into
mixxxdj:mainfrom
cr7pt0gr4ph7:search-in-tracks-shortcut

Conversation

@cr7pt0gr4ph7
Copy link
Copy Markdown
Contributor

@cr7pt0gr4ph7 cr7pt0gr4ph7 commented May 3, 2024

The new shortcut Ctrl+Shift+F (Search globally1) complements the existing shortcut Ctrl+F (Search in current location).

The use case for this is pretty simple (and motivated by me teaching dance classes) and probably pretty common elsewhere, too:

After digging around in my playlists & crates, leaving the computer to teach, and then coming back to it, I want to be able to quickly search for a specific song without having to first pick up the mouse or fiddle around with the trackpad.

Footnotes

  1. Ok, it is only "globally" as long as all tracks are present in the main Mixxx database, and not contained in external libraries like iTunes or Rekordbox.2

  2. As a later improvement, one could extend Ctrl+Shift+F to, either:
    a. Actually initiate a global search over all available libraries, or:
    b. Make default library to which Ctrl+Shift+F jumps configurable in the preferences, or:
    c. Provide different shortcuts for the different external libraries.

@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch from 1a95d62 to 46facc1 Compare May 3, 2024 16:05
@cr7pt0gr4ph7 cr7pt0gr4ph7 marked this pull request as draft May 3, 2024 18:45
@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch from 46facc1 to 55d557f Compare May 3, 2024 19:43
@ronso0
Copy link
Copy Markdown
Member

ronso0 commented May 5, 2024

Note that there is already Library::searchTracksInCollection (emitted when clicking actions in WSearchRelatedTracksMenu), which (IMHO) allows a much simpler implementation.

@cr7pt0gr4ph7
Copy link
Copy Markdown
Contributor Author

@ronso0 Thanks, I will have a look! I'll have to place the shortcut handling somewehere else, though, so it also works when the search widget is disabled (this behavioris inherent to QShortcut). I'd use a custom key binding in KeyboardEventFilter, but then it'd only work when Keyboard shortcuts are enabled.

Sidenote: There seem to be at at least three ways to define keyboard shortcut actions and associated key sequences right now:

  1. via eventFilter/keyPressEvent
  2. via QShortcut/QAction
  3. via KeyboardEventFilter/*.kbd.cfg/ControlObject (only active wjen

Option 3 is only active when keyboard shortcuts are enabled in the options, but when it is, it (mostly) overrides the other two.
Option 2 is somewhat integrated with option 3, but it's all bit convoluted.

Maybe it makes sense to integrate the "(Custom) keyboard shortcuts disabled" codepath into KeyboardEventFilter, too?

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented May 7, 2024

How about adding "Search in Tracks" to the Library menu?
And add the shortcut hint to the searchbar tooltip?

@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch 2 times, most recently from f5fe605 to 0210e1b Compare May 21, 2024 13:04
@cr7pt0gr4ph7 cr7pt0gr4ph7 deleted the search-in-tracks-shortcut branch May 21, 2024 19:20
@cr7pt0gr4ph7 cr7pt0gr4ph7 restored the search-in-tracks-shortcut branch May 21, 2024 21:49
@cr7pt0gr4ph7 cr7pt0gr4ph7 reopened this May 21, 2024
@cr7pt0gr4ph7 cr7pt0gr4ph7 marked this pull request as ready for review May 23, 2024 18:15
@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch from 0210e1b to 4d386c8 Compare May 23, 2024 20:48
@cr7pt0gr4ph7 cr7pt0gr4ph7 marked this pull request as draft May 23, 2024 22:38
@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch from caef3f3 to 22f171e Compare May 25, 2024 14:13
@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch from 22f171e to 8f7713b Compare August 21, 2024 13:11
…all" on Enter/Return

When the current text selection is due to the automatic selectAll()
when focusing the text field, a subsequent Key_Enter should switch to the
library view. Otherwise, it is due to an autocompletion and should trigger
the search first.
...so it uses the same format as the rest of the application.
… tooltip

The Ctrl+Backspace shortcut is a standard shortcut handled by QLineEdit
and deletes the current word, but doesn't actually clear the search box
if more than one word has been typed. This is different from the function
of the clear button, which clears the whole search box.
@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch 2 times, most recently from 986e93a to 488bd9e Compare August 22, 2024 09:20
@acolombier acolombier added this to the 2.6-beta milestone Feb 4, 2025
Copy link
Copy Markdown
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code LGTM! Haven't had a chance to test the feature yet

Comment thread res/keyboard/fr_FR.kbd.cfg Outdated
Copy link
Copy Markdown
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected! @ronso0 were your change requests addressed?

@acolombier
Copy link
Copy Markdown
Member

Friendly ping @ronso0 :)

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Mar 2, 2025

Just a note before I take a final look:
we need to document the new feature here https://manual.mixxx.org/2.5/en/chapters/appendix/keyboard_mapping_table#keyboard-mapping-table
(and add anchors for each section, probably simplify use/move the left columns' titles.

edit: anchors are added in mixxxdj/manual#734

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Mar 3, 2025

LGTM, will do a manual test asap.

Meanwhile, do you mind squashing the "accidental insertion/removal" commits into the kbd.cfg commit?
In case this causes trouble with the merge of main, just leave as is.

@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the search-in-tracks-shortcut branch from ca974e2 to e795ce9 Compare March 4, 2025 11:10
@cr7pt0gr4ph7
Copy link
Copy Markdown
Contributor Author

Meanwhile, do you mind squashing the "accidental insertion/removal" commits into the kbd.cfg commit? In case this causes trouble with the merge of main, just leave as is.

Done 👍

@github-project-automation github-project-automation Bot moved this to In progress in Releases Mar 25, 2025
@acolombier acolombier moved this from In progress to Need testing in Releases Mar 25, 2025
@daschuer
Copy link
Copy Markdown
Member

@ronso0 Can this be merged to 2.6-beta?

connect(pSearchHere, &QAction::triggered, this, &WMainMenuBar::searchInCurrentView);
pLibraryMenu->addAction(pSearchHere);

QString searchAllTitle = tr("Search in Tracks Library...");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use "Tracks view" so it's consistent with "Current view" and the searchbar tooltip

Copy link
Copy Markdown
Member

@ronso0 ronso0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM and works as expected!

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Apr 29, 2025

@ronso0 Can this be merged to 2.6-beta?

Yes.
It also fixes an (searchbar) issue with cursor position reset in main (didn't check 2.5, yet) caused by saveSearch().

@ronso0 ronso0 merged commit 019eab1 into mixxxdj:main May 3, 2025
@github-project-automation github-project-automation Bot moved this from Need testing to Done in Releases May 3, 2025
@ronso0
Copy link
Copy Markdown
Member

ronso0 commented May 3, 2025

Whooopsy, totally forgot to press merge.

Thank you very mucho @cr7pt0gr4ph7 been missing this feature lately, happy to merge finally!

@cr7pt0gr4ph7 cr7pt0gr4ph7 deleted the search-in-tracks-shortcut branch May 3, 2025 11:18
@cr7pt0gr4ph7
Copy link
Copy Markdown
Contributor Author

@ronso0 Thanks for merging! Sorry for not being involved in the project for the last few weeks, had a lot other stuff to do. I'm still planning on getting my other PRs ready for merging 👍

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented May 11, 2025

Unfortunately the global hotkey removed the Ctrl+F shortcut in the Developer Tools dialog.
Fixup is #14761

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Oct 29, 2025

Apparently 2.6 has been created while this was targeting main when main was still 2.6-alpha?
At least it's not in 2.6 : \

Shall we backport?

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants