Skip to content

fix(limelight-nav): guard dev accessibility warning behind NODE_ENV - #73

Merged
pras75299 merged 2 commits into
mainfrom
fix/limelight-nav-dev-warning-guard
Jun 1, 2026
Merged

pras75299 merged 2 commits into
mainfrom
fix/limelight-nav-dev-warning-guard

Conversation

@pras75299

@pras75299 pras75299 commented Jun 1, 2026 •

Copy link
Copy Markdown
Owner

Type

  • New component / block (registry)
  • CLI change (init / add / list / info / doctor / search / shadcn JSON)
  • Docs site (apps/www)
  • Build / scripts / CI
  • Bug fix
  • Refactor / chore

Summary

LimelightNav logged a console.warn on every render when a nav item was missing both label and ariaLabel. 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):

if (process.env.NODE_ENV !== "production" && !label && !ariaLabel) {
  console.warn(/* … */);
}

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Suppressed console warnings about missing navigation item labels in production builds. Warnings remain visible during development to aid debugging.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@vercel

vercel Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
uniqueui-platform Ready Ready Preview, Comment Jun 1, 2026 7:27am

@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

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 @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: fec78923-116b-4342-8808-0e1552099264

📥 Commits

Reviewing files that changed from the base of the PR and between dad7c3a and 08879c1.

📒 Files selected for processing (6)
  • apps/www/components/ui/limelight-nav.tsx
  • apps/www/public/r/limelight-nav.json
  • apps/www/public/registry.json
  • apps/www/public/registry/limelight-nav.json
  • registry.json
  • registry/limelight-nav/component.tsx
📝 Walkthrough

Walkthrough

The PR gates the LimelightNav component's accessibility warning for missing label/ariaLabel attributes to non-production builds. The same process.env.NODE_ENV !== "production" check is applied consistently across the source component and all public registry copies.

Changes

LimelightNav development warning gating

Layer / File(s) Summary
Gate LimelightNav accessibility warning to non-production builds
apps/www/components/ui/limelight-nav.tsx, registry/limelight-nav/component.tsx, apps/www/public/r/limelight-nav.json, apps/www/public/registry/limelight-nav.json, apps/www/public/registry.json, registry.json
The console.warn for nav items missing both label and ariaLabel is wrapped in a process.env.NODE_ENV !== "production" condition across the source component and all registry copies, preventing noisy warnings in production builds while preserving development-time feedback.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • pras75299/uniqueui#9: Both PRs touch the same LimelightNav implementation in apps/www/components/ui/limelight-nav.tsx, with the main PR changing the component's console.warn logic for missing label/ariaLabel (likely introduced when adding the new component).

Poem

🐰 A warning now whispers in dev,
But hushes when prod comes to play,
No noisy logs when users arrive,
Just clean builds, come what may! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: guarding a development accessibility warning behind NODE_ENV in the LimelightNav component.
Description check ✅ Passed The description covers the bug being fixed, the rationale, and the specific change made. The Type checkbox (Bug fix) is marked, and the summary explains the issue and solution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/limelight-nav-dev-warning-guard

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Use a development-only check to avoid warning noise in test envs.

On Line 99, !== "production" still emits warnings under NODE_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

📥 Commits

Reviewing files that changed from the base of the PR and between 0aa27d5 and dad7c3a.

📒 Files selected for processing (6)
  • apps/www/components/ui/limelight-nav.tsx
  • apps/www/public/r/limelight-nav.json
  • apps/www/public/registry.json
  • apps/www/public/registry/limelight-nav.json
  • registry.json
  • registry/limelight-nav/component.tsx

Comment thread apps/www/public/registry.json Resolved
@pras75299
pras75299 merged commit 9ee5817 into main Jun 1, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — 08879c16 Deployed Jun 1, 2026 by vercel[bot]
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