Skip to content

ref(cmdk): Guard GlobalCommandPaletteActions behind cmd-k-supercharged at the mount site#113021

Merged
JonasBa merged 2 commits into
masterfrom
jb/cmdk/registration-bailout
Apr 15, 2026
Merged

ref(cmdk): Guard GlobalCommandPaletteActions behind cmd-k-supercharged at the mount site#113021
JonasBa merged 2 commits into
masterfrom
jb/cmdk/registration-bailout

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 15, 2026

Changes

Moves the `cmd-k-supercharged` feature flag check from inside `GlobalCommandPaletteActions` to its call site in `navigation/index.tsx`.

When the flag is disabled the component is never mounted, so hooks like `useStarredIssueViews`, `useGetStarredDashboards`, and `useProjects` never run and no unnecessary API calls are made on every page load for orgs without the flag.

…ged flag is not enabled

Move all hook calls before the feature flag guard to satisfy Rules of Hooks, then early-return null when the organization does not have the cmd-k-supercharged feature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JonasBa JonasBa requested a review from a team as a code owner April 15, 2026 08:00
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 15, 2026
@sentry
Copy link
Copy Markdown
Contributor

sentry Bot commented Apr 15, 2026

Sentry Snapshot Testing

Name Added Removed Modified Renamed Unchanged Status
sentry-frontend
sentry-frontend
0 0 0 0 204 ✅ Unchanged

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8f964c1. Configure here.

Comment thread static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx Outdated
Guard GlobalCommandPaletteActions at the mount point in navigation/index.tsx instead of inside the component. This prevents the component from mounting entirely when the flag is off, so hooks like useStarredIssueViews, useGetStarredDashboards, and useProjects never run and no unnecessary API calls are made.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JonasBa JonasBa changed the title ref(cmdk): Bail out of GlobalCommandPaletteActions when cmd-k-supercharged is disabled ref(cmdk): Guard GlobalCommandPaletteActions behind cmd-k-supercharged at the mount site Apr 15, 2026
Copy link
Copy Markdown
Member

@priscilawebdev priscilawebdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good to me

@JonasBa JonasBa merged commit 07eb7a5 into master Apr 15, 2026
66 checks passed
@JonasBa JonasBa deleted the jb/cmdk/registration-bailout branch April 15, 2026 08:40
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants