Commit Graph
1 Commits
Author SHA1 Message Date
Metal AgentandClaude Opus 5 5564063aa5 Take the window arithmetic out of the window
main.rs is 3,884 lines and 56% of the application, so everything inside it is
as expensive to read as the renderer around it. The first thing to leave is
the part that never needed a renderer at all: how tall the workspace is once
the header, tab bar and footer are subtracted, how many panes fit beside the
rail, which slice of the attached panes is on screen, and how many rows and
columns of a measured cell that leaves.

This arithmetic is the contract with the PTY -- a program lays itself out from
the columns it is told it has, so an error of one column here is a wrapped
line in vim and a broken table in git log. That makes it exactly the code that
should be tested against numbers rather than against a window, and decision
0009's pane capacities were already wrong once because they were quoted from a
guessed cell width.

CellMetrics::measure stays behind. Asking the text system for a glyph advance
needs a live App, so the measurement remains a renderer's job and only the
answer crosses over, as two plain f32s. Size<Pixels> stops crossing at all:
geometry works in a local WindowSize and main.rs converts on the way in
through one From impl, which is the entire boundary. The module imports no
gpui, matching sidebar::model, so its two tests run in the headless job.

One thing removed rather than moved: lossless_f32 carried an
allow(clippy::unreadable_literal) with the reason "six-digit colour hex reads
whole". It had drifted up from the terminal colour tables below it and applied
to a function containing no colour and no literal it could suppress.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SPYebLiN2w4TqnHUYGdECq
2026-09-01 12:55:59 -07:00