emdash icon indicating copy to clipboard operation
emdash copied to clipboard

fix(sidebar): show open folder icon for expanded projects

Open kchung opened this issue 5 months ago • 1 comments

Description

If you have many projects open, it's hard to understand if the project doesn't have any tasks or if it's actually collapsed. This change uses FolderOpen to indicate if that the project is actually open

Related issues

N/A

Testing

  • pnpm run format
  • pnpm run lint
  • pnpm run typecheck
  • Manual: toggled project expand/collapse in the sidebar and confirmed the icon switches between open and closed folder.

Screenshot/Recording (if applicable)

Before After
image image
Checklist
  • [x] I kept this PR small and focused
  • [x] I ran a self-review before opening this PR
  • [x] I ran the relevant local checks or explained why not
  • [x] I updated docs when behavior or setup changed
  • [x] I added or updated tests when behavior changed, or explained why not
  • [x] I only added comments where the logic is not obvious
  • [x] I used Conventional Commits for commit messages and, when possible, the PR title

kchung avatar Jun 06 '26 00:06 kchung

Greptile Summary

This PR adds a visual indicator in the sidebar to distinguish expanded projects from collapsed ones by swapping the FolderClosed icon for FolderOpen when a non-SSH project is expanded.

  • The ProjectIcon ternary now reads isSshProject ? FolderInput : isExpanded ? FolderOpen : FolderClosed, correctly leveraging the existing MobX-observable isExpanded value so the icon updates reactively.
  • SSH projects continue to show FolderInput regardless of expansion state, which preserves their existing visual identity but means they don't yet get the open/closed treatment.

Confidence Score: 5/5

Safe to merge — a one-line icon selection change with no effect on data flow or state management.

The change is scoped to a single ternary expression that picks a display icon. isExpanded is already a MobX-observable-derived value and the component is wrapped in observer, so the icon will update reactively without any additional wiring. No logic, data, or side-effects are altered.

No files require special attention.

Important Files Changed

Filename Overview
src/renderer/features/sidebar/project-item.tsx Added FolderOpen import and updated ProjectIcon ternary to show open/closed folder icons based on isExpanded state for non-SSH projects. Logic is correct and reactive via MobX observer.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Render SidebarProjectItem] --> B{isSshProject?}
    B -- Yes --> C[ProjectIcon = FolderInput]
    B -- No --> D{isExpanded?}
    D -- Yes --> E[ProjectIcon = FolderOpen]
    D -- No --> F[ProjectIcon = FolderClosed]
    C --> G[Render icon in sidebar row]
    E --> G
    F --> G

Reviews (1): Last reviewed commit: "fix(sidebar): show open folder icon for ..." | Re-trigger Greptile

greptile-apps avatar Jun 06 '26 00:06 greptile-apps

thank you for the contribution @kchung ! merging

rabanspiegel avatar Aug 05 '26 18:08 rabanspiegel