fix(terminal): keep grid view render-only#298
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed9a99fc0c
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR makes grid/full view toggles render-only so they no longer mutate the underlying PTY/VT terminal dimensions, preventing agent history reflow/blank-row artifacts when switching views.
Changes:
- Stops applying grid-mode “adjusted render height” and grid font scaling to terminal sizing; terminal dimensions are now independent of view mode.
- Updates grid rendering to reserve space for the CWD bar without resizing the terminal, and to render a cursor-following slice of the active screen in compact grid tiles.
- Adds a resize wrapper to preserve semantic prompt/input content during terminal resizes and skips resize work when cols/rows are unchanged.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/ui/components/cwd_bar_metrics.zig |
New shared metrics helper for CWD bar sizing. |
src/ui/components/cwd_bar.zig |
Uses shared CWD bar metrics instead of local constants/helpers. |
src/render/renderer.zig |
Grid rendering now reserves CWD bar space and follows active cursor row via an offset. |
src/app/runtime.zig |
Removes view-mode-dependent terminal sizing adjustments; always uses full render height. |
src/app/layout.zig |
Terminal sizing ignores view mode; terminal resize now preserves semantic prompt and skips redundant resizes. |
docs/ARCHITECTURE.md |
Documents the new “render-only grid view” and prompt-preserving resize behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Track grid/full mode in terminal render cache invalidation, make PTY resize bookkeeping retryable after failures, and use an explicit cast for terminal row counts.
Solution
Full/grid mode toggles were mutating terminal state even though they are only view changes. That showed up differently across embedded agents: Codex gained blank rows near the input area, while Claude Code reflowed or redrew parts of its chat history.
This keeps Architect-owned resize calls from clearing semantic prompt/input rows, and makes grid view a render-only presentation of the same backing terminal. Grid font scaling and the CWD bar now affect the visible slice of a tile without changing the PTY/VT row and column count. Compact grid tiles follow the active cursor row, so short sessions still show their early output and long sessions stay near the latest prompt.
Fixes #299.
Test plan
Cmd+Return.