fix(sidebar): show open folder icon for expanded projects
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 formatpnpm run lintpnpm 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 |
|---|---|
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
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
ProjectIconternary now readsisSshProject ? FolderInput : isExpanded ? FolderOpen : FolderClosed, correctly leveraging the existing MobX-observableisExpandedvalue so the icon updates reactively. - SSH projects continue to show
FolderInputregardless 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
thank you for the contribution @kchung ! merging