Skip to content

feat(app): switching projects opens the agent that worked last, or a new task - #171

Merged
sean-brydon merged 1 commit into
cosscom:mainfrom
uixmat:acting-as-the-main
Oct 20, 2026
Merged

sean-brydon merged 1 commit into
cosscom:mainfrom
uixmat:acting-as-the-main

Conversation

@uixmat

@uixmat uixmat commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What

Switching to another project in the sidebar now moves the main area to that project. This applies to the rail tiles and to the two-column layout's project rows.

  • The project has an agent that is working or waiting on you: its worktree comes to the front with that agent's tab selected. If there are several, the one whose state changed last (state_since ?? created) wins, across all of the project's boxes.
  • It has none: the New task composer opens for that project. It's the same one as the sheet's ⌘N button.
  • Clicking the project that's already picked: nothing in the main area changes.

The choice is a pure function, landingAgent in app/src/lib/project-landing.ts, with unit tests. switchTo in components/sidebar/columns.tsx calls it, and so does the rail.

Tests

  • Unit tests: project-landing.test.ts.
  • E2E: sidebar-columns.spec.ts and sidebar-rail.spec.ts now cover all three cases. Setup steps that click notes close its New task dialog first. The old "leaves the main area as it was" test is replaced. The ↑/↓ test waits for every row, which also fixes flakiness it already had on main. The a11y sidebar scenes switch to shop and then go back Home.
  • Local runs: the app's checks, unit tests, app build, docs build and tsc -p e2e all pass. The touched specs, grid.spec.ts and the a11y suite pass, including --repeat-each=5. I also drove all the scenarios by hand in Chromium on the mock fixtures.

Open points

  • Ties: when two agents changed state at the same moment, the first one found wins. A running agent can therefore win over one that's waiting on you.
  • Contrast: an active worktree row on the rail's sheet already failed axe's colour-contrast check. Switching now makes that row common, so the a11y scenes go back Home to avoid it.

🤖 Generated with Claude Code

…new task

Picking another project on the rail or in the two-column sidebar now lands
the main area there: on its agent that is working or waiting on you whose
state changed last, or, with none, on the new task composer for it.
Picking the project already shown leaves the main area as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@uixmat is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel.

A member of the Team first needs to authorize it.

@uixmat
uixmat marked this pull request as ready for review October 20, 2026 13:13
@sean-brydon
sean-brydon merged commit e501841 into cosscom:main Oct 20, 2026
5 of 7 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