Skip to content

Cache TUI flex heights across frame passes - #34348

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5ad1a6711f4011c699b5d002b13dc3319cb4db8e
Jul 20, 2026
Merged

Cache TUI flex heights across frame passes#34348
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5ad1a6711f4011c699b5d002b13dc3319cb4db8e

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 20, 2026

Copy link
Copy Markdown

Cache TUI flex heights across frame passes

Why

Sizing, rendering, and cursor placement can query the same chat widget layout
multiple times in one frame, repeatedly measuring active transcript cells.

What changed

  • Build one chat widget renderable tree per frame and reuse it for sizing,
    rendering, and cursor placement.
  • Cache each flex child's desired height by width for the lifetime of that tree.
  • Reuse the bottom pane's renderable directly instead of forwarding each
    renderable operation through a wrapper.

Testing

  • Verify flex layouts measure a child once across frame passes and remeasure it
    when the width changes.
  • Verify a chat widget frame measures its active transcript cell once.

## Why

Sizing, rendering, and cursor placement can query the same chat widget layout
multiple times in one frame, repeatedly measuring active transcript cells.

## What changed

- Build one chat widget renderable tree per frame and reuse it for sizing,
  rendering, and cursor placement.
- Cache each flex child's desired height by width for the lifetime of that tree.
- Reuse the bottom pane's renderable directly instead of forwarding each
  renderable operation through a wrapper.

## Testing

- Verify flex layouts measure a child once across frame passes and remeasure it
  when the width changes.
- Verify a chat widget frame measures its active transcript cell once.

GitOrigin-RevId: 5ad1a6711f4011c699b5d002b13dc3319cb4db8e
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/5ad1a6711f4011c699b5d002b13dc3319cb4db8e branch from ffc4657 to eceb3ee Compare July 20, 2026 13:59
@copyberry
copyberry Bot merged commit eceb3ee into main Jul 20, 2026
32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/5ad1a6711f4011c699b5d002b13dc3319cb4db8e branch July 20, 2026 14:00
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants