feat: show a running job's steps instead of a terminal #35

Merged
barrettruth merged 1 commit from feat/step-list into main 2026-07-28 06:07:58 +00:00
Owner

Checklist

  • I have read CONTRIBUTING.md.
  • No AI was used to generate, edit, or review any part of this contribution.

Problem

gh run watch takes a run id and has no per-job flag, so <CR> on lintc
watched all thirty-nine checks. And a terminal running a redraw-in-place
program truncates to the window width and cannot be scrolled — both reasons we
had already disqualified terminal buffers for the log.

Solution

A running job renders its own steps:

✓ Set up job
✓ Run actions/checkout@v7.0.1
✓ Build third-party deps
✓ Build
⊘ unittest

This costs no new request. M.render already calls gh.job, which already
returns steps[] — we were fetching them and discarding them when the log
404'd. It is a normal ci:// buffer, so it scrolls, keeps the winbar, -,
g?, and it becomes the log on the next poll after the job finishes.

The steps are also written to b:ci.checks, which is what the list poll from
#34 looks at, so a job buffer refreshes on the same ten-second timer with no
new machinery.

Removed

The terminal shim, and with it the b:ci we were putting on a terminal buffer
and the - map on it. plugin/ci.lua is untouched.

Note

CheckRun.steps does exist in GraphQL — I had it recorded as REST-only,
which was wrong, and an introspection query shows steps right there among its
fields. It is not needed here, since adding steps(first:40) to the list query
would return roughly 1,560 step nodes per poll for a 39-check pull request in
order to serve the one job you opened. The REST job request we already make is
both smaller and already in the code path.

## Checklist - [x] I have read [CONTRIBUTING.md](https://forge.barrettruth.com/barrettruth/ci.nvim/src/branch/main/CONTRIBUTING.md). - [ ] No AI was used to generate, edit, or review any part of this contribution. ## Problem `gh run watch` takes a run id and has no per-job flag, so `<CR>` on `lintc` watched all thirty-nine checks. And a terminal running a redraw-in-place program truncates to the window width and cannot be scrolled — both reasons we had already disqualified terminal buffers for the log. ## Solution A running job renders its own steps: ``` ✓ Set up job ✓ Run actions/checkout@v7.0.1 ✓ Build third-party deps ✓ Build ⊘ unittest ``` This costs no new request. `M.render` already calls `gh.job`, which already returns `steps[]` — we were fetching them and discarding them when the log 404'd. It is a normal `ci://` buffer, so it scrolls, keeps the winbar, `-`, `g?`, and it becomes the log on the next poll after the job finishes. The steps are also written to `b:ci.checks`, which is what the list poll from #34 looks at, so a job buffer refreshes on the same ten-second timer with no new machinery. ## Removed The terminal shim, and with it the `b:ci` we were putting on a terminal buffer and the `-` map on it. `plugin/ci.lua` is untouched. ## Note `CheckRun.steps` **does** exist in GraphQL — I had it recorded as REST-only, which was wrong, and an introspection query shows `steps` right there among its fields. It is not needed here, since adding `steps(first:40)` to the list query would return roughly 1,560 step nodes per poll for a 39-check pull request in order to serve the one job you opened. The REST job request we already make is both smaller and already in the code path.
feat: show a running job's steps instead of a terminal
All checks were successful
quality / Format (pull_request) Successful in 6s
quality / Lint (pull_request) Successful in 7s
quality / Test (pull_request) Successful in 7s
01c8f71f92
Problem: gh run watch has no per-job flag, so pressing enter on one check
watched its whole run, in a terminal that truncates to the window and cannot
be scrolled.

Solution: The steps come back with the job we already fetch, so a running job
renders them itself and the existing poll keeps them current.
barrettruth deleted branch feat/step-list 2026-07-28 06:07:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/ci.nvim!35
No description provided.