File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ search:
55
55
thumbs_up : This answer was helpful
56
56
thumbs_down : This answer was not helpful
57
57
thumbs_announcement : Thank you for your feedback!
58
+ back_to_search : Back to search
58
59
failure :
59
60
general_title : There was an error loading search results.
60
61
ai_title : There was an error loading Copilot.
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ search:
55
55
thumbs_up : This answer was helpful
56
56
thumbs_down : This answer was not helpful
57
57
thumbs_announcement : Thank you for your feedback!
58
+ back_to_search : Back to search
58
59
failure :
59
60
general_title : There was an error loading search results.
60
61
ai_title : There was an error loading Copilot.
Original file line number Diff line number Diff line change 5
5
ActionList ,
6
6
Box ,
7
7
Header ,
8
+ IconButton ,
8
9
Link ,
9
10
Overlay ,
10
11
Spinner ,
@@ -20,6 +21,7 @@ import {
20
21
CopilotIcon ,
21
22
FileIcon ,
22
23
ArrowRightIcon ,
24
+ ArrowLeftIcon ,
23
25
} from '@primer/octicons-react'
24
26
25
27
import { useTranslation } from 'src/languages/components/useTranslation'
@@ -483,6 +485,15 @@ export function SearchOverlay({
483
485
}
484
486
}
485
487
488
+ const onBackButton = ( ) => {
489
+ // Leave the Ask AI state when the user clicks the back button
490
+ setSelectedIndex ( - 1 )
491
+ updateParams ( {
492
+ 'search-overlay-ask-ai' : '' ,
493
+ 'search-overlay-input' : urlSearchInputQuery ,
494
+ } )
495
+ }
496
+
486
497
// We render the AI Result in the searchGroups call, so we pass the props down via an object
487
498
// TODO: Move stateful logic to Context since we now have so many props:
488
499
const askAIState = {
@@ -626,6 +637,20 @@ export function SearchOverlay({
626
637
ref = { overlayRef }
627
638
>
628
639
< Header className = { styles . header } >
640
+ < Box
641
+ sx = { {
642
+ display : isAskAIState ? 'flex' : 'none' ,
643
+ marginRight : '8px' ,
644
+ fontWeight : 'bolder' ,
645
+ } }
646
+ >
647
+ < IconButton
648
+ aria-label = { t ( 'search.ai.back_to_search' ) }
649
+ icon = { ArrowLeftIcon }
650
+ onClick = { onBackButton }
651
+ variant = "invisible"
652
+ > </ IconButton >
653
+ </ Box >
629
654
< TextInput
630
655
className = "width-full"
631
656
data-testid = "overlay-search-input"
You can’t perform that action at this time.
0 commit comments