Skip to content

feat(ui): list pause, follow and close in the Actions pane in logs - #48

Merged
junior merged 1 commit into
p10node:mainfrom
Devehab:feat/log-actions
Nov 26, 2026
Merged

junior merged 1 commit into
p10node:mainfrom
Devehab:feat/log-actions

Conversation

@Devehab

@Devehab Devehab commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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:

 po/web-1
 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
 [↑] pause
 [esc] close logs
 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
 [d] Describe
 ...

Once paused, [↑] pause turns 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 / runLogControl in logview.go, the rows in viewActions (marked log:<id>), and the click in handleMouse.
  • Help text, docs/keybindings.md and docs/ui.md mention the rows.
  • Log search isn't part of this, as you suggested a separate request for it.

Tests: TestActionsPaneListsLogControls (nothing with no logs open, pause/close while following, follow once paused, and the resource actions still listed) and TestLogControlRowsAreClickable (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/ and go test ./internal/ui/ pass. I had to leave backends_test.go out locally because the client-go build didn't fit on my disk, so I'm counting on CI for the full run.

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 junior left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@junior
junior merged commit d97eb94 into p10node:main Nov 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Actions sidebar adaptivity

2 participants