Skip to content

🤖 refactor: move ChatInput attach/voice icons out of textarea overlay#3222

Merged
ammario merged 2 commits intomainfrom
chat-input-icon-overlap-fix
May 2, 2026
Merged

🤖 refactor: move ChatInput attach/voice icons out of textarea overlay#3222
ammario merged 2 commits intomainfrom
chat-input-icon-overlap-fix

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

@ammar-agent ammar-agent commented May 2, 2026

Summary

Move the attach (📎) and voice (🎙️) input buttons from the absolute overlay inside the chat textarea into the controls row directly to the left of the Send button, so they can never visually intersect typed text and read as a single trailing action cluster.

Background

The previous design positioned both buttons absolutely at the bottom-right corner of the textarea and reserved a fixed pr-16 (4rem) right padding to keep text out of their way. This had two problems:

  1. Text could still ride under the icons. The reserved gutter is a fixed pixel value, but font metrics, focus rings, and the icon group's effective width could push glyphs into the icon zone — most visibly the bottom line of multi-line wrapped input.
  2. Wasted horizontal space. Every line in the textarea lost 4rem on the right even when the input was short.

Implementation

  • VimTextArea: removed the trailingAction prop and its associated machinery (pr-16 conditional padding, scrollbarGutter: "stable", the absolute overlay div). The component had a single consumer, so removing the surface area is a net cleanup.
  • ChatInput: relocated <AttachFileButton> and <VoiceInputButton> into a new InputMethodGroup that sits in the right half of the existing controls row, between the agent mode picker (Exec ▾) and the Send button. Internal gap-0 and a -ml-1.5 on the Send container override the parent's gap-1.5 cadence so the trailing actions form one tight cluster [Exec ▾] 📎 🎙 ➤ rather than three small icons stranded in a wide-spaced row.
  • Reclaimed the right-side gutter for the empty-input keyboard hints (right-18right-2) since the textarea no longer has icons floating over its bottom-right corner.

Validation

  • Verified empty / short / multi-line wrapped inputs in Storybook (App/Chat/Input → VoiceInputNoApiKey); the bottom line of wrapped text never intersects either icon.
  • Recording overlay still replaces the textarea correctly while the controls row (with the voice button) stays put.
  • make static-check passes locally.

Risks

Low. The change is purely visual layout: button props, callbacks, and disabled states are unchanged, and no logic in ChatInput was altered. The trailingAction prop on VimTextArea had a single caller, so removing it is safe.


Generated with mux • Model: anthropic:claude-opus-4-7 • Thinking: high • Cost: $1.53

Relocates the attach and voice input buttons from the absolute overlay
inside the textarea to the existing controls row below, so they can never
visually intersect typed text (including wrapped lines that previously
slid under the icons despite the reserved pr-16 gutter).
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammario ammario merged commit 51e1617 into main May 2, 2026
24 checks passed
@ammario ammario deleted the chat-input-icon-overlap-fix branch May 2, 2026 18:44
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.

2 participants