Skip to content

Commit 6f0b454

Browse files
committed
feat(webui): update artefacts dropdown with EPU Player and link chips
- Rename FSRecorder to EPU Player with PyPI and GitHub release links - Update workspace entry with PyPI link chip - Add ArtefactLink type to support multiple links per artefact - Make only heading clickable (not entire menu item) - Add underline on hover for heading links - Enable text selection within menu items
1 parent 32e5926 commit 6f0b454

3 files changed

Lines changed: 60 additions & 13 deletions

File tree

core/artefacts.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,24 @@
2323
},
2424
{
2525
"id": "workspace",
26-
"label": "SmartEM Dev Workspace",
26+
"label": "SmartEM Workspace CLI",
2727
"url": "https://pypi.org/project/smartem-workspace/",
28-
"description": "CLI tool to scaffold and manage a local development environment",
29-
"command": "uvx smartem-workspace --help"
28+
"description": "CLI tool to automate multi-repo workspace setup",
29+
"command": "uvx smartem-workspace --help",
30+
"links": [
31+
{ "label": "PyPI", "url": "https://pypi.org/project/smartem-workspace/" }
32+
]
3033
},
3134
{
32-
"id": "fsrecorder",
33-
"label": "FSRecorder Util",
34-
"url": "https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/build_win_fsrecorder.yml",
35-
"description": "FSRecorder Utility packaged as a Windows 10 executable (download from workflow artifacts)",
36-
"command": ""
35+
"id": "epuplayer",
36+
"label": "EPU Player",
37+
"url": "https://github.com/DiamondLightSource/smartem-devtools/releases",
38+
"description": "Filesystem recorder/replayer for EPU output",
39+
"command": "uvx smartem-epuplayer --help",
40+
"links": [
41+
{ "label": "GitHub Releases", "url": "https://github.com/DiamondLightSource/smartem-devtools/releases" },
42+
{ "label": "PyPI", "url": "https://pypi.org/project/smartem-epuplayer/" }
43+
]
3744
}
3845
]
3946
}

core/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,18 @@ export interface ReposConfig {
6767
// Artefacts Types (artefacts.json)
6868
// =============================================================================
6969

70+
export interface ArtefactLink {
71+
label: string
72+
url: string
73+
}
74+
7075
export interface ArtefactItem {
7176
id: string
7277
label: string
7378
url: string
7479
description?: string
7580
command?: string
81+
links?: ArtefactLink[]
7682
}
7783

7884
export interface ArtefactsConfig {

webui/src/components/header/ArtefactsMenu.tsx

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,28 +104,36 @@ export function ArtefactsMenu() {
104104
{items.map((item) => (
105105
<MenuItem
106106
key={item.id}
107-
component="a"
108-
href={item.url}
109-
target="_blank"
110-
rel="noopener noreferrer"
111-
onClick={handleClose}
107+
disableRipple
112108
sx={{
113109
display: 'flex',
114110
flexDirection: 'column',
115111
alignItems: 'stretch',
116112
py: 1.5,
117113
px: 2,
118114
color: 'white',
115+
cursor: 'default',
116+
userSelect: 'text',
119117
'&:hover': {
120118
backgroundColor: 'rgba(255, 255, 255, 0.1)',
121119
},
122120
}}
123121
>
124122
<Box
123+
component="a"
124+
href={item.url}
125+
target="_blank"
126+
rel="noopener noreferrer"
127+
onClick={handleClose}
125128
sx={{
126129
display: 'flex',
127130
alignItems: 'center',
128131
gap: 0.75,
132+
color: 'inherit',
133+
textDecoration: 'none',
134+
'&:hover': {
135+
textDecoration: 'underline',
136+
},
129137
}}
130138
>
131139
<Box
@@ -159,6 +167,32 @@ export function ArtefactsMenu() {
159167
<CopyCodeBox code={item.command} />
160168
</Box>
161169
)}
170+
{item.links && item.links.length > 0 && (
171+
<Box sx={{ display: 'flex', gap: 1, mt: 1, pl: 2.5 }}>
172+
{item.links.map((link) => (
173+
<Box
174+
key={link.label}
175+
component="a"
176+
href={link.url}
177+
target="_blank"
178+
rel="noopener noreferrer"
179+
onClick={handleClose}
180+
sx={{
181+
fontSize: '0.7rem',
182+
color: 'rgba(255, 255, 255, 0.8)',
183+
textDecoration: 'none',
184+
px: 1,
185+
py: 0.25,
186+
borderRadius: 0.5,
187+
border: '1px solid rgba(255, 255, 255, 0.3)',
188+
'&:hover': { backgroundColor: 'rgba(255, 255, 255, 0.1)' },
189+
}}
190+
>
191+
{link.label}
192+
</Box>
193+
))}
194+
</Box>
195+
)}
162196
</MenuItem>
163197
))}
164198
</Menu>

0 commit comments

Comments
 (0)