Skip to content

feat: flight recorder 3/5 — in-viewer session history - #59

Open
mibrahimdev wants to merge 5 commits into
developfrom
feat/51-session-history
Open

mibrahimdev wants to merge 5 commits into
developfrom
feat/51-session-history

Conversation

@mibrahimdev

Copy link
Copy Markdown
Owner

Summary

Adds in-viewer session history to Sharingan (Issue #51, slice 3/5 of the flight-recorder epic #27). The user can now open Sharingan, tap a session selector pill, and browse previous process lifetimes in the existing Home/Detail UI.

Architecture

SharinganScreen
├── selectedSessionId: String?   (null = Current Session / live)
├── sessionEvents: List<SharinganEvent>?   (null = use store.events StateFlow)
├── activeEvents = sessionEvents ?: liveEvents
├── HomeHeader: session label pill + "↩ Live" pill when viewing past
└── SessionPickerSheet (ModalBottomSheet)
    ├── Current session (● LIVE + count)
    └── Past sessions newest-first (timestamp, eventCount, N failed badge)

Key decisions

  • Store remains live source of truth for the Current Session; Flight Recorder queried on demand for Past Sessions
  • Sharingan.clear() purges only the Current Session's mirrored rows; Past Sessions intact
  • :sharingan-db public API additions are implementation-scoped (consumed by :sharingan via implementation(project(":sharingan-db")), no :sharingan-noop parity tax)
  • iOS auto-start via startPlatformPersistence() expect/actual (Android ContentProvider unchanged)

Changes

Area What changed
GLOSSARY.md Renamed from CONTEXT.md; Session replaces Run; Flight Recorder definition updated
:sharingan-db SessionSummary, selectPastSessions, deleteEventsForSession, currentSessionId, pastSessions(), sessionEvents()
:sharingan internal EventDto.toEvent() decoder, Persistence.pastSessions() / sessionEvents()
:sharingan UI Session selector pill, SessionPickerSheet, past-session rendering, "↩ Live" return pill
iOS startPlatformPersistence() expect/actual, -lsqlite3 linker opts

Evidence

  • Before: Sharingan.clear() deleted all events across all sessions; no way to view past runs.
  • After: Sharingan.clear() deletes only current-session rows; past sessions visible in picker.

Tests passing

  • :sharingan-db:testDebugUnitTest — session-list query newest-first, correct counts, excludes current + 0-event, clear scope
  • :sharingan:testDebugUnitTest — DTO round-trip equality for all 3 protocols
  • :sharingan-db:iosSimulatorArm64Test / :sharingan:iosSimulatorArm64Test — iOS native tests
  • ktlintCheck — no multi-line comments, style compliance
  • checkApiParity — :sharingan ↔ :sharingan-noop parity green
  • apiCheck — BCV dumps match source

Commits

  1. b0e4cb5 docs: align glossary with session history
  2. 00f14aa feat(db): expose current and past session history
  3. e36601e feat(ui): browse past sessions in Sharingan
  4. 724ce39 fix(ios): initialize session persistence
  5. 2bad063 review: address architect feedback

Merge Danger

Door: Two-way (additive feature, no breaking changes to public API)

Blast Radius: Debug-only UI + internal persistence layer. :sharingan-noop parity verified. No consumer-facing breaking changes.

Closes #51
Part of #27

This branch has not been deployed

No deployments
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.

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

1 participant