Normalize desktop services and gate mobile EAS previews#3211
Normalize desktop services and gate mobile EAS previews#3211juliusmarminge wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Reveal abort leaves pending request
- Replaced the single requestAnimationFrame with a retry loop (up to 20 frames) so the effect keeps trying until projectHeaderRef is available and the reveal completes.
- ✅ Fixed: Unstable complete callback resets reveal
- Wrapped requestSidebarProjectReveal and completeSidebarProjectReveal in useCallback to stabilize their identity across renders, preventing the effect from being torn down and rescheduled on every parent re-render.
Or push these changes by commenting:
@cursor push 4501ba47ce
Preview (4501ba47ce)
diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx
--- a/apps/web/src/components/CommandPalette.tsx
+++ b/apps/web/src/components/CommandPalette.tsx
@@ -376,18 +376,18 @@
const nextSidebarProjectRevealRequestIdRef = useRef(0);
const [sidebarProjectRevealRequest, setSidebarProjectRevealRequest] =
useState<SidebarProjectRevealRequest | null>(null);
- function requestSidebarProjectReveal(projectRef: ScopedProjectRef): void {
+ const requestSidebarProjectReveal = useCallback((projectRef: ScopedProjectRef): void => {
nextSidebarProjectRevealRequestIdRef.current += 1;
setSidebarProjectRevealRequest({
requestId: nextSidebarProjectRevealRequestIdRef.current,
projectRef,
});
- }
- function completeSidebarProjectReveal(requestId: number): void {
+ }, []);
+ const completeSidebarProjectReveal = useCallback((requestId: number): void => {
setSidebarProjectRevealRequest((current) =>
current?.requestId === requestId ? null : current,
);
- }
+ }, []);
const routeTarget = useParams({
strict: false,
select: (params) => resolveThreadRouteTarget(params),
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx
--- a/apps/web/src/components/Sidebar.tsx
+++ b/apps/web/src/components/Sidebar.tsx
@@ -1179,17 +1179,31 @@
return;
}
- const frame = window.requestAnimationFrame(() => {
+ const revealId = projectRevealRequestId;
+ let cancelled = false;
+ let frameId: number;
+ let attempts = 0;
+ const maxAttempts = 20;
+
+ function tryScroll() {
+ if (cancelled) return;
const projectHeader = projectHeaderRef.current;
- if (!projectHeader) {
+ if (projectHeader) {
+ scrollSidebarProjectIntoView(projectHeader);
+ completeProjectReveal(revealId);
return;
}
- scrollSidebarProjectIntoView(projectHeader);
- completeProjectReveal(projectRevealRequestId);
- });
+ attempts++;
+ if (attempts < maxAttempts) {
+ frameId = window.requestAnimationFrame(tryScroll);
+ }
+ }
+ frameId = window.requestAnimationFrame(tryScroll);
+
return () => {
- window.cancelAnimationFrame(frame);
+ cancelled = true;
+ window.cancelAnimationFrame(frameId);
};
}, [completeProjectReveal, projectRevealRequestId]);
const sidebarThreads = useThreadShellsForProjectRefs(project.memberProjectRefs);You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 22cb345. Configure here.
| return () => { | ||
| window.cancelAnimationFrame(frame); | ||
| }; | ||
| }, [completeProjectReveal, projectRevealRequestId]); |
There was a problem hiding this comment.
Reveal abort leaves pending request
Medium Severity
In SidebarProjectItem, the sidebar reveal useEffect schedules a single requestAnimationFrame to scroll the project header and call completeProjectReveal. If projectHeaderRef.current is still null in that callback, it returns without scrolling or completing, and the effect does not run again because its dependencies are unchanged. The pending reveal request can then remain active and the sidebar may never scroll to the intended project.
Reviewed by Cursor Bugbot for commit 22cb345. Configure here.
| setSidebarProjectRevealRequest((current) => | ||
| current?.requestId === requestId ? null : current, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Unstable complete callback resets reveal
Medium Severity
completeSidebarProjectReveal and requestSidebarProjectReveal are plain functions recreated on every CommandPalette render, unlike neighboring handlers wrapped in useCallback. That new function identity is passed through context and listed in the sidebar reveal effect’s dependency array, so route and other parent re-renders during palette navigation repeatedly tear down and reschedule the scroll frame, which can prevent the reveal from ever running to completion.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 22cb345. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new sidebar project reveal feature with new contexts, hooks, and state coordination. New user-facing capabilities warrant human review. Additionally, there are 2 unresolved medium-severity comments identifying potential race conditions and callback stability issues. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
- Track sidebar project reveal requests with request ids - Scroll the matching project row into view after opening - Add resolver tests for grouped and ungrouped project rows
22cb345 to
81bed8f
Compare



Summary
🚀 Mobile Continuous Deploymentlabel.Testing
vp checkvp run typecheckvp run lintvp testNote
Low Risk
UI-only sidebar scrolling and React context wiring; no auth, data, or API changes.
Overview
When you pick or open a project from the command palette (search, new thread in project, add/browse project), the sidebar now scrolls that project row into view so it isn’t lost off-screen in a long list.
A reveal request (
projectRef+ monotonicrequestId) is held inCommandPaletteand passed throughcommandPaletteContext(requestSidebarProjectReveal/completeSidebarProjectReveal). The palette calls request on the relevant navigation paths before routing or creating a thread.Sidebarmaps the ref to the visible row viaresolveSidebarProjectRevealKey, including logical/grouped sidebar keys. The matchingSidebarProjectItemrunsscrollSidebarProjectIntoView(smooth, centered) on the project header after layout, then clears the request.Reviewed by Cursor Bugbot for commit 81bed8f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scroll sidebar to reveal a project when selected from the command palette
SidebarProjectRevealRequeststate andrequestSidebarProjectReveal/completeSidebarProjectRevealcallbacks inCommandPalette.tsx, exposed through new contexts incommandPaletteContext.tsx.Sidebar.tsxconsumes these contexts, resolves the reveal target to a sidebar row (accounting for grouped projects), and triggers ascrollIntoViewwith smooth/center/nearest options viasidebarProjectReveal.ts.Macroscope summarized 81bed8f.