Skip to content

Conversation

@thomasyuill-livekit
Copy link
Contributor

@thomasyuill-livekit thomasyuill-livekit commented Jan 23, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved mouse input handling during interpolation to ensure reliable starting points.
  • Refactor

    • Enhanced type safety with improved type annotations.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

⚠️ No Changeset found

Latest commit: 601764c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

This PR makes type safety improvements and refines interpolation logic. The first change adds a type annotation to a motion props constant using the MotionProps type. The second modifies mouse position interpolation to handle undefined values with fallbacks before lerping toward the last recorded position.

Changes

Cohort / File(s) Summary
Type Annotations
packages/shadcn/components/agents-ui/agent-control-bar.tsx
Added MotionProps type import and annotated MOTION_PROPS constant for improved type safety.
Interpolation Logic
packages/shadcn/components/agents-ui/react-shader-toy.tsx
Modified drawScene lerp logic for iMouse to compute current X/Y values with fallbacks of 0 before interpolating toward last recorded position, ensuring defined starting points.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Wiggles nose with delight
Types now guard the motion props so bright,
While mice glide smooth without a fright,
With fallbacks catching undefined fate,
Lerping gently, never late! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'chore(shadcn): clean up' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes made to the codebase. Consider using a more descriptive title such as 'chore(shadcn): add MotionProps type annotation and improve mouse lerp handling' to clearly communicate the main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee1daf and 601764c.

📒 Files selected for processing (2)
  • packages/shadcn/components/agents-ui/agent-control-bar.tsx
  • packages/shadcn/components/agents-ui/react-shader-toy.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (3)
packages/shadcn/components/agents-ui/agent-control-bar.tsx (2)

7-7: LGTM!

Good use of type-only import syntax for MotionProps.


45-63: LGTM!

Adding the explicit MotionProps type annotation improves type safety and enables better IDE support for the motion configuration object.

packages/shadcn/components/agents-ui/react-shader-toy.tsx (1)

841-846: LGTM!

The nullish coalescing fallbacks provide defensive handling for array element access, which is good practice especially if noUncheckedIndexedAccess is enabled. The lerp logic correctly interpolates from the current position toward the last recorded mouse position each frame.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
LiveKitRoom only 6 KB (0%)
LiveKitRoom with VideoConference 32.46 KB (0%)
All exports 43.37 KB (0%)

@thomasyuill-livekit thomasyuill-livekit merged commit a0afe15 into main Jan 23, 2026
7 checks passed
@thomasyuill-livekit thomasyuill-livekit deleted the ty/fix-shadcn-react-shader-toy-ts branch January 23, 2026 20:02
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.

3 participants