Skip to content

OPE-28: Refactor message store and domain markdown preparation - #18

Merged
ivanfenenko merged 6 commits into
mainfrom
feature/message-store-content-preparer
Jun 28, 2026
Merged

ivanfenenko merged 6 commits into
mainfrom
feature/message-store-content-preparer

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Jun 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Replace MessageLiveStore with MessageSync + InMemoryMessageStore behind MessageRepository on both platforms.
  • Add MessageContentPreparer and DisplayMessagePipeline so Session Chat observes DisplayMessage rows (message + optional rendered markdown) instead of parsing in the UI timeline.
  • Split Session Chat into timeline/composer/status-bar regions; remove RenderedMarkdownMapper from the UI layer.
  • Document the new architecture under docs/features/message-store/.
  • Fix Bugbot findings tracked in OPE-28.

Test plan

  • Android ./gradlew :app:assembleDebug
  • Android unit tests: MessageContentPreparerTest, MessageSyncTest, SessionChatViewModelTest (2 flaky timing cases in full suite; pass in isolation)
  • iOS xcodebuild build -scheme "OpenCode Mobile" -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO
  • iOS OpenCode MobileTests on simulator
  • Manual Session Chat: load history, send prompt, streaming assistant reply, reconnect refresh

Linear: OPE-28

ivanfenenko and others added 6 commits June 28, 2026 10:43
Replace MessageLiveStore with MessageSync/InMemoryMessageStore behind MessageRepository, add DisplayMessagePipeline and MessageContentPreparer so Session Chat observes display-ready rows instead of enriching in the UI timeline.

Co-authored-by: Cursor <[email protected]>
Emit empty message lists after SSE removal so Session Chat can reach the empty timeline state, and mark MessageSyncTests helper as @mainactor for test compilation.

Co-authored-by: Cursor <[email protected]>
…nfo.

Move abort/stop into SessionChatComposer, replace SessionChatStatusBar with SessionInfo for session id, SSE connection, work status, and context usage, and slim the ViewModel merge to three feature regions on both platforms.

Co-authored-by: Cursor <[email protected]>
Persist composer model/variant per server, worktree, and session; restore cached selection before history hints. Move Android cache orchestration into SessionChatComposer and document ViewModel facade guardrails so regional ownership stays explicit.

Co-authored-by: Cursor <[email protected]>
Move iOS cache orchestration into SessionChatComposer, add stale-cache notices on both platforms, and cover re-bind, fallback, and clear-data paths with tests and docs updates.

Co-authored-by: Cursor <[email protected]>
Apply cached model selection on empty/error timelines, route MessageSync fetch failures through domain error mapping, and reset Session Chat UI state immediately on bind to avoid mixed-session flashes.

Co-authored-by: Cursor <[email protected]>
@ivanfenenko
ivanfenenko merged commit 4bde79d into main Jun 28, 2026
@ivanfenenko ivanfenenko changed the title Refactor message store and domain markdown preparation OPE-28: Refactor message store and domain markdown preparation Jun 28, 2026
@linear-code

linear-code Bot commented Jun 28, 2026

Copy link
Copy Markdown
OPE-28 Fix Bugbot findings for session bind, model cache, and message errors

Address three Bugbot findings from PR #18 review on the message-store refactor branch.

Shipped:

  • Apply persisted SessionModelSelection on empty/error timelines instead of skipping cache.
  • Route MessageSync list fetch failures through MessageDomainAdapter.mapError on Android and iOS.
  • Reset SessionChatUiState immediately on bind to avoid mixed-session UI flashes.
  • Added Android tests: loadMessages_empty_restoresCachedModelSelection, bind_resetsUiStateBeforeRegionsFinish.

PR: ivanfenenko/opencode-mobile#18

Docs: docs/features/session-chat/progress.md, docs/features/model-selection/progress.md

@ivanfenenko
ivanfenenko deleted the feature/message-store-content-preparer branch October 26, 2026 14:05
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