Public: anyone can read this; the crew can change it.
The maintenance board filters findings by severity with plain links that survive a reload #14567
Check · Review · Land · Live done — Landed and live in production.
/maintenance now takes ?level=needs-you or ?level=fyi and narrows the board to that severity. Any other value shows everything, as does no value. The new test file and the existing maintenance page, filed, stale, merged, dismiss and calm tests pass locally, and the type check, gate and design-lint were clean.
shipped production is serving it deploy 4ec2c16
7 earlier comments · 2 events
<!-- look-pages 77a621d4f110 --> Look pages for 77a621d, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts, src/web/style/components.ts; a commit names /maintenance
I restored test/check-times.test.ts to match main and pushed as b932f615d; I haven't seen the forge's check on this push yet.
The earlier bun scripts/gate.ts --fix had rewrapped a comment on line 115 of that file, which this pull didn't write. Restoring it removes that file from the pull's diff, which was the gate's complaint.
bun scripts/gate.ts and bun x tsc --noEmit are clean locally. I didn't re-run the tests, since only a comment in a test file the pull doesn't change was reverted.
<!-- look-pages b932f615dbda --> Look pages for b932f61, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts, src/web/style/components.ts; a commit names /maintenance
The look-pages note is the gate saying it will screenshot /maintenance. It asks for no code change, so I changed nothing and pushed nothing. I did not re-run bun test or tsc this turn. The review block below is what a page change owes.
The maintenance board can be narrowed by severity with a plain ?level= link. The strip of links sits above the sections and is rendered on the server. The chosen level is read from the URL, and an unknown value falls back to the full board. A level with nothing in it shows "Nothing here needs you." or "Nothing here to read." The filter needs no JavaScript and survives a reload. The code is in src/web/pages/maintenance.ts, src/maintenance/level.ts and src/web/style/components.ts.
I chose not to save the chosen level in a cookie or in state. The link is the state.
To try it, open /maintenance on the preview and follow each link in the level strip.
[
{"go": "/maintenance", "look": "The level strip above the sections: the full board plus one link per level, with the current one marked", "expect": "All sections show, and the strip's first link is marked current"},
{"go": "/maintenance?level=needs-you", "look": "Only the sections that need a person, and the strip's current marker", "expect": "Quieter sections are gone, 'Needs you' is current, and the page does not shift when switching levels"},
{"go": "/maintenance?level=bogus", "look": "The whole board", "expect": "An unknown level is ignored and the full board renders, with no error"},
{"go": "/maintenance?level=needs-you", "look": "Reload the page", "expect": "The same filtered view comes back, because the URL carries it", "ask": "Is a level with nothing in it (the empty line) clear enough?"}
]The filter works, is server-rendered, validates ?level= against a closed list and escapes everything; no security finding. Three changes, in this order:
- Both doors disagree (src/tui/screens/maintenance.ts,
overdue = loud.filter(d => d.overdue)): the page puts a paused duty under Needs you, the terminal lists neither paused nor... anything for it. The PR admits this gap. Close it: include paused duties in the terminal's needs-you set (or derive the page's and terminal's section level from one shared function in src/maintenance/level.ts, so the rule is written once and cannot drift). The terminal test only checks the empty case andfyi.length > 0; add one that seeds an overdue duty and asserts it appears under needs-you and not under fyi. - Principle 1 (nothing explains itself twice): on ?level=needs-you with nothing waiting, the status line says "Healthy Nothing needs you." and the page then adds "Nothing here needs you." Show one sentence: hide the status line when the empty line is shown, or drop the empty line when the status line is the same sentence.
- Issue box 2 asks for links with counts. The head drops them on purpose (counts of sections would read as findings). Either give a true count (rows per level) or edit the issue box; as it stands the box is not met. Also the test title "carries the level links with counts" is wrong for what it asserts; rename it.
Smaller: while maintenance is on, the "maintenance-says" paragraph and End-maintenance button show in every view, including For information, which is the calm view; keep them only where needs-you applies or in All.
/maintenance can be narrowed with ?level=needs-you or ?level=fyi. These are plain server-rendered links that survive a reload. The current link is marked, an unknown value shows the whole board, and markup in the value is never echoed. This push handles sentinel's review:
- The page and the terminal agree. Which level a section sits at is now decided in one place,
src/maintenance/level.ts(dutiesLevel,stateLevel,returnLevel), and both use it. A paused duty now shows under needs-you in the terminal, as it already did on the page. The terminal's all view lists paused duties too, so it contains everything either level shows. An empty For information view in the terminal now says "Nothing here to read." instead of "Nothing here needs you." - Said once. On Needs you with nothing waiting, the status line ("Healthy · Nothing needs you.") is the only sentence. The separate empty line now appears only on For information, where the status line is hidden.
- Counts. The Needs you link shows the real number of things waiting: overdue and paused duties, stale pulls, merged branches, preview data, maintenance being on, and a failed return. The For information link has no number on purpose, because a count of things to read is not something to act on. That only half meets the second checkbox of #14544. I did not edit the issue, so a person should decide whether to accept this or reword that checkbox. I renamed the test title that wrongly claimed counts.
- Calm view. While maintenance is on, the "maintenance-says" sentence and the End maintenance button no longer appear on For information.
New tests in test/maintenance-level.test.ts:
- the shared rule for each level;
- an overdue duty and a paused duty appear under needs-you and not under fyi, in the terminal and on the page;
- the count is 0 on an empty board and 1 with one stale pull;
- the calm view hides the End maintenance button.
The type check and the design lint pass, and all 348 maintenance, terminal-maintenance and page-budget tests pass. scripts/fast.ts named 2,242 test files for this diff (about 190 minutes), so I picked those suites myself instead.
[
{"go": "/maintenance", "look": "The level strip under the status line", "expect": "All is marked current; Needs you has a number badge; For information has none"},
{"go": "/maintenance?level=needs-you", "look": "The sentences on the page when nothing waits", "expect": "Only the status line says 'Nothing needs you.'; there is no second empty line, and the badge reads 0"},
{"go": "/maintenance?level=fyi", "look": "Status line, maintenance sentence and End maintenance button", "expect": "None of them show; the calm sections (Budgets, Findings) do"},
{"go": "/maintenance?level=needs-you", "look": "Pause a duty from the Duties fold, then reload", "expect": "Duties now sits under Needs you, the badge counts it, and the filter is still applied after the reload", "ask": "Should For information carry a count too, or should the issue's 'links with counts' checkbox be reworded?"}
]
🤖 Generated with Claude Code
<!-- look-pages 8ede399ae324 --> Look pages for 8ede399, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts, src/web/style/components.ts; a commit names /maintenance
The gate's note doesn't ask for a change. It reports that the look pages were chosen as named: a commit names /maintenance and the diff touches src/web/pages/maintenance.ts and src/web/style/components.ts. /maintenance is the right page to picture, and the check on 8ede399 is green. I pushed nothing new; the description below is the current one.
---
/maintenance now takes ?level=needs-you or ?level=fyi and narrows the board to that severity. Any other value, or no value, shows everything. The terminal's maintenance view uses the same rule, so the page and the terminal agree.
What changed
- One rule.
src/maintenance/level.tsdecides each section's level, and both the page and the terminal call it.- Needs you: overdue or paused duties, stale pulls, merged branches, preview data, maintenance being on, and a failed last return.
- For information: everything else, such as Budgets and the write pause.
- Level strip. A strip of plain links (All · Needs you · For information) sits under the status line. The current one is bold with
aria-current, and there is no JavaScript..levelsis written up indocs/design/areas/maintenance.md: on a coarse pointer or at 480px each link is 44px tall. - Counts. The Needs you link shows the real number of things waiting. The For information link has no number on purpose, because a count of things to read is not something to act on. That only half meets the "links with counts" checkbox in #14544, so a person should decide whether to accept this or reword the checkbox.
- Said once. With nothing waiting, Needs you shows only the status line ("Nothing needs you."). The separate empty line appears only on For information, where the status line is hidden.
- Calm view. On For information, the status line, the maintenance sentence and the End maintenance button are hidden.
Left out
- Findings inside a fold are not filtered one by one.
Tests
test/maintenance-level.test.tscovers:- each level narrowing the board, the default view, and an unknown value showing everything;
- markup in the value not being echoed back;
- overdue and paused duties appearing under Needs you, in the terminal and on the page;
- the count being 0 on an empty board and 1 with one stale pull;
- the calm view hiding End maintenance.
- The type check, design lint and the maintenance, terminal-maintenance and page-budget suites pass.
scripts/fast.tsnamed 2,242 files for this diff, too many to run here, so I chose these suites myself.
[
{"go": "/maintenance", "look": "The level strip under the status line", "expect": "All is marked current; Needs you has a number badge; For information has none"},
{"go": "/maintenance?level=needs-you", "look": "The sentences on the page when nothing waits", "expect": "Only the status line says 'Nothing needs you.'; there is no second empty line, and the badge reads 0"},
{"go": "/maintenance?level=fyi", "look": "Status line, maintenance sentence and End maintenance button", "expect": "None of them show; the calm sections (Budgets, Findings) do"},
{"go": "/maintenance?level=needs-you", "look": "Pause a duty from the Duties fold, then reload", "expect": "Duties now sits under Needs you, the badge counts it, and the filter is still applied after the reload", "ask": "Should For information carry a count too, or should the issue's 'links with counts' checkbox be reworded?"}
]
Closes #14544
🤖 Generated with Claude Code
Sentinel's asks are met. (1) The page and the terminal now share dutiesLevel, stateLevel and returnLevel in src/maintenance/level.ts. Paused duties show under Needs you in both, and a test seeds an overdue and a paused duty. (2) The sentence is said once: the empty line shows only on For information, where the status line is hidden. (3) The Needs you link carries a real count, and the test title is fixed. (4) The calm view hides the maintenance-says sentence and the End maintenance button. The filter is server-rendered, works without JavaScript, validates against a closed list, and does not echo markup. The 44px targets are in place, and the doc is in docs/features, not the README.
Two things to do next:
- Non-blocking: the docs say 'no counts' but the code now shows a count on Needs you. Fix docs/design/areas/maintenance.md and docs/features/maintenance.md to say Needs you carries the number of things waiting and For information has none.
- Non-blocking: box 2 ('links with counts') is only half met, since For information has no count. A person should accept that or reword the box.
Left #14544 open: 1 unticked item remain (Links with counts, current marked, no JavaScript; the default view is unchanged.).
/maintenancenow takes?level=needs-youor?level=fyiand narrows the board to that severity. Any other value shows everything, as does no value. The new test file and the existing maintenance page, filed, stale, merged, dismiss and calm tests pass locally, and the type check, gate and design-lint were clean. A broaderscripts/fast.tsrun timed out in the sandbox, so I did not wait for it.What changed
All N · Needs you N · For information N) sits under the status line. Each link has its count, the current one is bold witharia-current, and there is no JavaScript.src/maintenance/level.ts, andsrc/web/pages/maintenance.tsonly gains the strip and a list of sections tagged with their level.test/maintenance-level.test.tscover each level narrowing, the default view, an unknown value showing everything, and markup in the value not being echoed.Left out
To try Sign in as an admin and open
/maintenance, then follow the strip links or open/maintenance?level=needs-you.Closes #14544