Skip to content

Fix UI Issues in AI Workspcae#2525

Merged
Thushani-Jayasekera merged 2 commits into
wso2:mainfrom
Induwara04:test-1
Jul 8, 2026
Merged

Fix UI Issues in AI Workspcae#2525
Thushani-Jayasekera merged 2 commits into
wso2:mainfrom
Induwara04:test-1

Conversation

@Induwara04

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and fixes to the AI Gateway and related UI components. The most significant changes are focused on improving polling behavior and token handling for gateways, enhancing user feedback for connection status, and standardizing how empty descriptions are displayed. There are also improvements to error handling and code cleanup.

Issues:

Gateway polling and token handling improvements:

  • The useGatewayList hook now accepts options to always poll and to configure the polling interval, allowing more flexible and responsive updates to gateway status. The polling logic is updated to respect these options. [1] [2] [3] [4] [5]
  • When creating a new gateway, if the API does not return a registration token, the code now attempts to generate one immediately, improving reliability for first-time setup.
  • The logic to auto-generate a token for inactive gateways in the ViewGateway page has been removed, as this is now handled during creation.

User interface and feedback enhancements:

  • A new animated connection status indicator is shown on the ViewGateway page, providing clear feedback to users about the gateway's connection state. This includes a spinner and animated dots when waiting for connection, and a green checkmark when connected. [1] [2] [3] [4] [5]
  • The "View Gateway configurations" button has been removed from the "Get Started" card, simplifying the UI.

Description and error message consistency:

  • All places displaying descriptions for applications, gateways, and external servers now consistently show an empty string instead of "No description" when the description is missing. [1] [2] [3] [4]
  • Error messages for deleting MCP proxies now display more informative messages from the server response when available, improving troubleshooting. [1] [2]

Other improvements and cleanup:

  • Some unused or redundant code has been removed, such as the hasAutoGeneratedTokenRef and the handleOpenGatewayConfigsDrawer function in ViewGateway, reducing complexity. [1] [2]
  • Clarified language in the UI regarding gateway registration token usage and reconfiguration, making instructions clearer for users. [1] [2]

These changes collectively improve the reliability, clarity, and user experience of the gateway management features.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Induwara04, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 25433e3f-b907-43e0-810b-4d1253cc3852

📥 Commits

Reviewing files that changed from the base of the PR and between ec9c736 and a0bce58.

📒 Files selected for processing (3)
  • portals/ai-workspace/src/pages/appShell/appShellPages/gateways/GatewaysList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyOverview.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsx
📝 Walkthrough

Walkthrough

This PR adds gateway polling options and token fallback generation, reworks ViewGateway's connection status UI and token messaging, introduces delete confirmation flows with error/success snackbars for MCP proxies, LLM proxies, and service providers (including provider usage checks), and standardizes description text fallbacks from "No description" to empty strings across multiple components.

Changes

Gateway Polling, Token Generation, and Connection UI

Layer / File(s) Summary
Gateway list hook: polling options and token fallback
portals/ai-workspace/src/hooks/useGateway.ts
useGatewayList accepts pollAlways/pollingIntervalMs options controlling polling cadence; createGateway falls back to rotateGatewayToken when the registration response omits a token, warning on failure.
GatewaysList and EditGateway wiring
.../gateways/GatewaysList.tsx, .../gateways/EditGateway.tsx
GatewaysList invokes the hook with { pollAlways: true }; EditGateway passes description directly instead of converting empty strings to undefined.
ViewGateway connection status and token messaging
.../gateways/ViewGateway.tsx
Adds animated waiting/connected status UI (renderGatewayConnectionStatus), removes prior auto-token-generation logic and the "View Gateway configurations" button, updates reconfigure/token copy across Quick Start, VM, Docker, and Kubernetes tabs, and adjusts description fallback.

Estimated code review effort: 4 (Complex) | ~60 minutes

Delete Flows and Error Messaging

Layer / File(s) Summary
MCP proxy delete error handling
.../externalServers/ExternalServersList.tsx
Adds getErrorDescription helper and shows a derived error message on MCP proxy deletion failure.
LLM proxy list delete flow and route-state feedback
.../proxies/LLMProxiesList.tsx
Adds useLocation/useAIWorkspaceSnackbar, getErrorDescription, and LLMProxyListLocationState; shows success snackbar via route state and wraps deletion in try/catch with feedback.
LLM proxy overview delete flow
.../proxies/LLMProxyOverview.tsx
Adds getErrorDescription/LLMProxyOverviewLocationState; navigates with proxyDeleted state on success, shows error snackbar on failure instead of setting updateError.
Service provider delete flow with usage check
.../serviceProvider/ServiceProviderOverview.tsx
Adds usage-check logic (getLLMProviderProxies) blocking deletion when linked proxies exist, a delete action button, a name-confirmation dialog, handleDeleteConfirm, and layout adjustments in header/action areas.

Estimated code review effort: 4 (Complex) | ~50 minutes

Description Fallback Standardization

Layer / File(s) Summary
Empty-string description fallback across list and overview components
applications/ApplicationsList.tsx, applications/GenAIApplicationsSummaryCardSection.tsx, externalServers/MCPProxiesSummaryCardSection.tsx, projects/ProjectListView.tsx, projects/ProjectsList.tsx, providerTemplate/ProviderTemplateOverview.tsx, providerTemplate/ProviderTemplatesList.tsx, proxies/LLMProxiesSummaryCardSection.tsx, serviceProvider/ProvidersList.tsx, serviceProvider/ServiceProviderOverview.tsx, serviceProvider/ServiceProvidersSummaryCard.tsx
Description text across these components now trims and falls back to an empty string instead of displaying the literal "No description" placeholder.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GatewaysList
  participant useGatewayList
  participant registerGateway
  participant rotateGatewayToken

  GatewaysList->>useGatewayList: createGateway()
  useGatewayList->>registerGateway: register()
  registerGateway-->>useGatewayList: response.data.token
  alt token missing
    useGatewayList->>rotateGatewayToken: rotateGatewayToken()
    rotateGatewayToken-->>useGatewayList: new token or error
  end
  useGatewayList-->>GatewaysList: gateway with initialToken
Loading
sequenceDiagram
  participant ServiceProviderOverview
  participant getLLMProviderProxies
  participant deleteProvider
  participant useLLMProviders

  ServiceProviderOverview->>getLLMProviderProxies: checkProviderUsageAndConfirmDelete()
  getLLMProviderProxies-->>ServiceProviderOverview: linked proxy count
  alt proxies linked
    ServiceProviderOverview-->>ServiceProviderOverview: block deletion
  else no proxies
    ServiceProviderOverview-->>ServiceProviderOverview: open delete dialog
    ServiceProviderOverview->>deleteProvider: deleteProvider()
    ServiceProviderOverview->>useLLMProviders: refreshProviders()
    ServiceProviderOverview-->>ServiceProviderOverview: navigate back
  end
Loading

Possibly related PRs

  • wso2/api-platform#2351: Both PRs modify ApplicationsList.tsx and GenAIApplicationsSummaryCardSection.tsx, related through overlapping edits to application description/list rendering logic.

Suggested reviewers: RakhithaRR, Tharsanan1, VirajSalaka, tharindu1st, AnuGayan

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the changes, but it misses most required template sections like Purpose, Goals, Approach, tests, security, and test environment. Reformat the PR description to match the template and add the missing sections with concrete details, links, and test/security information.
Title check ❓ Inconclusive The title is related, but it's too vague and generic to clearly summarize the main changes. Use a more specific title that mentions the main changes, such as gateway polling, token handling, and UI description updates.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🧹 Nitpick comments (3)
portals/ai-workspace/src/pages/appShell/appShellPages/gateways/ViewGateway.tsx (1)

1774-1774: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Remove the unreachable configs drawer
Nothing sets isConfigsDrawerOpen to true, so the drawer, onRetry={() => {}}, the loading/error state, normalizeGatewayConfigList/withKeyManagerEntries/keyManagerConfigs, and getGatewayConfigs can be removed as dead code.

🤖 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
`@portals/ai-workspace/src/pages/appShell/appShellPages/gateways/ViewGateway.tsx`
at line 1774, The configs drawer and its related dead code should be removed
from ViewGateway because nothing ever opens it. Delete the unreachable drawer UI
and the no-op onRetry handler, and remove the unused loading/error state plus
the gateway config plumbing that only supports it, including getGatewayConfigs,
normalizeGatewayConfigList, withKeyManagerEntries, and keyManagerConfigs. Also
clean up any now-unused isConfigsDrawerOpen state and related logic in
ViewGateway so the component only keeps active gateway behavior.
portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsx (1)

65-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract getErrorDescription into a shared utility.

This helper is now duplicated here, in LLMProxiesList.tsx, and in LLMProxyOverview.tsx. Any future change to the backend error shape will have to stay in sync across all three delete flows, so it is better to centralize it now.

🤖 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
`@portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsx`
around lines 65 - 72, The error-description helper is duplicated across
ExternalServersList, LLMProxiesList, and LLMProxyOverview, so centralize it in a
shared utility and have each delete flow import and use that single function.
Move getErrorDescription into a common module with the same fallback behavior,
then replace the local copies in the relevant list/overview components so future
backend error-shape changes only need one update.
portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsx (1)

1019-1075: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor wording: dialog refers to "component name".

The body asks the user to "type in the component name" while this dialog deletes an LLM Provider (title and placeholder use "provider"). Align the wording to "provider name" for consistency. Also note the button labels reuse ...ProvidersList.cancel/.delete message IDs from another component's namespace — acceptable if intentionally shared, otherwise consider this component's own IDs.

🤖 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
`@portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsx`
around lines 1019 - 1075, The delete confirmation dialog in
ServiceProviderOverview uses inconsistent wording by asking users to type the
“component name” even though it is deleting an LLM Provider. Update the
DialogContent copy to refer to the “provider name” so it matches the
DialogTitle, placeholder, and the delete flow. Keep the change localized to the
delete dialog text and preserve the existing confirmation behavior in
handleDeleteConfirm/isDeleteConfirmationValid.
🤖 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
`@portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyOverview.tsx`:
- Around line 255-261: The delete flow in LLMProxyOverview should not treat a
post-delete refresh failure as a delete failure. Update the handler around the
delete call and refreshProxies() so the proxy deletion is confirmed first, then
handle refresh errors separately without falling into the catch that shows
“Failed to delete App LLM Proxy.”; keep the successful navigate(proxiesPath, {
state: { proxyDeleted: true } }) path intact and use distinct error handling for
delete versus refresh.

---

Nitpick comments:
In
`@portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsx`:
- Around line 65-72: The error-description helper is duplicated across
ExternalServersList, LLMProxiesList, and LLMProxyOverview, so centralize it in a
shared utility and have each delete flow import and use that single function.
Move getErrorDescription into a common module with the same fallback behavior,
then replace the local copies in the relevant list/overview components so future
backend error-shape changes only need one update.

In
`@portals/ai-workspace/src/pages/appShell/appShellPages/gateways/ViewGateway.tsx`:
- Line 1774: The configs drawer and its related dead code should be removed from
ViewGateway because nothing ever opens it. Delete the unreachable drawer UI and
the no-op onRetry handler, and remove the unused loading/error state plus the
gateway config plumbing that only supports it, including getGatewayConfigs,
normalizeGatewayConfigList, withKeyManagerEntries, and keyManagerConfigs. Also
clean up any now-unused isConfigsDrawerOpen state and related logic in
ViewGateway so the component only keeps active gateway behavior.

In
`@portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsx`:
- Around line 1019-1075: The delete confirmation dialog in
ServiceProviderOverview uses inconsistent wording by asking users to type the
“component name” even though it is deleting an LLM Provider. Update the
DialogContent copy to refer to the “provider name” so it matches the
DialogTitle, placeholder, and the delete flow. Keep the change localized to the
delete dialog text and preserve the existing confirmation behavior in
handleDeleteConfirm/isDeleteConfirmationValid.
🪄 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: e106a0a7-d08a-4c31-a3f6-df2f0e5781b1

📥 Commits

Reviewing files that changed from the base of the PR and between 4c43468 and ec9c736.

📒 Files selected for processing (18)
  • portals/ai-workspace/src/hooks/useGateway.ts
  • portals/ai-workspace/src/pages/appShell/appShellPages/applications/ApplicationsList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/applications/GenAIApplicationsSummaryCardSection.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/MCPProxiesSummaryCardSection.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/gateways/EditGateway.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/gateways/GatewaysList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/gateways/ViewGateway.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/projects/ProjectListView.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/projects/ProjectsList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/providerTemplate/ProviderTemplateOverview.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/providerTemplate/ProviderTemplatesList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxiesList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxiesSummaryCardSection.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyOverview.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ProvidersList.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProvidersSummaryCard.tsx

@Thushani-Jayasekera
Thushani-Jayasekera merged commit 17648b6 into wso2:main Jul 8, 2026
7 checks passed
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.

2 participants