Skip to content

feat(settings): import Ghostty config with preview, color overrides, opacity and blur - #1001

Merged
nwparker merged 13 commits into
stablyai:mainfrom
mralexsaavedra:feat/958-ghostty-import
Apr 27, 2026
Merged

nwparker merged 13 commits into
stablyai:mainfrom
mralexsaavedra:feat/958-ghostty-import

Conversation

@mralexsaavedra

@mralexsaavedra mralexsaavedra commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #958

Summary

One-shot Ghostty config import from Terminal Settings: discovers the config file cross-platform, parses it, shows a preview diff with supported/unsupported keys, and applies only on explicit confirmation. All imported values are visible and editable in the Settings UI.

Screenshots

See issue #958 comments for screenshots of the import modal and the new Window section in Terminal Settings.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

131 unit tests across parser, mapper, orchestrator, terminal appearance, and mouse-hide helper. 2 pre-existing unrelated failures (codex-accounts, local-pty-provider) not caused by this PR.

AI Review Report

Reviewed cross-platform compatibility for config path discovery (macOS ~/.config/ghostty/config and ~/Library/Application Support/ghostty/config, Linux XDG, Windows %APPDATA%). Platform-specific behavior gated behind process.platform checks. All file paths use path.join. IPC uses existing settings:set channel — no new attack surface. Hex color validation prevents injecting arbitrary values into xterm theme. Deep equality fix prevents infinite re-import loop on already-applied object values. Window blur applies vibrancy on macOS and backgroundMaterial: 'acrylic' on Windows; Linux silently skips. mouse-hide-while-typing scoped to pane container (not document) — no UI bleed; cleaned up via IDisposable on pane close.

Security Audit

  • Config path probing is read-only, no user-controlled path traversal (paths are hardcoded per platform)
  • Hex color validation (/^#?([0-9a-fA-F]{3}){1,2}$/) before writing to xterm theme
  • No shell execution, no secrets handling
  • IPC uses existing settings:set channel — no new channels or elevated permissions

Notes

27 supported Ghostty keys:
font-family, font-size, font-weight, cursor-style, cursor-style-blink, focus-follows-mouse, macos-option-as-alt, background-opacity, background-blur-radius, background, foreground, cursor-color, cursor-text, cursor-opacity, selection-background, selection-foreground, palette (0–15), window-padding-color, window-padding-balance, window-padding-x, window-padding-y, split-divider-color, unfocused-split-opacity, scrollback-limit, bold-color, selection-word-chars, mouse-hide-while-typing

Intentionally unsupported (shown in modal): window-decoration, window-step-resize, window-height/width, gtk-tabs-location, custom-shader, keybind

Follow-up: window-decoration (frameless window) is feasible but needs a CSS drag region — separate PR.

Window blur requires app restart — no hot-reload IPC for BrowserWindow options.

@AmethystLiang

Copy link
Copy Markdown
Contributor

@nwparker can you review this?

Add safe one-shot Ghostty import with preview and success summary,
and probe documented Ghostty config paths before applying changes.

Refs stablyai#958
… from Ghostty

Adds three safe direct-mapping Ghostty keys that have clear equivalents
in GlobalSettings: font-weight, cursor-style-blink, and focus-follows-mouse.

Refs stablyai#958
…option-as-alt

- Add TerminalColorOverrides type grouping 21 optional xterm ITheme fields
- Add terminalBackgroundOpacity, terminalPanePaddingColor, terminalPaddingBalance
  to GlobalSettings
- Extend parser to collect repeated keys as string[] (needed for palette lines)
- Map background-opacity, background, foreground, cursor-color,
  selection-background/foreground, palette (0-15), window-padding-color,
  window-padding-balance, macos-option-as-alt in mapper
- Merge terminalColorOverrides into xterm ITheme at theme resolution; apply
  opacity as rgba() with allowTransparency enabled
- Accept hex colors with or without leading # (Ghostty omits it)
- Fix preview diff to use deep equality for object values so already-applied
  color overrides no longer reappear on next import
…or extend in Ghostty import

- Map background-blur-radius > 0 to windowBackgroundBlur: true; apply
  vibrancy on macOS and backgroundMaterial acrylic on Windows at window
  creation (blur requires restart — no hot-reload IPC exists)
- Accept window-padding-color = extend/background as valid Ghostty values;
  both map to default Orca padding behavior (undefined field) instead of
  landing in unsupportedKeys
- Split mapper.test.ts into domain-scoped describes to stay under 300-line limit
Expose terminalBackgroundOpacity, windowBackgroundBlur, terminalPaddingBalance,
terminalPanePaddingColor, and terminalColorOverrides in the settings UI so
imported Ghostty values can be viewed and changed manually.

- New TerminalWindowSection component (extracted from TerminalPane to stay
  under the 400-line limit)
- Collapsible color overrides sub-section with ColorField for all 21 xterm
  ITheme fields grouped as base, ANSI normal, and ANSI bright
- Reset button clears all color overrides at once
- Window blur toggle shows restart-required note (blur applies at window
  creation, no hot-reload IPC exists)
- Search entries added for all new controls
…er, cursor and word-chars keys

Map 9 additional Ghostty keys to Orca settings:

- split-divider-color → terminalDividerColorDark + terminalDividerColorLight
  (single value applies to both; Ghostty has no dark/light distinction)
- unfocused-split-opacity → terminalInactivePaneOpacity (direct float 0-1)
- scrollback-limit → terminalScrollbackLimit; applied to xterm scrollback option
- window-padding-x / window-padding-y → terminalPaddingX/Y; applied as CSS
  vars --pane-padding-x / --pane-padding-y in terminal.css
- cursor-text → terminalColorOverrides.cursorAccent (xterm ITheme field)
- bold-color → terminalColorOverrides.bold (persisted; xterm ITheme has no
  bold field yet — stored for future xterm upgrade)
- cursor-opacity → terminalCursorOpacity; blended into cursor rgba at theme
  resolution time
- selection-word-chars → terminalWordSeparator; applied to xterm wordSeparator
- mouse-hide-while-typing → terminalMouseHideWhileTyping field added; renderer
  application deferred (needs per-pane disposable + global mousemove listener)
…ings UI

- Window section: scrollback limit, horizontal/vertical padding, hide mouse
  while typing toggle, cursor text and bold color in Color Overrides
- Cursor section: cursor opacity NumberField
- Advanced section: word separators text input
- Search entries added for all new controls
- terminalDividerColorDark/Light and terminalInactivePaneOpacity skipped —
  already present in Theme and Pane Styling sections respectively
Register terminal.onData → cursor:none and mousemove → restore, scoped to
the pane container element. Uses the existing IDisposable per-pane pattern
(same as selectionDisposablesRef). Cleans up on pane close and effect teardown.
@mralexsaavedra
mralexsaavedra force-pushed the feat/958-ghostty-import branch from 6378ea6 to 88e3034 Compare April 25, 2026 06:59
@nwparker

Copy link
Copy Markdown
Contributor

@mralexsaavedra LMK when ready and I'll take a look!

@nwparker nwparker added the size/xl Extra large PR (>2500 added lines or >50 files) label Apr 26, 2026
- Centralize GhosttyImportPreview type in shared/types (remove duplicate from mapper)
- Fix parser to strip inline comments without breaking hex color values (#1a1a1a)
- Extract HEX_COLOR_RE to shared/color-validation to avoid duplication
- Remove redundant Number.isNaN checks after Number.isFinite (4 sites)
- Replace unsafe catch-all assignment with explicit font-family branch
- Migrate 280-line if-chain in mapGhosttyToOrca to FIELD_PARSERS registry
- Add human-readable setting labels in GhosttyImportModal via setting-labels map
- Add clarifying comment in index.ts re JSON.stringify undefined behavior
- Surface readFile errors in GhosttyImportPreview.error instead of
  showing misleading 'No config found' on permission denied
- Guard handleApply against double-apply when already applied
- Strip surrounding quotes from parsed config values (font-family)
- Return null from palette handler when all entries fail validation
- Inform user when background-blur-radius radius is not preserved
- Add valuesEqual key-order stability via stableStringify
- Normalize hex colors to #-prefixed format across all color mappers
- Reject blank values before numeric parsing (Number('') === 0 trap)
- Remove selection-word-chars mapping (inverted xterm semantics)
- Guard window-padding-x/y against negative integers
- Reactive mouse-hide-while-typing on existing panes when setting toggles
- Merge terminalColorOverrides on import instead of replacing
@mralexsaavedra

Copy link
Copy Markdown
Contributor Author

@nwparker Ready for review! Pushed a few extra commits on top of the original implementation addressing some code quality issues — type deduplication, inline comment parsing fix, centralized hex color validation, refactored the mapper's if-chain to a parser registry, and a handful of correctness fixes (color overrides merge, blank numeric values, quoted string values, reactive mouse-hide on existing panes, etc.). All 275 tests passing. 🟢

…r blur

Review found three high-impact issues in the Ghostty import: scrollback-limit
semantics are inverted/rescaled (Ghostty is bytes with 0=unlimited, xterm is
rows with 0=disabled), and window-padding-color + window-padding-balance set
CSS custom properties (--pane-padding-color, --pane-padding-balance) that
have no consuming rule anywhere in the tree — so users confirming "changes"
to those keys would see nothing happen.

Because none of the three keys have a safe mapping today, drop them from the
import and remove the dead UI controls + GlobalSettings fields + CSS var
plumbing. The mapper now lists them as unsupportedKeys alongside the
existing window-decoration / keybind / custom-shader entries.

Other fixes in the same review:

- allowTransparency now clears when background-opacity returns to 1 (prior
  code only ever set it to true, leaving a stale flag with measurable render
  cost).
- background-blur-radius = 0 no longer emits a misleading "radius value not
  preserved" note (0 cleanly maps to blur=false with no radius to lose).
- Add a 1 MB size cap on the config read so a pathological or symlinked file
  cannot OOM the main process.
- Make handleApply async and surface IPC errors inline in the modal instead
  of flipping straight to "Import complete" on failure.
- Type settings.previewGhosttyImport as Promise<GhosttyImportPreview> in
  preload so shape drift is caught at compile time.
- Make stableStringify recursive so future nested settings round-trip
  cleanly through valuesEqual.
- Restrict window-padding-x/y and background-blur-radius to decimal ints;
  prior code accepted exponent notation (1e10 sails through Number.isInteger)
  and would have landed absurd values in the store.
- Window blur now shows a "Restart required" banner with a Restart now
  button when the setting differs from the mount-time snapshot, mirroring
  the ExperimentalPane daemon pattern. Blur only applies at BrowserWindow
  creation on macOS/Windows.

Co-authored-by: Orca <help@stably.ai>
@nwparker

Copy link
Copy Markdown
Contributor

Did a correctness/reliability/security review of this PR and pushed a follow-up commit (72ec033) with fixes. Author is welcome to squash or amend — I kept it as a separate commit so the rationale is easy to review independently.

Findings that turned into code changes

  1. scrollback-limit, window-padding-color, window-padding-balance import paths are broken. Ghostty's scrollback-limit is a byte budget where 0 = unlimited; xterm's scrollback is a line count where 0 = disabled — importing a 10000000 byte value lands 10M lines in the buffer (huge memory hit) and 0 disables scrollback outright. The two window-padding-* keys set CSS custom properties (--pane-padding-color, --pane-padding-balance) that no rule in the tree consumes, so confirming "changes" on those keys was a silent no-op. Since none of the three had a safe mapping, I dropped them from the mapper, removed the dead UI controls from TerminalWindowSection, removed the GlobalSettings fields, and pulled the dead CSS var plumbing from pane-divider.ts.

  2. allowTransparency only ever got set to true in terminal-appearance.ts — a user who lowered background opacity and then reset it to 1 would keep paying the render cost permanently. Now explicitly tracks opacity and toggles both directions.

  3. background-blur-radius = 0 emitted a misleading "radius value not preserved" note, even though 0 cleanly maps to blur: false with no radius to lose. Note is now gated on true.

  4. No size cap on the config read. A symlinked or pathological file would be pulled into the main process. Added a 1 MB cap with a stat precheck that surfaces a clear error.

  5. Apply-path silently claimed success on IPC failure. handleApply now awaits updateSettings and the modal renders an inline error instead of flipping straight to "Import complete." (Note: the zustand store's updateSettings currently swallows its own errors internally — pre-existing behavior, out of scope here.)

  6. Preload typed the result as Promise<unknown>, bypassing the compile-time contract. Now Promise<GhosttyImportPreview>; the matching api-types.d.ts entry was already correct.

  7. stableStringify only sorted the top level — would spuriously flag nested-object settings as changed even when identical. Made it recursive so future nested settings round-trip cleanly through valuesEqual. Arrays preserve order (meaningful for list settings).

  8. Numeric parsers accepted exponent notation. Number("1e10") is finite and an integer, so a Ghostty config with window-padding-x = 1e9 would have landed an absurd value in the store. Added parseStrictInt (matches /^-?\d+$/) and tightened window-padding-x/y (cap 512) and background-blur-radius.

  9. Window blur silently requires a restart. Blur is only applied at BrowserWindow creation, so toggling the setting does nothing until the user restarts. Added a "Restart required" banner with a "Restart now" button — same pattern as ExperimentalPane's daemon toggle. The snapshot is taken at component mount, so toggling then toggling back hides the banner.

Dropped scope (per discussion with reviewer)

  • Multi-valued Ghostty key fallbacks (e.g. font-family fallback chains): only first value consumed; deferred.
  • Mouse-hide-while-typing refocus behavior: left as-is, matches Ghostty parity.
  • Parser # comment boundary test: parser matches Ghostty, skipped adding an explicit test.

Verification

  • pnpm typecheck — clean.
  • pnpm lint — clean (only 2 pre-existing warnings in unrelated files).
  • pnpm vitest run — 2828 pass. The 3 failures (2 files: pty.test.ts, terminal-attribution.test.ts) reproduce on main and are unrelated to this PR; matches what the PR description already notes.
  • Ghostty-specific test files (src/main/ghostty/**, useGhosttyImport, GhosttyImportModal, mouse-hide-while-typing, terminal-appearance) — 142/142 pass.

Diff: 17 files, +207 / -244.

Per review feedback: the "Import from Ghostty" row was taking its own slot
in the Terminal settings list alongside real configuration sections. Move
the trigger into the Terminal section's header (upper-right corner) as a
headerAction, next to the Terminal heading — it's a one-shot action, not a
setting.

- SettingsSection gains an optional `headerAction` slot rendered to the
  right of the section title/description.
- The useGhosttyImport hook is lifted from TerminalPane into Settings.tsx
  so the section header button (owned by Settings.tsx) and the modal
  (still rendered inside TerminalPane) share one state instance.
- TerminalPane drops its own "Import" section + the TERMINAL_GHOSTTY_IMPORT
  search entry group is no longer referenced there.
- Button carries the official Ghostty mark as a 16x16 icon so it reads
  clearly as a cross-app import even before users parse the label.

useGhosttyImport now accepts `GlobalSettings | null` so the parent can call
it above the pre-load spinner guard without violating hook ordering; the
apply path no-ops until settings arrive. Related test file updated to
pass the new `ghostty` prop and to assert the trigger is *not* rendered
inside TerminalPane anymore.

Co-authored-by: Orca <help@stably.ai>
@nwparker

Copy link
Copy Markdown
Contributor

Follow-up commit 62a4fa6 moves the Ghostty import trigger into the Terminal settings section header (upper-right corner) instead of taking its own row inside the settings list. The button now carries the Ghostty mark as a 16x16 icon.

Mechanics:

  • SettingsSection gains an optional headerAction slot (rendered right of the title/description).
  • useGhosttyImport is lifted from TerminalPane into Settings.tsx so the button (owned by Settings) and the modal (still in TerminalPane) share one state instance. The hook now accepts GlobalSettings | null so it can be called above the pre-load spinner guard without violating hook order.
  • TerminalPane's internal "Import" row and its TERMINAL_GHOSTTY_IMPORT_SEARCH_ENTRIES reference are gone.
  • resources/ghostty.svg added; imported the same way Landing.tsx imports logo.svg.
  • TerminalPane.ghostty.test.ts updated: new prop plumbing, and the first test inverts to assert the trigger is not rendered inside the pane anymore.

Verification: pnpm typecheck clean, pnpm lint clean (2 unrelated pre-existing warnings), 268/268 ghostty + settings + terminal-pane tests pass.

@nwparker
nwparker merged commit f5ad7aa into stablyai:main Apr 27, 2026
@mralexsaavedra

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review and the direct fixes, @nwparker! I really appreciate the catches on the OOM risks and the rendering performance—learned a lot from this one. Cheers!

@mralexsaavedra
mralexsaavedra deleted the feat/958-ghostty-import branch April 27, 2026 06:06
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…opacity and blur (stablyai#1001)

* feat(settings): add Ghostty config import

Add safe one-shot Ghostty import with preview and success summary,
and probe documented Ghostty config paths before applying changes.

Refs stablyai#958

* chore(git): ignore atl artifacts

* feat(settings): map font-weight, cursor-blink and focus-follows-mouse from Ghostty

Adds three safe direct-mapping Ghostty keys that have clear equivalents
in GlobalSettings: font-weight, cursor-style-blink, and focus-follows-mouse.

Refs stablyai#958

* feat(settings): expand Ghostty import to support colors, opacity and option-as-alt

- Add TerminalColorOverrides type grouping 21 optional xterm ITheme fields
- Add terminalBackgroundOpacity, terminalPanePaddingColor, terminalPaddingBalance
  to GlobalSettings
- Extend parser to collect repeated keys as string[] (needed for palette lines)
- Map background-opacity, background, foreground, cursor-color,
  selection-background/foreground, palette (0-15), window-padding-color,
  window-padding-balance, macos-option-as-alt in mapper
- Merge terminalColorOverrides into xterm ITheme at theme resolution; apply
  opacity as rgba() with allowTransparency enabled
- Accept hex colors with or without leading # (Ghostty omits it)
- Fix preview diff to use deep equality for object values so already-applied
  color overrides no longer reappear on next import

* feat(settings): support background-blur-radius and window-padding-color extend in Ghostty import

- Map background-blur-radius > 0 to windowBackgroundBlur: true; apply
  vibrancy on macOS and backgroundMaterial acrylic on Windows at window
  creation (blur requires restart — no hot-reload IPC exists)
- Accept window-padding-color = extend/background as valid Ghostty values;
  both map to default Orca padding behavior (undefined field) instead of
  landing in unsupportedKeys
- Split mapper.test.ts into domain-scoped describes to stay under 300-line limit

* feat(settings): add Window section to Terminal settings panel

Expose terminalBackgroundOpacity, windowBackgroundBlur, terminalPaddingBalance,
terminalPanePaddingColor, and terminalColorOverrides in the settings UI so
imported Ghostty values can be viewed and changed manually.

- New TerminalWindowSection component (extracted from TerminalPane to stay
  under the 400-line limit)
- Collapsible color overrides sub-section with ColorField for all 21 xterm
  ITheme fields grouped as base, ANSI normal, and ANSI bright
- Reset button clears all color overrides at once
- Window blur toggle shows restart-required note (blur applies at window
  creation, no hot-reload IPC exists)
- Search entries added for all new controls

* feat(settings): expand Ghostty import with scrollback, padding, divider, cursor and word-chars keys

Map 9 additional Ghostty keys to Orca settings:

- split-divider-color → terminalDividerColorDark + terminalDividerColorLight
  (single value applies to both; Ghostty has no dark/light distinction)
- unfocused-split-opacity → terminalInactivePaneOpacity (direct float 0-1)
- scrollback-limit → terminalScrollbackLimit; applied to xterm scrollback option
- window-padding-x / window-padding-y → terminalPaddingX/Y; applied as CSS
  vars --pane-padding-x / --pane-padding-y in terminal.css
- cursor-text → terminalColorOverrides.cursorAccent (xterm ITheme field)
- bold-color → terminalColorOverrides.bold (persisted; xterm ITheme has no
  bold field yet — stored for future xterm upgrade)
- cursor-opacity → terminalCursorOpacity; blended into cursor rgba at theme
  resolution time
- selection-word-chars → terminalWordSeparator; applied to xterm wordSeparator
- mouse-hide-while-typing → terminalMouseHideWhileTyping field added; renderer
  application deferred (needs per-pane disposable + global mousemove listener)

* feat(settings): expose new Ghostty-imported settings in Terminal Settings UI

- Window section: scrollback limit, horizontal/vertical padding, hide mouse
  while typing toggle, cursor text and bold color in Color Overrides
- Cursor section: cursor opacity NumberField
- Advanced section: word separators text input
- Search entries added for all new controls
- terminalDividerColorDark/Light and terminalInactivePaneOpacity skipped —
  already present in Theme and Pane Styling sections respectively

* feat(terminal): implement mouse-hide-while-typing per pane

Register terminal.onData → cursor:none and mousemove → restore, scoped to
the pane container element. Uses the existing IDisposable per-pane pattern
(same as selectionDisposablesRef). Cleans up on pane close and effect teardown.

* refactor(settings): address ghostty import code review findings

- Centralize GhosttyImportPreview type in shared/types (remove duplicate from mapper)
- Fix parser to strip inline comments without breaking hex color values (#1a1a1a)
- Extract HEX_COLOR_RE to shared/color-validation to avoid duplication
- Remove redundant Number.isNaN checks after Number.isFinite (4 sites)
- Replace unsafe catch-all assignment with explicit font-family branch
- Migrate 280-line if-chain in mapGhosttyToOrca to FIELD_PARSERS registry
- Add human-readable setting labels in GhosttyImportModal via setting-labels map
- Add clarifying comment in index.ts re JSON.stringify undefined behavior

* fix(settings): harden ghostty import from judgment-day review

- Surface readFile errors in GhosttyImportPreview.error instead of
  showing misleading 'No config found' on permission denied
- Guard handleApply against double-apply when already applied
- Strip surrounding quotes from parsed config values (font-family)
- Return null from palette handler when all entries fail validation
- Inform user when background-blur-radius radius is not preserved
- Add valuesEqual key-order stability via stableStringify
- Normalize hex colors to #-prefixed format across all color mappers
- Reject blank values before numeric parsing (Number('') === 0 trap)
- Remove selection-word-chars mapping (inverted xterm semantics)
- Guard window-padding-x/y against negative integers
- Reactive mouse-hide-while-typing on existing panes when setting toggles
- Merge terminalColorOverrides on import instead of replacing

* fix(ghostty): drop broken imports, tighten parsing, prompt restart for blur

Review found three high-impact issues in the Ghostty import: scrollback-limit
semantics are inverted/rescaled (Ghostty is bytes with 0=unlimited, xterm is
rows with 0=disabled), and window-padding-color + window-padding-balance set
CSS custom properties (--pane-padding-color, --pane-padding-balance) that
have no consuming rule anywhere in the tree — so users confirming "changes"
to those keys would see nothing happen.

Because none of the three keys have a safe mapping today, drop them from the
import and remove the dead UI controls + GlobalSettings fields + CSS var
plumbing. The mapper now lists them as unsupportedKeys alongside the
existing window-decoration / keybind / custom-shader entries.

Other fixes in the same review:

- allowTransparency now clears when background-opacity returns to 1 (prior
  code only ever set it to true, leaving a stale flag with measurable render
  cost).
- background-blur-radius = 0 no longer emits a misleading "radius value not
  preserved" note (0 cleanly maps to blur=false with no radius to lose).
- Add a 1 MB size cap on the config read so a pathological or symlinked file
  cannot OOM the main process.
- Make handleApply async and surface IPC errors inline in the modal instead
  of flipping straight to "Import complete" on failure.
- Type settings.previewGhosttyImport as Promise<GhosttyImportPreview> in
  preload so shape drift is caught at compile time.
- Make stableStringify recursive so future nested settings round-trip
  cleanly through valuesEqual.
- Restrict window-padding-x/y and background-blur-radius to decimal ints;
  prior code accepted exponent notation (1e10 sails through Number.isInteger)
  and would have landed absurd values in the store.
- Window blur now shows a "Restart required" banner with a Restart now
  button when the setting differs from the mount-time snapshot, mirroring
  the ExperimentalPane daemon pattern. Blur only applies at BrowserWindow
  creation on macOS/Windows.

Co-authored-by: Orca <help@stably.ai>

* feat(settings): move Ghostty import trigger to Terminal section header

Per review feedback: the "Import from Ghostty" row was taking its own slot
in the Terminal settings list alongside real configuration sections. Move
the trigger into the Terminal section's header (upper-right corner) as a
headerAction, next to the Terminal heading — it's a one-shot action, not a
setting.

- SettingsSection gains an optional `headerAction` slot rendered to the
  right of the section title/description.
- The useGhosttyImport hook is lifted from TerminalPane into Settings.tsx
  so the section header button (owned by Settings.tsx) and the modal
  (still rendered inside TerminalPane) share one state instance.
- TerminalPane drops its own "Import" section + the TERMINAL_GHOSTTY_IMPORT
  search entry group is no longer referenced there.
- Button carries the official Ghostty mark as a 16x16 icon so it reads
  clearly as a cross-app import even before users parse the label.

useGhosttyImport now accepts `GlobalSettings | null` so the parent can call
it above the pre-load spinner guard without violating hook ordering; the
apply path no-ops until settings arrive. Related test file updated to
pass the new `ghostty` prop and to assert the trigger is *not* rendered
inside TerminalPane anymore.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl Extra large PR (>2500 added lines or >50 files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Easily import Ghostty configs

4 participants