Skip to content

fix: [data-view] fix timeline tick labels and card heights under scaling - #1008

Open
Shreyag02 wants to merge 2 commits into
mainfrom
fix/timeline-demo-card-heights
Open

Shreyag02 wants to merge 2 commits into
mainfrom
fix/timeline-demo-card-heights

Conversation

@Shreyag02

@Shreyag02 Shreyag02 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • buildAxis subtracts a small epsilon before taking the ceiling of label floor / unit width. Dividing the unit width by scaling can leave a value a hair under an exact multiple (29.4 / 1.05 = 27.999999999999996), which thinned the axis one step too far and dropped tick labels.

  • Adds tests for widths on exact spacing boundaries.

  • The timeline demo and stress-page cards use calc(64px * var(--rs-scaling, 1)) for their height, so they stay inside the default lane height, which scales with the theme.

  • The timeline docs page says to scale an explicit card height when the scaling can change.

  • I have followed the pull request section of the contributing guide.

buildAxis takes the ceiling of the label floor over the unit width. The
call site divides the unit width by scaling, so a width on an exact
multiple of the floor can land a hair under it (29.4 / 1.05 =
27.999999999999996) and thin one step too far. Subtract a small epsilon
before the ceiling.
The default estimatedRowHeight scales with the theme's scaling, but the
demo cards had a fixed 64px height. At a larger scaling the card content
grew while the card did not. Scale the card height with --rs-scaling and
document this on the timeline page.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
apsara Ready Ready Preview Nov 16, 2026 5:22am UTC

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Timeline task card examples now scale their height with --rs-scaling, defaulting to 1. The documentation describes how theme scaling affects the default estimatedRowHeight and how to scale an explicit card height. Automatic axis-label spacing subtracts a small epsilon before rounding up. Tests cover spacing thresholds, timeline units, and theme scaling values.

Suggested reviewers: rohanchkrabrty

Merge Risk: Minimal · up to 2fa8d

This change makes the timeline demo cards scale with the theme and corrects a floating-point edge case in axis-label spacing. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
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.
Title check Passed The title names the main change: a fix to timeline tick labels and card heights under theme scaling. The changeset matches it. It adds an epsilon in buildAxis for tick label thinning, scales TaskCard …
Description check Passed The description states the epsilon fix in buildAxis, the new boundary tests, the calc(64px * var(--rs-scaling, 1)) card height change in the demo and stress page, and the docs update. All of these app…
Full details: Title check

Explanation

The title names the main change: a fix to timeline tick labels and card heights under theme scaling. The changeset matches it. It adds an epsilon in buildAxis for tick label thinning, scales TaskCard heights with --rs-scaling in the demo and stress page, and updates the docs and tests.

Full details: Description check

Explanation

The description states the epsilon fix in buildAxis, the new boundary tests, the calc(64px * var(--rs-scaling, 1)) card height change in the demo and stress page, and the docs update. All of these appear in the changeset, so the description is on topic.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.6.3)

packages/react/components/data-view/__tests__/timeline.test.tsx

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

packages/react/components/data-view/utils/time-scale.tsx

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 475ff11d-7962-4a4e-bcab-d10cd500a2a8
Commits

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

Files selected for processing: 2

  • packages/react/components/data-view/__tests__/timeline.test.tsx
  • packages/react/components/data-view/utils/time-scale.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@1008

commit: 2fa8d2d

@Shreyag02 Shreyag02 changed the title fix: [data-view] fix timeline tick labels and card heights under scaling fix: [data-view] scale timeline demo card heights with theme Nov 16, 2026
@Shreyag02
Shreyag02 changed the base branch from main to fix/timeline-label-thinning-boundary November 16, 2026 05:44
@Shreyag02
Shreyag02 added this pull request to stack #1010 November 16, 2026 05:44
@Shreyag02
Shreyag02 removed this pull request from stack #1010 November 16, 2026 05:53
@Shreyag02
Shreyag02 changed the base branch from fix/timeline-label-thinning-boundary to main November 16, 2026 05:53
@Shreyag02 Shreyag02 self-assigned this Nov 16, 2026
@Shreyag02 Shreyag02 changed the title fix: [data-view] scale timeline demo card heights with theme fix: [data-view] fix timeline tick labels and card heights under scaling Nov 16, 2026

This branch was successfully deployed

1 active deployment
Preview — 2fa8d2d0 Deployed Nov 16, 2026 by vercel[bot]
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