Text chat 16: core navigation, read markers and media playback (#266) #316

Manually merged
charles merged 8 commits from textchat-16-core-navigation-read into textchat 2026-11-13 00:30:13 +00:00
Owner

What

Text chat spec §6.2 "Navigation and read" (#60) and inline media, in fluxer-core:

  • Auto-ack (#60). The UI reports ViewportAtBottom { channel_id, at_bottom }. After every event (once the selection and window focus have taken it in), ReadStates::follow_view acks the selected channel when the window is focused, its list is at the bottom, its loaded history reaches the newest message, and it was not marked unread since it was opened. This is the original's shouldAutoAck. Nothing is acked until the UI reports the bottom, so nothing changes until Text chat 33 emits ViewportAtBottom.
  • New-messages marker. Opening an unread channel sets app.chat.nav.markers[channel] to the read state's last read id. The marker stays while the channel is open. MarkUnread moves the marker and the local read state to the previous loaded message (previousReadableMessageId) and blocks auto-ack until another channel is opened (manualAck). The AckManual request belongs to Text chat 15.
  • Timeline. selectors::timeline adds TimelineItem::NewMessagesMarker and a highlighted field on message rows. selectors::new_messages_bar(&App, channel) -> Option<NewMessagesBar { count, since }> and selectors::jump_to_present(&App, channel) -> bool are new.
  • Jumps. If the target is not loaded, JumpToMessage emits FetchMessages { around: Some(id), limit: 50 }, answered with the new ApiResult::MessagesAround, which replaces the loaded run. The target is highlighted for 2000 ms (Effect::Schedule) once it is shown. Away from the present (ChannelMessages::away_from_present), live messages are not stored and nothing is acked. JumpToPresent reloads the newest page.
  • History cap. At most 200 messages per channel, cut to 100 on the side away from the view: loading older pages drops the newest, live messages drop the oldest.
  • Media. PlayAttachment fetches the audio file (FetchMedia, MediaPurpose::Clip { key: attachment_clip_key(id) }) and plays it with AudioCommand::PlayClip. One attachment plays at a time: starting another or StopAttachment sets the current clip's gain to 0. selectors::media_playback returns a PlaybackModel. OpenMedia/CloseMedia drive the lightbox over the message's image and video attachments (chat::media::media_count). The lightbox closes when its message is deleted.

Testing

  • crates/fluxer-core/tests/chat_navigation.rs: ack_only_when_bottom_visible_and_focused, no_ack_for_unselected_channel, marker_set_from_read_state_on_open, mark_unread_moves_marker, jump_loads_around_and_highlights_2000ms, jump_to_present_reloads_newest, history_capped_at_200_trim_to_100, new_messages_bar_count.
  • crates/fluxer-core/tests/chat_media.rs: play_attachment_one_at_a_time, lightbox_index_navigation.
  • I wrote these tests first and watched them fail to compile against the missing ports. They pass now.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally on Linux. All 32 screenshot goldens are unchanged. No desktop-only tests apply to this task.

Deviations from the plan

  • The plan's media interface says PlayClip { source: PlaybackSource::Attachment(url), .. }, but the merged PlayClip is { clip: ClipRef, gain, tag }. So playback uses the soundboard's clip path: FetchMedia first, then PlayClip with key attachment:<id>. Clip tags start at chat::media::TAG_BASE (2^62) so they never collide with the soundboard's tags. Stopping a clip sets its gain to 0, which is the only stop the audio port has. PlaybackSource::Attachment is not used by the core.
  • Files outside the task's list, each changed as little as compiling allows:
    • effect.rs: the around field on FetchMessages.
    • event.rs: ApiResult::MessagesAround.
    • app.rs: one call to read_state.follow_view after ui.reduce.
    • selectors/{messages.rs,mod.rs}: the timeline rows and re-exports.
    • apps/fluxer/src/runtime.rs: passes around and returns MessagesAround.
    • fluxer-ui screens/main/messages.rs and widgets/message_list.rs: new match arms. The divider is filtered out of the drawn list until Text chat 33 draws it.
    • tests/messages.rs: around: None in two patterns and a describe arm.
    • tests/chat_ports.rs: stubs_emit_nothing skips the navigation actions, as Text chat 12 and 14 did for theirs.
  • The divider is placed only when a read message (one up to the marker) is loaded before it. The original also places it above the first loaded message; here the new-messages bar covers that case. As in the original, the divider does not break message grouping.
  • There is no "load newer" when scrolling down away from the present, because no port exists for it; "Jump to present" reloads instead.
  • The lightbox counts attachments only, not embed images.
  • Attachment gain is a fixed 1.0: the chat context has no output-volume setting.

Closes #266

🤖 Generated with Claude Code

## What Text chat spec §6.2 "Navigation and read" (#60) and inline media, in `fluxer-core`: - **Auto-ack (#60).** The UI reports `ViewportAtBottom { channel_id, at_bottom }`. After every event (once the selection and window focus have taken it in), `ReadStates::follow_view` acks the selected channel when the window is focused, its list is at the bottom, its loaded history reaches the newest message, and it was not marked unread since it was opened. This is the original's `shouldAutoAck`. Nothing is acked until the UI reports the bottom, so nothing changes until Text chat 33 emits `ViewportAtBottom`. - **New-messages marker.** Opening an unread channel sets `app.chat.nav.markers[channel]` to the read state's last read id. The marker stays while the channel is open. `MarkUnread` moves the marker and the local read state to the previous loaded message (`previousReadableMessageId`) and blocks auto-ack until another channel is opened (`manualAck`). The `AckManual` request belongs to Text chat 15. - **Timeline.** `selectors::timeline` adds `TimelineItem::NewMessagesMarker` and a `highlighted` field on message rows. `selectors::new_messages_bar(&App, channel) -> Option<NewMessagesBar { count, since }>` and `selectors::jump_to_present(&App, channel) -> bool` are new. - **Jumps.** If the target is not loaded, `JumpToMessage` emits `FetchMessages { around: Some(id), limit: 50 }`, answered with the new `ApiResult::MessagesAround`, which replaces the loaded run. The target is highlighted for 2000 ms (`Effect::Schedule`) once it is shown. Away from the present (`ChannelMessages::away_from_present`), live messages are not stored and nothing is acked. `JumpToPresent` reloads the newest page. - **History cap.** At most 200 messages per channel, cut to 100 on the side away from the view: loading older pages drops the newest, live messages drop the oldest. - **Media.** `PlayAttachment` fetches the audio file (`FetchMedia`, `MediaPurpose::Clip { key: attachment_clip_key(id) }`) and plays it with `AudioCommand::PlayClip`. One attachment plays at a time: starting another or `StopAttachment` sets the current clip's gain to 0. `selectors::media_playback` returns a `PlaybackModel`. `OpenMedia`/`CloseMedia` drive the lightbox over the message's image and video attachments (`chat::media::media_count`). The lightbox closes when its message is deleted. ## Testing - `crates/fluxer-core/tests/chat_navigation.rs`: `ack_only_when_bottom_visible_and_focused`, `no_ack_for_unselected_channel`, `marker_set_from_read_state_on_open`, `mark_unread_moves_marker`, `jump_loads_around_and_highlights_2000ms`, `jump_to_present_reloads_newest`, `history_capped_at_200_trim_to_100`, `new_messages_bar_count`. - `crates/fluxer-core/tests/chat_media.rs`: `play_attachment_one_at_a_time`, `lightbox_index_navigation`. - I wrote these tests first and watched them fail to compile against the missing ports. They pass now. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally on Linux. All 32 screenshot goldens are unchanged. No desktop-only tests apply to this task. ## Deviations from the plan - The plan's media interface says `PlayClip { source: PlaybackSource::Attachment(url), .. }`, but the merged `PlayClip` is `{ clip: ClipRef, gain, tag }`. So playback uses the soundboard's clip path: `FetchMedia` first, then `PlayClip` with key `attachment:<id>`. Clip tags start at `chat::media::TAG_BASE` (2^62) so they never collide with the soundboard's tags. Stopping a clip sets its gain to 0, which is the only stop the audio port has. `PlaybackSource::Attachment` is not used by the core. - Files outside the task's list, each changed as little as compiling allows: - `effect.rs`: the `around` field on `FetchMessages`. - `event.rs`: `ApiResult::MessagesAround`. - `app.rs`: one call to `read_state.follow_view` after `ui.reduce`. - `selectors/{messages.rs,mod.rs}`: the timeline rows and re-exports. - `apps/fluxer/src/runtime.rs`: passes `around` and returns `MessagesAround`. - `fluxer-ui` `screens/main/messages.rs` and `widgets/message_list.rs`: new match arms. The divider is filtered out of the drawn list until Text chat 33 draws it. - `tests/messages.rs`: `around: None` in two patterns and a `describe` arm. - `tests/chat_ports.rs`: `stubs_emit_nothing` skips the navigation actions, as Text chat 12 and 14 did for theirs. - The divider is placed only when a read message (one up to the marker) is loaded before it. The original also places it above the first loaded message; here the new-messages bar covers that case. As in the original, the divider does not break message grouping. - There is no "load newer" when scrolling down away from the present, because no port exists for it; "Jump to present" reloads instead. - The lightbox counts attachments only, not embed images. - Attachment gain is a fixed 1.0: the chat context has no output-volume setting. Closes #266 🤖 Generated with [Claude Code](https://claude.com/claude-code)
# Conflicts:
#	crates/fluxer-proto/README.md
#	crates/fluxer-proto/src/gateway/events.rs
#	crates/fluxer-proto/src/models/channel.rs
#	crates/fluxer-proto/src/models/mod.rs
#	crates/fluxer-proto/src/models/settings.rs
#	crates/fluxer-proto/tests/models_roundtrip.rs
Refs #266

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-proto/tests/models_roundtrip.rs
Auto-ack of the channel being read (#60), new-messages marker and bar,
jump to a message (FetchMessages around) with a 2000 ms highlight, jump
to present, the 200/100 history cap, inline audio playback through the
clip path and the lightbox state.

Refs #266

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

Independent review: Text chat 16 (core navigation, read markers, media playback)

Reviewed git diff 9fcc13d..origin/textchat-16-core-navigation-read (head bba7b4e) cold.

Checked and fine

  • All 10 tests named in the plan exist (chat_navigation.rs: 8, chat_media.rs: 2) and assert the spec's values: around + limit 50, highlight Effect::Schedule 2000 ms, cap 200 / trim to 100 on both sides, marker = read state's last read id on open, bar count/since, one clip at a time, lightbox index bounds.
  • Interfaces: selectors::{new_messages_bar -> Option<NewMessagesBar { count, since }>, jump_to_present -> bool, media_playback -> Option<PlaybackModel { message_id, attachment_id, position_ms, playing }>}, TimelineItem::NewMessagesMarker + highlighted on message rows, ApiRequest::FetchMessages { around }, OpenMedia/CloseMedia lightbox state all present.
  • Invariants: no new dependency in fluxer-core, no bytes/paths/URLs logged, no new fixtures (the around answer reuses the messages list shape), server data paths do not panic (no indexing on server input; trim indices are bounded by the length check). fluxer-ui changes are match arms only.
  • The PlayClip { clip, gain, tag } deviation (FetchMedia under attachment:<id>, then PlayClip; tags from 2^62) is sound against the merged voice port and the existing runtime FetchMedia arm (32 MiB cap).

Findings

  1. [blocking] Auto-ack ignores what covers the list (Review Focus #6). Navigation::being_read (chat/navigation.rs) claims parity with the original's shouldAutoAck, but drops its blockingModalOpen: isModalOpen || MediaViewer.isOpen and textChatVisible terms (fluxer_app/src/features/read_state/utils/AutoAckPredicate.ts, ChannelMessages.tsx:207-214). The core already holds two of those states: app.ui.settings.is_some() (the settings screen replaces the main view, fluxer-ui/src/app.rs:143) and app.chat.media.lightbox.is_some(). Scenario: user at the bottom of #general, window focused, opens Settings (or the lightbox); new messages arrive and are acked via follow_view although the user never sees them, i.e. "acks a channel the user is not looking at". Fix: require ui.settings.is_none() and chat.media.lightbox.is_none() in being_read (pass &MediaPlayback or a bool), plus a test case for each.

  2. [minor] on_around marks the start reached on any short answer. channel.reached_start = items.len() < PAGE_SIZE (messages.rs, on_around). A short around answer usually means the newer side is short (target near the newest message), not the older side. Jumping (e.g. from search) to a message within ~25 of the newest in a channel not loaded yet gives ~30 items → reached_start = true and away_from_present = false, so ScrolledToOldest never loads older history and "Jump to present" does nothing: history above stays unreachable until a reconnect. The original counts the older side separately (MessagePaginationUtils.ts:36-53, hasMoreBefore = messagesOlder >= expectedOlder). Suggest: reached_start = (messages older than around) < 25 (limit/2), and a test for it.

  3. [minor] New-messages bar gated on the open-time marker. new_messages_bar returns None without a marker, but the original shows the bar whenever unreadCount > 0 in stream phase (ChannelMessages.tsx:634). A channel opened while read, then scrolled up while messages arrive, shows no bar here. Task 33 can take this, or open a follow-up.

  4. [minor] Plan/Task 21 drift. PlaybackSource::Attachment(String) (from Text chat 10) is now unused, and Task 21's Interfaces still say "PlaybackSource::Attachment fetch + play". Please note in the plan (or a follow-up issue) that Task 21 has nothing to wire for attachment playback, so it does not add a dead runtime arm.

  5. [minor] Stop only silences. stop sets the clip's gain to 0; the decoded file keeps playing silently to the end (up to 32 MiB of audio). Acceptable given no StopClip in AudioCommand, but worth a follow-up issue so a stop actually ends the source.

Local CI: not completed in this review run (FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci was still compiling when the review had to be returned and was stopped); the implementer reports it green on bba7b4e, unverified here.

Verdict: Changes requested: 1 blocking (auto-ack while settings or the lightbox covers the list), 4 minor.

## Independent review: Text chat 16 (core navigation, read markers, media playback) Reviewed `git diff 9fcc13d..origin/textchat-16-core-navigation-read` (head bba7b4e) cold. **Checked and fine** - All 10 tests named in the plan exist (`chat_navigation.rs`: 8, `chat_media.rs`: 2) and assert the spec's values: `around` + limit 50, highlight `Effect::Schedule` 2000 ms, cap 200 / trim to 100 on both sides, marker = read state's last read id on open, bar count/since, one clip at a time, lightbox index bounds. - Interfaces: `selectors::{new_messages_bar -> Option<NewMessagesBar { count, since }>, jump_to_present -> bool, media_playback -> Option<PlaybackModel { message_id, attachment_id, position_ms, playing }>}`, `TimelineItem::NewMessagesMarker` + `highlighted` on message rows, `ApiRequest::FetchMessages { around }`, `OpenMedia`/`CloseMedia` lightbox state all present. - Invariants: no new dependency in `fluxer-core`, no bytes/paths/URLs logged, no new fixtures (the `around` answer reuses the messages list shape), server data paths do not panic (no indexing on server input; trim indices are bounded by the length check). `fluxer-ui` changes are match arms only. - The `PlayClip { clip, gain, tag }` deviation (FetchMedia under `attachment:<id>`, then PlayClip; tags from 2^62) is sound against the merged voice port and the existing runtime `FetchMedia` arm (32 MiB cap). **Findings** 1. **[blocking] Auto-ack ignores what covers the list (Review Focus #6).** `Navigation::being_read` (`chat/navigation.rs`) claims parity with the original's `shouldAutoAck`, but drops its `blockingModalOpen: isModalOpen || MediaViewer.isOpen` and `textChatVisible` terms (`fluxer_app/src/features/read_state/utils/AutoAckPredicate.ts`, `ChannelMessages.tsx:207-214`). The core already holds two of those states: `app.ui.settings.is_some()` (the settings screen *replaces* the main view, `fluxer-ui/src/app.rs:143`) and `app.chat.media.lightbox.is_some()`. Scenario: user at the bottom of #general, window focused, opens Settings (or the lightbox); new messages arrive and are acked via `follow_view` although the user never sees them, i.e. "acks a channel the user is not looking at". Fix: require `ui.settings.is_none()` and `chat.media.lightbox.is_none()` in `being_read` (pass `&MediaPlayback` or a bool), plus a test case for each. 2. **[minor] `on_around` marks the start reached on any short answer.** `channel.reached_start = items.len() < PAGE_SIZE` (`messages.rs`, `on_around`). A short `around` answer usually means the *newer* side is short (target near the newest message), not the older side. Jumping (e.g. from search) to a message within ~25 of the newest in a channel not loaded yet gives ~30 items → `reached_start = true` and `away_from_present = false`, so `ScrolledToOldest` never loads older history and "Jump to present" does nothing: history above stays unreachable until a reconnect. The original counts the older side separately (`MessagePaginationUtils.ts:36-53`, `hasMoreBefore = messagesOlder >= expectedOlder`). Suggest: `reached_start` = (messages older than `around`) < 25 (limit/2), and a test for it. 3. **[minor] New-messages bar gated on the open-time marker.** `new_messages_bar` returns `None` without a marker, but the original shows the bar whenever `unreadCount > 0` in stream phase (`ChannelMessages.tsx:634`). A channel opened while read, then scrolled up while messages arrive, shows no bar here. Task 33 can take this, or open a follow-up. 4. **[minor] Plan/Task 21 drift.** `PlaybackSource::Attachment(String)` (from Text chat 10) is now unused, and Task 21's Interfaces still say "`PlaybackSource::Attachment` fetch + play". Please note in the plan (or a follow-up issue) that Task 21 has nothing to wire for attachment playback, so it does not add a dead runtime arm. 5. **[minor] Stop only silences.** `stop` sets the clip's gain to 0; the decoded file keeps playing silently to the end (up to 32 MiB of audio). Acceptable given no `StopClip` in `AudioCommand`, but worth a follow-up issue so a stop actually ends the source. **Local CI:** not completed in this review run (`FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` was still compiling when the review had to be returned and was stopped); the implementer reports it green on bba7b4e, unverified here. **Verdict:** Changes requested: 1 blocking (auto-ack while settings or the lightbox covers the list), 4 minor.
- Navigation::being_read also requires the settings screen and the lightbox closed (the
  original's blockingModalOpen/textChatVisible), so messages arriving under them stay
  unread until they close.
- on_around counts the older side on its own (limit - 1 - limit/2, as
  MessagePaginationUtils.ts) instead of treating any short answer as the start.
- new_messages_bar shows whenever the channel is unread, marker or not
  (ChannelMessages.tsx unreadCount > 0).
- Plan, Task 21: attachment playback is FetchMedia + PlayClip; PlaybackSource::Attachment
  is unused (also noted on the variant).

Refs #266

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

Review round 1 addressed in 897fcb8 (cargo xtask ci green locally with FLUXER_SCREENSHOT_TESTS=1).

Blocking: auto-ack under Settings / lightbox (chat/navigation.rs): Navigation::being_read now also requires ui.settings.is_none() and chat.media.lightbox.is_none(); ReadStates::follow_view takes the media state. Module docs updated. Test no_ack_while_settings_or_lightbox_cover_the_list: a message arriving while Settings or the lightbox is open is not acked, and closing either acks it.

Minor: on_around reached_start (messages.rs): the start is now reached only when the older side is short, counted on its own (messages older than the target < limit - 1 - limit/2 = 24), as calculateAroundPaginationState. Test jump_near_newest_keeps_older_history (45-message answer near the newest keeps older loading; a short older side is the start).

Minor: new-messages bar without a marker (chat/navigation.rs): new_messages_bar now shows whenever the channel is unread (unreadCount > 0), counting loaded messages after the last read one (all when there is none). Extended new_messages_bar_count with a channel opened while read.

Minor: PlaybackSource::Attachment unused: Task 21 Interfaces in the plan now say attachment playback is FetchMedia + PlayClip and to add no arm for PlaybackSource::Attachment; the variant doc says the same.

Minor: Stop leaves the clip playing silently: cross-crate (AudioCommand::StopClip in core, fluxer-audio and the app runtime), so deferred to follow-up #352.

Review round 1 addressed in 897fcb8 (`cargo xtask ci` green locally with `FLUXER_SCREENSHOT_TESTS=1`). **Blocking: auto-ack under Settings / lightbox** (`chat/navigation.rs`): `Navigation::being_read` now also requires `ui.settings.is_none()` and `chat.media.lightbox.is_none()`; `ReadStates::follow_view` takes the media state. Module docs updated. Test `no_ack_while_settings_or_lightbox_cover_the_list`: a message arriving while Settings or the lightbox is open is not acked, and closing either acks it. **Minor: `on_around` reached_start** (`messages.rs`): the start is now reached only when the older side is short, counted on its own (messages older than the target < `limit - 1 - limit/2` = 24), as `calculateAroundPaginationState`. Test `jump_near_newest_keeps_older_history` (45-message answer near the newest keeps older loading; a short older side is the start). **Minor: new-messages bar without a marker** (`chat/navigation.rs`): `new_messages_bar` now shows whenever the channel is unread (`unreadCount > 0`), counting loaded messages after the last read one (all when there is none). Extended `new_messages_bar_count` with a channel opened while read. **Minor: `PlaybackSource::Attachment` unused**: Task 21 Interfaces in the plan now say attachment playback is `FetchMedia` + `PlayClip` and to add no arm for `PlaybackSource::Attachment`; the variant doc says the same. **Minor: Stop leaves the clip playing silently**: cross-crate (`AudioCommand::StopClip` in core, fluxer-audio and the app runtime), so deferred to follow-up #352.
Author
Owner

Merged origin/textchat (cfcec2a) into the branch in aa3c218 to clear the conflicts: kept both sides in messages.rs (upload-aware RetrySend/CancelUpload/DeleteMessage from textchat plus JumpToMessage/JumpToPresent), both re-export lines in selectors/mod.rs, and the navigation actions as one more filter in chat_ports.rs::stubs_emit_nothing. tests/chat_threads.rs (Task 18) needed a TimelineItem::NewMessagesMarker arm in its match. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.

Merged origin/textchat (cfcec2a) into the branch in aa3c218 to clear the conflicts: kept both sides in `messages.rs` (upload-aware `RetrySend`/`CancelUpload`/`DeleteMessage` from textchat plus `JumpToMessage`/`JumpToPresent`), both re-export lines in `selectors/mod.rs`, and the navigation actions as one more filter in `chat_ports.rs::stubs_emit_nothing`. `tests/chat_threads.rs` (Task 18) needed a `TimelineItem::NewMessagesMarker` arm in its match. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally.
Refs #266

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review, Task 16 (core navigation, read markers, media), round 2 (head aa3c218, diff cfcec2a..aa3c218)

Tests (plan Step 1): all 10 tests are present and assert the spec values. They are ack_only_when_bottom_visible_and_focused, no_ack_for_unselected_channel, marker_set_from_read_state_on_open, mark_unread_moves_marker, jump_loads_around_and_highlights_2000ms (around, limit 50, Schedule 2000 ms), jump_to_present_reloads_newest, history_capped_at_200_trim_to_100 (both trim directions), new_messages_bar_count, play_attachment_one_at_a_time and lightbox_index_navigation. Extra tests (no_ack_while_settings_or_lightbox_cover_the_list, jump_near_newest_keeps_older_history) are welcome.

Interfaces: these match the block exactly: TimelineItem::NewMessagesMarker, the highlighted field, new_messages_bar -> Option<NewMessagesBar { count, since }>, jump_to_present -> bool, FetchMessages { around }, media_playback -> Option<PlaybackModel { message_id, attachment_id, position_ms, playing }>, OpenMedia/CloseMedia with index, and the 200/100 cap.

Invariants: fluxer-core gains no dependency and no I/O. The clip key is attachment:{id}, so no URL ends up in the key. Server data cannot cause a panic: the trims index within checked bounds, a foreign channel_id in a page is skipped, and an unknown attachment, a non-audio attachment or an attachment without a URL is ignored. The test JSON uses example.com/media.example and has no secrets. No new fixture files.

Review Focus 6 (#60): satisfied. being_read requires all of these: the channel is selected, the window is focused, neither settings nor the lightbox is open, the channel was not marked unread by hand, the UI reported the bottom, and the loaded run reaches the present with no jump in flight. A channel the user is not looking at is never acked (tested). Acks are idempotent through the local mark.

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: green in the review worktree ("all steps passed"). The branch also merges cleanly with the current origin/textchat (b87bcd9).

Findings

  1. minor: The Interfaces block says PlayClip { source: PlaybackSource::Attachment(url) }. The merged AudioCommand::PlayClip has no source field (clip, gain, tag), so the attachment is played as the soundboard plays its clips (FetchMedia under attachment_clip_key, then PlayClip). The deviation is documented in the plan's Task 21 Produces line and in the PlaybackSource::Attachment doc. Task 21 must follow the amended line. The stopgap PlaybackSource::Attachment arm in apps/fluxer/src/audio_rt.rs (from textchat) is now dead and can go with Task 21.
  2. minor: Stop/switch only sets the gain to 0, so the clip keeps playing silently. This is tracked in follow-up #352 (open) and linked from round 1.
  3. minor: When the user sends while away_from_present (after a jump or a top-side trim), the echo drops the pending record but confirm does not store the message, so the user's own message disappears from the view until "Jump to present". The original jumps to the present on send. Suggest a follow-up, or have Task 25/33 dispatch JumpToPresent on send.
  4. minor: When no Sent message before the target is loaded, mark_unread changes nothing locally. Task 15's AckManual request still goes out, so local and server read state differ until the next READY or MESSAGE_ACK. This is an edge case and does not lose data.
  5. minor: The diff touches apps/fluxer/src/runtime.rs, fluxer-ui (messages.rs, message_list.rs) and tests/chat_threads.rs, all outside the Files list. Each change is the mechanical consequence of the new around field and the new TimelineItem variant, with no new behaviour beyond routing around to MessagesAround. Acceptable.

Verdict: approve. No blocking findings and local CI is green.

## Independent review, Task 16 (core navigation, read markers, media), round 2 (head aa3c218, diff cfcec2a..aa3c218) **Tests (plan Step 1):** all 10 tests are present and assert the spec values. They are `ack_only_when_bottom_visible_and_focused`, `no_ack_for_unselected_channel`, `marker_set_from_read_state_on_open`, `mark_unread_moves_marker`, `jump_loads_around_and_highlights_2000ms` (around, limit 50, `Schedule` 2000 ms), `jump_to_present_reloads_newest`, `history_capped_at_200_trim_to_100` (both trim directions), `new_messages_bar_count`, `play_attachment_one_at_a_time` and `lightbox_index_navigation`. Extra tests (`no_ack_while_settings_or_lightbox_cover_the_list`, `jump_near_newest_keeps_older_history`) are welcome. **Interfaces:** these match the block exactly: `TimelineItem::NewMessagesMarker`, the `highlighted` field, `new_messages_bar -> Option<NewMessagesBar { count, since }>`, `jump_to_present -> bool`, `FetchMessages { around }`, `media_playback -> Option<PlaybackModel { message_id, attachment_id, position_ms, playing }>`, `OpenMedia`/`CloseMedia` with index, and the 200/100 cap. **Invariants:** fluxer-core gains no dependency and no I/O. The clip key is `attachment:{id}`, so no URL ends up in the key. Server data cannot cause a panic: the trims index within checked bounds, a foreign `channel_id` in a page is skipped, and an unknown attachment, a non-audio attachment or an attachment without a URL is ignored. The test JSON uses example.com/media.example and has no secrets. No new fixture files. **Review Focus 6 (#60):** satisfied. `being_read` requires all of these: the channel is selected, the window is focused, neither settings nor the lightbox is open, the channel was not marked unread by hand, the UI reported the bottom, and the loaded run reaches the present with no jump in flight. A channel the user is not looking at is never acked (tested). Acks are idempotent through the local mark. **`FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`:** green in the review worktree ("all steps passed"). The branch also merges cleanly with the current origin/textchat (b87bcd9). ### Findings 1. **minor**: The Interfaces block says `PlayClip { source: PlaybackSource::Attachment(url) }`. The merged `AudioCommand::PlayClip` has no `source` field (`clip, gain, tag`), so the attachment is played as the soundboard plays its clips (`FetchMedia` under `attachment_clip_key`, then `PlayClip`). The deviation is documented in the plan's Task 21 Produces line and in the `PlaybackSource::Attachment` doc. Task 21 must follow the amended line. The stopgap `PlaybackSource::Attachment` arm in `apps/fluxer/src/audio_rt.rs` (from textchat) is now dead and can go with Task 21. 2. **minor**: Stop/switch only sets the gain to 0, so the clip keeps playing silently. This is tracked in follow-up #352 (open) and linked from round 1. 3. **minor**: When the user sends while `away_from_present` (after a jump or a top-side trim), the echo drops the pending record but `confirm` does not store the message, so the user's own message disappears from the view until "Jump to present". The original jumps to the present on send. Suggest a follow-up, or have Task 25/33 dispatch `JumpToPresent` on send. 4. **minor**: When no Sent message before the target is loaded, `mark_unread` changes nothing locally. Task 15's `AckManual` request still goes out, so local and server read state differ until the next READY or MESSAGE_ACK. This is an edge case and does not lose data. 5. **minor**: The diff touches `apps/fluxer/src/runtime.rs`, `fluxer-ui` (`messages.rs`, `message_list.rs`) and `tests/chat_threads.rs`, all outside the Files list. Each change is the mechanical consequence of the new `around` field and the new `TimelineItem` variant, with no new behaviour beyond routing `around` to `MessagesAround`. Acceptable. **Verdict: approve.** No blocking findings and local CI is green.
charles manually merged commit 188f780de1 into textchat 2026-11-13 00:30:13 +00:00
Sign in to join this conversation.
No description provided.