Skip to content

feat(overlay): transparent floating overlay surfaces for the Deck starter - #5

Merged
hellno merged 5 commits into
mainfrom
hellno/hover-overlay-window
Jun 10, 2026
Merged

feat(overlay): transparent floating overlay surfaces for the Deck starter#5
hellno merged 5 commits into
mainfrom
hellno/hover-overlay-window

Conversation

@hellno

@hellno hellno commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Adds a reusable floating-overlay primitive to the Deck starter behind --features overlay (macOS real window; Linux compile-only no-op): two small, genuinely-transparent always-on-top surfaces render together — a top-right frosted rail (generic job-status icons that pulse while running + three clickable hover/press buttons) and a bottom-center recording pill (record button toggled by click, or by space while Deck is focused, with a red pulse).

Each overlay window returns its view entity directly instead of wrapping it in gpui-component Root — which painted an opaque theme background (the old "dark box") — so the window stays transparent; a small objc2 bridge hardens the NSPanel so a click doesn't steal another app's keyboard focus (the only two unsafe blocks, both in harden.rs).

It reuses the existing macOS objc2 stack and surfaces raw-window-handle (already in the tree via gpui — no new compiled crate), extends the justfile + CI to the default/tray/overlay/tray,overlay clippy + test matrix, and lands the design docs (docs/overlay.md, docs/background-jobs.md).

just ci is green across the full matrix (clippy on all four feature configs; 6 default + 15 overlay tests); the on-screen transparency/placement and the over-other-apps focus behavior still want a manual macOS GUI run.

hellno added 5 commits June 9, 2026 17:58
…lay)

Add a reusable always-on-top overlay primitive to the starter, gated behind
--features overlay (macOS real window; Linux compile-only no-op). Two small,
genuinely-transparent surfaces render together: a top-right frosted rail (generic
job-status icons that pulse while running + 3 clickable hover/press buttons) and a
bottom-center recording pill (record button toggled by click, or by `space` while
Deck is focused, with a red pulse). Each window returns its view entity directly --
no gpui-component `Root` wrapper, which painted an opaque theme background (the old
"dark box") -- so the window stays transparent; an objc2 bridge hardens the NSPanel
so clicks don't steal another app's focus (the only 2 `unsafe` blocks, in harden.rs).

Reuses the existing macOS objc2 stack and surfaces raw-window-handle (already in the
tree via gpui -- no new compiled crate). justfile + CI gain the overlay clippy/test
matrix (default/tray/overlay/tray,overlay); docs/overlay.md carries the full design.
`DECK_OVERLAY=0|1` master-toggles it; `overlay_enabled` defaults true.
…l recipe

Redesign the bottom-center recording pill per maintainer feedback: drop the
blinking pulse for a steady solid red dot, and show a subtle light circular
button + an inline label (muted 'Start' -> bold 'Recording'). The whole pill is
the click target; the `space` toggle stays.

Fix the "double border": gpui keeps a macOS window shadow on transparent windows
(rounded *rectangle*, window-sized), which framed the `rounded_full` pill. Add a
`hide_shadow` flag to `harden_panel` and call `NSWindow::setHasShadow(false)` for
the pill window so it floats frameless on its own `shadow_lg`; the rail keeps its
window shadow (its `rounded_xl` matches the window rect). No new `unsafe` (reuses
the existing NSPanel bridge); count stays 2.

Document the whole pattern in docs/LEARNINGS.md \xc2\xa718 (transparent PopUp, no Root
wrapper, the setHasShadow knob, setBecomesKeyOnlyIfNeeded) so forks have the
recipe.
@hellno
hellno merged commit 50ec1a9 into main Jun 10, 2026
0 of 3 checks passed
@hellno
hellno deleted the hellno/hover-overlay-window branch June 11, 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