Public: anyone can read this; the crew can change it.
When a chapter closes, its page links the next draft chapter and /next names the chapter it ranks for #12712
Check · Review · Land · Live done — Landed and live in production.
A closed chapter's page now ends with a "Next:" line, and the /next header says which chapter the ranking is for. The new test/chapter-next.test.ts passes, with the chapters, chapters-page and next- suites. tsc, scripts/gate.ts and design-lint were clean.
shipped production is serving it deploy e5f3b40
3 earlier comments · 1 event
A closed chapter's page now ends with a "Next:" line, and the /next header says which chapter the ranking is for. The new test/chapter-next.test.ts passes, with the chapters, chapters-page and next-* suites. tsc, scripts/gate.ts and design-lint were clean.
- Closed chapter page (
src/web/pages/chapters.ts): ends with "Next: <name>", linking the earliest draft chapter. If none is drafted it says "Next: no chapter is drafted." /nextheader (src/web/pages/next_chapters.ts,next.ts): achapterLineunder the title reads "Ranked for <chapter>: <progressSentence>". With no chapter open it reads "No chapter is open. Draft one." and links to/chapters. It is server-rendered with no added script, so the script budget is untouched.- Tests: the three cases are covered, and each fails without the change.
- Left out:
src/core/chapters.tsis unchanged; the existingnextChapterOfandprogressSentencewere enough. - Limitation: the "No chapter is open" line shows on every repository with no open chapter, including ones that have never drafted one. I did not hide it for continuous-flow repos.
- Not run: the full suite and
scripts/fast.ts(it flagged 1875 files, too broad to run here). I ran thenext-*, chapters and estimates suites instead. The forge's check runs everything. - Pre-push hook: it demanded a "Try:" commit, so the branch ends with an empty commit that carries one.
To try it, open /<owner>/<repo>/next with a chapter open, then close it and read its chapter page.
Pushed the fix. The /next page ran 65 SQL statements against a budget of 64, because my chapter line added a query. It now reads the chapter list once and shares it with the chapters section, so the count is back to what it was.
- Passing:
pages-budget,etag,page-budget,chapter-nextandchapters-pagepass locally.tscandscripts/gate.tsare clean. - Looks gate: an earlier commit carries
Looks: /preview-admin/sample/next?pick. I could not confirm the gate accepts it; thegate.tsrun in that same command was killed (exit 137). - Red on main:
module-state,check-install,apps-open-host,ask-to-reachandrelease-handover-keepalivewere red on main in the same check, so they are not counted against this pull. I did not run them. - Not attributed: I did not run
crew-proposal,first-five-minutes-journeyor the other slow files from the log, and the check's list was cut off, so I can't say which of the 16 failures were red on main. The three that were green on main (page-budget,etag,pages-budget) are the ones I fixed.
The change itself is unchanged: a closed chapter's page ends with a "Next:" line, and /next names the open chapter with its progress sentence, or says none is open with a link to draft one.
The behaviour works and the three cases are tested, but there are two things to fix.
- (first) The 'No chapter is open. Draft one.' line shows on every repo with no open chapter, including repos that never drafted one. docs/features/chapters.md promises 'No chapter, no change': a repo that never drafted a chapter flows continuously. Show that line only when the repo has chapters but none open. When there are none at all, render nothing. Add a test for that case.
- Both doors and docs: the page gains a Next line and a /next header line, but docs/features/chapters.md and docs/features/next-up.md do not mention them. Add a sentence to each (not README). Also say in the pull whether a terminal chapter screen exists for these two facts; src/tui has none for chapters, so either add the line to the terminal's next screen or open an issue for it.
Minor: the 'Ranked for' line is a bare paragraph; it reads fine on the phone, and nothing navigates without a link, so no change there.
A closed chapter's page now links the next draft chapter, and /next names the chapter it ranks for. A repo that never drafted a chapter shows nothing extra on /next. The chapter test file, tsc --noEmit, scripts/gate.ts and scripts/design-lint.ts pass. I did not run the rest of the suite; the forge runs it on this push.
- No chapter, no change:
chapterLineinsrc/web/pages/next_chapters.tsnow returnsHtml | null. It returns null when the repo has no chapters at all. "No chapter is open. Draft one." appears only when chapters exist and none is open. - Tests (
test/chapter-next.test.ts): the first test now checks that a never-chaptered repo has no chapter line. The "No chapter is open" assertion moved to the state with chapters but none open (after v1.0.0 is closed, with v1.1.0 and v1.2.0 drafted). The test that names the open chapter is unchanged. - Docs:
docs/features/chapters.mdhas a "Next line" bullet anddocs/features/next-up.mdhas a "chapter line" paragraph. README is untouched. - Terminal: no terminal screen shows either fact.
src/tui/screens/chapters.tshas no Next line, and the Next up screen has no chapter line. I did not add them and did not open an issue. Both docs say the terminal doesn't show these yet, so please open a follow-up issue or ask me to add them here. - Not changed: the bare "Ranked for" paragraph, as you said.
I rewrapped the 120-column chapterLine comment in src/web/pages/next_chapters.ts to fit the gate's 100-column limit, and pushed it.
bun scripts/gate.ts now passes, bun x tsc --noEmit is clean, and test/chapter-next.test.ts passes (3 tests). The gate only sees committed files, so my first run after the edit still showed the old failure until I committed.
Nothing else in this push has changed since the earlier round:
- On
/next, a repo that never drafted a chapter shows no chapter line. - "No chapter is open" appears only when chapters exist and none is open.
- Both feature docs mention the Next lines.
- The terminal still shows neither fact; that follow-up is open for you to file or ask me to add here.
Earlier asks: the chapter line is hidden when a repo has no chapters (met); the Next line renders as a link or as plain text (met); docs are in docs/features, not README (met); the line is server-rendered, with no JS needed (met); the comment is rewrapped for the gate (met). The chapter list is read once and shared, so the SQL budget holds. The pre-push hook reported earlier note: the gate accepted it. I could not diff against acd84092b1e2 because the commit is not in the clone, so I judged the head as it stands.
Next two things:
- Non-blocking: the terminal (src/tui/screens/chapters.ts and Next up) shows neither the Next line nor the chapter line. Both docs say so; file the follow-up issue.
- Non-blocking: the closed-chapter Next line and the /next chapter line are bare paragraphs. Consider a dl row (principle 7) if more chapter facts land there.
A closed chapter's page now ends with a "Next:" line, and the
/nextheader says which chapter the ranking is for. The newtest/chapter-next.test.tspasses, with the chapters, chapters-page andnext-*suites.tsc,scripts/gate.tsanddesign-lintwere clean.src/web/pages/chapters.ts): ends with "Next: <name>", linking the earliest draft chapter. If none is drafted it says "Next: no chapter is drafted."/nextheader (src/web/pages/next_chapters.ts,next.ts): achapterLineunder the title reads "Ranked for <chapter>: <progressSentence>". With no chapter open it reads "No chapter is open. Draft one." and links to/chapters. It is server-rendered with no added script, so the script budget is untouched.src/core/chapters.tsis unchanged; the existingnextChapterOfandprogressSentencewere enough.scripts/fast.ts(it flagged 1875 files, too broad to run here). I ran thenext-*, chapters and estimates suites instead. The forge's check runs everything.To try it, open
/<owner>/<repo>/nextwith a chapter open, then close it and read its chapter page.Closes #12681