fix: increase terminal max-width from 120 to 1024#596
Conversation
The calculateBoxWidth function in useTerminalWidth capped content width at 120 columns regardless of terminal size, wasting horizontal space on wide terminals (>190 cols). Bumped to 1024, matching the existing DEFAULT_TERMINAL_WIDTH constant. Closes Nano-Collective#595
akramcodez
left a comment
There was a problem hiding this comment.
@zhaider3c Thanks for the contribution! The implementation correctly updates the terminal width limits and addresses the original issue.
One thing still needs updating before this can be merged: the corresponding unit test still expects the previous maximum width (120). Since the implementation now uses 1024, the test should be updated accordingly to reflect the new behavior and ensure the change is covered.
Once the test expectation is updated, I'd be happy to approve.
|
Thanks for tackling this - the diff is small, focused, and easy to review. That said, I agree with the framing in the linked issue that something should give on the 120 cap, but I'd push back on going all the way to 1024. A few thoughts: Why the cap exists The 120 ceiling isn't an accident or a forgotten constant - it's doing real work. CLI UX research and most well-designed TUIs converge on ~100–120 columns because:
So I don't think the right fix is "remove the cap." A configurable, sensible default is. The middle ground I'd suggest Something like
Let me know your thoughts :) |
Summary
Removes the hardcoded 120-column cap in
useTerminalWidth, replacing it with 1024. This lets content fill wide terminal windows instead of leaving ~74 columns of empty space on a 190-col terminal.Changes
source/hooks/useTerminalWidth.tsx—Math.min(columns - 4, 120)→Math.min(columns - 4, 1024)source/constants.ts—DEFAULT_TERMINAL_WIDTH = 120→DEFAULT_TERMINAL_WIDTH = 1024Related
Closes #595