@@ -10,31 +10,47 @@ import * as styles from './CommandBarFooter.module.css';
10
10
11
11
const CommandBarFooter : React . FC = ( ) => {
12
12
const {
13
- state : { activeCommandId, activeCommandMessage, commands, result, selectedCommandGroup, expanded } ,
14
- Icon,
13
+ state : {
14
+ activeCommandId,
15
+ resultCommandId,
16
+ activeCommandMessage,
17
+ commands,
18
+ result,
19
+ selectedCommandGroup,
20
+ expanded
21
+ } ,
22
+ Icon
15
23
} = useCommandBarState ( ) ;
16
24
17
- const runningCommand = useComputed < Command > ( ( ) => {
18
- if ( ! activeCommandId . value ) return null ;
25
+ const commandForContext = useComputed < Command > ( ( ) => {
26
+ const commandId = activeCommandId . value ?? resultCommandId . value ;
27
+ if ( ! commandId ) return null ;
19
28
// FIXME: This will not be correct when a command and an option in the result have the same id
20
- return activeCommandId . value
21
- ? commands . value [ activeCommandId . value ] ?? result . value . options [ activeCommandId . value ]
29
+ return commandId
30
+ ? commands . value [ commandId ] ?? result . value . options [ commandId ]
22
31
: null ;
23
32
} ) ;
24
33
34
+ const isRunning = activeCommandId . value !== null ;
35
+
25
36
if ( ! expanded . value ) return null ;
26
37
27
38
return (
28
39
< footer className = { styles . commandBarFooter } >
29
- { activeCommandId . value ? (
40
+ { isRunning ? (
30
41
< span className = { styles . activity } >
31
42
< IconWrapper >
32
43
< IconSpinner />
33
44
</ IconWrapper >
34
45
< em >
35
- { runningCommand . value . name } ‒ { activeCommandMessage }
46
+ { commandForContext . value . name } { activeCommandMessage . value ? '﹘' + activeCommandMessage . value : '' }
36
47
</ em >
37
48
</ span >
49
+ ) : commandForContext . value ? (
50
+ < span className = { styles . breadcrumb } >
51
+ < Icon icon = { commandForContext . value . icon } />
52
+ < small > { commandForContext . value . name } </ small >
53
+ </ span >
38
54
) : selectedCommandGroup . value ? (
39
55
< span className = { styles . breadcrumb } >
40
56
< Icon icon = { commands . value [ selectedCommandGroup . value ] . icon } />
0 commit comments