feat(data): retain conversations on archive() + expose archived filter + seed (#93)#110
Merged
Conversation
…r + seed (#93) Add `Conversation.archived` flag and flip `FakeConversationRepository.archive()` from removal to a flag mutation, so the upcoming Archived Discussions UI has an observable stream to subscribe to. Extend `ConversationFilter` with an `Archived` variant; `Channels` and `Discussions` predicates gain `!archived` so the existing lists keep their meaning. Seed one archived discussion for manual verification. Closes #93 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
Code Review: #93Decision: PASS FindingsNone. SummaryClean, spec-compliant implementation of the XS data-layer slice.
The architecture spec is also committed at |
…ed (#93) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Conversationgains anarchived: Boolean = falsefield (default keeps every existing construction site source-compatible).FakeConversationRepository.archive(id)flips from removing the conversation to settingarchived = trueviastate.update { … }. ThrowsIllegalArgumentExceptionfor unknown ids (unchanged contract); idempotent on repeat calls.ConversationFiltergainsArchived. Filter matrix:All— everything (no predicate)Channels—isPromoted && !archivedDiscussions—!isPromoted && !archivedArchived—archivedseed-discussion-archived,lastUsedAt = 2026-04-15T12:00:00Z) so the archived stream is non-empty for manual verification.Issue
Closes #93. Unblocks the Archived Discussions UI split from #77.
unarchive()is intentionally out of scope (sibling ticket).Testing
./gradlew test✓./gradlew lint✓./gradlew assembleDebug✓./gradlew connectedAndroidTest— not run (no device/emulator connected; this is pure data-layer code with no instrumented coverage needed).Test changes in
FakeConversationRepositoryTest:Allseed assertion 5→6 and addedArchived = 1assertion.createDiscussion_appearsIn_observeConversations_Allfrom 6→7.archive_removes_from_observeConversations→archive_movesConversation_from_Discussions_to_Archived_andRetainsInStoreper AC.seededDiscussions_remainEmptyid list to include the new archived seed.seededArchivedDiscussion_appearsIn_Archived_butNotIn_Discussions,archive_onUnknownId_throws,archive_isIdempotent.ChannelListViewModelTest.stubRepogains anArchived -> TODO("not used")branch to keep thewhenexhaustive.DiscussionListViewModelTeststubs don't switch on the enum and are unchanged.Architecture compliance
Follows
docs/specs/architecture/93-…mdverbatim: new enum variant rather than a parallel method;!archivedadded toChannelsandDiscussionsfor symmetry;archive()preserveslastUsedAtandisPromoted; noConversationIdvalue type introduced;unarchive()deferred.🤖 Generated with Claude Code