An unknown behind count reads ?, not 0+; Code pages leave the description and topics to Files
3 files+5−20/3 viewed
| 21 | 21 | assert.deepEqual(drift(["b3", "b2", "b1"], ["m2", "m1"], 3), { ahead: 3, behind: 0, aheadMore: true, behindMore: true }); | |
| 22 | 22 | assert.equal(count(3, true), "3+"); | |
| 23 | 23 | assert.equal(count(3, false), "3"); | |
| 24 | + | // Behind by an unknown number: not "0+", which reads as up to date. | |
| 25 | + | assert.equal(count(0, true), "?"); | |
| 24 | 26 | }); |
| 21 | 21 | return { ahead, behind, aheadMore: false, behindMore: false }; | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | − | /** `12`, or `50+` when the count ran past what was read. */ | |
| 24 | + | /** `12`, `50+` when the count ran past what was read, or `?` when nothing was counted before it did. */ | |
| 25 | 25 | export function count(value: number, more: boolean): string { | |
| 26 | + | if (more && value === 0) return "?"; | |
| 26 | 27 | return more ? `${value}+` : String(value); | |
| 27 | 28 | } |
| 156 | 156 | const { pathname } = useLocation(); | |
| 157 | 157 | const tabs = tabsFor(pathname.slice(base.length + 1), member, access.can); | |
| 158 | 158 | // The files' own About says what it is and its topics, as the one place. | |
| 159 | − | const filesPage = /^(code|tree)(\/|$)/.test(pathname.slice(base.length + 1)); | |
| 159 | + | const filesPage = /^(code|tree|blob|commits?|branches|tags)(\/|$)/.test(pathname.slice(base.length + 1)); | |
| 160 | 160 | // Everyone, signed in or not, finds the project's pages in the sidebar; | |
| 161 | 161 | // the page shows its name, and the views of the page it is on as tabs. | |
| 162 | 162 | return ( |