Skip to content

feat(ui-agent-workspace): added agent workspace list view#1093

Merged
MarsKubeX merged 1 commit intokortex-hub:mainfrom
MarsKubeX:feat/agent-workspace-list-view
Mar 12, 2026
Merged

feat(ui-agent-workspace): added agent workspace list view#1093
MarsKubeX merged 1 commit intokortex-hub:mainfrom
MarsKubeX:feat/agent-workspace-list-view

Conversation

@MarsKubeX
Copy link
Contributor

@MarsKubeX MarsKubeX commented Mar 11, 2026

Added agent workspace list view with the current attributes for workspaces list from the CLI. Agent workspaces are mocked in agent-workspace-mock-data.ts

Captura de pantalla 2026-03-11 a las 17 44 46

Part of #1040

Basic unit tests provided.

Signed-off-by: Marcel Bertagnini <mbertagn@redhat.com>
@MarsKubeX MarsKubeX requested a review from a team as a code owner March 11, 2026 16:48
@MarsKubeX MarsKubeX requested review from benoitf, gastoner and jeffmaury and removed request for a team March 11, 2026 16:48
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

Adds a new "Agent Workspaces" page to the application with navigation enum values, type definitions, UI components (card and list), a Svelte store for workspace data, routing configuration, and navigation registry entry to enable users to view agent workspaces.

Changes

Cohort / File(s) Summary
API Types
packages/api/src/navigation-page.ts, packages/api/src/navigation-request.ts
Added AGENT_WORKSPACES enum member to NavigationPage and corresponding interface property in NavigationParameters to support the new navigation target.
App Routing
packages/renderer/src/App.svelte
Added new route at /agent-workspaces rendering the AgentWorkspaceList component with breadcrumb metadata.
Agent Workspace Components
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.svelte, AgentWorkspaceCard.spec.ts, AgentWorkspaceEmptyScreen.svelte, AgentWorkspaceList.svelte, AgentWorkspaceList.spec.ts
Introduced reusable card component for individual workspace display, empty state screen, and main list page component with comprehensive unit tests covering rendering, data display, and accessibility.
Agent Workspaces Store
packages/renderer/src/stores/agent-workspaces.ts
Added writable store initialized with empty array and fetchAgentWorkspaces() function to populate data via IPC, auto-invoked on system-ready event with error logging.
Navigation Integration
packages/renderer/src/navigation.ts, packages/renderer/src/navigation.spec.ts, packages/renderer/src/stores/navigation/navigation-registry-agent-workspaces.svelte.ts, packages/renderer/src/stores/navigation/navigation-registry.ts
Added navigation case routing to /agent-workspaces, created navigation registry entry with robot icon and counter, integrated into navigation initialization with corresponding test coverage.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • kortex-hub/kortex#1040: Implements the requested feature to create a view/page for displaying agent workspaces with list, card, and empty state components.

Possibly related PRs

  • kortex-hub/kortex#1083: Implements the backend manager, mock implementation, and IPC/preload exposure of listAgentWorkspaces() that this PR's store depends on to populate workspace data.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding an agent workspace list view UI component.
Description check ✅ Passed The PR description clearly relates to the changeset, describing the addition of an agent workspace list view with UI components, navigation, and tests.

✏️ 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.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte (1)

20-23: Use a responsive column layout.

grid-cols-3 locks this page to three columns, so cards will get cramped or overflow when the desktop window is narrowed.

♻️ Suggested tweak
-        <div class="grid grid-cols-3 gap-4 p-5 w-full h-fit">
+        <div class="grid grid-cols-1 gap-4 p-5 w-full h-fit md:grid-cols-2 xl:grid-cols-3">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte` around
lines 20 - 23, The layout uses a fixed three-column grid which breaks at
narrower widths; update the container in AgentWorkspaceList.svelte (the div
rendering {`#each` $agentWorkspaces as workspace (workspace.id)} and
AgentWorkspaceCard) to use responsive grid column classes so the number of
columns adapts to viewport size (for example: single column on small screens,
two on medium, three on large). Replace the static "grid-cols-3" style with
responsive variants like "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" (or your
project's equivalent breakpoints) and ensure existing gap/padding classes remain
intact.
🤖 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/stores/agent-workspaces.ts`:
- Around line 24-35: The store currently initializes agentWorkspaces as an empty
array which makes UI treat "loading" as "empty"; change the store type to
Writable<AgentWorkspaceSummary[] | undefined> and initialize it with
writable(undefined), keep fetchAgentWorkspaces() and its
agentWorkspaces.set(data) behavior the same, and ensure the startup listener
(window.addEventListener('system-ready', ...)) still calls
fetchAgentWorkspaces(). Update consumers (notably AgentWorkspaceList.svelte) to
treat undefined as loading and [] as a genuine empty result so the empty-screen
no longer flashes during initial load.

---

Nitpick comments:
In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte`:
- Around line 20-23: The layout uses a fixed three-column grid which breaks at
narrower widths; update the container in AgentWorkspaceList.svelte (the div
rendering {`#each` $agentWorkspaces as workspace (workspace.id)} and
AgentWorkspaceCard) to use responsive grid column classes so the number of
columns adapts to viewport size (for example: single column on small screens,
two on medium, three on large). Replace the static "grid-cols-3" style with
responsive variants like "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" (or your
project's equivalent breakpoints) and ensure existing gap/padding classes remain
intact.
🪄 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: 41543299-eb74-4339-a2af-ee600f3fe67f

📥 Commits

Reviewing files that changed from the base of the PR and between 8cf1b23 and b9502e8.

📒 Files selected for processing (13)
  • packages/api/src/navigation-page.ts
  • packages/api/src/navigation-request.ts
  • packages/renderer/src/App.svelte
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.spec.ts
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.svelte
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceEmptyScreen.svelte
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.spec.ts
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte
  • packages/renderer/src/navigation.spec.ts
  • packages/renderer/src/navigation.ts
  • packages/renderer/src/stores/agent-workspaces.ts
  • packages/renderer/src/stores/navigation/navigation-registry-agent-workspaces.svelte.ts
  • packages/renderer/src/stores/navigation/navigation-registry.ts

Comment on lines +24 to +35
export const agentWorkspaces: Writable<AgentWorkspaceSummary[]> = writable([]);

export async function fetchAgentWorkspaces(): Promise<void> {
const data = await window.listAgentWorkspaces();
agentWorkspaces.set(data);
}

window.addEventListener('system-ready', () => {
fetchAgentWorkspaces().catch((error: unknown) => {
console.error('Failed to fetch agent workspaces', error);
});
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Don't conflate "loading" with "empty".

This store starts at [] and is populated asynchronously, while AgentWorkspaceList.svelte shows its empty screen whenever the array is empty. Users with real workspaces will briefly see "No agent workspaces" until the first fetch resolves.

💡 Minimal direction
-export const agentWorkspaces: Writable<AgentWorkspaceSummary[]> = writable([]);
+export const agentWorkspaces: Writable<AgentWorkspaceSummary[] | undefined> = writable(undefined);

Then have AgentWorkspaceList.svelte treat undefined as "loading" and [] as a real empty result.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/renderer/src/stores/agent-workspaces.ts` around lines 24 - 35, The
store currently initializes agentWorkspaces as an empty array which makes UI
treat "loading" as "empty"; change the store type to
Writable<AgentWorkspaceSummary[] | undefined> and initialize it with
writable(undefined), keep fetchAgentWorkspaces() and its
agentWorkspaces.set(data) behavior the same, and ensure the startup listener
(window.addEventListener('system-ready', ...)) still calls
fetchAgentWorkspaces(). Update consumers (notably AgentWorkspaceList.svelte) to
treat undefined as loading and [] as a genuine empty result so the empty-screen
no longer flashes during initial load.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 84.44444% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/renderer/src/stores/agent-workspaces.ts 28.57% 5 Missing ⚠️
packages/renderer/src/App.svelte 50.00% 1 Missing ⚠️
...src/lib/agent-workspaces/AgentWorkspaceCard.svelte 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@gastoner gastoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on Mac

</script>

<NavPage searchEnabled={false} title="Agent Workspaces">
{#snippet additionalActions()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about adding the search in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea, but I prefer to handle the search feat in another PR.

@MarsKubeX MarsKubeX linked an issue Mar 12, 2026 that may be closed by this pull request
@MarsKubeX MarsKubeX merged commit c418aae into kortex-hub:main Mar 12, 2026
15 checks passed
@MarsKubeX MarsKubeX deleted the feat/agent-workspace-list-view branch March 12, 2026 13:32
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.

Create a view/page to display agent workspaces

3 participants