Repository navigation
feat(ui): list pause, follow and close in the Actions pane in logs - #48
Conversation
With logs open, nothing but the status line said that scrolling up pauses the stream, so a new user could not find how to stop the flood. The Actions pane now lists the log viewer's keys above the usual actions: ↑ pause while following, end follow once paused, and esc close logs. Each row is clickable like an action; a click on pause stops in place instead of scrolling a line. Closes p10node#37 Signed-off-by: Ehab Kahwati <[email protected]>
junior
left a comment
There was a problem hiding this comment.
Checked it on 2a7656e: both new tests fail on main with only the test file added (no pause or close row, no follow once paused, nothing to click) and pass with the change, and dropping the offset reset from follow makes TestLogControlRowsAreClickable fail (following with a row still below). The branch passes gofmt, vet and go test -short ./... on Go 1.26.11 and 1.27.4, backends_test.go included, plus -race on ., internal/k8s and internal/ui and govulncheck on 1.27.4. It also merges cleanly with #47, and internal/ui passes on that merge, so either can go first.
Showing only the toggle that would change something reads well, and pausing in place on a click is the right call. The one new state, paused with nothing below yet, holds: only the wheel and the movement keys work out follow from the offset, so a clicked pause lasts until you scroll back down, press end or click follow. Thanks, @Devehab.
Closes #37.
As you said in the issue, nothing on screen tells you that scrolling up pauses the logs. Now, while logs are open, the Actions pane lists the log viewer's own keys above the usual actions:
Once paused,
[↑] pauseturns into[end] follow, so only the row that would change something is shown. The rows are clickable like the other actions: follow and close do what End and Esc do, and pause stops where the view is instead of scrolling a line like ↑. Lines that arrive after that are handled like any paused view, so the screen holds still.logControls/runLogControlinlogview.go, the rows inviewActions(markedlog:<id>), and the click inhandleMouse.docs/keybindings.mdanddocs/ui.mdmention the rows.Tests:
TestActionsPaneListsLogControls(nothing with no logs open, pause/close while following, follow once paused, and the resource actions still listed) andTestLogControlRowsAreClickable(pause holds the view as a line arrives, follow goes back to the bottom, close returns to the table). Both fail without the change.gofmt,go vet ./internal/ui/andgo test ./internal/ui/pass. I had to leavebackends_test.goout locally because the client-go build didn't fit on my disk, so I'm counting on CI for the full run.