Skip to content

feat(sidebar): fold covered projects into the project that covers them - #8

Open
na0s-fleet-agents[bot] wants to merge 2 commits into
mainfrom
feat/multi-repo-project-grouping
Open

na0s-fleet-agents[bot] wants to merge 2 commits into
mainfrom
feat/multi-repo-project-grouping

Conversation

@na0s-fleet-agents

@na0s-fleet-agents na0s-fleet-agents Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Problem

A project can now cover several repositories (pingdotgg#35925), but the sidebar still treats every project on its own. If a repository the project covers also has a project of its own, that project's threads sit apart from the project that covers it. In a busy sidebar the threads that need an answer are mixed in with each project's quiet ones. A worktree turn's changed-files card groups files by repository, but does not say which of those repositories has its own project.

Change

Folding. A project whose folder is a repository another project covers shows in that project's sidebar group. It matches the same folder on the same machine, or the same repository on any connected machine. Its threads read api · shop: the repository's folder name, then the covering project. The sidebar's project menu lists each folded project right under its covering project, with its own icon and name, indented as far as the sidebar indents gathered threads. Both indents come from one CSS variable, --sidebar-gathered-indent. Picking the folded project scopes the sidebar to its own threads, so a filter saved for it stays on it and shows checked under the covering project. A covered project's own settings, its entry in the command palette and the draft project picker are unchanged; they already list it. Folding follows a chain of covering projects to its end. Two projects that cover each other stay apart, and so does a project set to Keep separate. Nothing folds into an archived project.

Cross-machine folding needs each covered folder's repository identity, which clients did not get. ProjectTrackedFolder gets an optional repositoryIdentity. The server fills it in on project shells from the existing enrichment cache, which now has an identity-only lookup so covered folders don't trigger favicon scans. A folder whose identity resolves later is pushed in the same enrichment refresh as project roots. The field is never stored, and ProjectAddedFolders drops it on input. The client reducer keeps a folder's known identity through later deltas, the same way it keeps a project's.

Gathered, status-first sidebar. In the default sidebar, threads showing a status (Working, Input, Done, Woke and the rest) come first. Below them, each project that covers repositories gathers its own threads and its folded projects' threads under its name row. They are indented 12px beside a line that ends at the last thread. A thread joins its group once it no longer shows a status. Settings → General → Gather multi-repo projects is on by default. Turning it off gives the current active list, with folding still applied to grouping and filters. The boring (group-by-project) sidebar puts folded threads in the covering project's folder and doesn't gather.

Turn labels. In a turn that changed several repositories, a repository row whose repository has its own project shows that project's icon and name after the folder name. It matches the same way as folding: the project in that folder first, then one for the same repository elsewhere.

User docs: docs/user/thread-sidebar.md (new "Projects with several repositories" section) and docs/user/multi-repo-projects.md.

Scope

This is a feature and UI change built on pingdotgg#35925, not a bug fix. It ports the sidebar and turn-label parts of my fork PR #1 onto the upstream model. That covers the projects a project covers, meaning discovered folders plus trackedFolders. It leaves out the fork's umbrella settings and its checkpoint and worktree code. No maintainer has asked for it.

Surfaces:

  • Web and desktop: sidebar, settings and turn card.
  • Mobile: builds and type-checks unchanged. Its thread list shows each thread's own project name, so it needs no repo · project label. Its project filter does not fold, because folding there would also drop folded projects from the mobile new-thread project picker. Its turn summary has no per-repository rows to label.
  • Command palette: unchanged.
  • Wire: the only contract change is the optional repositoryIdentity field above.

Verification

All images are the web client in e2e's Chromium at 1280×800 with the light theme. Each scenario run starts from a fresh synthetic T3 home and a shop plain folder holding api and web repositories, plus a separate fleet repository. Agents use the dev replay provider. Each scenario was proven with vp run scenarios:prove … --base origin/main --head HEAD. Each fails on base 1368854828 and passes on head: the project menu and sidebar scenarios on 35b525995f, the turn scenario on 63e43fe832, whose code the second commit doesn't touch. The sidebar images below come from the 63e43fe832 run; the second commit moves the 12px indent into a shared variable without changing it.

Scenario Base 1368854828 (main) Head
Threads showing a status lead, and shop gathers its own and api's threads fails: no shop name row passes
The project menu lists api right under shop, indented as far as the sidebar indents shop's threads, and picking it scopes the sidebar to api fails: api is listed after fleet, not under shop passes
A worktree turn's changed files name the repository's own project fails: no label on the api row passes

Sidebar, setting on (the default)

shop is a plain folder that covers api and web. api also has its own project.

Before: main After
Before: one list in activity order; api's threads read "api", Pick a schema (Input) and the Done threads sit among the others After: Pick a schema (Input), Tune cache headers and Rotate deploy keys (Done) lead; below them the shop name row, with Spring launch copy and Fix product route ("api · shop") indented beside a line

Sidebar after opening a Done thread

Before: main After
Before: Tune cache headers loses Done and keeps its place After: Tune cache headers loses Done and joins shop's group at the end; Pick a schema and Rotate deploy keys still lead

Sidebar, setting off

Before: main After, Gather multi-repo projects off
Before: one list; api's threads read "api" After: the same order as main with no name row, and api's threads still read "api · shop"

Project menu

The menu lists api right under shop, indented. In the running app, both api's icon in the menu and Fix product route's card icon in the sidebar sit 12px right of shop's icon. The scenario measures both offsets and checks they match.

Before: main After
Before: the project menu lists shop, fleet and api as equals After: the project menu lists shop, then api indented under it with its own icon, then fleet
Before: after picking api, the menu shows api checked at the bottom and the sidebar lists Fix product route After: after picking api, api is checked under shop, and the sidebar lists only Fix product route ("api · shop") under the shop name row

Worktree turn across two repositories

api has a project titled "API service". web has none.

Before: main After
Before: 2 changed files, grouped into api and web rows showing folder names only After: the api row is followed by the API service icon and name; the web row is unchanged

The replay agent never writes files. The worktree scenario makes the edits itself while the turn waits on a question. The "Could not rename the worktree branch" notice appears because no text-generation model is configured in the scenario.

Tests

  • vp run check:changed origin/main --concurrency 1 on 35b525995f: format, lint, knip, typecheck (39 packages), 29 test files and React Compiler coverage all pass.
  • node scripts/i18n-check.ts: the catalogs match the source in web, mobile and desktop. The four new web strings are translated in all nine locales.
  • client-runtime projectGrouping.test.ts covers folding by folder and by repository across machines, folder matches only on the covering project's machine, the opt-in, Keep separate, archived covering projects, chains and cycles, and which project a covered folder maps to. A property test generates random projects, covered folders, machines and identities. It checks that folding keeps every project in exactly one group, every group key exactly once, and never folds into an archived group or a project that covers nothing.
  • client-runtime shellReducer.test.ts: a refresh carries tracked-folder identities, an unchanged refresh keeps the same snapshot, and a later delta keeps the identities.
  • server ProjectEnrichmentService.test.ts: tracked-folder identities fill in once resolved, a non-repository folder stays plain, and no favicon lookup runs. ShellStream.test.ts: a refresh carries a project whose tracked folder resolved.
  • web Sidebar.logic.test.ts covers gathering order and the status predicate. environmentGrouping.test.ts checks that a folded project keeps its own key, folder name and threads under the covering group.
  • Browser tests: Sidebar.browser.test.tsx renders the sidebar with the setting on and off, checking order, the name row and the api · shop label. A second test opens the project menu and checks that api is listed right under shop. It measures how far api's icon sits right of shop's icon in the menu, and how far a gathered card's icon sits right of the shop name row's icon in the sidebar, and asserts the two are equal (both 12px). It then picks api and checks the sidebar shows only api's threads and api is checked. MessagesTimeline.browser.test.tsx checks the project label on a repository row, and that a row with no project gets none.

Not verified

  • Cross-machine folding in a running app. The scenario runner starts one server, so folding by repository identity across two machines, and the server pushing a covered folder's identity once it resolves, are covered only by the unit tests above.
  • Mobile on a device. Only type checks and existing tests ran.
  • Dark theme and the desktop app. I didn't run them.
  • Full CI. I ran only check:changed and the focused suites.

Made with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Na0s and others added 2 commits November 23, 2026 14:01
A project whose folder is a repository another project covers now shows in
that project's sidebar group: the same folder on the same machine, or the same
repository on any connected machine. Saved project filters follow it. Covered
folders carry their repository identity on project shells for this.

In the default sidebar, threads showing a status lead; below them each
multi-repository project gathers its threads and its folded projects' threads
under its name. Settings > General > Gather multi-repo projects turns the
gathering off. A worktree turn's changed-files card names each repository's
own project after its folder row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he project menu

The sidebar's project menu lists each folded project right under the project
that covers it, indented as far as the sidebar indents gathered threads (one
shared --sidebar-gathered-indent). Picking it scopes the sidebar to that
project's own threads, so a filter saved for it stays on it instead of
following it into the covering project.

Co-Authored-By: Claude Opus 5.5 <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