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

A run's page opens its log, steps and cost in folds and leads with the verdict #13016

Merged opened this

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

Merged

A finished run's page now shows who, what, outcome and cost first, with the log and check steps in closed folds below. The new test and the 161 run-related tests pass. tsc, scripts/gate.ts, design-lint and test/mcp-size.test.ts are green.

Notes

shipped production is serving it deploy 59903fa

opened this

A finished run's page now shows who, what, outcome and cost first, with the log and check steps in closed folds below. The new test and the 161 run-related tests pass. tsc, scripts/gate.ts, design-lint and test/mcp-size.test.ts are green. Before/after pictures at 390 and 1280 px, light and dark, are not on the pull: I couldn't take screenshots from this sandbox.

  • Folds: the log is a "Log · N lines" fold and a check run's steps and pins are a "Steps" fold, in src/web/studio/run.ts. Both reuse the existing disclosure() from ui.ts.
  • Open or closed: a fold is open while the run is unfinished or has failed, so live viewing and failures read as before. It is closed only for runs that finished well.
  • Anchors: a small page script opens any enclosing fold when the URL hash points inside it, on load and on hashchange. A log link from a pull such as #L12 or #run-log therefore lands on the line with the fold open.
  • Test: test/run-page-folds.test.ts renders a real finished run and a running one. It checks that the finished log is a closed fold after the verdict, that the running one is open, and that the served page script contains the open-on-hash code. The anchor check only looks for that code in the script text; it never loads the page in a browser, so a real #L12 landing is untested.
  • Left out: no separate cost or diff fold. Cost, turns and time already sit in the head, and the run page has no diff. There is no MCP or terminal change, since this is page layout only.

The first push was refused until the repository's pre-push hook got a "Try:" commit, so the branch has an extra empty commit.

To try it, open /:owner/:name/runs/:id for a finished run and expand "Log", then open …#L1.

Closes #13002

5 earlier comments · 2 events
commented

A finished run's page now shows who, what, outcome and cost first, with the log and check steps in closed folds below. The new test and the 161 run-related tests pass. tsc, scripts/gate.ts, design-lint and test/mcp-size.test.ts are green. Before/after pictures at 390 and 1280 px, light and dark, are not on the pull: I couldn't take screenshots from this sandbox.

  • Folds: the log is a "Log · N lines" fold and a check run's steps and pins are a "Steps" fold, in src/web/studio/run.ts. Both reuse the existing disclosure() from ui.ts.
  • Open or closed: a fold is open while the run is unfinished or has failed, so live viewing and failures read as before. It is closed only for runs that finished well.
  • Anchors: a small page script opens any enclosing fold when the URL hash points inside it, on load and on hashchange. A log link from a pull such as #L12 or #run-log therefore lands on the line with the fold open.
  • Test: test/run-page-folds.test.ts renders a real finished run and a running one. It checks that the finished log is a closed fold after the verdict, that the running one is open, and that the served page script contains the open-on-hash code. The anchor check only looks for that code in the script text; it never loads the page in a browser, so a real #L12 landing is untested.
  • Left out: no separate cost or diff fold. Cost, turns and time already sit in the head, and the run page has no diff. There is no MCP or terminal change, since this is page layout only.

The first push was refused until the repository's pre-push hook got a "Try:" commit, so the branch has an extra empty commit.

To try it, open /:owner/:name/runs/:id for a finished run and expand "Log", then open …#L1.

commented

The gate now passes locally and I pushed the fix. The earlier gate output had read the uncommitted tree, so it still showed both failures.

  • Comment wrap: I rewrapped the header comment in test/run-page-folds.test.ts to under 100 columns. The three tests in that file still pass.
  • Looks: the commit message carries a No look: line, because no page in app.looks shows a run's page; it would need a seeded run. If you want the before/after pictures, a run page would have to be added to app.looks in forge.json. I did not do that here.

The rest of the pull is unchanged: a finished run's log and check steps are closed folds below the verdict, a running or failed run's are open, and a #L12 or #run-log link opens its fold.

commented

A run's page now folds its steps and its log, and /runs/:id#L3 opens the fold. The check's red came from the first-view budget test, which I fixed and pushed.

  • First-view budget: the two fold summaries ("Steps" and "Log · N lines") add 5 words and 2 text blocks to the run page. The page is now at 39 words and 13 blocks, against budgets of 34 and 11. I raised the run budget in docs/design/attention-budget.json to 39 words and 13 blocks, at both 390 px and 1280 px. That test says a raise needs a note in the pull, and this is the note. I raised the budget rather than trim the labels, because the summaries are what make the folds usable.
  • Test results: test/attention.test.ts passes here and bun x tsc --noEmit is clean.
  • Other two failures: "require-review refuses the merge until the head is approved" and "the archive answers only what a reader may read" are in test/tui-workflows.test.ts and test/contribute-no-forge.test.ts. Both pass here, 19 of 19 across the two files, and neither touches the run page, so I left them alone. If they fail again on the next check, I'll look at them then.
  • Not run: I did not run scripts/gate.ts, scripts/design-lint.ts or test/run-page-folds.test.ts on this push.

To try it, open a finished run's page. The log is a closed fold, and /runs/:id#L3 opens it.

Changes requested — before the latest push

Folding the log and steps under the verdict is the right idea and reuses disclosure(). Changes needed in one round:

  1. Fold opens only via JS: with JavaScript off, #L12 / #run-log land on a closed fold and the line is hidden. Open the fold server-side when the request has a hash is impossible, so for a finished run either keep the log open when a line link is the way in, or make the summary carry the link target; at minimum say in the pull what happens with JS off and test it.
  2. The "Steps" summary says nothing: show the outcome (e.g. "Steps · 3 of 4 passed") so a closed fold is still informative.
  3. Principle 1/8: the budget in attention-budget.json was raised to fit two summaries; trim the labels (drop "Log ·" prefix noise) and keep the old budget, or justify in the pull.
  4. Test for the anchor only greps the script text; add a real behaviour test (e.g. run the script against a DOM stub) so it fails if the hash handling breaks. Add a test for the failed-run-open case and the steps fold.
  5. The terminal run screen (src/tui/screens/runlog.ts) was not checked: state in the pull that it already shows log and steps flat, and add docs/features/run-folds.md as the how-to.
  6. Before/after pictures at 390 and 1280, light and dark, are not on the pull.

The inline-script OPEN_FOLD_JS should also live in client.ts with the other page scripts rather than a string constant in a view.

commented

A finished run's page now shows its verdict first, with the steps and the log in two folds below it. A link to #L12 or #run-log opens the folds around its target. bun x tsc --noEmit, scripts/gate.ts, scripts/design-lint.ts and the run-page, attention and header-width tests pass. A scan of the 12 tests that mention the run page's log or steps also passes, 217 in all.

Folds

  • Log: the summary is just "Log". It is closed on a finished run, and open while the run is going or after it failed.
  • Steps: the check's steps fold has its own summary carrying the outcome, for example "Steps 3/3 passed". It opens on a failed or running run.

Review points

  • JS off: the page is the same, but a #L12 link lands on a closed fold and you press "Log" to open it. This is documented in docs/features/run-folds.md and tested. I did not make the fold open from the server, because the server never sees the hash.
  • Budget: I could not keep the old run budget, so I raised it rather than drop information. The two summaries add words and one block each. The page was already at 34 words and 11 blocks, and is now at 38 and 13. I trimmed "Log · N lines" to "Log" and wrote the steps summary as "3/3 passed" rather than "3 of 4 passed". If you want the old budget back, the way to get it is to drop the steps outcome, which would hide the checks' verdict in a closed fold. I judged that worse.
  • Script: the fold-opening script moved to openFoldJs in src/web/client.ts, next to studioRunJs.
  • Tests: test/run-page-folds.test.ts runs the real script against a DOM stub. It covers nested folds, scrolling, no hash, a hash that matches nothing, and a later hashchange. It also covers the failed-run open case and the passing run's closed steps fold.
  • Terminal: I did not change src/tui/screens/runlog.ts. It already shows the state line, the steps and the last 200 log lines flat, so there are no folds to add. The how-to is docs/features/run-folds.md, listed in docs/features/README.md.

Not done

  • Pictures: the before/after pictures at 390 and 1280, light and dark, are not on the pull. I cannot take screenshots in this sandbox. The preview is at https://lab--13016--forge-trevato-apps.open-platform.sh.

Try it Open a finished run's page, then /runs/:id#L3.

commented

This pull makes a finished run's page fold its Steps and its log. The pipeline first gate rule had failed it because the pull adds a feature (docs/features/run-folds.md) and changes nothing in the pipeline.

I pushed an empty commit whose message carries the Direction: line the rule accepts. It says the run-page folds are issue #13002 and that no pipeline item waits on them. bun scripts/gate.ts now exits 0 locally. I did not re-run tsc or the tests, because the new commit changes no files, and I have not seen the forge's check on the new push.

I did not add a pipeline change to satisfy the rule. The folds are the whole feature, and padding the pull with unrelated pipeline edits would not make it better.

To try it, open a finished run's page. The log is a closed fold, and /runs/:id#L3 opens it at that line.

🤖 Generated with Claude Code

Approved

Approved. Since my last review the summaries are trimmed to Steps N/M passed and Log. The fold script is now openFoldJs in client.ts, tested against a DOM stub for nested folds, scrolling, no hash and hashchange. The failed-run open case and the closed passing-steps fold are tested. The attention budget is raised with a note, and the how-to is docs/features/run-folds.md, listed in the features README and not in README.md. The terminal run screen is already flat, so no tui change is needed. JS-off is honest: a #L12 link lands on a closed fold, and the summary opens it. Open and closed follow the run state, so a failed or running run reads as before.

Next two things, non-blocking:

  1. Non-blocking: add a run page to app.looks so before/after pictures at 390 and 1280, light and dark, exist (box 3).
  2. Non-blocking: where a fold is closed, say in the Log summary how many lines it holds, if the budget allows.
commented

Left #13002 open: 1 unticked item remain (before/after pictures at 390 and 1280 px, light and dark, are on the pull).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs