Skip to content

Commit c0abfe9

Browse files
committed
Remove unused tooltip and context check for the @-sign button in PromptField
1 parent 6842779 commit c0abfe9

1 file changed

Lines changed: 1 addition & 22 deletions

File tree

‎packages/ui/src/components/editor/panel/PromptField/PromptField.tsx‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
map_display_pos_to_raw_pos,
2020
map_raw_pos_to_display_pos
2121
} from './utils/position-mapping'
22-
import { dictionary } from '@shared/constants/dictionary'
2322
import { Tooltip } from './components'
2423

2524
export type EditFormat = 'whole' | 'truncated' | 'diff' | 'before-after'
@@ -60,7 +59,6 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
6059
const input_ref = useRef<HTMLDivElement>(null)
6160
const [caret_position, set_caret_position] = useState(0)
6261
const [should_show_ghost_text, set_should_show_ghost_text] = useState(false)
63-
const [show_at_sign_tooltip, set_show_at_sign_tooltip] = useState(false)
6462
const [show_submit_tooltip, set_show_submit_tooltip] = useState(false)
6563
const [is_text_selecting, set_is_text_selecting] = useState(false)
6664
const [is_focused, set_is_focused] = useState(false)
@@ -263,9 +261,6 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
263261
is_history_enabled
264262
])
265263

266-
const has_no_context =
267-
!props.context_file_paths || props.context_file_paths.length == 0
268-
269264
const edit_format_shortcuts: Record<EditFormat, string> = useMemo(() => {
270265
const modifier = is_mac ? '⌥' : 'Alt+'
271266
return {
@@ -363,17 +358,6 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
363358
}
364359
}}
365360
>
366-
{show_at_sign_tooltip && (
367-
<Tooltip
368-
message={dictionary.warning_message.NOTHING_SELECTED_IN_CONTEXT.replace(
369-
'.',
370-
''
371-
)}
372-
align="left"
373-
offset={8}
374-
is_warning
375-
/>
376-
)}
377361
{props.last_choice_button_title && show_submit_tooltip && (
378362
<Tooltip
379363
message={props.last_choice_button_title}
@@ -388,15 +372,9 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
388372
}}
389373
>
390374
<button
391-
onMouseEnter={() => {
392-
if (has_no_context) {
393-
set_show_at_sign_tooltip(true)
394-
}
395-
}}
396375
onClick={() => {
397376
props.on_at_sign_click()
398377
}}
399-
onMouseLeave={() => set_show_at_sign_tooltip(false)}
400378
className={cn(styles['footer__left__button'])}
401379
title="Reference File"
402380
>
@@ -446,6 +424,7 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
446424
: format == 'before-after'
447425
? 'before/after'
448426
: format
427+
449428
const is_selected = props.edit_format == format
450429
const should_underline = is_alt_pressed && !is_selected
451430

0 commit comments

Comments
 (0)