feat(gui): one window for recording and reviewing

The recorder is now the pinned first tab (Record, not closable, with a REC
marker while recording) of the viewer window; sessions follow as tabs. There
is one process and one window: komorebi-recorder, gui and view all claim the
same socket, and a second launch forwards (gui shows the Record tab, view
opens tabs) and exits. The request protocol gains an optional "tab" field;
old requests still parse. gui takes the record options (they only seed the
window that is started) and --new-window.

The window starts compact (420x380, always on top, Record tab only) when
launched plainly and full size for view; opening any session expands it,
and Compact / Expand is remembered in the prefs. RecorderApp::poll runs on
every frame whichever tab is showing, so recordings continue and finalize
while another tab is looked at. Cmd/Ctrl+0 shows the Record tab; Cmd/Ctrl+W
on it does nothing; closing the last session tab returns to Record.

KOMOREBI_RECORDER_PREFS_DIR and KOMOREBI_RECORDER_NO_IGNORE_RULE let tests
and end-to-end runs avoid the real prefs and the real komorebi.

The macOS/unix cfg branches (hidden title bar spacing) mirror the existing
tested patterns and could not be compiled on the Windows machine this was
written on.
This commit is contained in:
LGUG2Z committed 2026-10-28 17:41:27 -07:00
1 parent 72d600c8f6
commit 8e454e1e03
19 files changed
+1603 -571

No files matched your search

+9 -8
View File
@@ -22,14 +22,15 @@ budget, 6 an `assert` check did not hold.
komorebi-recorder view <session>
```
opens the recording in the viewer window, for the person who made it (or anyone with the folder) to play, scrub and mark.
The recorder window has **Open session…** and **Open last** for the same thing.
opens the recording in the window, for the person who made it (or anyone with the folder) to play, scrub and mark.
The Record tab of the same window has **Open session…** and **Open last** for the same thing.
There is only ever one viewer window. Each recording is a tab of it: `komorebi-recorder view <session>...` (from another
terminal, or from the recorder window) adds tabs to the window that is already open and brings it to the front, so
several recordings can be loaded side by side. A recording that is already open is just switched to. **+** (or ⌘/Ctrl-T)
adds a start tab with your recent recordings and **Open…**, × (or middle-click, or ⌘/Ctrl-W) closes a tab, Ctrl-Tab and
⌘/Ctrl-1 to 9 move between them, and only the tab you are looking at plays. `view --new-window` skips all of this and
There is only ever one window, for recording and for reviewing: its first tab is **Record** (see [Recording a bug
repro](recording-a-bug-repro.md#the-window)) and each recording is a tab after it. `komorebi-recorder view
<session>...` (from another terminal, or from the Record tab) adds tabs to the window that is already open and brings it
to the front, so several recordings can be loaded side by side. A recording that is already open is just switched to. **+** (or ⌘/Ctrl-T)
adds a start tab with your recent recordings and **Open…**, × (or middle-click, or ⌘/Ctrl-W) closes a tab (closing the
last one shows the Record tab), Ctrl-Tab and ⌘/Ctrl-1 to 9 move between them, ⌘/Ctrl-0 goes to the Record tab, and only the tab you are looking at plays. `view --new-window` skips all of this and
opens a window of its own.
- The **video** of every display, side by side. A display that was unplugged or asleep shows why it has nothing there,
@@ -137,7 +138,7 @@ and `event:12.end` when it finished.
| `assert --check "KIND ARGS METRIC<=N"` | Pass/fail checks for a scripted scenario, repeatable. Kinds: `findings kind=K [severity=S] count<=N`, `log "<logq query>" count==N`, `motion [region=x,y,w,h] [from=T] [to=T] segments\|active_ms\|peak_share<=N`, `blank region=x,y,w,h [from=T] [to=T] [color=white] ms<=N`, `annotations kind=note\|bug\|finding count>=N`. Operators `== != <= >= < >`. Prints `PASS`/`FAIL` per check; exit 0 if all pass, 6 if one fails, 4 if one cannot be measured (no video), 2 if malformed. `--json` gives `assert/1` |
| `annotate`, `annotations` | Add, change and list bug regions, notes and findings |
| `mark TEXT` | While recording: drop a named point note (author `script`) onto the timeline from a script; it then appears in `annotations`, `brief` and the viewer like any note |
| `view [SESSION...] [--new-window]` | Open recordings in the viewer window, each as a tab of the one window that is running (it is started if there is none and brought to the front if there is); `--new-window` makes a window of its own instead |
| `view [SESSION...] [--new-window]` | Open recordings in the window, each as a tab of the one window that is running (it is started if there is none and brought to the front if there is); `--new-window` makes a window of its own instead |
### Who changed it
+32 -10
View File
@@ -6,7 +6,7 @@ was the OS doing, at 00:12.5 in the video?" and the other way around.
```
komorebi-recorder record --duration 30 # record without a window
komorebi-recorder # or open the Record / Stop window
komorebi-recorder # or open the window, with its Record / Stop tab
```
It is built for the situations where komorebi bugs actually show up: laptops that get docked and undocked, woken with the
@@ -46,7 +46,7 @@ Start komorebi with `komorebi.exe --log-level debug` before recording a bug. (`R
prints every dependency's log; `RUST_LOG=komorebi=debug` does not.)
`komorebi-recorder doctor` says what the machine can do, and `komorebi-recorder record --no-video` records without the
screen.
The recorder window keeps itself out of the video (Windows 10 version 2004 or later).
The window keeps itself out of the video (Windows 10 version 2004 or later).
## Before you record
@@ -58,9 +58,11 @@ The recorder window keeps itself out of the video (Windows 10 version 2004 or la
- **`ffmpeg`** is only needed for `frames` and `selftest`. It is never used to capture. The `nix develop` shell provides
it; otherwise `brew install ffmpeg`.
The recorder window is borderless, and on Windows is named `komorebi-recorder` only once komorebi is told to ignore it:
There is one window for everything. It opens small (the Record tab alone, always on top, to leave over the application
you are reproducing a bug in) and grows when you open a recording; see [The window](#the-window). On Windows it is named
`komorebi-recorder` only once komorebi is told to ignore it:
at start the recorder runs `komorebic ignore-rule exe komorebi-recorder.exe` (and the same for
`komorebi-recorder-gui.exe`, which opens the viewer) against the running komorebi, a live rule that is not saved. If
`komorebi-recorder-gui.exe`, the build with no console window) against the running komorebi, a live rule that is not saved. If
komorebi is not running the window is named too; if `komorebic` is not found or fails, and on a Mac, the window stays
untitled, because komorebi does not manage windows without a title, and the recorder says so on standard error and in
the window. Either way opening it does not move your layout around while you are trying to reproduce a layout bug.
@@ -89,14 +91,33 @@ the same match is an `ignore_rules` entry with `kind: Exe`, `id: komorebi-record
}
```
It is also excluded from the video, as is any other `komorebi-recorder` process.
The viewer is one such process.
The window is one such process, in either size.
## Recording
Press **Record**, reproduce the problem, press **Stop**. The window shows live counters, recent events (a display being
unplugged, a wake) and any warnings. The session is written to
Press **Record**, reproduce the problem, press **Stop**. The Record tab shows live counters, recent events (a display
being unplugged, a wake) and any warnings. The session is written to
`~/Library/Application Support/komorebi/recordings/<UTC timestamp>/` unless you pass `--out`.
The **Review** row of the tab has **Open session…** (choose a recording's folder) and **Open last** (the newest one);
each opens the recording as a new tab of this same window, and the window grows to show it.
### The window
`komorebi-recorder` (or `komorebi-recorder gui`) opens one window, and there is never a second: starting it again, or
running `komorebi-recorder view <session>`, raises the window that is already open instead. The first tab, **Record**,
cannot be closed, and says `REC` and the time in the tab bar while a recording is going, so you can look at another tab
and see that it still is (the recording carries on whichever tab is showing, and closing the window while recording
finishes the session first). The recordings you open follow it as tabs, and **+**, ⌘/Ctrl-T and ⌘/Ctrl-0 (the Record
tab) work as in a browser.
Started plainly, the window is _compact_: 420 by 380, always on top, showing the Record tab and nothing else, the small
control window you leave over the application you are reproducing the bug in. **Expand** (on the Record tab) makes it
the full window with the tab bar, and opening a recording does that for you; **Compact** goes back, and the choice is
remembered. While recording, the full window has a **pin on top** checkbox. Options such as `--fps` or `--no-komorebi`
given to `komorebi-recorder`/`gui` set up the Record tab of the window that gets started; if a window is already open
they are ignored. `--new-window` opens a window of its own instead of raising the open one.
With every display ticked, the recorder follows _all_ displays, including ones connected while it is recording. Untick a
display to record only the others.
@@ -148,9 +169,10 @@ Useful options:
### Marking where the bug is
A bug is marked in one place, the viewer, after the recording: `komorebi-recorder view <session>` opens it, and **Mark
bug** (or **B**) takes a stretch of the recording and what went wrong in it. That marks a _region_, not a single moment.
The recorder window has no button for it, so while recording there is nothing to do but reproduce the problem.
A bug is marked in one place, a session's tab, after the recording: `komorebi-recorder view <session>` opens it (the
Record tab's **Open last** does too), and **Mark bug** (or **B**) takes a stretch of the recording and what went wrong in
it. That marks a _region_, not a single moment. The Record tab has no button for it, so while recording there is nothing
to do but reproduce the problem.
This is what makes the recording useful to whoever investigates it, person or agent: your description is the ground
truth of _what_ went wrong, and everything else in the session is evidence of _why_. See