@@ -5,6 +5,7 @@ import { Icon } from '../../common/Icon'
55import { get_highlighted_text } from './utils/get-highlighted-text'
66import { use_handlers } from './hooks/use-handlers'
77import { use_dropdown } from './hooks/use-dropdown'
8+ import { use_is_narrow_viewport } from './hooks/use-is-narrow-viewport'
89import { DropdownMenu } from '../../common/DropdownMenu'
910import { search_paths } from '@shared/utils/search-paths'
1011import { get_display_text } from './utils/get-display-text'
@@ -54,6 +55,7 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
5455 const container_ref = useRef < HTMLDivElement > ( null )
5556 const [ caret_position , set_caret_position ] = useState ( 0 )
5657 const [ show_at_sign_tooltip , set_show_at_sign_tooltip ] = useState ( false )
58+ const is_narrow_viewport = use_is_narrow_viewport ( )
5759 const {
5860 is_dropdown_open,
5961 toggle_dropdown,
@@ -496,24 +498,29 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
496498 >
497499 { props . show_edit_format_selector && (
498500 < div className = { styles [ 'footer__right__edit-format' ] } >
499- { ( [ 'whole' , 'truncated' , 'diff' ] as const ) . map ( ( format ) => (
500- < button
501- key = { format }
502- className = { cn (
503- styles [ 'footer__right__edit-format__button' ] ,
504- {
505- [ styles [
506- 'footer__right__edit-format__button--selected'
507- ] ] : props . edit_format == format
508- }
509- ) }
510- title = { `"${ props . edit_format_instructions ?. [ format ] } "` }
511- onClick = { ( ) => props . on_edit_format_change ?.( format ) }
512- data-text = { format }
513- >
514- { format }
515- </ button >
516- ) ) }
501+ { ( [ 'whole' , 'truncated' , 'diff' ] as const ) . map ( ( format ) => {
502+ const button_text = is_narrow_viewport
503+ ? format . charAt ( 0 ) . toUpperCase ( )
504+ : format
505+ return (
506+ < button
507+ key = { format }
508+ className = { cn (
509+ styles [ 'footer__right__edit-format__button' ] ,
510+ {
511+ [ styles [
512+ 'footer__right__edit-format__button--selected'
513+ ] ] : props . edit_format == format
514+ }
515+ ) }
516+ title = { `"${ props . edit_format_instructions ?. [ format ] } "` }
517+ onClick = { ( ) => props . on_edit_format_change ?.( format ) }
518+ data-text = { button_text }
519+ >
520+ { button_text }
521+ </ button >
522+ )
523+ } ) }
517524 </ div >
518525 ) }
519526
0 commit comments