Skip to content

fix(tui): prevent prompt textarea collapsing to zero width in small windows#15073

Open
Geralt4 wants to merge 4 commits intoanomalyco:devfrom
Geralt4:fix-invisible-input-4332
Open

fix(tui): prevent prompt textarea collapsing to zero width in small windows#15073
Geralt4 wants to merge 4 commits intoanomalyco:devfrom
Geralt4:fix-invisible-input-4332

Conversation

@Geralt4
Copy link

@Geralt4 Geralt4 commented Feb 25, 2026

Issue for this PR

Closes #4332

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes the bug where typing in the input field produces invisible text when the terminal window is narrowed.

The prompt layout stacks padding without a width floor:

  • Session box: paddingLeft={2} + paddingRight={2} = 4 cols
  • Left border: 1 col
  • Prompt inner box: paddingLeft={2} + paddingRight={2} = 4 cols
  • Total overhead: 9 cols

When the terminal is narrower than ~9 columns, the textarea receives zero available width from the flexbox engine. Because there was no minWidth on the textarea, it collapsed silently and rendered nothing.

Changes:

  • Added overflow="hidden" to the prompt padding box
  • Added minWidth={1} to the <textarea> component

How did you verify your code works?

Tested locally by narrowing the terminal window to minimum width (around 20 columns) on macOS and typing in the input field. Text remained visible throughout.

Screenshots / recordings

N/A - this is a layout fix that prevents text from becoming invisible; the expected behavior is simply that typed text should always be visible.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

IOANNIS MANOLOGLOU added 2 commits February 25, 2026 15:54
Fixes anomalyco#4332

When the leader key was active, the textarea text color was set to
theme.textMuted, causing visibility issues when the terminal window is
small. This change ensures the input field text always uses theme.text
for consistent visibility regardless of window size or leader key state.
…all windows

Add overflow=hidden to the prompt padding box and minWidth=1 to the
textarea so that when the terminal is very narrow the accumulated padding
(9 chars across the border + two box levels) cannot reduce the textarea
to zero width, which made all typed text invisible.

Closes anomalyco#4332
Copilot AI review requested due to automatic review settings February 25, 2026 14:19
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the prompt textarea would collapse to zero width in narrow terminal windows, making typed text invisible. The root cause was accumulated padding (9 columns total) from nested boxes without a width floor on the textarea. The fix adds overflow="hidden" to the padding container and minWidth={1} to the textarea to ensure text remains visible at any terminal size.

Changes:

  • Add overflow="hidden" and minWidth={1} to prevent textarea collapse in narrow terminals
  • Remove conditional textColor based on leader key state (appears unintentional)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +824 to +825
textColor={theme.text}
focusedTextColor={theme.text}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The textColor and focusedTextColor changes remove the visual feedback when the leader key is active. Previously, these colors would change to theme.textMuted when keybind.leader was true, consistent with how the model name text changes color on line 1007. This appears to be an unintended change that's unrelated to the width fix. Consider restoring the conditional color logic: textColor={keybind.leader ? theme.textMuted : theme.text} and focusedTextColor={keybind.leader ? theme.textMuted : theme.text} to maintain consistent leader key visual feedback throughout the prompt UI.

Suggested change
textColor={theme.text}
focusedTextColor={theme.text}
textColor={keybind.leader ? theme.textMuted : theme.text}
focusedTextColor={keybind.leader ? theme.textMuted : theme.text}

Copilot uses AI. Check for mistakes.
Comment on lines +824 to +825
textColor={theme.text}
focusedTextColor={theme.text}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description states this is a "single file, 2 lines" fix for the width issue, but the changes actually span 4 lines including textColor modifications that aren't mentioned in the description. The textColor changes on lines 824-825 remove the conditional behavior based on keybind.leader state, which appears to be an unrelated change that should either be mentioned in the PR description or reverted.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 25, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: input field text is invisible when window is small

2 participants