[Bug] Resizing the terminal sometimes doesn't re-layout the UI at all
Description
actualWidth is a raw, non-reactive read of process.stdout.columns. The only state that actually triggers a re-render is a separately-clamped boxWidth. A resize that doesn't move boxWidth produces zero re-renders every layout consumer (welcome screen, input box, status bar, session selector) can silently freeze at the old layout after a resize, sized for a terminal that no longer exists.
Parent: #907
Steps to Reproduce
- Start Nanocoder at a given terminal size.
- Resize the terminal to a different size.
- Observe the layout.
Expected Behavior
The UI re-measures and redraws for the new terminal size.
Actual Behavior
The UI can keep rendering content sized for the old width. Since the real terminal is now a different size, lines drawn for the old width get cut off mid-word by the terminal itself, and boxes end up visibly misaligned.
Recording
Root Cause
source/hooks/useTerminalWidth.tsx:7-8,112 calculateBoxWidth = Math.max(Math.min(columns - 4, 200), 40) is the only reactive state; actualWidth = process.stdout.columns is a raw render-time read with no subscription of its own.
Suggested Fix
Subscribe directly to the raw column/row count instead of deriving reactivity from the already-clamped boxWidth.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs on the latest
main
Hi @akramcodez ! Happy to take this one could you assign it to me?