Skip to content

GPUI: message search with Discord-style filters - #105

Merged
JSKitty merged 8 commits into
gpuifrom
claude/project-thread-hwfih4
Nov 19, 2026
Merged

JSKitty merged 8 commits into
gpuifrom
claude/project-thread-hwfih4

Conversation

@JSKitty

@JSKitty JSKitty commented Nov 19, 2026

Copy link
Copy Markdown

Requested by JSKitty · project thread

What

On-device message search for the GPUI client.

  • Engine (vector_core::search): every message (with edits applied, banned authors left out, attachment file names included) gets folded into one NUL-separated buffer and scanned with memchr::memmem. Case and accents are folded, CJK works without word breaks, "quoted phrases" work, and every term must match. The corpus holds plaintext, so it only lives while the search panel is open.
  • Filters: from:, mentions:, has: (link, image, video, audio, file), in: (a DM, a channel, or a whole community by name), and before: / after: / during: (2026-11-18, 2026-11, 2026, today, yesterday). from:me and mentions:me also work. Mentions are indexed by the person's name, so searching "alice" finds an @npub… mention of Alice.
  • UI:
    • Opening it: Cmd/Ctrl+K searches every chat. Cmd/Ctrl+F, the header's magnifier or the chat menu's "Search in Chat" searches the open chat.
    • While typing: autocomplete for the filter being typed, with avatars for people. Filters show as removable chips.
    • Results: grouped by chat with highlighted matches, a Newest/Oldest toggle, and a result count. Up/Down/Enter/Esc work, and Enter jumps to the message.
    • Layout: a centred card on wide windows and the whole window on slim ones.
  • All the text goes through t:: (new search.ftl). The filter keywords stay English on purpose, as syntax.

Numbers

cargo bench -p vector-core --features bench -- search runs 200k synthetic messages:

  • Building the corpus takes about 170 ms.
  • A scan takes 1 to 21 ms. A chat-scoped scan or a has: scan takes about 1 ms.

Testing

  • 15 engine tests in vector-core and 5 parser/filter tests in GPUI.
  • The i18n audit and spawn/vault audits pass.
  • Driven by hand on fixtures under Xvfb, both widescreen and slim.
  • Not yet run against a live account or on macOS.

Generated by Claude Code

vector_core::search folds every message into one buffer and scans it with
memchr's memmem: case and accent folded, CJK without word breaks, quoted
phrases, and from:, mentions:, has:, in:, before:, after:, during: filters.
GPUI opens it with Cmd/Ctrl+K (every chat) or Cmd/Ctrl+F, the header's
magnifier and the chat menu (the open chat), suggests the filter being
typed, and opens a result at the message. Slim takes the whole window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6ReurguGC2qWNpRCjenb
…s build only listed hits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6ReurguGC2qWNpRCjenb
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

JSKitty commented Nov 19, 2026

Copy link
Copy Markdown
Author

The failing claude check is the claude-code-action review job, not a build or test. The job ran with an empty ANTHROPIC_API_KEY, so it errored before it reviewed anything. Nothing in this diff touches that workflow. The engine, UI and audit tests pass locally: 15 tests in vector-core, plus the GPUI search and i18n tests.


Generated by Claude Code

JSKitty commented Nov 19, 2026

Copy link
Copy Markdown
Author

The build failure comes from the F-Droid source scan, not from compiling. scripts/fdroid-scan.py rejects web/whisper/whisper-gpu.wasm and web/whisper/whisper-cpu.wasm as binaries. Both files are already on gpui and this PR doesn't touch them: the diff only covers crates/vector-core, crates/vector-gpui, crates/vector-i18n and the lockfiles. The scan will fail the same way on any PR into gpui until those wasm files are added to the scanner's allowlist or built from source in CI.


Generated by Claude Code

JSKitty commented Nov 19, 2026

Copy link
Copy Markdown
Author

One vector-core test failed: community::v2::service::tests::control_sync::a_relay_that_caps_open_sessions_is_never_written_off_and_every_plane_still_compares. The other 2965 passed, including all the new search:: tests. This PR doesn't touch community/, and the failing test passes 3 out of 3 times locally at this PR's head. It looks timing-sensitive under CI load. I've re-run the failed job once.


Generated by Claude Code

The member list's field now also scans the Community's messages with the
same filters, listing matching members above compact message results.
Picking a result opens its channel at the message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6ReurguGC2qWNpRCjenb
@JSKitty
JSKitty marked this pull request as ready for review November 19, 2026 11:39
@JSKitty
JSKitty merged commit c8c46b9 into gpui Nov 19, 2026
4 of 5 checks passed
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

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.

2 participants