Skip to content

Normalize desktop services and gate mobile EAS previews#3211

Open
juliusmarminge wants to merge 1 commit into
mainfrom
t3code/scroll-project-into-view
Open

Normalize desktop services and gate mobile EAS previews#3211
juliusmarminge wants to merge 1 commit into
mainfrom
t3code/scroll-project-into-view

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Normalize several desktop/server Effect services to inline service shapes and split desktop shutdown/logging concerns into dedicated modules.
  • Add backend child process output logging with rotation, plus related desktop lifecycle and observability cleanup.
  • Refresh diff, sidebar project reveal, and provider/update settings flows across the web and server layers.
  • Gate the mobile EAS preview workflow on the 🚀 Mobile Continuous Deployment label.

Testing

  • vp check
  • vp run typecheck
  • vp run lint
  • vp test
  • Not run: additional manual runtime verification

Note

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 + monotonic requestId) is held in CommandPalette and passed through commandPaletteContext (requestSidebarProjectReveal / completeSidebarProjectReveal). The palette calls request on the relevant navigation paths before routing or creating a thread.

Sidebar maps the ref to the visible row via resolveSidebarProjectRevealKey, including logical/grouped sidebar keys. The matching SidebarProjectItem runs scrollSidebarProjectIntoView (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

  • Adds a sidebar project reveal mechanism: when a project is selected in the command palette, a reveal request is created and passed via context to the sidebar, which resolves the target row and smoothly scrolls it into view.
  • Introduces SidebarProjectRevealRequest state and requestSidebarProjectReveal/completeSidebarProjectReveal callbacks in CommandPalette.tsx, exposed through new contexts in commandPaletteContext.tsx.
  • Sidebar.tsx consumes these contexts, resolves the reveal target to a sidebar row (accounting for grouped projects), and triggers a scrollIntoView with smooth/center/nearest options via sidebarProjectReveal.ts.

Macroscope summarized 81bed8f.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e1d66cfb-9419-41fa-bbb6-24f48771535d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/scroll-project-into-view

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

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.

Create PR

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]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 22cb345. Configure here.

setSidebarProjectRevealRequest((current) =>
current?.requestId === requestId ? null : current,
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 22cb345. Configure here.

@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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 81bed8f. Prior analysis still applies.

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
@juliusmarminge juliusmarminge force-pushed the t3code/scroll-project-into-view branch from 22cb345 to 81bed8f Compare June 20, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant