Fix perf issue in collaboration section of landing page#3736
Fix perf issue in collaboration section of landing page#3736ShoeBoom wants to merge 11 commits intosimstudioai:mainfrom
Conversation
|
@ShoeBoom is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR fixes a performance issue in the landing page collaboration section by replacing a React-state-driven lerp/RAF cursor animation with a direct DOM mutation approach. On every Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Mouse enters section] --> B[handleMouseEnter]
B --> C[Set cursorRef.current.style.transform\n translate clientX-2, clientY-2]
C --> D[setIsHovering true]
D --> E[React re-render\n removes hidden class from YouCursor]
F[Mouse moves inside section] --> G[handleMouseMove]
G --> H[Set cursorRef.current.style.transform\n translate clientX-2, clientY-2\n NO React re-render]
I[Mouse leaves section] --> J[handleMouseLeave]
J --> K[setIsHovering false]
K --> L[React re-render\n adds hidden class to YouCursor]
style H fill:#2d6a4f,color:#fff
style C fill:#2d6a4f,color:#fff
Reviews (3): Last reviewed commit: "remove transition-transform" | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
PR SummaryLow Risk Overview Cursor visibility/hiding is simplified: the section now uses Tailwind Written by Cursor Bugbot for commit 8258b93. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is kicking off a free cloud agent to fix this issue. This run is complimentary, but you can enable autofix for all future PRs in the Cursor dashboard.
|
@greptile |
|
@ShoeBoom I feel it makes the 'You' cursor feel like a real multiplayer cursor w network latency and w/o it it's just a reskinned pointer |
technically the 'You' cursor should be client authoritative so it should feel instant, either way right now it just gives the impression that the collaborative mode is really buggy. I have a m3 macbook which is fairly fast, but the cursor teleports every 1s. If you want to simulate a slight laggy experience, you can either add a throttle function similar to tanstack pacer (and add back transition-transform) or restore some of the use effect logic but fix the infinite loop PS: I also noticed while reading this file that the other player cursors are also bugged, seems like they are meant to move but dont |

Summary
I Noticed the https://www.sim.ai/#collaboration section in the landing page has performance problems, cursor is very laggy. I initially tried to fix the current RAF implementation but the cursor still felt very floaty. Switched to a css transform based implementation and it feels much better
fixed with RAF (incase you want the RAF based version): main...ShoeBoom:sim-fix:53a577f6c386eb91ffce69e39532a5864570b7a6
Also changed cursor hiding logic from js based
style={{ cursor: isHovering ? 'none' : 'auto' }}to tailwind'shover:cursor-noneType of Change
Testing
Tested landing page using dev server
Also tested with 4x performance slowdown on m3 mac and it works fine
Checklist
Screenshots/Videos
Screen.Recording.2026-03-24.at.7.16.07.AM.stripped.mov