Skip to content

Search index: thread active-letter id into IndexableMessage.letter_id #448

@intendednull

Description

@intendednull

Follow-up to #355.

crates/web/src/app.rs builds IndexableMessage from the messages signal and currently hard-codes letter_id: None because there is no active-letter signal in crates/web/src/state.rs to read from. Letters/DMs is specced in docs/specs/2026-04-19-ui-design/letters-dms.md but the feature has not landed:

  • No letter_id / current_letter signal in AppState.
  • command_palette + tab_bar reference letters as a feature-flagged future surface.
  • SearchScope::ThisLetter(id) and SearchScope::AllLetters exist in the executor and rely on Posting.letter_id, but no code path produces a non-None letter_id today.

When letters-dms.md ships:

  1. Add current_letter: ReadSignal<Option<String>> (or equivalent) to AppState.
  2. Subscribe to it in the search-index Effect in crates/web/src/app.rs alongside current_channel / active_server.
  3. Set letter_id: current_letter.get() (or per-message lookup if the messages signal mixes channels and letters).
  4. Add a client-tier test confirming SearchScope::ThisLetter returns the expected hits.

Unblocks the documented in:#letter / scope-flip operator behaviour. Severity: medium (UX gap, not security).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions