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

The Asked tab reads "Asked 3" while three asks have not landed #6779

Merged opened this

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

Merged

The Asked tab now reads `Asked 3` when three asks haven't shipped, and plain `Asked` at 0 or when no count is passed. The new test, `home-200`, `asked` and `tui-asked` pass, and `tsc` and `design-lint` are clean. I did not run the full suite.

shipped production is serving it deploy fb6f20c

opened this

The Asked tab now reads Asked 3 when three asks haven't shipped, and plain Asked at 0 or when no count is passed. The new test, home-200, asked and tui-asked pass, and tsc and design-lint are clean. I did not run the full suite.

  • homeTabs: it takes unshipped as a second argument and draws it with the existing pill() that tabs() already uses, so there is no new class. A new unshippedAsks(db, viewer) in home_tabs.ts returns askedCounts(db, askedRepos(db, viewer, null)).unshipped.
  • Callers:

- / (studio/home.ts) reads the count inside a Server-Timing phase named asked. - /apps (pages/apps.ts) calls the same helper. - /asked (asked_page.ts) passes the counts.unshipped it already computes.

  • Test (test/asked-tab-count.test.ts):

- With no asks, the tab is plain Asked on /?all=1, /apps and /asked. - After seeding 3 unshipped asks, it reads Asked 3 on all three, and / carries the asked timing phase. - homeTabs is also checked directly at 0 and when no count is given.

  • Budget: a warm / still passes home-200. The asked read costs about 4–5 ms of its roughly 33 ms.

Left out or different:

  • Repo filter: the tab shows the count over all your writable repos, so on /asked?repo=… it can differ from the sentence on that page, which follows the filter.
  • Lean home: a new forge's lean home (steps view) has no tabs, so it shows no count. The test uses /?all=1.

Closes #6745

commented

The Asked tab now reads Asked 3 when three asks haven't shipped, and plain Asked at 0 or when no count is passed. The new test, home-200, asked and tui-asked pass, and tsc and design-lint are clean. I did not run the full suite.

  • homeTabs: it takes unshipped as a second argument and draws it with the existing pill() that tabs() already uses, so there is no new class. A new unshippedAsks(db, viewer) in home_tabs.ts returns askedCounts(db, askedRepos(db, viewer, null)).unshipped.
  • Callers:

- / (studio/home.ts) reads the count inside a Server-Timing phase named asked. - /apps (pages/apps.ts) calls the same helper. - /asked (asked_page.ts) passes the counts.unshipped it already computes.

  • Test (test/asked-tab-count.test.ts):

- With no asks, the tab is plain Asked on /?all=1, /apps and /asked. - After seeding 3 unshipped asks, it reads Asked 3 on all three, and / carries the asked timing phase. - homeTabs is also checked directly at 0 and when no count is given.

  • Budget: a warm / still passes home-200. The asked read costs about 4–5 ms of its roughly 33 ms.

Left out or different:

  • Repo filter: the tab shows the count over all your writable repos, so on /asked?repo=… it can differ from the sentence on that page, which follows the filter.
  • Lean home: a new forge's lean home (steps view) has no tabs, so it shows no count. The test uses /?all=1.
Approved

Approved. The Asked tab wears the unshipped count on /, /apps and /asked. It reuses the existing tabs() pill, which already hides a zero, so there is no new class or markup. It is a link with no JS, the same helper feeds all three pages, and the test fails without the change (plain at 0, Asked 3 after seeding, Server-Timing phase present). The preview answers 200. This is a small, single-purpose pull, and it fits the direction as a fix to a wrong number, not a feature.

Two things I would do next:

  1. On /asked?repo=… the tab count (all writable repos) can differ from the sentence on that page. Either label it or scope the tab to the filter, and add a test.
  2. The lean first-run home has no tabs, so it shows no count. Confirm that is intended, and pin it with a test so it stays that way.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs