Filter UX: Layout filter realtime, click-out clears filter, Sequencer filter exposed#6190
Filter UX: Layout filter realtime, click-out clears filter, Sequencer filter exposed#6190heffneil wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves filter UX in the Layout and Sequencer tabs by making filtering more discoverable and responsive, and by ensuring selection actions behave sensibly when items are filtered out.
Changes:
- Layout: refresh the model tree live on every keystroke and clear the filter when clicking/selecting a model that’s currently filtered out.
- Sequencer: keep the prop filter always visible, make Ctrl+F focus/select it, and prevent Enter/Escape/X from hiding the filter UI.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src-ui-wx/layout/LayoutPanel.cpp | Makes the Layout model filter update on each keystroke; clears active filter when selecting a model not currently present due to filtering. |
| src-ui-wx/sequencer/MainSequencer.cpp | Makes Sequencer filter always visible; updates key handling so Ctrl+F focuses it and Enter/Escape/X preserve visibility while applying/clearing filter text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1. Escape and X-button handlers in the sequencer filter used SetValue("")
which fires wxEVT_TEXT, re-invoking OnSeqFilterText -> ApplySeqFilter
a second time on top of the explicit ApplySeqFilter("") call below.
Double work + potential visual flicker. Switched to ChangeValue("")
so the empty filter applies exactly once via the explicit path.
2. Debounce the Layout tab's realtime filter refresh. The old
implementation called UpdateModelList(true) on every keystroke, which
is heavy on big layouts (preview recompute + full tree rebuild) and
could feel laggy during fast typing. Now the keystroke handler only
compiles the regex and restarts a 150ms one-shot wxTimer; the timer
fires UpdateModelList once when the user pauses. Fast-typed bursts
collapse into a single refresh. The Enter / search-button / cancel
paths stop the timer and refresh synchronously so they feel immediate
and don't trigger a redundant debounced refresh right after.
150ms is below the human-perceptible lag threshold (~200ms) so it
still feels "as you type" while eliminating the per-char work.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed all three Copilot review findings in commit 89bc9cc:
Build green on macOS Debug. |
|
I need to test this -- i didnt put in the realtime filter since the rebuild process wasnt so quick on my lowly pc. |
|
I know - copilot complained about how taxing it is but it didn't seem slow. Give it a shot. Its mostly cached so I don't think its hard on a pc with modest hardware |
89bc9cc to
b3b2545
Compare
|
@derwin12 stripped down per your feedback. Final diff: +25 −10 across 3 files (down from +97 −22). Rebased on current master so #6271's click-out-clears-filter fix (now upstream) dropped out automatically — no more duplicate work. Comments removed, cosmetic rebase noise reverted. What's left is the actual behavior change: Layout debounced realtime filter —
Layout timer member —
Sequencer always-visible filter —
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src-ui-wx/layout/LayoutPanel.cpp:10343
- Using
SetValuehere re-emitswxEVT_TEXT, which restarts the new debounce timer even though this handler already does an immediateUpdateModelList(true). That means canceling the filter (and theSelectModelInTreepath that calls this helper) schedules a second full rebuild about 150 ms later; becauseUpdateModelList(true)clears the tree selection, the delayed rebuild can wipe out the selection that was just restored.
void LayoutPanel::OnModelFilterCancelBtn(wxCommandEvent& event) {
_filterDebounceTimer.Stop();
ModelFilterCtrl->SetValue("");
_filterString = "";
_filterRegexValid = false;
UpdateModelList(true);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b3b2545 to
9b92a26
Compare
|
@derwin12 — friendly bump. The stripped-down version per your feedback (now +25/-10 across 3 files, down from +97/-22) has been sitting since May 4. Ready for another look whenever you have a sec. |
- Layout model filter: refresh as the user types, debounced through a 150ms one-shot timer so fast typing doesn't fire UpdateModelList on every keystroke. Enter / search-button still refresh immediately. - Sequencer prop filter: leave the control visible by default instead of hidden behind Ctrl+F. Ctrl+F focuses the filter and selects any existing text. Enter just moves focus to the effect grid (the filter is already applied live). Escape and the X button clear the filter and re-show all rows but keep the control visible.
9b92a26 to
a0dc0a1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src-ui-wx/layout/LayoutPanel.cpp:12261
OnModelFilterCancelBtnusesModelFilterCtrl->SetValue(""), which fireswxEVT_TEXT. That handler restarts_filterDebounceTimer, so after the immediateUpdateModelList(true)here you can still get a second redundant refresh ~150ms later (extra work + selection/focus churn). UseChangeValue("")to avoid generatingwxEVT_TEXTwhen cancelling explicitly (same pattern asViewsModelsPanel::OnNonModelsFilterCancel).
_filterDebounceTimer.Stop();
ModelFilterCtrl->SetValue("");
_filterString = "";
_filterRegexValid = false;
UpdateModelList(true);
|
Rebased onto current @keithsw1111 @dkulp @computergeek1507 — this small UX fix has been sitting since May. Could one of you take a look / let me know if anything's blocking it? Recap of what it does:
Diff is small (+36 / −24 across 5 files) and touches only the filter UI paths. |
- OnModelFilterCancelBtn uses ChangeValue (not SetValue) so clearing the filter doesn't re-fire wxEVT_TEXT and reschedule a debounced rebuild that wipes the restored selection (also covers the SelectModelInTree clear path) - Drop stale 'hidden by default' comment; the sequencer filter is now always visible Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Two UX improvements to the existing filter boxes in the Layout and Sequencer tabs:
(The earlier "clicking a filtered-out model in the preview clears the filter" change was split out and shipped separately via #6271 → master commit
0ba2cf70e. This PR no longer touchesSelectModelInTree.)1. Layout model filter narrows live as you type, debounced
ModelFilterCtrlalready boundwxEVT_TEXTand was compiling the regex on every keystroke, but it only refreshed the tree when the filter became empty. Now it kicks a 150ms one-shot_filterDebounceTimerso the tree narrows once typing pauses — no fullUpdateModelList(true)per keystroke, no perceived lag. Enter / search-button still refresh immediately and stop the pending timer to avoid a redundant second refresh.2. Sequencer prop filter exposed + view-switch reapplies
The
_seqFilterCtrlalready filtered rows live onwxEVT_TEXT, but it wasHide()-ed by default and only reachable through Ctrl+F. Most users never found it. Pressing Enter inside it calledShowSeqFilterPanel(false)which cleared the text — the act of "committing" destroyed the filter.Changes:
Hide()at construction — filter is always visible above the time displayOnSeqFilterEnternow just moves focus to the effect grid; the live-applied filter stays in placeOnSeqFilterCancel(X button, mouse) clears the text and re-shows all rows but keeps the filter visible — user can immediately type a new filterFILTER_SEQUENCERCtrl+F now focuses the always-visible filter andSelectAll()s any existing textMainSequencer::ReApplyCurrentSeqFilter()— called fromViewsModelsPanel::SelectView()afterDoForceSequencerRefresh()so the active filter is re-applied against the new view's rows when the user switches viewsShowSeqFilterPanel(bool)methodFiles changed
src-ui-wx/layout/LayoutPanel.cpp/.h— debounced realtime filtersrc-ui-wx/sequencer/MainSequencer.cpp/.h— exposed sequencer filter +ReApplyCurrentSeqFiltersrc-ui-wx/layout/ViewsModelsPanel.cpp— callReApplyCurrentSeqFilterfromSelectViewTest plan
UpdateModelListon every keystroke (debounce verified by typing fast and watching for one refresh)