Refactor agent identity components for UI consistency and improved display#1342
Refactor agent identity components for UI consistency and improved display#1342rasika2012 wants to merge 5 commits into
Conversation
…isplay of roles and permissions
📝 WalkthroughWalkthroughAgent identity management moved to a URL-driven Configure Agent drawer with credential, role, group, and endpoint views. Identity-related overview controls were removed or redirected, configuration tabs gained deep-link state, MCP tools gained grouped ACL-aware tables, and overview headers were standardized. ChangesAgent identity tables
Estimated code review effort: 5 (Critical) | ~90 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@console/workspaces/pages/overview/src/AgentOverview/EnvAgentIdentitySection.tsx`:
- Around line 137-152: Use a shared credential-mutation pending state in the
EnvAgentIdentitySection handlers, covering both claimSecret in handleClaim and
regenerate in handleRegenerate. Set it for the full duration of either async
operation, disable both controls while it is active, and clear it in a finally
path so failures do not leave the actions permanently disabled.
In
`@console/workspaces/pages/overview/src/AgentOverview/InstrumentationDrawer.tsx`:
- Around line 183-190: Key the EnvAgentIdentitySection render by the complete
identity tuple—orgName, projName, agentName, and environment—so React remounts
it whenever the selected environment or any identity component changes,
resetting displayed credentials while preserving the existing conditional
rendering.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d888bd3d-1fd6-404f-a74d-9bf4d0382f1b
📒 Files selected for processing (12)
console/workspaces/libs/types/src/api/agent-identity.tsconsole/workspaces/pages/env-thunders/src/subComponents/agentIdentity/AgentDetailPage.tsxconsole/workspaces/pages/env-thunders/src/subComponents/agentIdentity/AgentsTab.tsxconsole/workspaces/pages/env-thunders/src/subComponents/agentIdentity/GroupEditPage.tsxconsole/workspaces/pages/env-thunders/src/subComponents/agentIdentity/RoleEditPage.tsxconsole/workspaces/pages/env-thunders/src/subComponents/agentIdentity/useAgentLookup.tsconsole/workspaces/pages/identities/src/RoleEditPage.tsxconsole/workspaces/pages/overview/src/AgentOverview/EnvAgentIdentitySection.tsxconsole/workspaces/pages/overview/src/AgentOverview/ExternalAgentOverview.tsxconsole/workspaces/pages/overview/src/AgentOverview/InstrumentationDrawer.tsxconsole/workspaces/pages/overview/src/AgentOverview/InternalAgentOverview.tsxconsole/workspaces/pages/overview/src/AgentOverview/TokenGenerationStep.tsx
| {orgName && projName && agentName && environment && ( | ||
| <EnvAgentIdentitySection | ||
| orgId={orgName} | ||
| projectId={projName} | ||
| agentId={agentName} | ||
| envId={environment} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Reset revealed credentials when the selected environment changes.
React preserves EnvAgentIdentitySection state at this position. Switching environments can therefore display the previous environment’s client ID and secret. Key the component by the full identity tuple to force state isolation.
Proposed fix
<EnvAgentIdentitySection
+ key={`${orgName}/${projName}/${agentName}/${environment}`}
orgId={orgName}
projectId={projName}
agentId={agentName}
envId={environment}
/>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {orgName && projName && agentName && environment && ( | |
| <EnvAgentIdentitySection | |
| orgId={orgName} | |
| projectId={projName} | |
| agentId={agentName} | |
| envId={environment} | |
| /> | |
| )} | |
| {orgName && projName && agentName && environment && ( | |
| <EnvAgentIdentitySection | |
| key={`${orgName}/${projName}/${agentName}/${environment}`} | |
| orgId={orgName} | |
| projectId={projName} | |
| agentId={agentName} | |
| envId={environment} | |
| /> | |
| )} |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@console/workspaces/pages/overview/src/AgentOverview/InstrumentationDrawer.tsx`
around lines 183 - 190, Key the EnvAgentIdentitySection render by the complete
identity tuple—orgName, projName, agentName, and environment—so React remounts
it whenever the selected environment or any identity component changes,
resetting displayed credentials while preserving the existing conditional
rendering.
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@console/workspaces/libs/api-client/src/hooks/agents.ts`:
- Around line 241-252: Preserve query error state throughout the affected UI
instead of treating failures as empty data: in
console/workspaces/libs/api-client/src/hooks/agents.ts:241-252, update
useAgentIdentityBinding to return isError and error; in
console/workspaces/pages/configure-agent/src/Configure.Component.tsx:156-160,
retain pipeline/environment loading and error states for the drawer; in
console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx:92-96,
capture Thunder instance errors, at 130-145 render identity-query failures
before absent-binding handling, and at 314-324 show the query error instead of
“No identity provider”; in
console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx:178-180
distinguish environment lookup errors from an empty list, and at 238-260 surface
proxy and scope query failures instead of empty tools or metadata.
In `@console/workspaces/pages/configure-agent/src/Configure.Component.tsx`:
- Around line 137-144: Update closeManageIdentity to call setSearchParams with
the replace option enabled when removing MANAGE_IDENTITY_PARAM and
IDENTITY_ENV_PARAM, so closing the drawer replaces the current history entry
instead of adding one. Preserve the existing parameter-removal behavior.
In
`@console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx`:
- Around line 255-277: Update the Reveal Secret condition around handleClaim so
it also requires the binding to represent an external agent, reusing the
existing external-agent indicator from the component. Serialize handleClaim and
handleRegenerate per credential key by disabling both buttons whenever either
isClaiming or isRegenerating, while preserving their existing loading labels and
actions.
- Around line 424-430: Update the AgentIdentitySection usage in
ManageIdentityDrawer so it remounts whenever envName changes by providing a key
derived from envName. Preserve the existing props and rendering condition while
ensuring revealed local state is reset for each environment.
In `@console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx`:
- Around line 309-318: Update the tool-group selection logic around
selectedToolGroupKey and the Tools section to fall back to toolGroups[0] when
the selection is initially empty, preventing the empty-state flash. Use the same
first-group fallback for the Select value so the displayed selection and active
group remain synchronized, while preserving the effect-driven selection after it
runs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 38a69266-9ace-4d97-981e-55f500e033c4
📒 Files selected for processing (21)
console/workspaces/libs/api-client/src/hooks/agents.tsconsole/workspaces/libs/shared-component/src/components/AgentRolesGroups/AgentRolesGroups.tsxconsole/workspaces/libs/shared-component/src/components/index.tsconsole/workspaces/libs/types/src/routes/index.tsconsole/workspaces/libs/types/src/routes/manageIdentityParams.tsconsole/workspaces/pages/configure-agent/src/Configure.Component.tsxconsole/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsxconsole/workspaces/pages/configure-agent/src/ViewLLMProvider.Component.tsxconsole/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsxconsole/workspaces/pages/configure-agent/src/configureTabs.tsconsole/workspaces/pages/mcp-proxies/src/index.tsconsole/workspaces/pages/mcp-proxies/src/subComponents/ViewMCPProxy.tsxconsole/workspaces/pages/overview/src/AgentOverview/EnvAgentIdentitySection.tsxconsole/workspaces/pages/overview/src/AgentOverview/EnvAgentRolesGroupsSection.tsxconsole/workspaces/pages/overview/src/AgentOverview/EnvMonitorsSection.tsxconsole/workspaces/pages/overview/src/AgentOverview/EnvObservabilitySection.tsxconsole/workspaces/pages/overview/src/AgentOverview/InstrumentationDrawer.tsxconsole/workspaces/pages/overview/src/AgentOverview/InternalAgentOverview.tsxconsole/workspaces/pages/overview/src/AgentOverview/SectionHeader.tsxconsole/workspaces/pages/overview/src/AgentOverview/manageIdentityLink.tsconsole/workspaces/pages/overview/src/AgentOverview/useAgentIdentityBinding.ts
💤 Files with no reviewable changes (4)
- console/workspaces/pages/overview/src/AgentOverview/InstrumentationDrawer.tsx
- console/workspaces/pages/overview/src/AgentOverview/useAgentIdentityBinding.ts
- console/workspaces/pages/overview/src/AgentOverview/EnvAgentIdentitySection.tsx
- console/workspaces/pages/overview/src/AgentOverview/InternalAgentOverview.tsx
| const { data: identityViews, isLoading } = useGetAgentIdentity( | ||
| { orgName: orgId, projName: projectId, agentName: agentId }, | ||
| { environment: envId }, | ||
| ); | ||
| const binding = identityViews?.[0]; | ||
|
|
||
| return { | ||
| binding, | ||
| provisioned: binding?.status === "completed", | ||
| isLoading, | ||
| }; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Preserve query errors instead of presenting them as empty identity or tool data.
These queries discard error state, causing outages and authorization-metadata failures to appear as legitimate “not found,” empty tools, or missing scopes.
console/workspaces/libs/api-client/src/hooks/agents.ts#L241-L252: returnisErroranderrorfromuseAgentIdentityBinding.console/workspaces/pages/configure-agent/src/Configure.Component.tsx#L156-L160: retain pipeline/environment loading and error states for the drawer.console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx#L92-L96: capture Thunder instance query errors.console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx#L130-L145: render identity-query failures before the absent-binding state.console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx#L314-L324: show a query error instead of “No identity provider.”console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx#L178-L180: distinguish environment lookup failure from an empty environment list.console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx#L238-L260: surface proxy/scope failures instead of displaying empty tools or scope metadata.
As per coding guidelines, “Distinguish not-found conditions from real errors; never convert unexpected errors into not-found responses or silently fall back to defaults after real errors.”
📍 Affects 4 files
console/workspaces/libs/api-client/src/hooks/agents.ts#L241-L252(this comment)console/workspaces/pages/configure-agent/src/Configure.Component.tsx#L156-L160console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx#L92-L96console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx#L130-L145console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx#L314-L324console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx#L178-L180console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx#L238-L260
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@console/workspaces/libs/api-client/src/hooks/agents.ts` around lines 241 -
252, Preserve query error state throughout the affected UI instead of treating
failures as empty data: in
console/workspaces/libs/api-client/src/hooks/agents.ts:241-252, update
useAgentIdentityBinding to return isError and error; in
console/workspaces/pages/configure-agent/src/Configure.Component.tsx:156-160,
retain pipeline/environment loading and error states for the drawer; in
console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx:92-96,
capture Thunder instance errors, at 130-145 render identity-query failures
before absent-binding handling, and at 314-324 show the query error instead of
“No identity provider”; in
console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx:178-180
distinguish environment lookup errors from an empty list, and at 238-260 surface
proxy and scope query failures instead of empty tools or metadata.
Source: Coding guidelines
| const closeManageIdentity = () => { | ||
| setSearchParams((prev) => { | ||
| const next = new URLSearchParams(prev); | ||
| next.delete(MANAGE_IDENTITY_PARAM); | ||
| next.delete(IDENTITY_ENV_PARAM); | ||
| return next; | ||
| }); | ||
| }; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the relevant file around the reported lines and nearby open/close logic.
file='console/workspaces/pages/configure-agent/src/Configure.Component.tsx'
wc -l "$file"
sed -n '1,260p' "$file"Repository: wso2/agent-manager
Length of output: 9271
Replace the close action with replace: true.
Both opening and closing the drawer currently add history entries, so Back reopens the drawer after it’s closed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@console/workspaces/pages/configure-agent/src/Configure.Component.tsx` around
lines 137 - 144, Update closeManageIdentity to call setSearchParams with the
replace option enabled when removing MANAGE_IDENTITY_PARAM and
IDENTITY_ENV_PARAM, so closing the drawer replaces the current history entry
instead of adding one. Preserve the existing parameter-removal behavior.
| {!revealed && binding.hasUnclaimedSecret && ( | ||
| <Button | ||
| variant="text" | ||
| size="small" | ||
| onClick={() => void handleClaim()} | ||
| disabled={isClaiming} | ||
| startIcon={isClaiming ? <CircularProgress size={16} /> : <Eye size={16} />} | ||
| > | ||
| {isClaiming ? "Claiming..." : "Reveal Secret"} | ||
| </Button> | ||
| )} | ||
| {provisioned && ( | ||
| <Button | ||
| variant="text" | ||
| size="small" | ||
| onClick={() => void handleRegenerate()} | ||
| disabled={isRegenerating} | ||
| startIcon={ | ||
| isRegenerating ? <CircularProgress size={16} /> : <RotateCcwKey size={16} /> | ||
| } | ||
| > | ||
| {isRegenerating ? "Regenerating..." : "Regenerate Secret"} | ||
| </Button> |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Restrict secret reveal to external agents and serialize credential mutations.
hasUnclaimedSecret alone exposes Reveal for internal agents, contrary to Lines 75-78. Also, each button only disables itself, allowing claim and regeneration to race and potentially display a revoked secret.
Proposed fix
+ const isSecretMutationPending = isClaiming || isRegenerating;
- {!revealed && binding.hasUnclaimedSecret && (
+ {isExternal && !revealed && binding.hasUnclaimedSecret && (
<Button
- disabled={isClaiming}
+ disabled={isSecretMutationPending}
...
>
...
{provisioned && (
<Button
- disabled={isRegenerating}
+ disabled={isSecretMutationPending}As per coding guidelines, “serialize expensive per-key side effects rather than serializing globally.”
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {!revealed && binding.hasUnclaimedSecret && ( | |
| <Button | |
| variant="text" | |
| size="small" | |
| onClick={() => void handleClaim()} | |
| disabled={isClaiming} | |
| startIcon={isClaiming ? <CircularProgress size={16} /> : <Eye size={16} />} | |
| > | |
| {isClaiming ? "Claiming..." : "Reveal Secret"} | |
| </Button> | |
| )} | |
| {provisioned && ( | |
| <Button | |
| variant="text" | |
| size="small" | |
| onClick={() => void handleRegenerate()} | |
| disabled={isRegenerating} | |
| startIcon={ | |
| isRegenerating ? <CircularProgress size={16} /> : <RotateCcwKey size={16} /> | |
| } | |
| > | |
| {isRegenerating ? "Regenerating..." : "Regenerate Secret"} | |
| </Button> | |
| const isSecretMutationPending = isClaiming || isRegenerating; | |
| {isExternal && !revealed && binding.hasUnclaimedSecret && ( | |
| <Button | |
| variant="text" | |
| size="small" | |
| onClick={() => void handleClaim()} | |
| disabled={isSecretMutationPending} | |
| startIcon={isClaiming ? <CircularProgress size={16} /> : <Eye size={16} />} | |
| > | |
| {isClaiming ? "Claiming..." : "Reveal Secret"} | |
| </Button> | |
| )} | |
| {provisioned && ( | |
| <Button | |
| variant="text" | |
| size="small" | |
| onClick={() => void handleRegenerate()} | |
| disabled={isSecretMutationPending} | |
| startIcon={ | |
| isRegenerating ? <CircularProgress size={16} /> : <RotateCcwKey size={16} /> | |
| } | |
| > | |
| {isRegenerating ? "Regenerating..." : "Regenerate Secret"} | |
| </Button> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx`
around lines 255 - 277, Update the Reveal Secret condition around handleClaim so
it also requires the binding to represent an external agent, reusing the
existing external-agent indicator from the component. Serialize handleClaim and
handleRegenerate per credential key by disabling both buttons whenever either
isClaiming or isRegenerating, while preserving their existing loading labels and
actions.
Source: Coding guidelines
| {envName && ( | ||
| <AgentIdentitySection | ||
| orgId={orgId} | ||
| projectId={projectId} | ||
| agentId={agentId} | ||
| envId={envName} | ||
| /> |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the relevant file and the child component usage
ast-grep outline console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx --view expanded || true
printf '\n---\n'
rg -n "AgentIdentitySection|revealed|envName|open" console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx console/workspaces/pages/configure-agent/src/Configure -SRepository: wso2/agent-manager
Length of output: 12496
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the child component and its props/state.
child=$(git ls-files 'console/workspaces/pages/configure-agent/src/**/AgentIdentitySection.tsx' 'console/workspaces/pages/configure-agent/src/**/AgentIdentitySection.ts' | head -n 1)
printf 'Child file: %s\n' "${child:-<not found>}"
if [ -n "${child:-}" ]; then
ast-grep outline "$child" --view expanded || true
printf '\n---\n'
wc -l "$child"
printf '\n---\n'
cat -n "$child" | sed -n '1,260p'
fiRepository: wso2/agent-manager
Length of output: 180
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx'
printf '--- AgentIdentitySection (lines 80-190) ---\n'
sed -n '80,190p' "$file" | cat -n
printf '\n--- ManageIdentityDrawer render (lines 398-435) ---\n'
sed -n '398,435p' "$file" | cat -nRepository: wso2/agent-manager
Length of output: 247
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx'
echo '--- AgentIdentitySection (lines 80-190) ---'
sed -n '80,190p' "$file" | cat -n
echo
echo '--- ManageIdentityDrawer render (lines 398-435) ---'
sed -n '398,435p' "$file" | cat -nRepository: wso2/agent-manager
Length of output: 6344
Remount AgentIdentitySection on envName changes. Its local revealed state survives prop updates, so switching environments can show the previous environment’s client ID/secret under the new selection.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@console/workspaces/pages/configure-agent/src/Configure/subComponents/ManageIdentityDrawer.tsx`
around lines 424 - 430, Update the AgentIdentitySection usage in
ManageIdentityDrawer so it remounts whenever envName changes by providing a key
derived from envName. Preserve the existing props and rendering condition while
ensuring revealed local state is reset for each environment.
| const [selectedToolGroupKey, setSelectedToolGroupKey] = useState(""); | ||
| useDefaultSelection( | ||
| toolGroups.map((group) => group.key), | ||
| selectedToolGroupKey, | ||
| setSelectedToolGroupKey, | ||
| ); | ||
|
|
||
| const selectedToolGroup = toolGroups.find( | ||
| (group) => group.key === selectedToolGroupKey, | ||
| ); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE='console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx'
echo '--- file lines 250-380 ---'
sed -n '250,380p' "$FILE"
echo
echo '--- search useDefaultSelection ---'
rg -n "useDefaultSelection" -S console/workspaces/pages/configure-agent/src
echo
echo '--- search empty state text in file ---'
rg -n "No tools available|tools available|No .*available|empty state" -S "$FILE"Repository: wso2/agent-manager
Length of output: 5161
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE='console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx'
nl -ba "$FILE" | sed -n '290,360p'
echo
echo '--- useDefaultSelection definition ---'
rg -n "function useDefaultSelection|const useDefaultSelection|export .*useDefaultSelection" -S console/workspaces/pages/configure-agent/src
echo
echo '--- likely hook file candidates ---'
fd -a "useDefaultSelection*" console/workspaces/pages/configure-agent/srcRepository: wso2/agent-manager
Length of output: 196
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE='console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx'
echo '--- useDefaultSelection definition (100-145) ---'
sed -n '100,145p' "$FILE"
echo
echo '--- render around empty-state (630-690) ---'
sed -n '630,690p' "$FILE"Repository: wso2/agent-manager
Length of output: 4434
Avoid the empty-state flash on first render
Lines 309-318 and 661-670: derive the active tool group from toolGroups[0] until the default-selection effect runs, otherwise the Tools section briefly shows No tools available even when data is already present. Keep the Select value on the same fallback so the UI stays in sync.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@console/workspaces/pages/configure-agent/src/ViewMCPServer.Component.tsx`
around lines 309 - 318, Update the tool-group selection logic around
selectedToolGroupKey and the Tools section to fall back to toolGroups[0] when
the selection is initially empty, preventing the empty-state flash. Use the same
first-group fallback for the Select value so the displayed selection and active
group remain synchronized, while preserving the effect-driven selection after it
runs.
Purpose
Issue: #1324
This pull request refactors the agent identity UI in several areas to improve clarity, consistency, and usability. The most notable changes are the replacement of chip-based lists with tables for displaying roles, groups, scopes, and permissions, as well as updating terminology from "Thunder Agent ID" to "Agent ID" throughout the UI. Additional improvements include code cleanup and enhanced memoization for performance.
UI and Terminology Updates:
ListingTabletables for displaying agent roles, group memberships, assigned scopes, and permissions inAgentDetailPage.tsxandRoleEditPage.tsx, providing clearer and more consistent data presentation. [1] [2] [3] [4]Component and Code Improvements:
ReadOnlyItemsTable) and updated its usage inAgentDetailPage.tsx. [1] [2] [3] [4]RoleEditPage.tsxby movingcatalogByScopeto auseMemoand adjusting dependencies for better performance. [1] [2]SecretRevealAlertcomponent, simplifyingEnvAgentIdentitySection.tsx. [1] [2]Minor Enhancements:
EnvAgentIdentitySection.tsx.Goals
Approach
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning
Summary by CodeRabbit