#74 · UI benchmarks on the desktop app, plus two desktop fixes
- timeline-app
- pull request
- packages
Part 2 of #51, and it completes the issue: the UI benchmarks now drive the **desktop app** too. Building it found two desktop bugs, fixed here in their own commits. ## Desktop driver - **`bench/ui/webdriver.mjs`:** a small W3C WebDriver client for `tauri-driver`, which forwards to WebKitWebDriver on Linux. It sends pointer, key and wheel actions, evaluates scripts, and feeds the file input in chunks. - **Clicks wait like Playwright's:** until the target is stable and is what the pointer would hit. Without that, clicks landed on a dialog that had just closed, or on a moving button. - **Wheel actions release input state afterwards:** WebKitWebDriver silently drops a second identical wheel action. - **`UI_PLATFORMS=desktop`:** - runs every interaction except pinch (Chromium-only touch) in the debug app (`npx tauri build --debug --no-bundle`); - 1,000 moments stay in memory; 10,000 move into the native SQLite store, as for desktop users; - the editor now sets `data-storage` (`memory` / `sqlite` / `server`) on the root element, so the bench can tell when that move has finished. - **`bench/ui/desktop.Dockerfile`:** an Ubuntu 24.04 container with WebKitWebDriver, Xvfb, Rust and `tauri-driver`, for systems that don't package WebKitWebDriver (Arch, macOS). The local desktop runs used it. ## Measurement fixes, for all platforms - **Timing starts at the triggering input:** a click on release, a key on press, each wheel step. That's how Event Timing measures interactions; before, it started at the first input, which counted button hold time. Delete in the browser, for example, went from 104–152 ms to 48–100 ms. - **Views wait until their moments have loaded.** The earlier "platform navigation is fast at 100,000 moments" result was measured too early. It's slow too (274 ms wheel zoom), and #68 has a correction. - **Separations are timed until the separated view has loaded,** not just until the panel appears. - **`UI_KNOWN`** lists known misses: they're reported but don't fail `--gate`. **`UI_DEBUG`** now reports recent inputs (with modifiers), status messages and loading state. - **A failed open reports the editor's own message,** unless that message is a success note. ## CI A new job, **Desktop app / UI interactions within budget**: - Ubuntu, with `webkit2gtk-driver`, Xvfb and `tauri-driver`; - it builds the debug app and gates 1,000 and 10,000 moments, with 1.5× tolerance; - navigation and new durations are known misses (#68), and everything else must meet its budget. ## Bugs found and fixed 1. **Desktop search failed on any timeline with tags** ("malformed JSON"), including the endpoint picker's search. The native SQL read every metadata array's elements as stack entries (objects), and tags are strings. Fix: read only object elements. The native search test now includes tags; it fails without the fix. 2. **Escape couldn't close search or the moment picker on the desktop.** WebKit keeps Escape in search fields, even empty ones, and both dialogs focus theirs. Fix: Escape in an empty search field closes its dialog; with text, it still clears the text first. Verified in the desktop app. ## Results The full table is in `docs/benchmarks.md#results`, with the desktop under Xvfb's software rendering. - **Desktop:** discrete actions are within budget at 1,000 and 10,000 moments. Navigation (wheel zoom 368 ms, drag 393 ms) and new durations (278 ms) miss at 10,000, as on the other platforms (#68). Open is 1.6 s at 1,000 (first session) and 1.2 s at 10,000. - **Browser and platform:** re-measured with the new timing. The conclusions stand: navigation is the bottleneck (#68), and the advice shows too late (#69). ## Tests - **Desktop gate (CI configuration, in the container):** 42 measurements, 0 failures, 4 known misses. - **Browser and platform gate (CI configuration):** 49 measurements, all within budget. - **Unit tests (201), native-store tests (23), and the Chromium and Firefox browser and offline suites:** all pass.
Sources
Open #74 · UI benchmarks on the desktop app, plus two desktop fixes in the timeline