feat(ui): highlight messages that @-mention the viewer (LC-284) #320

Merged
longjacksonle merged 1 commit from feat/lc-284-self-mention-highlight into main 2026-06-14 18:35:28 +02:00

What

Messages that directly @-mention the viewer now stand out in the timeline (LC-284) - a layout-neutral left accent bar plus a faint accent wash - so a ping is easy to spot while scrolling instead of blending in.

How

  • MessageView::mentions_viewer() = the resolved mention set already loaded for chip rendering contains viewer_id. Cheap membership check, no extra query.
  • message.html adds an lc-mentioned class to the message row when that is true. Every room render path (page bulk render, single-message rebuild, WS new/edited renders) already populates mentions + viewer_id, so the highlight is correct both live and on reload with no new plumbing.
  • main.css: .lc-mentioned uses an inset box-shadow for the left bar (no layout shift) and a color-mix accent wash, theme-aware via --accent. Hover still shows the existing sunken background.

Webhook/email/bridge and DM messages carry no viewer mention, so their rendering is unchanged - and the LC-77 fixtures are unaffected (confirmed: no fixture diff). v1 covers direct mentions; @here/@channel broadcasts (no per-user mention row) are out of scope. No new DB/route/env. Not operator-visible.

Tests

routes_drafts: a message with a mention row for the viewer renders lc-mentioned; a plain message does not. just test and just test-saas pass; no fixture changes.

QA note

Visual, so worth a glance: post @you from another account and confirm the row gets the left bar + tint live; confirm a message mentioning someone else is highlighted for that person but not for you; check both light and dark themes; confirm hovering the row still works.

## What Messages that directly `@`-mention the viewer now stand out in the timeline (LC-284) - a layout-neutral left accent bar plus a faint accent wash - so a ping is easy to spot while scrolling instead of blending in. ## How - `MessageView::mentions_viewer()` = the resolved mention set already loaded for chip rendering contains `viewer_id`. Cheap membership check, no extra query. - `message.html` adds an `lc-mentioned` class to the message row when that is true. Every room render path (page bulk render, single-message rebuild, WS new/edited renders) already populates `mentions` + `viewer_id`, so the highlight is correct both live and on reload with no new plumbing. - `main.css`: `.lc-mentioned` uses an inset `box-shadow` for the left bar (no layout shift) and a `color-mix` accent wash, theme-aware via `--accent`. Hover still shows the existing sunken background. Webhook/email/bridge and DM messages carry no viewer mention, so their rendering is unchanged - and the LC-77 fixtures are unaffected (confirmed: no fixture diff). v1 covers direct mentions; `@here`/`@channel` broadcasts (no per-user mention row) are out of scope. No new DB/route/env. Not operator-visible. ## Tests `routes_drafts`: a message with a mention row for the viewer renders `lc-mentioned`; a plain message does not. `just test` and `just test-saas` pass; no fixture changes. ## QA note Visual, so worth a glance: post `@you` from another account and confirm the row gets the left bar + tint live; confirm a message mentioning someone else is highlighted for that person but not for you; check both light and dark themes; confirm hovering the row still works.
feat(ui): highlight messages that @-mention the viewer (LC-284)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 3m22s
check-secrets / Kingfisher (push) Successful in 5s
check-secrets / TruffleHog (push) Successful in 5s
check-secrets / Nosey parker (push) Successful in 4s
check-secrets / TruffleHog (pull_request) Successful in 5s
check-secrets / Kingfisher (pull_request) Successful in 5s
check-secrets / Nosey parker (pull_request) Successful in 5s
Create release / Create release from merged PR (pull_request) Has been skipped
e767434231
Messages that directly @-mention you now stand out in the timeline with a layout-neutral left accent bar and a faint accent wash, so a ping is easy to spot while scrolling.

Adds MessageView::mentions_viewer() (the resolved mention set + viewer_id are already loaded for chip rendering, so it is a cheap membership check, no extra query) and an lc-mentioned class applied in message.html when it is true. Because every room render path - page bulk, single-message rebuild, and the WS new/edited renders - already populates mentions, the highlight is correct live and on reload with no plumbing changes. The accent bar is an inset box-shadow (no layout shift) and theme-aware via --accent.

Webhook/email/bridge and DM messages carry no viewer mention, so their rendering (and the LC-77 fixtures) is unchanged. v1 covers direct mentions; @here/@channel broadcasts (no per-user mention row) are out of scope. Tests cover the mentions-viewer positive and negative cases.

#LC-284
#LC-285

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/lc-284-self-mention-highlight 2026-06-14 18:35:29 +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!320
No description provided.