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) {...@@ -1675,6 +1675,11 @@ export default function ChatView({ threadId }: ChatViewProps) {
1675 const toggleInteractionMode = useCallback(() => {1675 const toggleInteractionMode = useCallback(() => {
1676 handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan");1676 handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan");
1677 }, [handleInteractionModeChange, interactionMode]);1677 }, [handleInteractionModeChange, interactionMode]);
1678 const toggleRuntimeMode = useCallback(() => {
1679 void handleRuntimeModeChange(
1680 runtimeMode === "full-access" ? "approval-required" : "full-access",
1681 );
1682 }, [handleRuntimeModeChange, runtimeMode]);
1678 const togglePlanSidebar = useCallback(() => {1683 const togglePlanSidebar = useCallback(() => {
1679 setPlanSidebarOpen((open) => {1684 setPlanSidebarOpen((open) => {
1680 if (open) {1685 if (open) {
...@@ -3745,11 +3750,7 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -3745,11 +3750,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
3745 onCodexFastModeChange={onCodexFastModeChange}3750 onCodexFastModeChange={onCodexFastModeChange}
3746 onToggleInteractionMode={toggleInteractionMode}3751 onToggleInteractionMode={toggleInteractionMode}
3747 onTogglePlanSidebar={togglePlanSidebar}3752 onTogglePlanSidebar={togglePlanSidebar}
3748 onToggleRuntimeMode={() =>3753 onToggleRuntimeMode={toggleRuntimeMode}
3749 void handleRuntimeModeChange(
3750 runtimeMode === "full-access" ? "approval-required" : "full-access",
3751 )
3752 }
3753 />3754 />
3754 ) : (3755 ) : (
3755 <>3756 <>