layout recomputes viewport widths/heights from the current window size. In any modal state (debug detail OR approval-with-diff) the debug viewport is resized to fit the modal body; in every other state it goes back to the bottom-panel dimensions.
()
| 518 | // viewport is resized to fit the modal body; in every other state it |
| 519 | // goes back to the bottom-panel dimensions. |
| 520 | func (m *harness) layout() { |
| 521 | m.input.Width = max(m.width-6, 20) |
| 522 | |
| 523 | if m.inModal() { |
| 524 | modalW, modalH := m.modalSize() |
| 525 | // Inside: outer border (2 cols/rows) + horizontal padding (2 cols) |
| 526 | // + 2 rows for title + separator. |
| 527 | m.debugView.Width = max(modalW-4, 20) |
| 528 | m.debugView.Height = max(modalH-4, 4) |
| 529 | return |
| 530 | } |
| 531 | |
| 532 | inputHeight := 5 // spinner line + box (3) + hint (1) — always reserved |
| 533 | debugH := 0 |
| 534 | if debug.Enabled() { |
| 535 | debugH = debugPanelHeight |
| 536 | } |
| 537 | m.viewport.Width = m.width |
| 538 | m.viewport.Height = max(m.height-inputHeight-debugH, 3) |
| 539 | m.debugView.Width = max(m.width-2, 20) |
| 540 | m.debugView.Height = max(debugPanelHeight-2, 1) |
| 541 | } |
| 542 | |
| 543 | // inModal reports whether the current state should render a centered |
| 544 | // full-screen modal in place of the normal viewport+input layout. Two |
no test coverage detected