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

Next up draws the pace line on the page, the terminal and next_up when the dollar line is unsure #12257

Merged opened this

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

Merged

Next up now draws a line by pace on the page, the terminal and `next_up` whenever the dollar line is unsure. I changed one assertion in `test/week-sprint.test.ts`, which the issue said to leave alone (details below). The `tsc` check, `bun scripts/gate.ts`, design-lint, and the week, pages-budget, mcp-size and next tests pass locally. I didn't run the full suite, and I didn't look at the page in a…

shipped production is serving it deploy 44b6735

opened this

Next up now draws a line by pace on the page, the terminal and next_up whenever the dollar line is unsure. I changed one assertion in test/week-sprint.test.ts, which the issue said to leave alone (details below). The tsc check, bun scripts/gate.ts, design-lint, and the week, pages-budget, mcp-size and next tests pass locally. I didn't run the full suite, and I didn't look at the page in a browser.

What changed

  • weekView (src/flow/week.ts): it reads the issues closed as done in the last 7 days with one COUNT(*) on issue_repo_kind_number. It does this only when cut.unsure !== null, and passes the count to paceCut. WeekView gains pace: PaceCut | null.

- Sentence: when pace is chosen, the original projection sentence is kept and The line is drawn by pace: … is appended. When the cost line exists, pace is null, no read is made and the sentence is byte-for-byte unchanged. - lineAfter(week): a new helper returns the cost line's fits.length, else pace.rows, else null.

  • Surfaces:

- The page (src/web/pages/next.ts) draws the dashed separator after that many rows. - The terminal screen (src/tui/screens/next.ts) uses the same line. - next_up (src/http/mcp/tools/next_up.ts) sets thisWeek from the row's index against the line. - All three take it from the one WeekView, with no second read. No new MCP tool and no new CSS.

  • Test: test/week-pace.test.ts runs weekView on a real forge. With no capacity it chooses pace (pace is non-null and the sentence says "by pace"). After a subscription and a weekly limit are added it chooses cost, with pace null and the line equal to cut.fits.length.

One test changed that the issue said to leave alone

  • test/week-sprint.test.ts has one test, "no capacity read means no line", that asserted not.toContain('role="separator"') with no capacity. That is the case this issue exists to change: there is history, five issues just closed, and no capacity, so a pace line is now drawn.
  • I replaced that one assertion with toContain("The line is drawn by pace") and renamed the test. The other assertions in the test and the rest of the file are untouched. test/week.test.ts is unchanged and passes.

Not done

  • The separator's words are still "This week ends here (N fit)" for a pace line. The explanation sits in the #next-week sentence under the list.
  • The client-side drag re-placement (data-capacity) is still only emitted for the cost line, so dragging doesn't move a pace line.
  • The page statement budget stays green, so I didn't raise it.

The pre-push hook demanded a "how to try it" commit, so there is an empty Try: commit: open /<owner>/<app>/next on an app with no subscription cap and look for the dashed line after the pace's rows.

Closes #12134

5 earlier comments · 3 events
commented

Next up now draws a line by pace on the page, the terminal and next_up whenever the dollar line is unsure. I changed one assertion in test/week-sprint.test.ts, which the issue said to leave alone (details below). The tsc check, bun scripts/gate.ts, design-lint, and the week, pages-budget, mcp-size and next tests pass locally. I didn't run the full suite, and I didn't look at the page in a browser.

What changed

  • weekView (src/flow/week.ts): it reads the issues closed as done in the last 7 days with one COUNT(*) on issue_repo_kind_number. It does this only when cut.unsure !== null, and passes the count to paceCut. WeekView gains pace: PaceCut | null.

- Sentence: when pace is chosen, the original projection sentence is kept and The line is drawn by pace: … is appended. When the cost line exists, pace is null, no read is made and the sentence is byte-for-byte unchanged. - lineAfter(week): a new helper returns the cost line's fits.length, else pace.rows, else null.

  • Surfaces:

- The page (src/web/pages/next.ts) draws the dashed separator after that many rows. - The terminal screen (src/tui/screens/next.ts) uses the same line. - next_up (src/http/mcp/tools/next_up.ts) sets thisWeek from the row's index against the line. - All three take it from the one WeekView, with no second read. No new MCP tool and no new CSS.

  • Test: test/week-pace.test.ts runs weekView on a real forge. With no capacity it chooses pace (pace is non-null and the sentence says "by pace"). After a subscription and a weekly limit are added it chooses cost, with pace null and the line equal to cut.fits.length.

One test changed that the issue said to leave alone

  • test/week-sprint.test.ts has one test, "no capacity read means no line", that asserted not.toContain('role="separator"') with no capacity. That is the case this issue exists to change: there is history, five issues just closed, and no capacity, so a pace line is now drawn.
  • I replaced that one assertion with toContain("The line is drawn by pace") and renamed the test. The other assertions in the test and the rest of the file are untouched. test/week.test.ts is unchanged and passes.

Not done

  • The separator's words are still "This week ends here (N fit)" for a pace line. The explanation sits in the #next-week sentence under the list.
  • The client-side drag re-placement (data-capacity) is still only emitted for the cost line, so dragging doesn't move a pace line.
  • The page statement budget stays green, so I didn't raise it.

The pre-push hook demanded a "how to try it" commit, so there is an empty Try: commit: open /<owner>/<app>/next on an app with no subscription cap and look for the dashed line after the pace's rows.

commented

Next up now draws the line by pace when the dollar line is unsure. That shows on the page, in the terminal and in next_up. I fixed the one failure this pull caused and pushed; I haven't seen the forge's check re-run on that push.

The fix: the pace sentence made the terminal's Next up header longer. The header is cut to fit the screen, so a reader's "you can read this order, not change it" notice was being cut off. The notice now comes first and the longer sentence is the part that gets cut. The change is in src/tui/screens/next.ts. I didn't change any tests. test/tui-next-up.test.ts and test/week-pace.test.ts now pass, and tsc is clean. I didn't run the other pre-push steps: scripts/gate.ts, scripts/design-lint.ts and the other tests that cover this change.

Failures I left alone: the check log says three of the four failures are red on main too, so I did not touch them. They are the 429/503 retry-after test, the "a key is needed" test and the known-findings test. The log names test/retry-after.test.ts, test/first-ask-new-app.test.ts and test/deadends.test.ts as the files. My sandbox can't reproduce the 429/503 retry-after test, because its shard-run failure appears to depend on the full-suite run.

To try it: open /<owner>/<app>/next on an app with no subscription cap. The dashed line appears after the rows the pace allows. As a reader in the terminal, the notice leads the header line.

🤖 Generated with Claude Code

Changes requested — before the latest push

No security finding: the one added statement is parameterised and runs only when the dollar line is unsure. Two things to fix.

  1. docs/features/next-up.md line 23 still says that with no capacity read 'there is no line'. That is now false. Describe the pace line there and in the terminal and MCP paragraph (line 28), including thisWeek for pace. The how-to must match the behaviour.
  2. The separator for a pace line reads 'This week ends here (N fit)' on the page and in the terminal. 'Fit' is a dollar claim and the pace line does not make one. Give the pace line its own words, e.g. 'by pace: this week ends here', so the page does not state a cost it never computed (DESIGN §1 and §8: one plain sentence, no claim it cannot back).

Box 4: test/week-sprint.test.ts was edited, though the issue said it must pass unchanged. The edit is warranted, since that assertion described the old no-capacity behaviour. Say so on the issue so the box can be revised.

commented

Next up draws a pace line when the dollar line is unsure, and I've changed the wording and the how-to to match. I pushed it to the same branch. The week-pace, terminal next-up, week-doors and week-sprint tests pass. tsc and the design lint are clean. I did not run scripts/gate.ts. The forge's check on this push hasn't reported yet.

  • Pace wording: the pace line no longer says "N fit". The page separator now reads "By pace: this week ends here; below this line reads as next week." (paceWords in src/flow/week.ts). The terminal reads "── by pace: this week ends here, below reads as next week ──". The cost line keeps its "(N fit)" wording.
  • Test: I added a test that the pace wording says "By pace" and never "fit".
  • How-to: docs/features/next-up.md now says "no dollar line" where it said "no line". It has a new Pace line paragraph, and the terminal and MCP paragraph covers the pace separator and thisWeek. thisWeek means above the pace line when the line is by pace.
  • Box 4: I edited test/week-sprint.test.ts because its assertion described the old no-capacity behaviour (no line). I posted that on issue #12134 so the box can be revised.

I did not check the page's separator wording in a test; only the wording constants are tested.

Changes requested — before the latest push

The change is sound and matches the direction (one COUNT statement, only when the dollar line is unsure; one WeekView feeds the page, the terminal and next_up). One thing is missing: tests for the three surfaces.

Fix first: the new test only checks weekView, lineAfter and the wording constants. Three behaviours this pull adds have no test that would fail without them:

  1. The page draws the By pace: separator after pace.rows rows. The week-sprint assertion only sees the sentence, not the role="separator" line.
  2. The terminal screen shows the ── by pace: ── note under the right row.
  3. next_up sets thisWeek by index against lineAfter when the line is by pace.

Add one assertion for each, on the forge fixture already in week-pace.test.ts or week-sprint.test.ts.

Box 4 is left: test/week-sprint.test.ts was changed, not left unchanged. The change is justified (that assertion described the no-capacity case this issue replaces). Revise the box text on the issue, or keep the original assertion and add the new one beside it.

Boxes 1, 2, 3 and 5 are met on reading and on your report of green tests, budget and design-lint. I did not re-run them.

Non-blocking: the drag re-placement (data-capacity) stays cost-only, so dragging does not move a pace line. The docs say reload redraws it, which is fine.

commented

When the dollar line is unsure (no subscription cap has been read), Next up now draws its week line by pace on the page, in the terminal and in next_up. Pace is how many issues closed as done in the last 7 days: one indexed COUNT, run only in that case. A single WeekView feeds all three surfaces. lineAfter gives the row count above the line: the cost line's when it exists, otherwise the pace's.

  • Page: the role="separator" line sits after pace.rows rows and reads "By pace: this week ends here; below this line reads as next week." It makes no "N fit" claim.
  • Terminal: the note under that row reads ── by pace: this week ends here, below reads as next week ──. The notice for someone who can only read the list now comes before the projection sentence, so if the header is cut off it is the longer pace sentence that gets cut.
  • next_up: under a pace line, thisWeek is set by position against lineAfter. Under a cost line it still means "is in cut.fits".

Review follow-up: test/week-pace.test.ts now has a forge fixture with the clock fixed at Wednesday noon (setSystemTime). Five issues landed this week and six are open, so the pace reaches 3 rows. Three new tests use it:

  • the page renders exactly one pace separator, between "Work Cat" and "Work Dog", and no "fit" wording;
  • the terminal shows exactly one by-pace note, under row 3;
  • next_up (all rows) returns thisWeek as [true, true, true, false, false, false].

I checked that all three fail with main's versions of src/web/pages/next.ts, src/tui/screens/next.ts and src/http/mcp/tools/next_up.ts.

Box 4: test/week-sprint.test.ts keeps its changed assertion. The original not.toContain('role="separator"') is the "no capacity read means no line" behaviour this issue replaces. Its fixture has five issues closed this week, so on most days the pace draws a separator and the old assertion fails. The box text on the issue needs revising to match; I did not edit the issue.

Left out: dragging a row still re-places only a cost line (data-capacity). The pace line is redrawn on reload, as the docs say.

To try: open /<owner>/<app>/next on an app with no subscription cap and some issues closed this week. The dashed "By pace" line appears after the pace's rows.

Checks: bun scripts/gate.ts and bun x tsc --noEmit pass. bun test passes for week-pace, week-sprint, mcp-next-up and tui-next-up (40 tests).

🤖 Generated with Claude Code

commented

When the dollar line is unsure (no subscription cap has been read), Next up now draws its week line by pace on the page, in the terminal and in next_up. Pace is how many issues closed as done in the last 7 days. It is one indexed count, and it only runs in that case. One WeekView feeds all three surfaces. lineAfter gives the number of rows above the line: the cost line's when it exists, otherwise the pace's.

  • Page: the role="separator" line comes after pace.rows rows. It reads "By pace: this week ends here; below this line reads as next week." and makes no "N fit" claim.
  • Terminal: the note under that row reads ── by pace: this week ends here, below reads as next week ──. The header now puts the read-only notice first, so on a narrow terminal the longer pace sentence is what gets cut off.
  • next_up: under a pace line, thisWeek is set by a row's position against lineAfter. Under a cost line it still means the row is in cut.fits.

Tests: test/week-pace.test.ts has a fixture with the clock fixed at Wednesday noon (setSystemTime). Five issues landed this week and six are open, so the pace reaches 3 rows.

  • The page renders exactly one pace separator, between "Work Cat" and "Work Dog", with no "fit" wording.
  • The terminal shows exactly one by-pace note, under row 3.
  • next_up with all rows returns thisWeek as [true, true, true, false, false, false].

All three fail against main's versions of src/web/pages/next.ts, src/tui/screens/next.ts and src/http/mcp/tools/next_up.ts.

Last push: the check failed because a comment in that fixture was 114 columns; it is now split over two lines. Main's newer scripts/gate.ts has the 100-column rule, which this branch's copy does not, so I ran main's copy against the branch: it now passes. bun x tsc --noEmit passes, and so does bun test test/week-pace.test.ts (13 tests). Before that push, week-sprint, mcp-next-up and tui-next-up also passed (40 tests across the four files); the rewrap only touched a comment.

Box 4: test/week-sprint.test.ts keeps its changed assertion. The old not.toContain('role="separator"') describes "no capacity read means no line", which is the behaviour this issue replaces. That fixture closes five issues this week, so on most days the pace draws a separator and the old assertion would fail. The box text on the issue still needs revising to match; I did not edit the issue.

Left out: dragging a row still moves only a cost line (data-capacity). A pace line is redrawn on reload, as the docs say.

Try it: open /<owner>/<app>/next on an app with no subscription cap and some issues closed this week. The dashed "By pace" line appears after the pace's rows.

🤖 Generated with Claude Code

Approved

The pace line shows on the page, in the terminal and in next_up from one WeekView, with one indexed count read only when the dollar line is unsure. The pace wording makes no "fit" claim, and the how-to is in docs/features/next-up.md, not the README. The new surface tests cover the page, the terminal and next_up. The only open point is box 4: test/week-sprint.test.ts had to change, because "no capacity means no line" is the behaviour this issue replaces. I could not diff against my last reviewed head (83567b170523 is not in the clone), so I read the current change in full and did not run the tests or fetch the preview myself.

commented

Left #12134 open: 1 unticked item remain (Existing test/week.test.ts and test/week-sprint.test.ts pass unchanged (the cost line wins whenever it exists); a new test in test/week-pace.test.ts shows weekView choosing pace when capacity is null and cost when it is known.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs