Skip to content

fix(cards): drop the award action and match the glass bar sizing on feed cards - #6394

Open
tsahimatsliah wants to merge 8 commits into
mainfrom
claude/award-button-visibility-c29508
Open

fix(cards): drop the award action and match the glass bar sizing on feed cards#6394
tsahimatsliah wants to merge 8 commits into
mainfrom
claude/award-button-visibility-c29508

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 30, 2026

Copy link
Copy Markdown
Member

Three fixes to the feed card action bar.

1. Impressions and awards competed for the same slot. The gate was showAwardAction && (!impressionsEnabled || isLaptop), so with card_impressions on the award action was only dropped below laptop and still rendered on desktop next to the impressions stat. Impressions replace that button, so awards are now hidden on every viewport for all feed card variants (grid, list, signal) in both engagement bar variants.

2. The award button leaked onto authorless cards for logged out visitors. isSameUser was user?.id === post?.author?.id — for an anonymous visitor on a post with no author that compares undefined to undefined and evaluates to true, so the button rendered on exactly the cards where an award is impossible, and stayed hidden on the ones that do have an author. Now requires a real logged in id.

3. The impressions counter sat 5px from the card edge, reading as if it touched the rounded corner. The default bar now uses the sizing the floating glass pill already had since #6260: XSmall buttons, 16px icons, !pl-0.5 pr-0.5 around counters, and asymmetric pl-1 pr-2.5 row padding. The two bars now have identical internal geometry — first icon 9px in, trailing number 13px from the edge. The mobile-only typo-caption1 counter is gone; counts are footnote everywhere, like the glass bar.

Measured in Storybook across 320px and the 272px min card width, with 36·3·52.4K, 100·80·100K, 200·80·234.5K and 10K·999·1.2M: no row overflow and no overlap in any combination. Tightest case (272px, 200·80·234.5K) keeps a 4px gap between adjacent actions, and the trailing number stays a constant 11px from the card edge regardless of counts.

With the card_impressions flag off, feed cards keep the award action exactly as on main; the sizing change applies either way. The award action on the post page, reader rail and focus card is untouched.

Tests

  • ActionButtons.spec.tsx — both engagement bar variants x grid/list/signal: award absent and impressions present when the flag is on, award present when it is off. 6 of the 12 cases fail against the previous gate.
  • PostAwardAction.spec.tsx — both variants: hidden for logged out and logged in users on authorless posts, rendered on your own post and when the author can be awarded.

🤖 Generated with Claude Code

Preview domain

https://claude-award-button-visibility-c.preview.app.daily.dev

…e on

Impressions take the award slot on the right of the engagement bar, so the
two never coexist. Awards were only dropped below laptop; now they are gone
on every viewport for grid, list and signal cards, in both engagement bar
variants. With the card_impressions flag off, cards are unchanged.

Also fixes the award button rendering for logged out visitors: `user?.id ===
post?.author?.id` compared undefined to undefined on authorless posts, so
`isSameUser` was true and the button appeared on exactly the cards where an
award is impossible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 30, 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 30, 2026 1:51pm
storybook Building Building Preview Jul 30, 2026 1:51pm

Request Review

The impressions counter sat 5px from the card edge on the default bar, so
the number read as touching the rounded corner. Adopt the sizing the glass
pill already uses (FeedCardGlassActions, #6260): XSmall buttons, 16px icons,
`!pl-0.5 pr-0.5` around counters and asymmetric `pl-1 pr-2.5` row padding,
which gives the two bars identical internal geometry — first icon 9px in,
trailing number 13px from the edge, verified at the 272px min card width.

Drops the mobile-only `typo-caption1` counter: the count is now footnote
everywhere, matching the glass bar.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tsahimatsliah tsahimatsliah changed the title fix(cards): drop the award action from feed cards when impressions are on fix(cards): drop the award action and match the glass bar sizing on feed cards Jul 30, 2026
tsahimatsliah and others added 2 commits July 30, 2026 10:33
The v2 bar pushed its trailing action up to 41px outside the card on the
narrowest grid track. Buttons never shrink here (global flex-shrink: 0), so
six actions plus counters have to fit on intrinsic widths alone, and at
Small size (32px buttons, 20px icons) they need up to 288px inside a 262px
row. Two changes close the gap:

- new `tight` CardAction density (XSmall buttons, 16px icons), used by the
  feed bar only, so v2 matches the v1 and glass bars.
- no `gap` on the `feedCard` CardActionBar layout: `justify-between` already
  spreads the actions when there is slack, and the gap only added 20px the
  card could not give back.

Both default bars now sit at a 36px row height (`py-1.5` around the h-6
buttons) so shrinking the actions doesn't make the bar read as cramped.

Verified at 272px and 320px with 36·3·52.4K, 100·80·100K, 200·80·234.5K and
10K·999·1.2M: nothing escapes its container in any combination.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Renders v1 / v2 / glass feed bars at 320px and the 272px min card width
across four stat loads, so the width contract stays checkable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ensity

The /dev/buttons width-contract vignettes documented `density="compact"` as
the grid-card rule, which overflows the 272px MIN once a card carries six
actions with counters. They now use `tight`, matching what the feed ships.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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