Skip to content

feat(sessions): add ongoing flag to session type#305

Merged
Amund211 merged 1 commit into
mainfrom
session-ongoing-and-layout-padding
Jun 28, 2026
Merged

feat(sessions): add ongoing flag to session type#305
Amund211 merged 1 commit into
mainfrom
session-ongoing-and-layout-padding

Conversation

@Amund211

@Amund211 Amund211 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Flashlight ships an explicit ongoing boolean 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 / Session gain readonly ongoing: boolean.
  • apiToSession copies it through.
  • addExtrapolatedSessions stamps ongoing: false on every stitched-in gap (extrapolated sessions are never live).
  • Mock makeSession fixture + 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 tsc clean
  • pnpm test:unit — 528/528
  • pnpm oxlint:check clean
  • oxfmt --check clean on changed files

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 28, 2026 14:32
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying rainbow with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: boolean to APISession and Session, and thread it through apiToSession.
  • 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.

@Amund211 Amund211 force-pushed the session-ongoing-and-layout-padding branch from c9f4cc2 to 2fb7c3b Compare June 28, 2026 14:43
@Amund211 Amund211 closed this Jun 28, 2026
@Amund211 Amund211 deleted the session-ongoing-and-layout-padding branch June 28, 2026 14:43
@Amund211 Amund211 changed the title Extract session-detail prereqs: ongoing flag + layout padding feat(sessions): add ongoing flag to session type Jun 28, 2026
@Amund211 Amund211 restored the session-ongoing-and-layout-padding branch June 28, 2026 14:45
@Amund211 Amund211 reopened this Jun 28, 2026
@Amund211 Amund211 requested a review from Copilot June 28, 2026 14:46
@Amund211 Amund211 merged commit f3def54 into main Jun 28, 2026
13 checks passed
@Amund211 Amund211 deleted the session-ongoing-and-layout-padding branch June 28, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/queries/sessions.ts
Comment on lines 33 to 37
start: apiToPlayerDataPIT(apiSession.start),
end: apiToPlayerDataPIT(apiSession.end),
consecutive: apiSession.consecutive,
ongoing: apiSession.ongoing,
extrapolated,
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.

2 participants