summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/components
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-01-06 16:03:39 -0600
committerAdam <[email protected]>2026-01-20 07:33:44 -0600
commitde3641e8ebfd6d6d0262289136e970b1ddea54b2 (patch)
treeb351a43a08e24c57bec5ddcdc2e851853759a761 /packages/app/src/components
parent8bcbfd63960120efa3cb770f8e07de1bb57e93b0 (diff)
downloadopencode-de3641e8ebfd6d6d0262289136e970b1ddea54b2.tar.gz
opencode-de3641e8ebfd6d6d0262289136e970b1ddea54b2.zip
wip(app): settings
Diffstat (limited to 'packages/app/src/components')
-rw-r--r--packages/app/src/components/settings-general.tsx63
-rw-r--r--packages/app/src/components/terminal.tsx12
2 files changed, 74 insertions, 1 deletions
diff --git a/packages/app/src/components/settings-general.tsx b/packages/app/src/components/settings-general.tsx
index e9965b0fa..52672d01f 100644
--- a/packages/app/src/components/settings-general.tsx
+++ b/packages/app/src/components/settings-general.tsx
@@ -3,6 +3,7 @@ import { Select } from "@opencode-ai/ui/select"
import { Switch } from "@opencode-ai/ui/switch"
import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme"
import { useSettings } from "@/context/settings"
+import { playSound, SOUND_OPTIONS } from "@/utils/sound"
export const SettingsGeneral: Component = () => {
const theme = useTheme()
@@ -20,11 +21,20 @@ export const SettingsGeneral: Component = () => {
const fontOptions = [
{ value: "ibm-plex-mono", label: "IBM Plex Mono" },
+ { value: "cascadia-code", label: "Cascadia Code" },
{ value: "fira-code", label: "Fira Code" },
+ { value: "hack", label: "Hack" },
+ { value: "inconsolata", label: "Inconsolata" },
+ { value: "intel-one-mono", label: "Intel One Mono" },
{ value: "jetbrains-mono", label: "JetBrains Mono" },
+ { value: "meslo-lgs", label: "Meslo LGS" },
+ { value: "roboto-mono", label: "Roboto Mono" },
{ value: "source-code-pro", label: "Source Code Pro" },
+ { value: "ubuntu-mono", label: "Ubuntu Mono" },
]
+ const soundOptions = [...SOUND_OPTIONS]
+
return (
<div class="flex flex-col h-full overflow-y-auto no-scrollbar">
<div class="flex flex-col gap-8 p-8 max-w-[720px]">
@@ -110,6 +120,59 @@ export const SettingsGeneral: Component = () => {
/>
</SettingsRow>
</div>
+
+ {/* Sound effects Section */}
+ <div class="flex flex-col gap-1">
+ <h3 class="text-14-medium text-text-strong pb-2">Sound effects</h3>
+
+ <SettingsRow title="Agent" description="Play sound when the agent is complete or needs attention">
+ <Select
+ options={soundOptions}
+ current={soundOptions.find((o) => o.id === settings.sounds.agent())}
+ value={(o) => o.id}
+ label={(o) => o.label}
+ onSelect={(option) => {
+ if (!option) return
+ settings.sounds.setAgent(option.id)
+ playSound(option.src)
+ }}
+ variant="secondary"
+ size="small"
+ />
+ </SettingsRow>
+
+ <SettingsRow title="Permissions" description="Play sound when a permission is required">
+ <Select
+ options={soundOptions}
+ current={soundOptions.find((o) => o.id === settings.sounds.permissions())}
+ value={(o) => o.id}
+ label={(o) => o.label}
+ onSelect={(option) => {
+ if (!option) return
+ settings.sounds.setPermissions(option.id)
+ playSound(option.src)
+ }}
+ variant="secondary"
+ size="small"
+ />
+ </SettingsRow>
+
+ <SettingsRow title="Errors" description="Play sound when an error occurs">
+ <Select
+ options={soundOptions}
+ current={soundOptions.find((o) => o.id === settings.sounds.errors())}
+ value={(o) => o.id}
+ label={(o) => o.label}
+ onSelect={(option) => {
+ if (!option) return
+ settings.sounds.setErrors(option.id)
+ playSound(option.src)
+ }}
+ variant="secondary"
+ size="small"
+ />
+ </SettingsRow>
+ </div>
</div>
</div>
)
diff --git a/packages/app/src/components/terminal.tsx b/packages/app/src/components/terminal.tsx
index 8001e2caa..f19366b8a 100644
--- a/packages/app/src/components/terminal.tsx
+++ b/packages/app/src/components/terminal.tsx
@@ -1,6 +1,7 @@
import type { Ghostty, Terminal as Term, FitAddon } from "ghostty-web"
import { ComponentProps, createEffect, createSignal, onCleanup, onMount, splitProps } from "solid-js"
import { useSDK } from "@/context/sdk"
+import { monoFontFamily, useSettings } from "@/context/settings"
import { SerializeAddon } from "@/addons/serialize"
import { LocalPTY } from "@/context/terminal"
import { resolveThemeVariant, useTheme, withAlpha, type HexColor } from "@opencode-ai/ui/theme"
@@ -36,6 +37,7 @@ const DEFAULT_TERMINAL_COLORS: Record<"light" | "dark", TerminalColors> = {
export const Terminal = (props: TerminalProps) => {
const sdk = useSDK()
+ const settings = useSettings()
const theme = useTheme()
let container!: HTMLDivElement
const [local, others] = splitProps(props, ["pty", "class", "classList", "onConnectError"])
@@ -82,6 +84,14 @@ export const Terminal = (props: TerminalProps) => {
setOption("theme", colors)
})
+ createEffect(() => {
+ const font = monoFontFamily(settings.appearance.font())
+ if (!term) return
+ const setOption = (term as unknown as { setOption?: (key: string, value: string) => void }).setOption
+ if (!setOption) return
+ setOption("fontFamily", font)
+ })
+
const focusTerminal = () => {
const t = term
if (!t) return
@@ -112,7 +122,7 @@ export const Terminal = (props: TerminalProps) => {
cursorBlink: true,
cursorStyle: "bar",
fontSize: 14,
- fontFamily: "IBM Plex Mono, monospace",
+ fontFamily: monoFontFamily(settings.appearance.font()),
allowTransparency: true,
theme: terminalColors(),
scrollback: 10_000,