fix(frontend): hide placeholder text when copilot voice recording is active (#12534)

### Why / What / How

**Why:** When voice recording is active in the CoPilot chat input, the
recording UI (waveform + timer) overlays on top of the placeholder/hint
text, creating a visually broken appearance. Reported by a user via
SECRT-2163.

**What:** Hide the textarea placeholder text while voice recording is
active so it doesn't bleed through the `RecordingIndicator` overlay.

**How:** When `isRecording` is true, the placeholder is set to an empty
string. The existing `RecordingIndicator` overlay (waveform animation +
elapsed time) then displays cleanly without the hint text showing
underneath.

### Changes 🏗️

- Clear the `PromptInputTextarea` placeholder to `""` when voice
recording is active, preventing it from rendering behind the
`RecordingIndicator` overlay

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Open CoPilot chat at /copilot
- [x] Click the microphone button or press Space to start voice
recording
- [x] Verify the placeholder text ("Type your message..." / "What else
can I help with?") is hidden during recording
- [x] Verify the RecordingIndicator (waveform + timer) displays cleanly
without overlapping text
  - [x] Stop recording and verify placeholder text reappears
  - [x] Verify "Transcribing..." placeholder shows during transcription
This commit is contained in:
Abhimanyu Yadav
2026-03-26 11:11:09 +05:30
committed by GitHub
parent 5867e4d613
commit 9b086e39c6

View File

@@ -93,6 +93,12 @@ export function ChatInput({
baseHandleChange(e);
}
const resolvedPlaceholder = isRecording
? ""
: isTranscribing
? "Transcribing..."
: placeholder;
const canSend =
!disabled &&
(!!value.trim() || hasFiles) &&
@@ -129,7 +135,7 @@ export function ChatInput({
onChange={handleChange}
onKeyDown={handleKeyDown}
disabled={isInputDisabled}
placeholder={isTranscribing ? "Transcribing..." : placeholder}
placeholder={resolvedPlaceholder}
/>
{isRecording && !value && (
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">