Skip to content

Improve terminal UI and context accounting#106

Closed
shawnsw wants to merge 4 commits into
graykode:mainfrom
shawnsw:pr/terminal-ui-context-fixes
Closed

Improve terminal UI and context accounting#106
shawnsw wants to merge 4 commits into
graykode:mainfrom
shawnsw:pr/terminal-ui-context-fixes

Conversation

@shawnsw
Copy link
Copy Markdown
Contributor

@shawnsw shawnsw commented May 7, 2026

Summary

  • Improve responsive terminal layout for narrow/mobile panes, including grouped tabs and click targets.
  • Show recent selected-session chat history by default while keeping timeline available behind a toggle.
  • Fix Codex context usage so cached input is not double-counted and current context stays tied to the active window.
  • Add install script for building and installing abtop locally.

Commits

  • 8f66420 feat: improve responsive terminal UI
  • b356eac feat: show session chat history
  • b976a3a fix: correct codex context usage

Verification

  • cargo test
  • cargo clippy -- -D warnings
  • cargo run -- --once

@shawnsw shawnsw marked this pull request as ready for review May 7, 2026 05:33
@graykode
Copy link
Copy Markdown
Owner

graykode commented May 7, 2026

Could you make sure the commits are attributed to your GitHub author? Right now they're not linked to your account. Thanks!

@graykode
Copy link
Copy Markdown
Owner

graykode commented May 9, 2026

Review findings to fix in this PR. I will patch these directly on the PR branch.

  1. src/main.rs handles MouseEventKind::Down(_), so left, right, and middle clicks all activate the same click targets. That includes the ports panel KillOrphanPorts target, which means a non-left click can trigger process-kill behavior while mouse capture is enabled. Destructive click handling should be limited to MouseButton::Left.

  2. The session chat tail renders user/assistant transcript text directly into the TUI. The current chat cleanup only normalizes whitespace and redacts a few secret prefixes; it does not strip terminal control characters or bidi override characters. Chat text should go through the same class of terminal-safe sanitization used for snapshot output before it is stored or rendered.

@graykode
Copy link
Copy Markdown
Owner

graykode commented May 9, 2026

Closing this one because the scope is too broad for a safe merge as-is.

The Codex context accounting fix looks useful and worth keeping, but this PR also bundles responsive layout changes, chat-history UI, an install script, and related refactors. That makes the review and regression surface much larger than the actual fix we need right now.

Could you please reopen this work as smaller PRs, starting with just the Codex context accounting fix? The UI/chat-history pieces can then be reviewed separately with screenshots and focused behavior tests.

@graykode
Copy link
Copy Markdown
Owner

graykode commented May 9, 2026

Closed in favor of smaller, focused follow-up PRs.

@graykode graykode closed this May 9, 2026
@shawnsw
Copy link
Copy Markdown
Contributor Author

shawnsw commented May 10, 2026

@graykode thanks for the review. I have fixed the account email issue, and broken the PR into 3 smaller ones #113 #114 #115 per your suggestion.

@graykode
Copy link
Copy Markdown
Owner

@shawnsw Thanks for your PRs!

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