@@ -19,6 +19,9 @@ import Thumbnails from "../common/Thumbnails"
1919import ApiOptions , { normalizeApiConfiguration } from "../settings/ApiOptions"
2020import { MAX_IMAGES_PER_MESSAGE } from "./ChatView"
2121import ContextMenu from "./ContextMenu"
22+ import { useShortcut } from "../../utils/hooks"
23+ import Tooltip from "../common/Tooltip"
24+ import { useMetaKeyDetection } from "../../utils/hooks"
2225
2326interface ChatTextAreaProps {
2427 inputValue : string
@@ -210,7 +213,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
210213 } ,
211214 ref ,
212215 ) => {
213- const { filePaths, chatSettings, apiConfiguration, openRouterModels } = useExtensionState ( )
216+ const { filePaths, chatSettings, apiConfiguration, openRouterModels, platform } = useExtensionState ( )
214217 const [ isTextAreaFocused , setIsTextAreaFocused ] = useState ( false )
215218 const [ thumbnailsHeight , setThumbnailsHeight ] = useState ( 0 )
216219 const [ textAreaBaseHeight , setTextAreaBaseHeight ] = useState < number | undefined > ( undefined )
@@ -232,6 +235,8 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
232235 const [ arrowPosition , setArrowPosition ] = useState ( 0 )
233236 const [ menuPosition , setMenuPosition ] = useState ( 0 )
234237
238+ const [ , metaKeyChar ] = useMetaKeyDetection ( platform )
239+
235240 // Add a ref to track previous menu state
236241 const prevShowModelSelector = useRef ( showModelSelector )
237242
@@ -619,6 +624,8 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
619624 } , changeModeDelay )
620625 } , [ chatSettings . mode , showModelSelector , submitApiConfig ] )
621626
627+ useShortcut ( "Meta+Shift+a" , onModeToggle , { disableTextInputs : false } ) // important that we don't disable the text input here
628+
622629 const handleContextButtonClick = useCallback ( ( ) => {
623630 if ( textAreaDisabled ) return
624631
@@ -1067,12 +1074,15 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
10671074 ) }
10681075 </ ModelContainer >
10691076 </ ButtonGroup >
1070-
1071- < SwitchContainer data-testid = "mode-switch" disabled = { false } onClick = { onModeToggle } >
1072- < Slider isAct = { chatSettings . mode === "act" } isPlan = { chatSettings . mode === "plan" } />
1073- < SwitchOption isActive = { chatSettings . mode === "plan" } > Plan</ SwitchOption >
1074- < SwitchOption isActive = { chatSettings . mode === "act" } > Act</ SwitchOption >
1075- </ SwitchContainer >
1077+ < Tooltip
1078+ tipText = { `In ${ chatSettings . mode === "act" ? "Act" : "Plan" } mode, Cline will ${ chatSettings . mode === "act" ? "complete the task immediately" : "gather information to architect a plan" } ` }
1079+ hintText = { `Toggle w/ ${ metaKeyChar } +Shift+A` } >
1080+ < SwitchContainer data-testid = "mode-switch" disabled = { false } onClick = { onModeToggle } >
1081+ < Slider isAct = { chatSettings . mode === "act" } isPlan = { chatSettings . mode === "plan" } />
1082+ < SwitchOption isActive = { chatSettings . mode === "plan" } > Plan</ SwitchOption >
1083+ < SwitchOption isActive = { chatSettings . mode === "act" } > Act</ SwitchOption >
1084+ </ SwitchContainer >
1085+ </ Tooltip >
10761086 </ ControlsContainer >
10771087 </ div >
10781088 )
0 commit comments