1
1
import type { Interpolation , Theme } from "@emotion/react" ;
2
- import Button from "@mui/material/Button" ;
3
2
import Collapse from "@mui/material/Collapse" ;
4
3
import Divider from "@mui/material/Divider" ;
5
4
import Skeleton from "@mui/material/Skeleton" ;
@@ -12,6 +11,7 @@ import type {
12
11
WorkspaceApp ,
13
12
} from "api/typesGenerated" ;
14
13
import { isAxiosError } from "axios" ;
14
+ import { Button } from "components/Button/Button" ;
15
15
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow" ;
16
16
import {
17
17
DropdownMenu ,
@@ -71,7 +71,7 @@ export const AgentRow: FC<AgentRowProps> = ({
71
71
const appSections = organizeAgentApps ( agent . apps ) ;
72
72
const hasAppsToDisplay =
73
73
! browser_only || appSections . some ( ( it ) => it . apps . length > 0 ) ;
74
- const shouldDisplayApps =
74
+ const shouldDisplayAgentApps =
75
75
( agent . status === "connected" && hasAppsToDisplay ) ||
76
76
agent . status === "connecting" ;
77
77
const hasVSCodeApp =
@@ -160,6 +160,14 @@ export const AgentRow: FC<AgentRowProps> = ({
160
160
} ,
161
161
} ) ;
162
162
163
+ // This is used to show the parent apps of the devcontainer.
164
+ const [ showParentApps , setShowParentApps ] = useState ( false ) ;
165
+
166
+ const shouldDisplayAppsSection =
167
+ agent . status === "connected" &&
168
+ containers &&
169
+ ( containers . length > 0 ? showParentApps : true ) ;
170
+
163
171
return (
164
172
< Stack
165
173
key = { agent . id }
@@ -191,7 +199,18 @@ export const AgentRow: FC<AgentRowProps> = ({
191
199
) }
192
200
</ div >
193
201
194
- < div css = { { display : "flex" } } >
202
+ < div className = "flex items-center gap-2" >
203
+ { containers && containers . length > 0 && (
204
+ < Button
205
+ variant = "outline"
206
+ size = "sm"
207
+ onClick = { ( ) => setShowParentApps ( ( show ) => ! show ) }
208
+ >
209
+ Show parent apps
210
+ < DropdownArrow close = { showParentApps } margin = { false } />
211
+ </ Button >
212
+ ) }
213
+
195
214
{ ! browser_only && agent . display_apps . includes ( "ssh_helper" ) && (
196
215
< AgentSSHButton
197
216
workspaceName = { workspace . name }
@@ -218,9 +237,9 @@ export const AgentRow: FC<AgentRowProps> = ({
218
237
</ section >
219
238
) }
220
239
221
- { agent . status === "connected" && (
240
+ { shouldDisplayAppsSection && (
222
241
< section css = { styles . apps } >
223
- { shouldDisplayApps && (
242
+ { shouldDisplayAgentApps && (
224
243
< >
225
244
{ showVSCode && (
226
245
< VSCodeDesktopButton
@@ -319,11 +338,11 @@ export const AgentRow: FC<AgentRowProps> = ({
319
338
320
339
< Stack css = { { padding : "12px 16px" } } direction = "row" spacing = { 1 } >
321
340
< Button
322
- variant = "text"
323
- size = "small"
324
- startIcon = { < DropdownArrow close = { showLogs } margin = { false } /> }
341
+ size = "sm"
342
+ variant = "subtle"
325
343
onClick = { ( ) => setShowLogs ( ( v ) => ! v ) }
326
344
>
345
+ < DropdownArrow close = { showLogs } margin = { false } />
327
346
Logs
328
347
</ Button >
329
348
< Divider orientation = "vertical" variant = "middle" flexItem />
0 commit comments