fix(messages): collapsed long messages work with the keyboard and on any background (#343) #358

Merged
jared merged 1 commits from fix/collapsible-messages into lotus 2026-10-12 16:44:00 -04:00
Owner

Fixes #343.

Changes

  • Keyboard: tabbing into a link in the hidden part used to scroll the overflow: hidden box itself, cutting off the top until a remount. Focus inside now expands the message, and collapsing resets the scroll.
  • Screen readers: "Read more" / "Show less" is announced as a toggle (aria-expanded, aria-controls), and the arrows are aria-hidden.
  • Fade: it's a mask on the content instead of a gradient in a fixed surface colour, so there's no band in bubble layout, on highlighted messages or over chat backgrounds.
  • Font size: the cap is 20rem instead of 320px, so a larger font shows the same number of lines.

Verified (headless, a 41-line message with a link on the last line):

  • aria-expanded="false" while collapsed;
  • focusing the link expands the message (aria-expanded="true", no clipping);
  • bubble layout fades into the bubble with no band (screenshot below).

Bubble layout after

tsc clean · unit tests pass · ESLint/Prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #343. **Changes** - **Keyboard:** tabbing into a link in the hidden part used to scroll the `overflow: hidden` box itself, cutting off the top until a remount. Focus inside now **expands** the message, and collapsing resets the scroll. - **Screen readers:** "Read more" / "Show less" is announced as a toggle (`aria-expanded`, `aria-controls`), and the arrows are `aria-hidden`. - **Fade:** it's a **mask on the content** instead of a gradient in a fixed surface colour, so there's no band in bubble layout, on highlighted messages or over chat backgrounds. - **Font size:** the cap is **20rem** instead of 320px, so a larger font shows the same number of lines. **Verified** (headless, a 41-line message with a link on the last line): - `aria-expanded="false"` while collapsed; - focusing the link expands the message (`aria-expanded="true"`, no clipping); - bubble layout fades into the bubble with no band (screenshot below). ![Bubble layout after](https://code.lotusguild.org/attachments/2d2889d9-ee9b-4366-828f-da4912a34fb9) `tsc` clean · unit tests pass · ESLint/Prettier clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-12 15:31:53 -04:00
fix(messages): collapsed long messages work with the keyboard and on any background (#343)
CI / Build & Quality Checks (pull_request) Successful in 3m4s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 8s
CI / Playwright smoke (e2e) (pull_request) Successful in 16m15s
70f1d640ed
- Tab into a link in the hidden part used to scroll the overflow:hidden box
  itself (top cut off, and it stayed that way); focus inside now expands
  the message, and collapsing resets the scroll.
- "Read more" / "Show less" is announced as a toggle (aria-expanded,
  aria-controls); the arrows are aria-hidden.
- The fade is a mask on the content instead of a gradient in a fixed
  surface colour, so there's no band in bubble layout, on highlights or
  over chat backgrounds.
- The cap is 20rem instead of 320px, so a larger font shows as many lines.

Verified headless on a 41-line message with a link on the last line:
aria-expanded false → focusing the link expands it (aria-expanded true,
no clipping); bubble layout fades into the bubble with no band.

Fixes #343

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit fe61352d88 into lotus 2026-10-12 16:44:00 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#358