fix(ui): default guardrails page to first tab for admins, not submitted (#29872)

The Guardrails page hardcoded defaultActiveKey="submitted", so admins
landed on the "Submitted Guardrails" tab (the last of their four tabs)
instead of the primary view. The original intent was for non-admins,
whose only tab is Submitted Guardrails, to default there; admins should
open on their first tab.

Make the default role-aware: admins default to the first tab (Guardrail
Garden), non-admins keep Submitted Guardrails.
This commit is contained in:
yuneng-jiang 2026-06-06 18:10:17 -07:00 committed by GitHub
parent 13924fa1d6
commit 3448bf79f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,7 +133,7 @@ const GuardrailsPanel: React.FC<GuardrailsPanelProps> = ({ accessToken, userRole
return (
<div className="w-full mx-auto flex-auto overflow-y-auto m-8 p-2">
<Tabs
defaultActiveKey="submitted"
defaultActiveKey="guardrails"
items={[
...(isAdmin
? [