Skip to content

feat(data): retain conversations on archive() + expose archived filter + seed #93

@ilmoniemi

Description

@ilmoniemi

User Story

As an app developer wiring the Archived Discussions UI, I want archived conversations to remain observable through the repository (with a flag, not by deletion), so the UI layer can filter and render an "Archived discussions" list against a realistic data shape.

Context

The forthcoming Archived Discussions view (split from #77) needs to observe conversations matching isPromoted = false AND archived = true and offer a restore action. The repository surface introduced in #3 already exposes archive(conversationId), but the current FakeConversationRepository implementation removes the conversation from the in-memory store entirely (records - conversationId), so archived state is unobservable today and the existing filter enum (All, Channels, Discussions) has no way to surface it.

This ticket converts archive into flag-based retention so the UI slice has something to observe. The trivial inverse — unarchive(conversationId) — lands in a separate sibling ticket that this one unblocks.

Acceptance Criteria

  • Conversation (in data/model/Conversation.kt) gains an archived: Boolean = false field
  • FakeConversationRepository.archive(conversationId) retains the conversation with archived = true instead of removing it from the store
  • ConversationRepository exposes an archived-only observable stream — exact shape is the architect's call (new ConversationFilter variant, additional argument, or other), but Discussions must continue to mean "non-promoted and not archived" so the existing Recent Discussions list stays correct
  • FakeConversationRepository seeds at least one already-archived discussion (isPromoted = false, archived = true) so the archived stream is non-empty for manual verification
  • Unit tests cover: the seeded archived discussion appears in the archived stream and not in the Discussions stream; the existing archive_removes_from_observeConversations test is rewritten to assert the new flag-based semantics (archived items leave the Discussions stream and appear in the archived stream)

Technical Notes

  • The repository interface in data/repository/ConversationRepository.kt uses raw String for conversationId parameters today; there is no ConversationId value type yet. Stay consistent with the existing surface — do not introduce a value type as part of this ticket.
  • Any seed-count assertions in FakeConversationRepositoryTest (e.g. assertEquals(5, ...)) need updating to reflect the new seeded archived discussion.

Size Estimate

XS

Split from

#77

Metadata

Metadata

Assignees

No one assigned

    Labels

    size:xs<30 lines production code; trivial change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions