Skip to content

feat(core): TopicDetailSession as sole topic-detail control plane - #126

Merged
fannnzhang merged 11 commits into
mainfrom
feature/topic-detail-rust-session
Sep 23, 2026
Merged

fannnzhang merged 11 commits into
mainfrom
feature/topic-detail-rust-session

Conversation

@fannnzhang

Copy link
Copy Markdown
Contributor

Summary

  • Introduce a Rust per-topic TopicDetailSession (actor/registry/window/MessageBus) that owns pagination, prefetch, refresh, optimistic mutations, and UI snapshot projection.
  • Thin iOS FireTopicDetailStore and Android TopicDetailViewModel to command + observer consumers; keep local chrome (expand/search/keyboard) on the host.
  • Remove the old fetchTopicDetailPage / loadMoreTopicPosts / source-snapshot host RPC path and sync architecture docs (2026-09-22-ios-topic-detail-session.md, fire-native-architecture.md).

Test plan

  • cargo test -p fire-core -p fire-models -p fire-uniffi-topics (already green locally)
  • iOS: open topic detail, anchored unread scroll, load-more, like/reaction/reply, MessageBus live refresh, leave/re-enter same topic
  • iOS: LoginRequired on detail path triggers cookie resync → headless reauth → completeReadPathLogin without logout
  • Android: same open/load-more/mutation/observer flows; confirm ViewModel no longer calls page-fetch RPC
  • Home row counts patch after detail interactions; three-tier in-place update tokens still fold local chrome correctly

Made with Cursor

fannnzhang and others added 11 commits September 22, 2026 17:38
Move pagination, prefetch, MessageBus refresh, and mutation reconcile into a
Rust per-topic session with UI snapshots, and thin iOS/Android hosts to
command/observer consumers while removing the old page-fetch RPC path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Format and clippy-clean the new Rust modules, rename session handle
close to release for Kotlin AutoCloseable, fix Android unread decision
FFI name, and regenerate Fire.xcodeproj for the new Swift snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
xcodegen only includes Generated/FireUniFfi when those files exist;
regenerate with stubs so CI's post-artifact project check matches.

Co-authored-by: Cursor <cursoragent@cursor.com>
Profile and route hosts still read topicDetailStore after it became private,
which broke the iOS Test CI compile.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fire targets iOS and Android only; the windows-latest host-test job
was unused product coverage and wasted CI minutes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Mark topic-detail open/cancel/close as nonisolated on FireSessionStore so
the MainActor store can open handles synchronously, and replace the
four-UInt64 tuple with an Equatable revision fingerprint for Combine.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use camelCase topicId/postId labels, read vote/flag state from UI
snapshots, and accept TopicDetailTypingUserState in the assembler.

Co-authored-by: Cursor <cursoragent@cursor.com>
Derive owned/mutating post state from UI snapshots, and fix short-circuit
await plus actor-isolated completeReadPathLogin in applySession.

Co-authored-by: Cursor <cursoragent@cursor.com>
The non-snapshot branch was missing an explicit return, which failed
the Xcode 27 Swift compile in iOS Test.

Co-authored-by: Cursor <cursoragent@cursor.com>
The projection helper had a local binding before constructing
TopicPostState, so Swift required an explicit return.

Co-authored-by: Cursor <cursoragent@cursor.com>
postLayoutContentToken omitted return on the non-snapshot path, which
failed the Swift compile under Xcode 27.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fannnzhang
fannnzhang merged commit e7de5e9 into main Sep 23, 2026
11 checks passed
@fannnzhang
fannnzhang deleted the feature/topic-detail-rust-session branch September 23, 2026 04:43
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.

1 participant