Skip to content

Keep the API value card one height so its header stops reflowing (1.3.2) - #95

Merged
tsouth89 merged 1 commit into
mainfrom
fix/api-value-header-shift
Jul 21, 2026
Merged

Keep the API value card one height so its header stops reflowing (1.3.2)#95
tsouth89 merged 1 commit into
mainfrom
fix/api-value-header-shift

Conversation

@tsouth89

@tsouth89 tsouth89 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Fixes the Today / Yesterday / 30 days buttons jumping between rows on the Charts page.

Cause (introduced in 1.3.1)

1.3.1 moved the period-change label out of the ring's absolutely positioned centre into normal flow, so the card grows by a line whenever a period has a change to report. Today and 30 days have one, Yesterday does not, and Tokens never does — exactly the reported pattern.

That height change toggles the page scrollbar. Losing the scrollbar widens the content by ~15px, and the header wrapped below ~636px, so the switchers dropped to a second row and popped back on the next toggle.

Fix

  • The change label is always rendered and reserves its line, so the card holds one height across every period and metric. The trigger is gone.
  • The heading column shrinks and wraps its own text first (flex: 1 1 180px; min-width: 0), moving the header's wrap point from ~636px down to ~540px — well clear of a scrollbar's worth of width.

Verified

Measured against the real stylesheet and real markup headlessly:

  • Wrap threshold before: 640px one line / 632px wrapped. After: 560px one line / 520px wrapped.
  • Today card 238.5px vs Yesterday card 238.5px — identical height, header on one line in both.

Frontend 278 passed, tsc --noEmit clean.

Summary by CodeRabbit

  • Bug Fixes

    • Stabilized Charts page card heights when switching between Today, Yesterday, and 30-day periods.
    • Prevented page scrollbar changes and layout shifts when period metrics are unavailable.
    • Improved heading wrapping so controls remain consistently positioned.
  • Release

    • Updated the app to version 1.3.2.

The Today / Yesterday / 30 days buttons jumped between rows on the
Charts page. 1.3.1 moved the period-change label out of the ring's
absolutely positioned centre and into normal flow, so the card grew by
a line whenever a period had a change to report. Today and 30 days have
one, Yesterday does not, and Tokens never does, which is exactly the
pattern that was reported.

That height change added and removed the page scrollbar, and losing the
scrollbar widened the content by about 15px. The header wrapped below
roughly 636px, so the switchers dropped onto a second row and popped
back on the next toggle.

The change label is now always rendered and reserves its line, so the
card holds one height across every period and metric. The heading
column also shrinks and wraps its own text first, which moves the
header's wrap point down to about 540px and leaves it well clear of a
scrollbar's worth of width.

Prepares 1.3.2.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling 2d859f8 Commit Preview URL

Branch Preview URL
Jul 21 2026, 11:14 AM

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Charts API value cards now reserve space for period-change content and use stable flex sizing so headings wrap predictably without card-height or scrollbar shifts. Release metadata and changelog entries are updated for version 1.3.2.

Changes

Charts layout and release

Layer / File(s) Summary
Stabilize API value card layout
apps/desktop-tauri/src/components/TotalApiValueCard.tsx, apps/desktop-tauri/src/styles.css
The period-change span is always rendered, while flex sizing and fixed line-height rules stabilize heading wrapping, switcher placement, and card height.
Update 1.3.2 release metadata
apps/desktop-tauri/package.json, apps/desktop-tauri/src-tauri/Cargo.toml, apps/desktop-tauri/src-tauri/tauri.conf.json, rust/Cargo.toml, version.env, CHANGELOG.md
Application and crate versions are updated to 1.3.2, the build number is incremented to 100, and the changelog records the layout fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: finesssee

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main UI/layout fix in the PR and is specific enough for history scanning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/api-value-header-shift

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
apps/desktop-tauri/package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

apps/desktop-tauri/src-tauri/tauri.conf.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop-tauri/src/components/TotalApiValueCard.tsx`:
- Around line 231-237: Ensure the reserved period-change slot renders in both
populated and no-data states of TotalApiValueCard, rather than only inside the
!model.isEmpty branch. Move the existing span into a wrapper shared by both
branches or add an equivalent empty slot to the no-data branch, preserving
consistent card height when switching periods, and add a regression test
covering that transition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0831aae5-84ad-4c46-bc4d-9bbf1ec34a65

📥 Commits

Reviewing files that changed from the base of the PR and between a5c52eb and 2d859f8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • CHANGELOG.md
  • apps/desktop-tauri/package.json
  • apps/desktop-tauri/src-tauri/Cargo.toml
  • apps/desktop-tauri/src-tauri/tauri.conf.json
  • apps/desktop-tauri/src/components/TotalApiValueCard.tsx
  • apps/desktop-tauri/src/styles.css
  • rust/Cargo.toml
  • version.env

Comment on lines 231 to +237
{/* Below the ring, not inside it: the change label collided with the
stroke once the total needed the full centre. */}
{periodChangeLabel && (
<span className="api-value-card__period-change">{periodChangeLabel}</span>
)}
stroke once the total needed the full centre. Rendered even when
empty so the card keeps one height across periods and metrics —
a shrinking card toggled the scrollbar and reflowed the header. */}
<span className="api-value-card__period-change">
{periodChangeLabel ?? ""}
</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reserve the slot for empty periods too.

This span is still inside the !model.isEmpty branch. When a period has no provider data, the component renders only the status paragraph and skips the reserved slot, so switching between populated and empty periods can still change the card height. Move the slot into a wrapper shared by both branches, or render an equivalent empty slot in the no-data branch, and add a regression test for that transition.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop-tauri/src/components/TotalApiValueCard.tsx` around lines 231 -
237, Ensure the reserved period-change slot renders in both populated and
no-data states of TotalApiValueCard, rather than only inside the !model.isEmpty
branch. Move the existing span into a wrapper shared by both branches or add an
equivalent empty slot to the no-data branch, preserving consistent card height
when switching periods, and add a regression test covering that transition.

@tsouth89
tsouth89 merged commit 8ea0222 into main Jul 21, 2026
10 of 11 checks passed
@tsouth89
tsouth89 deleted the fix/api-value-header-shift branch July 21, 2026 11:19
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