Skip to content

Fix app hook lint errors#14

Merged
TaiChi112 merged 1 commit into
mainfrom
chore/lint-hooks-set-state-in-effect
Jun 2, 2026
Merged

Fix app hook lint errors#14
TaiChi112 merged 1 commit into
mainfrom
chore/lint-hooks-set-state-in-effect

Conversation

@TaiChi112

Copy link
Copy Markdown
Owner

Summary

  • Fixed the remaining app-code react-hooks/set-state-in-effect lint errors.
  • Kept this lint cleanup scoped to app runtime files only.

Validation

  • git diff --check passed.
  • Targeted lint for the changed app files passed.
  • bun run build passed with a temporary NODE_OPTIONS memory increase for local validation.
  • bun run lint was run; unrelated demo/refactor lint debt may remain.

Notes

  • This PR does not modify dependencies.
  • This PR does not modify demo/refactor files.
  • This PR does not address Dependabot alerts.
  • The temporary NODE_OPTIONS setting was used only for local validation and was not committed.

Copilot AI review requested due to automatic review settings June 2, 2026 13:57
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
personal-profile-prototype Ready Ready Preview, Comment Jun 2, 2026 1:58pm

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@TaiChi112, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 11 minutes and 27 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d76fd5e8-4a27-4262-8b86-f17d93d75ec1

📥 Commits

Reviewing files that changed from the base of the PR and between 2285e66 and 6a3b45c.

📒 Files selected for processing (2)
  • app/components/system/TourHighlight.tsx
  • app/features/sections/DocsSection.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/lint-hooks-set-state-in-effect

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.

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

This PR addresses remaining react-hooks/set-state-in-effect lint errors in app runtime components by refactoring state synchronization patterns to avoid directly setting state within useEffect bodies.

Changes:

  • Refactored DocsSection to derive the displayed doc from route state + local selection state, removing the effect-driven state sync.
  • Refactored TourHighlight to update highlight positioning via an requestAnimationFrame/event-driven callback rather than immediate effect body updates.

Reviewed changes

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

File Description
app/features/sections/DocsSection.tsx Removes effect-driven doc state syncing by deriving activeDoc from route param and local selection state.
app/components/system/TourHighlight.tsx Moves rect updates into a callback scheduled via requestAnimationFrame and reused by scroll/resize events.

Comment on lines +44 to 53
const animationFrameId = window.requestAnimationFrame(updateRect);

window.addEventListener('resize', updateRect);
window.addEventListener('scroll', updateRect, true);

return () => {
window.cancelAnimationFrame(animationFrameId);
window.removeEventListener('resize', updateRect);
window.removeEventListener('scroll', updateRect, true);
};
@TaiChi112 TaiChi112 merged commit 6d3ca4c into main Jun 2, 2026
4 checks passed
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