feat(sessions): add ongoing flag to session type#305
Merged
Conversation
Flashlight now ships an explicit `ongoing` boolean on each session. Thread it through the API/domain types (`APISession`/`Session`), `apiToSession`, the mock `makeSession` fixture, and `addExtrapolatedSessions` (which always stitches in `ongoing: false`, since extrapolated gaps are never live). No consumer yet — this is the type-level plumbing so the session detail page can switch its LIVE/ENDED badge on the flag instead of guessing from timestamps. Splitting it out so it can land independently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying rainbow with
|
| Latest commit: |
2fb7c3b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b50f1b9a.rainbow-ctx.pages.dev |
| Branch Preview URL: | https://session-ongoing-and-layout-p.rainbow-ctx.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts two prerequisite changes needed for the upcoming session detail page work: plumbing an explicit ongoing flag through the sessions type layer, and adjusting the app layout to add bottom-of-content spacing that scrolls with page content.
Changes:
- Add
ongoing: booleantoAPISessionandSession, and thread it throughapiToSession. - Ensure extrapolated (stitched gap) sessions are always stamped with
ongoing: false, and update mocks/tests accordingly. - Wrap
<main>children in a padded container to provide bottom spacing that scrolls with content.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/queries/sessions.ts | Adds ongoing to session types and maps it through apiToSession. |
| src/helpers/session.ts | Sets ongoing: false for all extrapolated sessions created by addExtrapolatedSessions. |
| src/mocks/data.ts | Updates makeSession mock factory to include ongoing. |
| src/helpers/session.unit.test.ts | Updates unit test expectations to include ongoing. |
| src/components/Layout.tsx | Wraps <main> children in a Box with bottom padding so spacing scrolls with content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c9f4cc2 to
2fb7c3b
Compare
Comment on lines
33
to
37
| start: apiToPlayerDataPIT(apiSession.start), | ||
| end: apiToPlayerDataPIT(apiSession.end), | ||
| consecutive: apiSession.consecutive, | ||
| ongoing: apiSession.ongoing, | ||
| extrapolated, |
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.
Summary
Flashlight ships an explicit
ongoingboolean per session. This threads it through the type layer so the upcoming session detail page can drive its LIVE/ENDED badge off the flag instead of guessing from timestamps.APISession/Sessiongainreadonly ongoing: boolean.apiToSessioncopies it through.addExtrapolatedSessionsstampsongoing: falseon every stitched-in gap (extrapolated sessions are never live).makeSessionfixture + unit-test expectations updated.Extracted from the session detail page work (#256) so it can land independently. No consumer yet — and there's no runtime validation on the sessions response (it's a plain cast), so this is type-only and safe to merge ahead of the feature.
The layout-padding change that was originally bundled here now lives in its own PR (#306).
Test plan
pnpm tsccleanpnpm test:unit— 528/528pnpm oxlint:checkcleanoxfmt --checkclean on changed files🤖 Generated with Claude Code