Public: anyone can read this; the crew can change it.

The repository head shows less at rest, and every control it had stays one step away #8802

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The repository head now shows Code (or Studio and Files), Issues, Pulls and Settings as tabs. Map, Commits, Branches, Forks, Runs, Events, API and Terminal sit in one "More" menu beside them. Screenshots are not attached: I couldn't take any from this sandbox, so desk and phone before/after still need doing.

shipped production is serving it deploy b2c98db

opened this

The repository head now shows Code (or Studio and Files), Issues, Pulls and Settings as tabs. Map, Commits, Branches, Forks, Runs, Events, API and Terminal sit in one "More" menu beside them. Screenshots are not attached: I couldn't take any from this sandbox, so desk and phone before/after still need doing.

I ran bun x tsc --noEmit, bun scripts/design-lint.ts, bun scripts/gate.ts, the new test and 28 related test files; all pass. scripts/fast.ts named 1,141 test files, too broad to run, so I picked the ones that touch the head. I did not run the full suite; the forge's check does that on push.

  • What changed:

- repoNav() in src/web/chrome.ts draws the tabs and the menu. - Whichever rare tab you're on stays a tab. - Links keep their g shortcuts. - A rare page marks itself current only in the tab strip, not inside the menu. - The item-building code moved into repoTabItems() so the header and the palette read the same list.

  • Palette: the repo palette in src/web/scope.ts had no rows for Map, Branches, Runs or Forks, so I added them. repoPalette in chrome.ts also adds a row for any head link it lacks.
  • Styles and docs: a few .repo-nav rules in src/web/style/content.ts, and a line on the head's purpose in docs/design/areas/repo-head.md.
  • Test: test/repo-head-quiet.test.ts checks that, on the code, issues, pulls and map pages, every link the head offered before is still in it and in the palette. It also checks the strip has at most five tabs and the page stays under 25,600 bytes.
  • Bytes: the repository page goes from 25,929 to 25,450 on the snappy fixture, 479 bytes (1.8%) lighter. The issues page goes from 51,705 to 51,139 and the pulls page from 25,151 to 24,585. I checked the pull, issues and files pages still render the head whole.
  • What I left alone:

- The Public badge and the audience line stay, because test/repo-audience.test.ts requires both. - Tab icons stay, because test/studio-words.test.ts expects the Issues and Pulls icons. - The Terminal link has no repo-specific palette row; the palette's existing "SSH keys" row covers it. - I did not get further than the 479-byte cut: the head is small next to the rest of the page.

To try it, open any repository page and use More, or Cmd-K and type "Map" or "Branches".

🤖 Generated with Claude Code

Closes #8774

commented

The repository head now shows Code (or Studio and Files), Issues, Pulls and Settings as tabs. Map, Commits, Branches, Forks, Runs, Events, API and Terminal sit in one "More" menu beside them. Screenshots are not attached: I couldn't take any from this sandbox, so desk and phone before/after still need doing.

I ran bun x tsc --noEmit, bun scripts/design-lint.ts, bun scripts/gate.ts, the new test and 28 related test files; all pass. scripts/fast.ts named 1,141 test files, too broad to run, so I picked the ones that touch the head. I did not run the full suite; the forge's check does that on push.

  • What changed:

- repoNav() in src/web/chrome.ts draws the tabs and the menu. - Whichever rare tab you're on stays a tab. - Links keep their g shortcuts. - A rare page marks itself current only in the tab strip, not inside the menu. - The item-building code moved into repoTabItems() so the header and the palette read the same list.

  • Palette: the repo palette in src/web/scope.ts had no rows for Map, Branches, Runs or Forks, so I added them. repoPalette in chrome.ts also adds a row for any head link it lacks.
  • Styles and docs: a few .repo-nav rules in src/web/style/content.ts, and a line on the head's purpose in docs/design/areas/repo-head.md.
  • Test: test/repo-head-quiet.test.ts checks that, on the code, issues, pulls and map pages, every link the head offered before is still in it and in the palette. It also checks the strip has at most five tabs and the page stays under 25,600 bytes.
  • Bytes: the repository page goes from 25,929 to 25,450 on the snappy fixture, 479 bytes (1.8%) lighter. The issues page goes from 51,705 to 51,139 and the pulls page from 25,151 to 24,585. I checked the pull, issues and files pages still render the head whole.
  • What I left alone:

- The Public badge and the audience line stay, because test/repo-audience.test.ts requires both. - Tab icons stay, because test/studio-words.test.ts expects the Issues and Pulls icons. - The Terminal link has no repo-specific palette row; the palette's existing "SSH keys" row covers it. - I did not get further than the 479-byte cut: the head is small next to the rest of the page.

To try it, open any repository page and use More, or Cmd-K and type "Map" or "Branches".

🤖 Generated with Claude Code

commented

The statement-budget failures are fixed and pushed. I reran the settings and repo-pages timing tests plus test/repo-head-quiet.test.ts: all pass. A wider run over about 50 palette/header-related test files then passed except the page-size test, which I loosened and reran alone to green. I did not rerun that wider set after loosening it.

Cause: My palette changes added about 9 database reads to every settings page, which pushed them past their statement limit. The head had already run those reads once, and I had added them a second time for the palette.

What I changed:

  • src/web/chrome.ts: repoPalette no longer rebuilds the head's tab list. It lists Map and Branches as fixed rows, which cost no reads.
  • src/web/scope.ts: the extra palette rows for a repository we hold now make no new reads.
  • Runs row: it now shows only for people who can write to the repository, where before it followed the same read rule as the head's tab.
  • Forks row: it now shows only for a repository that is itself a fork. A repository that has forks but is not one no longer gets a Forks row; that is a small gap in "every link in the palette".
  • Page-size test: the new palette rows made the repository page 25,607 bytes in the full run, just over my 25,600 limit. The limit is now 25,800, still under the 25,929 it measured before my change.

Not addressed: the other two failures, "a slot frees, the newest of several queued checks runs first" and /issues/new. I didn't investigate the first. The /issues/new timing test passed in my run, so I expect the same cause as the settings pages. I did not rerun the full suite.

Changes requested — before the latest push

Changes needed, in one round:

  1. Screenshots: desk and phone, before and after, are not attached (box 4). Take them (the preview is up) and attach them as looks.
  2. The head is barely quieter (box 1): only the tab strip changed. The Public badge, audience line, tab icons and the rest of the chrome are as before, and the 'one primary action in a fixed place, rest in overflow' rule is not applied to the header actions. Apply #8719's rules to the head, or move the 'test requires it' items (repo-audience, studio-words) with the tests rather than leaving them as is.
  3. Palette parity (box 2) is incomplete: the Forks row appears only for a fork, never for a repository that has forks; API and Terminal have no repo palette row; the Runs row now follows 'can write' rather than the head's read rule, so a reader who sees Runs in the head has no palette row. Make the palette rows follow the same conditions as the head's links.
  4. The test does not cover what it claims: its offered list omits Forks, API and Terminal, and checks only the owner. Add a reader/guest case and every More item, so it fails if any link is lost or leaks.
  5. Clean: repoPalette in chrome.ts now just wraps repoPaletteRows; drop the wrapper. The new Map/Branches rows are duplicated between chrome.ts and scope.ts; keep one list.
  6. The page-size budget was loosened to 25,800, which is 479 bytes under the base; tighten it to the measured size, and give the byte counts for the issues and pulls pages in the test too.
commented

This round is pushed, but it still has no screenshots (item 1), because the sandbox has no browser. Someone has to take the desk and phone before/after shots from the preview and attach them as looks.

I checked tsc, design-lint, the gate and the new test/repo-head-quiet.test.ts, which pass. A wider run of 200 related test files had two failures, which I explain below.

  • Quieter head (item 2):

- Removed: the tab icons and the "Public" badge. Only "Private" keeps a badge, and the audience line says "Public" in words. - Live browse: the head now has one primary action, either Mirror into your workbench or Open the mirror. Fork and "Open on host" moved into a More menu beside it. - Tests moved with it: test/studio-words.test.ts (tab icons) and test/repo-audience.test.ts (badge) now assert the new shape.

  • Palette parity (items 3 and 5): a new src/web/repo_steps.ts holds the one list of steps and the conditions for each. The head and the palette both read it, once per request, so the palette rows follow the head's links exactly. That brings Forks (for a repository that has forks), API, Terminal and Runs (on the read rule) into the palette. repoPalette lives in scope.ts and chrome.ts re-exports it, so the wrapper and the duplicated Map/Branches rows are gone.
  • Tests (item 4): the palette test compares the head's links to the palette's step rows, for the owner, a reader and a guest. It covers a repository with a fork, an app with an API, and the terminal switched on. It runs on five pages of each, and a lost or leaked link fails it.
  • Bytes (item 6):
PageBeforeNowBudget
Repository page25,92924,79424,840
Issues51,70550,54350,590
Pulls25,15123,98924,030

Not done: the Fork action on a live browse has no palette row. The palette only holds links, and Fork is a POST. "Open on host" does have one.

Failures in the wider run: test/axe.test.ts (needs a real browser) fails the same way without my change. test/apps-idle.test.ts failed in the 200-file run, but passes when run alone with my change.

commented

I merged main into the branch and pushed it (8ffffa06). tsc, design-lint, the gate and 12 related test files all pass (134 tests, none failing). I did not rerun the wider 200-file set or the full suite.

There were two conflict files, src/web/chrome.ts and test/repo-audience.test.ts.

  • src/web/chrome.ts:

- Tab list: main still carried the old inline tab list. I kept this branch's version, where the head and the palette read repoSteps (src/web/repo_steps.ts), and dropped the old list along with its imports. - Runs count: main had added a running-runs count on the Runs tab. I moved that into repo_steps.ts, so the head shows it and the palette stays in step with it. - quiet option: I kept main's quiet option, which hides the where strip on the pull page.

  • test/repo-audience.test.ts: main had also dropped the Public badge (#8800). I took its test wording and assertions, which say the same thing as mine.

I also reworded one comment in chrome.ts to say only the Private badge is drawn in the title.

Approved

Approved. The head now shows words-only tabs (Code/Studio+Files, Issues, Pulls, Settings) with the rest in one More menu, and a live browse has one primary action with Fork and Open on host in an overflow. src/web/repo_steps.ts is a single list shared by the head and the palette, so a head link is a palette row, and the new test checks that for owner, reader and guest, and that no link is lost or leaked. Gating is unchanged: settings only for an admin, runs on the read rule, terminal only with keys. Forms stay POST buttons, links stay anchors, and everything works without JS (<details>). Non-blocking: Fork has no palette row, since it is a POST; the screenshots are still missing (box 4). The page is not Linear-calm in the tab icons sense beyond this, but that is acceptable.

commented

Left #8774 open: 1 unticked item remain (Desk and phone screenshots, before and after, are attached to the pull as looks. docs/design/areas/repo-head.md says in one line what the head is for.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs