diff --git a/packages/vscode-ide-companion/src/webview/components/InputForm.tsx b/packages/vscode-ide-companion/src/webview/components/InputForm.tsx index f5a03b98..5bcbefbb 100644 --- a/packages/vscode-ide-companion/src/webview/components/InputForm.tsx +++ b/packages/vscode-ide-companion/src/webview/components/InputForm.tsx @@ -10,6 +10,7 @@ import { AutoEditIcon, PlanModeIcon, CodeBracketsIcon, + HideContextIcon, ThinkingIcon, SlashCommandIcon, LinkIcon, @@ -33,6 +34,8 @@ interface InputFormProps { thinkingEnabled: boolean; activeFileName: string | null; activeSelection: { startLine: number; endLine: number } | null; + // Whether to auto-load the active editor selection/path into context + skipAutoActiveContext: boolean; onInputChange: (text: string) => void; onCompositionStart: () => void; onCompositionEnd: () => void; @@ -42,6 +45,7 @@ interface InputFormProps { onToggleEditMode: () => void; onToggleThinking: () => void; onFocusActiveEditor: () => void; + onToggleSkipAutoActiveContext: () => void; onShowCommandMenu: () => void; onAttachContext: () => void; completionIsOpen: boolean; @@ -90,6 +94,7 @@ export const InputForm: React.FC = ({ thinkingEnabled, activeFileName, activeSelection, + skipAutoActiveContext, onInputChange, onCompositionStart, onCompositionEnd, @@ -98,7 +103,7 @@ export const InputForm: React.FC = ({ onCancel, onToggleEditMode, onToggleThinking, - onFocusActiveEditor, + onToggleSkipAutoActiveContext, onShowCommandMenu, onAttachContext, completionIsOpen, @@ -128,6 +133,15 @@ export const InputForm: React.FC = ({ onKeyDown(e); }; + // Selection label like "6 lines selected" (Claude-style); no line numbers + const selectedLinesCount = activeSelection + ? Math.max(1, activeSelection.endLine - activeSelection.startLine + 1) + : 0; + const selectedLinesText = + selectedLinesCount > 0 + ? `${selectedLinesCount} ${selectedLinesCount === 1 ? 'line' : 'lines'} selected` + : ''; + return (
= ({ aria-label="Message input" aria-multiline="true" data-placeholder="Ask Qwen Code …" + // Use a data flag so CSS can show placeholder even if the browser + // inserts an invisible
into contentEditable (so :empty no longer matches) + data-empty={inputText.trim().length === 0 ? 'true' : 'false'} onInput={(e) => { const target = e.target as HTMLDivElement; onInputChange(target.textContent || ''); @@ -196,15 +213,26 @@ export const InputForm: React.FC = ({ )} diff --git a/packages/vscode-ide-companion/src/webview/components/icons/EditIcons.tsx b/packages/vscode-ide-companion/src/webview/components/icons/EditIcons.tsx index 39a59f68..f5e12b33 100644 --- a/packages/vscode-ide-companion/src/webview/components/icons/EditIcons.tsx +++ b/packages/vscode-ide-companion/src/webview/components/icons/EditIcons.tsx @@ -109,6 +109,34 @@ export const CodeBracketsIcon: React.FC = ({ ); +/** + * Hide context (eye slash) icon (20x20) + * Used to indicate the active selection will NOT be auto-loaded into context + */ +export const HideContextIcon: React.FC = ({ + size = 20, + className, + ...props +}) => ( + +); + /** * Slash command icon (20x20) * Used for command menu button diff --git a/packages/vscode-ide-companion/src/webview/components/icons/index.ts b/packages/vscode-ide-companion/src/webview/components/icons/index.ts index 74f1b4c7..90feba93 100644 --- a/packages/vscode-ide-companion/src/webview/components/icons/index.ts +++ b/packages/vscode-ide-companion/src/webview/components/icons/index.ts @@ -30,6 +30,7 @@ export { AutoEditIcon, PlanModeIcon, CodeBracketsIcon, + HideContextIcon, SlashCommandIcon, LinkIcon, OpenDiffIcon,