Skip to content

fix(landing): remove cursor lerp causing laggy tracking in collaboration section#4727

Merged
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/brisbane-v2
May 22, 2026
Merged

fix(landing): remove cursor lerp causing laggy tracking in collaboration section#4727
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/brisbane-v2

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Removed the rAF-based lerp (CURSOR_LERP_FACTOR = 0.3) that smoothed the fake YouCursor in the landing page collaboration section — caused visible trail/lag since the native cursor is hidden
  • handleMouseMove now sets cursor position directly for 1:1 tracking; dropped the useEffect animation loop and unused refs
  • Replaced hardcoded collaboration-heading id with useId() to satisfy biome's useUniqueElementIds rule

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 22, 2026 7:33pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 22, 2026

PR Summary

Low Risk
Low risk UI-only change in the landing page that adjusts cursor-follow behavior and accessibility ids, with no backend or data-handling impact.

Overview
Removes the rAF/lerp-based smoothing for the faux YouCursor in the landing page collaboration section and updates mouse handling to set cursor position directly for 1:1 tracking (eliminating visible lag/trailing when the native cursor is hidden).

Updates the section’s aria-labelledby wiring by replacing the hardcoded collaboration-heading id with a useId()-generated id to ensure unique element IDs.

Reviewed by Cursor Bugbot for commit d41e0ea. Configure here.

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 22, 2026

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Greptile Summary

Removes the requestAnimationFrame-based lerp (CURSOR_LERP_FACTOR = 0.3) that made the YouCursor trail behind the real pointer, replacing it with direct setCursorPos calls in handleMouseMove. The useId() swap for the heading id satisfies Biome's useUniqueElementIds rule.

  • Removed the useEffect animation loop, targetPos ref, and animationRef ref; handleMouseMove now sets cursor state synchronously for 1:1 tracking.
  • Replaced the hardcoded \"collaboration-heading\" id with useId() on both the <section aria-labelledby> and <h2 id>, and updated the JSDoc accordingly.

Confidence Score: 5/5

Safe to merge — the change is scoped to a single landing page component and removes animation complexity without altering any data flow or business logic.

The diff removes an rAF loop and two refs, replaces a lerp with a direct state update, and swaps a hardcoded string id for useId(). All three changes are straightforward with no side-effects on the rest of the app.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/(landing)/components/collaboration/collaboration.tsx Lerp/rAF animation loop removed; cursor position now set directly in event handlers. useId() replaces hardcoded heading id. No functional regressions introduced.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Mouse enters section] -->|onMouseEnter| B[setCursorPos + setIsHovering true]
    B --> C[YouCursor renders at viewport coords]
    D[Mouse moves over section] -->|onMouseMove| E[setCursorPos directly]
    E --> C
    F[Mouse leaves section] -->|onMouseLeave| G[setIsHovering false]
    G --> H[YouCursor returns null]

    subgraph Removed
        direction TB
        R1[rAF loop every frame] -->|lerp 0.3| R2[setCursorPos lagging behind]
    end

    style Removed fill:#fef2f2,stroke:#fca5a5
Loading

Reviews (3): Last reviewed commit: "fix(landing): remove cursor lerp causing..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/brisbane-v2 branch from 5bfdbe1 to ac8b691 Compare May 22, 2026 19:00
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile-apps Thanks — addressed the P2 JSDoc note in commit ddc2f69. Updated the SEO block to describe the new useId()-generated heading id and clarified that id="collaboration" is the stable URL anchor.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

The JSDoc update looks good. The comment now accurately documents both IDs:

  • id="collaboration" → stable URL anchor for in-page navigation
  • aria-labelledby={headingId}useId()-generated id linking the <h2> for accessibility

The distinction is clear and the rest of the implementation (direct position tracking, no animation loop) is all in order. LGTM. ✅

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/(landing)/components/features/features.tsx Outdated
Comment thread apps/sim/app/(landing)/components/features/features.tsx Outdated
Comment thread apps/sim/app/_styles/globals.css Outdated
Comment thread apps/sim/app/_styles/globals.css Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/text-editor.tsx Outdated
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/brisbane-v2 branch from 40c1b4e to d41e0ea Compare May 22, 2026 19:33
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

Reverted the biome --unsafe mass auto-fix commit — it introduced several real bugs (broke StreamWriter.encoder build, merged Tailwind classes in features.tsx and editor.tsx, removed necessary !important in globals.css, SSR-unsafe document? access in text-editor.tsx). PR is back to a single focused commit touching only the landing-page cursor fix. All bot-flagged P1/P2 issues from the prior commit are no longer in the diff.

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d41e0ea. Configure here.

@waleedlatif1 waleedlatif1 merged commit 500f35a into staging May 22, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/brisbane-v2 branch May 22, 2026 19:58
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