Skip to content

feat(sidebar): collapsible Projects section#132

Merged
johannesjo merged 2 commits into
johannesjo:mainfrom
VitorRibeiroCustodio:feature/collapsible-projects-section
May 21, 2026
Merged

feat(sidebar): collapsible Projects section#132
johannesjo merged 2 commits into
johannesjo:mainfrom
VitorRibeiroCustodio:feature/collapsible-projects-section

Conversation

@VitorRibeiroCustodio
Copy link
Copy Markdown
Contributor

@VitorRibeiroCustodio VitorRibeiroCustodio commented May 21, 2026

Summary

Makes the sidebar Projects section collapsible. The section is currently always expanded and always occupies a capped slice of vertical space (40vh, or min(24vh, 180px) when dense). Users who keep many projects but spend most of their time in the tasks list pay that fixed space even when not switching projects.

What changed

  • The Projects section header is now a toggle button with a chevron that reflects collapsed vs. expanded state. Activating it hides the project list and reclaims the space for the tasks section;
  • The add-project control stays visible and usable while the section is collapsed;
  • Collapsed state persists across app restarts via the existing settings persistence (projectsCollapsed flag — no backend/IPC change, rides the existing persisted-state file);
  • Header toggle exposes aria-expanded / aria-controls for accessibility;

Implementation

  • src/components/Sidebar.tsx — header <label> → toggle <button> with chevron; project list wrapped in <Show when={!projectsCollapsed}>;
  • src/store/ — persisted projectsCollapsed flag wired through types, core, autosave, persistence; setProjectsCollapsed setter in ui.ts;
  • openspec/changes/add-collapsible-projects-section/ — proposal, spec, tasks;

Testing

  • npm run lint — pass
  • npm test — 1007 passed (4 new tests cover the persisted flag)
  • npm run typecheck — pass
  • openspec validate --type change add-collapsible-projects-section --strict — pass

Demo

Screen.Recording.2026-05-21.at.09.35.16.mov

Add a collapse/expand toggle to the sidebar Projects section header.
Collapsing hides the project list and reclaims the space for the tasks
section; a chevron on the header reflects the state. The collapsed flag
(`projectsCollapsed`) persists via the existing settings persistence so
it survives app restarts.

Closes johannesjo#130

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@VitorRibeiroCustodio VitorRibeiroCustodio marked this pull request as ready for review May 21, 2026 12:53
Address review feedback on the collapsible Projects section:

- Animate the Projects list collapse via a CSS grid-rows transition so the
  state change no longer snaps. Adds an outer `.projects-collapser` and an
  intermediate `.projects-clip` so the inner scroll container keeps its own
  `overflow-y: auto`. Honours `prefers-reduced-motion`.
- Skip "project mode" in `navigateRow` while collapsed and drop
  `sidebarFocusedProjectId` on collapse so arrow keys don't walk through
  invisible items.
- Give the header toggle a hover background and `:focus-visible` ring via
  `.projects-toggle` so the row reads as clickable.
- Update the openspec change: tasks now match the shipped helper name and
  add a navigation scenario; persistence + ui tests harden the invalid-value
  guard and cover the focus-clear behaviour.
@VitorRibeiroCustodio
Copy link
Copy Markdown
Contributor Author

@johannesjo to review, whenever was time for it.

@johannesjo
Copy link
Copy Markdown
Owner

Thank you very much @VitorRibeiroCustodio ! <3

@johannesjo johannesjo merged commit 2245957 into johannesjo:main May 21, 2026
2 checks passed
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.

2 participants