Skip to content

Commit 2fd0ae2

Browse files
committed
Ensure the chat input placeholder displays correctly by fixing the empty state CSS selector and handling single newline inputs
1 parent 1738940 commit 2fd0ae2

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎packages/ui/src/components/editor/panel/ChatInput/ChatInput.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
outline: none;
7676
}
7777

78-
&:empty:before {
78+
&--empty:before {
7979
content: attr(data-placeholder);
8080
position: absolute;
8181
color: var(--vscode-input-placeholderForeground);

‎packages/ui/src/components/editor/panel/ChatInput/ChatInput.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,8 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
532532
onClick={handle_input_click}
533533
autoFocus
534534
className={cn(styles.input, {
535-
[styles['input-with-tab-hint']]: show_tab_hint
535+
[styles['input-with-tab-hint']]: show_tab_hint,
536+
[styles['input--empty']]: !props.value
536537
})}
537538
data-placeholder={placeholder}
538539
/>

‎packages/ui/src/components/editor/panel/ChatInput/hooks/use-handlers.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export const use_handlers = (props: ChatInputProps) => {
6868
}
6969

7070
const handle_input_change = (e: React.FormEvent<HTMLDivElement>) => {
71-
const new_display_value = e.currentTarget.innerText
71+
let new_display_value = e.currentTarget.innerText
72+
if (new_display_value == '\n') {
73+
new_display_value = ''
74+
}
7275

7376
// Convert display text back to the original format with backticks
7477
// This is a reverse transformation

‎packages/vscode/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
44
"description": "AI coding without agents (CWC)",
5-
"version": "1.532.0",
5+
"version": "1.533.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

0 commit comments

Comments
 (0)