8000 feat(chat): grouped steps, queued messages and a centred form by aorumbayev · Pull Request #181 · kagan-sh/kagan · GitHub
[go: up one dir, main page]

Skip to content

feat(chat): grouped steps, queued messages and a centred form - #181

Merged
aorumbayev merged 102 commits into
mainfrom
feat/chat-polish
Dec 3, 2026
Merged

aorumbayev merged 102 commits into
mainfrom
feat/chat-polish

Conversation

@aorumbayev
Copy link
Copy Markdown
Member

What

A chat shows one Working · N steps group per turn with minimal tool rows, a thin scroll bar with message ticks and Jump to latest, and option chips with icons and a Send button. A message sent while the agent answers waits in a queue that survives a restart, with Steer now, Edit and Delete. The new-thread form is centred, a typed draft survives a thread switch, and a child thread opens in about 45 ms instead of 9 s.

Why

Long turns buried the answer under tool rows, and messages sent mid-reply were lost. Child rows could not be clicked, spinners froze, and Exit full screen stopped responding.

How

On macOS only the app binary links with lld, so the build cache stays valid for the other crates.

Test plan

  • cargo t --workspace --locked
  • CI opens the Browser page on Linux, macOS and Windows and fails if it does not show

The center builds a chat for the thread it shows and drops the one before
it, so the prompt box went with the old thread and the text with the box.
Each chat thread's draft now waits in memory, keyed by its id: the box
writes it on every change, and a chat built for the thread reads it back
with the caret after it. Sending or clearing empties it as before.

The regression test switches to another thread and back, then types, so
it fails on the code before this change. Decision 293 amends 285.
The Active child threads card listed each running child as a label with no
click, so the one list that names a child as active could not open it. Each
row is now a button that shows the thread through the same select step its
sidebar row takes, and Tab, Enter and Space reach it.

The sidebar's own child rows already opened their thread; nothing changed
there.
A busy row's spinner turns only while the mark asks for the next frame on
every frame the window draws. The test drives three frames with the clock
moving and fails if any of them asks for none, so a mark that stops asking
is caught before the window shows a frozen spinner.
## What

`.cargo/config.toml` no longer sets `-C link-arg=-fuse-ld=lld` in macOS
`rustflags`. `crates/kg/build.rs` prints it with
`cargo:rustc-link-arg-bins` on macOS, so only the app's link uses lld
and every other link keeps Apple's ld64.

## Why

The global flag reached every rustc call, so the build cache refused
every unit that carried it: 165 bypasses per checkout, and the 72
crates that use a bypassed proc macro missed in each new worktree. A
fresh worktree now restores 1000 units and takes 41s instead of 1m16s.

## Test plan

- [x] fmt, clippy `--workspace --all-targets -- -D warnings`
- [x] `cargo t --workspace --locked`: 2583 passed
- [x] `sh scripts/smoke.sh --keep`, `sh scripts/size-budget.sh`
- [x] two fresh worktrees: `mbx explain` shows one
`unmodeled-link-argument` (the app's link), 16 misses and 3 bypasses
Same change as the link lane; keeps this lane's builds cacheable.
Same 
10BC8
change as the link lane; keeps this lane's builds cacheable.
Same change as the link lane; keeps this lane's builds cacheable.
Same change as the link lane; keeps this lane's builds cacheable.
Same change as the link lane; keeps this lane's builds cacheable.
Same change as the link lane; keeps this lane's builds cacheable.
Same change as the link lane; keeps this lane's builds cacheable.
The restore in ChatView::new wrote the draft with replace_all, which
records the write in the box's undo stack, so one Undo in a box the
person just came back to emptied it, the prompt's change handler stored
"", and the draft was gone for the session. A box built for a thread
starts with an empty history and the map already holds the text, so the
restore uses set_value, which clears that history and emits no change.

The regression test now presses Undo on a restored draft and asserts the
text survives, which fails on the old code.
A busy row began its spinner's turn again whenever the row was built
again, and a window change builds the rows again, so a busy window drew
the same first angle on every frame and the spinner appeared to stand
still.

kagan now draws the mark itself, from an animation synced to the window's
shared clock, so a rebuilt row joins the turn where it is and every busy
mark turns together. Decision 298.
The form hugged the centre panel's left edge at 760 points, so a wide
window left half the panel empty. Its segmented controls sized to their
own content while the fields above and below spanned the column, the
cards were 96 points high with the mark, name and caption stacked in the
middle, Custom command was a short button under a full-width grid, and
the footer floated at the right of a left-aligned column.

The column is now centred in the centre panel, every field, both
segmented controls, the grid, Custom command and the footer share its
left and right edges, and each segmented pair splits the column in
halves. Cards are 68 points high with the mark at the left beside the
name and version, and Custom command spans the column as the program
section's own button. The chosen card takes an ink border in place of
the accent one, keeping its raised fill, accent bar and the ", selected"
name, so it is not told by colour alone. No control, word or key changed.

Decision 294 amends 289.
The vertical inset was written py_1_5, which GPUI reads as padding-block: 20%, not
one and a half spacing steps: every block carried a fifth of its own width above
and below its text. It is now px_2 py_1 on the 4/8 scale.

A command's output that an agent wrapped in a markdown fence showed the fence
line, and its closing line hid the exit word. Both read the text without it.
A row leads with one 16-point slot: the kind's icon, the state's own mark while it
waits, runs or failed, or the chevron while the pointer is on the row or its body
is open. The label is small type and the command is muted mono, so a row reads as
one line with its words on the transcript's own left edge. Rows stand 8 apart.

An output block copies the text it shows from a control that waits for the pointer,
and a command's exit word is read from that same text: "exit code 0" names the code
twice, and the old scan lost the number to the word after "exit".
The page's own script now sets a random token in its title and text and posts it back to its server, and every platform captures the window: Windows composition, the Xvfb display on Linux, screencapture on macOS. A missing capture or colour fails the run instead of skipping the check, and the tab closes on the page so the closing capture cannot pass on an older frame.
# Conflicts:
#	.config/size-budget.txt
#	docs/decisions.md
# Conflicts:
#	.config/size-budget.txt
#	docs/decisions.md
# Conflicts:
#	.config/size-budget.txt
#	docs/behaviour.md
#	docs/decisions.md
# Conflicts:
#	.config/size-budget.txt
#	docs/decisions.md
# Conflicts:
#	.config/size-budget.txt
#	crates/core/src/thread/acp/mod.rs
#	crates/ui/src/kagan/chat.rs
#	crates/ui/src/kagan/chat/composer.rs
#	docs/behaviour.md
#	docs/decisions.md
# Conflicts:
#	.config/size-budget.txt
#	docs/decisions.md
# Conflicts:
#	.config/size-budget.txt
#	crates/ui/src/kagan/chat.rs
#	crates/ui/src/tests/kagan/chat.rs
#	docs/behaviour.md
#	docs/decisions.md
The fork sync pinned a gpui-kit merge whose Windows webview called
paint_cursor_for_page through windows:: after upstream moved it to
windows_composition.rs, so windows-clippy and windows-tests failed
to compile gpui-webview.
The Tab-order test now runs on every platform, but focus_start_form
was still gated to unix, so the Windows test build could not find it.
The phase reader serves one unix-only test (it starts a shell), so the
Windows test build saw it as dead code.
The Windows page cursor pin changed Cargo.lock, so the hash the notices carry was stale and kg's notices test failed. The test is the regression proof: red before this line, green after.
@aorumbayev
aorumbayev marked this pull request as ready for review December 3, 2026 11:15
@aorumbayev
aorumbayev merged commit a5398d8 into main Dec 3, 2026
34 of 37 checks passed
@aorumbayev
aorumbayev deleted the feat/chat-polish branch December 3, 2026 11:16
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

0