From b8fb75a94adbd9f0175e29403cd85fde55cc2793 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Thu, 26 Mar 2026 14:02:01 -0500 Subject: fix(app): don't bundle fonts (#19329) --- packages/app/src/components/settings-general.tsx | 98 +++++++++++++----------- 1 file changed, 52 insertions(+), 46 deletions(-) (limited to 'packages/app/src/components') diff --git a/packages/app/src/components/settings-general.tsx b/packages/app/src/components/settings-general.tsx index f4b8198e7..ec0614729 100644 --- a/packages/app/src/components/settings-general.tsx +++ b/packages/app/src/components/settings-general.tsx @@ -4,12 +4,21 @@ import { Button } from "@opencode-ai/ui/button" import { Icon } from "@opencode-ai/ui/icon" import { Select } from "@opencode-ai/ui/select" import { Switch } from "@opencode-ai/ui/switch" +import { TextField } from "@opencode-ai/ui/text-field" import { Tooltip } from "@opencode-ai/ui/tooltip" import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme/context" import { showToast } from "@opencode-ai/ui/toast" import { useLanguage } from "@/context/language" import { usePlatform } from "@/context/platform" -import { useSettings, monoFontFamily } from "@/context/settings" +import { + monoDefault, + monoFontFamily, + monoInput, + sansDefault, + sansFontFamily, + sansInput, + useSettings, +} from "@/context/settings" import { playSoundById, SOUND_OPTIONS } from "@/utils/sound" import { Link } from "./link" import { SettingsList } from "./settings-list" @@ -25,13 +34,6 @@ type ThemeOption = { name: string } -let font: Promise | undefined - -function loadFont() { - font ??= import("@opencode-ai/ui/font-loader") - return font -} - // To prevent audio from overlapping/playing very quickly when navigating the settings menus, // delay the playback by 100ms during quick selection changes and pause existing sounds. const stopDemoSound = () => { @@ -149,25 +151,10 @@ export const SettingsGeneral: Component = () => { })), ) - const fontOptions = [ - { value: "ibm-plex-mono", label: "font.option.ibmPlexMono" }, - { value: "cascadia-code", label: "font.option.cascadiaCode" }, - { value: "fira-code", label: "font.option.firaCode" }, - { value: "hack", label: "font.option.hack" }, - { value: "inconsolata", label: "font.option.inconsolata" }, - { value: "intel-one-mono", label: "font.option.intelOneMono" }, - { value: "iosevka", label: "font.option.iosevka" }, - { value: "jetbrains-mono", label: "font.option.jetbrainsMono" }, - { value: "meslo-lgs", label: "font.option.mesloLgs" }, - { value: "roboto-mono", label: "font.option.robotoMono" }, - { value: "source-code-pro", label: "font.option.sourceCodePro" }, - { value: "ubuntu-mono", label: "font.option.ubuntuMono" }, - { value: "geist-mono", label: "font.option.geistMono" }, - ] as const - const fontOptionsList = [...fontOptions] - const noneSound = { id: "none", label: "sound.option.none" } as const const soundOptions = [noneSound, ...SOUND_OPTIONS] + const mono = () => monoInput(settings.appearance.font()) + const sans = () => sansInput(settings.appearance.uiFont()) const soundSelectProps = ( enabled: () => boolean, @@ -334,31 +321,50 @@ export const SettingsGeneral: Component = () => { /> + +
+ settings.appearance.setUIFont(value)} + placeholder={sansDefault} + spellcheck={false} + autocorrect="off" + autocomplete="off" + autocapitalize="off" + class="text-12-regular" + style={{ "font-family": sansFontFamily(settings.appearance.uiFont()) }} + /> +
+
+ - +
+ settings.appearance.setFont(value)} + placeholder={monoDefault} + spellcheck={false} + autocorrect="off" + autocomplete="off" + autocapitalize="off" + class="text-12-regular" + style={{ "font-family": monoFontFamily(settings.appearance.font()) }} + /> +
-- cgit v1.2.3