feat(home): per-type message-preview icons on the dashboard (LC-704) #670

Merged
longjacksonle merged 1 commit from feat/LC-704-preview-type-icons into main 2026-08-13 18:38:18 +02:00

What

Give each bodyless message preview on the Home "Catch up" dashboard a per-type label instead of the single generic "📎 Attachment" fallback that LC-703 shipped. An image, a video, a voice message, and a plain file now read distinctly on both the "Unread channels" (catch-up) and "Threads" cards:

  • 🖼 Image
  • 🎞 Video
  • 🎤 Voice message
  • 📎 File

Why

After LC-703, a message with no text body (attachment-only) always rendered "📎 Attachment", so the dashboard could not tell a shared screenshot from a voice memo or a PDF. The per-type label restores at-a-glance recognition of what is waiting in each channel/thread.

How

  • Classification mirrors the timeline's own render precedence (audio -> video -> image -> file; see templates/partials/attachment.html) and keys off the message's first attachment, so the dashboard label matches what the message leads with in the room. Reuses models::Attachment::is_image / is_video / is_audio; no new mime logic.
  • Reuses db::uploads::attachments_for_messages (the timeline's bulk loader) rather than widening the inbox / thread-digest queries. Only bodyless rows trigger a lookup, so an all-text dashboard costs no extra query.
  • The generic "📎 Attachment" remains the fallback for a bodyless message whose attachments could not be loaded.
  • New i18n keys home-dash-preview-image / -video / -voice / -file in both en and es (parity test passes).

Scope note

LC-704 originally bundled a workspace-wide one-click "Catch me up" AI summary. That is a new cross-room feature (new route, cross-room aggregation under a token budget, drawer UI, caching), not a preview tweak, so it was split into LC-705.

Testing

  • just test: 196 binaries ok, 0 failed, 1658 tests passed (incl. 2 new unit tests for the attachment classifier and the i18n en/es parity test).
  • cargo clippy clean under both standalone and saas feature sets.
  • cargo fmt --check clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_016ufqbuN7mjyt4ms5NEygMy

## What Give each bodyless message preview on the Home "Catch up" dashboard a per-type label instead of the single generic "📎 Attachment" fallback that LC-703 shipped. An image, a video, a voice message, and a plain file now read distinctly on both the "Unread channels" (catch-up) and "Threads" cards: - 🖼 Image - 🎞 Video - 🎤 Voice message - 📎 File ## Why After LC-703, a message with no text body (attachment-only) always rendered "📎 Attachment", so the dashboard could not tell a shared screenshot from a voice memo or a PDF. The per-type label restores at-a-glance recognition of what is waiting in each channel/thread. ## How - Classification mirrors the timeline's own render precedence (audio -> video -> image -> file; see `templates/partials/attachment.html`) and keys off the message's first attachment, so the dashboard label matches what the message leads with in the room. Reuses `models::Attachment::is_image` / `is_video` / `is_audio`; no new mime logic. - Reuses `db::uploads::attachments_for_messages` (the timeline's bulk loader) rather than widening the inbox / thread-digest queries. Only bodyless rows trigger a lookup, so an all-text dashboard costs no extra query. - The generic "📎 Attachment" remains the fallback for a bodyless message whose attachments could not be loaded. - New i18n keys `home-dash-preview-image` / `-video` / `-voice` / `-file` in both en and es (parity test passes). ## Scope note LC-704 originally bundled a workspace-wide one-click "Catch me up" AI summary. That is a new cross-room feature (new route, cross-room aggregation under a token budget, drawer UI, caching), not a preview tweak, so it was split into LC-705. ## Testing - `just test`: 196 binaries ok, 0 failed, 1658 tests passed (incl. 2 new unit tests for the attachment classifier and the i18n en/es parity test). - `cargo clippy` clean under both `standalone` and `saas` feature sets. - `cargo fmt --check` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016ufqbuN7mjyt4ms5NEygMy
feat(home): per-type message-preview icons on the dashboard (LC-704)
All checks were successful
check-secrets / Nosey parker (push) Successful in 3s
check-secrets / TruffleHog (push) Successful in 5s
check-secrets / Kingfisher (push) Successful in 6s
check-secrets / Nosey parker (pull_request) Successful in 3s
check-secrets / TruffleHog (pull_request) Successful in 5s
check-secrets / Kingfisher (pull_request) Successful in 9s
Check / clippy + fmt + tests (pull_request) Successful in 5m59s
Create release / Create release from merged PR (pull_request) Has been skipped
7a12704c27
The Home "Catch up" dashboard fell back to a single generic "📎 Attachment" label for any message with no text body, so an image, a video, a voice message, and a plain file all looked identical. This gives each bodyless preview a per-type label (🖼 Image, 🎞 Video, 🎤 Voice message, 📎 File) on both the "Unread channels" and "Threads" cards.

Classification mirrors the timeline's own render precedence (audio -> video -> image -> file) and keys off the message's first attachment, so the dashboard label matches what the message leads with in the room. The generic "📎 Attachment" stays as the fallback for a bodyless message whose attachments could not be loaded.

Reuses `db::uploads::attachments_for_messages` (the timeline's bulk loader) rather than widening the inbox / thread-digest queries, and only bodyless rows trigger a lookup, so an all-text dashboard costs no extra query. New i18n keys `home-dash-preview-image` / `-video` / `-voice` / `-file` in en and es.

The workspace-wide one-click "Catch me up" AI summary that was originally bundled in this ticket is a new cross-room feature and moved to LC-705.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ufqbuN7mjyt4ms5NEygMy
longjacksonle deleted branch feat/LC-704-preview-type-icons 2026-08-13 18:38:18 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!670
No description provided.