Skip to content

Sonny: every fold has a key, and the clean view stays text - #421

Merged
lydakis merged 6 commits into
mainfrom
claude/project-thread-4pq5m2
Oct 30, 2026
Merged

lydakis merged 6 commits into
mainfrom
claude/project-thread-4pq5m2

Conversation

@lydakis

@lydakis lydakis commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

The second PR from the design-system review (Sonny's Design System, recommendation 2).

The clean view stays text

The first version of this PR summed up commands, reads and edits as one row (• Ran 2 commands, edited calc.py ▸). George reversed that: Sonny is not another Claude Code; the clean view is mostly text. Agents are people you talk to, not minds to peek inside. The clean view shows what they say and what they do that reaches you: an agent to look at, a margin note, a lookout or task update, a question. Commands, reads and edits stay in /verbose. The work rows are gone, and this principle now opens FEATURES.md and the README's clean-view paragraph.

Every fold has a key

Folds and gathered rows (• Messaged calc.add and calc.neg ▸, ↳ 3 task updates ▸) opened only with a mouse. Ctrl+O now opens every row that folds, and folds them all again once all are open. This is Claude Code's key for the same thing.

Agents in /status were also click-only. Now ↑ ↓ pick one (marked ›) and Enter opens it in the pane, as a click does. The card's title names the keys: ↑↓ pick · enter open · esc close.

/status with ↑↓ pick · enter open in its title, the picked task marked ›

Checks

  • cargo test -p sonny --bins: 512 passed. New tests are ctrl_o_opens_every_fold_and_folds_them_again and status_picks_an_agent_from_the_keys.
  • cargo clippy -p sonny --all-targets and cargo fmt --check are clean.
  • The screenshot comes from the release build, replayed through the design-review rig.

🤖 Generated with Claude Code

The clean view left commands, reads and edits out entirely, so a reply
stood with nothing under it to show the edit or the test run. Each
stretch of that work is now one row, as Codex's Explored/Ran cells and
Claude Code's "Read 3 files" rows say it: "• Ran 2 commands, edited
tally.py -1 +1 ▸", ✗ and a count when some failed. A click opens every
call as the verbose view draws it; /verbose keeps them all drawn.

Rows a click opens had no key. Ctrl+O opens every fold and gathered row
in the conversation, or folds them again, as Claude Code's Ctrl+O does;
/status takes ↑↓ to pick an agent and Enter to open it, as /commons
picks a thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEBHyeyj8q32PemnWK
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T04:01:52.974404Z 8f1b20a New commits
🔒 Security Review ✅ Completed 2026-10-30T04:02:45.779098Z 8f1b20a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lydakis lydakis self-assigned this Oct 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74c92d2774

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/transcript.rs Outdated
Comment on lines +1939 to +1941
if verb == WORK {
let (mut spans, failed) = work_row(whats);
spans.push(Span::raw(if open { " ▾" } else { " ▸" }).dim());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make single-line work folds expandable

When a stretch contains only one successful read, its verbose rendering is a single header line, but the new summary replaces that header with Read 1 file ▸. transcript::unfolds returns false for a single one-line call, so commit_call attaches no opening link and open_all skips it. The filename is therefore hidden behind an inert disclosure arrow. Work folds need an expandability check that accounts for information lost in the summary, even when the underlying call occupies only one line.

Useful? React with 👍 / 👎.

Comment thread sonny/src/main.rs
Comment on lines +4398 to +4402
if let Some(cluster) = self.clusters.get_mut(&at)
&& cluster.open != open
{
cluster.open = open;
self.draw_cluster(at);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Expand relayed messages when opening all folds

When the conversation contains a folded message from another agent, Ctrl+O only changes cluster.open; it never loads or changes Relayed.text, which is what relayed_lines uses to reveal the message and its associated calls. For a single-message cluster, cluster_lines ignores cluster.open entirely, so Ctrl+O visibly does nothing; for a larger cluster, it reveals only more folded headers. Update the individual relayed-message state as well, using the history-loading behavior already implemented by press_row("said/…"), so these rows can actually be opened and closed from the keyboard.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6a7a0c1 (in #438). Ctrl+O now reads every shut message between agents from the history in one batch, as a click does, opens them with their clusters, and folds them all again on the next press. Tested.


Generated by Claude Code

Comment thread sonny/src/main.rs
Comment on lines +8813 to +8814
*first = Span::raw("›").bold();
pane.screen.keep_in_view(row, 2);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scroll to the status selection only when it changes

Once an agent is selected in a /status list taller than the pane, every redraw requests keep_in_view for that agent. Screen::render then overrides scrolling whenever the selected row would leave the viewport, so PageUp, PageDown, Home, End, and mouse scrolling cannot move freely away from the selection. Gate this request on a changed selection, as the /background and /commons rendering immediately above already do, rather than continuously pinning the viewport to the picked agent.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6a7a0c1 (in #438). /status scrolls to its pick only when the picked row changes, as /background and /commons do.


Generated by Claude Code

Comment thread sonny/src/transcript.rs Outdated
Comment on lines +1810 to +1813
"edit" => (
"edited",
shown(&field("path"), workspace),
diff(arguments, workspace).counts(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude unsuccessful edits from completed-change totals

When an edit fails because its old text is absent or ambiguous, the file tool returns before writing anything, but work_item still records the requested diff as an accomplished edit. If the agent then retries successfully in the same stretch, the summary counts both attempts' removed and added lines even though only one changed the file; a completely unsuccessful stretch likewise claims that files were edited. The trailing failure count does not distinguish which changes actually happened. Keep failed attempts visible, but exclude their requested changes from the completed-edit totals, consistent with drawn already suppressing diffs for failed file tools.

Useful? React with 👍 / 👎.

Comment thread sonny/src/transcript.rs Outdated
"web_search" | "web_fetch" => ("looked up", String::new(), (0, 0)),
_ => ("called", name.to_owned(), (0, 0)),
};
format!("{kind}\t{what}\t{removed}\t{added}\t{failed}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Escape work-item fields before using tab delimiters

When a shell command's first line contains a literal tab, work_item embeds it unescaped in the tab-delimited record, shifting every subsequent field consumed by work_row. For example, a failed command consisting of false, a tab, and --flag produces fields where the failure check reads 0 instead of true, so the folded row is green and omits the failure count. Tabs in filenames also corrupt the counts and failure state. Store these values structurally or escape the delimiter so valid tool arguments cannot change how the summary parses its metadata.

Useful? React with 👍 / 👎.

George: agents are people you talk to, so the clean view shows what
they say and what reaches you, not their commands, reads and edits.
The work rows go; Ctrl+O still opens every fold and ↑↓ Enter still
pick an agent in /status. The principle is in FEATURES.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEBHyeyj8q32PemnWK
@lydakis lydakis changed the title Sonny: the clean view sums up work as one row, and every fold has a key Sonny: every fold has a key, and the clean view stays text Oct 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b145bcd400

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/main.rs
Comment on lines +6751 to +6752
let last = bots.len() - 1;
let pick = watch.pick.map(|pick| pick.min(last));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reconcile the status selection when hiding resolved agents

If a resolved agent is selected in /status and r hides resolved agents, watch.pick remains outside the visible list. Rendering uses marks.get(pick), so no agent has a selection marker, but this handler silently clamps the stale index and Enter opens the last visible agent instead. Clear or normalize the stored selection when the visible list changes, and use that same selection for rendering and activation, so Enter cannot open an unselected agent.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6a7a0c1 (in #438). A pick past the visible list is now dropped instead of clamped, so Enter opens only the agent marked ›.


Generated by Claude Code

@lydakis
lydakis merged commit a7b13fa into main Oct 30, 2026
4 checks passed
lydakis pushed a commit that referenced this pull request Oct 30, 2026
- A rule is cut at the edge only when its last span is nothing but
  rule characters, as Worked for draws one; text that ends in them
  wraps (#432).
- Notes fold into the margin at the same width that shows it, gutter
  included (#427).
- A list over the composer shows only as many rows as fit above it,
  the pick among them (#427).
- /status scrolls to a pick once, so the page keys still move, and a
  pick that hiding resolved agents dropped is no pick (#421).
- Ctrl+O opens and folds the messages between agents too, reading
  them again as a click does (#421).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEBHyeyj8q32PemnWK
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.

2 participants