Skip to content

feat(native): wire UI primitive, overlay, and scrollbar THEME_CSS_HOOKS slots (Part of #457) - #469

Merged
rynfar merged 2 commits into
nativefrom
swarm-h4b-primitives-overlays-27842b3f
Nov 20, 2026
Merged

rynfar merged 2 commits into
nativefrom
swarm-h4b-primitives-overlays-27842b3f

Conversation

@rynfar

@rynfar rynfar commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Part of #457 (Wave H4B Part 3).

Problem

After the THEME_CSS_HOOKS slot parser, compiler, and GPUI ThemeSlot engine landed in #467, the 10 UI primitive, overlay, and scrollbar slots (button, input, switch, select-trigger, dialog-popup, popover-popup, menu-popup, tooltip-popup, scroll-area-scrollbar, scroll-area-thumb) still needed live wiring across ThemeConfig and GPUI primitives/overlays.

Summary

  • theme/mod.rs & theme/slots.rs:
    • Mapped compiled ThemeSlot::ScrollAreaScrollbar (background/opacity/display: none), ThemeSlot::ScrollAreaThumb (base & :hover), and ThemeSlot::Input (border-color/solid background) into ThemeConfig ("scrollbar.background", "scrollbar.thumb.background", "scrollbar.thumb.hover.background", "input.border") on apply, boot, and live preview so all gpui-component overlay scrollbars and Input widgets restyle live.
    • Added zero-allocation slot query helpers (slot_has_hover, slot_has_active, slot_has_background, slot_border_color) and theme_slot_clipped_background_layer so containers with overflowing submenus or scrollable lists clip scoped --theme-background-image layers without breaking children.
  • UI primitives & overlays (composing :hover/:active via refine_slot_hover/refine_slot_active inside existing closures with zero duplicate .hover()/.active() calls, and suppressing glass::backdrop only when a slot sets a custom background):
    • settings/controls.rs: Button (Button), Switch (Switch), Select trigger (SelectTrigger) + popup (PopoverPopup/MenuPopup), tooltip (TooltipPopup), DialogFrame (DialogPopup + background layer).
    • right_panel/controls.rs: Button (Button), tooltip_view (TooltipPopup, also shared by thread_details).
    • composer/controls.rs: ComposerControl & Button (Button), tooltip (TooltipPopup), menu_surface (MenuPopup), popup_surface (PopoverPopup).
    • thread_details/controls.rs: Row (Button / SelectTrigger for chevron rows) & MenuTrigger (Button).
    • dialog.rs: ConfirmDialog card (DialogPopup + background layer) & footer buttons (Button).
    • context_menu.rs: ContextMenu::panel (MenuPopup + clipped background layer preserving overflowing submenus).
    • palette/mod.rs: CommandPalette card (DialogPopup + background layer), back button (Button), and search Input (Input).
  • apps/native/parity/LEDGER.md: Updated ST-APPEARANCE and AP-THEME Native notes to reflect all 29 THEME_CSS_HOOKS selectors compiling into live GPUI StyleRefinement overrides (keeping non-hook DOM selectors & getComputedStyle inspector noted as [D]/DOM n/a).

Verification

  1. vp fmt --check apps/native/parity/LEDGER.md: PASS
  2. node apps/native/scripts/gen-theme.ts --check: PASS
  3. node apps/native/conformance/generate.ts --check: PASS
  4. node --test apps/native/parity/sync.test.ts: 47 passed, 0 failed
  5. CARGO_INCREMENTAL=0 cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings: PASS (0 warnings)
  6. CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-core: 1,902 passed (1,894 unit + 8 integration), 0 failed
  7. CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-client -- --test-threads=1: 171 passed, 0 failed
  8. T3_NATIVE_HOME=$(mktemp -d) CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-native -- --test-threads=1: 234 passed, 0 failed
  9. Targeted --features snapshot tests: theme (15/15), dialog (21/21), context_menu::project_filter_tests (3/3), palette (16/16), right_panel (13/13), settings (72/72), composer::controls (1/1), thread_details (11/11) — 152/152 passed (note: 2 pre-existing HeadlessAppContext AppState teardown leaks remain in untouched context_menu/thread_menu_tests.rs).
  10. CARGO_INCREMENTAL=0 cargo build --manifest-path apps/native/Cargo.toml -p t3-native: PASS

@rynfar
rynfar merged commit 68729fe into native Nov 20, 2026
@rynfar
rynfar deleted the swarm-h4b-primitives-overlays-27842b3f branch November 20, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant