Show the project folder instead of its Git folder in the `clai2` web sidebar heading tooltip

Merged
MP
1mo ago
+74-7

The sidebar's project heading tooltip was the raw project key, which for every Git repository is its common Git dir (…/scratch/.git). As the issue suggests, the server now sends each Project's folder next to its key (the main checkout, computed by a new project_folder helper that project_names already used inline), and the heading's title reads it. Removed folders (the \0missing key) gets folder: null, so it still has no tooltip.

Alternative considered: stripping /.git in the client. Rejected so the client doesn't parse keys, per the issue.

Tests:

  • tests/clai2/test_web.py::test_sidebar_project_folder_is_its_main_checkout: /api/sessions for a repo with a linked worktree returns folder without .git, and None for Removed folders.
  • tests/clai2/browser/test_web_browser.py::test_project_heading_title_is_its_folder: the heading's title is the folder. It failed on main with Actual value: /x/scratch/.git.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Summary by cubic

Fixes #12198: the clai2 web sidebar's project heading tooltip now shows the project's main checkout folder instead of the raw Git folder key (e.g. /x/scratch instead of /x/scratch/.git).

  • The server now sends each Project's folder alongside its key, computed by a new project_folder helper; removed folders (\0missing) get folder: null and keep no tooltip.
  • Updated the sidebar heading and the browser test to read the new field; rejected client-side key parsing so the UI never inspects Git folders.