Skip to content

refactor: simplify reference lap logic & store reactivity#549

Draft
BatMichoo wants to merge 1 commit into
tariknz:mainfrom
BatMichoo:sector-delta
Draft

refactor: simplify reference lap logic & store reactivity#549
BatMichoo wants to merge 1 commit into
tariknz:mainfrom
BatMichoo:sector-delta

Conversation

@BatMichoo
Copy link
Copy Markdown
Contributor

Description

Refactored the SectorDelta widget and ReferenceLapStore to simplify reference lap selection and improve store reactivity.

  • Automatic Reference Selection: useLiveSectorDelta now automatically picks the best reference lap (Session Best -> Class Best/Ghost).
  • Store Refactoring: Simplified ReferenceLapStore by removing redundant state (seriesId, persistedLapsVersion, fileLoadedClassIds).
  • Performance & Reactivity: Replaced manual getState calls with proper Zustand selectors.
  • Optimization: Prevented unnecessary re-renders in SectorTimingStore.

Type of Change

  • New feature
  • Bug fix
  • Performance improvement
  • Refactoring

Checklist

  • I have tested this in iRacing
  • All tests pass locally via npm test
  • I have run npm run lint
  • I have performed a self-review
  • I have added/updated Storybook stories

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f4337dd-ea28-4fb6-aca6-aab9fb8b8720

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

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