fix(reactions): the reactions row no longer flickers or loses its spacing (#305) #377

Merged
jared merged 1 commits from fix/reactions-collapse-loop into lotus 2026-10-17 20:07:28 -04:00
Owner

Fixes #305.

There were two bugs in the one-row "+N" collapse:

  • Endless flip: measure() used the border box, which grows by 4 px while collapsed (margin -2 / padding 2). A row within 4 px of fitting flipped collapsed↔expanded every frame: flicker, layout shifts, and about 11 % of a core per looping message. It now measures the content box.
  • Lost spacing: the collapsed style used the margin shorthand, which overrode the timeline's marginTop and, once removed, cleared it. The row then stuck to the message text. Longhand margins now keep marginTop (minus 2 px).

Verified headless with 12 reactions and a viewport sweep from 1300 to 1400 px:

worst flips / 1.5 s margin-top after
before 90 at 1344 px 0px
after 0 at every width 8px

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

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #305. There were two bugs in the one-row "+N" collapse: - **Endless flip:** `measure()` used the **border box**, which grows by 4 px while collapsed (`margin -2` / `padding 2`). A row within 4 px of fitting flipped collapsed↔expanded every frame: flicker, layout shifts, and about 11 % of a core per looping message. It now measures the **content box**. - **Lost spacing:** the collapsed style used the `margin` shorthand, which overrode the timeline's `marginTop` and, once removed, cleared it. The row then stuck to the message text. **Longhand margins** now keep `marginTop` (minus 2 px). **Verified** headless with 12 reactions and a viewport sweep from 1300 to 1400 px: | | worst flips / 1.5 s | margin-top after | |---|---|---| | before | **90** at 1344 px | 0px | | after | **0** at every width | **8px** | `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-17 18:26:19 -04:00
fix(reactions): the reactions row no longer flickers or loses its spacing (#305)
CI / Build & Quality Checks (pull_request) Successful in 3m3s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 13s
CI / Playwright smoke (e2e) (pull_request) Successful in 12m57s
1c62fb4722
Two bugs in the one-row "+N" collapse:
- measure() used the border box, which grows by 4 px while collapsed
  (margin -2 / padding 2), so a row within 4 px of fitting flipped
  collapsed↔expanded every frame (flicker, layout shifts, ~11 % of a core
  per looping message). It now measures the content box.
- The collapsed style used the `margin` shorthand, which overrode the
  timeline's marginTop and, when removed, cleared it; the row then stuck
  to the message text. Longhand margins keep marginTop (minus 2 px).

Verified headless (12 reactions, viewport sweep 1300–1400 px): before,
90 style flips in 1.5 s at 1344 px and margin-top 0px after a cycle;
now 0 flips at every width and margin-top stays 8px.

Fixes #305

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit b855eb505d into lotus 2026-10-17 20:07:28 -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#377