@@ -42,6 +42,8 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip
4242import { Shortcut } from "@/components/ui/shortcut" ;
4343import { useWebElementScrollbar } from "@/components/use-web-scrollbar" ;
4444import { useShortcutKeys } from "@/hooks/use-shortcut-keys" ;
45+ import { formatShortcut } from "@/utils/format-shortcut" ;
46+ import { getShortcutOs } from "@/utils/shortcut-platform" ;
4547import type { MessageInputKeyboardActionKind } from "@/keyboard/actions" ;
4648import {
4749 markScrollInvestigationEvent ,
@@ -233,7 +235,9 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
233235 const voiceMuteToggleKeys = useShortcutKeys ( "voice-mute-toggle" ) ;
234236 const dictationToggleKeys = useShortcutKeys ( "dictation-toggle" ) ;
235237 const queueKeys = useShortcutKeys ( "message-input-queue" ) ;
238+ const focusInputKeys = useShortcutKeys ( "focus-message-input" ) ;
236239 const [ inputHeight , setInputHeight ] = useState ( MIN_INPUT_HEIGHT ) ;
240+ const [ isInputFocused , setIsInputFocused ] = useState ( false ) ;
237241 const rootRef = useRef < View | null > ( null ) ;
238242 const inputWrapperRef = useRef < View | null > ( null ) ;
239243 const textInputRef = useRef < TextInput | ( TextInput & { getNativeRef ?: ( ) => unknown } ) | null > (
@@ -997,10 +1001,12 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
9971001 accessibilityLabel = "Message agent..."
9981002 onFocus = { ( ) => {
9991003 isInputFocusedRef . current = true ;
1004+ setIsInputFocused ( true ) ;
10001005 onFocusChange ?.( true ) ;
10011006 } }
10021007 onBlur = { ( ) => {
10031008 isInputFocusedRef . current = false ;
1009+ setIsInputFocused ( false ) ;
10041010 onFocusChange ?.( false ) ;
10051011 } }
10061012 style = { [
@@ -1025,6 +1031,11 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
10251031 autoFocus = { isWeb && autoFocus }
10261032 />
10271033 { inputScrollbar }
1034+ { isWeb && ! isInputFocused && ! value && focusInputKeys ? (
1035+ < Text style = { styles . focusHintText } pointerEvents = "none" >
1036+ { formatShortcut ( focusInputKeys [ 0 ] , getShortcutOs ( ) ) } to focus
1037+ </ Text >
1038+ ) : null }
10281039 </ View >
10291040
10301041 { /* Button row */ }
@@ -1270,6 +1281,14 @@ const styles = StyleSheet.create(((theme: any) => ({
12701281 textInputScrollWrapper : {
12711282 position : "relative" ,
12721283 } ,
1284+ focusHintText : {
1285+ position : "absolute" ,
1286+ top : 0 ,
1287+ right : 0 ,
1288+ fontSize : theme . fontSize . xs ,
1289+ color : theme . colors . foregroundMuted ,
1290+ opacity : 0.5 ,
1291+ } ,
12731292 textInput : {
12741293 width : "100%" ,
12751294 color : theme . colors . foreground ,
0 commit comments