Skip to content

ui: closed alert + creative empty chamber + diff threshold + filename truncation - #50

Merged
yogthos merged 1 commit into
mainfrom
ui/alert-empty-chamber-diff
May 20, 2026
Merged

ui: closed alert + creative empty chamber + diff threshold + filename truncation#50
yogthos merged 1 commit into
mainfrom
ui/alert-empty-chamber-diff

Conversation

@yogthos

@yogthos yogthos commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Closed alert box (right borders on every row), CRT-static styled empty chambers when a tool errors/denies, left-truncated MODIFIED paths so filenames survive, and bumped the edit-tool diff threshold from 20 to 200 lines so meaningful diffs render. 599 tests pass, 0 warnings.

… truncation

Four issues from the visual review:

## Permission alert: every row closes

The alert's inner rows (tool/args/key hints) had a left `│` border
but no right border, so the box looked half-open. New `row` helper
in the alert renderer pads each content row to the inner width and
adds the right `│` border. The frame now reads as a single closed
box, not a left bracket with text hanging out.

## Empty tool chambers get distinct styling

When `close_tool_chamber_if_open` fires (permission denied, agent
errored, interjected mid-execution, or a fresh ToolCall before the
previous one finished), the chamber previously closed empty —
just a top border and bottom border with nothing inside. Now it
gets a small CRT-static signature inside:

  ╭─ WRITE_TODO_LIST ─ ... ──╮
  │ ░▒░▓░▒▒░▓▒░▒░▓░▒▒░▓▒░▒░ │
  │       ░▒▓  NO OUTPUT  ▓▒░       │
  │   tool denied · aborted · no result   │
  │ ▒░▓░▒▓░▒░▓▒░▓░▒▓░▒░▓▒░▓ │
  ╰────────────────────────────╯

Two `static_row` patterns (alternating glyph runs) sandwich a
centered `NO OUTPUT` label + reason. Reads as a "dead channel"
rather than a silent empty rectangle.

New helpers: `static_row(inner, seed)` builds the noise rows,
`chamber_row_centered(content, inner)` horizontally centers labels
inside the chamber.

## MODIFIED panel: left-truncate paths

`src/clj/yourname/guestbook/…` hid the filename — the most useful
information lived at the right edge. New module-level
`left_truncate(s, max)` produces `…clj/yourname/foo.rs` so the
filename always survives. Applied to the MODIFIED section's items
before they reach `push_section` (which still does its own
right-padding to fit the chamber width).

## Edit-tool diff threshold

`edit` was only emitting a unified diff when both old and new
sides were ≤ 20 lines. Larger edits silently dropped the diff —
the chat showed `Applied edit to <path>` with no `+`/`-` lines,
and the chamber renderer (which detects `--- a/`) fell back to
the plain-text path. Threshold bumped to 200 lines per side; that
covers virtually all edit-tool use without inflating LLM context
for genuinely massive refactors.

## Test plan

- [x] `cargo test --features plugin` -> 599 pass, 0 fail.
- [x] Both build profiles -> 0 warnings.
- [ ] Eyeball: deny a tool, verify the chamber shows the NO
      OUTPUT static rows; check the alert is fully closed;
      check MODIFIED filenames are readable; verify large edits
      show the colorized diff in the chamber.
@yogthos
yogthos merged commit 6d7708f into main May 20, 2026
1 check passed
@yogthos
yogthos deleted the ui/alert-empty-chamber-diff branch May 20, 2026 21:54
allen-munsch pushed a commit to allen-munsch/dirge that referenced this pull request Jun 3, 2026
… truncation (dirge-code#50)

Four issues from the visual review:

## Permission alert: every row closes

The alert's inner rows (tool/args/key hints) had a left `│` border
but no right border, so the box looked half-open. New `row` helper
in the alert renderer pads each content row to the inner width and
adds the right `│` border. The frame now reads as a single closed
box, not a left bracket with text hanging out.

## Empty tool chambers get distinct styling

When `close_tool_chamber_if_open` fires (permission denied, agent
errored, interjected mid-execution, or a fresh ToolCall before the
previous one finished), the chamber previously closed empty —
just a top border and bottom border with nothing inside. Now it
gets a small CRT-static signature inside:

  ╭─ WRITE_TODO_LIST ─ ... ──╮
  │ ░▒░▓░▒▒░▓▒░▒░▓░▒▒░▓▒░▒░ │
  │       ░▒▓  NO OUTPUT  ▓▒░       │
  │   tool denied · aborted · no result   │
  │ ▒░▓░▒▓░▒░▓▒░▓░▒▓░▒░▓▒░▓ │
  ╰────────────────────────────╯

Two `static_row` patterns (alternating glyph runs) sandwich a
centered `NO OUTPUT` label + reason. Reads as a "dead channel"
rather than a silent empty rectangle.

New helpers: `static_row(inner, seed)` builds the noise rows,
`chamber_row_centered(content, inner)` horizontally centers labels
inside the chamber.

## MODIFIED panel: left-truncate paths

`src/clj/yourname/guestbook/…` hid the filename — the most useful
information lived at the right edge. New module-level
`left_truncate(s, max)` produces `…clj/yourname/foo.rs` so the
filename always survives. Applied to the MODIFIED section's items
before they reach `push_section` (which still does its own
right-padding to fit the chamber width).

## Edit-tool diff threshold

`edit` was only emitting a unified diff when both old and new
sides were ≤ 20 lines. Larger edits silently dropped the diff —
the chat showed `Applied edit to <path>` with no `+`/`-` lines,
and the chamber renderer (which detects `--- a/`) fell back to
the plain-text path. Threshold bumped to 200 lines per side; that
covers virtually all edit-tool use without inflating LLM context
for genuinely massive refactors.

## Test plan

- [x] `cargo test --features plugin` -> 599 pass, 0 fail.
- [x] Both build profiles -> 0 warnings.
- [ ] Eyeball: deny a tool, verify the chamber shows the NO
      OUTPUT static rows; check the alert is fully closed;
      check MODIFIED filenames are readable; verify large edits
      show the colorized diff in the chamber.

Co-authored-by: Yogthos <yogthos@gmail.com>
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