Skip to content

feat(data): seed FakeConversationRepository with 3 fake channels #5

@ilmoniemi

Description

@ilmoniemi

User Story

As a developer building Phase 0 channel-list UI, I want FakeConversationRepository to start with three pre-populated channels so that composables have realistic data to render without each call site having to call createDiscussion + promote in setup.

Context

Phase 0 UI work (channel list screen and downstream) needs fixture data. FakeConversationRepository currently initializes empty (delivered by #4). Three seeded channels with distinct cwd / currentSessionId / lastUsedAt give the channel-list screen something to render against until the Phase 4 backend ships.

The parallel discussions seed (#6) handles isPromoted = false entries; this ticket must leave discussions state untouched.

Acceptance Criteria

  • Three channels (isPromoted = true) populate FakeConversationRepository's initial state on construction — e.g. "Pyrycode Mobile", "Joi Pilates", "Personal" (or similar).
  • Each seeded channel has a distinct cwd, a stable currentSessionId, and a distinct lastUsedAt.
  • observeConversations(Channels) emits all three on first collection.
  • observeConversations(Discussions) emits empty (feat(data): seed FakeConversationRepository with 2 fake discussions #6 runs in parallel and is out of scope here).
  • A new test asserts the three are returned and ordered by lastUsedAt descending.

Technical Notes

  • The existing observeConversations_emitsEmpty_initially_for_all_filters test in FakeConversationRepositoryTest will fail once initial state is non-empty — adjust or replace it as part of this change (count goes from 0 to 3 for Channels; Discussions stays at 0).
  • observeConversations does not currently sort. The ordering AC implies adding a sortedByDescending { it.lastUsedAt } projection inside the existing state.map { ... } block.
  • Use kotlinx.datetime.Clock.System.now() offset by kotlin.time.Duration deltas (or Instant.fromEpochSeconds) so each seed gets a deterministic, distinct lastUsedAt.

Size Estimate

XS — three seed entries in the state initializer, one short sortedByDescending, one new test, one adjusted existing test.

Depends on

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