Skip to content

fix(tui): rebuild dag inspector on the chat design language - #137

Merged
LeXwDeX merged 1 commit into
devfrom
fix/dag-chat-language
Jul 29, 2026
Merged

fix(tui): rebuild dag inspector on the chat design language#137
LeXwDeX merged 1 commit into
devfrom
fix/dag-chat-language

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

Rebuilds the /dag inspector on the chat transcript's design language instead of the diff-viewer's frame vocabulary. Box-drawing lines (─┬├┴) are gone; the screen is now rail-and-panel blocks with two-column side padding, exactly as routes/session renders messages.

A grilling pass over the first attempt found three real defects, all fixed here.

1. Sidebar was not responsive (severe)

Chat gates its 42-wide sidebar on dimensions().width > 120 (routes/session/index.tsx). The first attempt rendered it unconditionally. Measured at 60 columns:

|  wave 1· 1 node        |   ← gap collapsed
|    ✓ coll build        |   ← node name truncated to "coll"
|    ⠋aGeneralPur        |   ← name reduced to "a", spinner glued on

Now gated on the same threshold. Below it the sidebar is dropped and the summary block carries workflow 1/2 so the left/right cursor stays legible. Locked in by a new regression test asserting the sidebar appears at 130 columns and is absent at 100.

2. Selection used the "unfocused" highlight

dialog-select uses primary + selectedForeground() for the active row and degrades to backgroundElement only when focus moves away. The first attempt used backgroundElement for the focused state — semantically "selected but unfocused", and only an 8% luminance step (#0a0a0a#1e1e1e), so the cursor was nearly invisible on low-contrast terminals.

Node cursor (what return acts on) now uses primary + selectedForeground(); the secondary workflow selection keeps backgroundElement. One strong highlight on screen, no ambiguity about what return targets.

3. Fixed layout for the empty state

Panels keep a fixed layout: the sidebar is present whenever the terminal is wide and simply empty when there is nothing to list. The empty state also gained a Run /dag-flow <task> … hint — previously it was a dead end, which is what made an earlier UI change look like "nothing changed" (the empty state is byte-identical across versions since it was never restyled).

Cursor-only interaction model

Command Before After
dag.down / dag.up j,down / k,up down / up
dag.next_workflow / dag.previous_workflow l,right,tab / h,left right / left
dag.close escape,q escape
dag.enter return return
dag.pause / resume / step / cancel p / r / s / x none

The four control operations gain namespace: "palette" so they stay reachable through the command palette — without it, unbinding them would have made the capability unreachable, since route commands registered via useBindings are not palette-visible by default. A test pins this. The footer is now a single uncrowded row: enter open session escape close.

Test plan

  • tsgo --noEmit clean in packages/tui
  • Full TUI suite: 233 pass / 0 fail (43 in the DAG files, up from 41)
  • Rewrote the three pressKey("p") tests to invoke dag.pause directly, and replaced the contextual-footer assertion with one that verifies control hints never appear
  • Lint ratchet tightened 4704 → 4690: a runCommand test helper collapses ten duplicated command-context assertions into one, a net reduction of 14 warnings

Replaces the diff-viewer frame vocabulary with the chat transcript's: rail
and panel blocks instead of box-drawing lines, two-column side padding, and
a fixed 42-wide sidebar gated on the same > 120 terminal width chat uses.

- Responsive sidebar: below 120 columns the sidebar squeezed node names into
  4-character truncation, so it is dropped and the summary block carries the
  workflow position instead.
- Selection now uses primary + selectedForeground() for the node cursor and
  backgroundElement for the secondary workflow selection, matching the select
  dialog's focused/unfocused semantics. backgroundElement alone meant
  "selected but unfocused" and read as an 8% luminance nudge.
- Cursor keys only: down/up move nodes, left/right switch workflows, return
  opens, escape closes. j/k/h/l/tab/q are gone and pause/resume/step/cancel
  are unbound by default, reachable through the command palette instead, so
  the footer stays a single uncrowded row.
- Tightens the lint ratchet to 4690: a runCommand test helper collapses ten
  duplicated command-context assertions into one.
@LeXwDeX
LeXwDeX merged commit a4b448c into dev Jul 29, 2026
4 checks passed
@LeXwDeX
LeXwDeX deleted the fix/dag-chat-language branch July 29, 2026 14:18
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.

1 participant