Search r4: no bottom band, no kind row, natural-language filters, fits above the keyboard #399

Open
opened 2026-10-15 03:55:19 +00:00 by kayg · 6 comments
Owner

kayg, 2026-10-15, about the search r3 mockup on an iPhone (screenshots attached): "In general, I love search. I love how it looks." Then:

  1. Remove the bottom band with Date / Tag / Best match / 🗑. "They are not even action buttons," so they shouldn't be there.
  2. Not full-screen on mobile; keyboard-aware. With the keyboard and Safari's bar up, a lot of results get cut. Search should resize itself to fit the space above the keyboard bar, and grow back when the keyboard goes down.
  3. Remove the kind row (All / Notes / Journal / Photos / Files / Tags). Natural language goes into the query and is inferred instead. Examples: "before 2026-03-04", "after 2025-03-06", and likewise kinds and tags ("photos", "#travel", "last week"), recognised automatically and shown as recognised tokens in the field.
  4. Row actions on mobile: each search row gets swipe actions: insert a link to the item at the caret, copy the link, open. This becomes part of a general swipe-gesture system, researched and grilled in #400.

The screenshots also show:

  • (09:20) with the keyboard up, Safari's floating URL capsule and an iOS drag ghost ("Coffee and the Calternal rewrite plan" with a ✓) overlap the rows; a long press started a native drag;
  • (09:21) the long-press preview card.
    Check both while doing this.

Mockup first (preview.calternal.cloud/search.html), r4. Supersedes the band and kind-row parts of #330/#331/#352.

kayg, 2026-10-15, about the search r3 mockup on an iPhone (screenshots attached): "In general, I love search. I love how it looks." Then: 1. **Remove the bottom band** with Date / Tag / Best match / 🗑. "They are not even action buttons," so they shouldn't be there. 2. **Not full-screen on mobile; keyboard-aware.** With the keyboard and Safari's bar up, a lot of results get cut. Search should resize itself to fit the space above the keyboard bar, and grow back when the keyboard goes down. 3. **Remove the kind row** (All / Notes / Journal / Photos / Files / Tags). Natural language goes into the query and is inferred instead. Examples: "before 2026-03-04", "after 2025-03-06", and likewise kinds and tags ("photos", "#travel", "last week"), recognised automatically and shown as recognised tokens in the field. 4. **Row actions on mobile:** each search row gets swipe actions: insert a link to the item at the caret, copy the link, open. This becomes part of a general swipe-gesture system, researched and grilled in #400. The screenshots also show: - (09:20) with the keyboard up, Safari's floating URL capsule and an iOS drag ghost ("Coffee and the Calternal rewrite plan" with a ✓) overlap the rows; a long press started a native drag; - (09:21) the long-press preview card. Check both while doing this. Mockup first (preview.calternal.cloud/search.html), r4. Supersedes the band and kind-row parts of #330/#331/#352.
Author
Owner

kayg's grill answers, 2026-10-15:

  • S7: yes. Recognised words become inline tokens in the field; tap a token to turn it back into text.
  • S8: yes. English for now, with ISO and relative dates, kinds, #tags, pinned and in trash. "photos from Spiti" means kind Photos plus the text Spiti.
  • S9: yes. No sort control. Best match by default; "newest" and "oldest" switch the order.
  • S10: yes. No kind row and no band on desktop either; one search model everywhere.
  • S11: yes. The search interface is responsive and dynamic on desktop and phone. On phones it fits above the keyboard and grows back. kayg: "desktop already looks good".
  • S12: yes. 2 or 3 tappable example queries when the query is empty: "very easy and very intuitive UI everywhere".
  • S13: yes. A tap opens; swipe actions come after the #400 grill. kayg: "tap and hold already shows the preview which is amazing".
**kayg's grill answers, 2026-10-15:** - **S7:** yes. Recognised words become inline tokens in the field; tap a token to turn it back into text. - **S8:** yes. English for now, with ISO and relative dates, kinds, #tags, pinned and in trash. "photos from Spiti" means kind Photos plus the text Spiti. - **S9:** yes. No sort control. Best match by default; "newest" and "oldest" switch the order. - **S10:** yes. No kind row and no band on desktop either; one search model everywhere. - **S11:** yes. The search interface is responsive and dynamic on desktop and phone. On phones it fits above the keyboard and grows back. kayg: "desktop already looks good". - **S12:** yes. 2 or 3 tappable example queries when the query is empty: "very easy and very intuitive UI everywhere". - **S13:** yes. A tap opens; swipe actions come after the #400 grill. kayg: "tap and hold already shows the preview which is amazing".
Author
Owner

Search r4 on preview (PR #416)

Try it:

I backed up the site first (site.bak-399-202610150934). The other mockups are untouched.

What changed

  1. The bottom band is gone, and so is the kind row, on phone and desktop.
  2. Filter words become tokens in the field. Type photos from Spiti, and after the space "photos" becomes a Photos token while "from Spiti" stays as words. Only Spiti photos show.
    • Tap a token and it turns back into words, and they stay words.
    • Backspace at the start of the words turns the last token back into words to edit.
    • A word becomes a token when a space, a paste or a keyboard suggestion finishes it. Deleting never makes one.
    • Filter words you're still typing already narrow the results.
  3. What it recognises (English):
    • 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 (2026-03-04, 2026-03, 2025), a day and month (4 March, March 4 2025), or a relative date: today, yesterday, this / last / past week, month or year, last monday.
      • "in March" is the most recent March.
      • A month or weekday on its own stays a word, because "march" or "monday" can be ordinary search words.
    • Other filters: #tag (it includes its children), pinned, in trash, newest, oldest.
    • Joining words like "from", "about" or "and" next to a filter are read as part of the sentence and not searched for.
    • "Quoted words" are never filters.
  4. No sort control. Best match is the default; "newest" or "oldest" reorders the results.
  5. Phone: 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 springs back when the keyboard goes down, and scrolling the results puts the keyboard away. Desktop keeps r3's layout.
  6. An empty field shows recent things plus three examples to tap. The filter words in each example show in the accent. After you've typed three filter words of your own, the examples stop showing.
  7. Rows: a tap opens and a long press shows the preview. A held row never starts the system's drag ghost, callout or text selection, and lifting your finger after a long press doesn't open the row.

The parser is a small pure module, packages/ui/src/search/words.ts, so the real app can reuse it. Its 34 unit tests run in CI.

How it fits above the keyboard (sources)

  • iOS doesn't resize the page for the keyboard. It only shrinks the visual viewport, and it ignores interactive-widget=resizes-content. Safari has no VirtualKeyboard API (env(keyboard-inset-height)) either. Sources: WebKit 230225, Chrome's viewport-resize notes.
  • So the panel reads visualViewport. Its top is offsetTop and its bottom is offsetTop + height, never below 100svh.
  • Reading twice. The first resize can report a stale offsetTop (WebKit 237851), so every change is read again on the next frame and once more 80 ms later.
  • iOS 26 can leave the visual viewport short after the keyboard goes down (WebKit 297779, Apple forums 800125). When nothing is focused for typing, there can't be a keyboard, so the panel uses the whole page.
  • iOS 26 doesn't draw fixed content below its floating controls (Apple forums 800798). The panel ends at 100svh or above, never under them.
  • Home Screen apps have been reported to stay shrunk after the first keyboard (report, WebKit 218983). The focus rule above should cover that too. Checklist item 5 tests it.
  • Pinch zoom: while zoomed in, the last good size stays.
  • The field is 17 px, so iOS never zooms the page when the field gets focus.
  • Drag ghost and callout: cancelling touchstart would also stop the list scrolling from a row (WebKit 231161; its reporter rejected that fix for the same reason). Rows cancel dragstart and selectstart instead, and set -webkit-user-drag: none on the row and its thumbnail. A non-passive touchmove and touchend take over only after the long press fires. -webkit-touch-callout alone has been reported ignored on iOS 26.1 (Apple forums 808606). Checklist items 13 and 14 cover this.

None of this can be proved in emulated WebKit; please run the checklist on the iPhone.

Device checklist (real iPhone; emulated WebKit can't show any of this)

Open https://preview.calternal.cloud/search.html#/list/journal and tap search (or pull down).

  1. Safari tab, iOS 26, keyboard up. The panel's bottom edge sits about 8 px above the keyboard's suggestion bar. No rows hide behind the keyboard, and nothing hides behind the floating address capsule.
  2. Keyboard down by scrolling the results. The keyboard goes away, and the panel springs back down to just above the home indicator and Safari's bar. Repeat 5 times; it never stays short.
  3. Keyboard down with the keyboard's own ⌄ key, and with Cancel then reopen. Same as 2.
  4. Toolbar collapsed first. Scroll a list so Safari's bar shrinks, then open search. The panel never ends under the bar, and there's no strip of empty glass at the bottom.
  5. Home Screen app. Open, type, scroll to dismiss, and repeat. The panel grows all the way back each time, with no black band at the bottom.
  6. Rotate with the keyboard up and down. After a moment the panel fits again.
  7. Emoji keyboard and dictation. Switching keyboards changes the height; the panel follows within a frame or two.
  8. Pinch zoom while search is open. The panel doesn't jump while you're zoomed in, and fits again at normal size.
  9. Type photos from Spiti. After the space, "photos" turns into a Photos token and "from Spiti" stays as words. Only Spiti photos show.
  10. Pick a word from the suggestion bar (for example "photos"). It becomes a token just as typing the space does.
  11. Tap the token. It turns back into the word "photos" and stays a word, even after more typing.
  12. Backspace at the start of the words. The last token turns back into editable words.
  13. Long-press a row. The preview card comes up, with no drag ghost, no callout or menu, and no text selection. Lifting your finger doesn't open the row; tapping the card does.
  14. Scroll a long list starting on a row. It scrolls normally (the hold guard mustn't block scrolling).
  15. Font size. The field never zooms the page when it takes focus (it is 17 px).

Screenshots (my own, Chromium)

Phone strips, left to right:

  1. empty, with the examples;
  2. the "photos from Spiti" example tapped;
  3. run before 2026-09-01 #area/health newest typed, with the line scrolled to the words;
  4. a token tapped back into words;
  5. the keyboard up (a simulated 336 px keyboard; visualViewport shrunk);
  6. the keyboard down, grown back;
  7. the long-press preview.

Desktop strips, left to right: empty, the example, typed, a long list.

320 light / dark
chromium-320-light.png
chromium-320-dark.png

360 light / dark
chromium-360-light.png
chromium-360-dark.png

375 light / dark
chromium-375-light.png
chromium-375-dark.png

390 light / dark
chromium-390-light.png
chromium-390-dark.png

900 light / dark
chromium-900-light.png
chromium-900-dark.png

1440 light / dark
chromium-1440-light.png
chromium-1440-dark.png

WebKit, 390 and 1440 (layout only: this headless WebKit draws no blur, so the app shows through the glass):
webkit-390-light.png
webkit-1440-dark.png

Grow-back, measured (panel height after the keyboard goes down at 390, in px): 494 at 0 ms, 587 at 60 ms, 748 at 140 ms, 821 at 260 ms, 830 at 500 ms. Shrinking is instant.

Questions for you

  1. When a word becomes a token: right now it happens on the space after it, so "photos" turns into a token as you press space. Should it wait until you open a result instead? That's less magic, but you see the token later.
  2. A month or weekday on its own stays a word ("march", "monday"). Only "in March", "on monday", "March 2025" and "last monday" are dates. Is that right, or should a bare month also be a date?
  3. "last week" means the calendar week before this one (Mon–Sun), and "past week" means the last 7 days. OK?
  4. "in trash" shows only what's in the Trash (r3's Trash pill added the Trash to the results). OK?
  5. At 320 with three or more tokens, the field scrolls sideways and fades at its left edge. Would you rather the tokens shrink to icons once space runs out?
## Search r4 on preview (PR #416) **Try it:** - **Empty field, with the examples:** https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&examples=1 - **Typed searches:** [photos from Spiti](https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&q=photos%20from%20Spiti) · [days last week](https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&q=days%20last%20week) · [#area/health newest](https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&q=%23area/health%20newest) · [run before 2026-09-01](https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&q=run%20before%202026-09-01) - **On the phone:** https://preview.calternal.cloud/search.html#/list/journal, then tap search or pull down. I backed up the site first (`site.bak-399-202610150934`). The other mockups are untouched. **What changed** 1. **The bottom band is gone, and so is the kind row,** on phone and desktop. 2. **Filter words become tokens in the field.** Type `photos from Spiti`, and after the space "photos" becomes a **Photos** token while "from Spiti" stays as words. Only Spiti photos show. - Tap a token and it turns back into words, and they stay words. - Backspace at the start of the words turns the last token back into words to edit. - A word becomes a token when a space, a paste or a keyboard suggestion finishes it. Deleting never makes one. - Filter words you're still typing already narrow the results. 3. **What it recognises** (English): - **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 (`2026-03-04`, `2026-03`, `2025`), a day and month (`4 March`, `March 4 2025`), or a relative date: today, yesterday, this / last / past week, month or year, last monday. - "in March" is the most recent March. - A month or weekday on its own stays a word, because "march" or "monday" can be ordinary search words. - **Other filters:** `#tag` (it includes its children), pinned, in trash, newest, oldest. - **Joining words** like "from", "about" or "and" next to a filter are read as part of the sentence and not searched for. - **"Quoted words"** are never filters. 4. **No sort control.** Best match is the default; "newest" or "oldest" reorders the results. 5. **Phone:** 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 springs back when the keyboard goes down, and scrolling the results puts the keyboard away. Desktop keeps r3's layout. 6. **An empty field** shows recent things plus three examples to tap. The filter words in each example show in the accent. After you've typed three filter words of your own, the examples stop showing. 7. **Rows:** a tap opens and a long press shows the preview. A held row never starts the system's drag ghost, callout or text selection, and lifting your finger after a long press doesn't open the row. The parser is a small pure module, `packages/ui/src/search/words.ts`, so the real app can reuse it. Its 34 unit tests run in CI. ### How it fits above the keyboard (sources) - **iOS doesn't resize the page for the keyboard.** It only shrinks the visual viewport, and it ignores `interactive-widget=resizes-content`. Safari has no VirtualKeyboard API (`env(keyboard-inset-height)`) either. Sources: [WebKit 230225](https://bugs.webkit.org/show_bug.cgi?id=230225), [Chrome's viewport-resize notes](https://developer.chrome.com/blog/viewport-resize-behavior). - So the panel reads `visualViewport`. Its top is `offsetTop` and its bottom is `offsetTop + height`, never below `100svh`. - **Reading twice.** The first resize can report a stale `offsetTop` ([WebKit 237851](https://bugs.webkit.org/show_bug.cgi?id=237851)), so every change is read again on the next frame and once more 80 ms later. - **iOS 26 can leave the visual viewport short after the keyboard goes down** ([WebKit 297779](https://bugs.webkit.org/show_bug.cgi?id=297779), [Apple forums 800125](https://developer.apple.com/forums/thread/800125)). When nothing is focused for typing, there can't be a keyboard, so the panel uses the whole page. - **iOS 26 doesn't draw fixed content below its floating controls** ([Apple forums 800798](https://developer.apple.com/forums/thread/800798)). The panel ends at `100svh` or above, never under them. - **Home Screen apps** have been reported to stay shrunk after the first keyboard ([report](https://dev.to/cederhook/fixing-the-ios-standalone-pwa-keyboard-bug-that-shrinks-your-viewport-for-good-63d), [WebKit 218983](https://bugs.webkit.org/show_bug.cgi?id=218983)). The focus rule above should cover that too. Checklist item 5 tests it. - **Pinch zoom:** while zoomed in, the last good size stays. - **The field is 17 px,** so iOS never zooms the page when the field gets focus. - **Drag ghost and callout:** cancelling `touchstart` would also stop the list scrolling from a row ([WebKit 231161](https://bugs.webkit.org/show_bug.cgi?id=231161); its reporter rejected that fix for the same reason). Rows cancel `dragstart` and `selectstart` instead, and set `-webkit-user-drag: none` on the row and its thumbnail. A non-passive `touchmove` and `touchend` take over only after the long press fires. `-webkit-touch-callout` alone has been reported ignored on iOS 26.1 ([Apple forums 808606](https://developer.apple.com/forums/thread/808606)). Checklist items 13 and 14 cover this. None of this can be proved in emulated WebKit; please run the checklist on the iPhone. ### Device checklist (real iPhone; emulated WebKit can't show any of this) Open https://preview.calternal.cloud/search.html#/list/journal and tap search (or pull down). 1. **Safari tab, iOS 26, keyboard up.** The panel's bottom edge sits about 8 px above the keyboard's suggestion bar. No rows hide behind the keyboard, and nothing hides behind the floating address capsule. 2. **Keyboard down by scrolling the results.** The keyboard goes away, and the panel springs back down to just above the home indicator and Safari's bar. Repeat 5 times; it never stays short. 3. **Keyboard down with the keyboard's own ⌄ key, and with Cancel then reopen.** Same as 2. 4. **Toolbar collapsed first.** Scroll a list so Safari's bar shrinks, then open search. The panel never ends under the bar, and there's no strip of empty glass at the bottom. 5. **Home Screen app.** Open, type, scroll to dismiss, and repeat. The panel grows all the way back each time, with no black band at the bottom. 6. **Rotate** with the keyboard up and down. After a moment the panel fits again. 7. **Emoji keyboard and dictation.** Switching keyboards changes the height; the panel follows within a frame or two. 8. **Pinch zoom** while search is open. The panel doesn't jump while you're zoomed in, and fits again at normal size. 9. **Type `photos from Spiti`.** After the space, "photos" turns into a Photos token and "from Spiti" stays as words. Only Spiti photos show. 10. **Pick a word from the suggestion bar** (for example "photos"). It becomes a token just as typing the space does. 11. **Tap the token.** It turns back into the word "photos" and stays a word, even after more typing. 12. **Backspace at the start of the words.** The last token turns back into editable words. 13. **Long-press a row.** The preview card comes up, with no drag ghost, no callout or menu, and no text selection. Lifting your finger doesn't open the row; tapping the card does. 14. **Scroll a long list starting on a row.** It scrolls normally (the hold guard mustn't block scrolling). 15. **Font size.** The field never zooms the page when it takes focus (it is 17 px). ### Screenshots (my own, Chromium) **Phone strips, left to right:** 1. empty, with the examples; 2. the "photos from Spiti" example tapped; 3. `run before 2026-09-01 #area/health newest ` typed, with the line scrolled to the words; 4. a token tapped back into words; 5. the keyboard up (a simulated 336 px keyboard; `visualViewport` shrunk); 6. the keyboard down, grown back; 7. the long-press preview. **Desktop strips, left to right:** empty, the example, typed, a long list. **320** light / dark ![chromium-320-light.png](https://git.kayg.org/attachments/a13192a6-a7e6-42f1-bd0b-cc6f500af8bc) ![chromium-320-dark.png](https://git.kayg.org/attachments/7a612f0d-0e09-4188-945f-31b4a60d8b4f) **360** light / dark ![chromium-360-light.png](https://git.kayg.org/attachments/308bb7a0-21cf-4f1d-8567-591cf6c6e80b) ![chromium-360-dark.png](https://git.kayg.org/attachments/e9581303-e3ae-4835-bcff-61057bad4e3d) **375** light / dark ![chromium-375-light.png](https://git.kayg.org/attachments/e1d8770c-8cc5-49a5-a966-f76514240910) ![chromium-375-dark.png](https://git.kayg.org/attachments/ff313b8d-0a01-46bb-867c-b0ba30126855) **390** light / dark ![chromium-390-light.png](https://git.kayg.org/attachments/df8b43c1-e9ee-4e26-bfbd-7cfa1c20279e) ![chromium-390-dark.png](https://git.kayg.org/attachments/ea3f735f-f13f-4db2-b7c1-395969f07ed4) **900** light / dark ![chromium-900-light.png](https://git.kayg.org/attachments/14d15511-e809-4bb0-82f2-2fcc1e55becb) ![chromium-900-dark.png](https://git.kayg.org/attachments/585f795c-b687-4b75-9ccf-b4e21bb55acb) **1440** light / dark ![chromium-1440-light.png](https://git.kayg.org/attachments/619fb9e3-0230-46c0-ad5e-cd28d431b21c) ![chromium-1440-dark.png](https://git.kayg.org/attachments/c05cea6b-80a1-48c9-9637-bd15b6c7861a) **WebKit, 390 and 1440** (layout only: this headless WebKit draws no blur, so the app shows through the glass): ![webkit-390-light.png](https://git.kayg.org/attachments/64af3255-c598-41c9-943e-ba2824380eef) ![webkit-1440-dark.png](https://git.kayg.org/attachments/7e0a4e99-76c6-47a2-b82f-de4a64fd6b8b) **Grow-back, measured** (panel height after the keyboard goes down at 390, in px): 494 at 0 ms, 587 at 60 ms, 748 at 140 ms, 821 at 260 ms, 830 at 500 ms. Shrinking is instant. ### Questions for you 1. **When a word becomes a token:** right now it happens on the space after it, so "photos" turns into a token as you press space. Should it wait until you open a result instead? That's less magic, but you see the token later. 2. **A month or weekday on its own stays a word** ("march", "monday"). Only "in March", "on monday", "March 2025" and "last monday" are dates. Is that right, or should a bare month also be a date? 3. **"last week" means the calendar week before this one** (Mon–Sun), and "past week" means the last 7 days. OK? 4. **"in trash" shows only what's in the Trash** (r3's Trash pill added the Trash to the results). OK? 5. **At 320 with three or more tokens,** the field scrolls sideways and fades at its left edge. Would you rather the tokens shrink to icons once space runs out?
Author
Owner

kayg, 2026-10-15: S14–S18 accepted as recommended:

  • S14: a word becomes a token on the space after it.
  • S15: a month on its own stays a plain word.
  • S16: "last week" means the previous Monday to Sunday, and "past week" means the last 7 days.
  • S17: "in trash" shows only Trash.
  • S18: at 320, compact tokens with a sideways scroll.

Also fix the two things I saw: the placeholder is clipped at 390 (use "Search everything" on phones), and leftover words show highlighted after a URL query.

**kayg, 2026-10-15:** S14–S18 accepted as recommended: - **S14:** a word becomes a token on the space after it. - **S15:** a month on its own stays a plain word. - **S16:** "last week" means the previous Monday to Sunday, and "past week" means the last 7 days. - **S17:** "in trash" shows only Trash. - **S18:** at 320, compact tokens with a sideways scroll. Also fix the two things I saw: the placeholder is clipped at 390 (use "Search everything" on phones), and leftover words show highlighted after a URL query.
Author
Owner

kayg, 2026-10-15, after trying r4 on an iPhone:

  1. "Even though there are like 4 results, the search interface does not automatically become shorter. I think that's what I meant by the search interface being dynamic and responsive." The panel should hug its content: height = content, capped by the space available above the keyboard (or the screen), and it changes smoothly as results come and go.
  2. Dismissing the keyboard by scrolling: "it felt different because the animation is too fast, or like, not polished enough." The panel's resize when the keyboard goes down or up must feel physical and match the keyboard's own motion, not snap.
    (kayg's message was cut off after this; the rest is pending.)
**kayg, 2026-10-15, after trying r4 on an iPhone:** 1. "Even though there are like 4 results, the search interface does not automatically become shorter. I think that's what I meant by the search interface being dynamic and responsive." The panel should hug its content: height = content, capped by the space available above the keyboard (or the screen), and it changes smoothly as results come and go. 2. Dismissing the keyboard by scrolling: "it felt different because the animation is too fast, or like, not polished enough." The panel's resize when the keyboard goes down or up must feel physical and match the keyboard's own motion, not snap. (kayg's message was cut off after this; the rest is pending.)
Author
Owner

kayg, 2026-10-15 (S19): keep "scrolling dismisses the keyboard" for now. kayg: "that's also what iOS mail does... We can keep this behavior for a while, and if it bothers me, we can flick it." Make the dismissal animation smoother and more polished, so it feels natural.

**kayg, 2026-10-15 (S19):** keep "scrolling dismisses the keyboard" for now. kayg: "that's also what iOS mail does... We can keep this behavior for a while, and if it bothers me, we can flick it." Make the dismissal animation smoother and more polished, so it feels natural.
Author
Owner

Search r5 on preview (PR #436; replaces #416)

Try it on the iPhone: https://preview.calternal.cloud/search.html#/list/journal, then tap search. On a wide screen: https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&examples=1. I backed up the site first (site.bak-399r5-202610151327).

What changed

  1. The panel hugs its content (phone). It's as tall as the field plus whatever is showing: examples and recents, results, or just "Nothing matches". It's never taller than the room above the keyboard, or the screen when the keyboard is down. When results come and go it changes size on a soft spring.
    • No re-layout per frame: the panel is laid out once at full height. A spring moves a clip on the glass and the words (paint only) and a vertical scale on its shadow layer (a transform).
    • Long lists: while the keyboard is up, the list pads its end so the last row can scroll above the keyboard.
    • Desktop is unchanged: the panel keeps its size there, because of the preview pane.
  2. Keyboard motion (S19: scrolling still dismisses the keyboard, as in Mail).
    • The panel doesn't wait for Safari. With the address bar at the bottom (iOS 26's default), Safari reports the visual viewport's new size only at the end of the keyboard's animation (WebKit 265578). While a finger drags with the keyboard up, it reports sizes that aren't real (WebKit 226689). Following those numbers gave r4 its late, abrupt jump. With the toolbar collapsed or in the Home Screen app it reports at once.
    • Dismissing: the blur comes first and the keyboard starts leaving as the field loses focus. On that blur, from a scroll, the ⌄ key or Cancel, the panel starts growing in the same frame, on a spring with no overshoot that settles in about a third of a second. That's tuned to iOS's keyboard, whose curve behaves like an overdamped spring (Apple forums 48088). Safari's late report then lands on the same target, so there's no second jump.
    • Showing: the first time, the panel shrinks when Safari reports the keyboard (the keyboard covers that edge meanwhile). After that it remembers the keyboard's height, so on focus it moves up together with the keyboard, and Safari's report only corrects it.
    • Stale reads: iOS can report stale numbers on the first resize (WebKit 237851), so the size is read again 80 ms later and once more after the keyboard has finished.
    • iOS 26 leaving the viewport short: after the keyboard goes down, iOS 26 can leave the viewport a little short (WebKit 297779). With nothing focused to type into there's no keyboard, so the panel takes the whole page.
    • Why not a CSS transition on the height: the iOS keyboard can't be tracked frame by frame from a web page (no VirtualKeyboard API, and interactive-widget is ignored: WebKit 230225). The best a page can do is start at the same moment as the keyboard, on a similar curve.
  3. "Search everything" is the placeholder on phones, and it fits at 320.
  4. A link opens search with its words not selected. The highlight you saw was the field selecting its text on open.
  5. S18: under 360 px, tokens drop their icons to fit more.
  6. The keyboard's ⌃ ⌄ ✓ bar: a web page can't remove it in Safari.
    • Only a native app hosting the page can hide it (a WebKit option for apps, WebKit 155574; Capacitor's keyboard plugin uses it). WebKit dropped the bar only for visionOS's form controls (WebKit 246176).
    • What a page can do is give the arrows nowhere to go. While search is open, the app behind it is now inert (search is a modal dialog, so this is right for VoiceOver too). The search field is then the only field, so ⌃ ⌄ should be greyed out. I can't test that without a device; checklist item 17 covers it.
    • Separately, the bar shrinks to a slim strip when a hardware keyboard is attached.
  7. Safari's top and bottom are tinted to match the page, as in the app (#396 / PR #405).
    • Why it was wrong: the mockup still published old --edge-top / --edge-bottom values that nothing reads any more, so Safari tinted its bars paper over a sky backdrop.
    • Now: the mockup publishes --sky-edge like the app, and the phone's list screens set data-edge with the glass's own colour and melt into it at the top and bottom. On the Home Screen the app is sized by the real screen (WebKit 301994), with no strips.
    • Shared code: glass-edge.ts and home-screen.ts move to packages/ui, so the app and the mockup share them; the app re-exports them, so its imports are unchanged. This PR is stacked on #405.
  8. Shared with Views (#312): the hug and keyboard logic is now apps/mockup/src/lib/fit/ (hug.ts and viewport.svelte.ts), for any floating panel.
  9. A tap on the app below a short panel closes search on a phone, as the dim does on desktop.

Frame strips at 390 (real time; my own)

Recorded in Chromium's screencast while it runs at full speed. The numbers under each strip are milliseconds after the trigger, and the "edge" lines give the panel's visible bottom (px) from the page's own per-frame log.

The keyboard is simulated:

  • it's drawn see-through, with a red top edge, and slides over 300 ms;
  • it starts when the field gains or loses focus, as iOS's does;
  • the simulated Safari reports its size 300 ms late, as Safari does with its bar at the bottom.

This machine renders without a GPU, so the strips have few frames. Judge the feel on the iPhone.

1. Hugging: from the recent list to "photos from Spiti" (4 rows), soft spring (light, then dark): edge 828 → 718 → 418 → 326 px over about 0.9 s.
frames-light-1-hug-shrink.png
frames-dark-1-hug-shrink.png

2. Growing back when the field is cleared:
frames-light-2-hug-grow.png

3. "Nothing matches": just the field and the line (settles at 144 px):
frames-light-3-nothing.png

4. Keyboard down by scrolling the list. The panel starts growing on the blur, with the keyboard, before Safari's late report, and keeps its edge just above the keyboard's top as it slides away:
frames-light-5-scroll-dismiss.png
frames-dark-5-scroll-dismiss.png

5. Keyboard down with the keyboard's ⌄ key (a plain blur):
frames-light-7-hide-key.png

6. Keyboard up, first time: Safari's late report is all there is, so the panel follows it. The keyboard covers that edge meanwhile.
frames-light-4-keyboard-up-first.png

7. Keyboard up after that: the panel remembers the keyboard's height and rises with it:
frames-light-6-keyboard-up-again.png
frames-dark-6-keyboard-up-again.png

Screenshots at every width (Chromium; light and dark)

Phone strips, left to right: empty, "photos from Spiti", typed tokens, keyboard up, keyboard down, few results (hug), "Nothing matches" (hug), long-press preview. Desktop strips: empty, example, typed, long list (unchanged layout).

320: chromium-320-light.png chromium-320-dark.png
360: chromium-360-light.png chromium-360-dark.png
375: chromium-375-light.png chromium-375-dark.png
390: chromium-390-light.png chromium-390-dark.png
900: chromium-900-light.png chromium-900-dark.png
1440: chromium-1440-light.png chromium-1440-dark.png
WebKit 390 and 1440 (layout only; this headless WebKit draws no blur): webkit-390-light.png webkit-1440-dark.png

Checks: all pass in Chromium (6 widths) and WebKit (390, 1440), light and dark, with no page errors. They cover:

  • the visible edge 8 px above the keyboard;
  • the last row scrolling above the keyboard;
  • growing back fully;
  • hugging a few rows and "Nothing matches";
  • the placeholder fitting;
  • no words selected after a link.

Unit tests: 66 of 66. apps/web check: 0 errors, and both apps build.

Device checklist, round 5 (real iPhone; please run each in a Safari tab and in the Home Screen app)

Open https://preview.calternal.cloud/search.html#/list/journal and tap search.

Hugging

  1. Empty field: the panel is as tall as the examples plus Recent and no taller. With the keyboard up, it stops 8 px above the keyboard.
  2. Type kunzum: the panel shrinks around the one or two rows on a soft spring. Clear the field and it grows back the same way. Typing fast never makes it jitter or jump.
  3. Type zzqx: the panel is just the field plus "Nothing matches", rounded at the bottom.
  4. Round edges: the panel's bottom corners stay round at every size, and its shadow follows the bottom edge.

The keyboard going down (the main one)
5. Type calternal, then scroll the results: the keyboard goes down, and the panel's bottom edge moves down with it at the same moment and the same pace, settling without a bounce. There's no pause before it moves and no second jump when Safari catches up.
6. The keyboard's own ⌄ key: the same.
7. Cancel, then open again: no leftover gap at the bottom, and no short panel.
8. The address bar at the bottom (iOS 26 default), then with the bar collapsed by scrolling a list first: the same in both. In the second case Safari reports at once, and the prediction and the report agree.

The keyboard coming up
9. Tap the field the first time after loading: the panel shrinks to the keyboard's top, at the latest when the keyboard finishes. Nothing hides under the keyboard afterwards.
10. Every time after that: the panel's edge moves up with the keyboard as it rises (it remembers the keyboard's height).
11. Switch to the emoji keyboard, or start dictation: the panel follows the new height on the same spring.

Still right from round 4
12. Long list, keyboard up: scroll to the end; the last row comes fully above the keyboard.
13. Long-press a row: the preview shows, with no drag ghost, callout or selection, and scrolling that starts on a row still works.
14. The placeholder reads "Search everything" and isn't cut off.
15. A link with words (for example the "photos from Spiti" link above) opens with the words not highlighted.
16. At 320 (an iPhone SE in zoomed display): the tokens show words only, and the line scrolls sideways.

Edges and the keyboard's bar
17. With search open and the keyboard up: the ⌃ ⌄ arrows on the bar above the keyboard are greyed out, because the search field is the only field. The bar itself stays; a web page can't remove it.
18. Safari tab, sky backdrop, on a list: the strip behind the status bar and the strip around Safari's bottom bar are the glass's colour, with no paper-coloured band. Open a note: they turn paper.
19. Home Screen app: the glass and the sky run to both edges, with no flat strip at the top or bottom, and the search panel still ends above the keyboard.

Questions for you

  1. Desktop doesn't hug (the preview pane needs the height). Should it hug when there's no preview, for example when nothing matches?
  2. The first time the keyboard comes up in a session, the panel can only follow Safari's late report. After that it moves with the keyboard. Is the first time acceptable, or should it guess a typical keyboard height (about 336 pt on a 6.1" iPhone) on the very first focus?
  3. Tapping the app below a short panel closes search on a phone. Keep that, or should taps there do nothing?
## Search r5 on preview (PR #436; replaces #416) **Try it on the iPhone:** https://preview.calternal.cloud/search.html#/list/journal, then tap search. On a wide screen: https://preview.calternal.cloud/search.html#/note/2026-10-13?list=journal&find=1&examples=1. I backed up the site first (`site.bak-399r5-202610151327`). ### What changed 1. **The panel hugs its content** (phone). It's as tall as the field plus whatever is showing: examples and recents, results, or just "Nothing matches". It's never taller than the room above the keyboard, or the screen when the keyboard is down. When results come and go it changes size on a soft spring. - **No re-layout per frame:** the panel is laid out once at full height. A spring moves a clip on the glass and the words (paint only) and a vertical scale on its shadow layer (a transform). - **Long lists:** while the keyboard is up, the list pads its end so the last row can scroll above the keyboard. - **Desktop is unchanged:** the panel keeps its size there, because of the preview pane. 2. **Keyboard motion (S19: scrolling still dismisses the keyboard, as in Mail).** - **The panel doesn't wait for Safari.** With the address bar at the bottom (iOS 26's default), Safari reports the visual viewport's new size only at the *end* of the keyboard's animation ([WebKit 265578](https://bugs.webkit.org/show_bug.cgi?id=265578)). While a finger drags with the keyboard up, it reports sizes that aren't real ([WebKit 226689](https://bugs.webkit.org/show_bug.cgi?id=226689)). Following those numbers gave r4 its late, abrupt jump. With the toolbar collapsed or in the Home Screen app it reports at once. - **Dismissing:** the blur comes first and the keyboard starts leaving as the field loses focus. On that blur, from a scroll, the ⌄ key or Cancel, the panel starts growing in the same frame, on a spring with no overshoot that settles in about a third of a second. That's tuned to iOS's keyboard, whose curve behaves like an overdamped spring ([Apple forums 48088](https://developer.apple.com/forums/thread/48088)). Safari's late report then lands on the same target, so there's no second jump. - **Showing:** the first time, the panel shrinks when Safari reports the keyboard (the keyboard covers that edge meanwhile). After that it remembers the keyboard's height, so on focus it moves up together with the keyboard, and Safari's report only corrects it. - **Stale reads:** iOS can report stale numbers on the first resize ([WebKit 237851](https://bugs.webkit.org/show_bug.cgi?id=237851)), so the size is read again 80 ms later and once more after the keyboard has finished. - **iOS 26 leaving the viewport short:** after the keyboard goes down, iOS 26 can leave the viewport a little short ([WebKit 297779](https://bugs.webkit.org/show_bug.cgi?id=297779)). With nothing focused to type into there's no keyboard, so the panel takes the whole page. - **Why not a CSS transition on the height:** the iOS keyboard can't be tracked frame by frame from a web page (no VirtualKeyboard API, and `interactive-widget` is ignored: [WebKit 230225](https://bugs.webkit.org/show_bug.cgi?id=230225)). The best a page can do is start at the same moment as the keyboard, on a similar curve. 3. **"Search everything"** is the placeholder on phones, and it fits at 320. 4. **A link opens search with its words not selected.** The highlight you saw was the field selecting its text on open. 5. **S18:** under 360 px, tokens drop their icons to fit more. 6. **The keyboard's ⌃ ⌄ ✓ bar:** a web page can't remove it in Safari. - Only a native app hosting the page can hide it (a WebKit option for apps, [WebKit 155574](https://bugs.webkit.org/show_bug.cgi?id=155574); [Capacitor's keyboard plugin](https://forum.ionicframework.com/t/hiding-accessory-bar-ios/117199) uses it). WebKit dropped the bar only for visionOS's form controls ([WebKit 246176](https://bugs.webkit.org/show_bug.cgi?id=246176)). - What a page *can* do is give the arrows nowhere to go. While search is open, the app behind it is now `inert` (search is a modal dialog, so this is right for VoiceOver too). The search field is then the only field, so ⌃ ⌄ should be greyed out. I can't test that without a device; checklist item 17 covers it. - Separately, the bar shrinks to a slim strip when a hardware keyboard is attached. 7. **Safari's top and bottom are tinted to match the page, as in the app (#396 / PR #405).** - **Why it was wrong:** the mockup still published old `--edge-top` / `--edge-bottom` values that nothing reads any more, so Safari tinted its bars paper over a sky backdrop. - **Now:** the mockup publishes `--sky-edge` like the app, and the phone's list screens set `data-edge` with the glass's own colour and melt into it at the top and bottom. On the Home Screen the app is sized by the real screen (WebKit 301994), with no strips. - **Shared code:** `glass-edge.ts` and `home-screen.ts` move to `packages/ui`, so the app and the mockup share them; the app re-exports them, so its imports are unchanged. This PR is stacked on #405. 8. **Shared with Views (#312):** the hug and keyboard logic is now `apps/mockup/src/lib/fit/` (`hug.ts` and `viewport.svelte.ts`), for any floating panel. 9. **A tap on the app below a short panel closes search** on a phone, as the dim does on desktop. ### Frame strips at 390 (real time; my own) Recorded in Chromium's screencast while it runs at full speed. The numbers under each strip are milliseconds after the trigger, and the "edge" lines give the panel's visible bottom (px) from the page's own per-frame log. The keyboard is simulated: - it's drawn see-through, with a red top edge, and slides over 300 ms; - it starts when the field gains or loses focus, as iOS's does; - the simulated Safari reports its size 300 ms late, as Safari does with its bar at the bottom. This machine renders without a GPU, so the strips have few frames. Judge the feel on the iPhone. **1. Hugging: from the recent list to "photos from Spiti" (4 rows), soft spring** (light, then dark): edge 828 → 718 → 418 → 326 px over about 0.9 s. ![frames-light-1-hug-shrink.png](https://git.kayg.org/attachments/cc648600-1015-4a6f-9fb6-ada2ee631957) ![frames-dark-1-hug-shrink.png](https://git.kayg.org/attachments/41ed6fa0-d716-43ea-b560-85c74b464394) **2. Growing back when the field is cleared:** ![frames-light-2-hug-grow.png](https://git.kayg.org/attachments/9790c428-3730-442f-baf9-aa4db1fac503) **3. "Nothing matches": just the field and the line** (settles at 144 px): ![frames-light-3-nothing.png](https://git.kayg.org/attachments/10266474-f136-4e49-a40b-9c1ed21e3dfe) **4. Keyboard down by scrolling the list.** The panel starts growing on the blur, with the keyboard, before Safari's late report, and keeps its edge just above the keyboard's top as it slides away: ![frames-light-5-scroll-dismiss.png](https://git.kayg.org/attachments/629ea43e-24bb-4ae2-a53a-79331c09b5ae) ![frames-dark-5-scroll-dismiss.png](https://git.kayg.org/attachments/e96ca448-fb44-4ec1-8e68-60fa3e7bce4d) **5. Keyboard down with the keyboard's ⌄ key (a plain blur):** ![frames-light-7-hide-key.png](https://git.kayg.org/attachments/9d4c3c1c-468c-4d68-841e-b8959b5f9910) **6. Keyboard up, first time:** Safari's late report is all there is, so the panel follows it. The keyboard covers that edge meanwhile. ![frames-light-4-keyboard-up-first.png](https://git.kayg.org/attachments/2c5bd58b-577b-433d-bfa4-53812b5e2baa) **7. Keyboard up after that:** the panel remembers the keyboard's height and rises with it: ![frames-light-6-keyboard-up-again.png](https://git.kayg.org/attachments/56de2cd2-0729-4747-9e13-1a8560ff3e7b) ![frames-dark-6-keyboard-up-again.png](https://git.kayg.org/attachments/cbd85edd-48d6-439b-8c85-d245948f5192) ### Screenshots at every width (Chromium; light and dark) **Phone strips, left to right:** empty, "photos from Spiti", typed tokens, keyboard up, keyboard down, few results (hug), "Nothing matches" (hug), long-press preview. **Desktop strips:** empty, example, typed, long list (unchanged layout). **320:** ![chromium-320-light.png](https://git.kayg.org/attachments/97e5d721-f0f3-487c-9289-0b2c5b1b3451) ![chromium-320-dark.png](https://git.kayg.org/attachments/e6930970-34bb-4b0c-a2ea-e04028e5c523) **360:** ![chromium-360-light.png](https://git.kayg.org/attachments/45e70ca0-2847-4c3e-8307-08a71f803c69) ![chromium-360-dark.png](https://git.kayg.org/attachments/59b80330-cc3a-4e82-b76b-d82394b5ffea) **375:** ![chromium-375-light.png](https://git.kayg.org/attachments/6d76f749-7cbf-4201-99e2-534d9ab7f220) ![chromium-375-dark.png](https://git.kayg.org/attachments/0e671678-64fc-4817-b897-bcbf11d02769) **390:** ![chromium-390-light.png](https://git.kayg.org/attachments/d02ea0ab-037e-43b8-83a6-eea66dfc1045) ![chromium-390-dark.png](https://git.kayg.org/attachments/e9debb73-d4f0-4915-bb4d-9da065d99116) **900:** ![chromium-900-light.png](https://git.kayg.org/attachments/c5052f80-2935-44ef-aa88-25e960a1f197) ![chromium-900-dark.png](https://git.kayg.org/attachments/5c5364e9-fe5d-4428-bcff-2712ae78fa6b) **1440:** ![chromium-1440-light.png](https://git.kayg.org/attachments/102b98be-5afa-48ef-9353-08488a23f535) ![chromium-1440-dark.png](https://git.kayg.org/attachments/ca61a8cd-ae1b-4520-8141-1b2287f70c08) **WebKit 390 and 1440** (layout only; this headless WebKit draws no blur): ![webkit-390-light.png](https://git.kayg.org/attachments/297b0871-4e8c-499c-ae2e-01fb585b9a25) ![webkit-1440-dark.png](https://git.kayg.org/attachments/c1c8c966-35b5-46ab-9721-b935aff22201) **Checks:** all pass in Chromium (6 widths) and WebKit (390, 1440), light and dark, with no page errors. They cover: - the visible edge 8 px above the keyboard; - the last row scrolling above the keyboard; - growing back fully; - hugging a few rows and "Nothing matches"; - the placeholder fitting; - no words selected after a link. Unit tests: 66 of 66. `apps/web check`: 0 errors, and both apps build. ### Device checklist, round 5 (real iPhone; please run each in a Safari tab and in the Home Screen app) Open https://preview.calternal.cloud/search.html#/list/journal and tap search. **Hugging** 1. **Empty field:** the panel is as tall as the examples plus Recent and no taller. With the keyboard up, it stops 8 px above the keyboard. 2. **Type `kunzum`:** the panel shrinks around the one or two rows on a soft spring. Clear the field and it grows back the same way. Typing fast never makes it jitter or jump. 3. **Type `zzqx`:** the panel is just the field plus "Nothing matches", rounded at the bottom. 4. **Round edges:** the panel's bottom corners stay round at every size, and its shadow follows the bottom edge. **The keyboard going down (the main one)** 5. **Type `calternal`, then scroll the results:** the keyboard goes down, and the panel's bottom edge moves down with it at the same moment and the same pace, settling without a bounce. There's no pause before it moves and no second jump when Safari catches up. 6. **The keyboard's own ⌄ key:** the same. 7. **Cancel, then open again:** no leftover gap at the bottom, and no short panel. 8. **The address bar at the bottom (iOS 26 default), then with the bar collapsed by scrolling a list first:** the same in both. In the second case Safari reports at once, and the prediction and the report agree. **The keyboard coming up** 9. **Tap the field the first time after loading:** the panel shrinks to the keyboard's top, at the latest when the keyboard finishes. Nothing hides under the keyboard afterwards. 10. **Every time after that:** the panel's edge moves up with the keyboard as it rises (it remembers the keyboard's height). 11. **Switch to the emoji keyboard, or start dictation:** the panel follows the new height on the same spring. **Still right from round 4** 12. **Long list, keyboard up:** scroll to the end; the last row comes fully above the keyboard. 13. **Long-press a row:** the preview shows, with no drag ghost, callout or selection, and scrolling that starts on a row still works. 14. **The placeholder reads "Search everything"** and isn't cut off. 15. **A link with words** (for example the "photos from Spiti" link above) opens with the words not highlighted. 16. **At 320 (an iPhone SE in zoomed display):** the tokens show words only, and the line scrolls sideways. **Edges and the keyboard's bar** 17. **With search open and the keyboard up:** the ⌃ ⌄ arrows on the bar above the keyboard are greyed out, because the search field is the only field. The bar itself stays; a web page can't remove it. 18. **Safari tab, sky backdrop, on a list:** the strip behind the status bar and the strip around Safari's bottom bar are the glass's colour, with no paper-coloured band. Open a note: they turn paper. 19. **Home Screen app:** the glass and the sky run to both edges, with no flat strip at the top or bottom, and the search panel still ends above the keyboard. ### Questions for you 1. **Desktop doesn't hug** (the preview pane needs the height). Should it hug when there's no preview, for example when nothing matches? 2. **The first time the keyboard comes up** in a session, the panel can only follow Safari's late report. After that it moves with the keyboard. Is the first time acceptable, or should it guess a typical keyboard height (about 336 pt on a 6.1" iPhone) on the very first focus? 3. **Tapping the app below a short panel closes search on a phone.** Keep that, or should taps there do nothing?
Sign in to join this conversation.
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#399
No description provided.