Skip to content

fix(overview): keep ProjectionCard 'Revenue so far' label inside card#33

Open
Ehsan-saradar wants to merge 1 commit intomainfrom
fix/projection-card-label-overflow
Open

fix(overview): keep ProjectionCard 'Revenue so far' label inside card#33
Ehsan-saradar wants to merge 1 commit intomainfrom
fix/projection-card-label-overflow

Conversation

@Ehsan-saradar
Copy link
Copy Markdown
Contributor

Summary

  • Detect when the Revenue so far label inside ProjectionCard would overflow the card and flip it to the left side of the marker line, with right-aligned text so the text edge stays aligned with the line.
  • Marker line position is unchanged (left: ${progressPercent}% is preserved); only the surrounding label is re-anchored via transform: translateX(-100%) and flex-row-reverse.
  • Overflow is detected dynamically with ResizeObserver, so it adapts to the actual track width (between min-w-[180px] and max-w-[280px]) and the actual label width (label/value text).

Closes #32

Test plan

  • Open the Overview tab; pick a date range / granularity that puts revenue progress at low (~30%), mid (~60%), and high (~90%) percentages
  • Verify that at low % the label sits to the right of the marker line (current behavior preserved)
  • Verify that at high % the label flips to the left of the marker line and stays inside the card
  • Verify the marker line is at the same horizontal position in both states
  • Resize the browser / change layout breakpoints and confirm the flip threshold reacts correctly

🤖 Generated with Claude Code

When progress is high, the label was anchored to the left of the marker
line and could overflow the card on the right. Detect overflow with a
ResizeObserver and flip the label to the left side of the line with
right-aligned text, keeping the marker line position unchanged.

Closes #32

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 2, 2026

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

Project Deployment Actions Updated (UTC)
analytics-dashboard Ready Ready Preview, Comment May 2, 2026 7:13am

Request Review

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.

Projection card: 'Revenue so far' label overflows card at high progress

1 participant