authorgravatar for cursoragent@cursor.comCursor Agent <cursoragent@cursor.com> 2026-03-09 18:57:17+00:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-09 11:57:27-07:00
log7a3d4d1f31e4316eb832f820012bf575aa57669a
tree70620f08dffdf81eb94ef716e6cb86265b27bdcb
parente354e8697f490c729d7022b28e921f4c12e0a8ae

fix: stabilize onToggleRuntimeMode with useCallback to preserve memo

Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com> Applied via @cursor push command

1 files changed, 6 insertions(+), 5 deletions(-)

apps/web/src/components/ChatView.tsx+6-5
......@@ -1675,6 +1675,11 @@ export default function ChatView({ threadId }: ChatViewProps) {
16751675 const toggleInteractionMode = useCallback(() => {
16761676 handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan");
16771677 }, [handleInteractionModeChange, interactionMode]);
1678 const toggleRuntimeMode = useCallback(() => {
1679 void handleRuntimeModeChange(
1680 runtimeMode === "full-access" ? "approval-required" : "full-access",
1681 );
1682 }, [handleRuntimeModeChange, runtimeMode]);
16781683 const togglePlanSidebar = useCallback(() => {
16791684 setPlanSidebarOpen((open) => {
16801685 if (open) {
......@@ -3745,11 +3750,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
37453750 onCodexFastModeChange={onCodexFastModeChange}
37463751 onToggleInteractionMode={toggleInteractionMode}
37473752 onTogglePlanSidebar={togglePlanSidebar}
3748 onToggleRuntimeMode={() =>
3749 void handleRuntimeModeChange(
3750 runtimeMode === "full-access" ? "approval-required" : "full-access",
3751 )
3752 }
3753 onToggleRuntimeMode={toggleRuntimeMode}
37533754 />
37543755 ) : (
37553756 <>