Skip to content

fix(terminal): keep grid view render-only#298

Merged
forketyfork merged 3 commits intomainfrom
fix/fullmode-toggle-redraw
Apr 30, 2026
Merged

fix(terminal): keep grid view render-only#298
forketyfork merged 3 commits intomainfrom
fix/fullmode-toggle-redraw

Conversation

@forketyfork
Copy link
Copy Markdown
Owner

@forketyfork forketyfork commented Apr 30, 2026

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

  • Launch Architect from this branch with at least two sessions.
  • Run Codex or Claude Code in one session, generate enough output to fill several rows, then toggle full view in and out several times with Cmd+Return.
  • Verify the agent history does not gain blank rows, duplicate tail output, or lose line fragments after toggling.
  • Verify the grid tile shows the latest prompt/output after exiting full view.
  • Verify a short session with only a few lines of output is still visible in grid view rather than showing an empty tile.

@forketyfork forketyfork requested a review from Copilot April 30, 2026 13:33
@forketyfork forketyfork marked this pull request as ready for review April 30, 2026 13:33
Copy link
Copy Markdown

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

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: 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".

Comment thread src/render/renderer.zig
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/render/renderer.zig Outdated
Comment thread src/app/layout.zig Outdated
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.
@forketyfork forketyfork merged commit a2019b8 into main Apr 30, 2026
4 checks passed
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.

[Bug]: Full view toggles corrupt embedded agent terminal history

2 participants