Skip to content

fix: remove console debug statements and fix formatting#108

Open
shrutu0929 wants to merge 2 commits intoRefactron-ai:mainfrom
shrutu0929:chore/remove-console-logs
Open

fix: remove console debug statements and fix formatting#108
shrutu0929 wants to merge 2 commits intoRefactron-ai:mainfrom
shrutu0929:chore/remove-console-logs

Conversation

@shrutu0929
Copy link
Copy Markdown

@shrutu0929 shrutu0929 commented Mar 18, 2026

This Pull Request removes unnecessary console.log trace and debug statements scattered across various frontend components and hooks (including

Dashboard.tsx
,

useAuth.tsx
,

LoginForm.tsx
,

DeviceConnect.tsx
, and

VerifyEmail.tsx
). These temporary logs were cluttering the output console in production environments without providing user-facing value. Essential debug logs inside utilities like

usePerformanceMonitoring
and

analytics.ts
were strictly preserved since they are already conditionally wrapped to execute only in local development (NODE_ENV === 'development'), and legitimate console.error logs were intentionally kept intact for reliable debugging.

Summary by CodeRabbit

  • Chores
    • Removed numerous debug logging statements across authentication flows, onboarding, device handling, forms, and other UI components to reduce console clutter.
    • Updated automated workflow behavior to adjust pull request trigger handling and add an early checkout step for more reliable automation.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 18, 2026

Someone is attempting to deploy a commit to the omsherikar's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

Removed debug console.log statements across UI components, hooks, and a service; also adjusted a CI workflow trigger and added an explicit checkout step. No functional or control-flow changes.

Changes

Cohort / File(s) Summary
Components (console logs removed)
src/components/Dashboard.tsx, src/components/DeviceConnect.tsx, src/components/EarlyAccessForm.tsx, src/components/LoginForm.tsx, src/components/ProtectedRoute.tsx, src/components/VerifyEmail.tsx
Deleted multiple debug console.log statements. No behavior, error handling, or control-flow changes.
Hooks (console logs removed)
src/hooks/useAuth.tsx, src/hooks/useCookieConsent.ts
Removed debug logging related to device-code handling, auth states, and analytics enabling/disabling. Logic unchanged.
Service (console logs removed)
src/services/apiKey.service.ts
Removed debug logs from token retrieval and API key creation flows; request behavior unchanged.
CI workflow
.github/workflows/auto-label.yml
Changed trigger from pull_request to pull_request_target and added an explicit actions/checkout@v4 step before the labeler.
Manifest / Package
package.json
Small edits recorded in manifest changes (lines changed referenced in diff).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

type:refactor

Poem

🐰 I hopped through files at break of dawn,
Snipped the logs where debug lights shone,
Fewer prints, a quieter stream,
Cleaner console — hop and gleam! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'fix: remove console debug statements and fix formatting' directly and clearly describes the main changes in the 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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

👋 Welcome to Refactron! Thank you for opening your first pull request.

A maintainer will review your changes soon. Please ensure:

  • All CI checks pass
  • Your code follows our style guidelines
  • Tests are included if applicable
  • Documentation is updated if needed

Check out our Contributing Guide for more information.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/hooks/useAuth.tsx`:
- Around line 194-208: The current branch reads pending_device_code from
localStorage then navigates to '/device/connect' using navigation state which is
lost on page refresh; change the handoff to use a URL query parameter instead
(e.g. navigate to '/device/connect?device_code=...') so DeviceConnect (and the
existing LoginForm query-based flow) can rehydrate it from the URL after a
refresh; keep the localStorage key 'pending_device_code' unchanged (do not
remove it here), update the navigate(...) call in useAuth (the branch around
localStorage.getItem('pending_device_code')) to append the device code as a
query param rather than using state, and ensure DeviceConnect.tsx reads the
device code from the query string on mount instead of relying solely on
navigation state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 95ed2e14-3333-49f9-9298-fbabd20b63c9

📥 Commits

Reviewing files that changed from the base of the PR and between f1a72d2 and 942bf5a.

📒 Files selected for processing (9)
  • src/components/Dashboard.tsx
  • src/components/DeviceConnect.tsx
  • src/components/EarlyAccessForm.tsx
  • src/components/LoginForm.tsx
  • src/components/ProtectedRoute.tsx
  • src/components/VerifyEmail.tsx
  • src/hooks/useAuth.tsx
  • src/hooks/useCookieConsent.ts
  • src/services/apiKey.service.ts
💤 Files with no reviewable changes (2)
  • src/components/EarlyAccessForm.tsx
  • src/hooks/useCookieConsent.ts

Comment on lines 194 to 208
// Check if there's a pending device code
const deviceCode = localStorage.getItem('pending_device_code');
console.log(
'[completeOnboarding] Device code from localStorage:',
deviceCode
);


if (deviceCode) {
// Navigate with state (cleanup will happen in DeviceConnect after mount)
console.log(
'[completeOnboarding] Navigating to device connect with code via state'
); // Don't remove yet - ProtectedRoute needs to detect this!
// Don't remove yet - ProtectedRoute needs to detect this!
// localStorage.removeItem('pending_device_code');
navigate('/device/connect', {
state: { deviceCode },
replace: true,
});
} else {
console.log(
'[completeOnboarding] No device code found, redirecting to dashboard'
);

navigate('/dashboard');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Preserve the device code across refreshes.

This branch reads pending_device_code from localStorage, then forwards it to /device/connect as navigation-only state. src/components/DeviceConnect.tsx clears pending_device_code on mount and does not rehydrate from storage, so a reload on the connect page drops the code and breaks the CLI authorization flow. Reusing the query-param handoff that src/components/LoginForm.tsx already uses avoids that failure mode.

🔁 Suggested change
         if (deviceCode) {
           // Navigate with state (cleanup will happen in DeviceConnect after mount)
           // Don't remove yet - ProtectedRoute needs to detect this!
           // localStorage.removeItem('pending_device_code');
-          navigate('/device/connect', {
-            state: { deviceCode },
-            replace: true,
-          });
+          navigate(`/device/connect?code=${encodeURIComponent(deviceCode)}`, {
+            replace: true,
+          });
         } else {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/useAuth.tsx` around lines 194 - 208, The current branch reads
pending_device_code from localStorage then navigates to '/device/connect' using
navigation state which is lost on page refresh; change the handoff to use a URL
query parameter instead (e.g. navigate to '/device/connect?device_code=...') so
DeviceConnect (and the existing LoginForm query-based flow) can rehydrate it
from the URL after a refresh; keep the localStorage key 'pending_device_code'
unchanged (do not remove it here), update the navigate(...) call in useAuth (the
branch around localStorage.getItem('pending_device_code')) to append the device
code as a query param rather than using state, and ensure DeviceConnect.tsx
reads the device code from the query string on mount instead of relying solely
on navigation state.

@shrutu0929 shrutu0929 changed the title Remove console debug statements from production frontend components fix: remove console debug statements and fix formatting Mar 19, 2026
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