Skip to content

feat: move remaining widgets to channels - #670

Merged
tariknz merged 3 commits into
mainfrom
feat/remaining-telemetry-channels
Aug 9, 2026
Merged

feat: move remaining widgets to channels#670
tariknz merged 3 commits into
mainfrom
feat/remaining-telemetry-channels

Conversation

@tariknz

@tariknz tariknz commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Description

Completes the penultimate Phase 4 migration described in docs/ARCHITECTURE_REVIEW.md and docs/IMPLEMENTATION_PLAN.md.

  • Moves Standings, Relative, Sector Delta, Information Bar, Weather, Wind, Lap Time Log, and their shared updaters off the legacy renderer telemetry firehose.
  • Reuses the existing standings, session timing, session bar, and track state snapshots for data they already own.
  • Adds a demand-driven 25 Hz lap-log.snapshot for Lap Time Log's distinct full-precision inputs, wired through live, curated-tape, mock, IPC, and browser-source channel paths.
  • Makes Telemetry Inspector the only explicit widget that still requests raw legacy telemetry. All normal dashboard widgets now declare channel/session dependencies and can run without TelemetryProvider.
  • Extends recorded replay validation to 14 isolated probes and updates channel-backed Storybook fixtures.

Validation:

  • npm run lint
  • npm run test -- --no-coverage — 1,215 passed, 1 skipped
  • npm run test:replay:curated — 36,000 frames, 70 session revisions, 14 probes
  • npm run build-storybook
  • git diff --check

Architecture pre-PR checklist:

  • N1 — no new synchronous filesystem I/O
  • N2 — no new frontend imports from src/app
  • N3 — no new cross-widget imports
  • N4 — no new raw IPC handlers
  • R2.1/R2.2 — raw renderer telemetry subscriptions removed from normal widgets
  • R3.1 — no new renderer session-derived store
  • R4.1 — existing typed channel bridge reused
  • R6.1 — no storage changes
  • R7.1 — widgets remain channel consumers
  • R8.1 — no settings-shape changes
  • R10.1 — no native-code changes
  • R11.1 — no direct console logging
  • R13.1 — processor runtime metrics added
  • R14.1 — processor and runtime tests added
  • Storybook fixtures updated for migrated widgets

Screenshots

Before

Normal renderers containing any remaining unmigrated widget mounted TelemetryProvider and received the legacy telemetry payload at the SDK loop rate.

After

Normal widgets consume only their declared typed snapshots. Telemetry Inspector retains the explicit development/debug raw-stream path. No intentional visual changes.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Performance improvement
  • Refactoring (no functional changes)
  • Documentation update
  • Dependency update

Checklist

  • I have discussed this change in the discord server
  • I have tested this in iRacing (either in an online session or with AI)
  • All tests pass locally via npm test
  • I have added tests that prove my fix is effective or that my feature works
  • I have run npm run lint and fixed any issues
  • I have performed a self-review of my own code
  • I have added/updated Storybook stories for visual changes
  • I have updated the README.md (if applicable)
  • I have updated defaultDashboard.ts if introducing new widgets or configurations (if applicable)

Summary by CodeRabbit

  • New Features
    • Added a unified lap-time view with best-lap history, lap validity, incidents, and session details.
    • Expanded standings with driver positions, lap times, pit-stop data, push-to-pass status, and session timing.
    • Added relative humidity to session weather information.
    • Added session and track-state data for more widgets, including weather, wind, flags, and sector displays.
  • Bug Fixes
    • Improved data clearing and state handling when sessions end or connections are interrupted.
  • Tests
    • Added coverage for lap logging, replay validation, widget configuration, and snapshot behavior.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@tariknz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 978fbeb6-e973-4ab2-88e1-e4367713764d

📥 Commits

Reviewing files that changed from the base of the PR and between 1ee6044 and 6154bfc.

📒 Files selected for processing (7)
  • src/frontend/components/SectorDelta/widgetRuntimeDefinition.ts
  • src/frontend/components/Standings/hooks/useSessionLapCount.tsx
  • src/frontend/components/Standings/hooks/useTrackTemperature.tsx
  • src/frontend/components/Weather/hooks/useTrackTemperature.tsx
  • src/frontend/context/CarSpeedStore/TopSpeedStoreUpdater.tsx
  • test-data/telemetry/ai-race-10min.golden.json
  • tools/telemetry-replay/track-state-probe.ts
📝 Walkthrough

Walkthrough

The change adds typed session-bar, standings, track-state, and lap-log snapshot channels. It introduces demand-driven lap-log processing, migrates frontend consumers from raw telemetry, updates widget runtime definitions and Storybook fixtures, and extends replay validation.

Changes

Telemetry snapshot processing

Layer / File(s) Summary
Snapshot contracts and processing
src/types/channels/channel.ts, src/app/processors/*
Adds snapshot fields and the lap-log.snapshot contract. Implements lap-log processing, lifecycle handling, and versioned publication.
Runtime integration and replay validation
src/app/bridge/iracingSdk/..., tools/telemetry-replay/*
Wires LapLogRuntime into SDK bridges and extends replay probes and curated validation.
Frontend snapshot consumers
src/frontend/components/..., src/frontend/context/...
Replaces raw telemetry reads with typed snapshot hooks across lap timing, standings, weather, track state, and shared stores.
Widget wiring and Storybook fixtures
src/frontend/components/*/widgetRuntimeDefinition.ts, *.stories.tsx, src/frontend/widgetRuntime.spec.tsx, .storybook/*
Adds channel subscriptions, disables legacy telemetry where applicable, and supplies snapshot fixtures.
Migration plan and shared channel wiring
docs/IMPLEMENTATION_PLAN.md, src/frontend/context/ChannelStore/*
Updates migration status and exports the lap-log snapshot hook.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SDKBridge
  participant LapLogRuntime
  participant LapLogProcessor
  participant ChannelStore
  participant LapTimeLog
  SDKBridge->>LapLogRuntime: forward telemetry and session events
  LapLogRuntime->>LapLogProcessor: process active frames
  LapLogProcessor-->>LapLogRuntime: return versioned LapLogSnapshot
  LapLogRuntime->>ChannelStore: publish lap-log.snapshot
  ChannelStore-->>LapTimeLog: provide useLapLogSnapshot data
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: migrating the remaining widgets from legacy telemetry to channels.
Description check ✅ Passed The description covers the migration scope, implementation details, testing results, screenshots, change types, and checklist status.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/remaining-telemetry-channels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tariknz
tariknz marked this pull request as ready for review August 9, 2026 00:29

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🧹 Nitpick comments (3)
src/frontend/context/CarSpeedStore/TopSpeedStoreUpdater.tsx (1)

13-20: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Depend on the snapshot fields, not the snapshot object.

The effect depends on snapshot. The channel publishes a new snapshot object on each tick, so the effect runs at the channel rate. useTopSpeedStore.setState receives a new object each time, so every store subscriber re-renders even when the three values are unchanged.

TrackTemperatureStoreUpdater.tsx (line 12) already uses scalar dependencies. Apply the same pattern here.

♻️ Proposed fix to use scalar dependencies
   const snapshot = useSessionBarSnapshot();
+  const lastLapTopSpeed = snapshot?.lastLapTopSpeed;
+  const sessionBestTopSpeed = snapshot?.sessionBestTopSpeed;
+  const sessionNum = snapshot?.sessionNum;
 
   useEffect(() => {
-    if (!enabled || !snapshot) return;
+    if (!enabled || lastLapTopSpeed === undefined) return;
     useTopSpeedStore.setState({
-      lastLapTopSpeed: snapshot.lastLapTopSpeed,
-      sessionBestTopSpeed: snapshot.sessionBestTopSpeed,
-      sessionNum: snapshot.sessionNum,
+      lastLapTopSpeed,
+      sessionBestTopSpeed,
+      sessionNum,
     });
-  }, [enabled, snapshot]);
+  }, [enabled, lastLapTopSpeed, sessionBestTopSpeed, sessionNum]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/frontend/context/CarSpeedStore/TopSpeedStoreUpdater.tsx` around lines 13
- 20, Update the useEffect in the TopSpeedStoreUpdater component to depend on
snapshot.lastLapTopSpeed, snapshot.sessionBestTopSpeed, and snapshot.sessionNum
individually rather than the snapshot object. Preserve the existing enabled and
snapshot guard and setState fields, following the scalar-dependency pattern used
by TrackTemperatureStoreUpdater.
src/frontend/components/Standings/hooks/useSessionLapCount.tsx (1)

3-13: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Type EMPTY against SessionTimingSnapshot.

EMPTY omits required snapshot fields, so useSessionLapCount() returns a drift-prone union type. Use satisfies SessionTimingSnapshot so missing or renamed fields fail at compile time.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/frontend/components/Standings/hooks/useSessionLapCount.tsx` around lines
3 - 13, Type the EMPTY fallback against SessionTimingSnapshot by applying
satisfies SessionTimingSnapshot to its definition. Ensure all required snapshot
fields are present and correctly named while preserving useSessionLapCount’s
existing fallback behavior.
src/frontend/components/Standings/hooks/useTrackTemperature.tsx (1)

4-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated temperature-unit union.

UseTrackTemperatureOptions declares the same inline union twice. Define one TemperatureUnit alias and use it for both properties.

Proposed refactor
+type TemperatureUnit = 'Metric' | 'Imperial';
+
 interface UseTrackTemperatureOptions {
-  airTempUnit?: 'Metric' | 'Imperial';
-  trackTempUnit?: 'Metric' | 'Imperial';
+  airTempUnit?: TemperatureUnit;
+  trackTempUnit?: TemperatureUnit;
 }

As per coding guidelines, use type aliases for union types.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/frontend/components/Standings/hooks/useTrackTemperature.tsx` around lines
4 - 7, Define a shared TemperatureUnit type alias for the 'Metric' | 'Imperial'
union, then update both airTempUnit and trackTempUnit in
UseTrackTemperatureOptions to use that alias.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/processors/lapLogRuntime.ts`:
- Around line 21-40: Require a SessionLifecycle in LapLogRuntime’s constructor
and remove the optional lifecycle branch, ensuring the existing onLifecycle
handlers for sessionNumChange and disconnect are always registered. Update all
LapLogRuntime construction sites to provide the lifecycle rather than allowing
undefined, preserving snapshot cleanup on disconnect.

In `@src/frontend/components/SectorDelta/widgetRuntimeDefinition.ts`:
- Around line 7-12: Update the SectorDelta runtime definition’s channel
configuration so track-state.snapshot uses its declared max/default processor
rate instead of inheriting ratePreset: 'static' with an undefined rate. Add the
channel-specific rate override supported by the widget runtime, while leaving
the other channels and static preset unchanged.

In `@src/frontend/components/Standings/hooks/useTrackTemperature.tsx`:
- Around line 13-19: Keep missing temperatures nullable instead of converting
them to zero: in src/frontend/components/Standings/hooks/useTrackTemperature.tsx
lines 13-19, check trackTempVal before applying any fallback; at lines 29-31,
apply the same treatment to airTempVal; and in
src/frontend/components/Weather/hooks/useTrackTemperature.tsx lines 13-15,
preserve both nullable values until formatting so unavailable temperatures
remain represented correctly.

---

Nitpick comments:
In `@src/frontend/components/Standings/hooks/useSessionLapCount.tsx`:
- Around line 3-13: Type the EMPTY fallback against SessionTimingSnapshot by
applying satisfies SessionTimingSnapshot to its definition. Ensure all required
snapshot fields are present and correctly named while preserving
useSessionLapCount’s existing fallback behavior.

In `@src/frontend/components/Standings/hooks/useTrackTemperature.tsx`:
- Around line 4-7: Define a shared TemperatureUnit type alias for the 'Metric' |
'Imperial' union, then update both airTempUnit and trackTempUnit in
UseTrackTemperatureOptions to use that alias.

In `@src/frontend/context/CarSpeedStore/TopSpeedStoreUpdater.tsx`:
- Around line 13-20: Update the useEffect in the TopSpeedStoreUpdater component
to depend on snapshot.lastLapTopSpeed, snapshot.sessionBestTopSpeed, and
snapshot.sessionNum individually rather than the snapshot object. Preserve the
existing enabled and snapshot guard and setState fields, following the
scalar-dependency pattern used by TrackTemperatureStoreUpdater.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 671130d6-c2fe-4a33-a759-aaec4d37580c

📥 Commits

Reviewing files that changed from the base of the PR and between cc4dbe3 and b4366da.

📒 Files selected for processing (65)
  • .storybook/index.ts
  • .storybook/sessionBarSnapshot.ts
  • docs/IMPLEMENTATION_PLAN.md
  • src/app/bridge/iracingSdk/iracingSdkBridge.ts
  • src/app/bridge/iracingSdk/mock-data/mockSdkBridge.ts
  • src/app/processors/LapLogProcessor.spec.ts
  • src/app/processors/LapLogProcessor.ts
  • src/app/processors/SessionBarProcessor.ts
  • src/app/processors/StandingsProcessor.ts
  • src/app/processors/lapLogRuntime.spec.ts
  • src/app/processors/lapLogRuntime.ts
  • src/frontend/components/CornerNameOverlay/widgetRuntimeDefinition.ts
  • src/frontend/components/Flag/widgetRuntimeDefinition.ts
  • src/frontend/components/GarageCover/widgetRuntimeDefinition.ts
  • src/frontend/components/HeartRate/widgetRuntimeDefinition.ts
  • src/frontend/components/InformationBar/widgetRuntimeDefinition.ts
  • src/frontend/components/LapTimeLog/hooks/useLapTimeLog.ts
  • src/frontend/components/LapTimeLog/widgetRuntimeDefinition.ts
  • src/frontend/components/Relative/widgetRuntimeDefinition.ts
  • src/frontend/components/SectorDelta/SectorDelta.stories.tsx
  • src/frontend/components/SectorDelta/SectorDelta.tsx
  • src/frontend/components/SectorDelta/components/SectorProgressIndicator.tsx
  • src/frontend/components/SectorDelta/hooks/useCarouselWindow.ts
  • src/frontend/components/SectorDelta/widgetRuntimeDefinition.ts
  • src/frontend/components/Standings/Relative.stories.tsx
  • src/frontend/components/Standings/Standings.stories.tsx
  • src/frontend/components/Standings/components/TitleBar/TitleBar.tsx
  • src/frontend/components/Standings/hooks/useBrakeBias.tsx
  • src/frontend/components/Standings/hooks/useDriverIncidents.tsx
  • src/frontend/components/Standings/hooks/useDriverPositions.tsx
  • src/frontend/components/Standings/hooks/usePrecipitation.tsx
  • src/frontend/components/Standings/hooks/useSessionBestLapTime.tsx
  • src/frontend/components/Standings/hooks/useSessionCurrentTime.tsx
  • src/frontend/components/Standings/hooks/useSessionLapCount.tsx
  • src/frontend/components/Standings/hooks/useTrackTemperature.tsx
  • src/frontend/components/Standings/hooks/useTrackWetness.tsx
  • src/frontend/components/Standings/widgetRuntimeDefinition.ts
  • src/frontend/components/TelemetryInspector/widgetRuntimeDefinition.ts
  • src/frontend/components/TwitchChat/widgetRuntimeDefinition.ts
  • src/frontend/components/Weather/Weather.stories.tsx
  • src/frontend/components/Weather/Weather.tsx
  • src/frontend/components/Weather/hooks/useTrackTemperature.tsx
  • src/frontend/components/Weather/widgetRuntimeDefinition.ts
  • src/frontend/components/Wind/Wind.stories.tsx
  • src/frontend/components/Wind/Wind.tsx
  • src/frontend/components/Wind/widgetRuntimeDefinition.ts
  • src/frontend/context/BattleGapStore/BattleGapStoreUpdater.tsx
  • src/frontend/context/CarSpeedStore/TopSpeedStoreUpdater.tsx
  • src/frontend/context/ChannelStore/index.ts
  • src/frontend/context/ChannelStore/useLapLogSnapshot.ts
  • src/frontend/context/PitLapStore/PitLapStoreUpdater.tsx
  • src/frontend/context/PushToPassStore/PushToPassStoreUpdater.tsx
  • src/frontend/context/TrackTemperatureStore/TrackTemperatureStoreUpdater.spec.tsx
  • src/frontend/context/TrackTemperatureStore/TrackTemperatureStoreUpdater.tsx
  • src/frontend/context/shared/useThrottledWeather.tsx
  • src/frontend/context/shared/useTotalRaceLaps.tsx
  • src/frontend/context/shared/useTotalRaceTime.tsx
  • src/frontend/context/shared/useTotalRaceValue.tsx
  • src/frontend/widgetRuntime.spec.tsx
  • src/types/channels/channel.ts
  • test-data/telemetry/ai-race-10min.golden.json
  • tools/telemetry-replay/lap-log-probe.ts
  • tools/telemetry-replay/run-curated-validation.ts
  • tools/telemetry-replay/session-bar-probe.ts
  • tools/telemetry-replay/standings-probe.ts

Comment on lines +21 to +40
constructor(
private readonly bus: ChannelBus,
lifecycle: SessionLifecycle | undefined,
private readonly metrics: PerformanceSections
) {
this.disconnects = [
bus.onSubscriberCountChanged((channel, count) => {
if (channel !== 'lap-log.snapshot') return;
if (count > 0) this.activate();
else this.deactivate();
}),
];
if (lifecycle) {
this.disconnects.push(
lifecycle.onSessionNumChange(() =>
this.onLifecycle({ type: 'sessionNumChange' })
),
lifecycle.onDisconnect(() => this.onLifecycle({ type: 'disconnect' }))
);
}

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect direct bridge call sites and confirm that lifecycle is always supplied
# whenever channelBus is supplied.
rg -n -C 5 --glob '*.{ts,tsx}' '\bpublishIRacingSDKEvents\s*\(' src tools

Repository: tariknz/irdashies

Length of output: 7751


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== LapLogRuntime =="
fd -a 'lapLogRuntime\.ts$' src . | sed 's#^\./##' | while read -r f; do
  echo "--- $f"
  wc -l "$f"
  cat -n "$f"
done

echo "== publishIRacingSDKEvents implementations =="
for f in src/app/bridge/iracingSdk/iracingSdkBridge.ts src/app/bridge/iracingSdk/mock-data/mockSdkBridge.ts; do
  echo "--- $f"
  wc -l "$f"
  rg -n -C 12 -A 20 -B 10 'new LapLogRuntime|publishIRacingSDKEvents|stop\(\)|channelBus|lifecycle' "$f"
done

echo "== setup lifecycle creation =="
sed -n '1,120p' src/app/bridge/iracingSdk/setup.ts | cat -n

Repository: tariknz/irdashies

Length of output: 24974


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== ChannelBus snapshot storage and clear semantics =="
fd -a 'channelBridge\.ts$' src | sed 's#^\./##' | while read -r f; do
  echo "--- $f"
  wc -l "$f"
  rg -n -C 10 'latestSnapshots|publish\(|clearSnapshot|subscriberCount|subscribe' "$f"
done

echo "== Mock lifecycle API =="
fd -a 'sessionLifecycle\.ts$' src | sed 's#^\./##' | while read -r f; do
  echo "--- $f"
  wc -l "$f"
  sed -n '1,180p' "$f" | cat -n
done

Repository: tariknz/irdashies

Length of output: 14940


Require lifecycle delivery for an active LapLogRuntime.

LapLogRuntime accepts an optional SessionLifecycle, but snapshot cleanup depends on onDisconnect. The iRacing bridge creates LapLogRuntime whenever channelBus is present, and demo mode can pass undefined; when all lap-log.snapshot subscribers unsubscribe after a session without a lifecycle disconnect, ChannelBus.latestSnapshots preserves the last value and sends it to later subscribers. Require SessionLifecycle here, or wire a public disconnect reset from bridge shutdown paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/processors/lapLogRuntime.ts` around lines 21 - 40, Require a
SessionLifecycle in LapLogRuntime’s constructor and remove the optional
lifecycle branch, ensuring the existing onLifecycle handlers for
sessionNumChange and disconnect are always registered. Update all LapLogRuntime
construction sites to provide the lifecycle rather than allowing undefined,
preserving snapshot cleanup on disconnect.

Comment thread src/frontend/components/SectorDelta/widgetRuntimeDefinition.ts
Comment thread src/frontend/components/Standings/hooks/useTrackTemperature.tsx Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/frontend/components/CornerNameOverlay/CornerNameOverlay.stories.tsx`:
- Around line 24-29: Update the default story decorators in CornerNameOverlay
stories to compose TelemetryDecorator with ChannelSnapshotDecorator, ensuring
the default story provides session data required by useLovelyTrackData while
preserving the existing track-state snapshot.

In `@tools/telemetry-replay/track-state-probe.ts`:
- Line 42: Update createTrackStateProbe() so its schemaVersion is 2 to reflect
the added SessionFlags field, then regenerate or update
test-data/telemetry/ai-race-10min.golden.json so the curated checkpoint hash
matches the new probe output.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 80181fc6-d617-422f-ad2b-dce3c172722f

📥 Commits

Reviewing files that changed from the base of the PR and between b4366da and 1ee6044.

📒 Files selected for processing (16)
  • .storybook/trackStateSnapshot.ts
  • src/app/processors/TrackStateProcessor.spec.ts
  • src/app/processors/TrackStateProcessor.ts
  • src/frontend/components/CornerNameOverlay/CornerNameOverlay.stories.tsx
  • src/frontend/components/CornerNameOverlay/hooks/useCurrentSection.ts
  • src/frontend/components/CornerNameOverlay/widgetRuntimeDefinition.ts
  • src/frontend/components/Flag/Flag.tsx
  • src/frontend/components/Flag/widgetRuntimeDefinition.ts
  • src/frontend/components/GarageCover/GarageCover.tsx
  • src/frontend/components/GarageCover/widgetRuntimeDefinition.ts
  • src/frontend/components/SectorDelta/hooks/useLiveSectorDelta.ts
  • src/frontend/components/Standings/Relative.tsx
  • src/frontend/widgetRuntime.spec.tsx
  • src/types/channels/channel.ts
  • test-data/telemetry/ai-race-10min.golden.json
  • tools/telemetry-replay/track-state-probe.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/frontend/components/CornerNameOverlay/widgetRuntimeDefinition.ts
  • src/frontend/components/Flag/widgetRuntimeDefinition.ts
  • src/frontend/components/GarageCover/widgetRuntimeDefinition.ts
  • src/frontend/widgetRuntime.spec.tsx
  • src/types/channels/channel.ts

Comment on lines +24 to +29
ChannelSnapshotDecorator({
'track-state.snapshot': {
...trackStateStorySnapshot,
lapDistPct: 0.5,
},
}),

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 8 \
  'TelemetryDecorator|ChannelSnapshotDecorator|useLovelyTrackData' \
  .storybook src/frontend/components/CornerNameOverlay

Repository: tariknz/irdashies

Length of output: 16066


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '.storybook files:'
git ls-files .storybook | sort

printf '\n.storybook/index.ts\n'
cat -n .storybook/index.ts

printf '\nStory metadata excerpt:\n'
sed -n '1,65p' src/frontend/components/CornerNameOverlay/CornerNameOverlay.stories.tsx | cat -n

printf '\nHooks excerpt:\n'
sed -n '1,120p' src/frontend/components/CornerNameOverlay/CornerNameOverlay.tsx | cat -n
sed -n '1,140p' src/frontend/components/CornerNameOverlay/hooks/useLovelyTrackData.ts | cat -n
sed -n '110,165p' src/frontend/components/CornerNameOverlay/hooks/useLovelyTrackData.ts | cat -n

Repository: tariknz/irdashies

Length of output: 6888


Compose TelemetryDecorator into the default story metadata.

The default decorators only inject a track-state.snapshot channel value. useLovelyTrackData still depends on useSessionStore(s => s.session?.WeekendInfo?.TrackName), so the default story will not load track sections unless a provider supplies session. Add a default-story TelemetryDecorator(...) or an appropriate Storybook global provider so the default story matches the component stories guideline and data flow.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/frontend/components/CornerNameOverlay/CornerNameOverlay.stories.tsx`
around lines 24 - 29, Update the default story decorators in CornerNameOverlay
stories to compose TelemetryDecorator with ChannelSnapshotDecorator, ensuring
the default story provides session data required by useLovelyTrackData while
preserving the existing track-state snapshot.

Source: Coding guidelines

Comment thread tools/telemetry-replay/track-state-probe.ts
@tariknz
tariknz merged commit 781f93f into main Aug 9, 2026
7 checks passed
@tariknz
tariknz deleted the feat/remaining-telemetry-channels branch August 9, 2026 00:49
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.

1 participant