/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/app/src/pages/session/session-panel-width.ts
19 строк
1 KB
Luke Parker
fix(app): reserve review pane minimum instead of capping chat width at 45% (#35078)
09 июл 2026, 02:47
Не верифицирован
09 июл 2026, 02:47
dd25d14
Код
Авторство
О чём код?
// The review pane has no width of its own: it takes whatever the chat panel // leaves behind. Instead of capping the chat panel at a fraction of the window // (which forces the review pane to grow with the monitor), reserve a fixed // minimum for the review pane and let the chat panel take everything else. export const SESSION_PANEL_WIDTH_MIN = 450 export const REVIEW_PANE_WIDTH_MIN = 480 export const REVIEW_PANE_WIDTH_MIN_SPLIT = 800 export function sessionPanelWidthMax(input: { available: number; split: boolean }) { const pane = input.split ? REVIEW_PANE_WIDTH_MIN_SPLIT : REVIEW_PANE_WIDTH_MIN return Math.max(SESSION_PANEL_WIDTH_MIN, input.available - pane) } // `available` is undefined until the layout row is first measured; render the // stored width untouched until then to avoid a first-frame snap. export function clampSessionPanelWidth(input: { width: number; available: number | undefined; split: boolean }) { if (input.available === undefined) return input.width return Math.min(input.width, sessionPanelWidthMax({ available: input.available, split: input.split })) }