Skip to content

feat: compact mode for short terminals and distraction-free toggle#397

Merged
wesm merged 5 commits intomainfrom
short-terminals
Feb 28, 2026
Merged

feat: compact mode for short terminals and distraction-free toggle#397
wesm merged 5 commits intomainfrom
short-terminals

Conversation

@mariusvniekerk
Copy link
Collaborator

@mariusvniekerk mariusvniekerk commented Feb 28, 2026

Summary

  • Auto-hide TUI chrome (status line, table headers, scroll indicator, help footer) when terminal height < 15 rows
  • Add D keybinding to manually toggle distraction-free mode at any terminal size
  • Add ROBOREV_SKIP_VERSION_CHECK=1 env var to skip daemon version mismatch restarts (useful for go run development)
  • Update mouse click handling to account for compact mode header offset

Test plan

  • Existing tests updated and passing
  • New tests for compact mode rendering and distraction-free toggle
  • Manual: resize terminal below 15 rows, verify chrome is hidden
  • Manual: press D in queue view, verify chrome toggles
  • Manual: ROBOREV_SKIP_VERSION_CHECK=1 go run ./cmd/roborev tui connects to running daemon

Closes #378

🤖 Generated with Claude Code

Hide status line, table headers, scroll indicator, flash messages, and
help footer when the terminal height is below 15 rows. Add a manual
distraction-free toggle (D key) that hides the same chrome regardless
of terminal size.

Also add ROBOREV_SKIP_VERSION_CHECK=1 env var to skip daemon version
mismatch restarts, useful for development with go run.

Closes #378

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@roborev-ci
Copy link

roborev-ci bot commented Feb 28, 2026

roborev: Combined Review (ec547b0)

Verdict: The changes introduce medium-severity bugs related to daemon status validation and TUI layout rendering, though no security vulnerabilities were found.

Medium

Daemon liveness can be falsely
accepted when version check is skipped

  • Files: cmd/roborev/daemon_lifecycle.go:144, cmd/roborev/daemon_
    lifecycle.go:166
  • Problem: decodeErr is now ignored when ROBOREV_SKIP_VERSION_CHECK=1, so
    any process returning HTTP 200 on /status can be treated as a valid daemon even if the response is unreadable/non-daemon JSON.
  • Suggested Fix: Keep decodeErr as a hard failure regardless of skipVersionCheck; only skip the version mismatch/empty-version checks.

**
TUI layout overflow in compact mode**

  • File: cmd/roborev/tui/render_queue.go (end of renderQueueView())
  • Problem: In compact/distraction-free mode, the help table footer is hidden, meaning the final string written
    to the builder ends with a trailing newline (\n) from the job row or padding loop. This produces m.height total newlines instead of the required m.height - 1, causing the TUI layout to overflow and vertically scroll by one line on every render frame.
  • Suggested
    Fix:
    Trim the trailing newline from the view output when in compact mode before appending the final escape sequences. For example:
    output := b.String()
    if compact {
        output = strings.TrimSuffix(output, "\n")
    }
    return output + "\x1

b[K\x1b[J"


---
*Synthesized from 4 reviews (agents: codex, gemini | types: default, security)*

mariusvniekerk and others added 3 commits February 28, 2026 10:03
The VERSION MISMATCH warning was hidden along with other chrome in
compact mode. Show it inline on the title line so users always see
when TUI and daemon versions disagree.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Keep decodeErr as a hard failure in ensureDaemon even when
  ROBOREV_SKIP_VERSION_CHECK=1 is set, so non-daemon processes
  returning HTTP 200 are not falsely accepted.
- Trim trailing newline in compact mode to prevent TUI layout
  overflow by one line on every render frame.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@roborev-ci
Copy link

roborev-ci bot commented Feb 28, 2026

roborev: Combined Review (dd9c75d)

Verdict: Security reviews passed without issue, but there are two medium-severity functional bugs regarding daemon auto-start
and TUI layout overflow.

Medium

  • Daemon auto-start regression
    File: cmd/roborev/daemon_lifecycle.go:190
    ROBOREV_SKIP_VERSION_CHECK=1 now also disables daemon auto-start (return fmt. Errorf("no running daemon found...")). This is broader than a “skip version check” and can make normal commands fail unexpectedly when no daemon is running.
    Suggested fix: Keep auto-start behavior unchanged for this flag, or split the behavior into two distinct flags (e.g., one for version-check bypass
    , one for no-autostart).

  • Off-by-one layout overflow in compact mode
    File: cmd/roborev/tui/render_queue.go
    Empty queue padding writes padTarget + 1 lines total because linesWritten starts at 1 despite the code already having written two lines (a blank line and the "No jobs in queue" message). In compact mode, this makes the view one line taller than the exact terminal height (m.height), causing unintended layout overflow and continuous terminal scrolling.
    Suggested fix:
    Initialize linesWritten := 2 to correctly account for the two lines already written before the padding loop.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

ROBOREV_SKIP_VERSION_CHECK=1 should only skip version mismatch
restarts, not prevent auto-starting the daemon entirely. The
startDaemon function already has its own ephemeral binary guard.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@roborev-ci
Copy link

roborev-ci bot commented Feb 28, 2026

roborev: Combined Review (46363f6)

Verdict: All agents agree the code is clean; no medium, high, or critical severity issues were found.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

@wesm
Copy link
Collaborator

wesm commented Feb 28, 2026

Thank you! I'll review and merge in a couple of hours

@wesm wesm merged commit c1d35b1 into main Feb 28, 2026
8 checks passed
@wesm wesm deleted the short-terminals branch February 28, 2026 20:51
@wesm
Copy link
Collaborator

wesm commented Feb 28, 2026

LGTM! thank you

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.

The tui does not cope well with very short terminals

2 participants