You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ix-windows: floating blurred overlays that auto-size to content (#1327)
## What
Reworks `ix-windows` from tiled borderless webview windows into
floating, blurred **overlay** cards that auto-size to their content. No
tiling, no layout manager.
- **Blur behind.** Each window paints its transparent `wry` webview on
top of a native `NSVisualEffectView` (behind-window blur, `HUDWindow`
material), inserted as the content view's first subview with a rounded,
shadowed layer. The rendered HTML sits on top.
- **Auto-size to content.** A page `ResizeObserver` measures the
`#ix-root` panel and posts its pixel size over `wry`'s IPC channel; the
new `UserEvent::Resize` drives `WindowManager::resize`, which fits the
OS window (clamped to the monitor, 1px hysteresis to break any reflow
loop). The panel is `inline-block`/`max-width` so its intrinsic size
doesn't depend on window width.
- **Floating overlay.** Windows are transparent + borderless +
always-on-top, and join all spaces / float over fullscreen apps
(`NSWindowCollectionBehavior`).
## Why
The previous behavior relied on an external tiling WM (aerospace/yabai
rules) to lay windows out. This makes each resource a self-contained,
self-sizing HUD overlay instead.
## Validation
- `nix build .#ix-windows` passes (darwin).
- New `parse_size` unit test; existing `shell`/`escape_text` tests
retained. Window/webview/blur paths need a display and are exercised
manually.
- Docs + README updated (`docs/ix-windows/overview.md`).
🤖 Drafted with Claude Code (Opus).
<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
> [!NOTE]
> ### Add floating blurred overlay windows with auto-size to content in
ix-windows
> - Windows are now always-on-top transparent overlays instead of
borderless square windows, with initial size reduced to 480x300 and
position cascade adjusted.
> - A `ResizeObserver`-based script
([MEASURE_JS](https://github.com/indexable-inc/index/pull/1327/files#diff-1e1abdcf7151daee9cdb984d29eca28bda3ded2eaa1b78937674b8156ef55a43))
measures the `#ix-root` panel and reports pixel dimensions to the native
layer via wry IPC, driving `WindowManager::resize` to clamp and apply
the new size against monitor bounds.
> - On macOS, `install_blur()` uses `objc2-app-kit` to insert an
`NSVisualEffectView` beneath the webview and sets collection behavior to
float across spaces and over fullscreen apps.
> - A new `UserEvent` enum wraps both producer stream events and
`Resize` reports; `main.rs` forwards producer events as
`UserEvent::Producer` and dispatches `UserEvent::Resize` to
`WindowManager::resize`.
> - `parse_size` strictly validates IPC size messages, rejecting
non-finite or non-positive values to avoid panics during clamping.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized
1895a3e.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- macroscope-ui-refresh -->
<!-- Macroscope's pull request summary ends here -->
Copy file name to clipboardExpand all lines: docs/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ From-source documentation for the packages in the `index` repo (a shared, open-s
50
50
|[ix-dev-diagnose](ix-dev-diagnose/overview.md)|`packages/ix-dev-diagnose` probes `https://ix.dev/` (or any HTTPS URL) from the caller's network path and writes a single JSON diagnostic capturing every layer of the request: system DNS... |
51
51
|[ix-fleet](ix-fleet/overview.md)|`packages/ix-fleet` renders and executes declarative **fleet plans**: a single JSON document describes a set of remote ix VMs (nodes) and their images, NixOS switch targets, east-west gro... |
52
52
|[ix-sdk-python](ix-sdk-python/overview.md)|`packages/ix-sdk-python` is the Nix package that makes the precompiled Python SDK bindings available in-repo as `pkgs.ix-sdk-python` / `nix build .#ix-sdk-python`. |
53
-
|[ix-windows](ix-windows/overview.md)|`packages/ix-windows` renders each live MCP resource as its own borderless, square, ghostty-styled native webview window. |
53
+
|[ix-windows](ix-windows/overview.md)|`packages/ix-windows` renders each live MCP resource as its own floating, blurred overlay webview window that auto-sizes to its content. |
54
54
|[kitty](kitty/overview.md)|`packages/kitty` is an encoder for the kitty terminal graphics protocol: it turns image bytes into the `APC _G ... |
55
55
|[lake](lake/overview.md)|`packages/lake` (member `lake/iceberg`, crate `lake-iceberg`) is the Iceberg corpus lake: the durable, replayable log under the multi-source search corpus (issue #752), succeeding the ful... |
56
56
|[launchk](launchk/overview.md)|`packages/launchk` builds launchk, a cursive (Rust TUI) tool for observing launchd agents and daemons, from source. |
`clap`, `tao`, `wry`, `tokio`, `serde_json`; on macOS also `objc2` +
26
-
`objc2-foundation` + `objc2-web-kit` for the WebKit/window tuning
27
-
(`Cargo.toml:31`).
27
+
`objc2-app-kit` + `objc2-foundation` + `objc2-web-kit` for the native blur and
28
+
WebKit tuning.
28
29
29
30
```
30
31
nix run .#ix-windows # watch the default discovery dir
@@ -34,111 +35,126 @@ nix build .#ix-windows
34
35
35
36
**Darwin-only flake output.**`wry` links the system WebKit framework on macOS;
36
37
Linux (WebKitGTK) is a later add, so `default.nix` restricts `meta.platforms` to
37
-
`aarch64-darwin` and `x86_64-darwin` (`packages/ix-windows/default.nix:11`). The
38
-
macOS WebKit tuning (`src/lib.rs:294`) is behind `#[cfg(target_os = "macos")]`,
39
-
so the crate still compiles on other targets, just without that tuning.
38
+
`aarch64-darwin` and `x86_64-darwin`. The native blur and WebKit tuning are
39
+
behind `#[cfg(target_os = "macos")]`, so the crate still compiles on other
40
+
targets, just without that styling (no blur, no auto-resize is unaffected since
41
+
it is plain `tao`).
40
42
41
-
## CLI (`src/main.rs:22`)
43
+
## CLI (`src/main.rs`)
42
44
43
45
| flag | default | meaning |
44
46
| --- | --- | --- |
45
-
|`--dir`| discovery dir | producer-socket directory to watch, matching the `dashboard` aggregator. Defaults via [`discovery_dir`](../dashboard-core/overview.md#discovery-paths) (`main.rs:28`). |
46
-
|`--rescan-ms`|`500`| how often to rescan the directory for new/removed sockets (`main.rs:33`). |
47
+
|`--dir`| discovery dir | producer-socket directory to watch, matching the `dashboard` aggregator. Defaults via [`discovery_dir`](../dashboard-core/overview.md#discovery-paths). |
48
+
|`--rescan-ms`|`500`| how often to rescan the directory for new/removed sockets. |
47
49
48
-
## Threading model (`src/main.rs:37`)
50
+
## Threading model (`src/main.rs`)
49
51
50
52
Windows must be created and driven on the main thread (`tao`), but the
51
-
subscriber is async. The binary:
53
+
subscriber is async, and the page's measuring script also feeds events back. The
54
+
binary:
52
55
53
-
1. Builds a `tao``EventLoop` parameterized on `ProducerEvent` as its user-event
54
-
type, and a proxy (`main.rs:43`).
56
+
1. Builds a `tao``EventLoop` parameterized on [`UserEvent`] as its user-event
57
+
type, and a proxy. [`UserEvent`] wraps either a `ProducerEvent`
58
+
(`UserEvent::Producer`) or a content-size report (`UserEvent::Resize`).
55
59
2. Spawns a side thread running a multi-thread tokio runtime that calls
0 commit comments