Skip to content

feat(agents): Add agent dropdown to the page#107108

Merged
priscilawebdev merged 11 commits intomasterfrom
priscila/feat/add-agents-dropdown-to-agents-page
Jan 30, 2026
Merged

feat(agents): Add agent dropdown to the page#107108
priscilawebdev merged 11 commits intomasterfrom
priscila/feat/add-agents-dropdown-to-agents-page

Conversation

@priscilawebdev
Copy link
Copy Markdown
Member

@linear
Copy link
Copy Markdown

linear bot commented Jan 27, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 27, 2026
@priscilawebdev priscilawebdev changed the title feat(agents): Add agents dropdown to the page feat(agents): Add agent dropdown to the page Jan 28, 2026
@priscilawebdev priscilawebdev marked this pull request as ready for review January 28, 2026 07:47
@priscilawebdev priscilawebdev requested review from a team as code owners January 28, 2026 07:47
Base automatically changed from priscila/fix/conversations-agent-dropdown-cache-pollution to master January 28, 2026 09:08
@priscilawebdev priscilawebdev requested review from a team as code owners January 28, 2026 09:58
@priscilawebdev priscilawebdev removed the request for review from a team January 28, 2026 09:59
@priscilawebdev priscilawebdev removed the Scope: Backend Automatically applied to PRs that change backend components label Jan 28, 2026
Copy link
Copy Markdown
Member

@obostjancic obostjancic left a comment

Choose a reason for hiding this comment

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

Looks ok, but I think we could inline this agent filter in the useCombinedQuery hook so that the other components on this page (like widgets) are not aware how the query is constructed, they just use the query passed to them.

@obostjancic
Copy link
Copy Markdown
Member

Another point: Trace table allows users to add the agent to the filter, currently that appends to the search bar but i would expect it to update the agent selector instead.

@priscilawebdev priscilawebdev force-pushed the priscila/feat/add-agents-dropdown-to-agents-page branch from 587a8a6 to f8956d3 Compare January 30, 2026 06:40
@priscilawebdev
Copy link
Copy Markdown
Member Author

Another point: Trace table allows users to add the agent to the filter, currently that appends to the search bar but i would expect it to update the agent selector instead.

I’ve updated the code so it now updates the dropdown instead of the search bar 😉
Apart from that, I’ve also introduced a small change: users can now remove the agent from the URL directly via the Traces table.

This is how it looks:

Screen.Recording.2026-01-30.at.06.52.44.mov

@priscilawebdev
Copy link
Copy Markdown
Member Author

Looks ok, but I think we could inline this agent filter in the useCombinedQuery hook so that the other components on this page (like widgets) are not aware how the query is constructed, they just use the query passed to them.

Yes, it was like that before. However, based on the Sentry feedback and your thumbs up on that feedback, I’ve updated the code accordingly. I’ve now dropped that commit.

In my opinion, since the URL parameters are cleared when navigating away from the page, it’s fine to keep the current behavior.

@priscilawebdev priscilawebdev enabled auto-merge (squash) January 30, 2026 09:04
@priscilawebdev priscilawebdev merged commit db829d3 into master Jan 30, 2026
53 checks passed
@priscilawebdev priscilawebdev deleted the priscila/feat/add-agents-dropdown-to-agents-page branch January 30, 2026 09:11
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 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

...location.query,
agent: isAgentInUrl
? agentFilters.filter(urlAgent => urlAgent !== agent)
: [...agentFilters, agent],
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.

Empty array passed instead of null when removing agents

Medium Severity

When clicking to remove the last selected agent from the filter, agentFilters.filter(urlAgent => urlAgent !== agent) returns an empty array [] which is passed directly to the Link's query. The AgentSelector component explicitly handles this case by setting null when the array is empty (values.length > 0 ? values : null), which cleanly removes the parameter from the URL. This inconsistency could cause unexpected URL serialization behavior with an empty array instead of removing the agent parameter entirely.

Fix in Cursor Fix in Web

? `${SpanFields.GEN_AI_AGENT_NAME}:[${agentFilters.map(a => `"${a}"`).join(',')}]`
: '';
const combinedQuery = useCombinedQuery(agentQuery) || undefined;
const combinedQuery = useCombinedQuery();
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.

Missing fallback to undefined for empty query string

Medium Severity

The old code used useCombinedQuery(agentQuery) || undefined to convert empty strings to undefined, ensuring the query parameter is omitted from the API request when empty. The new code removes this pattern, causing query: '' to be sent to the API instead. This differs from other similar pages in the codebase that use the || undefined pattern and could cause different API behavior.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

its ok. I guess , it doesn't matter if it is empty or undefined

@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 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