feat(agent-workspaces): display mounts, environment, and agent in workspace UI#1194
feat(agent-workspaces): display mounts, environment, and agent in workspace UI#1194MarsKubeX wants to merge 1 commit intokortex-hub:mainfrom
Conversation
…kspace UI Bump kortex-cli-api and kortex-workspace-configuration to 0.1.7. The workspace configuration schema replaced `name` with `mounts` and `environment`; the CLI schema added an `agent` field. The Details page now shows mounts (dependencies, configs), environment variables with secret indicators, and the agent. The Card also displays the agent below the workspace name. Closes kortex-hub#1182 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Marcel Bertagnini <mbertagn@redhat.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis PR adds support for displaying workspace agent identifiers, mounts (dependencies and configs), and environment variables throughout the agent workspace UI. It includes dependency version bumps, updated mock data with new configuration structures, and enhanced UI components with comprehensive test coverage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 the current code and only fix it if needed.
Inline comments:
In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte`:
- Around line 97-121: The Mounts section guard uses the nullish coalescing of
dependencies length which hides configs when dependencies exists but is an empty
array; update the outer condition in AgentWorkspaceDetails.svelte to explicitly
check both lengths (e.g., use a logical OR between
configuration.mounts?.dependencies?.length and
configuration.mounts?.configs?.length) so configs-only workspaces render, and
add a regression test for a workspace with { dependencies: [], configs: ['.ssh']
} to ensure the Mounts/Configs rows appear.
- Line 65: The DetailsPage header is rendering an empty string while
workspaceSummary hasn't loaded; update the title prop in
AgentWorkspaceDetails.svelte to use workspaceId as a fallback (e.g.,
title={workspaceSummary?.name ?? workspaceId}) so the page header stays stable
until agentWorkspaces resolves the summary.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7ede4bdf-d85f-41b9-b5d6-a1433f6dc634
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.jsonpackages/main/src/plugin/agent-workspace/agent-workspace-mock-data.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte
| </div> | ||
| {:then configuration} | ||
| <DetailsPage title={configuration.name ?? ''}> | ||
| <DetailsPage title={workspaceSummary?.name ?? ''}> |
There was a problem hiding this comment.
Avoid rendering a blank details title when the summary store is not ready.
If agentWorkspaces has not resolved this workspace yet, the page header collapses to '' even though the configuration view can still load. Falling back to workspaceId keeps the title stable until the summary arrives.
💡 Proposed fix
- <DetailsPage title={workspaceSummary?.name ?? ''}>
+ <DetailsPage title={workspaceSummary?.name ?? workspaceId}>📝 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.
| <DetailsPage title={workspaceSummary?.name ?? ''}> | |
| <DetailsPage title={workspaceSummary?.name ?? workspaceId}> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte` at
line 65, The DetailsPage header is rendering an empty string while
workspaceSummary hasn't loaded; update the title prop in
AgentWorkspaceDetails.svelte to use workspaceId as a fallback (e.g.,
title={workspaceSummary?.name ?? workspaceId}) so the page header stays stable
until agentWorkspaces resolves the summary.
| {#if configuration.mounts?.dependencies?.length ?? configuration.mounts?.configs?.length} | ||
| <tr> | ||
| <DetailsTitle>Mounts</DetailsTitle> | ||
| </tr> | ||
| {#if configuration.mounts?.dependencies?.length} | ||
| <tr> | ||
| <DetailsCell>Dependencies</DetailsCell> | ||
| <DetailsCell> | ||
| {#each configuration.mounts.dependencies as dep (dep)} | ||
| <span class="block">{dep}</span> | ||
| {/each} | ||
| </DetailsCell> | ||
| </tr> | ||
| {/if} | ||
| {#if configuration.mounts?.configs?.length} | ||
| <tr> | ||
| <DetailsCell>Configs</DetailsCell> | ||
| <DetailsCell> | ||
| {#each configuration.mounts.configs as cfg (cfg)} | ||
| <span class="block">{cfg}</span> | ||
| {/each} | ||
| </DetailsCell> | ||
| </tr> | ||
| {/if} | ||
| {/if} |
There was a problem hiding this comment.
Fix the mounts guard for configs-only workspaces.
This condition skips configs whenever dependencies is present but empty, so a configuration like { dependencies: [], configs: ['.ssh'] } hides the entire Mounts section. Check both lengths explicitly instead, and add a configs-only regression case while touching this.
🐛 Proposed fix
- {`#if` configuration.mounts?.dependencies?.length ?? configuration.mounts?.configs?.length}
+ {`#if` (configuration.mounts?.dependencies?.length ?? 0) > 0 || (configuration.mounts?.configs?.length ?? 0) > 0}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte`
around lines 97 - 121, The Mounts section guard uses the nullish coalescing of
dependencies length which hides configs when dependencies exists but is an empty
array; update the outer condition in AgentWorkspaceDetails.svelte to explicitly
check both lengths (e.g., use a logical OR between
configuration.mounts?.dependencies?.length and
configuration.mounts?.configs?.length) so configs-only workspaces render, and
add a regression test for a workspace with { dependencies: [], configs: ['.ssh']
} to ensure the Mounts/Configs rows appear.
|
The format will change with kortex-hub/kortex-cli-api#21. Do you want to integrate the previous version, or wait that the new is merged? |
In that case I'll wait for the new version in kortex-hub/kortex-cli-api#21. |
Bump kortex-cli-api and kortex-workspace-configuration to 0.1.7. The workspace configuration schema replaced
namewithmountsandenvironment; the CLI schema added anagentfield. The Details page now shows mounts (dependencies, configs), environment variables with secret indicators, and the agent. The Card also displays the agent below the workspace name.Closes #1182