@devries-cameron20 / t3code Mirror · read-only / commits / bc27482417
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 19:15 UTC

perf(web): validate monospace fonts when selected (#15642)

maria committed Oct 4, 2026 at 22:37 UTC bc2748241776066c532f3312a26f1756d9740f9c
1 file changed +13 -2
apps/web/src/components/settings/FontFamilyPicker.tsx
+13 -2
@@ -12,6 +12,7 @@ import {
12 ComboboxTrigger,
13 } from "../ui/combobox";
14 import { SelectButton } from "../ui/select";
15 +import { stackedThreadToast, toastManager } from "../ui/toast";
16
17 const DEFAULT_FONT_VALUE = "__default__";
18
@@ -141,8 +142,8 @@ export function FontFamilyPicker({
142
143 const families = useMemo(() => {
144 if (enumeration.status !== "granted") return [];
144 - return requireMonospace ? enumeration.families.filter(isMonospaceFamily) : enumeration.families;
145 - }, [enumeration, requireMonospace]);
145 + return enumeration.families;
146 + }, [enumeration]);
147
148 const items = useMemo(() => {
149 const trimmedQuery = query.trim().toLowerCase();
@@ -160,6 +161,16 @@ export function FontFamilyPicker({
161
162 const handlePick = (value: string) => {
163 setOpen(false);
164 + if (value !== DEFAULT_FONT_VALUE && requireMonospace && !isMonospaceFamily(value)) {
165 + toastManager.add(
166 + stackedThreadToast({
167 + type: "error",
168 + title: `"${value}" isn't monospace`,
169 + description: "Code and terminal need a fixed-width font, so the current font was kept.",
170 + }),
171 + );
172 + return;
173 + }
174 onSelect(value === DEFAULT_FONT_VALUE ? "" : value);
175 };
176