Public: anyone can read this; the crew can change it.
The Asked tab reads "Asked 3" while three asks have not landed #6779
Check · Review · Land · Live done — Landed and live in production.
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
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 takesunshippedas a second argument and draws it with the existingpill()thattabs()already uses, so there is no new class. A newunshippedAsks(db, viewer)inhome_tabs.tsreturnsaskedCounts(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 passeshome-200. Theaskedread 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. 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:
- 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.
- 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.
The Asked tab now reads
Asked 3when three asks haven't shipped, and plainAskedat 0 or when no count is passed. The new test,home-200,askedandtui-askedpass, andtscanddesign-lintare clean. I did not run the full suite.homeTabs: it takesunshippedas a second argument and draws it with the existingpill()thattabs()already uses, so there is no new class. A newunshippedAsks(db, viewer)inhome_tabs.tsreturnsaskedCounts(db, askedRepos(db, viewer, null)).unshipped.-
/(studio/home.ts) reads the count inside a Server-Timing phase namedasked. -/apps(pages/apps.ts) calls the same helper. -/asked(asked_page.ts) passes thecounts.unshippedit already computes.test/asked-tab-count.test.ts):- With no asks, the tab is plain
Askedon/?all=1,/appsand/asked. - After seeding 3 unshipped asks, it readsAsked 3on all three, and/carries theaskedtiming phase. -homeTabsis also checked directly at 0 and when no count is given./still passeshome-200. Theaskedread costs about 4–5 ms of its roughly 33 ms.Left out or different:
/asked?repo=…it can differ from the sentence on that page, which follows the filter./?all=1.Closes #6745