Commit

An unknown behind count reads ?, not 0+; Code pages leave the description and topics to Files

syntaqxcommitted Parent10725c1Browse files
3 files+5−20/3 viewed
+2−0
2121 assert.deepEqual(drift(["b3", "b2", "b1"], ["m2", "m1"], 3), { ahead: 3, behind: 0, aheadMore: true, behindMore: true });
2222 assert.equal(count(3, true), "3+");
2323 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), "?");
2426 });
+2−1
2121 return { ahead, behind, aheadMore: false, behindMore: false };
2222 }
2323
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. */
2525 export function count(value: number, more: boolean): string {
26+ if (more && value === 0) return "?";
2627 return more ? `${value}+` : String(value);
2728 }
+1−1
156156 const { pathname } = useLocation();
157157 const tabs = tabsFor(pathname.slice(base.length + 1), member, access.can);
158158 // 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));
160160 // Everyone, signed in or not, finds the project's pages in the sidebar;
161161 // the page shows its name, and the views of the page it is on as tabs.
162162 return (