Skip to content

Commit cb8ff94

Browse files
committed
merge: integrate origin/main into feat/system-audio-windows-linux
Resolve conflicts with unified provider layout (PR #570): - ReasoningModelSelector: keep hoisted CLOUD_PROVIDER_IDS, add effectiveMode - SettingsPage: keep extracted useSettingsLayout import, add InferenceModeSelector - SettingsSection: keep extracted useSettingsLayout import, add useTranslation and InferenceMode
2 parents 4c3a24a + a9d29bb commit cb8ff94

26 files changed

+1505
-555
lines changed

src/components/ControlPanel.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ export default function ControlPanel() {
399399
cloudTranscriptionBaseUrl: s.cloudTranscriptionBaseUrl,
400400
parakeetModel: s.parakeetModel,
401401
whisperModel: s.whisperModel,
402+
transcriptionMode: s.transcriptionMode,
403+
remoteTranscriptionType: s.remoteTranscriptionType,
404+
remoteTranscriptionUrl: s.remoteTranscriptionUrl,
402405
});
403406
if (result.success && result.transcription) {
404407
const rawText = result.transcription.text;

src/components/ReasoningModelSelector.tsx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ interface ReasoningModelSelectorProps {
5151
setGroqApiKey: (key: string) => void;
5252
customReasoningApiKey?: string;
5353
setCustomReasoningApiKey?: (key: string) => void;
54+
mode?: "cloud" | "local";
5455
}
5556

5657
function GpuStatusBadge() {
@@ -321,9 +322,10 @@ export default function ReasoningModelSelector({
321322
setGroqApiKey,
322323
customReasoningApiKey = "",
323324
setCustomReasoningApiKey,
325+
mode,
324326
}: ReasoningModelSelectorProps) {
325327
const { t } = useTranslation();
326-
const [selectedMode, setSelectedMode] = useState<"cloud" | "local">("cloud");
328+
const [selectedMode, setSelectedMode] = useState<"cloud" | "local">(mode || "cloud");
327329
const [selectedCloudProvider, setSelectedCloudProvider] = useState("openai");
328330
const [selectedLocalProvider, setSelectedLocalProvider] = useState("qwen");
329331
const [customModelOptions, setCustomModelOptions] = useState<CloudModelOption[]>([]);
@@ -494,6 +496,8 @@ export default function ReasoningModelSelector({
494496
return customModelOptions;
495497
}, [isCustomBaseDirty, customModelOptions]);
496498

499+
const effectiveMode = mode || selectedMode;
500+
497501
const cloudProviders = CLOUD_PROVIDER_IDS.map((id) => ({
498502
id,
499503
name:
@@ -730,22 +734,24 @@ export default function ReasoningModelSelector({
730734

731735
return (
732736
<div className="space-y-4">
733-
<div className="space-y-2">
734-
<ProviderTabs
735-
providers={MODE_TABS}
736-
selectedId={selectedMode}
737-
onSelect={(id) => handleModeChange(id as "cloud" | "local")}
738-
renderIcon={renderModeIcon}
739-
colorScheme="purple"
740-
/>
741-
<p className="text-xs text-muted-foreground text-center">
742-
{selectedMode === "local"
743-
? t("reasoning.mode.localDescription")
744-
: t("reasoning.mode.cloudDescription")}
745-
</p>
746-
</div>
737+
{!mode && (
738+
<div className="space-y-2">
739+
<ProviderTabs
740+
providers={MODE_TABS}
741+
selectedId={effectiveMode}
742+
onSelect={(id) => handleModeChange(id as "cloud" | "local")}
743+
renderIcon={renderModeIcon}
744+
colorScheme="purple"
745+
/>
746+
<p className="text-xs text-muted-foreground text-center">
747+
{effectiveMode === "local"
748+
? t("reasoning.mode.localDescription")
749+
: t("reasoning.mode.cloudDescription")}
750+
</p>
751+
</div>
752+
)}
747753

748-
{selectedMode === "cloud" ? (
754+
{effectiveMode === "cloud" ? (
749755
<div className="space-y-2">
750756
<div className="border border-border rounded-lg overflow-hidden">
751757
<ProviderTabs

src/components/SelfHostedPanel.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { useTranslation } from "react-i18next";
2+
import { Input } from "./ui/input";
3+
4+
interface SelfHostedPanelProps {
5+
service: "transcription" | "reasoning";
6+
url: string;
7+
onUrlChange: (url: string) => void;
8+
}
9+
10+
export default function SelfHostedPanel({ service, url, onUrlChange }: SelfHostedPanelProps) {
11+
const { t } = useTranslation();
12+
13+
const placeholderUrl =
14+
service === "transcription" ? "http://192.168.1.126:8178" : "http://192.168.1.126:8080";
15+
16+
return (
17+
<div className="border border-border rounded-lg p-3 space-y-2.5">
18+
<div className="space-y-1.5">
19+
<label className="block text-xs font-medium text-foreground">
20+
{t("settingsPage.selfHosted.serverUrl")}
21+
</label>
22+
<Input
23+
value={url}
24+
onChange={(e) => onUrlChange(e.target.value)}
25+
placeholder={placeholderUrl}
26+
className="h-8 text-sm"
27+
/>
28+
</div>
29+
<p className="text-xs text-muted-foreground/70">{t("settingsPage.selfHosted.lanHint")}</p>
30+
</div>
31+
);
32+
}

0 commit comments

Comments
 (0)