Skip to content

ref(cmdk): Eagerly load filter key sections and cap boolean attributes#114125

Merged
JonasBa merged 1 commit intomasterfrom
jb/cmdk/issues-search
Apr 28, 2026
Merged

ref(cmdk): Eagerly load filter key sections and cap boolean attributes#114125
JonasBa merged 1 commit intomasterfrom
jb/cmdk/issues-search

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 28, 2026

Update issues and traces search to populate the cmdk with more results

Remove the `state === 'selected'` gate from the section-level resources
in both issue list and spans command palette actions. The section queryFns
only map over already-loaded in-memory data (no API calls), so deferring
them until selection was unnecessary and prevented filter keys from
appearing in search results.

Also wrap span boolean attributes in a capped section (limit=4) so they
no longer pollute search results unboundedly.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 28, 2026
@JonasBa JonasBa marked this pull request as ready for review April 28, 2026 04:46
@JonasBa JonasBa requested review from a team as code owners April 28, 2026 04:46
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 39c2197. Configure here.

tags: Tag[],
cacheKey: string
): ((q: string, ctx: CMDKResourceContext) => CMDKQueryOptions) =>
(_q, ctx) =>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Eager section query caches stale tags

Medium Severity

After removing the enabled: ctx.state === 'selected' gate, the section query now fires on mount but its queryKey does not include tags.length. With staleTime: Infinity, the first cached result wins forever, so any tags that arrive later (for example when issuePlatformTagsQuery resolves after eventsTagsQuery) never appear in the "Event Tags" section. The sibling makeStringSectionResource in spansCommandPaletteActions.tsx includes tags.length precisely for this reason.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 39c2197. Configure here.

@JonasBa JonasBa merged commit 9b80e96 into master Apr 28, 2026
67 checks passed
@JonasBa JonasBa deleted the jb/cmdk/issues-search branch April 28, 2026 14:40
cleptric pushed a commit that referenced this pull request May 5, 2026
#114125)

Update issues and traces search to populate the cmdk with more results

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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