Skip to content

fix(v2): reaction counts rode high next to the emoji — align ink, not boxes - #867

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/reaction-baseline
Aug 6, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/reaction-baseline

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Closes the desktop half of #865 (Sam's HQ screenshot: count digit visibly above the emoji's center; mobile fine).

The measurement trap, for the record

The chip flex-centers its two spans, and the spans' layout boxes are perfectly centered — probed live with getBoundingClientRect: 0.00px offset on every chip, while the bug sat in plain sight. Apple Color Emoji ink extends below the baseline; digit ink does not, so box centering diverges from ink centering by a couple of pixels on desktop. The instrument measured the box; users see the ink. (Same lesson as the layout-invariants rule one layer down: verify what users see, not what the DOM reports.)

The fix — exact by construction, no nudged constants

  • align-items: baseline on the chip: digits hang on the emoji's baseline, which is how "👍 2" renders in plain inline text — the reference that looks right on every platform (and why mobile was already fine).
  • line-height: 22px (chip inner height) on the emoji span — with baseline on, this line box is the only thing vertically centering the pair; that's documented inline because shrinking it back to 1 top-hugs the chip.

Verified visually in-browser, current vs fixed side by side at 3× zoom: current reproduces the screenshot, fixed sits both glyphs on one baseline, chip geometry (24px pill) unchanged.

Guard

Added to v2-layout-invariants — both halves are load-bearing and invisible to jsdom. 21/21 invariants green; V2MessageBubble suite green.

Remaining in #865, deliberately untouched tonight: the triple .v2-msg__reaction definition cleanup (the "dead" block contributes the hover transition) and reactions being absent from the public read-only showcase view entirely.

… boxes

Reported by Sam during YC-interview prep with an HQ screenshot: on desktop,
the count digit sits visibly above the emoji's center; mobile renders fine.

Root cause is a measurement trap worth recording. The chip flex-centers its
two spans, and the spans' LAYOUT boxes are perfectly centered — probed live
with getBoundingClientRect: 0.00px offset, while the bug sat in plain sight.
Apple Color Emoji ink extends below the baseline; digit ink does not. Box
centering therefore diverges from ink centering by a couple of pixels on
desktop, in exactly the direction the screenshot shows. The instrument
measured the box; users see the ink.

Fix is two lines, exact by construction rather than by nudged constants:
align-items: baseline on the chip (digits hang on the emoji's baseline —
how "emoji + digit" renders in plain inline text, the reference that looks
right on every platform), and line-height: 22px (chip inner height) on the
emoji span, which becomes the sole vertical centering of the shared line.
Verified visually in-browser at 3x zoom, current vs fixed side by side;
chip geometry (24px pill) unchanged. Fixture-path block gets the same
alignment for parity.

Guarded in v2-layout-invariants (both halves are load-bearing and invisible
to jsdom): baseline on the button rule, 22px on the emoji span — shrink
either and the pair top-hugs the chip or the count rides high again.
@lilyshen0722
lilyshen0722 merged commit e0155b0 into main Aug 6, 2026
11 checks passed
lilyshen0722 added a commit that referenced this pull request Aug 18, 2026
…ore pattern (#869)

backend/node_modules (#818) and frontend/node_modules (#867) are committed
SYMLINKS pointing at an absolute path inside one operator worktree. They got
past .gitignore because 'node_modules/' (trailing slash) matches only
directories — a symlink named node_modules sails through 'git add -A'.

Measured blast radius before this fix:
- docker builds: SAFE. .dockerignore patterns are filepath.Clean'd, so
  'node_modules/' excludes the symlink from the context (verified empirically
  with positive+negative controls; the live backend image at e55f0c2 was
  already built from a symlink-carrying tree and succeeded).
- CI: SAFE. npm ci removes the symlink before installing; PR checks on both
  carrier PRs passed.
- every other checkout: NOT safe. 'git pull' exits 0 and silently replaces a
  real, populated node_modules directory with the dangling symlink (ignored
  files are expendable to checkout — reproduced in a scratch repo). On the
  one machine where the target resolves, everything silently uses a May-24
  worktree's dependencies instead of the tree's own: version skew with no
  error anywhere.

Fix: untrack both symlinks (git rm --cached — the author's local links are
untouched) and drop the trailing slash so the pattern matches the symlink
form too.

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant