Expose active reference snapshot + session setup to plugin panels#76
Merged
Conversation
Plugin panels (the AI coach) only saw data/laps/selectedLapNumber/course/useKph, so they had no awareness of lap snapshots even when one was loaded as the reference. Add `activeSnapshot` to PluginPanelProps: the loaded reference snapshot as a curated PluginSnapshot with clean-lap samples (capture buffer trimmed) plus the frozen engine/course/vehicle/setup. Computed once in Index from the active snapshot id and threaded through SessionContext to the Coach, Labs, and Profile panel hosts. https://claude.ai/code/session_01L9h3QDcyTEXmVe6tWMio6T
Coverage SummaryLines: 35.53% (2397/6745) · Statements: 34.56% · Functions: 28.94% · Branches: 36.14% Per-file coverage
|
The active snapshot already carries its frozen setup (the baseline), but the setup the driver is currently running wasn't being passed to plugins at all. Add `sessionSetup: VehicleSetup | null` to PluginPanelProps, resolved once in Index from the session's assigned setup id, threaded through SessionContext to the Coach / Labs / Profile hosts. A coach panel can now compare the current setup against the snapshot's frozen baseline. https://claude.ai/code/session_01L9h3QDcyTEXmVe6tWMio6T
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
Make lap snapshots and the current session setup available to plugin panels (the AI coach). Today panels only receive
{ data, laps, selectedLapNumber, course, useKph }, so the coach has zero awareness of snapshots, and no way to see the setup the driver is currently running.This PR adds two fields to
PluginPanelProps:activeSnapshot: PluginSnapshot | nullThe snapshot the user has loaded as the reference lap, or
null. A curated, serializablePluginSnapshotwith:sessionSetup: VehicleSetup | nullThe setup sheet currently assigned to the active session log (via the file manager), or
null— i.e. what the driver is running right now. Pair withactiveSnapshot.setup(the frozen baseline) to compare and coach across sessions.Both are computed once in
Index.tsxand threaded throughSessionContextto all three panel hosts (Coach, Labs, Profile). Existing panels ignore the new fields. The external coach package can now be updated (separately) to consumeprops.sessionSetup+props.activeSnapshot.Scope decisions
lapStartMs/lapEndMsmarkers.Files
plugins/panels.ts(newPluginSnapshottype,activeSnapshot+sessionSetuponPluginPanelProps),contexts/SessionContext.tsx,pages/Index.tsx,tabs/CoachTab.tsx,tabs/LabsTab.tsx,tabs/ProfileTab.tsx,plugins/README.md,CLAUDE.md,CHANGELOG.md.Test plan
npm run lint,npm run typecheck,npm run test:run(737 passing),npm run buildall greenactiveSnapshotis populated for panels; clearing it →nullsessionSetupis populated; clear the assignment →nullactiveSnapshot.samples/engine/setupandsessionSetuphttps://claude.ai/code/session_01L9h3QDcyTEXmVe6tWMio6T