Task 24: Screenshot test harness and golden images (#24) #94

Manually merged
charles merged 0 commits from task/24-screenshot-tests into foundation 2026-11-11 18:28:23 +00:00
Owner

Stacked on: task/20-ui-message-list-composer, task/22-ui-settings-parity

What this builds

  • fluxer_ui::testing::render(view: Element<UiMessage>, size: (u32, u32)) -> RgbaImage (src/testing/offscreen.rs): one frame of a view, drawn by iced's wgpu renderer (iced::Renderer through renderer::Headless, backend "wgpu") into an offscreen texture. Dark theme, bundled fonts, scale factor 1, no cursor. It does what iced does before a draw: layout, a RedrawRequested pass so widgets settle their status (a button that never saw one draws as disabled), another layout if a widget asked for it, then draw and read back.
  • fluxer_ui::testing::assert_matches_golden(name, &image, tolerance) (src/testing/mod.rs): compares with fixtures/golden/<name>.png; DEFAULT_TOLERANCE is 0.5 (% of differing pixels). UPDATE_GOLDEN=1 rewrites the golden. On failure it writes <name>.actual.png and <name>.diff.png (differences in red) to FLUXER_SCREENSHOT_OUT and names them in the message. diff() is the comparison alone.
  • crates/fluxer-ui/tests/screenshots.rs: login_screen_matches_golden, main_screen_with_basic_scenario_matches_golden, settings_appearance_matches_golden, 1280x720. State is built from the fixtures by applying events to App (READY, GUILD_CREATE, history, MESSAGE_CREATE, PRESENCE_UPDATE, as fixtures/scenarios/basic.toml plays them); no devserver. The clock is fixed.
  • fixtures/golden/{login,main-general,settings-appearance}.png, drawn by lavapipe (Mesa 23.2.1) in an ubuntu:22.04 container with the CI job's package list.
  • .forgejo/workflows/ci.yaml: the Linux job sets WGPU_BACKEND=vulkan and VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json, and fails in the package step if that file is missing. mesa-vulkan-drivers and FLUXER_SCREENSHOT_TESTS=1 were already there.
  • docs/screenshots/README.md: the tests, the reference renderer, updating goldens, adding a screen, and how to capture the Electron side-by-side.

How it was tested

  • Test first: the three tests failed to compile (no testing module), then failed on missing goldens, then passed after UPDATE_GOLDEN=1.
  • Goldens generated and re-checked on lavapipe inside ubuntu:22.04 (same apt packages and env as the Linux job). I looked at all three images.
  • The same goldens also pass on this machine's hardware GPU, so the tolerance holds across renderers here.
  • 9 unit tests for the comparison (percentages, channel tolerance, size mismatch, update, missing golden, failure messages); they run on every platform.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. Not run on the Forgejo runners by me.

Deviations from the plan

  • xtask/src/main.rs: only a doc comment changed. The step from Task 1 (cargo test --workspace -- --ignored when FLUXER_SCREENSHOT_TESTS=1) already runs these tests, which are #[ignore]d.
  • A pixel counts as differing when a channel is off by more than 8 of 255 (CHANNEL_TOLERANCE); the plan only gives the 0.5 %. Without it, rounding differences in anti-aliasing would count.
  • tests/screenshots.rs is #![cfg(not(windows))], like message_view.rs (#93): a test binary that builds iced::Renderer cannot load on the Windows runner. Windows does not set FLUXER_SCREENSHOT_TESTS anyway.
  • testing is an ordinary public module of the library (integration tests cannot see cfg(test) items). It reads and writes golden PNGs, which is file I/O in a crate that otherwise does none; the README says so. Nothing the application runs calls it.
  • The history of #general in the main screenshot is 8 messages written in the test (READY's members in rotation), not the 120 the devserver generates: that generator is private to fluxer-devserver.
  • Merging the two base branches conflicted in crates/fluxer-ui/src/app.rs and crates/fluxer-ui/README.md (both sides kept: Task 20's main::update and Task 22's settings routing).

For the reviewer

  • lavapipe prints error: XDG_RUNTIME_DIR not set in the environment. a few times in the container; the tests pass regardless. Expect that noise in the Linux log.
  • The Electron capture steps in docs/screenshots/README.md are standard Chromium DevTools; I did not run the Electron app to try them.

Closes #24

🤖 Generated with Claude Code

Stacked on: task/20-ui-message-list-composer, task/22-ui-settings-parity ## What this builds - `fluxer_ui::testing::render(view: Element<UiMessage>, size: (u32, u32)) -> RgbaImage` (`src/testing/offscreen.rs`): one frame of a view, drawn by iced's wgpu renderer (`iced::Renderer` through `renderer::Headless`, backend `"wgpu"`) into an offscreen texture. Dark theme, bundled fonts, scale factor 1, no cursor. It does what iced does before a draw: layout, a `RedrawRequested` pass so widgets settle their status (a button that never saw one draws as disabled), another layout if a widget asked for it, then draw and read back. - `fluxer_ui::testing::assert_matches_golden(name, &image, tolerance)` (`src/testing/mod.rs`): compares with `fixtures/golden/<name>.png`; `DEFAULT_TOLERANCE` is 0.5 (% of differing pixels). `UPDATE_GOLDEN=1` rewrites the golden. On failure it writes `<name>.actual.png` and `<name>.diff.png` (differences in red) to `FLUXER_SCREENSHOT_OUT` and names them in the message. `diff()` is the comparison alone. - `crates/fluxer-ui/tests/screenshots.rs`: `login_screen_matches_golden`, `main_screen_with_basic_scenario_matches_golden`, `settings_appearance_matches_golden`, 1280x720. State is built from the fixtures by applying events to `App` (READY, GUILD_CREATE, history, MESSAGE_CREATE, PRESENCE_UPDATE, as `fixtures/scenarios/basic.toml` plays them); no devserver. The clock is fixed. - `fixtures/golden/{login,main-general,settings-appearance}.png`, drawn by lavapipe (Mesa 23.2.1) in an `ubuntu:22.04` container with the CI job's package list. - `.forgejo/workflows/ci.yaml`: the Linux job sets `WGPU_BACKEND=vulkan` and `VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json`, and fails in the package step if that file is missing. `mesa-vulkan-drivers` and `FLUXER_SCREENSHOT_TESTS=1` were already there. - `docs/screenshots/README.md`: the tests, the reference renderer, updating goldens, adding a screen, and how to capture the Electron side-by-side. ## How it was tested - Test first: the three tests failed to compile (no `testing` module), then failed on missing goldens, then passed after `UPDATE_GOLDEN=1`. - Goldens generated and re-checked on lavapipe inside `ubuntu:22.04` (same apt packages and env as the Linux job). I looked at all three images. - The same goldens also pass on this machine's hardware GPU, so the tolerance holds across renderers here. - 9 unit tests for the comparison (percentages, channel tolerance, size mismatch, update, missing golden, failure messages); they run on every platform. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. Not run on the Forgejo runners by me. ## Deviations from the plan - `xtask/src/main.rs`: only a doc comment changed. The step from Task 1 (`cargo test --workspace -- --ignored` when `FLUXER_SCREENSHOT_TESTS=1`) already runs these tests, which are `#[ignore]`d. - A pixel counts as differing when a channel is off by more than 8 of 255 (`CHANNEL_TOLERANCE`); the plan only gives the 0.5 %. Without it, rounding differences in anti-aliasing would count. - `tests/screenshots.rs` is `#![cfg(not(windows))]`, like `message_view.rs` (#93): a test binary that builds `iced::Renderer` cannot load on the Windows runner. Windows does not set `FLUXER_SCREENSHOT_TESTS` anyway. - `testing` is an ordinary public module of the library (integration tests cannot see `cfg(test)` items). It reads and writes golden PNGs, which is file I/O in a crate that otherwise does none; the README says so. Nothing the application runs calls it. - The history of #general in the main screenshot is 8 messages written in the test (READY's members in rotation), not the 120 the devserver generates: that generator is private to `fluxer-devserver`. - Merging the two base branches conflicted in `crates/fluxer-ui/src/app.rs` and `crates/fluxer-ui/README.md` (both sides kept: Task 20's `main::update` and Task 22's settings routing). ## For the reviewer - lavapipe prints `error: XDG_RUNTIME_DIR not set in the environment.` a few times in the container; the tests pass regardless. Expect that noise in the Linux log. - The Electron capture steps in `docs/screenshots/README.md` are standard Chromium DevTools; I did not run the Electron app to try them. Closes #24 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(ui): generated theme tokens, fonts and icons
All checks were successful
ci / Windows (x64) (push) Successful in 22s
ci / Windows (x64) (pull_request) Successful in 15s
ci / Linux (x86_64) (push) Successful in 1m22s
ci / Linux (x86_64) (pull_request) Successful in 1m23s
64430a109d
- xtask gen-theme --fork <path>: parses the Electron app's colour system,
  globals and message-layout CSS into crates/fluxer-ui/src/theme/tokens.rs
  (hsl/hsla/rgb/hex, saturation-factor calc, var() fallbacks, color-mix in
  srgb and oklab; rem to px).
- fluxer-ui::theme: tokens (DARK), palette::Theme with iced's Base and
  widget catalogs, fonts (Fluxer Sans/Mono as TTF) and icons (Phosphor SVGs).
- Adds iced 0.14 to the workspace; deny.toml allows BSL-1.0 and CC0-1.0 and
  ignores three unmaintained-crate advisories that iced pulls in.

Refs #16

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge origin/foundation into task/16-ui-theme-fonts-icons
All checks were successful
ci / Windows (x64) (push) Successful in 1m32s
ci / Windows (x64) (pull_request) Successful in 38s
ci / Linux (x86_64) (push) Successful in 1m28s
ci / Linux (x86_64) (pull_request) Successful in 1m34s
897ebaae93
Conflicts in xtask (both sides implemented dispatch stubs: gen-theme here,
vendor-spec/spec-check on foundation) and Cargo.lock resolved as the union.

Refs #16

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge origin/foundation into task/16-ui-theme-fonts-icons
All checks were successful
ci / Windows (x64) (push) Successful in 44s
ci / Linux (x86_64) (push) Successful in 1m41s
ci / Windows (x64) (pull_request) Successful in 52s
ci / Linux (x86_64) (pull_request) Successful in 1m31s
301b889ef7
Mechanical conflicts: both sides added workspace dependencies (iced, futures-util)
and Cargo.lock entries.

Refs #16

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #8

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(core): store skeleton and session reducer
All checks were successful
ci / Windows (x64) (push) Successful in 42s
ci / Linux (x86_64) (push) Successful in 1m0s
ci / Windows (x64) (pull_request) Successful in 41s
ci / Linux (x86_64) (pull_request) Successful in 1m5s
cacedcbbf7
Refs #8

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Adds the gateway crate's dependencies (rustls, rustls-native-certs and zstd are
new to the workspace; Task 7 names tokio-tungstenite with rustls and zstd).

Refs #7

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #7

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fluxer_markdown_parser is pinned to the fork's main (ba98441b) over the anonymous
HTTPS URL: the fork is public, so the CI runners need no deploy key. cargo-deny
gets the git source and a per-crate AGPL-3.0-or-later licence exception.

Refs #19

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #19

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #7

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(ui): rich text from the native Markdown parser
All checks were successful
ci / Linux (x86_64) (push) Successful in 4m44s
ci / Windows (x64) (push) Successful in 5m45s
ci / Windows (x64) (pull_request) Successful in 46s
ci / Linux (x86_64) (pull_request) Successful in 4m29s
72276377ff
parse_message runs the fork's parser with the message flags; blocks/spans turn the
AST into a span model (tested instead of pixels); rich_text draws it with iced rich
text spans, code blocks and block quotes, and emits LinkClicked / SpoilerToggled.

Refs #19

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #7

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #9

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #11

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(core): presence, users and ui state
All checks were successful
ci / Windows (x64) (push) Successful in 39s
ci / Windows (x64) (pull_request) Successful in 39s
ci / Linux (x86_64) (push) Successful in 1m7s
ci / Linux (x86_64) (pull_request) Successful in 1m3s
f4ce82e123
Refs #11

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(gateway): websocket transport with zstd streaming
All checks were successful
ci / Windows (x64) (push) Successful in 57s
ci / Windows (x64) (pull_request) Successful in 48s
ci / Linux (x86_64) (push) Successful in 1m3s
ci / Linux (x86_64) (pull_request) Successful in 1m3s
e60021584a
Refs #7

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(core): guild and channel reducers and sidebar selectors
All checks were successful
ci / Windows (x64) (pull_request) Successful in 45s
ci / Windows (x64) (push) Successful in 43s
ci / Linux (x86_64) (pull_request) Successful in 1m3s
ci / Linux (x86_64) (push) Successful in 1m10s
e753f32ec6
Refs #9

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #10

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(ui): avatars with cached image loading
Some checks failed
ci / Windows (x64) (pull_request) Successful in 1m11s
ci / Windows (x64) (push) Successful in 55s
ci / Linux (x86_64) (pull_request) Failing after 1m32s
ci / Linux (x86_64) (push) Has been cancelled
5c961c3ca6
fluxer-core: media_urls ports the web app's AvatarUtils/MediaProxyUtils
(avatar_url, guild_icon_url, default avatar index, size snapping,
buildMediaProxyURL).
fluxer-ui: images::ImageLoader (the crate's single I/O boundary) with the
per-URL Images state, and widgets::avatar (round clip, bundled default
avatars, presence dot from the theme tokens).
fluxer-platform: images::ImageCache (reqwest, PNG/JPEG/GIF/WebP decode,
disk cache under cache_dir/images/<sha256>, in-memory LRU) implementing
ImageLoader.

Refs #21

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(core): messages, typing and read state
All checks were successful
ci / Windows (x64) (push) Successful in 44s
ci / Windows (x64) (pull_request) Successful in 44s
ci / Linux (x86_64) (push) Successful in 1m4s
ci / Linux (x86_64) (pull_request) Successful in 1m3s
38a4f01a14
Refs #10

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs(ui): mark illustrative snippets as text, not ignored doctests
All checks were successful
ci / Windows (x64) (push) Successful in 57s
ci / Windows (x64) (pull_request) Successful in 54s
ci / Linux (x86_64) (push) Successful in 1m35s
ci / Linux (x86_64) (pull_request) Successful in 1m43s
2d16dfbfec
The Linux CI screenshot step runs 'cargo test --workspace -- --ignored',
which compiles 'ignore' doctests; the images.rs fragment is not a
compilable item and failed there.

Refs #21

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #13

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-core/README.md
#	crates/fluxer-core/src/app.rs
#	crates/fluxer-core/src/lib.rs
#	crates/fluxer-core/src/selectors/mod.rs
# Conflicts:
#	crates/fluxer-core/README.md
#	crates/fluxer-core/src/app.rs
#	crates/fluxer-core/src/lib.rs
#	crates/fluxer-core/src/selectors/mod.rs
feat(devserver): fixture-backed API and gateway for tests
All checks were successful
ci / Windows (x64) (pull_request) Successful in 1m11s
ci / Linux (x86_64) (pull_request) Successful in 1m20s
ci / Windows (x64) (push) Successful in 57s
ci / Linux (x86_64) (push) Successful in 1m10s
4c00cf12fd
Refs #13

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #12

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(platform,core): settings, keyring token and sqlite cache
Some checks failed
ci / Windows (x64) (push) Failing after 23s
ci / Linux (x86_64) (push) Failing after 56s
ci / Windows (x64) (pull_request) Failing after 13s
ci / Linux (x86_64) (pull_request) Failing after 54s
6eb27db77c
Core: PersistOp/PersistResult/LocalSettings in fluxer_core::persist, the
stored-token login (Loaded -> Discover -> Me -> ConnectGateway), cached READY
data marked App::stale until the live READY, and the CacheReady/CacheMessages/
SaveSettings writes.

Platform: Paths, settings.toml (defaults on missing, .bad on invalid), the
keyring token, the SQLite cache (rebuilt when corrupt or of another schema
version, in memory if the file is unusable) and Store, which ties them to
PersistOp for the runtime.

New dependencies: directories, keyring, rusqlite (bundled), toml, base64,
getrandom, tempfile (dev), keyring-core (dev, mock store).

Refs #12

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
chore(deps): bump num-bigint 0.4.7 -> 0.4.8 (0.4.7 was yanked)
All checks were successful
ci / Windows (x64) (push) Successful in 1m2s
ci / Linux (x86_64) (push) Successful in 1m20s
ci / Windows (x64) (pull_request) Successful in 51s
ci / Linux (x86_64) (pull_request) Successful in 1m18s
6b043c3a08
cargo deny (yanked = deny) failed on both runners for run 71/72: num-bigint 0.4.7,
a transitive dependency of keyring's Secret Service store, was yanked from crates.io.
Lockfile-only patch bump; no manifest change.

Refs #12

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	Cargo.lock
# Conflicts:
#	Cargo.lock
#	Cargo.toml
Refs #14

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ApiClient::with_observer shows each exchange that got a response (no
headers); Connection::connect_with_tap shows each frame received and
sent. Both are off unless asked for.

Refs #14

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(app): effect runtime, config, logging and record mode
Some checks failed
ci / Windows (x64) (pull_request) Failing after 19s
ci / Windows (x64) (push) Failing after 4s
ci / Linux (x86_64) (pull_request) Successful in 1m37s
ci / Linux (x86_64) (push) Successful in 1m43s
a2ce504001
Refs #14

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ci(windows): free the build cache when the runner disk is low
All checks were successful
ci / Linux (x86_64) (push) Successful in 1m9s
ci / Windows (x64) (push) Successful in 1m33s
ci / Linux (x86_64) (pull_request) Successful in 1m12s
ci / Windows (x64) (pull_request) Successful in 1m21s
6ada26ce7e
The persistent Windows runner ran out of space on C: (os error 112). Log free
space, remove this project's own target dirs when it drops below 30 GB, and
turn off incremental compilation there. Also correct CLAUDE.md: one target dir
per worktree, and run the screenshot step locally before pushing.

Refs #51

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/ci/51-windows-disk-space' into task/14-app-runtime
All checks were successful
ci / Linux (x86_64) (push) Successful in 1m49s
ci / Windows (x64) (push) Successful in 2m59s
ci / Linux (x86_64) (pull_request) Successful in 1m53s
ci / Windows (x64) (pull_request) Successful in 2m46s
d0f3c10f86
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	deny.toml
feat(ui): iced shell and login screen
All checks were successful
ci / Linux (x86_64) (push) Successful in 2m18s
ci / Windows (x64) (push) Successful in 3m51s
ci / Linux (x86_64) (pull_request) Successful in 2m9s
ci / Windows (x64) (pull_request) Successful in 3m38s
9e1bc0a481
fluxer_ui::run shows the runtime's snapshots in an iced window and sends
what the user does back as CoreEvents; the login screen covers the
instance field, credentials, the TOTP step and one text per AuthError
(captcha included). apps/fluxer launches it in place of the headless loop.

Refs #17

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(ui): main three-pane layout
All checks were successful
ci / Linux (x86_64) (push) Successful in 2m12s
ci / Windows (x64) (push) Successful in 3m50s
ci / Linux (x86_64) (pull_request) Successful in 2m12s
ci / Windows (x64) (pull_request) Successful in 3m12s
f9183ef0ef
screens::main draws the guild rail, the resizable channel sidebar, the
channel header and the member list from main::model(&App), which reads
the store through the core selectors. Its messages map to UserActions.
New widgets: mention badge, tooltip card and resizable split. The shell
shows the main screen once logged in.

Refs #18

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	Cargo.lock
#	crates/fluxer-ui/Cargo.toml
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/lib.rs
#	crates/fluxer-ui/src/widgets/mod.rs
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/fluxer-core/README.md
#	crates/fluxer-core/src/lib.rs
#	crates/fluxer-platform/Cargo.toml
#	crates/fluxer-platform/README.md
#	crates/fluxer-platform/src/lib.rs
#	crates/fluxer-ui/Cargo.toml
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/lib.rs
#	crates/fluxer-ui/src/widgets/mod.rs
Refs #22

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
extract-parity reads the fork's 21 settings search index files (117
entries) into docs/parity/settings.toml and merges on re-run;
parity-check validates status and owner and is a step of xtask ci.

Refs #22

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #22

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(ui): settings skeleton and settings parity list
All checks were successful
ci / Linux (x86_64) (push) Successful in 2m20s
ci / Windows (x64) (push) Successful in 3m59s
ci / Linux (x86_64) (pull_request) Successful in 2m19s
ci / Windows (x64) (pull_request) Successful in 3m32s
4deffe7c3f
screens::settings draws the web app's settings navigation (22 tabs in
four groups, from fluxer_core::settings_tabs) and the open tab's page:
Account, Appearance, Notifications and Companion apps panels are built,
every other section is a "Coming in sub-project N" placeholder whose
owner matches docs/parity/settings.toml. Regenerating the status API
token goes through PersistOp::RegenerateStatusToken, which the runtime
answers with PersistResult::StatusToken.

Refs #22

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(ui): virtualised message list and composer
Some checks failed
ci / Linux (x86_64) (push) Successful in 5m38s
ci / Windows (x64) (push) Failing after 4m12s
ci / Linux (x86_64) (pull_request) Successful in 5m28s
ci / Windows (x64) (pull_request) Failing after 4m3s
a1c70f1036
The main screen's message view: widgets::message_list builds and lays out
only the rows that show (pure rules: layout, anchor_at/scroll_for_anchor,
ReachTop), keeps what is being read in place when older messages arrive,
asks for history near the top and shows "Jump to present" for messages
that arrive while scrolled up. message_row draws a message (avatar, role
colour, HH:MM, rich text, "(edited)", pending at 50 %, "Failed to send -
Retry"), day_separator the dated line, composer the growing text box with
Enter/Shift+Enter and the typing line. screens::main::messages ties them
to the store: model, view-local state, and update -> UserActions.

rich_text::rich_text no longer borrows its nodes and context for the
element's lifetime; main::Message gains Messages(..) and is turned into
UserActions by main::update.

Refs #20

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ci(windows): name the DLLs a failed test binary cannot load
Some checks failed
ci / Windows (x64) (push) Failing after 3m30s
ci / Linux (x86_64) (push) Successful in 5m19s
ci / Windows (x64) (pull_request) Failing after 4m3s
ci / Linux (x86_64) (pull_request) Has been cancelled
5a7b2c3386
cargo reports a test binary that dies in the loader only as exit code
0xc0000135 (STATUS_DLL_NOT_FOUND). After a failed Windows job, read the PE
imports of every executable the cargo log blames for that code and print
the ones that do not resolve, plus the Windows edition, into the published
log.

Refs #20

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
test(ui): run the message view's renderer tests in their own binary, off Windows
All checks were successful
ci / Windows (x64) (push) Successful in 3m37s
ci / Linux (x86_64) (push) Successful in 5m30s
ci / Windows (x64) (pull_request) Successful in 4m5s
ci / Linux (x86_64) (pull_request) Successful in 5m12s
4febcd11ab
The Windows runner is a Windows Server 2025 Server Core install without
opengl32.dll. A test binary that builds an iced::Renderer links wgpu's GL
backend, imports that DLL statically, and is killed by the loader
(0xc0000135) before any test runs, even when it only asks for tiny-skia.

Move the five headless widget tests from tests/message_list.rs to
tests/message_view.rs, which is cfg(not(windows)); the ten layout, composer
and model tests keep running on Windows. Shared fixtures and helpers go to
tests/common. Linux runs all fifteen as before. Follow-up: #93.

Refs #20

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/app.rs
test(ui): offscreen screenshot tests
All checks were successful
ci / Windows (x64) (push) Successful in 3m49s
ci / Linux (x86_64) (push) Successful in 5m26s
ci / Windows (x64) (pull_request) Successful in 4m3s
ci / Linux (x86_64) (pull_request) Successful in 5m12s
480fde6c20
fluxer_ui::testing::render draws a view with iced's wgpu renderer into an offscreen
texture; assert_matches_golden compares it with fixtures/golden/<name>.png (0.5 % of
differing pixels allowed, UPDATE_GOLDEN=1 rewrites). Three screen tests: login, main
with the basic scenario, Settings -> Appearance. The goldens are drawn by lavapipe on
Ubuntu 22.04, which the Linux CI job now pins with WGPU_BACKEND and VK_ICD_FILENAMES.

Refs #24

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Independent review — Task 24 (screenshot tests), commit 480fde6

Scope: git diff e93471f..origin/task/24-screenshot-tests (11 files).

Checks

  1. Plan tests: login_screen_matches_golden, main_screen_with_basic_scenario_matches_golden, settings_appearance_matches_golden all exist in crates/fluxer-ui/tests/screenshots.rs, build their state from fixtures/ (READY, guild_create, message_create, presence_update; no devserver), render at 1280x720 and compare with DEFAULT_TOLERANCE = 0.5 %. The three goldens are 1280x720 RGBA and show the expected screens (I looked at each).
  2. Interfaces: testing::render(view: Element<'_, UiMessage>, size: (u32, u32)) -> RgbaImage (iced wgpu Headless renderer, offscreen), testing::assert_matches_golden(name, &image, tolerance), UPDATE_GOLDEN=1 rewrites. Present as the plan names them (the image is taken by reference).
  3. Invariants: no change to fluxer-core; no secrets or tokens in code, fixtures or docs; nothing here parses server data. fluxer-ui I/O: see finding 1.
  4. Review Focus: no item belongs to Task 24.
  5. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree with its own target dir: green (exit 0; the 3 screenshot tests passed, working tree left clean). This ran on the host's hardware GPU, not on lavapipe; I did not reproduce the lavapipe container run, and both Forgejo jobs for 480fde6 were still pending when I looked once.

Findings

  1. minor — crates/fluxer-ui/src/testing/mod.rs: golden PNG reads/writes are a second file-I/O path inside the fluxer-ui library, compiled unconditionally as pub mod testing (not cfg(test), no cargo feature). The plan prescribes this module and its behaviour, the application never calls it, and the crate README documents it, so I do not count it as an invariant break. But CLAUDE.md still says the ImageLoader is the single exception and was not updated. Suggested follow-up: put testing behind a testing cargo feature (enabled by the crate's own dev-dependency on itself or required-features on the test) and add one sentence to CLAUDE.md.
  2. minor — crates/fluxer-ui/src/lib.rs / testing/offscreen.rs: render() builds iced::Renderer and is now part of the lib that the Windows unit-test binary is built from. #93 showed that a binary that keeps such code fails to load on the Windows runner (opengl32.dll). It should be dropped by the linker like run() is, but that is unverified: the Windows job on this commit has to be seen green before merge. A testing feature (finding 1) would also remove this risk.
  3. minor — testing/mod.rs: CHANNEL_TOLERANCE = 8 is on top of the plan's 0.5 %. At 1280x720, 0.5 % is 4608 pixels, so a missing line of message text or a wrongly coloured presence dot/badge stays under the threshold; the per-channel slack widens that further. Within the plan's numbers, so not blocking; worth knowing when relying on these tests for regressions (smaller per-widget frames would be sharper).
  4. minor — xtask/src/main.rs: only a doc comment changed; the existing step runs every #[ignore]d test in the workspace under the env var, which covers these. Acceptable deviation from the plan's "Modify".
  5. minor — docs/screenshots/README.md: the Electron capture procedure was not tried against the Electron app (implementer's own note); Task 26 will exercise it.

Verdict: APPROVE — zero blocking findings, local ci green. Merge condition for the integrator: both runners green on 480fde6, the Linux job being the first real lavapipe run of the full xtask ci, the Windows job covering finding 2.

## Independent review — Task 24 (screenshot tests), commit 480fde6 Scope: `git diff e93471f..origin/task/24-screenshot-tests` (11 files). **Checks** 1. Plan tests: `login_screen_matches_golden`, `main_screen_with_basic_scenario_matches_golden`, `settings_appearance_matches_golden` all exist in `crates/fluxer-ui/tests/screenshots.rs`, build their state from `fixtures/` (READY, guild_create, message_create, presence_update; no devserver), render at 1280x720 and compare with `DEFAULT_TOLERANCE` = 0.5 %. The three goldens are 1280x720 RGBA and show the expected screens (I looked at each). 2. Interfaces: `testing::render(view: Element<'_, UiMessage>, size: (u32, u32)) -> RgbaImage` (iced wgpu `Headless` renderer, offscreen), `testing::assert_matches_golden(name, &image, tolerance)`, `UPDATE_GOLDEN=1` rewrites. Present as the plan names them (the image is taken by reference). 3. Invariants: no change to `fluxer-core`; no secrets or tokens in code, fixtures or docs; nothing here parses server data. `fluxer-ui` I/O: see finding 1. 4. Review Focus: no item belongs to Task 24. 5. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree with its own target dir: **green** (exit 0; the 3 screenshot tests passed, working tree left clean). This ran on the host's hardware GPU, not on lavapipe; I did not reproduce the lavapipe container run, and both Forgejo jobs for 480fde6 were still pending when I looked once. **Findings** 1. **minor** — `crates/fluxer-ui/src/testing/mod.rs`: golden PNG reads/writes are a second file-I/O path inside the `fluxer-ui` library, compiled unconditionally as `pub mod testing` (not `cfg(test)`, no cargo feature). The plan prescribes this module and its behaviour, the application never calls it, and the crate README documents it, so I do not count it as an invariant break. But `CLAUDE.md` still says the ImageLoader is the single exception and was not updated. Suggested follow-up: put `testing` behind a `testing` cargo feature (enabled by the crate's own dev-dependency on itself or `required-features` on the test) and add one sentence to `CLAUDE.md`. 2. **minor** — `crates/fluxer-ui/src/lib.rs` / `testing/offscreen.rs`: `render()` builds `iced::Renderer` and is now part of the lib that the Windows unit-test binary is built from. #93 showed that a binary that keeps such code fails to load on the Windows runner (opengl32.dll). It should be dropped by the linker like `run()` is, but that is unverified: the Windows job on this commit has to be seen green before merge. A `testing` feature (finding 1) would also remove this risk. 3. **minor** — `testing/mod.rs`: `CHANNEL_TOLERANCE = 8` is on top of the plan's 0.5 %. At 1280x720, 0.5 % is 4608 pixels, so a missing line of message text or a wrongly coloured presence dot/badge stays under the threshold; the per-channel slack widens that further. Within the plan's numbers, so not blocking; worth knowing when relying on these tests for regressions (smaller per-widget frames would be sharper). 4. **minor** — `xtask/src/main.rs`: only a doc comment changed; the existing step runs every `#[ignore]`d test in the workspace under the env var, which covers these. Acceptable deviation from the plan's "Modify". 5. **minor** — `docs/screenshots/README.md`: the Electron capture procedure was not tried against the Electron app (implementer's own note); Task 26 will exercise it. **Verdict: APPROVE** — zero blocking findings, local ci green. Merge condition for the integrator: both runners green on 480fde6, the Linux job being the first real lavapipe run of the full `xtask ci`, the Windows job covering finding 2.
charles manually merged commit 24e7c9d137 into foundation 2026-11-11 18:28:23 +00:00
Sign in to join this conversation.
No description provided.