diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eabdaec9..ea890f88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,6 +215,19 @@ jobs: run: sudo apt-get update && sudo apt-get install -y libx11-dev - name: Build and run the D test suite run: dub run --config=test --compiler=ldc2 + # code.dlang.org serves the repository by its root dub.json, which hands over to bindings/d: a project + # that depends on the root (as `dub add blenderui` makes it) must resolve it, build the kit and link. + - name: A project that depends on the repository's root recipe + shell: bash + working-directory: . + run: | + mkdir -p .ci-consumer/source + cat > .ci-consumer/dub.json <<'EOF' + { "name": "consumer", "targetType": "executable", "dependencies": { "blenderui": { "path": ".." } } } + EOF + printf 'import bui;\nvoid main() { auto r = BUI_KIT_VERSION_MAJOR; }\n' > .ci-consumer/source/app.d + cd .ci-consumer + dub build --compiler=ldc2 # bindings/go builds the C kit with cgo's compiler (gcc; MinGW on Windows) through # `go generate`, then runs the tests of both packages and the examples'. They are diff --git a/.github/workflows/extras.yml b/.github/workflows/extras.yml new file mode 100644 index 00000000..c99aace0 --- /dev/null +++ b/.github/workflows/extras.yml @@ -0,0 +1,119 @@ +# Extra checks that never hold back a release: release.yml runs ci.yml before it publishes, but not this +# file. A job here that is red tells you something to fix; it does not stop a tag from publishing. Once a +# job has been green for a while, move it into ci.yml to make it a gate. +# +# js the JavaScript packages' own tests (native, react, svelte, vue), which ci.yml does not run +# website the documentation website builds, and none of its internal links is broken +# lint cargo fmt and clippy (the warnings are counted in the run's summary, not failed on) +# rust-extras the demos and the addons (charts, panels) still compile + +name: extras + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +concurrency: + group: extras-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + js: + name: JavaScript packages (npm test) + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + - uses: oven-sh/setup-bun@v2 # the runtime tests build a Bun executable too (they skip it when Bun is missing) + continue-on-error: true + - uses: dtolnay/rust-toolchain@stable + - name: X11 headers and a virtual display + run: sudo apt-get update && sudo apt-get install -y libx11-dev xvfb + - name: Install workspace dependencies + working-directory: bindings + run: npm ci + - name: Build the Node.js addon + working-directory: bindings/node + run: npm run build + - name: Test every package + working-directory: bindings + run: xvfb-run -a npm test + + website: + name: website builds, links resolve + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Build + working-directory: website + run: | + bun install + bun run build + - name: Internal links + run: python tools/check_site_links.py + + lint: + name: cargo fmt and clippy + runs-on: ubuntu-latest + timeout-minutes: 60 + defaults: + run: + working-directory: bindings/rust + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + - name: X11 headers + run: sudo apt-get update && sudo apt-get install -y libx11-dev + # the code has its own layout (long lines), so rustfmt's default would rewrite thousands of + # places: its differences are counted, not failed on + - name: cargo fmt (counted, not failed on) + continue-on-error: true + run: | + cargo fmt --all -- --check 2>&1 | tee "$RUNNER_TEMP/fmt.log" || true + { + echo "### rustfmt" + echo + echo "differences: $(grep -c '^Diff in' "$RUNNER_TEMP/fmt.log" || true)" + } >> "$GITHUB_STEP_SUMMARY" + - name: cargo clippy (counted, not failed on) + continue-on-error: true + run: | + cargo clippy --workspace --all-targets 2>&1 | tee "$RUNNER_TEMP/clippy.log" + { + echo "### clippy" + echo + echo "warnings: $(grep -c '^warning' "$RUNNER_TEMP/clippy.log" || true)" + echo "errors: $(grep -c '^error' "$RUNNER_TEMP/clippy.log" || true)" + } >> "$GITHUB_STEP_SUMMARY" + + rust-extras: + name: demos and addons compile + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + dir: [demos, addons/bui-charts, addons/bui-panels] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: X11 headers + run: sudo apt-get update && sudo apt-get install -y libx11-dev + - name: cargo check + working-directory: ${{ matrix.dir }} + run: cargo check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80e55e97..ff3936ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,10 @@ # CARGO_REGISTRY_TOKEN a crates.io API token (scopes: publish-new, publish-update) # LUAROCKS_API_KEY a luarocks.org API key (luarocks.org > Settings > API keys), for the `luarocks` job # NUGET_USER the nuget.org profile name (not an e-mail) that owns BlenderUI, for the `nuget` job +# RUBYGEMS_OWNER_ID (a repository *variable*, not a secret) the id of the rubygems.org account that owns the +# pending trusted publisher of `blenderui`, for the `rubygems` job +# Without NUGET_USER or the RubyGems trusted publisher those two jobs build their package and warn instead of failing. +# The `go-tag` job pushes the tag bindings/go/ that Go needs to find the module in its folder. # npm, PyPI and NuGet need no token: all three use trusted publishing (OIDC). On nuget.org # (user menu > Trusted Publishing), a policy names this repository and release.yml. On npmjs.com, each of # @blender-ui/native, its platform packages (@blender-ui/native-, bindings/node/platform.js) @@ -345,16 +349,114 @@ jobs: with: name: nupkg path: nupkg + # Without NUGET_USER the package is packed and checked but not pushed, with a warning, instead of + # failing the job (which would also skip the GitHub Release that waits for it). + - name: Is NuGet set up? + id: nuget + env: + NUGET_USER: ${{ secrets.NUGET_USER }} + run: | + if [ -n "$NUGET_USER" ]; then + echo "ready=true" >> "$GITHUB_OUTPUT" + else + echo "ready=false" >> "$GITHUB_OUTPUT" + echo "::warning::NUGET_USER is not set: BlenderUI was packed but not pushed (docs/publishing.md, 'NuGet')" + fi - name: NuGet login (OIDC, a one-hour API key) - if: env.PUBLISH == 'true' + if: env.PUBLISH == 'true' && steps.nuget.outputs.ready == 'true' id: login uses: NuGet/login@v1 with: user: ${{ secrets.NUGET_USER }} - name: Push (a version already on nuget.org is skipped) - if: env.PUBLISH == 'true' + if: env.PUBLISH == 'true' && steps.nuget.outputs.ready == 'true' run: dotnet nuget push "nupkg/*.nupkg" --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + rubygems: + name: RubyGems + needs: [versions, ci] + if: ${{ !cancelled() && needs.versions.result == 'success' && (needs.ci.result == 'success' || needs.ci.result == 'skipped') }} + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + id-token: write # the OIDC token RubyGems trusts + defaults: + run: + working-directory: bindings/ruby + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 # `rake gem` vendors the kit's C sources with a Python script + with: + python-version: "3.12" + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: true + working-directory: bindings/ruby + - name: Build the gem (the kit's C sources are inside it) + run: bundle exec rake gem + # Trusted publishing (OIDC, no token). Until the gem exists, the pending trusted publisher on + # rubygems.org needs the id of the account that will own it: the repository variable RUBYGEMS_OWNER_ID. + - name: Configure RubyGems credentials (trusted publishing) + id: creds + if: env.PUBLISH == 'true' + continue-on-error: true # a missing trusted publisher warns below instead of failing the release + uses: rubygems/configure-rubygems-credentials@v2.2.0 + with: + owner: ${{ vars.RUBYGEMS_OWNER_ID }} + - name: Push (a version already on RubyGems is skipped) + env: + CREDS: ${{ steps.creds.outcome }} + run: | + gem_file=$(ls blenderui-*.gem) + version=${gem_file#blenderui-} + version=${version%.gem} + if [ "$PUBLISH" != true ]; then + echo "::notice::dry run: $gem_file was built; not pushed" + exit 0 + fi + if [ "$CREDS" != success ]; then + echo "::warning::RubyGems trusted publishing is not set up: $gem_file was built but not pushed (docs/publishing.md, 'RubyGems')" + exit 0 + fi + if gem search --remote --exact blenderui 2>/dev/null | grep -q "blenderui ($version"; then + echo "::notice::blenderui $version is already on RubyGems; skipping" + exit 0 + fi + gem push "$gem_file" + + go-tag: + name: Go module tag + needs: [versions, ci] + if: ${{ !cancelled() && needs.versions.result == 'success' && (needs.ci.result == 'success' || needs.ci.result == 'skipped') }} + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write # pushes the tag + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + # Go finds a module that lives in a folder by a tag with the folder as its prefix: the module + # github.com/ppmpreetham/BUI/bindings/go at v0.6.0 is the tag bindings/go/v0.6.0, on the release commit. + - name: Tag bindings/go + run: | + go_tag="bindings/go/$TAG" + if git rev-parse -q --verify "refs/tags/$go_tag" >/dev/null; then + echo "::notice::$go_tag already exists; skipping" + exit 0 + fi + commit=$(git rev-parse "refs/tags/$TAG^{commit}") + if [ "$PUBLISH" != true ]; then + echo "::notice::dry run: would tag $go_tag at $commit" + exit 0 + fi + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag "$go_tag" "$commit" + git push origin "$go_tag" + github-release: name: GitHub Release needs: [crates, npm, luarocks, nuget] diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 7a4e0652..ef397f76 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -66,8 +66,8 @@ include `ui/`.) | `gpu/` | The draw surface used by the toolkit (`GPU_*`, `imm*`) behind seam headers + a null backend that *records and forwards*: with a sink installed it emits screen-space primitives (`GPU_backend_sink.h`); without one it discards them. Theme colors reach the GPU layer through function-pointer hooks. | **Builds + tested** | | `compat/` | Seam headers carrying upstream API names (`RNA_access.hh`, `BLF_api.hh`, …) with BUI-owned opaque types and stub implementations (`intern/bui_stubs.cc`). | **Builds** | | `ui/` | The toolkit sources from `editors/interface`: interface.cc family, widgets, handlers, regions, view2d, views, textbox. Kept for reference and porting work; **not compiled by default** (`-DBUI_BUILD_UI=ON` builds it as `bui_ui`). `kit/` re-ports what it needs in C. | **Compiles + links** (opt-in) | -| `kit/` | Blender's UI as a retained-mode C runtime: node tree, uiLayout-style layout, `interface_handlers.cc` interaction rules, widget drawing ported from `interface_widgets.cc` (widget-base shader parameters rendered by `gpu/` raster), menus, color picker, views, editors; Blender's screen layout (`kit/intern/screen`, ported from `editors/screen`: areas on a graph of shared edges that split, join, dock and resize, regions that resize, hide and flip, saved as JSON); Tk-style pack/grid/place geometry managers, canvas display list, multi-line text area; UI undo/redo, Tab field traversal, vertical multi-drag, panel animation; Blender's file browser; images (`kit/intern/image`: Blender's imbuf design, one format table over Wuffs, libjpeg-turbo, libwebp, libtiff, OpenEXRCore, libavif, libjxl, the OS's HEIC decoder and BUI's HDR/PNM/SVG readers in `kit/extern`, decode at the drawn size, a worker pool and a memory-budgeted cache; see [the Images page](https://bui.preetham.top/docs/concepts/images/)); damage-driven rendering; Blender's Dark and Light themes (`kit_theme_presets.c`, generated by `tools/gen_theme.py` from Blender's `Blender_Dark.xml` / `Blender_Light.xml` presets over `userdef_default_theme.c`; `BK_set_theme`); native window hosts for Win32, X11, Wayland, Cocoa and Android (`kit_window_win32.c`, `kit_window_x11.c`, `kit_window_wayland.c`, `kit_window_cocoa.m`, `kit_window_android.c`; `kit_window_null.c` elsewhere); the desktop shell (`kit/intern/shell`: tray icons, notifications, taskbar progress, recent files); one accessibility tree per window (`kit/intern/a11y`, served to screen readers by `a11y/`). Touch screens and trackpad gestures live in the kit, not the hosts: `kit/intern/kit_touch.c` is one state machine (Android's model: taps, long presses, scrolls past the touch slop, a second finger's pan, pinch and turn as Blender's `MOUSEPAN` / `MOUSEZOOM` / `MOUSEROTATE`) with the fling in `kit_fling.c` (`VelocityTracker`, `OverScroller`), and every host (Win32 `WM_POINTER`, X11 XInput 2, Wayland `wl_touch` and pointer gestures, Cocoa's magnify and rotate, Android) only forwards contacts to `BK_touch` and trackpad gestures to `BK_magnify` / `BK_rotate` ([docs/touch.md](docs/touch.md)). The Win32 host is BUI's own; the X11 host follows Blender's GHOST input mapping, and the Cocoa host (checked by CI and tried by hand on three Macs: two Apple Silicon, one Intel) is ported from GHOST's Cocoa backend. `kit/intern/blender/` holds Blender files copied in and edited for the kit (each edit marked `BUI:`): `interface_string_search.cc` (menu search with recent searches), `interface_undo.cc` (text-edit undo), `interface_utils.cc` (float display precision). C API: `kit/include/BUI_kit.h`. | **Builds + tested** | -| `a11y/` | `bui-a11y`, a Rust crate: the kit's accessibility trees as AccessKit trees, served to UI Automation on Windows through the window's `WM_GETOBJECT`. The only code that uses AccessKit; C API in `a11y/include/bui_a11y.h`. Gate: `-DBUI_A11Y=ON` (needs cargo); on for Rust and Node. | **Builds + tested** (Windows) | +| `kit/` | Blender's UI as a retained-mode C runtime: node tree, uiLayout-style layout, `interface_handlers.cc` interaction rules, widget drawing ported from `interface_widgets.cc` (widget-base shader parameters rendered by `gpu/` raster), menus, color picker, views, editors; Blender's screen layout (`kit/intern/screen`, ported from `editors/screen`: areas on a graph of shared edges that split, join, dock and resize, regions that resize, hide and flip, saved as JSON); Tk-style pack/grid/place geometry managers, canvas display list, multi-line text area; UI undo/redo, Tab field traversal, vertical multi-drag, panel animation; Blender's file browser; images (`kit/intern/image`: Blender's imbuf design, one format table over Wuffs, libjpeg-turbo, libwebp, libtiff, OpenEXRCore, libavif, libjxl, the OS's HEIC decoder and BUI's HDR/PNM/SVG readers in `kit/extern`, decode at the drawn size, a worker pool and a memory-budgeted cache; see [the Images page](https://bui.preetham.top/docs/concepts/images/)); damage-driven rendering; Blender's Dark and Light themes (`kit_theme_presets.c`, generated by `tools/gen_theme.py` from Blender's `Blender_Dark.xml` / `Blender_Light.xml` presets over `userdef_default_theme.c`; `BK_set_theme`); native window hosts for Win32, X11, Wayland, Cocoa and Android (`kit_window_win32.c`, `kit_window_x11.c`, `kit_window_wayland.c`, `kit_window_cocoa.m`, `kit_window_android.c`; `kit_window_null.c` elsewhere); the desktop shell (`kit/intern/shell`: tray icons, notifications, taskbar progress, recent files); one accessibility tree per window (`kit/intern/a11y`, served to screen readers by `platform/a11y/`). Touch screens and trackpad gestures live in the kit, not the hosts: `kit/intern/kit_touch.c` is one state machine (Android's model: taps, long presses, scrolls past the touch slop, a second finger's pan, pinch and turn as Blender's `MOUSEPAN` / `MOUSEZOOM` / `MOUSEROTATE`) with the fling in `kit_fling.c` (`VelocityTracker`, `OverScroller`), and every host (Win32 `WM_POINTER`, X11 XInput 2, Wayland `wl_touch` and pointer gestures, Cocoa's magnify and rotate, Android) only forwards contacts to `BK_touch` and trackpad gestures to `BK_magnify` / `BK_rotate` ([docs/touch.md](docs/touch.md)). The Win32 host is BUI's own; the X11 host follows Blender's GHOST input mapping, and the Cocoa host (checked by CI and tried by hand on three Macs: two Apple Silicon, one Intel) is ported from GHOST's Cocoa backend. `kit/intern/blender/` holds Blender files copied in and edited for the kit (each edit marked `BUI:`): `interface_string_search.cc` (menu search with recent searches), `interface_undo.cc` (text-edit undo), `interface_utils.cc` (float display precision). C API: `kit/include/BUI_kit.h`. | **Builds + tested** | +| `platform/a11y/` | `bui-a11y`, a Rust crate: the kit's accessibility trees as AccessKit trees, served to UI Automation on Windows through the window's `WM_GETOBJECT`. The only code that uses AccessKit; C API in `platform/a11y/include/bui_a11y.h`. Gate: `-DBUI_A11Y=ON` (needs cargo); on for Rust and Node. | **Builds + tested** (Windows) | | `api/` | `bui_c_api.h` — small stable C ABI: version info + sink/viewport plumbing for hosts and bindings. | **Builds + tested** | | `bindings/python/` | `buipy` CPython extension (no third-party deps; Dear ImGui is compiled into it, `blenderui.imgui`, so a process holds one kit) + `bui` package: `bui.components` (Blender component library), `bui.qtsyntax` / `bui.tksyntax` (Qt / tkinter APIs as thin facades over the kit), `bui.host` (native or Tk windows), `SvgSink` headless renderer, `bui.qt.BuiCanvas` PySide6/PyQt6 widget. | **Builds + tested** | | `bindings/imgui/` | Dear ImGui (vendored, 1.93.1 WIP) on BUI: `imgui_impl_bui` platform + renderer backend hosted in a kit `custom` node (input, cursors, clipboard, DPI, damage-driven frames) drawing through `BUI_raster_mesh` and BUI textures; Blender style and Inter font; the C API (`cimgui.h`) and the generator behind the Python and Rust bindings; the Blender-widgets build (`blender/`, `-DBUI_IMGUI_BLENDER_WIDGETS=ON`). Gate: `-DBUI_BUILD_IMGUI` (ON with C++). | **Builds + tested** | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b6b10e0..280d20cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ All notable changes to **blenderui** (BUI). The format follows ## [Unreleased] ### Added +- **`precision` on number fields and sliders** (`.precision(2)`): the decimals shown, as a Blender property's precision. A field whose step turns fractional shows its decimals again (it kept none). +- **`Window::text_field_focused()`** is public: keys typed into a Blender text field still reach page listeners (as in a browser), and this tells a shortcut to stand aside. +- **`WeakEntity::listener`**: the listener `cx.listener` makes, from a `Copy` handle, for elements built away from `render`'s context (a `Screen`'s editor factories). `cx.listener` is now this. - **Touch screens and trackpad gestures, one model on every platform.** The kit turns a host's contacts into what its widgets know (`BK_touch(ctx, id, BK_TOUCH_DOWN/MOVE/UP/CANCEL, x, y, time_ms, mods)`, `kit/intern/kit_touch.c`), with Android's numbers: a finger on a widget that drags (sliders, fields, scrollbars, the node editor) is the pointer at once; anywhere else a tap is a click, half a second held still is the context menu (a right press), and a move past the 8 dp touch slop scrolls exactly as far as the finger went (from just past the slop) and flings on along `OverScroller`'s curve. A second finger cancels what the first did (as `BK_cancel`) and the two pan (Blender's `MOUSEPAN`), magnify (`MOUSEZOOM`) and rotate (`MOUSEROTATE`) about their centre. Trackpad pinches and turns come in through `BK_magnify` / `BK_rotate` (GHOST's `GHOST_kTrackpadEventMagnify` / `Rotate`); custom nodes get them as `BK_CUSTOM_MAGNIFY` / `ROTATE` and "events" nodes as `BK_EV_GESTURE`, and events made from a finger carry `BK_FROM_TOUCH`. `BK_custom_set_touch(node, BK_TOUCH_MODE_SCROLL / POINTER / RAW)` says what a finger does on a custom node (RAW: every contact as `BK_CUSTOM_TOUCH`; the Dear ImGui adapter uses POINTER). In the node editor two fingers pan the view and a pinch zooms about them. Hosts only forward: Windows through `WM_POINTER` (touch only; no promoted mouse clicks or press-and-hold right click; `WM_POINTERCAPTURECHANGED` cancels), X11 through XInput 2.2 touch (libXi loaded at run time) and XInput 2.4 pinches, Wayland through `wl_touch` and `zwp_pointer_gestures_v1`, macOS through `magnifyWithEvent:` / `rotateWithEvent:`, and Android hands every pointer over (its own touch code is gone). Rust: `on_pan(|e: &PanEvent, ..|)` (before the scroll; `cx.stop_propagation()` takes the drag), `on_pinch(|e: &PinchEvent, ..|)`, `on_rotate(|e: &RotateEvent, ..|)` (rsx `onPan` / `onPinch` / `onRotate`) and, headless, `App::simulate_touch`, `simulate_magnify`, `simulate_rotate`. Details that a plain mapping gets wrong: a two-finger update waits until both fingers moved, so a pan does not wobble the zoom or angle; a finger that lands on a fling stops it without clicking; a finger's double tap may land one widget unit away (the mouse's 4 px is too tight); a finger's drag never warps the system pointer; no hover stays behind a lifted finger; `BK_cancel` now cancels an unmoved press too (a box select a second finger interrupted deselects nothing) and every contact, and a window that loses the focus cancels them; a cancelled link drag in the node editor puts back the link it took off an input (`node_link_cancel`), and `Delete` / `X` do nothing mid link or value drag. Rust's `ScrollWheelEvent::position` now comes from the event (a finger's scroll moves no pointer), and a diagonal finger scroll no longer loses an axis. Docs: [docs/touch.md](docs/touch.md). **C API changes:** the `BK_window_wm(win, "touch_drag", 1, 0)` key is removed; call `BK_custom_set_touch(node, BK_TOUCH_MODE_POINTER)` on the custom node instead. A raw `BK_EV_WHEEL` event's text is now `"mods button phase x y"` (where the scroll is, relative to the node). - **Android scrolling the way Android does it, a rubber band past the ends, and an opt-in smooth wheel.** The touch fling is a port of Android's: `VelocityTracker`'s least squares fit of the last 100 ms of touches (batched touches included) and `OverScroller`'s spline fling with its friction (`kit/intern/kit_fling.c`), not an exponential decay on a two-point velocity; a drag starts from just past the touch slop, so the content no longer jumps by it. New: `BK_scroll_phase` (`BK_SCROLL_WHEEL`/`DRAG`/`FLING`/`END`) tells a view how a scroll came, and Rust's `ScrollWheelEvent::phase` carries it. `Options::overscroll` (off by default, as in Blender) makes a list stretch past either end with UIScrollView's curve while the finger drags (a fling's momentum stretches it less) and spring back when it lifts; the Android demo turns it on. `Options::smooth_wheel` (off by default) eases a wheel notch in over a few frames, as macOS does, instead of scrolling at once. A scroll now moves a list exactly as far as asked in both directions: it used to be turned into a position through estimated heights, so going up through items not yet measured moved the content by whatever the estimates were off by (10 % too far in a test from the middle of 200 000 messages, while down was exact); the list now walks the distance item by item from the anchor at the next layout, measuring what it passes (`view/relative.rs`). The Android Rust demo's chat is a million messages. Checked on a 90 Hz phone: dragging past the top stretches the first message about 400 px and it settles back at rest. - **Android runs at the display's fastest refresh rate.** Some phones (ColorOS) held the app to 60 Hz on a 90 Hz panel. `kit_window_android.c` now names the fastest mode (at the current size, whatever the panel offers) on the window with `preferredDisplayModeId` / `preferredRefreshRate`, in JNI from the activity's `onWindowFocusChanged` callback (it runs on the UI thread, so no Java class is needed), and also votes with `ANativeWindow_setFrameRate`. An animating pass that drew nothing no longer spins the loop (it waits `IDLE_FRAME_MS`). `-DBUI_ANDROID_FRAME_LOG` logs frames and CPU time per second to logcat (tag `BUI`). Checked on a 90 Hz phone: 60 Hz before, 90 Hz after. @@ -22,7 +25,7 @@ All notable changes to **blenderui** (BUI). The format follows - **The desktop shell: tray icons with menus, notifications, taskbar progress and recent files**, in the C kit for every binding (`kit/intern/shell`). A tray icon (`BK_tray_new`) takes an image file or a Blender icon's name, a tooltip and a menu of `BKMenuSpec` items (separators, check marks, submenus, disabled items); clicks, double clicks and menu items come back as kit events (`BK_EV_CLICK`, `BK_EV_DOUBLE`, `BK_EV_CALL`) through one listener (`BK_shell_set_callbacks`), and so does a click on a notification (`BK_notify`, `BK_EV_ACTIVATE`). `BK_window_set_progress` puts a progress on the window's taskbar button (normal, paused, error, indeterminate, none) and `BK_shell_add_recent` adds a file to the system's recent documents, as Blender's GHOST does (`setProgressBar` / `endProgressBar`, `addToSystemRecentFiles`). Windows: `Shell_NotifyIconW` with `TrackPopupMenu`, notifications as the tray icon's balloon (Windows 10 and 11 show it as a toast), `ITaskbarList3`, `SHAddToRecentDocs`; shell32 and ole32 are loaded at run time, so linking needs nothing more. Linux: StatusNotifierItem with com.canonical.dbusmenu, org.freedesktop.Notifications and the Unity launcher entry over D-Bus, with libdbus-1 loaded at run time (the window loops wait on its socket), and GTK's `recently-used.xbel`. macOS: `NSStatusItem` + `NSMenu`, `UNUserNotificationCenter` (bundled apps), the Dock icon's progress and `NSDocumentController` (written, not yet run on a Mac). `BK_shell_features()` reports what the build and system have; the new `shell` feature (`BUI_SHELL`, on by default) leaves it all out. Rust: `blenderui::shell` (`Tray`, `MenuItem`, `notify`, `add_recent_document`, `set_app_id`, `App::on_shell_event`, `Window::set_taskbar_progress`; `examples/tray.rs`); JavaScript: `app.createTray()`, `app.notify()`, `app.addRecentDocument()`, `win.setProgressBar()` with Electron's names; Python: `buipy.Tray`, `buipy.notify`, `buipy.add_recent_file`, `KitWindow.set_progress`. Tests: `tests/shell_test.c` (with `tests/shell_dbus_host.py`, a desktop's side of the D-Bus protocols, on Linux), `tests/suite/shell.rs`, `bindings/python/tests/test_shell.py`. - **CSS: `subgrid`, anchor positioning and view transitions** (Rust and JavaScript). `grid-template-rows: subgrid` (or columns) gives a grid item its parent's tracks: the parent lays the subgrid's items out as its own (they size its tracks, the subgrid's padding and border added at its edges), so cards line up their headers and bodies (`tree/subgrid.rs`; taffy has no subgrids). Anchor positioning (`anchor.rs`): `anchor-name`, `position-anchor`, `anchor()` in the insets (fallbacks, `calc(anchor() ± length)`), `anchor-size()`, `position-area`, `anchor-center` and `position-try-fallbacks` (`flip-block`, `flip-inline`, area options); an anchored box reads its anchor's place from the last layout and the window lays out again when it moved, as `@container` does. View transitions (`transition.rs`): `Window::start_view_transition()` pictures the page, then the next render's boxes with a `view-transition-name` move and resize from their old place while the old pictures fade out and the page cross-fades, timed by `::view-transition-group()` / `-old()` / `-new()` rules (by name, `*` or `.class`). Tests: `tests/suite/css_spec.rs`. - **C# binding** (`bindings/csharp`, first slice): `Bui.Interop.Native` holds every `BK_*` function, struct and constant of `BUI_kit.h`, generated by ClangSharp with no marshalling stubs (`DisableRuntimeMarshalling`, `delegate* unmanaged` callbacks); `Bui` has `Node`, `Frame`, `Button`, `Label`, `Context`, `Window` and `Kit`, with nodes kept alive by their parents through the kit's ref hooks; `-DBUI_BUILD_CSHARP_BINDINGS=ON` builds the kit as one shared library (`bui_kit.dll` with MSVC, its exports generated from the functions the binding imports; `libbui_kit.dylib`; `libbui_kit.so`). A headless suite (`tests/Bui.Tests`) and `examples/Hello`. CI builds and tests it on Linux, macOS (arm64 and x64) and Windows; `release.yml` publishes `BlenderUI` to NuGet with trusted publishing, the kit for each platform under `runtimes//native/`. -- **Accessibility: screen readers see BUI apps on Windows, through [AccessKit](https://accesskit.dev).** The kit keeps one accessibility tree per window: its widgets add themselves (role, name, value, states, bounds; menus, tabs, enum, list and tree rows as items), and the Rust HTML engine adds the page under its canvas, with roles and names mapped as browsers map HTML and ARIA (HTML-AAM, accname: `aria-labelledby`, `aria-label`, `