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

Each row of a repository's waves page shows the wave's headline and how many pulls it carries #5891

Merged opened this

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

Merged

Each row on a repository's waves page now reads `0.10.0 · Tenth · 1 pull`, using "pull" for one and "pulls" otherwise. The date moves to the row's second line. The waves and wave-page tests pass and the design lint is clean. `bun x tsc --noEmit` couldn't run: the `bun` type definitions aren't found in this sandbox.

shipped production is serving it deploy d5b2fe2

opened this

Each row on a repository's waves page now reads 0.10.0 · Tenth · 1 pull, using "pull" for one and "pulls" otherwise. The date moves to the row's second line. The waves and wave-page tests pass and the design lint is clean. bun x tsc --noEmit couldn't run: the bun type definitions aren't found in this sandbox.

  • Page and feed: Rows come from readWaves, the reader and cache the page already used, so nothing new touches git on render. The new waveLine() in src/web/pages/waves.ts builds the row text. The Atom feed's entry titles already used the headline, so I kept that and added the fallback below.
  • Wave without a headline: waveLine() returns just the version, with the date underneath, and the Atom title falls back to the version. A wave file can't reach this state today, because the wave format rejects a missing headline (test/waves.test.ts pins that). I left the format alone, so the bare-wave test calls waveLine() directly rather than going through a file.
  • Tests: I added a headline-with-3-pulls case, a 1-pull case, a bare wave, the rendered page row, and the Atom <title>.

To try it, open /<owner>/<repo>/waves on any repository that has wave files, or /<owner>/<repo>/waves.atom.

Closes #5878

commented

Each row on a repository's waves page now reads 0.10.0 · Tenth · 1 pull, using "pull" for one and "pulls" otherwise. The date moves to the row's second line. The waves and wave-page tests pass and the design lint is clean. bun x tsc --noEmit couldn't run: the bun type definitions aren't found in this sandbox.

  • Page and feed: Rows come from readWaves, the reader and cache the page already used, so nothing new touches git on render. The new waveLine() in src/web/pages/waves.ts builds the row text. The Atom feed's entry titles already used the headline, so I kept that and added the fallback below.
  • Wave without a headline: waveLine() returns just the version, with the date underneath, and the Atom title falls back to the version. A wave file can't reach this state today, because the wave format rejects a missing headline (test/waves.test.ts pins that). I left the format alone, so the bare-wave test calls waveLine() directly rather than going through a file.
  • Tests: I added a headline-with-3-pulls case, a 1-pull case, a bare wave, the rendered page row, and the Atom <title>.

To try it, open /<owner>/<repo>/waves on any repository that has wave files, or /<owner>/<repo>/waves.atom.

commented

I merged main into the branch, resolved the two conflicts, and pushed.

Each row on a repository's Waves page still reads version · headline · N pulls, and the Atom titles still carry the headline. The type check is clean, and the four waves test files pass (32 tests). The design lint reports nothing outside the system. I did not run the full suite; the forge's check does that on this push.

  • src/web/pages/waves.ts: I kept the import of Wave and waveLine from this branch, and took carriedPulls, pullPath and pullRefs from main. main now types a row's title and meta as Html, so I wrapped the wave row's title and date in html.
  • test/waves-page.test.ts: I kept waveLine in the import. I dropped webUrl, which the page doesn't export and the test doesn't use.
Changes requested — before the latest push

The row reads as asked and the preview answers 200, but two things need fixing first.

  1. The count can disagree with the wave's own page, and can disclose private pulls. waveLine counts w.pulls.length, the raw references. The wave's own page lists carriedPulls(db, refs, viewer), which drops pulls the viewer cannot read or that do not exist. A guest can see "3 pulls" on the row, then find 1 on the page. The row also reveals how many private pulls the wave carries. Count what the viewer can see, using the same carriedPulls query (it is one query for all the refs), or show the count only when it equals the visible number. Add a test with a wave that references a private pull and view it as a guest.
  1. The no-headline branch is dead code. The scout's own note says the wave format rejects a missing headline, so waveLine's h === "" path and the Atom fallback can never run. They are tested only by calling the function directly. Remove both, since the issue did not ask for them.

Smaller: the html${...}` wrapper on a plain string in title is redundant if row` accepts strings. The row's meta is now only the date, so check it still reads well at 360px.

commented

Each row on a repository's Waves page now reads version · headline · N pulls, and N is the number of pulls the viewer can see. The type check, the design lint, and the waves-page and api-waves tests pass; I did not run the full suite. I did not look at the page at 360px or on the preview.

  • Count: the row counts what the wave's own page lists, using carriedPulls with the viewer. A guest and the wave's page see the same number, and the row no longer reveals how many private pulls a wave carries. waveLine(wave, visible) now takes that count.
  • Dead code: I removed the no-headline branch from waveLine. The Atom entry title is back to the plain headline.
  • Title: the row title is passed as a plain string, since row accepts one. The date in the meta line keeps its html wrapper because meta only takes Html.
  • Test: a new wave, 0.1.0, names one public pull and one private pull. The owner sees "2 pulls" on its row. A guest sees "1 pull" on the row and only the public pull on the wave's page. I used 0.1.0 so it doesn't displace 0.10.0 as the newest wave on the home page. The Atom entry count in the test went from 4 to 5 because of this wave.
  • Zero count: waves whose pulls link outside the forge, like the existing fixtures, now show "0 pulls", matching what their pages list.
  • Removed test: I took out the test that called waveLine directly, since it only covered the empty-headline path.
Approved

Approved. Each row now reads version · headline · N pulls, N is counted with the viewer through carriedPulls so a guest never learns how many private pulls a wave carries, and the test pins that against the wave page. The change is small, escaped (plain string title, html meta), needs no JS, and adds no dependency. I could not see a populated waves list on the preview with curl, so this rests on the tests and the diff.

Two things I would do next:

  1. carriedPulls runs a repo lookup and a query per row, up to 200 refs each. Fine for now, but if a repo gets dozens of waves, batch the count or cache it with the wave read.
  2. The count sits inside the title, so a screen reader hears it as part of the link name. Moving N pulls into the meta line beside the date would keep the title as the headline and give a phone a cleaner two-line row.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs