Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[profile.default]
test-threads = 6
slow-timeout = { period = "60s", terminate-after = 2 }
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,33 @@ that do not use them.

### Added

- Added retained GPU canvases for editor, visualization, game/map and scientific
viewports. `Element::gpu_canvas`, `GpuCanvasSpec` and the renderer-neutral
`CustomPaintContext::gpu_canvas` helper preserve normal Argui layout,
transforms, clipping, rounded corners, opacity, effects, overlays,
interaction, accessibility, multi-window surfaces and native popups.
- Added `GpuCanvasRegistration`, `GpuCanvasRegistry`, `GpuCanvasFactory`,
`GpuCanvasRenderer` and private-field device/render contexts, plus the exact
`argui::render::wgpu` re-export. Callbacks can create resources from Argui's
selected device, perform queue writes, and encode compute/render/copy work
into a borrowed offscreen target. Argui remains the owner of backend
selection, surface acquisition, command submission and presentation.
- Added explicit content-revision and resize/DPI caching with a configurable,
bounded per-surface texture budget. Paused or unchanged canvases avoid custom
GPU callbacks. Required/optional WGPU features and direction-aware limits are
negotiated before device creation, including every Windows fallback attempt;
incompatible shared devices fail clearly. Recoverable frame errors use a
visible placeholder and deduplicated failure/recovery runtime events instead
of aborting surrounding UI. Profiles, inspector traces and DevTools report
canvas cache, render, hit, failure, byte and CPU-encode statistics.
- Added native and WebAssembly/WebGPU support plus the product-shaped
**GPU Canvas Lab** in `app_examples/gpu-canvas`. It demonstrates an Argui
toolbar and inspector around custom WGPU compute and render passes, pan/zoom,
pause/resume, keyboard alternatives, overlays, an effect layer, resize/HiDPI,
bounded particles and in-app simulated failure recovery.
- Published a release-built WebAssembly version of the GPU Canvas Lab on the
website's App Examples page, with build/copy validation and a responsive
compact layout for narrow viewports.
- Added inherited text-selection highlight styling with solid or gradient fills,
per-corner radii and an interactive Widget Gallery page.
- Added default-on Windows renderer fallback from DirectX 12 DirectComposition
Expand All @@ -21,6 +48,19 @@ that do not use them.

### Fixed

- Cleared workspace crate artifacts and the temporary crates.io registry before
archive checks, preventing same-version caches from masking coordinated
workspace changes and breaking dependent archive verification.
- Used an operating-system lock for coverage runs so a cached lock file from a
cancelled CI job cannot block the next quality check.
- Limited individual Nextest cases to two minutes so a stalled native test is
reported by name instead of consuming the full CI job timeout.
- Stopped hidden or minimized GTK windows from keeping the event loop in a
permanent redraw poll, and queued synthetic lifecycle input through its GDK
window instead of re-entering the renderer from a GTK signal callback.
- Kept embedded GPU canvases renderable beneath the website loading overlay so
Chromium can initialize WebGPU and emit its ready signal instead of stalling
a hidden iframe.
- Prevented Web canvases from taking focus and moving an embedding page while
they load; full-page apps can opt in through `WindowConfig::focus_on_launch`.
- Kept Winit's AppKit content view attached when enabling the macOS desktop
Expand All @@ -34,9 +74,25 @@ that do not use them.

### Changed

- Made vertical canvas dragging follow the content by default, added an
in-app natural/inverted direction toggle, aligned keyboard panning with the
selected direction and smoothed wheel/pinch zoom interaction.
- Advanced strict DevTools GPU-trace JSON to `argui-gpu-trace-v4` so exported
frames include GPU-canvas cache, byte, render, hit, failure and CPU-encode
metrics; older strict trace versions remain rejected on import.
- Made the base release gallery the recommended local command. Optional native
integrations can still be enabled individually or together when needed.

### Known limitations

- GPU canvases use Argui-owned WGPU instances, devices, queues and surfaces;
the high-level runtime still does not accept externally owned GPU objects.
- Canvas pixels have no automatic semantic meaning. Applications must provide
labels, keyboard controls and semantic Argui overlays for important actions.
- Canvas profiling measures cache behavior and CPU encoding time, not the
duration of application-authored GPU passes; applications may encode their
own supported timestamp queries when needed.

## [0.2.1] - 2026-09-14

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ WebAssembly and the opt-in Android/iOS shells.
- **Responsive by design.** Flex and grid layout, light and dark themes, animation and virtualized lists.
- **Accessible controls.** Keyboard navigation, focus, text editing, native AccessKit integration and browser semantics.
- **GPU effects.** Custom WGSL shaders, gradients, shadows, blur and liquid glass.
- **Retained GPU canvases.** Embed bounded application WGPU compute/render viewports while Argui preserves layout, clipping, effects, input and presentation.
- **Native integrations.** Multiple windows, file pickers, trays, WebViews and popovers that can extend beyond the window on supported backends.
- **Optional updates.** A signed update engine with a separate, reusable progress dialog.
- **Inspect as you build.** Element inspection, live styles, theme editing and profiling through optional DevTools.
Expand All @@ -80,6 +81,7 @@ for workloads, memory figures and reproduction commands.
- [x] Text shaping, editing, selection, bidirectional text and IME input
- [x] Mouse, touch, keyboard, focus and accessible semantics
- [x] Light/dark themes, animation, images, SVG and custom WGSL effects
- [x] Retained custom WGPU canvases with native and WebAssembly/WebGPU support
- [x] Fluent localization through the optional `i18n` feature
- [x] State-preserving Subsecond patches through the optional `hot-reload` feature
- [x] Optional DevTools, file picker, updater, WebView, tray, native popovers and desktop backdrop
Expand Down
8 changes: 8 additions & 0 deletions app_examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app_examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["docs-examples", "fake-ai-harness"]
members = ["docs-examples", "fake-ai-harness", "gpu-canvas"]
resolver = "3"

[workspace.package]
Expand Down
4 changes: 4 additions & 0 deletions app_examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ packages and dependency graphs do not include them.
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [Fake AI Harness](fake-ai-harness/) | A bundled adaptation of Wikipedia's Large language model article streams 6,000 simulated tokens at 1,000 tokens/s through a responsive VList. |
| [Documentation examples](docs-examples/) | Seventeen exact-source applications compiled into the interactive learning site. Each guide displays the Rust module it actually runs. |
| [GPU Canvas Lab](gpu-canvas/) | A retained WGPU compute/render viewport with Argui controls, pan/zoom, pause, overlays, effects, diagnostics, native and WebAssembly builds. |

Run an application from the repository root:

```sh
cargo run --manifest-path app_examples/Cargo.toml -p argui-example-ai-harness
```

GPU Canvas Lab has its own native and browser commands in its
[README](gpu-canvas/README.md).
21 changes: 21 additions & 0 deletions app_examples/gpu-canvas/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "argui-example-gpu-canvas"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish = false
description = "A retained custom WGPU canvas inside an accessible Argui application shell"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
argui = { workspace = true, features = ["widget-button"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen.workspace = true

[lints]
workspace = true
53 changes: 53 additions & 0 deletions app_examples/gpu-canvas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# GPU Canvas Lab

GPU Canvas Lab is a complete Argui application shell around one retained custom
WGPU viewport. The toolbar, inspector, focus handling, gestures, keyboard
commands, rounded clipping, effect layer, and status overlay are ordinary Argui
UI. The canvas callback uses Argui's exact WGPU re-export to run a bounded
256-particle compute pass and then a grid/particle render pass into the
Argui-owned offscreen target.

The example exercises the public API boundary directly. Its factory receives a
`GpuCanvasDeviceContext` and uses the exposed `wgpu::Device`, target format,
limits, and device generation to allocate buffers and pipelines. Every render
callback receives a `GpuCanvasRenderContext`, writes through its queue, and
encodes compute and render passes through its command encoder and target view.
The application deliberately never submits or presents; Argui owns those steps.

The model and renderer share a short-lived `RwLock` snapshot. Each pan, zoom,
or reset updates a camera destination, then animation ticks smoothly interpolate
the visible view and advance an explicit content revision. The callback copies
the snapshot, releases the lock, writes its uniform buffer, and encodes work.
While paused and with the camera settled, the model requests no animation
frames, the revision stays fixed, and unrelated Argui redraws reuse the retained
texture without invoking the callback.

Run the native release build from the repository root:

```sh
cargo run --release --manifest-path app_examples/Cargo.toml \
-p argui-example-gpu-canvas
```

Check the WebAssembly target:

```sh
cargo check --manifest-path app_examples/Cargo.toml \
-p argui-example-gpu-canvas --target wasm32-unknown-unknown
```

Build the browser package with the repository-pinned `wasm-pack` 0.15.0, copy
the generated package beside the supplied page, and serve it over HTTP:

```sh
wasm-pack build app_examples/gpu-canvas --target web --release \
--out-dir web/pkg
python3 -m http.server --directory app_examples/gpu-canvas/web 8000
```

Open `http://localhost:8000` in a WebGPU-capable browser. Drag or use arrow keys
to pan; use the wheel, pinch, or `+`/`-` to zoom; press `0` to reset and Space to
pause/resume. Vertical dragging follows the pointer by default; “Drag Y” switches
between natural and inverted modes. “Test recovery” exercises the visible
placeholder and runtime diagnostic path; “Recover canvas” advances the revision
and retries.
Loading
Loading