Skip to content

Flight recorder 3/5: in-viewer session history (browse previous runs) #51

Description

@mibrahimdev

Part of the flight-recorder persistence epic — design: docs/superpowers/specs/2026-08-21-flight-recorder-persistence-design.md, discussion #27. Sequenced after #50.

Deliverable

After this slice: the user opens Sharingan, sees a list of previous sessions, taps one, and browses its logs in the existing list/detail UI.

Scope

  • EventDto.toEvent() decoder — reconstruct public HttpEvent/MqttEvent/BleEvent from the stored blob via their internal constructors. This is the decoder the hand-rolled SharinganExport encoder lacks.
  • Internal query API on PersistenceController: list sessions (id + started_at + counts), load one session's events. Internal — consumed by the in-app viewer, not exposed publicly (deliberate trim of Design session: persistent per-session log storage (flight-recorder) #27 point 8; no noop tax).
  • Session-picker UI in the viewer; selecting a past session renders its decoded events through the existing Home/Detail composables. Follow the project's stateless-Content + VM-wrapper split and Scaffold/insets conventions; previews on stateless composables only.

TDD / acceptance

  • RED→GREEN: DTO encode→decode round-trip reconstructs an equal event for all three protocol types.
  • Session-list query returns launches newest-first with correct event counts.
  • Manual emulator/device check: previous session visible and browsable.
  • checkApiParity green (retrieval is internal).

Activity

  1. mibrahimdev commented on Aug 22, 2026

    @mibrahimdev
    OwnerAuthor

    Carry-forward from slice 2 (#50) dual review: Sharingan.clear() currently clears only the in-memory ring, not persisted rows — after slice 2, "removes all retained events" is a latent lie. Since this slice adds the DB read path, wire clear() to also purge the current session's persisted rows here (and add a test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions