Skip to content

Fix what the review of search and the away summary found - #73

Merged
danielehrhardt merged 1 commit into
mainfrom
fix/search-away
Oct 4, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
fix/search-away

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

Follow-up to #68 (search) and #69 (while you were away), fixing every finding of their review.

Search: major

  • Matches by content disappeared while typing. cmdk stores an item's keywords only when its value changes, so automations, tickets and core-found chats lost their match after the next keystroke. Those items are now keyed by the search, so they register again (${id}:${q}).
  • The core's chat results replaced the local ones. Local title/preview matches and the core's message matches now show together, de-duplicated. The core matches each word (AND) instead of the whole phrase.

Search: minor

  • keepPreviousData results from an earlier query are never shown for the new one (isPlaceholderData, and deferred === q).
  • Unique cmdk values (text + U+2063 + id, never searched), so same-named automations, agents, chats or waiting items no longer highlight together or freeze ArrowDown.
  • #12 sorts by number, so Import passwords from Chrome, 1Password and other password managers #12 comes before #120.
  • wordFilter folds accents and case for every script (NFKD; "cafe" finds "Café", "istanbul" finds "İstanbul"). Words in Chinese, Japanese, Korean and Thai match anywhere.
  • The core search starts at 3 characters, after 250 ms.

While you were away: major

  • It never ended. The desktop now stores { since, until } (until = the moment you came back), the API takes until, and every query is bounded by it. The header shows the time away, not the time since.
  • It read the whole runs table. Migration 58 adds idx_runs_finished (partial) and task_events(kind, created_at). The query keeps SQLite on that index (+r.status), and a test asserts the plan uses it. Counts are done in SQL, highlight candidates are limited to 300, and the window is capped at 31 days.

While you were away: minor

  • It triggers on pointerup / keyup, so the card can't appear mid-click.
  • "Replied" and "problem" lines only for chats still unread; one read on the phone or in another window isn't news.
  • The total cost is the sum of the per-agent costs.
  • Automations are de-duplicated by id, and a delivery names who delivered it.

Checks:

  • Core: full suite 1418 pass, 0 fail. away.test.ts now also covers the end of the window, unread-only chats, the index in the query plan and until validation.
  • Typecheck: desktop.
  • Browser: "Daily digest" (found through its prompt "check stripe payouts") stays from "s" to "st" to "stripe". "nice meet" finds chats whose messages say "nice to meet".

Search (⌘K):
- What the core found in messages, and tickets or automations matched by their description, stay while typing
  (cmdk reads keywords only when an item mounts: they are keyed by the search).
- Chats matching here and chats the core found in their messages show together; results of an earlier search
  never stand in for the new one; the core matches word by word ("invoice march" finds "March invoice review").
- Items with the same text stay apart (no stuck keyboard); "#12" puts #12 first.
- Matching ignores accents and folds case for every script; Chinese, Japanese and Korean words match anywhere.

While you were away:
- Covers the time until the human came back, not up to now; at most 31 days.
- Found through new indexes on when runs ended and on ticket events (migration 58) instead of reading every run.
- Shows up after the click is released, so it never moves what the click was meant for.
- Lists only chats still unread (read on the phone or elsewhere = not news); totals and per-agent costs agree;
  automations with the same name stay apart; a delivered ticket names who delivered it.
@danielehrhardt
danielehrhardt merged commit d520163 into main Oct 4, 2026
5 of 8 checks passed
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.

1 participant