Fix UI Issues in AI Workspcae#2525
Conversation
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis 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. ChangesGateway Polling, Token Generation, and Connection UI
Estimated code review effort: 4 (Complex) | ~60 minutes Delete Flows and Error Messaging
Estimated code review effort: 4 (Complex) | ~50 minutes Description Fallback Standardization
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
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ 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
🧹 Nitpick comments (3)
portals/ai-workspace/src/pages/appShell/appShellPages/gateways/ViewGateway.tsx (1)
1774-1774: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffRemove the unreachable configs drawer
Nothing setsisConfigsDrawerOpentotrue, so the drawer,onRetry={() => {}}, the loading/error state,normalizeGatewayConfigList/withKeyManagerEntries/keyManagerConfigs, andgetGatewayConfigscan 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 winExtract
getErrorDescriptioninto a shared utility.This helper is now duplicated here, in
LLMProxiesList.tsx, and inLLMProxyOverview.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 valueMinor 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/.deletemessage 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
📒 Files selected for processing (18)
portals/ai-workspace/src/hooks/useGateway.tsportals/ai-workspace/src/pages/appShell/appShellPages/applications/ApplicationsList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/applications/GenAIApplicationsSummaryCardSection.tsxportals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/externalServers/MCPProxiesSummaryCardSection.tsxportals/ai-workspace/src/pages/appShell/appShellPages/gateways/EditGateway.tsxportals/ai-workspace/src/pages/appShell/appShellPages/gateways/GatewaysList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/gateways/ViewGateway.tsxportals/ai-workspace/src/pages/appShell/appShellPages/projects/ProjectListView.tsxportals/ai-workspace/src/pages/appShell/appShellPages/projects/ProjectsList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/providerTemplate/ProviderTemplateOverview.tsxportals/ai-workspace/src/pages/appShell/appShellPages/providerTemplate/ProviderTemplatesList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxiesList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxiesSummaryCardSection.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyOverview.tsxportals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ProvidersList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsxportals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProvidersSummaryCard.tsx
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:
useGatewayListhook 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]ViewGatewaypage has been removed, as this is now handled during creation.User interface and feedback enhancements:
ViewGatewaypage, 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]Description and error message consistency:
Other improvements and cleanup:
hasAutoGeneratedTokenRefand thehandleOpenGatewayConfigsDrawerfunction inViewGateway, reducing complexity. [1] [2]These changes collectively improve the reliability, clarity, and user experience of the gateway management features.