feat(actions): add telemetry-driven ON/OFF state to pit toggles and fuel fill#205
Conversation
…uel fill (#197) - Extract shared status bar utility (ON/OFF/N/A) from car-control - Add telemetry subscription to Pit Quick Actions for windshield tearoff and fast repair modes with live ON/OFF/N/A status bars - Add toggle-fuel-fill mode to Fuel Service with telemetry-driven icon showing refuel amount in display-unit-aware format (L/g) - Fast repair shows gray N/A bar when FastRepairAvailable is 0 - Create dynamic SVG templates for pit-quick-actions and fuel-service
- Match car-control onWillDisappear order (super before cleanup) - Use telemetry helpers in execute methods instead of inline hasFlag - Remove dead static icon entries/imports for telemetry-aware modes - Remove unused FUEL_SERVICE_LABELS entry for toggle-fuel-fill - Remove unnecessary statusBar re-export from car-control - Fix PI fallback default to match new toggle-fuel-fill default
- Add toggle-fuel-fill mode to actions.json and fuel-service docs - Document telemetry-driven ON/OFF/N/A status bars for pit quick actions - Sync action/control counts across README, website, overview, and skills (32 actions, 349 controls; Pit Service: 15 controls)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds telemetry-driven ON/OFF/N/A visual indicators for pit actions, extracts a shared status-bar SVG utility, introduces a new telemetry-aware Changes
Sequence DiagramsequenceDiagram
participant User as Stream Deck (User)
participant Action as Telemetry-Aware Action
participant SDK as iRacing SDK
participant Display as Stream Deck Display
User->>Action: onWillAppear(actionId)
Action->>SDK: subscribe(actionId)
SDK->>Action: telemetry update (PitSvFlags, fuel amt, availability)
loop on telemetry change
Action->>Action: derive telemetryState (isOn, amount, available)
alt stateKey changed
Action->>Action: generateSvg(settings, telemetryState)
Action->>Display: setImage(svg)
else no change
Note right of Action: skip update
end
end
User->>Action: onKeyDown
Action->>SDK: pit.clearXXX() or pit.xxx(0) based on telemetryState
SDK->>Action: telemetry reflects change
Action->>Display: setImage(updated svg)
User->>Action: onWillDisappear
Action->>SDK: unsubscribe(actionId)
Note right of Action: clear cached state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/stream-deck-plugin/src/pi/fuel-service.ejs (1)
42-44:⚠️ Potential issue | 🟠 MajorReorder PI partials to match required template contract.
Line 42 places
common-settingsbeforecolor-overrides; this should be reversed so common settings come after color overrides.🔧 Proposed fix
- <%- include('common-settings') %> - - <%- include('color-overrides', { slots: ['backgroundColor', 'textColor', 'graphic1Color'], defaults: require('./data/color-defaults.json')['fuel-service'] }) %> + <%- include('color-overrides', { slots: ['backgroundColor', 'textColor', 'graphic1Color'], defaults: require('./data/color-defaults.json')['fuel-service'] }) %> + + <%- include('common-settings') %>As per coding guidelines: Property Inspector templates must include color-overrides between action-specific and global sections, and include common-settings after color-overrides.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/stream-deck-plugin/src/pi/fuel-service.ejs` around lines 42 - 44, The partial includes in the PI template are in the wrong order: swap the two include lines so that color-overrides (the include('color-overrides', { slots: ..., defaults: ... })) appears before common-settings (include('common-settings')), ensuring color-overrides sits between action-specific and global sections and common-settings follows it to satisfy the template contract.
🧹 Nitpick comments (1)
packages/actions/src/actions/pit-quick-actions.ts (1)
24-33: Remove duplicate JSDoc comment.There are two consecutive JSDoc comments documenting
STATIC_ACTION_ICONS. The first (lines 24-26) is incomplete, while the second (lines 27-30) provides the full explanation.♻️ Proposed fix
-/** - * Standalone SVG templates for static pit quick action modes (imported from `@iracedeck/icons`) - */ /** * Standalone SVG templates for static pit quick action modes (imported from `@iracedeck/icons`). * Telemetry-aware modes (windshield-tearoff, request-fast-repair) use the dynamic template instead. */ const STATIC_ACTION_ICONS: Partial<Record<PitQuickActionType, string>> = {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/actions/src/actions/pit-quick-actions.ts` around lines 24 - 33, Remove the duplicate/incomplete JSDoc above STATIC_ACTION_ICONS so only the full descriptive comment remains; locate the consecutive comments that document STATIC_ACTION_ICONS (referenced by the symbol STATIC_ACTION_ICONS and related types like PitQuickActionType and clearAllCheckboxesIconSvg) and delete the first incomplete JSDoc block, leaving the complete JSDoc immediately before the constant.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/stream-deck-plugin/src/pi/fuel-service.ejs`:
- Around line 42-44: The partial includes in the PI template are in the wrong
order: swap the two include lines so that color-overrides (the
include('color-overrides', { slots: ..., defaults: ... })) appears before
common-settings (include('common-settings')), ensuring color-overrides sits
between action-specific and global sections and common-settings follows it to
satisfy the template contract.
---
Nitpick comments:
In `@packages/actions/src/actions/pit-quick-actions.ts`:
- Around line 24-33: Remove the duplicate/incomplete JSDoc above
STATIC_ACTION_ICONS so only the full descriptive comment remains; locate the
consecutive comments that document STATIC_ACTION_ICONS (referenced by the symbol
STATIC_ACTION_ICONS and related types like PitQuickActionType and
clearAllCheckboxesIconSvg) and delete the first incomplete JSDoc block, leaving
the complete JSDoc immediately before the constant.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 31fcf9bc-d29b-48b3-b05b-6866d5971d1b
⛔ Files ignored due to path filters (2)
packages/actions/icons/fuel-service.svgis excluded by!**/*.svgpackages/actions/icons/pit-quick-actions.svgis excluded by!**/*.svg
📒 Files selected for processing (15)
.claude/skills/iracedeck-actions/SKILL.mdREADME.mddocs/reference/actions.jsonpackages/actions/src/actions/car-control.tspackages/actions/src/actions/fuel-service.test.tspackages/actions/src/actions/fuel-service.tspackages/actions/src/actions/pit-quick-actions.test.tspackages/actions/src/actions/pit-quick-actions.tspackages/actions/src/icons/status-bar.test.tspackages/actions/src/icons/status-bar.tspackages/stream-deck-plugin/src/pi/fuel-service.ejspackages/website/src/content/docs/docs/actions/overview.mdpackages/website/src/content/docs/docs/actions/pit-service/fuel-service.mdpackages/website/src/content/docs/docs/actions/pit-service/pit-quick-actions.mdpackages/website/src/content/docs/index.mdx
Related Issue
Fixes #197
What changed?
status-bar.tstoggle-fuel-fillmode to Fuel Service (now the default) with telemetry-driven icon showing refuel amount in display-unit-aware format (L/g)How to test
Checklist
Summary by CodeRabbit
New Features
Documentation