Skip to content
Merged
2 changes: 1 addition & 1 deletion crates/dim-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ answer text (including its retained streaming tail)
· stopped
```

The fullscreen composer box has no prompt mark. The adopted model and, when its configuration carries one, the reasoning effort it sends (`provider / model · effort`) sit at the right of its top border. Its bottom border keeps the run status, status slot (a notice, `esc interrupt`, `permission required`), goal and main branch context reading (`1.8K / 256K`) at the left, and the attached Session's workspace and git branch at the right, with Home naming the launch directory. The permission preset is not in that border: both modes show the live permission footer described above, without an `AGENT` prefix, with its hint in the selected interface language. Scrollback retains its other status information, right-aligned model label and `›` prompt. The live footer is not committed to transcript history. When the workspace differs from the CLI's `--cwd`, the `@` picker names the `--cwd` in its title, so local file completion still says which directory it lists. A box too narrow for the whole model label drops the effort first, then the label.
Both TUI modes share the same composer border layout: the adopted model and, when its configuration carries one, the reasoning effort it sends (`provider / model · effort`) sit at the right of the top border, while shell mode keeps the top-border left title. The bottom border keeps the run status, status slot (a notice, `esc interrupt`, `permission required` / `answer required`, disconnect), background task count, goal and main branch context reading (`1.8K / 256K`) at the left, and the attached Session's workspace, git branch and unread badge at the right, with Home naming the launch directory. The permission preset is not in that border: both modes show only the live permission footer described above, without an `AGENT` prefix, with its hint in the selected interface language. While a prompt replaces the composer, a notice or the disconnect state is drawn once, on the rows above the footer. Scrollback keeps its `›` prompt, while fullscreen omits the prompt mark and keeps mouse targets such as clicking the model label. The live footer is not committed to transcript history. When the workspace differs from the CLI's `--cwd`, the `@` picker names the `--cwd` in its title, so local file completion still says which directory it lists. A box too narrow for the whole model label drops the effort first, then the label.

The Git branch label follows branch switches in both modes, including switches made by tools or another terminal. At startup the client resolves the workspace's own Git `HEAD` path (including linked worktrees); the existing UI timer reads that file at most once every 10 seconds, without spawning more Git processes, and requests a repaint only when the name changes. Detached HEAD displays `HEAD`; a transient read failure keeps the last known name until the next check.

Expand Down
984 changes: 752 additions & 232 deletions crates/dim-cli/src/ui/tui.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/architecture/tui-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ daemon. `--keep` leaves the home and raw streams in place for inspection.
| commands | `slash_palette_lists_curated_commands_and_settings` | The palette's curated order and filter, the Settings panel, and `/keys` output |
| commands | `palette_tab_completes_and_enter_runs_the_command` | `Tab` completes the command without running it, three `Tab`s keep completing and never exit the palette, and `Enter` still runs it, in both layouts |
| runs | `streaming_status_reports_and_interrupts` | The status row says `working…`/`esc interrupt`, OSC 7501 reports `working`, `Escape` interrupts with the recorded reason, and the status settles; with `DIM_TERMINAL_PROGRESS=on`, OSC 9;4 draws the working bar and takes it down when the run settles, and the last sequence the pane receives after exit is that clear |
| runs | `composer_borders_match_in_scrollback_and_fullscreen` | A slow-thinking turn in both scrollback and fullscreen at 100 and 60 columns places the run status, `esc interrupt`, and context usage together on the composer's bottom border, keeps the model on the top border (beside `! shell mode` in scrollback), and leaves only the permission preset on the footer line |
| input-queue | `queue_holds_steers_and_deletes` | Held messages in queue mode, the `Queue (n)` strip, `/queue`, `x` deletion read from the panel's own rows, `Enter` steer, the applied row in the transcript, and the deleted input never entering it |
| approvals | `approval_panel_allows_one_command` | The permission panel names the tool and command, `y` allows once, the command output returns to the model, and the status is blocked before the answer |
| approvals | `question_panel_answer_reaches_the_next_request` | The question panel's options, the review step, and the chosen label in the tool result the model receives |
Expand Down
51 changes: 24 additions & 27 deletions docs/design/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -677,22 +677,14 @@ prints two lines: usage, then the no-goal notice.
The line client and both terminal UI modes print these lines; in the terminal UI they are one
report in the transcript, so earlier reports stay readable above later ones. The status area
carries one short element while the shown line follows a goal, and nothing for a completed,
blocked or cleared one:
blocked or cleared one. Both modes draw it the same way: on the composer's bottom border, beside
the run status and context usage, with the place on its right:

```text
╭──────────────────────────────────────────────────────────────────────────────╮
╭────────────────────────────────────────────────────── local / fixture-model ─╮
│ › _ │
╰────────────────────────────── ⑂ main ▸ child work · after message 0 ─────────╯
⏵⏵ Workspace write (shift+tab to cycle) ◎ goal active 1.8K / 256K
```

Fullscreen draws the same element in the composer's bottom border, beside the run status:

```text
╭──────────────────────────────────────────────────────────────────────────────╮
│ › _ │
╰──── ◎ goal paused 1.8K / 256K ────────────────── ● main · after message 4 ─╯
⏵⏵ Full access (shift+tab to cycle)
╰─ ◎ goal active 1.8K / 256K ───────── ⑂ main ▸ child work · after message 0 ─╯
⏵⏵ Workspace write (shift+tab to cycle)
```

## Loop
Expand Down Expand Up @@ -1490,7 +1482,7 @@ Enter also writes the default a new Session in this folder reads ([provider mana

Bare `/effort` and `/reasoning` open the current model's inline effort picker in both TUI
modes; explicit-value forms and the line client keep their command behavior. At Home the
picker and the explicit-value forms act on the footer's preview, the model the first
picker and the explicit-value forms act on the top border's preview, the model the first
message's Session adopts. The selection contract is owned by [model
configuration](model-configuration.md#scrollback-interaction).

Expand Down Expand Up @@ -3109,11 +3101,20 @@ Assistant: ...
Both TUI modes draw a live permission footer under the composer, without an `AGENT` prefix;
the preset, colors, localized shortcut hint and key behavior are defined in
[`/permissions`](#permissions). It is not committed to transcript history.
Scrollback keeps the goal marker, context use against its window, and one slot for the state
in force — a notice, a required answer or permission, `esc interrupt`, or the background task
count — on the same line. The model, with its effort when both fit, is right-aligned there;
the line is clipped to the terminal width. Fullscreen instead keeps run status, the status
slot, goal and context information in the composer border, not the permission preset.
Both modes place the model label (with its effort when both fit) on the right side of the
composer's top border, and keep the run status, the status slot (a notice, a required answer
or permission, `esc interrupt`, or disconnect), background task count, goal and context
information on the left side of the composer's bottom border, leaving only the permission
preset and its shortcut hint on the footer line. When the corner is too narrow, the first
candidate that fits wins, in this order: (1) the full run status, with its retry reason, and
every optional part; (2) the phase with the slot and the optional parts, dropping context,
then goal, then background tasks; (3) the optional parts with the slot and without the phase,
dropped the same way; (4) the slot alone. The retry reason goes before the phase, and the
slot outranks every optional part, so it is kept whole when it fits the border. The slot
alone is clipped from its end only when it is wider than the border. While a prompt replaces the composer
(permission, question, effort, exit, upgrade, fork, timeline, queue, export or report),
the composer is not drawn, so a notice or the disconnect state is drawn once, on the rows
just above the footer, and the footer stays permission-only.

### Submit check warnings

Expand Down Expand Up @@ -3277,14 +3278,10 @@ The three rows above are alternatives: only the effective preset appears. The sh
is translated into the selected interface language. Read only is cyan,
Workspace write is purple and Full access is yellow; the shortcut hint is muted. Light themes
use darker shades for contrast, and limited-color terminals use their cyan, magenta and yellow
slots. The permission label takes priority over the hint and other status content on narrow
terminals. Fullscreen retains run, goal, context and notice information in the composer border.
In scrollback the hint ranks last: the permission label is drawn first and the hint only when
the whole line still fits with it, so the hint's cells go to the rest when they are needed. A
slot that asks the user something or reports a problem, which is a notice, the disconnected
text, `answer required` and `permission required`, outranks the right-aligned model: the model
gives up its effort first, then its place while that slot shows. `esc interrupt`, goal, context
and background text still yield to the model, which keeps its space before they are clipped.
slots. The permission label takes priority over the hint on narrow terminals, where the line
is clipped to the terminal width. Both modes keep run status, the status slot, background
task count, goal and context information on the composer's bottom border, and the model label
on the composer's top border.

With the composer owning the keys, Shift+Tab cycles Read only → Workspace write → Full access
→ Read only without submitting or changing the draft, including during a running turn. It
Expand Down
69 changes: 38 additions & 31 deletions docs/design/cli-current-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ strip. The strip by itself establishes no foreground wait. An idle line
keeps the existing idle treatment when there is no confirmed background
work. `LineState::Waiting` means an open line with no running turn.

In scrollback the run status is the composer’s top border title. Fullscreen
keeps it in the lower dock. The place and unread badge continue to share the
right side of the bottom border. Keep the existing notice slots and
Both modes use the same composer layout: the run status, status slot
(`esc interrupt`, notices, `permission required` / `answer required`,
disconnect), background task count, goal and context usage share the left side
of the composer’s bottom border. The place and unread badge continue to share
the right side of the bottom border. The model label sits on the right side of
the top border, while shell mode keeps the top-border left title. The footer
line below the composer keeps only the permission mode in both modes. While a
prompt replaces the composer, the composer is not drawn, so a notice or the
disconnect state is drawn once, on the rows above the footer. Keep the existing
notice slots and
[notification and clipping priorities](timeline-ui.md#unread-replies).
Shorten the status within its existing space by terminal cell width. Preserve
the phase and any known object ahead of optional elapsed text.
Expand All @@ -46,29 +53,29 @@ Scrollback during a dispatched batch at the default tool detail setting:
> Fix the issue and verify
[committed tool history]

o CI checks 2m13s
+-- Tool batch pending ------------------------+
| > |
+------------------------ Unread (1) · /lines -+
o CI checks 2m13s
+----------------------------------- provider / model -+
| > |
+-- Tool batch pending ---------- Unread (1) · /lines -+
```

Scrollback while the model generates and a server runs in the background:

```text
o Dev server 8m02s
+-- Generating · this turn 24s ----------------+
| > |
+------------------------------------- ~/repo -+
o Dev server 8m02s
+----------------------------------- provider / model -+
| > |
+-- Generating · this turn 24s --------------- ~/repo -+
```

The same generating state in narrow scrollback, with both elapsed labels
omitted and the task still visible:
omitted, the model label dropped to fit, and the task still visible:

```text
o Dev server
+-- Generating ----------------+
+------------------------------+
| > |
+--------------------- ~/repo -+
+-- Generating ------- ~/repo -+
```

The task row’s elapsed time comes from the task’s own start. Show “this turn”
Expand Down Expand Up @@ -166,19 +173,19 @@ an admitted wait with an authoritative start.
Conditional scrollback and fullscreen examples:

```text
o CI checks 2m13s
+-- Waiting for task: CI checks · wait 1m40s ----------+
| > |
+--------------------------------------------- ~/repo -+

+--------------------------------------------------------------+
| [tool history at current detail setting] |
| |
| o CI checks 2m13s |
| +----------------------------------------------------------+ |
| | > | |
| +-- Waiting for task: CI checks · wait 1m40s ----- ~/repo -+ |
+--------------------------------------------------------------+
o CI checks 2m13s
+----------------------------------------- provider / model -+
| > |
+-- Waiting for task: CI checks · wait 1m40s ------- ~/repo -+

+----------------------------------------------------------------+
| [tool history at current detail setting] |
| |
| o CI checks 2m13s |
| +----------------------------------------- provider / model -+ |
| | > | |
| +-- Waiting for task: CI checks · wait 1m40s ------- ~/repo -+ |
+----------------------------------------------------------------+
```

## Cost and terminal signaling
Expand Down Expand Up @@ -212,10 +219,10 @@ adopted inputs. Repainting adds zero RPCs, history scans or remote CI polls.
OSC bytes independently through the existing terminal status checks.
- With a disposable `DIMCODE_HOME` and deterministic provider, capture
both modes at 100, 60 and 32 columns using a synthetic “CI checks” task.
Check the scrollback top border and fullscreen lower dock, the
place/unread label and notifications, default visibility without
`/tasks`, history scroll, detail toggles, branch changes, disconnect,
stop and resume. This scenario can join the local tmux suite under
Check the unified composer borders (top-right model label and bottom-left
status dock) in both modes, the place/unread label and notifications, default
visibility without `/tasks`, history scroll, detail toggles, branch changes,
disconnect, stop and resume. This scenario can join the local tmux suite under
[#1803](https://github.com/arcships/dim/issues/1803) when it lands.
Until then, use the existing isolated local terminal harness.
- After an owner contract is approved, separately verify the named status
Expand Down
13 changes: 6 additions & 7 deletions docs/design/model-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,11 @@ configuration-superseded, reload/interruption and Session-closed contracts.
## Scrollback interaction

Both native TUI modes draw the model label and its effective reasoning effort
in the theme's highlight colour. Scrollback keeps this label in its bottom status
row; fullscreen keeps it on the composer's top border. With fullscreen mouse
reporting enabled, clicking the visible model label opens the existing `/models`
picker without discarding the draft. Only a press and release on the same label
cell counts; dragging, resizing, a hidden label or an open overlay cannot activate
it. Esc closes the picker and returns to the draft.
in the theme's highlight colour on the right side of the composer's top border.
With fullscreen mouse reporting enabled, clicking the visible model label opens
the existing `/models` picker without discarding the draft. Only a press and
release on the same label cell counts; dragging, resizing, a hidden label or an
open overlay cannot activate it. Esc closes the picker and returns to the draft.

```text
╭────────────────────── provider / model · high ─╮
Expand All @@ -579,7 +578,7 @@ and show supported choices from the existing `provider.catalog` response, withou
mutation or a new query method. Bare `/agent` uses existing `agent.list` IDs, names
and descriptions; selection uses an exact ID. Empty/unavailable choices are explicit.

At Home there is no adopted model yet: the footer's preview is the model the first
At Home there is no adopted model yet: the top border's preview is the model the first
message's Session adopts, so the same commands act on it. Bare `/effort` and `/fast`
list that model's advertised choices, and a value is held for the Session the first
message creates instead of writing the shown one. The preview reported the model's
Expand Down
Loading