Skip to content

Leave a filtered canvas in one gesture - #123

Merged
vmillet-dev merged 1 commit into
mainfrom
feat/one-gesture-to-leave-a-filtered-canvas
Sep 15, 2026
Merged

vmillet-dev merged 1 commit into
mainfrom
feat/one-gesture-to-leave-a-filtered-canvas

Conversation

@vmillet-dev

Copy link
Copy Markdown
Owner

Closes #116.

Search deploy, pick #ops, pick SH, and getting back to the whole corpus
was 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 , with
notes.clearFilters as its accessible name — the count alone would read as a
label rather than an action.

⚠️ preventDefault on 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 cursor
in a field they had just emptied.

Escape falls through

CANVAS_KEYS already gave Escape to clearing the selection, and a run
answers 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+K and the search field alone.

The quick filter is left alone, on purpose

is_filtering in notes::view counts 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. clearFilters
cancels 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 test 975 passing, npm run lint clean, npm run test:e2e 15/15 in 4:11.

🤖 Generated with Claude Code

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>
@vmillet-dev
vmillet-dev merged commit cd05ada into main Sep 15, 2026
9 checks passed
@vmillet-dev
vmillet-dev deleted the feat/one-gesture-to-leave-a-filtered-canvas branch September 15, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leaving a filtered canvas takes as many gestures as entering it

1 participant