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

A preview's toolbar page lists the files its pull changed, each a link to that file's diff #7848

shipped production is serving it opened this has it
opened this

Intent: in a preview, the person sees what this pull changed without leaving the toolbar page. This is the first step toward the vision's "in a preview, a tint on what changed and its diff on selection".

Done when:

  • [ ] GET /:owner/:name/toolbar?env=pull-N shows, under the existing change line, a list of up to 10 changed paths, each with its +/- counts. Each path links to /:owner/:name/pulls/N/files#<fileAnchor(file)>, using the same anchor src/web/diff-view.ts writes.
  • [ ] When more than 10 files changed, the list ends with "and K more", linking to the pull's files page.
  • [ ] The list comes from the same cached diffBetween read that statOf already does in src/web/studio/toolbar.ts. Caching the per-file paths and counts alongside the totals means a second load of the page does not read git again (statReads.count stays the same).
  • [ ] A production toolbar page and a pull the viewer may not see show no list. Paths are escaped.
  • [ ] A test in test/toolbar-change-line.test.ts (or a new test/toolbar-changed-files.test.ts) fails without the change. It covers the list, the anchors, the "and K more" cut-off and the cache hit.
  • [ ] Any new class is named in docs/design/areas/toolbar.md, and bun scripts/design-lint.ts passes.

Files: src/web/studio/toolbar.ts, docs/design/areas/toolbar.md, test/toolbar-change-line.test.ts Risks: a pull with thousands of files. Cap what is kept in the cache, not only what is shown.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs