Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

_chat.settings.tsx

780 lines31.6 KB

1import { createFileRoute } from "@tanstack/react-router";
2import { useQuery } from "@tanstack/react-query";
3import { useCallback, useState } from "react";
4import { type ProviderKind, DEFAULT_GIT_TEXT_GENERATION_MODEL } from "@t3tools/contracts";
5import { getModelOptions, normalizeModelSlug } from "@t3tools/shared/model";
6import { getAppModelOptions, MAX_CUSTOM_MODEL_LENGTH, useAppSettings } from "../appSettings";
7import { resolveAndPersistPreferredEditor } from "../editorPreferences";
8import { isElectron } from "../env";
9import { useTheme } from "../hooks/useTheme";
10import { serverConfigQueryOptions } from "../lib/serverReactQuery";
11import { ensureNativeApi } from "../nativeApi";
12import { Button } from "../components/ui/button";
13import { Input } from "../components/ui/input";
14import {
15 Select,
16 SelectItem,
17 SelectPopup,
18 SelectTrigger,
19 SelectValue,
20} from "../components/ui/select";
21import { Switch } from "../components/ui/switch";
22import { APP_VERSION } from "../branding";
23import { SidebarInset } from "~/components/ui/sidebar";
24​
25const THEME_OPTIONS = [
26 {
27 value: "system",
28 label: "System",
29 description: "Match your OS appearance setting.",
30 },
31 {
32 value: "light",
33 label: "Light",
34 description: "Always use the light theme.",
35 },
36 {
37 value: "dark",
38 label: "Dark",
39 description: "Always use the dark theme.",
40 },
41] as const;
42​
43const MODEL_PROVIDER_SETTINGS: Array<{
44 provider: ProviderKind;
45 title: string;
46 description: string;
47 placeholder: string;
48 example: string;
49}> = [
50 {
51 provider: "codex",
52 title: "Codex",
53 description: "Save additional Codex model slugs for the picker and `/model` command.",
54 placeholder: "your-codex-model-slug",
55 example: "gpt-6.7-codex-ultra-preview",
56 },
57 {
58 provider: "claudeAgent",
59 title: "Claude",
60 description: "Save additional Claude model slugs for the picker and `/model` command.",
61 placeholder: "your-claude-model-slug",
62 example: "claude-sonnet-5-0",
63 },
64] as const;
65​
66const TIMESTAMP_FORMAT_LABELS = {
67 locale: "System default",
68 "12-hour": "12-hour",
69 "24-hour": "24-hour",
70} as const;
71​
72function getCustomModelsForProvider(
73 settings: ReturnType<typeof useAppSettings>["settings"],
74 provider: ProviderKind,
75) {
76 switch (provider) {
77 case "claudeAgent":
78 return settings.customClaudeModels;
79 case "codex":
80 default:
81 return settings.customCodexModels;
82 }
84​
85function getDefaultCustomModelsForProvider(
86 defaults: ReturnType<typeof useAppSettings>["defaults"],
87 provider: ProviderKind,
88) {
89 switch (provider) {
90 case "claudeAgent":
91 return defaults.customClaudeModels;
92 case "codex":
93 default:
94 return defaults.customCodexModels;
95 }
97​
98function patchCustomModels(provider: ProviderKind, models: string[]) {
99 switch (provider) {
100 case "claudeAgent":
101 return { customClaudeModels: models };
102 case "codex":
103 default:
104 return { customCodexModels: models };
105 }
107​
108function SettingsRouteView() {
109 const { theme, setTheme, resolvedTheme } = useTheme();
110 const { settings, defaults, updateSettings } = useAppSettings();
111 const serverConfigQuery = useQuery(serverConfigQueryOptions());
112 const [isOpeningKeybindings, setIsOpeningKeybindings] = useState(false);
113 const [openKeybindingsError, setOpenKeybindingsError] = useState<string | null>(null);
114 const [customModelInputByProvider, setCustomModelInputByProvider] = useState<
115 Record<ProviderKind, string>
116 >({
117 codex: "",
118 claudeAgent: "",
119 });
120 const [customModelErrorByProvider, setCustomModelErrorByProvider] = useState<
121 Partial<Record<ProviderKind, string | null>>
122 >({});
123​
124 const codexBinaryPath = settings.codexBinaryPath;
125 const codexHomePath = settings.codexHomePath;
126 const keybindingsConfigPath = serverConfigQuery.data?.keybindingsConfigPath ?? null;
127 const availableEditors = serverConfigQuery.data?.availableEditors;
128​
129 const gitTextGenerationModelOptions = getAppModelOptions(
130 "codex",
131 settings.customCodexModels,
132 settings.textGenerationModel,
133 );
134 const selectedGitTextGenerationModelLabel =
135 gitTextGenerationModelOptions.find(
136 (option) =>
137 option.slug === (settings.textGenerationModel ?? DEFAULT_GIT_TEXT_GENERATION_MODEL),
138 )?.name ?? settings.textGenerationModel;
139​
140 const openKeybindingsFile = useCallback(() => {
141 if (!keybindingsConfigPath) return;
142 setOpenKeybindingsError(null);
143 setIsOpeningKeybindings(true);
144 const api = ensureNativeApi();
145 const editor = resolveAndPersistPreferredEditor(availableEditors ?? []);
146 if (!editor) {
147 setOpenKeybindingsError("No available editors found.");
148 setIsOpeningKeybindings(false);
149 return;
150 }
151 void api.shell
152 .openInEditor(keybindingsConfigPath, editor)
153 .catch((error) => {
154 setOpenKeybindingsError(
155 error instanceof Error ? error.message : "Unable to open keybindings file.",
156 );
157 })
158 .finally(() => {
159 setIsOpeningKeybindings(false);
160 });
161 }, [availableEditors, keybindingsConfigPath]);
162​
163 const addCustomModel = useCallback(
164 (provider: ProviderKind) => {
165 const customModelInput = customModelInputByProvider[provider];
166 const customModels = getCustomModelsForProvider(settings, provider);
167 const normalized = normalizeModelSlug(customModelInput, provider);
168 if (!normalized) {
169 setCustomModelErrorByProvider((existing) => ({
170 ...existing,
171 [provider]: "Enter a model slug.",
172 }));
173 return;
174 }
175 if (getModelOptions(provider).some((option) => option.slug === normalized)) {
176 setCustomModelErrorByProvider((existing) => ({
177 ...existing,
178 [provider]: "That model is already built in.",
179 }));
180 return;
181 }
182 if (normalized.length > MAX_CUSTOM_MODEL_LENGTH) {
183 setCustomModelErrorByProvider((existing) => ({
184 ...existing,
185 [provider]: `Model slugs must be ${MAX_CUSTOM_MODEL_LENGTH} characters or less.`,
186 }));
187 return;
188 }
189 if (customModels.includes(normalized)) {
190 setCustomModelErrorByProvider((existing) => ({
191 ...existing,
192 [provider]: "That custom model is already saved.",
193 }));
194 return;
195 }
196​
197 updateSettings(patchCustomModels(provider, [...customModels, normalized]));
198 setCustomModelInputByProvider((existing) => ({
199 ...existing,
200 [provider]: "",
201 }));
202 setCustomModelErrorByProvider((existing) => ({
203 ...existing,
204 [provider]: null,
205 }));
206 },
207 [customModelInputByProvider, settings, updateSettings],
208 );
209​
210 const removeCustomModel = useCallback(
211 (provider: ProviderKind, slug: string) => {
212 const customModels = getCustomModelsForProvider(settings, provider);
213 updateSettings(
214 patchCustomModels(
215 provider,
216 customModels.filter((model) => model !== slug),
217 ),
218 );
219 setCustomModelErrorByProvider((existing) => ({
220 ...existing,
221 [provider]: null,
222 }));
223 },
224 [settings, updateSettings],
225 );
226​
227 return (
228 <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
229 <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
230 {isElectron && (
231 <div className="drag-region flex h-[52px] shrink-0 items-center border-b border-border px-5">
232 <span className="text-xs font-medium tracking-wide text-muted-foreground/70">
233 Settings
234 </span>
235 </div>
236 )}
237​
238 <div className="flex-1 overflow-y-auto p-6">
239 <div className="mx-auto flex w-full max-w-3xl flex-col gap-6">
240 <header className="space-y-1">
241 <h1 className="text-2xl font-semibold tracking-tight text-foreground">Settings</h1>
242 <p className="text-sm text-muted-foreground">
243 Configure app-level preferences for this device.
244 </p>
245 </header>
246​
247 <section className="rounded-2xl border border-border bg-card p-5">
248 <div className="mb-4">
249 <h2 className="text-sm font-medium text-foreground">Appearance</h2>
250 <p className="mt-1 text-xs text-muted-foreground">
251 Choose how T3 Code looks across the app.
252 </p>
253 </div>
254​
255 <div className="space-y-4">
256 <div className="space-y-2" role="radiogroup" aria-label="Theme preference">
257 {THEME_OPTIONS.map((option) => {
258 const selected = theme === option.value;
259 return (
260 <button
261 key={option.value}
262 type="button"
263 role="radio"
264 aria-checked={selected}
265 className={`flex w-full items-start justify-between rounded-lg border px-3 py-2 text-left transition-colors ${
266 selected
267 ? "border-primary/60 bg-primary/8 text-foreground"
268 : "border-border bg-background text-muted-foreground hover:bg-accent"
269 }`}
270 onClick={() => setTheme(option.value)}
271 >
272 <span className="flex flex-col">
273 <span className="text-sm font-medium">{option.label}</span>
274 <span className="text-xs">{option.description}</span>
275 </span>
276 {selected ? (
277 <span className="rounded bg-primary/14 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary">
278 Selected
279 </span>
280 ) : null}
281 </button>
282 );
283 })}
284 </div>
285​
286 <p className="text-xs text-muted-foreground">
287 Active theme: <span className="font-medium text-foreground">{resolvedTheme}</span>
288 </p>
289​
290 <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">
291 <div>
292 <p className="text-sm font-medium text-foreground">Timestamp format</p>
293 <p className="text-xs text-muted-foreground">
294 System default follows your browser or OS time format. <code>12-hour</code>{" "}
295 and <code>24-hour</code> force the hour cycle.
296 </p>
297 </div>
298 <Select
299 value={settings.timestampFormat}
300 onValueChange={(value) => {
301 if (value !== "locale" && value !== "12-hour" && value !== "24-hour") return;
302 updateSettings({
303 timestampFormat: value,
304 });
305 }}
306 >
307 <SelectTrigger className="w-40" aria-label="Timestamp format">
308 <SelectValue>{TIMESTAMP_FORMAT_LABELS[settings.timestampFormat]}</SelectValue>
309 </SelectTrigger>
310 <SelectPopup align="end">
311 <SelectItem value="locale">{TIMESTAMP_FORMAT_LABELS.locale}</SelectItem>
312 <SelectItem value="12-hour">{TIMESTAMP_FORMAT_LABELS["12-hour"]}</SelectItem>
313 <SelectItem value="24-hour">{TIMESTAMP_FORMAT_LABELS["24-hour"]}</SelectItem>
314 </SelectPopup>
315 </Select>
316 </div>
317​
318 {settings.timestampFormat !== defaults.timestampFormat ? (
319 <div className="flex justify-end">
320 <Button
321 size="xs"
322 variant="outline"
323 onClick={() =>
324 updateSettings({
325 timestampFormat: defaults.timestampFormat,
326 })
327 }
328 >
329 Restore default
330 </Button>
331 </div>
332 ) : null}
333 </div>
334 </section>
335​
336 <section className="rounded-2xl border border-border bg-card p-5">
337 <div className="mb-4">
338 <h2 className="text-sm font-medium text-foreground">Codex App Server</h2>
339 <p className="mt-1 text-xs text-muted-foreground">
340 These overrides apply to new sessions and let you use a non-default Codex install.
341 </p>
342 </div>
343​
344 <div className="space-y-4">
345 <label htmlFor="codex-binary-path" className="block space-y-1">
346 <span className="text-xs font-medium text-foreground">Codex binary path</span>
347 <Input
348 id="codex-binary-path"
349 value={codexBinaryPath}
350 onChange={(event) => updateSettings({ codexBinaryPath: event.target.value })}
351 placeholder="codex"
352 spellCheck={false}
353 />
354 <span className="text-xs text-muted-foreground">
355 Leave blank to use <code>codex</code> from your PATH.
356 </span>
357 </label>
358​
359 <label htmlFor="codex-home-path" className="block space-y-1">
360 <span className="text-xs font-medium text-foreground">CODEX_HOME path</span>
361 <Input
362 id="codex-home-path"
363 value={codexHomePath}
364 onChange={(event) => updateSettings({ codexHomePath: event.target.value })}
365 placeholder="/Users/you/.codex"
366 spellCheck={false}
367 />
368 <span className="text-xs text-muted-foreground">
369 Optional custom Codex home/config directory.
370 </span>
371 </label>
372​
373 <div className="flex flex-col gap-3 text-xs text-muted-foreground sm:flex-row sm:items-start sm:justify-between">
374 <div className="min-w-0 flex-1">
375 <p>Binary source</p>
376 <p className="mt-1 break-all font-mono text-[11px] text-foreground">
377 {codexBinaryPath || "PATH"}
378 </p>
379 </div>
380 <Button
381 size="xs"
382 variant="outline"
383 className="self-start"
384 onClick={() =>
385 updateSettings({
386 codexBinaryPath: defaults.codexBinaryPath,
387 codexHomePath: defaults.codexHomePath,
388 })
389 }
390 >
391 Reset codex overrides
392 </Button>
393 </div>
394 </div>
395 </section>
396​
397 <section className="rounded-2xl border border-border bg-card p-5">
398 <div className="mb-4">
399 <h2 className="text-sm font-medium text-foreground">Models</h2>
400 <p className="mt-1 text-xs text-muted-foreground">
401 Save additional provider model slugs so they appear in the chat model picker and
402 `/model` command suggestions.
403 </p>
404 </div>
405​
406 <div className="space-y-5">
407 {MODEL_PROVIDER_SETTINGS.map((providerSettings) => {
408 const provider = providerSettings.provider;
409 const customModels = getCustomModelsForProvider(settings, provider);
410 const customModelInput = customModelInputByProvider[provider];
411 const customModelError = customModelErrorByProvider[provider] ?? null;
412 return (
413 <div
414 key={provider}
415 className="rounded-xl border border-border bg-background/50 p-4"
416 >
417 <div className="mb-4">
418 <h3 className="text-sm font-medium text-foreground">
419 {providerSettings.title}
420 </h3>
421 <p className="mt-1 text-xs text-muted-foreground">
422 {providerSettings.description}
423 </p>
424 </div>
425​
426 <div className="space-y-4">
427 <div className="flex flex-col gap-3 sm:flex-row sm:items-start">
428 <label
429 htmlFor={`custom-model-slug-${provider}`}
430 className="block flex-1 space-y-1"
431 >
432 <span className="text-xs font-medium text-foreground">
433 Custom model slug
434 </span>
435 <Input
436 id={`custom-model-slug-${provider}`}
437 value={customModelInput}
438 onChange={(event) => {
439 const value = event.target.value;
440 setCustomModelInputByProvider((existing) => ({
441 ...existing,
442 [provider]: value,
443 }));
444 if (customModelError) {
445 setCustomModelErrorByProvider((existing) => ({
446 ...existing,
447 [provider]: null,
448 }));
449 }
450 }}
451 onKeyDown={(event) => {
452 if (event.key !== "Enter") return;
453 event.preventDefault();
454 addCustomModel(provider);
455 }}
456 placeholder={providerSettings.placeholder}
457 spellCheck={false}
458 />
459 <span className="text-xs text-muted-foreground">
460 Example: <code>{providerSettings.example}</code>
461 </span>
462 </label>
463​
464 <Button
465 className="sm:mt-6"
466 type="button"
467 onClick={() => addCustomModel(provider)}
468 >
469 Add model
470 </Button>
471 </div>
472​
473 {customModelError ? (
474 <p className="text-xs text-destructive">{customModelError}</p>
475 ) : null}
476​
477 <div className="space-y-2">
478 <div className="flex items-center justify-between gap-2 text-xs text-muted-foreground">
479 <p>Saved custom models: {customModels.length}</p>
480 {customModels.length > 0 ? (
481 <Button
482 size="xs"
483 variant="outline"
484 onClick={() =>
485 updateSettings(
486 patchCustomModels(provider, [
487 ...getDefaultCustomModelsForProvider(defaults, provider),
488 ]),
489 )
490 }
491 >
492 Reset custom models
493 </Button>
494 ) : null}
495 </div>
496​
497 {customModels.length > 0 ? (
498 <div className="space-y-2">
499 {customModels.map((slug) => (
500 <div
501 key={`${provider}:${slug}`}
502 className="flex items-center justify-between gap-3 rounded-lg border border-border bg-background px-3 py-2"
503 >
504 <code className="min-w-0 flex-1 truncate text-xs text-foreground">
505 {slug}
506 </code>
507 <Button
508 size="xs"
509 variant="ghost"
510 onClick={() => removeCustomModel(provider, slug)}
511 >
512 Remove
513 </Button>
514 </div>
515 ))}
516 </div>
517 ) : (
518 <div className="rounded-lg border border-dashed border-border bg-background px-3 py-4 text-xs text-muted-foreground">
519 No custom models saved yet.
520 </div>
521 )}
522 </div>
523 </div>
524 </div>
525 );
526 })}
527 </div>
528 </section>
529​
530 <section className="rounded-2xl border border-border bg-card p-5">
531 <div className="mb-4">
532 <h2 className="text-sm font-medium text-foreground">Git</h2>
533 <p className="mt-1 text-xs text-muted-foreground">
534 Configure the model used for generating commit messages, PR titles, and branch
535 names.
536 </p>
537 </div>
538​
539 <div className="flex flex-col gap-4 rounded-lg border border-border bg-background px-3 py-3 sm:flex-row sm:items-center sm:justify-between">
540 <div className="min-w-0 flex-1">
541 <p className="text-sm font-medium text-foreground">Text generation model</p>
542 <p className="text-xs text-muted-foreground">
543 Model used for auto-generated git content.
544 </p>
545 </div>
546 <Select
547 value={settings.textGenerationModel ?? DEFAULT_GIT_TEXT_GENERATION_MODEL}
548 onValueChange={(value) => {
549 if (value) {
550 updateSettings({
551 textGenerationModel: value,
552 });
553 }
554 }}
555 >
556 <SelectTrigger
557 className="w-full shrink-0 sm:w-48"
558 aria-label="Git text generation model"
559 >
560 <SelectValue>{selectedGitTextGenerationModelLabel}</SelectValue>
561 </SelectTrigger>
562 <SelectPopup align="end">
563 {gitTextGenerationModelOptions.map((option) => (
564 <SelectItem key={option.slug} value={option.slug}>
565 {option.name}
566 </SelectItem>
567 ))}
568 </SelectPopup>
569 </Select>
570 </div>
571​
572 {settings.textGenerationModel !== defaults.textGenerationModel ? (
573 <div className="mt-3 flex justify-end">
574 <Button
575 size="xs"
576 variant="outline"
577 onClick={() =>
578 updateSettings({
579 textGenerationModel: defaults.textGenerationModel,
580 })
581 }
582 >
583 Restore default
584 </Button>
585 </div>
586 ) : null}
587 </section>
588​
589 <section className="rounded-2xl border border-border bg-card p-5">
590 <div className="mb-4">
591 <h2 className="text-sm font-medium text-foreground">Threads</h2>
592 <p className="mt-1 text-xs text-muted-foreground">
593 Choose the default workspace mode for newly created draft threads.
594 </p>
595 </div>
596​
597 <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">
598 <div>
599 <p className="text-sm font-medium text-foreground">Default to New worktree</p>
600 <p className="text-xs text-muted-foreground">
601 New threads start in New worktree mode instead of Local.
602 </p>
603 </div>
604 <Switch
605 checked={settings.defaultThreadEnvMode === "worktree"}
606 onCheckedChange={(checked) =>
607 updateSettings({
608 defaultThreadEnvMode: checked ? "worktree" : "local",
609 })
610 }
611 aria-label="Default new threads to New worktree mode"
612 />
613 </div>
614​
615 {settings.defaultThreadEnvMode !== defaults.defaultThreadEnvMode ? (
616 <div className="mt-3 flex justify-end">
617 <Button
618 size="xs"
619 variant="outline"
620 onClick={() =>
621 updateSettings({
622 defaultThreadEnvMode: defaults.defaultThreadEnvMode,
623 })
624 }
625 >
626 Restore default
627 </Button>
628 </div>
629 ) : null}
630 </section>
631​
632 <section className="rounded-2xl border border-border bg-card p-5">
633 <div className="mb-4">
634 <h2 className="text-sm font-medium text-foreground">Responses</h2>
635 <p className="mt-1 text-xs text-muted-foreground">
636 Control how assistant output is rendered during a turn.
637 </p>
638 </div>
639​
640 <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">
641 <div>
642 <p className="text-sm font-medium text-foreground">Stream assistant messages</p>
643 <p className="text-xs text-muted-foreground">
644 Show token-by-token output while a response is in progress.
645 </p>
646 </div>
647 <Switch
648 checked={settings.enableAssistantStreaming}
649 onCheckedChange={(checked) =>
650 updateSettings({
651 enableAssistantStreaming: Boolean(checked),
652 })
653 }
654 aria-label="Stream assistant messages"
655 />
656 </div>
657​
658 {settings.enableAssistantStreaming !== defaults.enableAssistantStreaming ? (
659 <div className="mt-3 flex justify-end">
660 <Button
661 size="xs"
662 variant="outline"
663 onClick={() =>
664 updateSettings({
665 enableAssistantStreaming: defaults.enableAssistantStreaming,
666 })
667 }
668 >
669 Restore default
670 </Button>
671 </div>
672 ) : null}
673 </section>
674​
675 <section className="rounded-2xl border border-border bg-card p-5">
676 <div className="mb-4">
677 <h2 className="text-sm font-medium text-foreground">Keybindings</h2>
678 <p className="mt-1 text-xs text-muted-foreground">
679 Open the persisted <code>keybindings.json</code> file to edit advanced bindings
680 directly.
681 </p>
682 </div>
683​
684 <div className="space-y-3">
685 <div className="flex items-center justify-between gap-3 rounded-lg border border-border bg-background px-3 py-2">
686 <div className="min-w-0 flex-1">
687 <p className="text-xs font-medium text-foreground">Config file path</p>
688 <p className="mt-1 break-all font-mono text-[11px] text-muted-foreground">
689 {keybindingsConfigPath ?? "Resolving keybindings path..."}
690 </p>
691 </div>
692 <Button
693 size="xs"
694 variant="outline"
695 disabled={!keybindingsConfigPath || isOpeningKeybindings}
696 onClick={openKeybindingsFile}
697 >
698 {isOpeningKeybindings ? "Opening..." : "Open keybindings.json"}
699 </Button>
700 </div>
701​
702 <p className="text-xs text-muted-foreground">
703 Opens in your preferred editor selection.
704 </p>
705 {openKeybindingsError ? (
706 <p className="text-xs text-destructive">{openKeybindingsError}</p>
707 ) : null}
708 </div>
709 </section>
710​
711 <section className="rounded-2xl border border-border bg-card p-5">
712 <div className="mb-4">
713 <h2 className="text-sm font-medium text-foreground">Safety</h2>
714 <p className="mt-1 text-xs text-muted-foreground">
715 Additional guardrails for destructive local actions.
716 </p>
717 </div>
718​
719 <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">
720 <div>
721 <p className="text-sm font-medium text-foreground">Confirm thread deletion</p>
722 <p className="text-xs text-muted-foreground">
723 Ask for confirmation before deleting a thread and its chat history.
724 </p>
725 </div>
726 <Switch
727 checked={settings.confirmThreadDelete}
728 onCheckedChange={(checked) =>
729 updateSettings({
730 confirmThreadDelete: Boolean(checked),
731 })
732 }
733 aria-label="Confirm thread deletion"
734 />
735 </div>
736​
737 {settings.confirmThreadDelete !== defaults.confirmThreadDelete ? (
738 <div className="mt-3 flex justify-end">
739 <Button
740 size="xs"
741 variant="outline"
742 onClick={() =>
743 updateSettings({
744 confirmThreadDelete: defaults.confirmThreadDelete,
745 })
746 }
747 >
748 Restore default
749 </Button>
750 </div>
751 ) : null}
752 </section>
753 <section className="rounded-2xl border border-border bg-card p-5">
754 <div className="mb-4">
755 <h2 className="text-sm font-medium text-foreground">About</h2>
756 <p className="mt-1 text-xs text-muted-foreground">
757 Application version and environment information.
758 </p>
759 </div>
760​
761 <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">
762 <div>
763 <p className="text-sm font-medium text-foreground">Version</p>
764 <p className="text-xs text-muted-foreground">
765 Current version of the application.
766 </p>
767 </div>
768 <code className="text-xs font-medium text-muted-foreground">{APP_VERSION}</code>
769 </div>
770 </section>
771 </div>
772 </div>
773 </div>
774 </SidebarInset>
775 );
777​
778export const Route = createFileRoute("/_chat/settings")({
779 component: SettingsRouteView,
780});