Repository navigation
fix(limelight-nav): guard dev accessibility warning behind NODE_ENV - #73
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 39 minutes and 59 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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe PR gates the ChangesLimelightNav development warning gating
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 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 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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/www/components/ui/limelight-nav.tsx (1)
99-103:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse a development-only check to avoid warning noise in test envs.
On Line 99,
!== "production"still emits warnings underNODE_ENV="test". If the intent is dev-only diagnostics, gate with=== "development".Suggested fix
- if (process.env.NODE_ENV !== "production" && !label && !ariaLabel) { + if (process.env.NODE_ENV === "development" && !label && !ariaLabel) { console.warn( `LimelightNav: Item with id "${id}" is missing both 'label' and 'ariaLabel'. An accessible name is required for screen readers.` ); }🤖 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 `@apps/www/components/ui/limelight-nav.tsx` around lines 99 - 103, The warning condition in the LimelightNav rendering currently uses process.env.NODE_ENV !== "production", which still triggers in test environments; change the guard to only run in development by checking process.env.NODE_ENV === "development" so the console.warn inside the LimelightNav item check (the block that warns when id has neither label nor ariaLabel) only runs in dev builds and not under NODE_ENV="test" or other non-production environments.
🤖 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 `@apps/www/public/registry.json`:
- Line 2175: The console.warn guard inside the LimelightNav component currently
uses process.env.NODE_ENV !== "production" which still allows logging during
tests; change that check to process.env.NODE_ENV === "development" around the
warning that triggers when an item has no label or ariaLabel (the block inside
items.map where console.warn is called) so the warning only appears in
development builds and not in test or other non-production environments.
---
Outside diff comments:
In `@apps/www/components/ui/limelight-nav.tsx`:
- Around line 99-103: The warning condition in the LimelightNav rendering
currently uses process.env.NODE_ENV !== "production", which still triggers in
test environments; change the guard to only run in development by checking
process.env.NODE_ENV === "development" so the console.warn inside the
LimelightNav item check (the block that warns when id has neither label nor
ariaLabel) only runs in dev builds and not under NODE_ENV="test" or other
non-production environments.
🪄 Autofix (Beta)
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
Run ID: 0f7c28ab-002c-43c8-ba62-09154ea3b68a
📒 Files selected for processing (6)
apps/www/components/ui/limelight-nav.tsxapps/www/public/r/limelight-nav.jsonapps/www/public/registry.jsonapps/www/public/registry/limelight-nav.jsonregistry.jsonregistry/limelight-nav/component.tsx
Type
Summary
LimelightNavlogged aconsole.warnon every render when a nav item was missing bothlabelandariaLabel. That guard is useful for local development, but it also fired in production builds and added noise during SSR/tests.Wrap the warning in
process.env.NODE_ENV !== "production"so it only runs in development. Runtime behavior and accessibility (aria-label={ariaLabel ?? label}) are unchanged — only the dev-only diagnostic is gated.Change (1 line):