@@ -101,8 +101,6 @@ export default function ProjectScriptsControl({
101101 ) ,
102102 [ fileScripts , scripts ] ,
103103 ) ;
104- const dropdownItemClassName =
105- "data-highlighted:bg-transparent data-highlighted:text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-highlighted:hover:bg-accent data-highlighted:hover:text-accent-foreground data-highlighted:focus-visible:bg-accent data-highlighted:focus-visible:text-accent-foreground" ;
106104
107105 const openAddDialog = ( ) => {
108106 setEditorRequest ( { scriptId : null , initial : EMPTY_PROJECT_SCRIPT_INPUT } ) ;
@@ -153,7 +151,6 @@ export default function ProjectScriptsControl({
153151 < MenuItem
154152 density = { presentation === "menu" ? "touch" : "default" }
155153 key = { `${ fileScript . name } ${ fileScript . command } ` }
156- className = { dropdownItemClassName }
157154 onClick = { ( ) => void importFileScript ( fileScript ) }
158155 >
159156 < ScriptIcon icon = { fileScript . icon ?? "play" } className = "size-4" />
@@ -178,25 +175,23 @@ export default function ProjectScriptsControl({
178175 < MenuItem
179176 density = { presentation === "menu" ? "touch" : "default" }
180177 key = { script . id }
181- className = { ` group ${ dropdownItemClassName } ` }
178+ className = " group"
182179 onClick = { ( ) => onRunScript ( script ) }
183180 >
184181 < ScriptIcon icon = { script . icon } className = "size-4" />
185182 < MenuItemLabel >
186183 { script . runOnWorktreeCreate ? `${ script . name } (setup)` : script . name }
187184 </ MenuItemLabel >
188185 < span className = "relative ms-auto flex h-6 min-w-6 items-center justify-end" >
189- { shortcutLabel && (
190- < MenuShortcut
191- className = {
192- presentation === "menu"
193- ? "ms-0 mr-7"
194- : "ms-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0"
195- }
196- >
197- { shortcutLabel }
198- </ MenuShortcut >
199- ) }
186+ { shortcutLabel &&
187+ ( presentation === "menu" ? (
188+ < MenuShortcut className = "ms-0 mr-7" > { shortcutLabel } </ MenuShortcut >
189+ ) : (
190+ // The shortcut yields its slot to the edit button on hover.
191+ < span className = "transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0" >
192+ < MenuShortcut className = "ms-0" > { shortcutLabel } </ MenuShortcut >
193+ </ span >
194+ ) ) }
200195 < Button
201196 type = "button"
202197 variant = "ghost"
@@ -220,11 +215,7 @@ export default function ProjectScriptsControl({
220215 ) ;
221216 } ) }
222217 { importMenuItems }
223- < MenuItem
224- density = { presentation === "menu" ? "touch" : "default" }
225- className = { dropdownItemClassName }
226- onClick = { openAddDialog }
227- >
218+ < MenuItem density = { presentation === "menu" ? "touch" : "default" } onClick = { openAddDialog } >
228219 < PlusIcon className = "size-4" />
229220 < MenuItemLabel > Add action</ MenuItemLabel >
230221 </ MenuItem >
@@ -296,7 +287,6 @@ export default function ProjectScriptsControl({
296287 </ Tooltip >
297288 < GroupSeparator className = "hidden @3xl/header-actions:block" />
298289 < Menu
299- highlightItemOnHover = { false }
300290 open = { actionsMenuOpen . scripts }
301291 onOpenChange = { ( open ) =>
302292 setActionsMenuOpen ( { presentation, scripts : open , imports : false } )
@@ -312,7 +302,6 @@ export default function ProjectScriptsControl({
312302 </ Group >
313303 ) : importableScripts . length > 0 ? (
314304 < Menu
315- highlightItemOnHover = { false }
316305 open = { actionsMenuOpen . imports }
317306 onOpenChange = { ( open ) =>
318307 setActionsMenuOpen ( { presentation, scripts : false , imports : open } )
@@ -327,7 +316,7 @@ export default function ProjectScriptsControl({
327316 </ MenuTrigger >
328317 < MenuPopup align = "end" >
329318 { importMenuItems }
330- < MenuItem className = { dropdownItemClassName } onClick = { openAddDialog } >
319+ < MenuItem onClick = { openAddDialog } >
331320 < PlusIcon className = "size-4" />
332321 Add action
333322 </ MenuItem >
0 commit comments