Skip to content

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

Open
kchung wants to merge 1 commit into
generalaction:mainfrom
kchung:feat-closed-file-icon
Open

fix(sidebar): show open folder icon for expanded projects#2400
kchung wants to merge 1 commit into
generalaction:mainfrom
kchung:feat-closed-file-icon

Conversation

@kchung

@kchung kchung commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

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
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit messages and, when possible, the PR title

The project folder icon was hardcoded to FolderClosed regardless of
expansion state, so collapsing a project gave no visual indicator. Use
FolderOpen when the project is expanded and FolderClosed when collapsed.
@kchung kchung marked this pull request as ready for review June 6, 2026 00:14
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

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
Loading

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

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