Skip to content

Commit 6f69327

Browse files
committed
Add agentic search action to context is empty warning status bar
- place 'agentic search' on this as well [Fragment] - in scenario when we show 'context is empty warning', we should show this status bar in place of 'attaching 0 files' status bar, not above the prompt field ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── Main │ └── MainView │ ├── MainView.tsx │ └── components │ └── PromptAttachments │ └── PromptAttachments.tsx └── packages └── ui └── src └── components └── editor └── prompt └── StatusBar └── StatusBar.tsx
1 parent 0ef5dbf commit 6f69327

1 file changed

Lines changed: 38 additions & 33 deletions

File tree

  • apps/editor/src/views/prompt/frontend/Main/MainView

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx‎

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,6 @@ export const MainView: React.FC<Props> = (props) => {
280280
}}
281281
/>
282282

283-
{context_is_empty_warning && (
284-
<>
285-
<UiStatusBar
286-
theme="warning"
287-
icon="codicon-warning"
288-
label={t('common.context-is-empty')}
289-
/>
290-
<UiSeparator height={4} />
291-
</>
292-
)}
293-
294283
<UiSeparator height={2} />
295284

296285
{props.response_history.length > 0 &&
@@ -429,28 +418,44 @@ export const MainView: React.FC<Props> = (props) => {
429418
/>
430419
</div>
431420

432-
<PromptAttachments
433-
token_count={props.selected_files_token_count}
434-
files_count={
435-
context_is_empty_warning ? undefined : props.selected_files.length
436-
}
437-
theme={
438-
props.target == TARGET.WEB
439-
? props.web_prompt_type == 'edit-files'
440-
? 'blue'
441-
: 'purple'
442-
: props.api_prompt_type == 'edit-files'
443-
? 'blue'
444-
: 'purple'
445-
}
446-
is_alt_pressed={is_alt_pressed}
447-
on_agentic_search={props.on_agentic_search}
448-
translations={{
449-
attaching_file: t('selected-files.attaching-file'),
450-
attaching_files: t('selected-files.attaching-files'),
451-
agentic_search: t('selected-files.agentic-search')
452-
}}
453-
/>
421+
{context_is_empty_warning ? (
422+
<UiStatusBar
423+
placement="bottom"
424+
theme="warning"
425+
icon="codicon-warning"
426+
label={t('common.context-is-empty')}
427+
actions={[
428+
{
429+
id: 'agentic-search',
430+
icon: 'codicon-search-sparkle',
431+
label: t('selected-files.agentic-search'),
432+
keycap: is_alt_pressed ? '/' : undefined,
433+
on_click: props.on_agentic_search
434+
}
435+
]}
436+
/>
437+
) : (
438+
<PromptAttachments
439+
token_count={props.selected_files_token_count}
440+
files_count={props.selected_files.length}
441+
theme={
442+
props.target == TARGET.WEB
443+
? props.web_prompt_type == 'edit-files'
444+
? 'blue'
445+
: 'purple'
446+
: props.api_prompt_type == 'edit-files'
447+
? 'blue'
448+
: 'purple'
449+
}
450+
is_alt_pressed={is_alt_pressed}
451+
on_agentic_search={props.on_agentic_search}
452+
translations={{
453+
attaching_file: t('selected-files.attaching-file'),
454+
attaching_files: t('selected-files.attaching-files'),
455+
agentic_search: t('selected-files.agentic-search')
456+
}}
457+
/>
458+
)}
454459

455460
<UiSeparator height={6} />
456461

0 commit comments

Comments
 (0)