BonitoSlate: live WGLMakie/Bonito over Slate's transport (issue #7) #9

Merged
kahliburke merged 9 commits from worktree-feat+bonito-support into main 2026-07-24 13:39:27 -07:00
kahliburke commented 2026-07-24 01:52:02 -07:00 (Migrated from github.com)

Closes #7 (Bonito/WGLMakie support).

Routes interactive Bonito.jl / WGLMakie figures over Slate's own per-notebook
transport (no extra port), including reliable browser-reload of live figures.
Ships as the BonitoSlate example extension on top of new core plumbing.

Core (affects all Slate users — additive, low-risk)

  • SlateExtensionsBase SDK: provide_served_asset!/served_asset (content-addressed
    byte serving), the slate_live_render trait, and on_live_reset/run_live_resets.
  • Serve extension assets once per page: hub route GET /n/{id}/served/{hash}
    (lazy worker fetch, cached, immutable) + worker/gate tools + a no-evict store.
  • Re-render live outputs on browser connect: retain a live cell's source
    (_LIVE_OUTPUTS), re-run it fresh per connect, deliver via a flat base64 gate
    return; page-serve swaps a live figure for a non-booting placeholder so a stale
    fragment never collides with the fresh re-render; one immortal per-notebook
    debouncer coalesces reload bursts. All of this no-ops for notebooks without
    slate_live_render outputs, and live_placeholder only rewrites bonito-fig-card.
  • Chart scroll-zoom gate + setting: wheel only zooms an active chart; sensitivity
    slider in Settings (covers ECharts too).
  • Theme: BonitoSlate follows use_slate_theme!() instead of forcing theme_dark().

BonitoSlate extension (experimental)

SlateConnection (Bonito frames over Slate's WS), SlateAssetServer (bundle served
once), figure card + served Bonito runtime, shared page-root for arbitrary figures.

Reliability status (honest)

  • Solid: open notebook → reload page (incl. rapid bursts) fills the live figure.
  • Known-rough (tracked follow-ups): editing a live cell in place, and repeated
    close+reopen cycles, can wedge the hub re-render until an extension restart. Scoped
    to the live-WGLMakie feature; ordinary notebooks are unaffected. WGLMakie itself is
    officially experimental and doesn't render the Axis3 box (see NOTES, not committed).

Integration & tests

Merged current origin/main (36 commits: cell actions, provide_assets!, ECharts fixes,
teardown-deadlock refactor, SlateAFM, …). Conflicts resolved in capture.jl,
server_complete.jl (kept origin's deadlock-safe teardown + re-added the live-rerender
stop), and the SEB test. Full suite: 4801 pass / 0 fail / 0 error.

Closes #7 (Bonito/WGLMakie support). Routes interactive **Bonito.jl / WGLMakie** figures over Slate's own per-notebook transport (no extra port), including reliable **browser-reload** of live figures. Ships as the `BonitoSlate` example extension on top of new core plumbing. ## Core (affects all Slate users — additive, low-risk) - **SlateExtensionsBase SDK:** `provide_served_asset!`/`served_asset` (content-addressed byte serving), the `slate_live_render` trait, and `on_live_reset`/`run_live_resets`. - **Serve extension assets once per page:** hub route `GET /n/{id}/served/{hash}` (lazy worker fetch, cached, immutable) + worker/gate tools + a no-evict store. - **Re-render live outputs on browser connect:** retain a live cell's source (`_LIVE_OUTPUTS`), re-run it fresh per connect, deliver via a flat base64 gate return; page-serve swaps a live figure for a non-booting placeholder so a stale fragment never collides with the fresh re-render; one immortal per-notebook debouncer coalesces reload bursts. All of this no-ops for notebooks without `slate_live_render` outputs, and `live_placeholder` only rewrites `bonito-fig-card`. - **Chart scroll-zoom gate + setting:** wheel only zooms an *active* chart; sensitivity slider in Settings (covers ECharts too). - Theme: BonitoSlate follows `use_slate_theme!()` instead of forcing `theme_dark()`. ## BonitoSlate extension (experimental) `SlateConnection` (Bonito frames over Slate's WS), `SlateAssetServer` (bundle served once), figure card + served Bonito runtime, shared page-root for arbitrary figures. ## Reliability status (honest) - **Solid:** open notebook → reload page (incl. rapid bursts) fills the live figure. - **Known-rough (tracked follow-ups):** editing a live cell in place, and repeated close+reopen cycles, can wedge the hub re-render until an extension restart. Scoped to the live-WGLMakie feature; ordinary notebooks are unaffected. WGLMakie itself is officially experimental and doesn't render the `Axis3` box (see NOTES, not committed). ## Integration & tests Merged current `origin/main` (36 commits: cell actions, `provide_assets!`, ECharts fixes, teardown-deadlock refactor, SlateAFM, …). Conflicts resolved in `capture.jl`, `server_complete.jl` (kept origin's deadlock-safe teardown + re-added the live-rerender stop), and the SEB test. **Full suite: 4801 pass / 0 fail / 0 error.**
Sign in to join this conversation.
No description provided.