Conversation
Add an opt-in log viewer to the PR runs view. With `runLogView: "inline"` in config.json, `enter` on a job or step renders its log inside ghui instead of opening the browser: scroll with j/k, ctrl-d/u, ctrl-f/b, gg/G, or the mouse wheel; `o` opens the job on GitHub; `esc` returns to the steps. The default is unchanged and still opens the browser. Logs come from `gh run view --job <id> --log`. Current gh (2.98) labels every line "UNKNOWN STEP", so a step is selected by its start/end time window from `--json jobs` instead of by name. Timestamps, the leading BOM, and gh's caret-escaped ANSI codes are stripped before rendering. Also bind ctrl-f/ctrl-b to full-page moves in the runs view, and short-circuit the idle sentinel key for the run-detail atom so opening the runs view no longer spawns a failing `gh` process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The runs view (
a) shows a PR's jobs and steps, butenteron a step hands off to the browser to read the log. I use ghui against a GitHub Enterprise instance where the web UI is sometimes unavailable whileghstill works, so a log I can read without leaving the terminal is the difference between investigating a red check and waiting. The original runs plan also lists "on-demand full step-log fetch + scroll" as its first follow-up.What Changes
An opt-in inline log viewer, added as a third sub-mode of the existing runs view. Nothing changes unless
runLogViewis set.runLogView),enteron a job or steprunLogView: "inline",enteron a stepj/k,ctrl-d/ctrl-u,ctrl-f/ctrl-b,gg/G, and the mouse wheel scroll it;oopens the job on GitHub;escreturns to the steps.runLogView: "inline",enteron a job headerctrl-f/ctrl-bctrl-d/ctrl-uhalf-page moves.Logs come from a new
getWorkflowJobLog(gh run view --job <id> --log), parsed by a pureparseJobLoghelper. Current gh (2.98.0) labels every log lineUNKNOWN STEP, so a step is selected by its start/end time window from--json jobsrather than by name; the two line up at second resolution, so a line logged in a boundary second can appear under both adjacent steps. The parser also strips the leading BOM, timestamps, and gh's caret-escaped ANSI codes (^[[36;1m). A running job shows gh's own "still in progress" message, since GitHub only exposes job logs after completion.The preference follows
showScrollbars/diffWhitespaceMode: read once at startup byloadStoredRunLogView, with the browser as the fallback for missing or unknown values. Mock mode generates job logs from the existing run fixtures.One small unrelated fix: the run-detail atom family now returns an idle result for the empty sentinel key instead of spawning a doomed
gh run view 0 --repo ""every time the runs view opens. The new log atom needed the same guard.Scope
Runs view only. No changes to the runs list, run detail rows, failure navigation, or any other surface. README, the runs plan status, and a minor changeset are included.
Verification
bun install --frozen-lockfile bun run format:check bun run typecheck bun run lint bun run test bun run test:keymap bun run changeset:status git diff --checkAll pass: 583 tests in the full suite and 131 keymap tests. New unit tests cover
parseJobLog(step window selection, BOM, timestamp and ANSI stripping) andloadStoredRunLogView(default, inline, unknown value).Verified against a live job log from this repository's CI with gh 2.98.0: the step column is
UNKNOWN STEPon every line, the time-window filter isolates a step correctly, and no ANSI residue remains. Also confirmed thatgh run view --logand the jobs logs REST endpoint both refuse in-progress jobs, which is why the viewer shows gh's message rather than a partial log.Driven end to end in mock mode inside tmux at 120x16 and 140x40: runs list, run detail, step log, whole-job log,
ctrl-f/ctrl-bpaging, wheel scrolling via SGR mouse sequences, andescback with selection preserved.