Skip to content

Commit ede8b41

Browse files
JonasBaclaude
andcommitted
fix(cmdk): Restore new-tab behavior for admin links
The /_admin/ actions were converted to 'to' props, causing isExternalLocation to return false (same origin) and navigate() to attempt client-side routing to Django-served admin pages. Switch both admin CMDKActions to onAction with window.open so they open in a new tab as originally intended. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0727811 commit ede8b41

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,21 @@ export function GlobalCommandPaletteActions() {
227227
<CMDKAction
228228
display={{label: t('Open _admin'), icon: <IconOpen />}}
229229
keywords={[t('superuser')]}
230-
to="/_admin/"
230+
onAction={() => window.open('/_admin/', '_blank', 'noreferrer')}
231231
/>
232232
<CMDKAction
233233
display={{
234234
label: t('Open %s in _admin', organization.name),
235235
icon: <IconOpen />,
236236
}}
237237
keywords={[t('superuser')]}
238-
to={`/_admin/customers/${organization.slug}/`}
238+
onAction={() =>
239+
window.open(
240+
`/_admin/customers/${organization.slug}/`,
241+
'_blank',
242+
'noreferrer'
243+
)
244+
}
239245
/>
240246
{!isActiveSuperuser() && (
241247
<CMDKAction

0 commit comments

Comments
 (0)