Skip to content

fix: improve UI consistency in codebase indexing popover #7041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions webview-ui/src/components/chat/CodeIndexPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
<div className="mt-4">
<button
onClick={() => setIsSetupSettingsOpen(!isSetupSettingsOpen)}
className="flex items-center text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none"
className="flex items-center text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none cursor-pointer"
aria-expanded={isSetupSettingsOpen}>
<span
className={`codicon codicon-${isSetupSettingsOpen ? "chevron-down" : "chevron-right"} mr-1`}></span>
Expand All @@ -613,7 +613,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
<div className="mt-4 space-y-4">
{/* Embedder Provider Section */}
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.embedderProviderLabel")}
</label>
<Select
Expand Down Expand Up @@ -650,7 +650,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
{currentSettings.codebaseIndexEmbedderProvider === "openai" && (
<>
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.openAiKeyLabel")}
</label>
<VSCodeTextField
Expand All @@ -672,7 +672,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelLabel")}
</label>
<VSCodeDropdown
Expand Down Expand Up @@ -715,7 +715,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
{currentSettings.codebaseIndexEmbedderProvider === "ollama" && (
<>
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.ollamaBaseUrlLabel")}
</label>
<VSCodeTextField
Expand Down Expand Up @@ -746,7 +746,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelLabel")}
</label>
<VSCodeTextField
Expand All @@ -767,7 +767,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelDimensionLabel")}
</label>
<VSCodeTextField
Expand Down Expand Up @@ -799,7 +799,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
{currentSettings.codebaseIndexEmbedderProvider === "openai-compatible" && (
<>
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.openAiCompatibleBaseUrlLabel")}
</label>
<VSCodeTextField
Expand All @@ -826,7 +826,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.openAiCompatibleApiKeyLabel")}
</label>
<VSCodeTextField
Expand Down Expand Up @@ -854,7 +854,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelLabel")}
</label>
<VSCodeTextField
Expand All @@ -875,7 +875,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelDimensionLabel")}
</label>
<VSCodeTextField
Expand Down Expand Up @@ -907,7 +907,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
{currentSettings.codebaseIndexEmbedderProvider === "gemini" && (
<>
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.geminiApiKeyLabel")}
</label>
<VSCodeTextField
Expand All @@ -929,7 +929,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelLabel")}
</label>
<VSCodeDropdown
Expand Down Expand Up @@ -972,7 +972,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
{currentSettings.codebaseIndexEmbedderProvider === "mistral" && (
<>
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.mistralApiKeyLabel")}
</label>
<VSCodeTextField
Expand All @@ -994,7 +994,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.modelLabel")}
</label>
<VSCodeDropdown
Expand Down Expand Up @@ -1036,7 +1036,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({

{/* Qdrant Settings */}
<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.qdrantUrlLabel")}
</label>
<VSCodeTextField
Expand Down Expand Up @@ -1064,7 +1064,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="space-y-2">
<label className="text-sm font-medium">
<label className="text-sm font-medium mb-1 block">
{t("settings:codeIndex.qdrantApiKeyLabel")}
</label>
<VSCodeTextField
Expand All @@ -1090,7 +1090,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
<div className="mt-4">
<button
onClick={() => setIsAdvancedSettingsOpen(!isAdvancedSettingsOpen)}
className="flex items-center text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none"
className="flex items-center text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none cursor-pointer"
aria-expanded={isAdvancedSettingsOpen}>
<span
className={`codicon codicon-${isAdvancedSettingsOpen ? "chevron-down" : "chevron-right"} mr-1`}></span>
Expand All @@ -1103,7 +1103,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
<div className="mt-4 space-y-4">
{/* Search Score Threshold Slider */}
<div className="space-y-2">
<div className="flex items-center gap-2">
<div className="flex items-center gap-2 mb-1">
Copy link
Author

Choose a reason for hiding this comment

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

I notice that here we're adding to the parent div instead of the label element itself. For consistency with all the other labels in this file (lines 616, 653, 675, 718, 749, 770, 802, 829, 857, 878, 910, 932, 975, 997, 1039, 1067), should we consider moving the classes directly to the label element?

<label className="text-sm font-medium">
{t("settings:codeIndex.searchMinScoreLabel")}
</label>
Expand Down Expand Up @@ -1149,7 +1149,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({

{/* Maximum Search Results Slider */}
<div className="space-y-2">
<div className="flex items-center gap-2">
<div className="flex items-center gap-2 mb-1">
Copy link
Author

Choose a reason for hiding this comment

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

Same pattern here - for consistency with the rest of the file, the classes would typically go on the label element rather than the wrapper div.

<label className="text-sm font-medium">
{t("settings:codeIndex.searchMaxResultsLabel")}
</label>
Expand Down
Loading