Leave a filtered canvas in one gesture - #123
Merged
Merged
Conversation
The search, the tags and the languages were each undone where they were set, across three bands of the header. The result count doubles as the way out of all three, and Escape falls through to it once there is no selection left to clear. The quick filter is deliberately untouched: is_filtering does not count it, so it is not what turned the gesture on, and it has a visible control of its own with "All" in it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #116.
Search
deploy, pick#ops, pickSH, and getting back to the whole corpuswas three gestures across three bands of the header — each obvious on its own,
together a state nobody set deliberately and nobody could leave in one move.
Where it hangs
On the result count, which is the one thing on screen that appears exactly
when the canvas is narrowed. It becomes a button carrying a
✕, withnotes.clearFiltersas its accessible name — the count alone would read as alabel rather than an action.
preventDefaulton the click, and it is load-bearing: the field is inside the<label>, so without it the click focuses the input and hands the user a cursorin a field they had just emptied.
Escape falls through
CANVAS_KEYSalready gaveEscapeto clearing the selection, and arunanswers whether it acted — so the same entry now tries the selection first and
the filters second. One key, one meaning: leave the state the canvas is in. The
shortcuts sheet says so, in both locales.
Typing is untouched: the directive ignores any keystroke aimed at an input, which
is what leaves
Ctrl+Kand the search field alone.The quick filter is left alone, on purpose
is_filteringinnotes::viewcounts the search, the tags and the languages —not the quick filter. So "Pinned" never turns this gesture on, and clearing
it would be undoing something the gesture never claimed. It also has a visible
three-way control with "All" in it, which is already the way out. There is a test
on it.
One bug found by its own test
Setting the two search signals was not enough. A keystroke from a moment ago is
still inside the 150 ms debounce; it lands afterwards and puts the query back,
leaving the canvas filtered with an empty field to explain it.
clearFilterscancels the pending call first.
The test that found it needs real timers and a real wait — faking the clock only
proves the assertion ran before the timer did, which is why the first version of
it passed against the bug. Checked both ways: red without the cancel, green with.
Checked locally
npm test975 passing,npm run lintclean,npm run test:e2e15/15 in 4:11.🤖 Generated with Claude Code