Skip to content

Show replies inside nested threads on mobile - #2477

Closed
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:agent/mobile-nested-thread-root
Closed

Show replies inside nested threads on mobile#2477
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:agent/mobile-nested-thread-root

Conversation

@BradGroux

@BradGroux BradGroux commented Jul 23, 2026

Copy link
Copy Markdown

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 head M → direct reply C.

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.rs is 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.

@BradGroux
BradGroux marked this pull request as ready for review July 23, 2026 06:12
@BradGroux
BradGroux requested a review from a team as a code owner July 23, 2026 06:12
@BradGroux BradGroux changed the title fix(mobile): load nested thread replies from root Show replies when opening a nested thread on mobile Jul 23, 2026
@BradGroux BradGroux changed the title Show replies when opening a nested thread on mobile Show replies inside nested threads on mobile Jul 23, 2026
@zacklavin11

Copy link
Copy Markdown

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

Co-authored-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <bradgroux@hotmail.com>
@BradGroux
BradGroux force-pushed the agent/mobile-nested-thread-root branch from 970bcc4 to cc429ba Compare July 26, 2026 12:40
@BradGroux

Copy link
Copy Markdown
Author

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-check passed.
  • just mobile-test passed all 656 tests with one intentional skip.
  • just ci passed 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.rs is 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.

@BradGroux

Copy link
Copy Markdown
Author

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.

@BradGroux BradGroux closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Mobile: replies sent in a nested thread never appear — thread query is root-scoped

2 participants