Skip to content

Fix home card layout stability during loading states - #2176

Merged
MusabShakeel576 merged 1 commit into
qafrom
claude/cool-euler-872z13
Jun 23, 2026
Merged

Fix home card layout stability during loading states#2176
MusabShakeel576 merged 1 commit into
qafrom
claude/cool-euler-872z13

Conversation

@MusabShakeel576

Copy link
Copy Markdown
Contributor

Summary

This PR fixes layout instability on the home screen where stat cards (Cashback and Savings) would shrink while loading and grow back once data resolved. The changes ensure consistent card heights across all states and reduce unnecessary polling of card details.

Key Changes

  • Fixed stat card height consistency: Added a fixed STAT_VALUE_HEIGHT constant to both HomeCashbackCard and HomeSavingsStatCard that applies to both the loading skeleton and loaded content. This prevents the cards from changing size during the loading transition.

  • Improved skeleton and text alignment: Wrapped stat values in a container with justifyContent: 'flex-end' and added lineHeight styling to ensure proper vertical alignment of both skeleton loaders and actual content.

  • Reduced card details polling: Changed cardDetailsQueryOptions to use a 60-second stale time instead of 5-second polling. Card details (cashback totals, percentages, metadata) change infrequently and don't need constant polling. The live card balance is fetched separately via the cardBalance query which continues to poll every 5 seconds.

  • Simplified button styling: Updated the CTA button in FinishSetupModal to use the variant="brand" prop instead of inline style classes for better maintainability.

Implementation Details

  • The STAT_VALUE_HEIGHT is calculated as Math.round(fontSize(1.875) * 1.3) to match the font size with appropriate line height multiplier
  • Both cashback and savings cards use the same height constant to maintain visual alignment
  • Removed the h-8 class from skeletons since height is now controlled via inline styles
  • The polling reduction should improve performance by reducing unnecessary network requests and preventing the cashback card from repeatedly showing its loading state

https://claude.ai/code/session_011pAKfpRFjbH5TJSfNimjJy

…bled-looking CTA

Three native home-screen fixes:

1. Cashback/Savings stat cards no longer change height when the amount
   loads. The skeleton was a fixed 32px (`h-8`) while the loaded amount's
   line box is taller, so the card shrank during loading and grew back.
   Both cards now reserve a shared fixed value height (STAT_VALUE_HEIGHT)
   for the skeleton and the loaded value, so they stay the same height in
   every state and match each other.

2. Cashback no longer re-shows its loader every few seconds. The card
   details query was polling every 5s (`refetchInterval: 5_000`). Card
   details (cashback totals, percentage) change rarely and the live card
   balance is already polled separately, so the interval is removed and
   staleTime raised to 60s.

3. The "Finish setting up" CTA no longer looks disabled. It used
   `bg-button-earning` (brand green at 20% opacity), which renders as a
   muted dark green on the dark modal background. Switched to the standard
   `variant="brand"` solid-green button used elsewhere in the app.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011pAKfpRFjbH5TJSfNimjJy
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored Jun 22, 2026 7:33am
solid-app-staging Ignored Ignored Jun 22, 2026 7:33am

Request Review

@MusabShakeel576
MusabShakeel576 merged commit f68970d into qa Jun 23, 2026
5 checks passed
@MusabShakeel576
MusabShakeel576 deleted the claude/cool-euler-872z13 branch June 23, 2026 08:43
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