Skip to content

feat(app): sort sidebar projects#133

Merged
graydawnc merged 1 commit intomainfrom
feat/sidebar-sort
Apr 30, 2026
Merged

feat(app): sort sidebar projects#133
graydawnc merged 1 commit intomainfrom
feat/sidebar-sort

Conversation

@graydawnc
Copy link
Copy Markdown
Collaborator

What

Three changes that grew out of the same iteration on the library shell.

1. Sidebar project sort menu

Hover-revealed sort icon next to the PROJECTS label opens a small menu with:

  • Recent activity (default) — lastSessionAt DESC
  • Name (A–Z) — locale-aware, case-insensitive localeCompare
  • Most sessionssessionCount DESC, ties broken by recency

Selection persists on AgentsConfig (sits alongside the existing sidebarShowSourceDots / sidebarShowSessionCount flags) so it survives restarts. Sorting happens in JS over the existing listProjectGroups payload — no DB query or IPC contract changes. The Loose ("no-git") group stays pinned to the bottom regardless of order.

2. Scroll fade-out on main surfaces

A mask-image: linear-gradient over the last 20–24px on every scrollable list:

  • Sidebar project list
  • LibraryLanding feed
  • ProjectView session list
  • SessionDetail message list

Half-clipped rows at the scroll edge now read as "more below, keep scrolling" instead of "broken edge".

3. Default window 1180×780 → 1080×740

The library redesign had stretched the default further than DESIGN.md's "compact utility, ~960px" stance. Brings it back closer to spec. Min sizes (800×520) unchanged so users can still resize.

Why

The sort menu is the gap most directly visible at scale: at hundreds of sessions across 30+ projects, recency is the only ordering and the tail of the list becomes unfindable without knowing roughly when something was last touched. Three options are enough — a symmetric fourth (First started) was considered and dropped because it has near-zero usage value at this granularity.

The fade-out and the window-size tweak fall out of the same observation: the sidebar (and main feed) at default size always shows N+½ rows, and there's no window height that fixes that for everyone (project counts vary, system DPI varies). Treating it as a visual-affordance problem — fade the edge — is robust across all sizes; treating it as a sizing problem only solves it for one specific row count. Pulling the default down rather than pushing it up matches the "compact utility" direction in DESIGN.md.

How it connects

  • The sort options mirror parts of the ProjectView sort menu (Recent / Most messages / Title) but at project granularity. Wording and the ✓-active pattern match the existing Menu component.
  • Sort persistence is wired through the existing getAgentsConfig / setAgentsConfig IPC. App owns local state and writes through on change; no new IPC handler.
  • The Sidebar consumes status from props and now also sortOrder / onSortOrderChange, so the App is the single source of truth for sidebar pref state.
  • The [mask-image:linear-gradient(to_bottom,...)] Tailwind arbitrary value works directly in Chromium (no -webkit- prefix needed).

Test plan

  • tsc clean
  • vitest 12/12 pass
  • Manual: hover PROJECTS, sort icon appears, all three options change order
  • Manual: choose Most sessions, restart — selection restored
  • Manual: Loose group stays at the bottom across all sort orders
  • Manual: bottom edge of all four scroll surfaces fades out
  • Manual: default-launched window is 1080×740, sidebar still scrolls projects

…ult window

Sidebar gains a sort menu (hover-revealed icon next to PROJECTS) with
three options:

- Recent activity (default) — last_session_at DESC
- Name (A–Z) — locale-aware, case-insensitive
- Most sessions — sessionCount DESC, ties broken by recency

The selection persists on AgentsConfig (alongside the existing
sidebarShowSourceDots / sidebarShowSessionCount flags) so it roams
across restarts. Sorting happens in JS over the existing
listProjectGroups payload — no DB or IPC contract changes. The Loose
("no-git") group always stays pinned to the bottom regardless of order.

Also a few drive-by visual fixes that came up testing this:

- Default window 1180x780 → 1080x740. The library redesign accumulated
  width that doesn't match DESIGN.md's "compact utility, ~960px"
  stance; bringing the default back closer to spec. Min sizes
  unchanged so users can still resize larger.
- Bottom fade-mask on every main scroll surface (sidebar project list,
  LibraryLanding feed, ProjectView, SessionDetail message list). The
  half-clipped row at the bottom of a scrollable list now reads as
  "more below, keeps scrolling" instead of "broken edge". Uses
  mask-image: linear-gradient over the last 20–24px.
@graydawnc graydawnc changed the title feat(app): sidebar project sort menu + scroll fade-out + tighter default window feat(app): sort sidebar projects Apr 30, 2026
@graydawnc graydawnc merged commit e499d25 into main Apr 30, 2026
4 checks passed
@graydawnc graydawnc deleted the feat/sidebar-sort branch April 30, 2026 06:17
graydawnc added a commit that referenced this pull request Apr 30, 2026
* docs(design): rewrite for library-first shell

Realigns DESIGN.md with the shipped library-first product (PRs #122#133).
Reverses the 2026-03-27 "search box is the product" framing now that the
Sidebar + Project View + ⌘K overlay are the home, and adds a decisions-log
row that references the reversal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(design): clean up two stale references missed in first pass

Spacing's "Search bar padding (home / results bar)" and the First-Person
Language Do/Don't row "You starred this" both predated the library-first
shell. Updated to "⌘K overlay / results page" and "You pinned this" so
the doc reads consistently end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Chen <99816898+donteatfriedrice@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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