@@ -31,6 +31,8 @@ import {
3131} from "@t3tools/shared/model" ;
3232import {
3333 memo ,
34+ type ComponentProps ,
35+ type ReactNode ,
3436 useCallback ,
3537 useEffect ,
3638 useLayoutEffect ,
@@ -251,6 +253,7 @@ function formatWorkingTimer(startIso: string, endIso: string): string | null {
251253 return seconds > 0 ? `${ minutes } m ${ seconds } s` : `${ minutes } m` ;
252254}
253255
256+
254257const LAST_EDITOR_KEY = "t3code:last-editor" ;
255258const LAST_INVOKED_SCRIPT_BY_PROJECT_KEY = "t3code:last-invoked-script-by-project" ;
256259const MAX_VISIBLE_WORK_LOG_ENTRIES = 6 ;
@@ -3720,49 +3723,85 @@ export default function ChatView({ threadId }: ChatViewProps) {
37203723 < Separator orientation = "vertical" className = "mx-0.5 hidden h-4 sm:block" />
37213724
37223725 { /* Interaction mode toggle */ }
3723- < Button
3724- variant = "ghost"
3725- className = "shrink-0 whitespace-nowrap px-2 text-muted-foreground/70 hover:text-foreground/80 sm:px-3"
3726- size = "sm"
3727- type = "button"
3728- onClick = { toggleInteractionMode }
3729- title = {
3730- interactionMode === "plan"
3731- ? "Plan mode — click to return to normal chat mode"
3732- : "Default mode — click to enter plan mode"
3733- }
3734- >
3735- < BotIcon />
3736- < span className = "sr-only sm:not-sr-only" >
3737- { interactionMode === "plan" ? "Plan" : "Chat" }
3738- </ span >
3739- </ Button >
3726+ < Tooltip >
3727+ < TooltipTrigger
3728+ render = {
3729+ < Button
3730+ variant = "ghost"
3731+ className = "shrink-0 whitespace-nowrap px-2 text-muted-foreground/70 hover:text-foreground/80 sm:px-3"
3732+ size = "sm"
3733+ type = "button"
3734+ onClick = { toggleInteractionMode }
3735+ aria-description = {
3736+ interactionMode === "plan"
3737+ ? "Plan mode — click to return to normal chat mode"
3738+ : "Default mode — click to enter plan mode"
3739+ }
3740+ >
3741+ < BotIcon />
3742+ < span className = "sr-only sm:not-sr-only" >
3743+ { interactionMode === "plan" ? "Plan" : "Chat" }
3744+ </ span >
3745+ </ Button >
3746+ }
3747+ />
3748+ < TooltipPopup
3749+ side = "top"
3750+ className = "max-w-72 whitespace-normal leading-tight"
3751+ >
3752+ < span className = "flex flex-col items-center gap-1" >
3753+ < span >
3754+ { interactionMode === "plan"
3755+ ? "Plan mode — click to return to normal chat mode"
3756+ : "Default mode — click to enter plan mode" }
3757+ </ span >
3758+ < kbd className = "inline-flex shrink-0 items-center gap-0.5 rounded bg-foreground/10 px-1 py-0.5 font-medium font-sans text-[10px]" >
3759+ < span > ⇧</ span >
3760+ < span > Tab</ span >
3761+ </ kbd >
3762+ </ span >
3763+ </ TooltipPopup >
3764+ </ Tooltip >
37403765
37413766 { /* Divider */ }
37423767 < Separator orientation = "vertical" className = "mx-0.5 hidden h-4 sm:block" />
37433768
37443769 { /* Runtime mode toggle */ }
3745- < Button
3746- variant = "ghost"
3747- className = "shrink-0 whitespace-nowrap px-2 text-muted-foreground/70 hover:text-foreground/80 sm:px-3"
3748- size = "sm"
3749- type = "button"
3750- onClick = { ( ) =>
3751- void handleRuntimeModeChange (
3752- runtimeMode === "full-access" ? "approval-required" : "full-access" ,
3753- )
3754- }
3755- title = {
3756- runtimeMode === "full-access"
3770+ < Tooltip >
3771+ < TooltipTrigger
3772+ render = {
3773+ < Button
3774+ variant = "ghost"
3775+ className = "shrink-0 whitespace-nowrap px-2 text-muted-foreground/70 hover:text-foreground/80 sm:px-3"
3776+ size = "sm"
3777+ type = "button"
3778+ onClick = { ( ) =>
3779+ void handleRuntimeModeChange (
3780+ runtimeMode === "full-access" ? "approval-required" : "full-access" ,
3781+ )
3782+ }
3783+ aria-description = {
3784+ runtimeMode === "full-access"
3785+ ? "Full access — click to require approvals"
3786+ : "Approval required — click for full access"
3787+ }
3788+ >
3789+ { runtimeMode === "full-access" ? < LockOpenIcon /> : < LockIcon /> }
3790+ < span className = "sr-only sm:not-sr-only" >
3791+ { runtimeMode === "full-access" ? "Full access" : "Supervised" }
3792+ </ span >
3793+ </ Button >
3794+ }
3795+ />
3796+ < TooltipPopup
3797+ side = "top"
3798+ className = "max-w-72 whitespace-normal leading-tight"
3799+ >
3800+ { runtimeMode === "full-access"
37573801 ? "Full access — click to require approvals"
3758- : "Approval required — click for full access"
3759- }
3760- >
3761- { runtimeMode === "full-access" ? < LockOpenIcon /> : < LockIcon /> }
3762- < span className = "sr-only sm:not-sr-only" >
3763- { runtimeMode === "full-access" ? "Full access" : "Supervised" }
3764- </ span >
3765- </ Button >
3802+ : "Approval required — click for full access" }
3803+ </ TooltipPopup >
3804+ </ Tooltip >
37663805
37673806 { /* Plan sidebar toggle */ }
37683807 { ( activePlan || activeProposedPlan || planSidebarOpen ) ? (
0 commit comments