Find bar X clears the query instead of closing the bar

The X was redundant with the top-bar search icon (both closed the bar).
Now the X empties the query and results but leaves the bar open; closing
is the search icon's toggle.

- editor: new findClear (empties query/matches, bumps Gen so an in-flight
  scan of the old query is dropped, disarms the settle) and FindClear
  handler; the X icon now runs FindClear.
- main: mirrors the logic-side clear into the main-owned widget input
  (frame.FindQuery=="" while the widget still has text -> SetText("")).
- tests: unit findClear (stays open, supersedes in-flight scan); e2e X
  clears but keeps the bar open and focus, close now via ToggleFind.
- doc: spec updated (clear button vs icon toggle).
This commit is contained in:
gmp
2026-08-20 13:00:21 -04:00
parent 1cbb367b1f
commit d726ea7244
6 changed files with 75 additions and 11 deletions
+6 -3
View File
@@ -75,9 +75,12 @@ elsewhere.
selection is highlighted in the editor and pushed to the IME. (Shift state
is tracked by the app, since Gio's Android bridge drops modifier keys —
architecture.md §2.1.)
- **In-file search:** a find icon on the top bar (right side) opens a find
bar directly below it, with a text input, an "N / M" counter, next/prev
navigation, and a close button. The query is a plain substring,
- **In-file search:** a find icon on the top bar (right side) toggles a
find bar directly below it, with a text input, an "N / M" counter,
next/prev navigation, and a clear (X) button. The X empties the query and
the results but leaves the bar open; the top-bar icon closes it (and
re-opens it). Opening the bar moves key focus to the search input and
raises the soft keyboard. The query is a plain substring,
case-insensitive, no regex; each change is scanned over the entire
in-memory content by a worker (`Search` task), so typing never blocks the
UI and stale scans are dropped by generation. Next/prev select and scroll