Search r4: filter words as tokens, no band or kind row, fits above the keyboard (#399) #416

Closed
kayg wants to merge 6 commits from issue/399-search-r4 into dev
Owner

Search round 4 in the mockup, for #399 (kayg's S7–S13). Mockup only; production is unchanged. Stacked on #352, which carries #330 and #331, so r4 builds on r3.

  • No band and no kind row, on phone and desktop. Date, Tag, Best match, Trash and All / Notes / Journal / Photos / Files / Tags are gone (FilterBar.svelte is deleted).
  • Filter words become tokens in the field: "photos from Spiti" shows as a Photos token followed by the words "from Spiti", and only Spiti photos are listed.
    • A word becomes a token when a space, a paste or a keyboard suggestion finishes it. Deleting never makes one.
    • Tapping a token turns it back into words, and they stay words.
    • Backspace at the start of the words turns the last token back into words you can edit.
    • Unfinished filter words already narrow the results while you type.
  • The parser is pure and lives in packages/ui/src/search/words.ts, so the real app can reuse it. It has 34 unit tests in words.test.ts, which CI runs through test:primitives. It recognises:
    • kinds (notes, days/journal/logs, photos/pictures, files/pdfs/documents, tags);
    • dates: before / after / on / in / since / until / from … to / between … and, written as an ISO day, month or year, "4 March", "March 4 2025", today, yesterday, this/last/past week/month/year, or last monday;
    • #tags, pinned, in trash, newest and oldest;
    • joining words such as "from" and "and" next to a filter;
    • "quoted words" as plain text.
  • No sort control: best match is the default, and "newest" or "oldest" reorders.
  • Empty field: recent things plus three examples to tap. The filter words in each example show in the accent. The examples stop showing after three filter words have been typed; this is counted on the device, and examples=1 brings them back.
  • Phone layout: search hangs from the top and ends 8 px above the keyboard, or above the home indicator and Safari's bar when the keyboard is down.
    • It follows visualViewport (search/viewport.svelte.ts), so it never reaches below 100svh.
    • When the keyboard goes down it springs back with the house spring. It shrinks instantly, because the keyboard already covers that edge.
    • Scrolling the results puts the keyboard away.
    • Desktop keeps r3's size and place, and is capped by the visible area.
  • Rows: a tap opens and a long press shows the preview, as before. A held row now cancels dragstart and selectstart, and sets -webkit-user-drag: none on the row and its thumbnail. While the preview is showing, a non-passive touchmove and touchend stop the list from scrolling and stop the tap. I didn't cancel touchstart, because that would stop the list scrolling from any row (WebKit 231161). This needs checking on a device.

Checks (Chromium at 320/360/375/390/900/1440 and WebKit at 390/1440, light and dark; all pass, with no page errors):

  • tokens from an example and from typing;
  • tapping a token back into words, and kept words staying words;
  • only photos for "photos from Spiti";
  • no kind row and no band;
  • the panel's bottom 8 px above a 336 px keyboard (simulated by shrinking visualViewport);
  • growing back to full height with a spring;
  • the long-press preview staying open on release;
  • desktop panel size unchanged (1120×740 at 1440, 852×740 at 900).

Unit tests: 66 of 66 pass in packages/ui.

Preview: https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&examples=1 (backup site.bak-399-202610150934).

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Search round 4 in the mockup, for #399 (kayg's S7–S13). Mockup only; production is unchanged. Stacked on #352, which carries #330 and #331, so r4 builds on r3. - **No band and no kind row,** on phone and desktop. Date, Tag, Best match, Trash and All / Notes / Journal / Photos / Files / Tags are gone (`FilterBar.svelte` is deleted). - **Filter words become tokens in the field:** "photos from Spiti" shows as a Photos token followed by the words "from Spiti", and only Spiti photos are listed. - A word becomes a token when a space, a paste or a keyboard suggestion finishes it. Deleting never makes one. - Tapping a token turns it back into words, and they stay words. - Backspace at the start of the words turns the last token back into words you can edit. - Unfinished filter words already narrow the results while you type. - **The parser is pure and lives in `packages/ui/src/search/words.ts`,** so the real app can reuse it. It has 34 unit tests in `words.test.ts`, which CI runs through `test:primitives`. It recognises: - kinds (notes, days/journal/logs, photos/pictures, files/pdfs/documents, tags); - dates: before / after / on / in / since / until / from … to / between … and, written as an ISO day, month or year, "4 March", "March 4 2025", today, yesterday, this/last/past week/month/year, or last monday; - #tags, pinned, in trash, newest and oldest; - joining words such as "from" and "and" next to a filter; - "quoted words" as plain text. - **No sort control:** best match is the default, and "newest" or "oldest" reorders. - **Empty field:** recent things plus three examples to tap. The filter words in each example show in the accent. The examples stop showing after three filter words have been typed; this is counted on the device, and `examples=1` brings them back. - **Phone layout:** search hangs from the top and ends 8 px above the keyboard, or above the home indicator and Safari's bar when the keyboard is down. - It follows `visualViewport` (`search/viewport.svelte.ts`), so it never reaches below `100svh`. - When the keyboard goes down it springs back with the house spring. It shrinks instantly, because the keyboard already covers that edge. - Scrolling the results puts the keyboard away. - Desktop keeps r3's size and place, and is capped by the visible area. - **Rows:** a tap opens and a long press shows the preview, as before. A held row now cancels `dragstart` and `selectstart`, and sets `-webkit-user-drag: none` on the row and its thumbnail. While the preview is showing, a non-passive `touchmove` and `touchend` stop the list from scrolling and stop the tap. I didn't cancel `touchstart`, because that would stop the list scrolling from any row (WebKit 231161). This needs checking on a device. **Checks** (Chromium at 320/360/375/390/900/1440 and WebKit at 390/1440, light and dark; all pass, with no page errors): - tokens from an example and from typing; - tapping a token back into words, and kept words staying words; - only photos for "photos from Spiti"; - no kind row and no band; - the panel's bottom 8 px above a 336 px keyboard (simulated by shrinking `visualViewport`); - growing back to full height with a spring; - the long-press preview staying open on release; - desktop panel size unchanged (1120×740 at 1440, 852×740 at 900). Unit tests: 66 of 66 pass in `packages/ui`. Preview: https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&examples=1 (backup `site.bak-399-202610150934`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Mockup search, round 3: glass pills, one lighter material, pull to search (#275, #320, #321)
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 25s
CI / rust (pull_request) Successful in 1m57s
e8233d6db9
kayg on round 2: the band behind the filter buttons "looks bad", and search should be "more
transparent and less blurry so more content can be seen", on one material shared with the bar,
sheets and menus (#319).

- The bottom progressive-blur band is gone. Date, Tag, Sort, Trash and Clear are glass pills on
  the shared floating tokens (--glass-float, --glass-float-filter, --glass-float-edge), floating
  straight over the list. On a phone, unset filters show just their icon (with a tooltip and a
  name that says the setting) so the row fits; Clear becomes an icon pill.
- The panel and the phone sheet use only the floating tokens (no more one-off 72 px blur).
- styles/glass.css tries the lighter material on those shared tokens, mockup-wide: tint 0.30 /
  0.36 (light / dark) and blur 20 px, down from 0.40 / 0.42 and 44 px. Proposed for tokens.css
  on #319; production is unchanged.
- Pull to search (#320): a small gesture plugin (search/pull.svelte.ts) plus its hint pill.
  A downward pull from the top third of any phone screen follows the finger with resistance,
  arms at 72 px ("Let go to search"), opens the sheet coming down from the top, and springs back
  if let go early. It starts only when what's under the finger is at its top (or on a header),
  never from the left edge, never with words selected or inside text being edited, and cancels
  touch moves only once the pull is its own, so iOS overscroll can't fight it.
- Search now floats over Settings too, so the pull works on every screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Search list clears its pills; the selector capsule never animates from the keyboard (#275)
Some checks failed
CI / server (pull_request) Successful in 24s
CI / web (pull_request) Failing after 25s
CI / rust (pull_request) Successful in 1m45s
8abd41a897
- Search: the results list ends a pill, its gap to the edge (with the home indicator on a
  phone) and 24 px of air further down, so the last row always scrolls fully out from under the
  floating filter pills. One measure (--clear-of-pills) sets both the padding and the keyboard's
  scroll padding. Checked at 1440, 390 and 390 with a 34 px home indicator, Chromium and WebKit.
- Selector (packages/ui): the capsule no longer fades in on first appearance, and changes from
  the keyboard (arrows, Enter, Space) or from outside (a link, another control) jump without
  any fade or slide, reduced motion included. Only a pointer's click glides or fades. Two new
  e2e checks: nothing runs on first appearance or after keyboard choices, and a pointer's first
  choice does fade in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Search: the tab bar steps aside, one pill size, rows never rest under the pills (#350)
Some checks failed
CI / web (pull_request) Failing after 24s
CI / server (pull_request) Successful in 23s
CI / rust (pull_request) Successful in 2m0s
4ec278eacb
- While search is open, the app's bottom bar (tabs and note tools) and the phone's + button are
  hidden at every width, so nothing shows under the sheet's filter pills (it did at 320).
- The filter pills are one size: --f tall (36 px with a 44 px hit area on touch), and square
  when they show only their icon, the Trash included.
- The results list now stops above the pill row instead of running under it, so no row rests
  or scrolls under the pills at any scroll position; its last 14 px fade instead of ending on a
  hard edge. The pills keep their own glass. Checked at the top, mid-list and the end, at 320,
  390, 900 and 1440, light and dark, Chromium and WebKit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
- packages/ui/src/search/words.ts: a small pure parser for English filter words
  (kinds, before/after/on/in/since/until/between dates with ISO or relative days,
  #tags, pinned, in trash, newest/oldest), with unit tests run by CI.
- The search field shows recognised words as tokens; a tap turns one back into
  words, and they stay words. Words become tokens when a space, paste or
  suggestion finishes them; deleting never makes one.
- The bottom pills (Date, Tag, Sort, Trash) and the kind row are gone on every
  width. Best match by default; "newest" or "oldest" reorders.
- An empty field shows recent things plus three examples to try; they step
  aside after a few filter words.
- Phone: the panel hangs from the top and ends above the keyboard and Safari's
  bar (visualViewport), and springs back when the keyboard goes down.
  Scrolling the results puts the keyboard away.
- Rows: a held row never starts the system drag, callout or selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Search r4: the token line fades at its edge when scrolled (#399)
Some checks failed
CI / server (pull_request) Successful in 30s
CI / rust (pull_request) Successful in 3m0s
CI / web (pull_request) Failing after 43m31s
9e73419bc9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Replaced by #436 (search round 5), which carries everything here plus the hug, the keyboard motion, the shared lib/fit module and the Safari edge colours. Closing without merging.

Replaced by #436 (search round 5), which carries everything here plus the hug, the keyboard motion, the shared `lib/fit` module and the Safari edge colours. Closing without merging.
kayg closed this pull request 2026-10-15 11:27:53 +00:00
Some checks failed
CI / server (pull_request) Successful in 30s
CI / rust (pull_request) Successful in 3m0s
CI / web (pull_request) Failing after 43m31s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!416
No description provided.