Skip to content

Diff viewer: raw CLI error as empty state + system beep when clicking, when there is no diff #5246

@austinywang

Description

@austinywang

Bug description

When there is no diff to show, the diff viewer (diff editor) panel displays a raw, developer-oriented error string centered in the otherwise-empty panel:

No last-turn diff baseline recorded for this workspace and surface yet. Run another agent turn with cmux hooks active, or use --unstaged, --staged, or --branch.

Two problems:

  1. Bad empty-state UI. This is internal CLI jargon (--unstaged, --staged, --branch, "last-turn diff baseline", "cmux hooks active") shown to the user as the entire empty state. It reads like an error, not an intentional "nothing to show here" state, and gives no friendly guidance.
  2. Click beep. Clicking anywhere in that empty diff panel produces a system "unable to click" sound (NSBeep). Clicks land on a non-interactive surface that rejects them with an error beep instead of being harmless no-ops.

Steps to reproduce

  1. Open the diff viewer for a workspace/surface that has no recorded last-turn diff baseline (e.g. a clean main checkout, or before any agent turn with cmux hooks has run).
  2. Observe the panel shows the raw "No last-turn diff baseline recorded…" message filling the panel.
  3. Click anywhere in the empty panel area → a system beep plays.

Expected behavior

  • A clean, friendly empty state when there is no diff (e.g. "No changes to show" with a short plain-language hint), not a raw CLI error string. Consider surfacing the existing Unstaged / Staged / Branch options as obvious in-panel choices, or auto-falling back to unstaged changes, instead of dead-ending on the baseline error.
  • Clicking empty/non-interactive regions of the diff panel should be a harmless no-op, never an error beep.

Technical notes (starting points, not a mandate)

  • The message originates as a CLIError thrown in CLI/cmux_open.swift:2318 and is rendered into the diff-viewer panel. The empty-state handling should be a real UI state rather than a thrown error surfaced verbatim.
  • The diff viewer UI is the web app under diff-viewer/ (bun + vite).
  • Existing tests reference the string: cmuxTests/CMUXOpenCommandTests.swift (lines ~749, 783, 1154).
  • All user-facing copy must be localized (en + ja).

Environment

  • Seen in the cmux app diff editor panel ("Unstaged changes" tab) on a clean workspace. A screenshot is available from the reporter.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions