Inline picker for @ and [[ on the search API; !@ and ![[ embed (cards) #165

Open
opened 2026-10-14 06:54:52 +00:00 by kayg · 4 comments
Owner

kayg, 2026-10-14:

  • Typing @ or [[ in a note on calternal.cloud shows nothing at all.
  • "both of these should start an in-line expansion where I can choose all the notes/attachments, etc to link here and the links should be smart! a !@ or ![[ should do the same but embed them inside the current note (the card UX i was talking about)"
  • "this inline choosing of links surface should just internally use the search interface/API because that's what it really is"
  • Cards are "an inline expand of internal links", plus "external link previews/cards when pasted".

Build:

  1. Picker: @ and [[ open an inline picker, the same UX for both, anchored at the caret.
    • It runs on search.query (the FTS5 provider from #10/#53), so the ranking, typo tolerance and frecency are the same as ⌘K. One search API, two surfaces.
    • It covers notes and attachments, and "Create note '…'" when nothing matches.
    • Keyboard first: arrows, Enter, Esc, Tab.
    • It writes a standard [Title](<Note.md>) link (or an attachment link) and stays in sync on rename (#9).
  2. Embeds: !@ and ![[ use the same picker and insert an embed: ![Title](<Note.md>) for notes, ![](<file>) for images and files.
    • In the editor, an embedded note renders as an inline card you can expand or collapse, showing that note's content live and read-only. Editing happens in place later.
    • Images show inline.
  3. External link cards: pasting a bare URL on its own line offers to turn it into a preview card (title, site, image) fetched through our server. The fetch is private, cached, no-referrer, and never fetched from the browser.
  4. Look: external links are pills like note links, with a simple diagonal ↗ glyph (#162 owns the pill style).
  5. Source mode shows the markdown.

Perf: the first results show within one frame of a keystroke on a 10k Home; reuse the palette's search client.

kayg, 2026-10-14: - Typing `@` or `[[` in a note on calternal.cloud shows nothing at all. - "both of these should start an in-line expansion where I can choose all the notes/attachments, etc to link here and the links should be smart! a !@ or ![[ should do the same but embed them inside the current note (the card UX i was talking about)" - "this inline choosing of links surface should just internally use the search interface/API because that's what it really is" - Cards are "an inline expand of internal links", plus "external link previews/cards when pasted". **Build:** 1. **Picker:** `@` and `[[` open an inline picker, the same UX for both, anchored at the caret. - It runs on `search.query` (the FTS5 provider from #10/#53), so the ranking, typo tolerance and frecency are the same as ⌘K. One search API, two surfaces. - It covers notes and attachments, and "Create note '…'" when nothing matches. - Keyboard first: arrows, Enter, Esc, Tab. - It writes a standard `[Title](<Note.md>)` link (or an attachment link) and stays in sync on rename (#9). 2. **Embeds:** `!@` and `![[` use the same picker and insert an embed: `![Title](<Note.md>)` for notes, `![](<file>)` for images and files. - In the editor, an embedded note renders as an inline **card** you can expand or collapse, showing that note's content live and read-only. Editing happens in place later. - Images show inline. 3. **External link cards:** pasting a bare URL on its own line offers to turn it into a preview card (title, site, image) fetched through our server. The fetch is private, cached, no-referrer, and never fetched from the browser. 4. **Look:** external links are pills like note links, with a simple diagonal ↗ glyph (#162 owns the pill style). 5. **Source mode** shows the markdown. **Perf:** the first results show within one frame of a keystroke on a 10k Home; reuse the palette's search client.
Author
Owner

PR #220, the fast fix: [[ (same for @) opens the picker, typing narrows it through search.query, choosing writes a standard link. Real server and engine. Each size: open, typing w <tag>, chosen. Chromium first, then WebKit.

chromium-320-light-1-open.png
chromium-320-light-1-open.png

chromium-320-light-2-typing.png
chromium-320-light-2-typing.png

chromium-320-light-3-chosen.png
chromium-320-light-3-chosen.png

chromium-320-dark-1-open.png
chromium-320-dark-1-open.png

chromium-320-dark-2-typing.png
chromium-320-dark-2-typing.png

chromium-320-dark-3-chosen.png
chromium-320-dark-3-chosen.png

chromium-390-light-1-open.png
chromium-390-light-1-open.png

chromium-390-light-2-typing.png
chromium-390-light-2-typing.png

chromium-390-light-3-chosen.png
chromium-390-light-3-chosen.png

chromium-390-dark-1-open.png
chromium-390-dark-1-open.png

chromium-390-dark-2-typing.png
chromium-390-dark-2-typing.png

chromium-390-dark-3-chosen.png
chromium-390-dark-3-chosen.png

chromium-1440-light-1-open.png
chromium-1440-light-1-open.png

chromium-1440-light-2-typing.png
chromium-1440-light-2-typing.png

chromium-1440-light-3-chosen.png
chromium-1440-light-3-chosen.png

chromium-1440-dark-1-open.png
chromium-1440-dark-1-open.png

chromium-1440-dark-2-typing.png
chromium-1440-dark-2-typing.png

chromium-1440-dark-3-chosen.png
chromium-1440-dark-3-chosen.png

webkit-320-light-2-typing.png
webkit-320-light-2-typing.png

webkit-320-dark-2-typing.png
webkit-320-dark-2-typing.png

webkit-390-light-2-typing.png
webkit-390-light-2-typing.png

webkit-390-dark-2-typing.png
webkit-390-dark-2-typing.png

webkit-1440-light-2-typing.png
webkit-1440-light-2-typing.png

webkit-1440-dark-2-typing.png
webkit-1440-dark-2-typing.png

PR #220, the fast fix: `[[` (same for `@`) opens the picker, typing narrows it through search.query, choosing writes a standard link. Real server and engine. Each size: open, typing `w <tag>`, chosen. Chromium first, then WebKit. **chromium-320-light-1-open.png** ![chromium-320-light-1-open.png](https://git.kayg.org/attachments/63822f9e-e25f-46b5-8185-357dfcfc77a7) **chromium-320-light-2-typing.png** ![chromium-320-light-2-typing.png](https://git.kayg.org/attachments/f679006c-7ff4-41d6-b09c-fd1e07aa734b) **chromium-320-light-3-chosen.png** ![chromium-320-light-3-chosen.png](https://git.kayg.org/attachments/c283930e-2b35-4373-b152-af8a0de65625) **chromium-320-dark-1-open.png** ![chromium-320-dark-1-open.png](https://git.kayg.org/attachments/e9066d93-e51f-40a4-994f-b984378e98f8) **chromium-320-dark-2-typing.png** ![chromium-320-dark-2-typing.png](https://git.kayg.org/attachments/96d32d28-181b-4531-a9a4-51086b5923cf) **chromium-320-dark-3-chosen.png** ![chromium-320-dark-3-chosen.png](https://git.kayg.org/attachments/e8f17f5e-dd75-40b7-9a42-ec585ea4c5e4) **chromium-390-light-1-open.png** ![chromium-390-light-1-open.png](https://git.kayg.org/attachments/a690341b-a56b-4fb5-8c2f-873f95bf21cf) **chromium-390-light-2-typing.png** ![chromium-390-light-2-typing.png](https://git.kayg.org/attachments/6f9a1059-c0dd-4d1b-8653-e99f2930ad45) **chromium-390-light-3-chosen.png** ![chromium-390-light-3-chosen.png](https://git.kayg.org/attachments/0d597f45-5a61-4a0e-918a-90f3bd6f276a) **chromium-390-dark-1-open.png** ![chromium-390-dark-1-open.png](https://git.kayg.org/attachments/fc6d309d-54dd-44fe-8524-6ed8c6fa136a) **chromium-390-dark-2-typing.png** ![chromium-390-dark-2-typing.png](https://git.kayg.org/attachments/4a086882-e59b-4583-a1d7-94ee9f588dbd) **chromium-390-dark-3-chosen.png** ![chromium-390-dark-3-chosen.png](https://git.kayg.org/attachments/717486b0-730b-4ad8-bfde-cd4302998ed0) **chromium-1440-light-1-open.png** ![chromium-1440-light-1-open.png](https://git.kayg.org/attachments/eee76ed0-8998-4cbd-a59e-dda746748381) **chromium-1440-light-2-typing.png** ![chromium-1440-light-2-typing.png](https://git.kayg.org/attachments/038549d5-3bea-430a-a435-cbf2897eb25e) **chromium-1440-light-3-chosen.png** ![chromium-1440-light-3-chosen.png](https://git.kayg.org/attachments/cd60c3ca-d3d1-437c-9f5c-67eda789e3fe) **chromium-1440-dark-1-open.png** ![chromium-1440-dark-1-open.png](https://git.kayg.org/attachments/274a3b60-76d5-4ae3-a013-d4678f79c55d) **chromium-1440-dark-2-typing.png** ![chromium-1440-dark-2-typing.png](https://git.kayg.org/attachments/1e810f27-a63a-4335-b957-da5a1680c09f) **chromium-1440-dark-3-chosen.png** ![chromium-1440-dark-3-chosen.png](https://git.kayg.org/attachments/104e6339-1fcc-4d3c-8c31-3b7944a7ef3d) **webkit-320-light-2-typing.png** ![webkit-320-light-2-typing.png](https://git.kayg.org/attachments/5449cfe7-4ae7-4e32-a3fc-0fa618a18920) **webkit-320-dark-2-typing.png** ![webkit-320-dark-2-typing.png](https://git.kayg.org/attachments/ce079e05-b519-4482-be54-fd238e1ea04a) **webkit-390-light-2-typing.png** ![webkit-390-light-2-typing.png](https://git.kayg.org/attachments/02287e76-facc-42c3-b547-a98c37268099) **webkit-390-dark-2-typing.png** ![webkit-390-dark-2-typing.png](https://git.kayg.org/attachments/3345f72d-3b33-400c-9c91-06b9b5c93791) **webkit-1440-light-2-typing.png** ![webkit-1440-light-2-typing.png](https://git.kayg.org/attachments/1802e30d-9018-4780-a2d2-b034dfc61488) **webkit-1440-dark-2-typing.png** ![webkit-1440-dark-2-typing.png](https://git.kayg.org/attachments/e1bf9561-109a-4b68-8aaa-d113b9f08174)
Author
Owner

PR #234, the full picker: app icons, instant first answer, "New note" when nothing has that exact title. Each size shows open, typing w <tag> and chosen; Chromium, then WebKit at 320 and 390.

chromium-320-light-1-open.png
chromium-320-light-1-open.png

chromium-320-light-2-typing.png
chromium-320-light-2-typing.png

chromium-320-dark-2-typing.png
chromium-320-dark-2-typing.png

chromium-320-dark-3-chosen.png
chromium-320-dark-3-chosen.png

chromium-390-light-1-open.png
chromium-390-light-1-open.png

chromium-390-light-2-typing.png
chromium-390-light-2-typing.png

chromium-390-dark-2-typing.png
chromium-390-dark-2-typing.png

chromium-390-dark-3-chosen.png
chromium-390-dark-3-chosen.png

chromium-1440-light-2-typing.png
chromium-1440-light-2-typing.png

chromium-1440-light-3-chosen.png
chromium-1440-light-3-chosen.png

chromium-1440-dark-1-open.png
chromium-1440-dark-1-open.png

chromium-1440-dark-2-typing.png
chromium-1440-dark-2-typing.png

webkit-320-light-2-typing.png
webkit-320-light-2-typing.png

webkit-320-dark-2-typing.png
webkit-320-dark-2-typing.png

webkit-390-light-2-typing.png
webkit-390-light-2-typing.png

webkit-390-dark-2-typing.png
webkit-390-dark-2-typing.png

PR #234, the full picker: app icons, instant first answer, "New note" when nothing has that exact title. Each size shows open, typing `w <tag>` and chosen; Chromium, then WebKit at 320 and 390. **chromium-320-light-1-open.png** ![chromium-320-light-1-open.png](https://git.kayg.org/attachments/7b3735b9-10f0-4ce4-abb8-119e0b828405) **chromium-320-light-2-typing.png** ![chromium-320-light-2-typing.png](https://git.kayg.org/attachments/b1482ad5-816e-46c9-8ce8-1f485832d945) **chromium-320-dark-2-typing.png** ![chromium-320-dark-2-typing.png](https://git.kayg.org/attachments/52a0c31c-46ca-491f-bbd7-ef9cbde507a3) **chromium-320-dark-3-chosen.png** ![chromium-320-dark-3-chosen.png](https://git.kayg.org/attachments/cfd63ced-e6ac-46b5-8a86-34c7e431badd) **chromium-390-light-1-open.png** ![chromium-390-light-1-open.png](https://git.kayg.org/attachments/50ff7013-fef6-453e-a7b3-3fd928211ddc) **chromium-390-light-2-typing.png** ![chromium-390-light-2-typing.png](https://git.kayg.org/attachments/d7eaeda1-59d6-40a8-b732-00445d8727fa) **chromium-390-dark-2-typing.png** ![chromium-390-dark-2-typing.png](https://git.kayg.org/attachments/48479120-0916-4c82-879f-25818fb5a73e) **chromium-390-dark-3-chosen.png** ![chromium-390-dark-3-chosen.png](https://git.kayg.org/attachments/78476137-1041-45a7-82d3-3c775e464125) **chromium-1440-light-2-typing.png** ![chromium-1440-light-2-typing.png](https://git.kayg.org/attachments/9863be33-170b-484d-9024-c667bcd8bff0) **chromium-1440-light-3-chosen.png** ![chromium-1440-light-3-chosen.png](https://git.kayg.org/attachments/0b5fe995-596a-4a6a-be0b-e918c92a9334) **chromium-1440-dark-1-open.png** ![chromium-1440-dark-1-open.png](https://git.kayg.org/attachments/a201897e-cd8b-4f0f-8c19-43c6034d36da) **chromium-1440-dark-2-typing.png** ![chromium-1440-dark-2-typing.png](https://git.kayg.org/attachments/c88deff1-ed5f-4901-8eae-986aa01b88a5) **webkit-320-light-2-typing.png** ![webkit-320-light-2-typing.png](https://git.kayg.org/attachments/5b89448a-d502-4721-81d7-7ecb82030090) **webkit-320-dark-2-typing.png** ![webkit-320-dark-2-typing.png](https://git.kayg.org/attachments/32e4eef2-33b4-4fd7-80d2-6fe1df56281e) **webkit-390-light-2-typing.png** ![webkit-390-light-2-typing.png](https://git.kayg.org/attachments/76b17f40-50a7-4a9c-9d1b-464274a4f354) **webkit-390-dark-2-typing.png** ![webkit-390-dark-2-typing.png](https://git.kayg.org/attachments/6c2f202f-aee1-47b0-b6aa-b61168ca6d77)
Author
Owner

PR #263, cards: a note embed (closed with fade, then opened) and web cards from previews.get (rust-lang.org with its picture, example.com without). Real server; the previews were fetched from the internet by our server. 320/390/1440, light and dark; Chromium, then WebKit.

chromium-320-light-4-cards.png
chromium-320-light-4-cards.png

chromium-320-dark-5-card-open.png
chromium-320-dark-5-card-open.png

chromium-390-light-4-cards.png
chromium-390-light-4-cards.png

chromium-390-dark-4-cards.png
chromium-390-dark-4-cards.png

chromium-390-dark-5-card-open.png
chromium-390-dark-5-card-open.png

chromium-1440-light-4-cards.png
chromium-1440-light-4-cards.png

chromium-1440-light-5-card-open.png
chromium-1440-light-5-card-open.png

chromium-1440-dark-4-cards.png
chromium-1440-dark-4-cards.png

chromium-1440-dark-5-card-open.png
chromium-1440-dark-5-card-open.png

webkit-320-light-4-cards.png
webkit-320-light-4-cards.png

webkit-320-dark-5-card-open.png
webkit-320-dark-5-card-open.png

webkit-390-light-5-card-open.png
webkit-390-light-5-card-open.png

webkit-390-dark-4-cards.png
webkit-390-dark-4-cards.png

webkit-1440-light-4-cards.png
webkit-1440-light-4-cards.png

webkit-1440-dark-5-card-open.png
webkit-1440-dark-5-card-open.png

PR #263, cards: a note embed (closed with fade, then opened) and web cards from previews.get (rust-lang.org with its picture, example.com without). Real server; the previews were fetched from the internet by our server. 320/390/1440, light and dark; Chromium, then WebKit. **chromium-320-light-4-cards.png** ![chromium-320-light-4-cards.png](https://git.kayg.org/attachments/aa9982c6-f575-49ff-bea3-6d34671f8465) **chromium-320-dark-5-card-open.png** ![chromium-320-dark-5-card-open.png](https://git.kayg.org/attachments/b438151c-ba36-4baf-841b-268b4975a6f8) **chromium-390-light-4-cards.png** ![chromium-390-light-4-cards.png](https://git.kayg.org/attachments/6cd0b7a0-a1a7-4e96-a281-25d7a523cc88) **chromium-390-dark-4-cards.png** ![chromium-390-dark-4-cards.png](https://git.kayg.org/attachments/d6d5883b-5a64-49cc-bd49-5b40aa3c3220) **chromium-390-dark-5-card-open.png** ![chromium-390-dark-5-card-open.png](https://git.kayg.org/attachments/3132ff7d-bf64-48a1-8f1f-e9dd9d0592ef) **chromium-1440-light-4-cards.png** ![chromium-1440-light-4-cards.png](https://git.kayg.org/attachments/02219352-e1f4-4fc2-9cc0-0ec912ab9118) **chromium-1440-light-5-card-open.png** ![chromium-1440-light-5-card-open.png](https://git.kayg.org/attachments/26d52be7-b337-4a19-8c86-e87a82c33592) **chromium-1440-dark-4-cards.png** ![chromium-1440-dark-4-cards.png](https://git.kayg.org/attachments/d69f3f14-e459-4b9a-a77c-80b9a418637c) **chromium-1440-dark-5-card-open.png** ![chromium-1440-dark-5-card-open.png](https://git.kayg.org/attachments/04bac49e-a77b-4dc3-8cf5-399f71fe543f) **webkit-320-light-4-cards.png** ![webkit-320-light-4-cards.png](https://git.kayg.org/attachments/41e2673a-195d-4370-be69-e86f62cc5a12) **webkit-320-dark-5-card-open.png** ![webkit-320-dark-5-card-open.png](https://git.kayg.org/attachments/f507b3ca-0eca-4885-9c06-d04e2bed2315) **webkit-390-light-5-card-open.png** ![webkit-390-light-5-card-open.png](https://git.kayg.org/attachments/86f0e339-1758-4cc4-a6f2-72f82f9fa3e1) **webkit-390-dark-4-cards.png** ![webkit-390-dark-4-cards.png](https://git.kayg.org/attachments/905136b9-1515-4851-8d17-472df9db0676) **webkit-1440-light-4-cards.png** ![webkit-1440-light-4-cards.png](https://git.kayg.org/attachments/768f7e67-2be3-4211-9730-ee9e85b5a22f) **webkit-1440-dark-5-card-open.png** ![webkit-1440-dark-5-card-open.png](https://git.kayg.org/attachments/9d0ccf91-009e-42ae-847b-f3f92adffb10)
Author
Owner

Why @ and [[ showed nothing: Editor.svelte passed the editor's link shortcuts only notePath. The completion source returns null when it has no search function, so it gave nothing on every keystroke. Fixed in #261 (replaces #220).

The PRs, a stack; merge them in order:

  1. #261: the fast fix. The picker runs on search.query.
  2. #262: the full picker: ![[ and !@ embeds, an instant first answer, “New note”, Tab, icons.
  3. #263: cards: note embeds and web previews, plus previews.get on the server with SSRF guards.

Perf (10k-note fixture Home, real server, production web build; the machine was at load average 50 to 80). For each keystroke after [[, did the list's content change before the frame that paints the typed letter?

changed in the same frame letter → list, median
#261 (search only, CodeMirror's 100 ms activation) 9/31 297 ms (p95 552)
#262 (instant from the note list, then search) 28/39 Chromium, 15/17 WebKit 0 when it changed

In the remaining keystrokes, the instant answer matched the list already showing, so nothing needed to change until the search answer arrived. Plain typing latency on this busy machine was p50 481 ms in the same run, so the absolute times say more about the machine than the code.

**Why `@` and `[[` showed nothing:** `Editor.svelte` passed the editor's link shortcuts only `notePath`. The completion source returns `null` when it has no `search` function, so it gave nothing on every keystroke. Fixed in #261 (replaces #220). **The PRs, a stack; merge them in order:** 1. #261: the fast fix. The picker runs on `search.query`. 2. #262: the full picker: `![[` and `!@` embeds, an instant first answer, “New note”, Tab, icons. 3. #263: cards: note embeds and web previews, plus `previews.get` on the server with SSRF guards. **Perf** (10k-note fixture Home, real server, production web build; the machine was at load average 50 to 80). For each keystroke after `[[`, did the list's content change before the frame that paints the typed letter? | | changed in the same frame | letter → list, median | |---|---|---| | #261 (search only, CodeMirror's 100 ms activation) | 9/31 | 297 ms (p95 552) | | #262 (instant from the note list, then search) | 28/39 Chromium, 15/17 WebKit | 0 when it changed | In the remaining keystrokes, the instant answer matched the list already showing, so nothing needed to change until the search answer arrived. Plain typing latency on this busy machine was p50 481 ms in the same run, so the absolute times say more about the machine than the code.
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#165
No description provided.