Show replies inside nested threads on mobile
Fixes #2415.
What mobile users saw
Opening a reply as the head of a nested thread showed no direct replies, even when those replies existed on the relay.
Why it happened
ThreadDetailPage asked threadRepliesProvider for relay history using the nested head ID. Relay thread history is keyed by the original root event, so the query returned no history for that nested head.
The page already knew the effective root later in the build and already filtered the result down to direct children. The history query was using the wrong ID.
What changed
- Query root-scoped history with the original thread root.
- Keep the existing direct-child filter so the nested view still shows only replies to the selected head.
- Add a Flutter widget regression for root
R→ nested headM→ direct replyC.
How this was tested
The test needed to distinguish two separate identities: relay history is scoped to the original root, while the nested screen must still render only direct children of the selected nested head. Testing only the rendered reply would not prove the relay query used the correct event ID.
Focused regression coverage
The Flutter widget regression constructs root R, nested head M, and direct reply C. Before the production fix, it expected the relay filter #e == [R] and received [M]. With the fix, the provider queries history using R, the existing child filter selects replies to M, and C renders in the nested view.
The focused proof is a widget-level relay-history regression. It validates the query and render contract without claiming a live-relay or physical-device end-to-end test.
Current rebased head
Verified at exact PR head cc429baa8be179d44d35cb40579e79f3e80f323d, rebased onto origin/main at dd222a509b156ba52ed3219e895d7bf1cf322c92:
just mobile-check— formatting unchanged, analyzer clean, and mobile file-size checks passed.just mobile-test— 656 passed, one skipped.just ci— Rust formatting and workspace Clippy passed; Desktop dependency-policy and Biome checks passed. The aggregate gate then stopped on an unchanged upstream baseline:desktop/src-tauri/src/managed_agents/runtime.rsis 2,220 lines against its 2,216-line ratchet. This PR does not modify that file.
The rebase conflict was limited to the shared mobile test helper after a newer day-divider regression landed. The resolution preserves both the upstream day-divider coverage and this nested-thread regression.
User impact bump
Hitting this in production on phone: nested-thread replies show on desktop / exist on the relay, but the mobile nested thread stays empty. Makes mobile feel broken for any non-top-level conversation.
Fix in this PR looks right and small (query with threadHead.rootId ?? threadHead.id, keep the existing direct-child filter + regression).
Blocker right now: GitHub reports mergeable: CONFLICTING / mergeStateStatus: DIRTY against current main. Branch is ~3 days old and has drifted. No human review yet (REVIEW_REQUIRED, zero reviews).
Would love a rebase + re-check so this can land — high mobile usability hit relative to diff size.
Refs: #2415
Thanks for the bump — the conflict report was accurate and is now resolved.
I rebased the branch onto current main (dd222a50) and force-updated the PR to cc429baa. The conflict was limited to the shared mobile test helper after a newer day-divider regression landed; the resolution preserves both that upstream coverage and this nested-thread regression.
Current verification:
- GitHub reports
mergeable: MERGEABLE; the PR remains blocked only on required human review. just mobile-checkpassed.just mobile-testpassed all 656 tests with one intentional skip.just cipassed Rust formatting/workspace Clippy and Desktop dependency-policy/Biome checks, then stopped at an unchanged upstream file-size baseline:desktop/src-tauri/src/managed_agents/runtime.rsis 2,220 lines against its 2,216-line ratchet. This PR does not modify that file.
I also updated the PR body so the head SHA, current test counts, rebase resolution, and aggregate-gate exception are explicit.
This fix was correct when submitted, but current main now contains the same user-visible repair through #2103 (32ead9310) plus broader local/optimistic reply handling and navigation coverage.
The current implementation queries relay history with threadHead.rootId ?? threadHead.id, then keeps the nested-head filtering behavior. Rebasing this branch would duplicate that code and its regression rather than add a distinct fix.
I am closing this PR as superseded, not rejected. The originating issue can be validated against a build containing #2103; this comment does not claim that every released mobile build already includes the fix.