Skip to content

Fix forecast card rows not filling card width on storefront#5034

Merged
aseckin merged 3 commits into
mainfrom
fix/storefront-forecast-card-width
Jul 17, 2026
Merged

Fix forecast card rows not filling card width on storefront#5034
aseckin merged 3 commits into
mainfrom
fix/storefront-forecast-card-width

Conversation

@aseckin

@aseckin aseckin commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
image

(ss of the problem)

Problem

On the storefront, Multiple Choice card option rows render narrower than the card, leaving dead space on the right. The same cards in the feed look correct.

Root cause

PercentageForecastCard and NumericForecastCard had a bare relative root with no width. That's invisible in most layouts, where a block element fills its parent — but both consumer card shells lay content out as flex flex-col items-center, and in a column flex container align-items governs the horizontal axis. So the cards sized to fit-content and the rows collapsed to the widest label.

The feed and the similar-questions sidebar each worked around this with a <div className="w-full"> wrapper. The storefront card was the one call site without one, so it was the only place the bug was visible.

Fix

Add w-full to the two roots rather than a third copy of the wrapper. These two were the outliers — their siblings DateForecastCard and TimeSeriesChart, and their own child ForecastCardWrapper, already declare w-full. This covers multiple choice, binary groups, numeric/discrete groups and date groups at once (all of them had the bug on the storefront; MC is just what got reported).

Also passes buttonVariant="minimal" on the storefront card: it's fully covered by an absolute z-100 Link overlay, so the "N others" chevron button underneath could never be clicked. The feed already passes minimal for this reason.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the layout of numeric and percentage forecast cards so they consistently use the available width.
    • Updated homepage forecast cards with a more streamlined button presentation.

PercentageForecastCard and NumericForecastCard had a bare `relative` root
with no width. That is invisible in most layouts, where a block element
fills its parent, but both consumer card shells lay content out as
`flex flex-col items-center` — and in a column flex container, align-items
governs the horizontal axis, so the cards sized to fit-content instead of
stretching. The option rows collapsed to the widest label.

The feed and the similar-questions sidebar each worked around this with a
`<div className="w-full">` wrapper; the storefront card was the one call
site without one, so it was the only place the bug was visible. Fix the
roots instead of adding a third wrapper — their siblings DateForecastCard
and TimeSeriesChart, and their own child ForecastCardWrapper, already
declare w-full. This covers multiple choice, binary groups, numeric and
discrete groups, and date groups at once.

Also pass buttonVariant="minimal" on the storefront card: it is fully
covered by an absolute z-100 Link overlay, so the "N others" chevron
button underneath could never be clicked. The feed already passes minimal
for the same reason.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3f9a6fef-a2c1-460e-9782-42f2f35f1507

📥 Commits

Reviewing files that changed from the base of the PR and between b506092 and 4d5194b.

📒 Files selected for processing (3)
  • front_end/src/app/(storefront)/components/homepage_post_card.tsx
  • front_end/src/components/consumer_post_card/group_forecast_card/numeric_forecast_card.tsx
  • front_end/src/components/consumer_post_card/group_forecast_card/percentage_forecast_card.tsx

📝 Walkthrough

Walkthrough

GroupForecastCard now uses a minimal button variant on the homepage, and numeric and percentage forecast cards now include full-width root containers while preserving their conditional flex layout.

Changes

Group forecast card presentation

Layer / File(s) Summary
Forecast card presentation wiring and layout
front_end/src/app/(storefront)/components/homepage_post_card.tsx, front_end/src/components/consumer_post_card/group_forecast_card/*
The homepage passes buttonVariant="minimal" to GroupForecastCard; numeric and percentage forecast card containers now always include w-full while retaining conditional flex classes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: ncarazon, cemreinanc

Poem

I’m a rabbit with cards in a row,
Making forecast buttons softly glow.
Full width from ear to ear,
With tidy layouts clear—
Hop, review, and let the pixels flow!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main storefront width fix for forecast card rows.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/storefront-forecast-card-width

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aseckin
aseckin requested a review from ncarazon July 16, 2026 07:14
@aseckin
aseckin marked this pull request as ready for review July 16, 2026 07:14
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Cleanup: Preview Environment Removed

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App Deleted
🗄️ PostgreSQL Branch Deleted
⚡ Redis Database Deleted
🔧 GitHub Deployments Removed
📦 Docker Image Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-07-17T13:05:17Z

@aseckin
aseckin merged commit 7fc4d8b into main Jul 17, 2026
12 of 13 checks passed
@aseckin
aseckin deleted the fix/storefront-forecast-card-width branch July 17, 2026 13:05
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