Task 20: message_list virtualised widget, message rows, composer (#20) #61

Manually merged
charles merged 0 commits from task/20-ui-message-list-composer into foundation 2026-11-11 18:28:17 +00:00
Owner

What this builds

The message view of the main screen (Foundation spec §5.2, plan Task 20).

  • widgets::message_list: MessageList, a custom iced widget over TimelineItems that builds and lays out only the rows that show (plus two either side). Rows are built during layout, their widget trees matched by message id. Row heights are an estimate (measure) until a row has been laid out, then the real height, cached per message and width. Pure rules, which the tests assert on: layout(heights, viewport, scroll) -> VisibleRange, anchor_at / scroll_for_anchor (the first visible message keeps its place when rows above are added or change height), ReachTop (on_reach_top once per oldest row within 600 px; scrolling away re-arms it). At its end the list stays at its end; scrolled up, a new message shows the "Jump to present" pill (click: go to the end); a message the user sends goes to the end. Mouse wheel and a draggable scrollbar thumb.
  • widgets::message_row: avatar 40 px, author in the colour of their highest coloured role, HH:MM with the full date as tooltip, content through rich_text, "(edited)", grouped rows with the time in the gutter on hover, Pending at 50 % opacity, Failed with red "Failed to send — Retry" (RetrySend { nonce }).
  • widgets::day_separator, widgets::composer (multi-line, grows up to 50 % of the message view, Enter sends, Shift+Enter new line, DraftChanged on every edit, typing line below).
  • screens::main::messages: State (composer text box, revealed spoilers, Markdown parsed once per message on the snapshot that brings it), model, update -> Vec<UserAction>, view. Wired into main::view and the shell.

How it was tested

  • crates/fluxer-ui/tests/message_list.rs (15 tests). The four of the plan on the pure layout engine (only_visible_rows_are_laid_out, prepend_keeps_anchor_row_in_place, reach_top_fires_once_per_page, typing_summary_strings); model and update tests driven through App::apply with the fixtures (grouping, times with a UTC offset, edited, pending → failed → retry with the store's nonce, empty draft not sent, link clicks); and five headless widget tests that run the real message view through iced's widget protocol (layout, events, draw) with the software renderer, no window: fewer than 30 rows built for 50 messages, the list starts at its end, wheel scrolling, ReachedTop exactly once, the anchor row at the same y after an older page is prepended, the pill appearing and a click on it, sending while scrolled up, the composer growing by 22 px per line up to half of the view. With FLUXER_UI_DUMP_DIR=<dir> these tests also write their frames as PNGs.
  • Manual run (plan step): fluxer --devserver on a private Xvfb display, driven with xdotool: opened #general, scrolled back through all 120 messages (three history pages load on the way, content does not jump), typed a two-line message with Shift+Enter, sent it with Enter; the echo appears and the list goes to its end. Result: docs/screenshots/main-messages.png. I could not capture the Electron side for a side-by-side.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally.
  • The tests were written before the implementation; their first failure was the compile error for the missing modules, I did not run them against stubs.

Deviations from the plan

  • MessageList::new owns its inputs (Vec<TimelineItem>, boxed impl Fn) instead of borrowing slices and &dyn Fn: views here return elements that outlive their inputs. fluxer_ui::view and main::view now tie the element to &'a App / &'a Local, and main::view takes &App as a third argument (the message view has no model of all messages, by design).
  • main::Message gains Messages(messages::Message), so it is no longer Copy/Eq, and Message::into_action returns Option<UserAction> (None for Messages); the shell calls the new main::update(&mut Local, message, &App). tests/main_model.rs (Task 18) is adjusted for the Option.
  • rich_text::rich_text(nodes, ctx) (Task 19) no longer borrows nodes and ctx for the element's lifetime; it never needed to (the span model is owned). Signature only.
  • Typing line: the web app's strings (RollingTypingText.tsx, TypingTierText.ts): names for one, two and three people, "Several people are typing..." from four on, with .... The plan says "Several" from three and ….
  • "(edited)" is a small line under the content, not inline after the last word (rich_text returns a finished element).
  • The anchor is the first visible message, never a day separator (an older page moves the separator of its day).
  • Avatars: rows compute the author's AvatarSource, but fluxer_ui::run has no ImageLoader yet, so RowCtx::images is None and authors get the bundled default avatar. Passing a loader into run touches apps/fluxer and is not in this task's files.
  • messages::State::utc_offset is UTC until something provides the local offset (time's local-offset feature is not enabled; a view does not ask the OS). Times and day separators are therefore UTC for now.

For the reviewer

  • message_list.rs: layout() builds children lazily and reconciles Tree::children by row key; diff() only diffs the pill. This is the part to read closely.
  • Under the tiny-skia backend the avatars are square (iced's software renderer ignores the image border radius of Task 21's widget); with wgpu they are round.
  • Found while testing, not fixed here: #60 (nothing emits MarkRead).

Stacked on: task/18-ui-main-layout, task/19-ui-rich-text, task/21-ui-avatar-image-cache, task/10-core-messages-readstate

Closes #20

🤖 Generated with Claude Code

## What this builds The message view of the main screen (Foundation spec §5.2, plan Task 20). - `widgets::message_list`: `MessageList`, a custom iced widget over `TimelineItem`s that builds and lays out **only the rows that show** (plus two either side). Rows are built during `layout`, their widget trees matched by message id. Row heights are an estimate (`measure`) until a row has been laid out, then the real height, cached per message and width. Pure rules, which the tests assert on: `layout(heights, viewport, scroll) -> VisibleRange`, `anchor_at` / `scroll_for_anchor` (the first visible message keeps its place when rows above are added or change height), `ReachTop` (`on_reach_top` once per oldest row within 600 px; scrolling away re-arms it). At its end the list stays at its end; scrolled up, a new message shows the "Jump to present" pill (click: go to the end); a message the user sends goes to the end. Mouse wheel and a draggable scrollbar thumb. - `widgets::message_row`: avatar 40 px, author in the colour of their highest coloured role, `HH:MM` with the full date as tooltip, content through `rich_text`, "(edited)", grouped rows with the time in the gutter on hover, `Pending` at 50 % opacity, `Failed` with red "Failed to send — Retry" (`RetrySend { nonce }`). - `widgets::day_separator`, `widgets::composer` (multi-line, grows up to 50 % of the message view, Enter sends, Shift+Enter new line, `DraftChanged` on every edit, typing line below). - `screens::main::messages`: `State` (composer text box, revealed spoilers, Markdown parsed once per message on the snapshot that brings it), `model`, `update -> Vec<UserAction>`, `view`. Wired into `main::view` and the shell. ## How it was tested - `crates/fluxer-ui/tests/message_list.rs` (15 tests). The four of the plan on the pure layout engine (`only_visible_rows_are_laid_out`, `prepend_keeps_anchor_row_in_place`, `reach_top_fires_once_per_page`, `typing_summary_strings`); model and `update` tests driven through `App::apply` with the fixtures (grouping, times with a UTC offset, edited, pending → failed → retry with the store's nonce, empty draft not sent, link clicks); and five **headless widget tests** that run the real message view through iced's widget protocol (layout, events, draw) with the software renderer, no window: fewer than 30 rows built for 50 messages, the list starts at its end, wheel scrolling, `ReachedTop` exactly once, the anchor row at the same y after an older page is prepended, the pill appearing and a click on it, sending while scrolled up, the composer growing by 22 px per line up to half of the view. With `FLUXER_UI_DUMP_DIR=<dir>` these tests also write their frames as PNGs. - Manual run (plan step): `fluxer --devserver` on a private Xvfb display, driven with xdotool: opened `#general`, scrolled back through all 120 messages (three history pages load on the way, content does not jump), typed a two-line message with Shift+Enter, sent it with Enter; the echo appears and the list goes to its end. Result: `docs/screenshots/main-messages.png`. I could not capture the Electron side for a side-by-side. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. - The tests were written before the implementation; their first failure was the compile error for the missing modules, I did not run them against stubs. ## Deviations from the plan - `MessageList::new` owns its inputs (`Vec<TimelineItem>`, boxed `impl Fn`) instead of borrowing slices and `&dyn Fn`: views here return elements that outlive their inputs. `fluxer_ui::view` and `main::view` now tie the element to `&'a App` / `&'a Local`, and `main::view` takes `&App` as a third argument (the message view has no model of all messages, by design). - `main::Message` gains `Messages(messages::Message)`, so it is no longer `Copy`/`Eq`, and `Message::into_action` returns `Option<UserAction>` (`None` for `Messages`); the shell calls the new `main::update(&mut Local, message, &App)`. `tests/main_model.rs` (Task 18) is adjusted for the `Option`. - `rich_text::rich_text(nodes, ctx)` (Task 19) no longer borrows `nodes` and `ctx` for the element's lifetime; it never needed to (the span model is owned). Signature only. - Typing line: the web app's strings (`RollingTypingText.tsx`, `TypingTierText.ts`): names for one, two **and three** people, "Several people are typing..." from four on, with `...`. The plan says "Several" from three and `…`. - "(edited)" is a small line under the content, not inline after the last word (`rich_text` returns a finished element). - The anchor is the first visible *message*, never a day separator (an older page moves the separator of its day). - Avatars: rows compute the author's `AvatarSource`, but `fluxer_ui::run` has no `ImageLoader` yet, so `RowCtx::images` is `None` and authors get the bundled default avatar. Passing a loader into `run` touches `apps/fluxer` and is not in this task's files. - `messages::State::utc_offset` is UTC until something provides the local offset (`time`'s `local-offset` feature is not enabled; a view does not ask the OS). Times and day separators are therefore UTC for now. ## For the reviewer - `message_list.rs`: `layout()` builds children lazily and reconciles `Tree::children` by row key; `diff()` only diffs the pill. This is the part to read closely. - Under the tiny-skia backend the avatars are square (iced's software renderer ignores the image border radius of Task 21's widget); with wgpu they are round. - Found while testing, not fixed here: #60 (nothing emits `MarkRead`). Stacked on: task/18-ui-main-layout, task/19-ui-rich-text, task/21-ui-avatar-image-cache, task/10-core-messages-readstate Closes #20 🤖 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
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>
Author
Owner

Independent review: Task 20 (ui-message-list-composer), commit a1c70f1

Reviewed git diff 335350d..a1c70f1 cold. Local cargo xtask ci in a fresh worktree with its own target dir: green (fmt, clippy, deny, tests incl. the 15 tests of tests/message_list.rs; screenshot step skipped because FLUXER_SCREENSHOT_TESTS was not set in my run).

Checks

  1. Plan tests: only_visible_rows_are_laid_out, prepend_keeps_anchor_row_in_place, reach_top_fires_once_per_page, typing_summary_strings all exist and assert on the pure layout engine (layout, anchor_at/scroll_for_anchor, ReachTop, REACH_TOP_DISTANCE = 600). See finding 1 for the typing strings.
  2. Interfaces: all named items exist; signatures deviate (finding 2). Nothing merged depends on the plan's exact shapes and the workspace builds.
  3. Invariants: no change outside fluxer-ui; no network/file I/O added; no tokens or secrets in code or tests; server-controlled values (heights, NaN scroll, non-URL links, time formatting, offsets) go through clamps/checked_*/unwrap_or, no panicking path found in the diff.
  4. Review Focus: none of the five items belongs to this task.
  5. CI: green locally (see above).

Findings

  1. minor crates/fluxer-ui/src/widgets/composer.rs (typing_summary): the plan says "Several people are typing…" from 3 users; the code names three ("A, B and C are typing...") and says "Several" from four, with ASCII "...". I checked the fork (RollingTypingText.tsx, TYPING_ROLLING_MAX_NAMES = 3, TypingTierText.ts): the code matches the web app, so the plan is what is off. Note the web app shows other tier strings for 5+ typists in en-US/en-GB; here it is always "Several people are typing...". Plan text should be amended, or a follow-up opened.
  2. minor interface deviations from the Interfaces block, none breaking a merged consumer: MessageList::new takes Vec<TimelineItem> and impl Fn closures (plus .key()/.on_reach_top() builders) instead of slices/&dyn Fn; composer::view takes a third typing argument and an iced Content; main::view takes &App as third argument; main::Message loses Copy/Eq and into_action returns Option<UserAction>. Tasks 22 and 24 must build against these, not the plan.
  3. minor crates/fluxer-ui/src/app.rs (now_unix): the shell reads SystemTime::now() on every snapshot. Not network or file I/O and it stays out of the views, but it is the first place fluxer-ui reads the OS itself, and relative <t:…> timestamps only refresh when a snapshot arrives. Cleaner if the runtime supplied the time together with the local UTC offset that is already pending.
  4. minor crates/fluxer-ui/src/widgets/message_list.rs (layout): if row heights are still changing after MAX_LAYOUT_PASSES (4), the rows of the final range that were not built in an earlier pass are not built, and nothing requests another layout, so a gap can show until the next event. Needs estimates that are badly off (very long messages on a first scroll); a request_redraw/relayout on the unsettled case would close it.
  5. minor crates/fluxer-ui/src/widgets/message_list.rs (ReachTop / State::heights): a failed history fetch is only retried after scrolling beyond 600 px and back (documented in the test, but a list shorter than 600 px can never do that); the per-channel height cache is never pruned of deleted messages or replaced provisional ids (bounded by channel lifetime).
  6. minor contract: CLAUDE.md asks for side-by-side screenshots with the Electron app on UI PRs; the PR has only the native screenshot. "(edited)" is on its own line rather than inline, avatars are bundled defaults (no ImageLoader in run yet) and times are UTC: all stated in the PR, each should have a follow-up issue linked before merge (only #60, MarkRead, exists as far as I can see).

Read closely as requested: the lazy child building in layout() keeps self.children, Tree::children and the layout node's children in the same order (pill first), reuses row trees by RowKey across rebuilds and relayouts, and resets on key or width change; operate/update/draw/overlay zip the three consistently. No defect found there beyond finding 4.

Verdict: APPROVE (0 blocking, 6 minor; local ci green).

## Independent review: Task 20 (ui-message-list-composer), commit a1c70f1 Reviewed `git diff 335350d..a1c70f1` cold. Local `cargo xtask ci` in a fresh worktree with its own target dir: **green** (fmt, clippy, deny, tests incl. the 15 tests of `tests/message_list.rs`; screenshot step skipped because `FLUXER_SCREENSHOT_TESTS` was not set in my run). ### Checks 1. **Plan tests**: `only_visible_rows_are_laid_out`, `prepend_keeps_anchor_row_in_place`, `reach_top_fires_once_per_page`, `typing_summary_strings` all exist and assert on the pure layout engine (`layout`, `anchor_at`/`scroll_for_anchor`, `ReachTop`, `REACH_TOP_DISTANCE` = 600). See finding 1 for the typing strings. 2. **Interfaces**: all named items exist; signatures deviate (finding 2). Nothing merged depends on the plan's exact shapes and the workspace builds. 3. **Invariants**: no change outside `fluxer-ui`; no network/file I/O added; no tokens or secrets in code or tests; server-controlled values (heights, NaN scroll, non-URL links, time formatting, offsets) go through clamps/`checked_*`/`unwrap_or`, no panicking path found in the diff. 4. **Review Focus**: none of the five items belongs to this task. 5. **CI**: green locally (see above). ### Findings 1. **minor** `crates/fluxer-ui/src/widgets/composer.rs` (`typing_summary`): the plan says "Several people are typing…" from 3 users; the code names three ("A, B and C are typing...") and says "Several" from four, with ASCII "...". I checked the fork (`RollingTypingText.tsx`, `TYPING_ROLLING_MAX_NAMES = 3`, `TypingTierText.ts`): the code matches the web app, so the plan is what is off. Note the web app shows other tier strings for 5+ typists in en-US/en-GB; here it is always "Several people are typing...". Plan text should be amended, or a follow-up opened. 2. **minor** interface deviations from the Interfaces block, none breaking a merged consumer: `MessageList::new` takes `Vec<TimelineItem>` and `impl Fn` closures (plus `.key()`/`.on_reach_top()` builders) instead of slices/`&dyn Fn`; `composer::view` takes a third `typing` argument and an iced `Content`; `main::view` takes `&App` as third argument; `main::Message` loses `Copy`/`Eq` and `into_action` returns `Option<UserAction>`. Tasks 22 and 24 must build against these, not the plan. 3. **minor** `crates/fluxer-ui/src/app.rs` (`now_unix`): the shell reads `SystemTime::now()` on every snapshot. Not network or file I/O and it stays out of the views, but it is the first place `fluxer-ui` reads the OS itself, and relative `<t:…>` timestamps only refresh when a snapshot arrives. Cleaner if the runtime supplied the time together with the local UTC offset that is already pending. 4. **minor** `crates/fluxer-ui/src/widgets/message_list.rs` (`layout`): if row heights are still changing after `MAX_LAYOUT_PASSES` (4), the rows of the final range that were not built in an earlier pass are not built, and nothing requests another layout, so a gap can show until the next event. Needs estimates that are badly off (very long messages on a first scroll); a `request_redraw`/relayout on the unsettled case would close it. 5. **minor** `crates/fluxer-ui/src/widgets/message_list.rs` (`ReachTop` / `State::heights`): a failed history fetch is only retried after scrolling beyond 600 px and back (documented in the test, but a list shorter than 600 px can never do that); the per-channel height cache is never pruned of deleted messages or replaced provisional ids (bounded by channel lifetime). 6. **minor** contract: CLAUDE.md asks for side-by-side screenshots with the Electron app on UI PRs; the PR has only the native screenshot. "(edited)" is on its own line rather than inline, avatars are bundled defaults (no `ImageLoader` in `run` yet) and times are UTC: all stated in the PR, each should have a `follow-up` issue linked before merge (only #60, MarkRead, exists as far as I can see). Read closely as requested: the lazy child building in `layout()` keeps `self.children`, `Tree::children` and the layout node's children in the same order (pill first), reuses row trees by `RowKey` across rebuilds and relayouts, and resets on key or width change; `operate`/`update`/`draw`/`overlay` zip the three consistently. No defect found there beyond finding 4. **Verdict: APPROVE** (0 blocking, 6 minor; local ci green).
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>
Author
Owner

Windows CI failure (runs 89, 90: message_list-*.exe exit code 0xc0000135) diagnosed and fixed; head is now 4febcd1, green on Linux and Windows for both push and pull_request.

  • Cause (verified in the log of run 91): the runner is Windows Server 2025 Standard, Server Core, and has no opengl32.dll. A test binary that builds an iced::Renderer links wgpu's GL backend and imports that DLL statically, so the loader kills it before any test runs.
  • Fix (4febcd1): the five headless widget tests moved to crates/fluxer-ui/tests/message_view.rs, which is #![cfg(not(windows))]; the ten layout, composer and model tests in message_list.rs still run on Windows; shared helpers are in tests/common. Linux still runs all fifteen. Using a tiny-skia-only renderer in the tests was not possible without making every view generic (fluxer_ui::Element is fixed to iced::Renderer).
  • CI (5a7b2c3), kept: a Name missing DLLs step (tools/ci/missing-dlls.ps1) that runs only after a failed Windows job and names the unresolved DLLs of any executable that exited with 0xc0000135.
  • Deferred: #93 (follow-up, ci) — getting these tests back on Windows, and the fact that the shipped fluxer.exe probably cannot start on this runner either, which matters for any future Windows smoke test.
Windows CI failure (runs 89, 90: `message_list-*.exe` exit code `0xc0000135`) diagnosed and fixed; head is now 4febcd1, green on Linux and Windows for both push and pull_request. - **Cause (verified in the log of run 91):** the runner is Windows Server 2025 Standard, Server Core, and has no `opengl32.dll`. A test binary that builds an `iced::Renderer` links wgpu's GL backend and imports that DLL statically, so the loader kills it before any test runs. - **Fix (4febcd1):** the five headless widget tests moved to `crates/fluxer-ui/tests/message_view.rs`, which is `#![cfg(not(windows))]`; the ten layout, composer and model tests in `message_list.rs` still run on Windows; shared helpers are in `tests/common`. Linux still runs all fifteen. Using a tiny-skia-only renderer in the tests was not possible without making every view generic (`fluxer_ui::Element` is fixed to `iced::Renderer`). - **CI (5a7b2c3), kept:** a `Name missing DLLs` step (`tools/ci/missing-dlls.ps1`) that runs only after a failed Windows job and names the unresolved DLLs of any executable that exited with `0xc0000135`. - **Deferred:** #93 (follow-up, ci) — getting these tests back on Windows, and the fact that the shipped `fluxer.exe` probably cannot start on this runner either, which matters for any future Windows smoke test.
charles manually merged commit 24e7c9d137 into foundation 2026-11-11 18:28:17 +00:00
Sign in to join this conversation.
No description provided.