Skip to content

🔧 fix: clamp time display to 0-100% to prevent negative ms values#807

Open
guangzan wants to merge 1 commit intoelysiajs:mainfrom
guangzan:fix/beyond-negative-time-display
Open

🔧 fix: clamp time display to 0-100% to prevent negative ms values#807
guangzan wants to merge 1 commit intoelysiajs:mainfrom
guangzan:fix/beyond-negative-time-display

Conversation

@guangzan
Copy link

@guangzan guangzan commented Mar 2, 2026

When mouse moves outside the left edge of the OpenTelemetry timeline, the displayed time could show negative values (e.g. -0.03ms). Clamp left percentage to [0, 100] range so time always displays 0ms-25ms.

image

After:

image

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the left position could exceed valid bounds, ensuring it now stays within the acceptable range.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Warning

Rate limit exceeded

@guangzan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cfb420c and 6201b6b.

📒 Files selected for processing (1)
  • docs/components/fern/beyond.vue

Walkthrough

A bounds-checking modification ensures the left position value in the move function is clamped between 0 and 100, preventing out-of-range positioning. The computed left value now undergoes range validation before assignment.

Changes

Cohort / File(s) Summary
Position Bounds Clamping
docs/components/fern/beyond.vue
Added clamping to constrain computed _left value to the range [0, 100] in the move function, replacing the previous unchecked assignment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit bounds through Vue with glee,
Left and right, now clamped they'll be!
From zero to one hundred we stay,
No wild positions go astray! 🐰
Between the lines, precision reigns,
Our values safe from all constraints.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: clamping the time display to prevent negative values in the timeline component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@guangzan guangzan changed the title fix: clamp time display to 0-100% to prevent negative ms values 🔧 fix: clamp time display to 0-100% to prevent negative ms values Mar 2, 2026
@guangzan guangzan force-pushed the fix/beyond-negative-time-display branch 2 times, most recently from 719f3c6 to 625d187 Compare March 2, 2026 08:24
When mouse moves outside the left edge of the OpenTelemetry timeline,
the displayed time could show negative values (e.g. -0.03ms). Clamp
left percentage to [0, 100] range so time always displays 0ms-25ms.
@guangzan guangzan force-pushed the fix/beyond-negative-time-display branch from 625d187 to 6201b6b Compare March 2, 2026 08:29
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