Skip to content

feat(app): sort sidebar projects by recent activity - #4140

Closed
gengjiawen wants to merge 1 commit into
getpaseo:mainfrom
gengjiawen:feat/sidebar-recent-sort
Closed

feat(app): sort sidebar projects by recent activity#4140
gengjiawen wants to merge 1 commit into
getpaseo:mainfrom
gengjiawen:feat/sidebar-recent-sort

Conversation

@gengjiawen

@gengjiawen gengjiawen commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Product discussion: #4138 (the same request was filed earlier as #2626 and auto-closed per the issues-are-for-bugs policy).

Adds a Sort projects preference to the sidebar display menu, shown when grouping by project. Manual is the existing drag order; Recent activity puts the project with the freshest workspace activity first, so with many projects the one you are actually working in is always at the top.

Design decisions

  • Recency is the latest statusEnteredAt among a project's workspace entries — the same timestamp the workspace rows already show (workspace status merged with root-agent activity), so the sort always agrees with what the rows display.
  • The default stays Manual; nothing changes until you opt in.
  • Projects without a timestamp keep their manual relative order, after every dated project.
  • Drag-and-drop is ignored while the recency sort is active: a drop position taken from a sorted view says nothing about the manual order, so it never overwrites it. Switching back to Manual restores the drag order exactly as you left it.
  • Timestamps come from the unfiltered entries map, so an active label filter cannot change which workspace stands for a project.
  • The sort row only appears in project grouping (status grouping has no project sections).
  • Persisted as an optional key in the sidebar-view store's strict schema — existing persisted state keeps parsing, no version bump.

QA

Automated coverage

New Playwright e2e exercising the full journey — drag a manual order, switch to Recent activity, watch fresh activity in another project reorder the list live, reload to prove the preference survives the strict persisted schema, switch back to Manual and get the drag order back:

npx playwright test --project=browser e2e/browser/sidebar-project-sort.spec.ts
  ✓  1 [browser] › e2e/browser/sidebar-project-sort.spec.ts:41:5 › recent-activity sort reorders projects live and leaves the manual order alone (1.2m)
  1 passed

New unit tests for the sort (freshest-first, undated projects keep manual order after dated ones, identity return when nothing moves) plus the store migration carrying the new key:

npx vitest run src/hooks/sidebar-workspaces-view-model.test.ts src/stores/sidebar-view-store.test.ts src/components/sidebar-workspace-list.test.tsx src/i18n/resources.test.ts --bail=1
 Test Files  4 passed (4)
      Tests  99 passed (99)

npm run typecheck and npm run lint clean. All nine locales carry the new strings.

Re-verified on a rebase onto main at da8c1b5c9, 80 commits past the original branch point: the rebase is conflict-free, and npm run typecheck, npm run lint, npm run format:check, the e2e spec and the four unit files above are all green on it.

Manual

I deployed the built web UI onto my own live daemon and use it with a dozen projects: the row appears under the display menu in project grouping, Recent activity keeps the active project on top as agents report activity, and Manual brings back my drag order.

The sort row under the display menu, shown only in project grouping:

Sort projects menu row

Four projects. Manual is the drag order; Recent activity puts the freshest first:

Manual versus Recent activity

Fresh activity in design-system moves it to the top with no manual reorder:

Activity bump reorders live

Platform matrix

Platform Tested Notes
iOS Cross-platform code paths only — zustand store, pure sort, existing menu/OptionList components; no platform gates added
Android Same as iOS
Web Playwright e2e + unit tests; author-verified on a live deployment
Desktop macOS Same code path as web; untested
Desktop Windows Same code path as web; untested
Desktop Linux Same code path as web; untested

🤖 Generated with Claude Code

Add a "Sort projects" preference to the sidebar display menu, shown when
grouping by project. "Manual" keeps the existing drag order; "Recent
activity" puts the project with the freshest workspace activity first,
using the same status timestamp the workspace rows already show.

- Default stays "manual", so nothing changes until opted in.
- Recency is the latest statusEnteredAt among a project's workspace
  entries; projects without a timestamp keep their manual relative
  order after every dated one.
- Drag-and-drop is ignored while the recency sort is active, so a drop
  position taken from a sorted view never overwrites the manual order.
- Persisted as an optional key in the sidebar-view store; existing
  persisted state (strict schema) keeps parsing.

Product discussion: getpaseo#4138

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gengjiawen

Copy link
Copy Markdown
Contributor Author

@boudra Can you take a look at this ? thx

@boudra

boudra commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closing this feature PR. Please discuss the workflow and shared need in Discussions, following CONTRIBUTING.md.

@boudra boudra closed this Sep 8, 2026
@gengjiawen

Copy link
Copy Markdown
Contributor Author

Closing this feature PR. Please discuss the workflow and shared need in Discussions, following CONTRIBUTING.md.

#4138 I already opened discussion, can you reopen this PR

@gengjiawen

Copy link
Copy Markdown
Contributor Author

Closing this feature PR. Please discuss the workflow and shared need in Discussions, following CONTRIBUTING.md.

#4138 I already opened discussion, can you reopen this PR

@boudra

gengjiawen added a commit to gengjiawen/paseo that referenced this pull request Sep 9, 2026
gengjiawen added a commit to gengjiawen/paseo that referenced this pull request Sep 9, 2026
gengjiawen added a commit to gengjiawen/paseo that referenced this pull request Sep 9, 2026
ChrisjanWust added a commit to ChrisjanWust/paseo that referenced this pull request Sep 9, 2026
Import 50e089f while preserving compact project workspace preferences. Extend browser coverage to verify sorting and manual-order restoration with compact mode enabled.
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