Auto DJ: (Re-)enable search in the Auto DJ view#13337
Conversation
This enables correct filtering of proxy models that wrap an instance of BaseSqlTableModel (or a subclass).
The search feature for the Auto DJ view was originally disabled by 54f71ea over 12 years ago. We now have some new tools available, which means we can implement a workaround instead of disabling search altogether. Searching within normal playlists is already possible and works correctly, and the Auto DJ queue is basically just another playlist, so being able to search there matches user expectations. We reuse the ProxyTrackModel code already used by the file browser view, so this shouldn't cause any additional problems.
This is to allow these actions to work as expected in the Auto DJ view. Whether these actions are allowed or not should be determined by the underlying TrackModel, and not by the ProxyTrackModel.
This fixes the focus behavior of copy/cut/paste in the Auto DJ view.
|
Huh, seems like I found a slight bug with the code formatting rules when confronted with changes in files that contain old, wrongly indented code. Fixing the indent of the old code makes the issues with the new code disappear... so that's what I will be doing. Don't know enough about |
…d issues with clang-format This prevents clang-format from inferring the wrong indent sizes for other parts of the file.
|
Just a hint: IIRC from a related discussion, one of the reasons to keep the search disabled in Auto DJ was that it is not obvious that the view is filtered. A possible solution, also relevant here IMHO, would be inserting narrow, empty dummy lines where the invisible tracks would be. Not sure how that could work though. |
Okay, I understand the concerns. I tried to look up the discussion you where mentioning, but couldn't find it. After thinking a bit about it, let me explain my reasoning why I think this is should not be a problem in practice. |
|
Update / TLDR: See my comment below for an overview, and then possibly come back for the detailed reasoning here. As I see it, there are three problems to be avoided here:
|
|
These are just my two cents, though. I appreciate feedback whether I missed something! As an aside, here are possibly related issues from the past that I could find:
If if I infer everything correctly, the limitations for searching & sorting the Auto DJ queue were primarily motivated by technical restrictions, and not by user expectations. As explained by @daschuer in this comment on #6335, most users probably expect the Auto DJ queue to behave like a playlist. |
|
My personal, real-world use case that motivated this PR is this: I have prepared a 3 hour/100 track playlist in the Auto DJ queue for a dance party, and want to remove a specific track from the queue because I have added another copy of it near the top of the queue during the course of the party. Without neither search nor sorting, this is an arduous task - that's why we have search. Inserting narrow placeholder rows or greying out filtered out tracks instead of fully hiding them would be slightly better, but would still force me to scroll through a large list of tracks. It seems to me that there are three camps of users:
I think that the second solution conflicts with how playlists (that is, the specific objects called "playlists" in the UI, not the general concept which also includes in the Auto DJ queue) behave currently in Mixxx, and thus is undesirable in my opinion, but could be solved using a config option or separate feature. The third and fourth solutions are compromises that give noone what they want, except for the people that do not need or use the feature anyway. |
|
Thanks for elaborating!
tracked by #7922 |
I think a status bar / info bar could also solve this. (stale PR #3406).
That wouldn't help much IMO. If the filtered tracks fill the view such a bottom row wouldn't be visible. |
daschuer
left a comment
There was a problem hiding this comment.
I can confirm your use case.
However, I am strictly against filtering and sorting in the Auto-DJ playlist. The reliable view what will happen next is, IMHO much more important than any desire for sorting and filtering.
I often search for a successor and forget to go to the Track view first. If that happens with Auto DJ late at night, even a warning bar would be not enough, considering other visual clutter we have already.
I like however @ronso0 idea to highlight and probably select and auto scroll to the filter matches. That is IMHO quiicker as a normal filtering for your tracks.
You just need to press del and the tracks are gone.
What do you think?
After giving it some more thought, I can't really come up with a valid use case for sorting an already running Auto DJ playlist, either, so we can restrict the discussion to filtering only, and see whether we can find a good solution for that.
Yeah, I'd be kind of opposed to a warning bar / status bar at the bottom of the screen, too, due to its distraction potential. The search bar is basically the main entry point for starting to interact with tracks/playlists (see #13200), so any visual indicators or such, if any, should be in close visual proximity to it or the track list, because that are the places users will look at. I think that your use case is very valid. Just to understand correctly, what are your main concerns/issues you want to avoid?
Also, for clarification, are you using an external DJ controller or a Mixxx-only setup? (For context, I'm running Mixxx on a laptop and do not have any experience whatsoever with external controllers).
I don't know about introducing a whole different behavior of the search control just for one library view, though. That has a great potential for confusion, and feels a bit like overkill. I like the idea of scrolling, but that only works well for a single selected track. As soon as multiple tracks are selected, you have to find a way for the user to see that there are offscreen track which are selected, and for the user to cycle through those tracks, ... it removes one potential issue but creates others. |
|
The best solutions I think of so far (based on the suggestions here and elsewhere) are:
|
For the record, I didn't propose that (here ; ) Maybe in some ancient combo. I agree it's bad UX) Let's take a step back and ignore the imlipcit constraints we set when thinking of the AutoDJ as a regular (playlist) view, e.g. when sorting all rows are sorted, when filtering the filter is strict, no exceptions. There are basically two situations where filtering and/or sorting can be applied, AutoDJ ON or OFF, but IMO there are different constraints / requirements / expectations:
In both situations filtering / sorting may be desired, mostly like in playlists:
So if we now have a somewhat independent table model (at least we can tweak the filtered view to our liking) could it be possible to present the filtered view differently?
What do you think? |
I can confirm. They can be grayed out or such. That's still ok for me. For the rest, the view proposed in #13337 (comment) |
|
Let's not allow sorting. What is the reason you need to see all filter matches on a single page? If we pin the first four, and than replace the hidden rows with a single line as you demonstrate above that could work. Maybe with a + icon to uncollapse these rows and remove the filter. |
|
This PR is marked as stale because it has been open 90 days with no activity. |
|
Sorry, this PR is still active, just didn't find time to work on it. I'll try to implement the requested features some time in the next months. |
|
This PR is marked as stale because it has been open 90 days with no activity. |
|
Coming back to this after I read https://mixxx.discourse.group/t/search-function-for-auto-dj/32934 Recently I noticed that Betterbird (a ThunderBird fork) changes the background of the email list when a Quick Filter is active. It's pattern of diagonal lines, clearly distinguishing the regular, full view from the filtered one. So, while I like some of the ideas we discussed here (especially keeping next 1-3 tracks visible), I'd prefer to implement this kind of "filtered" indicator and only keep tracks 1,2,3. I'll publish a quick POC when it's ready. |
|
Nice, here is a screenshot for reference. |
|
Sorry, I haven't been active for the last months due to other things requiring my time. Just for reference, I've been running this patch1 in production for 1,5 years now (including at dance parties and weddings) and can offer my experience so far:
Footnotes
|
|
I'm also a user of Betterbird, so I can say that:
|
|
@cr7pt0gr4ph7 Thanks for your feedback!
Since we introduced the
So "move to top+2" would be |
Indeed, that would be consistent with the existing warning for manual track removal in playlists and crates. edit |
|
I managed to get the background warning, but it's not polished, yet. The I'll open a PR for testing, then we can decide whether we want this everywhere (in every library view) or only in Auto DJ. |

The search feature for the Auto DJ view was originally disabled by 54f71ea over 12 years ago.
We now have some new tools available, which means we can implement a workaround instead of disabling search altogether. Searching within normal playlists is already possible and works correctly, and the Auto DJ queue is basically just another playlist, so being able to search there matches user expectations.
The implementation here reuses the
ProxyTrackModelcode already used by the file browser view for the actual filtering behavior (4970e30). Most of the changes here are for makingBaseSqlTableModelplay nicely withProxyTrackModel(75ce4d0), for making cut, copy & paste work (62c3a0f) and behave correctly w.r.t. keyboard focus (35569a4).