Skip to content

implement UI namespace filtering#1923

Open
maazghani wants to merge 8 commits into
kagent-dev:mainfrom
maazghani:maazghani/implement-namespace-filtering-ui
Open

implement UI namespace filtering#1923
maazghani wants to merge 8 commits into
kagent-dev:mainfrom
maazghani:maazghani/implement-namespace-filtering-ui

Conversation

@maazghani
Copy link
Copy Markdown
Contributor

@maazghani maazghani commented May 26, 2026

Summary

part 2 of addressing #1812

This connects the agents list UI to the namespace filtering support added in the previous API/client PR.

/agents stays the all-namespaces view. /agents?namespace=<namespace> now fetches and renders agents scoped to that namespace. The namespace picker drives both the URL and the agents request, so there is no “trust me, the request was scoped” UI state.

The scoped empty state also carries the namespace into New Agent, but only as the starting value. The create form still lets the user change the namespace before saving.

Notes

AgentList owns list fetching now because the selected namespace comes from the route. AgentsProvider still handles shared create/edit dependencies without fetching every agent on mount.

Delete refresh gets passed down from the current list view so deletes refresh the same scoped query.

Tests

Added coverage for:

  • /agents fetching all agents
  • /agents?namespace=kagent fetching scoped agents
  • namespace selector URL updates
  • clearing back to all namespaces
  • scoped empty state linking to New Agent
  • create form initializing from ?namespace=...
  • getAgents() normalizing a missing data field to []
IMG_3505 IMG_3506 IMG_3507

@maazghani maazghani marked this pull request as ready for review May 26, 2026 14:20
Copilot AI review requested due to automatic review settings May 26, 2026 14:20
@maazghani maazghani requested a review from peterj as a code owner May 26, 2026 14:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds namespace-aware behavior to the Agents UI by introducing query-param-driven namespace filtering, improving how “all namespaces” is represented in the selector, and adjusting agent list fetching/refreshing flows.

Changes:

  • Add namespace filtering on /agents via ?namespace= plus namespace-aware empty state and create link.
  • Enhance NamespaceCombobox to optionally include an “All namespaces” entry and disable auto-default selection when desired.
  • Add/adjust tests for namespace behavior and normalize getAgents to treat missing data as an empty list.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/src/lib/tests/agentsActions.test.ts Adds coverage for getAgents normalization when data is missing.
ui/src/lib/tests/CreateAgentPage.namespace.test.tsx Verifies create page initializes namespace from ?namespace=.
ui/src/lib/tests/AgentsProvider.namespace.test.tsx Verifies AgentsProvider no longer fetches all agents on mount.
ui/src/lib/tests/AgentList.namespace.test.tsx Tests namespace filtering, URL updates, and scoped empty-state create link.
ui/src/components/NamespaceCombobox.tsx Adds “All namespaces” option, optional default auto-select, and ARIA label support.
ui/src/components/DeleteAgentButton.tsx Replaces provider refresh with an onDeleted callback for post-delete refresh.
ui/src/components/AgentsProvider.tsx Stops initial agent list fetching and removes post-create/update refresh behavior.
ui/src/components/AgentListView.tsx Threads onAgentsChanged down to rows to refresh after deletes.
ui/src/components/AgentList.tsx Implements namespace query parsing, filtered fetching, and namespace selector/UX.
ui/src/components/AgentGrid.tsx Threads onAgentsChanged through to cards for refresh after deletes.
ui/src/components/AgentCard.tsx Calls onAgentsChanged after delete via DeleteButton.
ui/src/app/agents/new/page.tsx Initializes create namespace from query and returns to namespace-scoped list after create.
ui/src/app/actions/agents.ts Normalizes getAgents to sort an empty array when data isn’t an array.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/src/components/AgentList.tsx
Comment thread ui/src/components/DeleteAgentButton.tsx
Comment thread ui/src/app/agents/new/page.tsx Outdated
EItanya and others added 3 commits May 26, 2026 11:35
peterj
peterj previously approved these changes May 26, 2026
@maazghani
Copy link
Copy Markdown
Contributor Author

maazghani commented May 26, 2026

PR comments addressed, @peterj ready to review/merge.

@maazghani maazghani requested a review from peterj May 26, 2026 19:54
@maazghani
Copy link
Copy Markdown
Contributor Author

maazghani commented May 27, 2026

Looks like chainguard has recovered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants