Skip to content

fix(web): plumb has_image/has_file into search index#442

Merged
intendednull merged 1 commit into
claude/adoring-euler-DvNnkfrom
auto-fix/issue-355-search-index-fields
Apr 27, 2026
Merged

fix(web): plumb has_image/has_file into search index#442
intendednull merged 1 commit into
claude/adoring-euler-DvNnkfrom
auto-fix/issue-355-search-index-fields

Conversation

@intendednull
Copy link
Copy Markdown
Owner

Summary

IndexableMessage build site in crates/web/src/app.rs hard-code has_image: false, has_file: false, letter_id: None. has:image / has:file operator silently underreport.

Fix: add IndexableMessage::from_display_message(&DisplayMessage, channel_name, grove_id, letter_id) in willow-client. Sniff body:

  • [file:NAME:b64]has_image if NAME image-ext, else has_file.
  • URL with image-ext path → has_image.
  • http(s):// substring → has_link (already worked).

Web app indexer use new constructor.

Tradeoffs

Body sniff > new attachments field on DisplayMessage. Field touch state shape, leak file-format details into projection layer. Body sniff cheap, mirrors web UI's render rule, no new abstraction.

letter_id parked

letter_id stay None. Active-letter signal not plumbed into indexer effect — need AppState change + new signal. Park as #441.

Test plan

  • Client tier test: IndexableMessage::from_display_message with image attachment → has_image=true
  • Same with file attachment → has_file=true
  • Image URL → has_image=true + has_link=true
  • Plain URL → has_link=true only
  • Plain text → all flags false
  • grove_id + letter_id pass through
  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace all green
  • cargo check --target wasm32-unknown-unknown -p willow-web
  • rg "letter_id: None,|has_image: false,|has_file: false," crates/web/src/app.rs empty

Refs #355
Follow-up: #441

https://claude.ai/code/session_016cmtqT7yEQUgjcLgz4pARP


Generated by Claude Code

`IndexableMessage` in `app.rs` hard-coded `has_image: false`,
`has_file: false`, `letter_id: None`, so `has:image` / `has:file`
operators silently underreport.

New `IndexableMessage::from_display_message` derives the flags from
the body: `[file:NAME:b64]` → image if NAME ext is image, else file;
`http(s)://...image-ext` URL → image. Web app uses the constructor.

`letter_id` stays None: active-letter signal not plumbed into the
indexer effect yet — follow-up.

Refs #355

https://claude.ai/code/session_016cmtqT7yEQUgjcLgz4pARP
@intendednull intendednull merged commit 160652e into claude/adoring-euler-DvNnk Apr 27, 2026
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