Repository navigation
feat(tui): collapse long command lines behind Ctrl+O - #212
Merged
Merged
Conversation
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo test ...; git diff --check; git status --short) whose collapsed line would exceed 80 chars now truncate to the first command/pipe segment plus a "· N output lines" suffix intheme::dim(), instead of rendering the full raw command inline.Ctrl+Omechanism exactly as-is: no new keybinding, no new focus-tracking state. The globaltool_detail.expandedflag (toggled bySemanticCommand::ToggleToolDetails, bound to Ctrl+O inapp/commands.rs) already flows intoConversationViewOpts::tool_expanded→ActivityGroupPresentation::expanded, and full detail was already revealed via that samep.expandedcheck in the render loop when toggled — this change only affects what the collapsed line shows, not how/when it expands.collapsed_command_summary()only kicks in when the block'scount_labelstarts with"$ "(i.e., is actually a raw command line) — exploring/implementing groups (e.g. "3 files inspected") are untouched, and commands under the 80-char threshold render exactly as before.80matches the truncation length already used elsewhere in this file for thewrote ·write/edit summary, rather than introducing a new magic number.activity_entry_from_tool's collapsed label for solo (non-grouped) validation commands, which previously showed a useless generic "1 item" instead of the command itself — now consistent with the pre-groupedChatItem::ActivityGrouppath, which already exposed the raw command.Test plan
cargo fmt --all -- --checkcargo test --package forge-tui --lib(707 passed), including new tests:long_command_entry_collapses_with_truncated_line_and_output_count,long_command_entry_expands_full_text_via_ctrl_o,short_command_entries_are_unaffected,collapsed_command_summary_splits_at_first_pipe_or_semicolon,collapsed_command_summary_ellipsizes_an_overlong_single_segment,collapsed_command_summary_ignores_short_commands.git diff --check