Skip to content

fix(notifications): stop follow-back button layout shift and gap#6334

Merged
tsahimatsliah merged 2 commits into
mainfrom
claude/follow-back-layout-shift-81b9cd
Jul 17, 2026
Merged

fix(notifications): stop follow-back button layout shift and gap#6334
tsahimatsliah merged 2 commits into
mainfrom
claude/follow-back-layout-shift-81b9cd

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 17, 2026

Copy link
Copy Markdown
Member

Changes

Fixes the "Follow back" row in the Activity/notifications feed, which caused layout shift on scroll and left a large gap under the headline.

  • Layout shift on scroll: the button was gated behind {inView && ...} inside a zero-height container, so each row's follow-status query fired only once the row entered view — then the h-8 button popped in, grew the row, and jerked the rows below it. Now the button's height is reserved up front (flex min-h-8 items-center, matching ButtonSize.Small = h-8), so the row height stays constant whether or not the button has mounted/resolved. The lazy inView query is preserved.
  • Huge gap: dropped the redundant stacked margins (mt-1 on the wrapper span + mt-3 on the button) so the button sits tight under the headline, relying on the parent flex-col gap-1 for spacing.

Manual Testing

The notifications page is auth-gated, so worth a visual sanity check on a real feed. The reserved-height value matches the button's actual height exactly, so there should be no residual shift.

Preview domain

https://claude-follow-back-layout-shift.preview.app.daily.dev

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Jul 17, 2026 2:33pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jul 17, 2026 2:33pm

Request Review

The "Follow back" action on "is now following you" rows caused a layout
shift while scrolling and sat under an oversized gap:

- Reserve the button's height up front (flex min-h-8 items-center) so the
  row keeps a constant height instead of growing when the lazily-mounted
  button pops in as the row scrolls into view.
- Drop the redundant stacked margins (mt-1 wrapper + mt-3 button) so the
  action sits tight under the headline.
- Render it as a plain text link (!px-0, underline on hover) aligned to
  the row's content edge, replacing the padded Tertiary button whose
  hover fill overhung the label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tsahimatsliah
tsahimatsliah merged commit b83147b into main Jul 17, 2026
13 checks passed
@tsahimatsliah
tsahimatsliah deleted the claude/follow-back-layout-shift-81b9cd branch July 17, 2026 15:02
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.

2 participants