fix(web): plumb has_image/has_file into search index#442
Merged
intendednull merged 1 commit intoApr 27, 2026
Merged
Conversation
`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
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IndexableMessagebuild site incrates/web/src/app.rshard-codehas_image: false,has_file: false,letter_id: None.has:image/has:fileoperator silently underreport.Fix: add
IndexableMessage::from_display_message(&DisplayMessage, channel_name, grove_id, letter_id)in willow-client. Sniff body:[file:NAME:b64]→has_imageif NAME image-ext, elsehas_file.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_idstayNone. Active-letter signal not plumbed into indexer effect — needAppStatechange + new signal. Park as #441.Test plan
IndexableMessage::from_display_messagewith image attachment →has_image=truehas_file=truehas_image=true+has_link=truehas_link=trueonlycargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspaceall greencargo check --target wasm32-unknown-unknown -p willow-webrg "letter_id: None,|has_image: false,|has_file: false," crates/web/src/app.rsemptyRefs #355
Follow-up: #441
https://claude.ai/code/session_016cmtqT7yEQUgjcLgz4pARP
Generated by Claude Code