Skip to content

feat(desktop): handle local/remote/offline state on sidebar workspace icons#3649

Merged
Kitenite merged 2 commits into
mainfrom
please-help-me-handle-state-on-the-sidebar-icons-for-local-should-be-super-simple-icon-for-remote-sh
Apr 22, 2026
Merged

feat(desktop): handle local/remote/offline state on sidebar workspace icons#3649
Kitenite merged 2 commits into
mainfrom
please-help-me-handle-state-on-the-sidebar-icons-for-local-should-be-super-simple-icon-for-remote-sh

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 22, 2026

Summary

  • Local workspaces now render a minimal dot icon; remote and cloud workspaces render a cloud icon
  • Remote-device workspaces whose associated host is offline (v2Hosts.isOnline === false) render CloudOff with reduced opacity
  • Sidebar tooltip labels the host type (local / remote / cloud) and surfaces the offline state when applicable

Test plan

  • Local workspace shows the dot icon
  • Remote workspace with an online host shows the cloud icon
  • Remote workspace whose host goes offline shows the cloud-off icon and tooltip says "device offline"
  • Fully-cloud workspace shows the cloud icon
  • Tooltip copy reads correctly for each host type in the expanded sidebar

Summary by CodeRabbit

  • New Features
    • Remote device workspaces now display online/offline status with enhanced visual indicators and tooltips, clearly distinguishing between offline remote devices, online remote devices, and local devices.

Summary by cubic

Show the workspace’s host type and online state in the sidebar. Local shows a small dot; remote/cloud show a cloud; remote-device shows a dimmed cloud-off when offline, with clear tooltips.

  • New Features
    • Added hostIsOnline to sidebar workspace data and props.
    • Render dot for local, cloud for remote/cloud, and LuCloudOff when a remote device is offline.
    • Updated tooltips to label Local / Remote / Cloud and indicate "device offline" when applicable.

Written for commit 49215a5. Summary will update on new commits.

…e-on-the-sidebar-icons-for-local-should-be-super-simple-icon-for-remote-sh
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

The PR extends the dashboard sidebar workspace data model to include a hostIsOnline field that tracks remote host connectivity. This field is threaded through components and used to conditionally render different workspace icons and tooltips based on host type and online status, with special handling for offline remote devices.

Changes

Cohort / File(s) Summary
Data Model & Hook
types.ts, useDashboardSidebarData.ts
Extended DashboardSidebarWorkspace interface with hostIsOnline: boolean | null field; hook now derives and populates this field from host state for remote-device workspaces.
Icon Component Refactor
DashboardSidebarWorkspaceIcon.tsx
Replaced icon selection logic with renderHostIcon() helper that renders local-device indicator for local hosts, cloud/cloud-off icons for remote-device based on hostIsOnline status, and removed variant-dependent styling.
Component Prop Threading
DashboardSidebarWorkspaceItem.tsx, DashboardSidebarCollapsedWorkspaceButton.tsx
Parent and collapsed button components now accept and forward hostIsOnline prop down to icon component.
Expanded View & Tooltips
DashboardSidebarExpandedWorkspaceRow.tsx
Updated tooltip text to conditionally display "Offline" label for offline remote devices, and provide distinct labels for local and cloud workspaces based on hostType.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A host online now shows its face,
With icons bright in their rightful place!
Remote or local, the sidebar knows,
Which workspaces live where the connection flows.
bounces

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding handling of local, remote, and offline states to sidebar workspace icons, directly matching the PR's core functionality.
Description check ✅ Passed The description includes a clear summary, test plan, and explains the changes well, though it lacks explicit sections for Related Issues and Type of Change from the template.
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 please-help-me-handle-state-on-the-sidebar-icons-for-local-should-be-super-simple-icon-for-remote-sh

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 22, 2026

Greptile Summary

This PR adds host-type-aware and offline-state-aware visual feedback to workspace icons and tooltips in the dashboard sidebar. Local workspaces now display a minimal dot, remote/cloud workspaces display a cloud icon, and remote workspaces whose associated host is offline display a dimmed CloudOff icon with descriptive tooltip copy.

Key changes:

  • DashboardSidebarWorkspaceIcon — replaces the previous LuFolderGit2/LuLaptop/LuCloud tri-branch with a renderHostIcon() helper; uses hostIsOnline === false (strict check) to distinguish confirmed-offline from unknown/null state
  • useDashboardSidebarData — reads hosts?.isOnline in the live query and propagates it as hostIsOnline on workspace objects, with null explicitly set for non-remote-device types to avoid leaking irrelevant data
  • DashboardSidebarExpandedWorkspaceRow — replaces the generic "Worktree workspace / Isolated copy for parallel development" tooltip with host-type-specific and offline-aware strings
  • DashboardSidebarWorkspace type — gains hostIsOnline: boolean | null aligned with data-layer semantics

Confidence Score: 5/5

Safe to merge — the changes are additive, well-scoped, and the offline detection logic is correct.

All data-flow paths are consistent: hostIsOnline is gated to null for non-remote-device types at the data layer and the strict === false check correctly differentiates confirmed offline from status unknown (null). The icon/tooltip logic covers all three host types without gaps. No existing behavior is broken.

No files require special attention.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx Replaces type-based icon logic with a renderHostIcon() helper; local-device gets a small dot, offline remote-device gets LuCloudOff at 60% opacity, everything else gets LuCloud.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts Adds hostIsOnline field to the live query and gates it so only remote-device workspaces carry a non-null value.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx Passes hostIsOnline to DashboardSidebarWorkspaceIcon and replaces generic tooltip copy with type-specific and offline-aware strings.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/types.ts Adds hostIsOnline: boolean
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/DashboardSidebarWorkspaceItem.tsx Threads hostIsOnline prop down to DashboardSidebarCollapsedWorkspaceButton.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx Accepts and forwards hostIsOnline to DashboardSidebarWorkspaceIcon for the collapsed sidebar icon.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["useDashboardSidebarData\n(live query: hosts?.isOnline)"] --> B{hostType?}
    B -->|"cloud\n(hostMachineId == null)"| C["hostIsOnline: null"]
    B -->|"local-device\n(machineId matches)"| D["hostIsOnline: null"]
    B -->|"remote-device\n(different machineId)"| E["hostIsOnline: boolean | null\n(from hosts.isOnline)"]
    C & D & E --> F["DashboardSidebarWorkspace\n{ hostType, hostIsOnline }"]
    F --> G["DashboardSidebarWorkspaceItem"]
    G --> H["DashboardSidebarCollapsedWorkspaceButton"]
    G --> I["DashboardSidebarExpandedWorkspaceRow"]
    H --> J["DashboardSidebarWorkspaceIcon"]
    I --> J
    J --> K{Render icon}
    K -->|"local-device"| L["● dot span"]
    K -->|"remote-device && hostIsOnline === false"| M["LuCloudOff opacity-60"]
    K -->|"remote-device (online/null) or cloud"| N["LuCloud"]
Loading

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin' in..." | Re-trigger Greptile

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.

🧹 Nitpick comments (2)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx (1)

134-153: Optional: flatten the nested ternary in the tooltip copy.

The double-nested ternary for both <p> blocks is correct but a bit hard to scan. Consider extracting a small helper (e.g. getHostTooltipCopy(hostType, hostIsOnline) returning { title, subtitle }) to improve readability and keep the two strings in sync as host types evolve.

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

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx`
around lines 134 - 153, Refactor the nested ternaries inside
DashboardSidebarExpandedWorkspaceRow (the two <p> blocks within TooltipContent)
by creating a helper function getHostTooltipCopy(hostType, hostIsOnline) that
returns an object like { title, subtitle }; replace the inline ternaries with
title and subtitle lookups so both tooltip strings are produced in one place,
keeping hostType and hostIsOnline logic centralized and easier to maintain as
host types change.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx (1)

33-63: Icon branching looks good; one minor accessibility nit.

Logic correctly handles local-dot / remote-online-cloud / remote-offline-cloud-off / cloud → cloud. Since renderHostIcon is invoked only inside render and doesn't need a stable identity, inlining it (or wrapping with useMemo) is a matter of taste — current form is fine.

Minor a11y suggestion: the icons are purely decorative (tooltip in DashboardSidebarExpandedWorkspaceRow provides the label, and the collapsed button conveys semantics via aria-label), so consider adding aria-hidden="true" to the LuCloud/LuCloudOff SVGs and the local-device dot <span> to avoid any stray accessible-name contribution from SVG <title> defaults in some react-icons setups.

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

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx`
around lines 33 - 63, The decorative host icons returned by renderHostIcon (the
local-device dot <span> and the LuCloud / LuCloudOff SVG components) can
contribute stray accessible names; mark them explicitly decorative by adding
aria-hidden="true" to the <span> used for the local device dot and to the
LuCloud and LuCloudOff components inside renderHostIcon so screen readers ignore
these visuals (the accessible label is provided elsewhere via
DashboardSidebarExpandedWorkspaceRow tooltip / collapsed button aria-label).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx`:
- Around line 134-153: Refactor the nested ternaries inside
DashboardSidebarExpandedWorkspaceRow (the two <p> blocks within TooltipContent)
by creating a helper function getHostTooltipCopy(hostType, hostIsOnline) that
returns an object like { title, subtitle }; replace the inline ternaries with
title and subtitle lookups so both tooltip strings are produced in one place,
keeping hostType and hostIsOnline logic centralized and easier to maintain as
host types change.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx`:
- Around line 33-63: The decorative host icons returned by renderHostIcon (the
local-device dot <span> and the LuCloud / LuCloudOff SVG components) can
contribute stray accessible names; mark them explicitly decorative by adding
aria-hidden="true" to the <span> used for the local device dot and to the
LuCloud and LuCloudOff components inside renderHostIcon so screen readers ignore
these visuals (the accessible label is provided elsewhere via
DashboardSidebarExpandedWorkspaceRow tooltip / collapsed button aria-label).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 202507bf-3d67-4b56-8472-1390d3f9ca88

📥 Commits

Reviewing files that changed from the base of the PR and between 52e9e75 and 49215a5.

📒 Files selected for processing (6)
  • 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/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceIcon/DashboardSidebarWorkspaceIcon.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/types.ts

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 6 files

@Kitenite Kitenite merged commit b21a3b9 into main Apr 22, 2026
7 checks passed
@Kitenite Kitenite deleted the please-help-me-handle-state-on-the-sidebar-icons-for-local-should-be-super-simple-icon-for-remote-sh branch April 22, 2026 20:35
@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