Skip to content

[codex] Update sidebar main workspace icons#3800

Merged
Kitenite merged 4 commits into
mainfrom
sidebar-icon-close-button
Apr 27, 2026
Merged

[codex] Update sidebar main workspace icons#3800
Kitenite merged 4 commits into
mainfrom
sidebar-icon-close-button

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 27, 2026

Summary

  • Use CgLaptop for local main workspace sidebar icons.
  • Pass workspace type into collapsed and expanded sidebar icon rendering.
  • Split the expanded sidebar row into separate remove-from-sidebar and close-workspace action buttons with distinct icons, handlers, aria labels, and tooltips.
  • Preserve existing remote/cloud/offline host icon behavior for main workspaces outside the local-device path.

Validation

  • bun run --cwd apps/desktop typecheck
  • bunx @biomejs/biome@2.4.2 check on the changed sidebar files

Summary by CodeRabbit

  • UI Improvements
    • Sidebar shows distinct workspace-type indicators, including a laptop icon for main local workspaces.
    • Collapsed workspace button now conveys workspace type so icons match expanded and collapsed states.
    • Action behavior clarified: main workspaces use a "Remove from sidebar" control (minus icon), other workspaces use a "Close workspace" control (X), each with appropriate tooltip and hotkey behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c875876f-c0ca-44b5-adfb-7cc324e2f7b6

📥 Commits

Reviewing files that changed from the base of the PR and between 82d01f6 and e7a9955.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx

📝 Walkthrough

Walkthrough

Passes workspace.type as a new required workspaceType prop through sidebar workspace components; expanded row replaces a single delete handler with separate onRemoveFromSidebarClick and onCloseWorkspaceClick callbacks and uses a minus icon for main workspaces; icon rendering now shows a laptop for local main workspaces. (49 words)

Changes

Cohort / File(s) Summary
Workspace item entry
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx
Pass workspace.type down as workspaceType to child components and replace single delete callback with two distinct callbacks for remove vs close.
Collapsed workspace button
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx
Added required workspaceType: DashboardSidebarWorkspaceType prop; destructure and forward it to DashboardSidebarWorkspaceIcon.
Expanded workspace row
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
Replaced onDeleteClick with onRemoveFromSidebarClick and onCloseWorkspaceClick; choose minus icon and remove-from-sidebar action for workspace.type === "main", X/close for others; forward workspaceType to icon.
Workspace icon
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx
Added workspaceType prop; render CgLaptop when hostType === "local-device" AND workspaceType === "main" before previous local-device fallback.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through props and left a trail,
Main workspaces wear a laptop veil,
Buttons now split—remove or close,
I tidy trees where the sidebar grows,
Nibbles, icons, and a joyful tail! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description includes clear bullet points explaining the changes (using CgLaptop, passing workspace type, splitting action buttons, preserving existing behavior) and references validation steps, but lacks required sections from the template (Related Issues, Type of Change, Testing details, Screenshots, Additional Notes). Expand the description to include Related Issues section (if applicable), select Type of Change checkbox(es), add detailed testing steps, and any other context. The summary itself is clear but incomplete against the template structure.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title '[codex] Update sidebar main workspace icons' is a clear reference to the primary change where CgLaptop icons are added for local main workspaces and workspace type is passed to icon components. It's specific and accurately reflects the main focus of the changeset.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sidebar-icon-close-button

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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR propagates a new workspaceType prop ("main" | "worktree") through the sidebar icon and row components so the main workspace renders a CgLaptop icon and a minus (−) remove action instead of the X close action used for worktree workspaces. The changes are coherent, type-safe, and validated by the project's type checker.

Confidence Score: 5/5

Safe to merge — all findings are P2 style/edge-case observations

The implementation is correct for the described scope. The only finding (offline state hidden behind the laptop icon for a remote-device main workspace) is a P2 edge case that may not even be a reachable state in the application.

DashboardSidebarWorkspaceIcon.tsx — ordering of workspaceType guard vs. isRemoteDeviceOffline branch

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx Adds workspaceType prop; inserts CgLaptop icon for main workspaces before host-type checks, which skips the offline indicator path for remote-device main workspaces
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx Passes workspace.type to both icon instances; swaps close button icon to HiMiniMinus for main workspaces and keeps HiMiniXMark for worktrees — looks correct
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx Threads new workspaceType prop through to DashboardSidebarWorkspaceIcon — straightforward and correct
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx Passes workspace.type to DashboardSidebarCollapsedWorkspaceButton — minimal, correct change

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[DashboardSidebarWorkspaceItem] -->|workspaceType| B[DashboardSidebarCollapsedWorkspaceButton]
    A --> C[DashboardSidebarExpandedWorkspaceRow]
    B -->|workspaceType| D[DashboardSidebarWorkspaceIcon]
    C -->|workspace.type| D
    D --> E{pullRequestState?}
    E -->|yes| F[PR icon]
    E -->|no| G{workspaceType === 'main'?}
    G -->|yes| H[CgLaptop icon]
    G -->|no| I{hostType?}
    I -->|local-device| J[RxDot]
    I -->|remote-device offline| K[TbCloudOff]
    I -->|cloud| L[TbCloud]
    C --> M{isMainWorkspace?}
    M -->|yes| N[HiMiniMinus — Remove from sidebar]
    M -->|no| O[HiMiniXMark — Close workspace]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx
Line: 77-79

Comment:
**Offline state not reflected for main workspaces on remote devices**

The `workspaceType === "main"` guard short-circuits before the `isRemoteDeviceOffline` branch, so a main workspace whose host is a remote device that is currently offline will display the `CgLaptop` icon with no visual degradation (no `TbCloudOff` / opacity-60 treatment). If main workspaces can only be on local devices in practice this is harmless, but if the type system allows remote-device main workspaces the offline state becomes invisible to the user.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Update sidebar main workspace icons" | Re-trigger Greptile

Comment on lines +77 to +79
if (workspaceType === "main") {
return <CgLaptop className={cn("size-4 transition-colors", iconColor)} />;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Offline state not reflected for main workspaces on remote devices

The workspaceType === "main" guard short-circuits before the isRemoteDeviceOffline branch, so a main workspace whose host is a remote device that is currently offline will display the CgLaptop icon with no visual degradation (no TbCloudOff / opacity-60 treatment). If main workspaces can only be on local devices in practice this is harmless, but if the type system allows remote-device main workspaces the offline state becomes invisible to the user.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx
Line: 77-79

Comment:
**Offline state not reflected for main workspaces on remote devices**

The `workspaceType === "main"` guard short-circuits before the `isRemoteDeviceOffline` branch, so a main workspace whose host is a remote device that is currently offline will display the `CgLaptop` icon with no visual degradation (no `TbCloudOff` / opacity-60 treatment). If main workspaces can only be on local devices in practice this is harmless, but if the type system allows remote-device main workspaces the offline state becomes invisible to the user.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx`:
- Around line 287-290: In DashboardSidebarExpandedWorkspaceRow, prevent keyboard
events from reaching the parent row onKeyDown by stopping propagation for
Enter/Space on the button handlers (the same places you already call
event.stopPropagation() in the onClick block for the remove and other button
elements); update the button event handlers (e.g., the onKeyDown for the remove
button and the other button at the same area) to check for event.key === 'Enter'
|| event.key === ' ' (or 'Spacebar' for broad support) and call
event.preventDefault() and event.stopPropagation() before invoking
onRemoveFromSidebarClick (or the corresponding action), so keyboard activation
won't bubble to the parent DashboardSidebarExpandedWorkspaceRow onKeyDown
handler.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: a25a4da7-992e-463c-a7ed-04e2889550ad

📥 Commits

Reviewing files that changed from the base of the PR and between 80b4b5b and 82d01f6.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx

@Kitenite Kitenite merged commit 180425a into main Apr 27, 2026
7 checks passed
@Kitenite Kitenite deleted the sidebar-icon-close-button branch April 27, 2026 17:38
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

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.

1 participant