Separate pane background from tab chrome

Merged
LA
7mo ago
+1298-151

Adds an optional pane background color so embedders can keep tab chrome themed without repainting terminal panes underneath their own renderer.


Summary by cubic

Separates the pane background from the tab chrome and adds fully configurable split action buttons with host‑defined actions. Softens the split‑button backdrop with finer fade control and new content occlusion to keep contrast without heavy visuals.

  • New Features

    • New appearance.chromeColors.paneBackgroundHex; falls back to backgroundHex when unset.
    • New appearance.chromeColors.tabBarBackgroundHex and splitButtonBackdropHex for finer surface control.
    • Configurable split buttons via appearance.splitButtons; duplicate ids are ignored. Icons support SF Symbols, emoji (with scale), or image data; auto‑detects template SVGs and caches images.
    • New APIs for host actions: BonsplitController.requestCustomAction(_:inPane:) and BonsplitDelegate.splitTabBar(_:didRequestCustomAction:inPane:).
    • New appearance.splitButtonBackdropEffect (and splitButtonBackdropStyle) to set fade width, content fade width, solid width, ramp start, leading/trailing opacity, content occlusion fraction, and whether tab content is masked. Backdrops paint when any split‑backdrop, tab‑bar, or chrome background is customized; defaults are softened for a subtler fade.
    • Trailing inset now matches the configured button count; minimal mode doesn’t reserve space.
    • Double‑clicking empty trailing space triggers the first newTerminal button if present; otherwise no‑op.
    • Host‑controlled pane tab shortcuts via BonsplitController.tabShortcutHintsEnabled.
  • Bug Fixes

    • Added a precomposited, opaque backdrop option matching the pane background to avoid double‑compositing artifacts.

Summary by CodeRabbit

  • New Features

    • Fully configurable tab-bar split buttons (reorderable, system image/emoji/image-data icons, per-button tooltips) and public APIs to request/handle host-defined custom actions.
    • New appearance properties and public color accessors for tab bar, pane background, and split-button backdrop; split-button backdrop style/effect options.
  • Improvements

    • Backdrop compositing with translucency and focus-aware alpha; pane/tab color resolution refined.
    • Dynamic trailing inset based on button count; improved hover, press animation, masking, and double-click behavior.
  • Tests

    • Expanded coverage for icons, image caching, hit-testing, double-clicks, spacing, and custom actions.