Skip to content

Commit 5d9cca3

Browse files
committed
🤖 fix: header heights and provider display names
- Use span instead of h2/h3 for headers to ensure consistent heights - Add PROVIDER_DISPLAY_NAMES constant with proper casing (OpenAI, xAI, etc.) - Update ProvidersSection and ModelsSection to use display names
1 parent 17da905 commit 5d9cca3

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

src/browser/components/Settings/SettingsModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export function SettingsModal() {
6868
{/* Sidebar */}
6969
<div className="border-border-medium flex w-48 shrink-0 flex-col border-r">
7070
<div className="border-border-medium flex h-12 items-center border-b px-4">
71-
<h2 id="settings-title" className="text-foreground text-sm font-semibold">
71+
<span id="settings-title" className="text-foreground text-sm font-semibold">
7272
Settings
73-
</h2>
73+
</span>
7474
</div>
7575
<nav className="flex-1 overflow-y-auto p-2">
7676
{SECTIONS.map((section) => (
@@ -94,7 +94,7 @@ export function SettingsModal() {
9494
{/* Content */}
9595
<div className="flex flex-1 flex-col overflow-hidden">
9696
<div className="border-border-medium flex h-12 items-center justify-between border-b px-6">
97-
<h3 className="text-foreground text-sm font-medium">{currentSection.label}</h3>
97+
<span className="text-foreground text-sm font-medium">{currentSection.label}</span>
9898
<button
9999
type="button"
100100
onClick={handleClose}

src/browser/components/Settings/sections/ModelsSection.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect, useCallback } from "react";
22
import { Plus, Trash2 } from "lucide-react";
33
import type { ProvidersConfigMap } from "../types";
4-
import { SUPPORTED_PROVIDERS } from "@/common/constants/providers";
4+
import { SUPPORTED_PROVIDERS, PROVIDER_DISPLAY_NAMES } from "@/common/constants/providers";
55

66
interface NewModelForm {
77
provider: string;
@@ -98,7 +98,7 @@ export function ModelsSection() {
9898
<option value="">Select provider</option>
9999
{SUPPORTED_PROVIDERS.map((p) => (
100100
<option key={p} value={p}>
101-
{p}
101+
{PROVIDER_DISPLAY_NAMES[p]}
102102
</option>
103103
))}
104104
</select>
@@ -136,7 +136,10 @@ export function ModelsSection() {
136136
className="border-border-medium bg-background-secondary flex items-center justify-between rounded-md border px-4 py-2"
137137
>
138138
<div className="flex items-center gap-3">
139-
<span className="text-muted text-xs capitalize">{provider}</span>
139+
<span className="text-muted text-xs">
140+
{PROVIDER_DISPLAY_NAMES[provider as keyof typeof PROVIDER_DISPLAY_NAMES] ??
141+
provider}
142+
</span>
140143
<span className="text-foreground font-mono text-sm">{modelId}</span>
141144
</div>
142145
<button

src/browser/components/Settings/sections/ProvidersSection.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect, useCallback } from "react";
22
import { ChevronDown, ChevronRight, Check, X } from "lucide-react";
33
import type { ProvidersConfigMap } from "../types";
4-
import { SUPPORTED_PROVIDERS } from "@/common/constants/providers";
4+
import { SUPPORTED_PROVIDERS, PROVIDER_DISPLAY_NAMES } from "@/common/constants/providers";
55

66
export function ProvidersSection() {
77
const [config, setConfig] = useState<ProvidersConfigMap>({});
@@ -90,7 +90,9 @@ export function ProvidersSection() {
9090
) : (
9191
<ChevronRight className="text-muted h-4 w-4" />
9292
)}
93-
<span className="text-foreground text-sm font-medium capitalize">{provider}</span>
93+
<span className="text-foreground text-sm font-medium">
94+
{PROVIDER_DISPLAY_NAMES[provider]}
95+
</span>
9496
</div>
9597
<div
9698
className={`h-2 w-2 rounded-full ${configured ? "bg-green-500" : "bg-border-medium"}`}

src/common/constants/providers.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ export type ProviderName = keyof typeof PROVIDER_REGISTRY;
8080
*/
8181
export const SUPPORTED_PROVIDERS = Object.keys(PROVIDER_REGISTRY) as ProviderName[];
8282

83+
/**
84+
* Display names for providers (proper casing for UI)
85+
*/
86+
export const PROVIDER_DISPLAY_NAMES: Record<ProviderName, string> = {
87+
anthropic: "Anthropic",
88+
openai: "OpenAI",
89+
google: "Google",
90+
xai: "xAI",
91+
ollama: "Ollama",
92+
openrouter: "OpenRouter",
93+
};
94+
8395
/**
8496
* Type guard to check if a string is a valid provider name
8597
*/

0 commit comments

Comments
 (0)