@@ -8,7 +8,7 @@ import MenuItem from "@mui/material/MenuItem";
8
8
import Select from "@mui/material/Select" ;
9
9
import Stack from "@mui/material/Stack" ;
10
10
import TextField from "@mui/material/TextField" ;
11
- import Tooltip from "@mui/material/Tooltip" ;
11
+ import MUITooltip from "@mui/material/Tooltip" ;
12
12
import { API } from "api/api" ;
13
13
import {
14
14
deleteWorkspacePortShare ,
@@ -31,14 +31,25 @@ import {
31
31
HelpTooltipTitle ,
32
32
} from "components/HelpTooltip/HelpTooltip" ;
33
33
import { Spinner } from "components/Spinner/Spinner" ;
34
+ import {
35
+ Tooltip ,
36
+ TooltipContent ,
37
+ TooltipProvider ,
38
+ TooltipTrigger ,
39
+ } from "components/Tooltip/Tooltip" ;
34
40
import {
35
41
Popover ,
36
42
PopoverContent ,
37
43
PopoverTrigger ,
38
44
} from "components/deprecated/Popover/Popover" ;
39
45
import { type FormikContextType , useFormik } from "formik" ;
40
46
import { type ClassName , useClassName } from "hooks/useClassName" ;
41
- import { ChevronDownIcon , ExternalLinkIcon , X as XIcon } from "lucide-react" ;
47
+ import {
48
+ ChevronDownIcon ,
49
+ ExternalLinkIcon ,
50
+ ShareIcon ,
51
+ X as XIcon ,
52
+ } from "lucide-react" ;
42
53
import { useDashboard } from "modules/dashboard/useDashboard" ;
43
54
import { type FC , useState } from "react" ;
44
55
import { useMutation , useQuery } from "react-query" ;
@@ -188,14 +199,14 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
188
199
canSharePorts && template . max_port_share_level === "public" ;
189
200
190
201
const disabledPublicMenuItem = (
191
- < Tooltip title = "This workspace template does not allow sharing ports with unauthenticated users." >
202
+ < MUITooltip title = "This workspace template does not allow sharing ports with unauthenticated users." >
192
203
{ /* Tooltips don't work directly on disabled MenuItem components so you must wrap in div. */ }
193
204
< div >
194
205
< MenuItem value = "public" disabled >
195
206
Public
196
207
</ MenuItem >
197
208
</ div >
198
- </ Tooltip >
209
+ </ MUITooltip >
199
210
) ;
200
211
201
212
return (
@@ -282,24 +293,17 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
282
293
required
283
294
css = { styles . newPortInput }
284
295
/>
285
- < Button
286
- type = "submit"
287
- size = "sm"
288
- variant = "subtle"
289
- css = { {
290
- paddingLeft : 12 ,
291
- paddingRight : 12 ,
292
- minWidth : 0 ,
293
- } }
294
- >
295
- < ExternalLinkIcon
296
- className = "size-icon-xs"
297
- css = { {
298
- flexShrink : 0 ,
299
- color : theme . palette . text . primary ,
300
- } }
301
- />
302
- </ Button >
296
+ < TooltipProvider >
297
+ < Tooltip >
298
+ < TooltipTrigger asChild >
299
+ < Button type = "submit" size = "icon" variant = "subtle" >
300
+ < ExternalLinkIcon />
301
+ < span className = "sr-only" > Connect to port</ span >
302
+ </ Button >
303
+ </ TooltipTrigger >
304
+ < TooltipContent > Connect to port</ TooltipContent >
305
+ </ Tooltip >
306
+ </ TooltipProvider >
303
307
</ form >
304
308
</ Stack >
305
309
</ Stack >
@@ -354,21 +358,29 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
354
358
alignItems = "center"
355
359
>
356
360
{ canSharePorts && (
357
- < Button
358
- size = "sm"
359
- variant = "subtle"
360
- onClick = { async ( ) => {
361
- await upsertSharedPortMutation . mutateAsync ( {
362
- agent_name : agent . name ,
363
- port : port . port ,
364
- protocol : listeningPortProtocol ,
365
- share_level : "authenticated" ,
366
- } ) ;
367
- await sharedPortsQuery . refetch ( ) ;
368
- } }
369
- >
370
- Share
371
- </ Button >
361
+ < TooltipProvider >
362
+ < Tooltip >
363
+ < TooltipTrigger asChild >
364
+ < Button
365
+ size = "icon"
366
+ variant = "subtle"
367
+ onClick = { async ( ) => {
368
+ await upsertSharedPortMutation . mutateAsync ( {
369
+ agent_name : agent . name ,
370
+ port : port . port ,
371
+ protocol : listeningPortProtocol ,
372
+ share_level : "authenticated" ,
373
+ } ) ;
374
+ await sharedPortsQuery . refetch ( ) ;
375
+ } }
376
+ >
377
+ < ShareIcon />
378
+ < span className = "sr-only" > Share</ span >
379
+ </ Button >
380
+ </ TooltipTrigger >
381
+ < TooltipContent > Share this port</ TooltipContent >
382
+ </ Tooltip >
383
+ </ TooltipProvider >
372
384
) }
373
385
</ Stack >
374
386
</ Stack >
@@ -471,7 +483,6 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
471
483
< Button
472
484
size = "sm"
473
485
variant = "subtle"
474
- css = { styles . deleteButton }
475
486
onClick = { async ( ) => {
476
487
await deleteSharedPortMutation . mutateAsync ( {
477
488
agent_name : agent . name ,
@@ -602,11 +613,6 @@ const styles = {
602
613
} ,
603
614
} ) ,
604
615
605
- deleteButton : ( ) => ( {
606
- minWidth : 30 ,
607
- padding : 0 ,
608
- } ) ,
609
-
610
616
newPortForm : ( theme ) => ( {
611
617
border : `1px solid ${ theme . palette . divider } ` ,
612
618
borderRadius : "4px" ,
0 commit comments