Skip to content

Add puppeteer dependency and suppress hydration warnings in various c…#70

Merged
sphildreth merged 1 commit intomainfrom
sph-2026-03-22.02
Mar 22, 2026
Merged

Add puppeteer dependency and suppress hydration warnings in various c…#70
sphildreth merged 1 commit intomainfrom
sph-2026-03-22.02

Conversation

@sphildreth
Copy link
Copy Markdown
Owner

This pull request primarily adds the puppeteer package as a new dependency and cleans up unnecessary console logging in authentication-related React components. It also makes minor improvements to hydration warnings in the UI. The most important changes are grouped below:

Dependency Management:

UI Hydration Improvements:

  • Added suppressHydrationWarning to date display elements in ArticleCard.tsx and ModerationQueue.tsx to prevent React hydration mismatches on client/server rendering. [1] [2]

Code Cleanup (Authentication Components):

  • Removed verbose console.log debugging statements from TwoFactorGuard.tsx and TwoFactorVerification.tsx, resulting in cleaner production code and improved security by not logging sensitive authentication flow details. [1] [2] [3] [4]

Copilot AI review requested due to automatic review settings March 22, 2026 13:13
@sphildreth sphildreth merged commit 5a679fe into main Mar 22, 2026
3 checks passed
@sphildreth sphildreth deleted the sph-2026-03-22.02 branch March 22, 2026 13:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates authentication/UI behavior and dev tooling in the Narravo Next.js codebase, focusing on reducing noisy logs, improving hydration stability, and adding a browser automation dependency.

Changes:

  • Add puppeteer to devDependencies and update pnpm-lock.yaml accordingly.
  • Improve 2FA/WebAuthn environment handling and trusted-device behavior during JWT creation.
  • Suppress hydration warnings for server/client date rendering mismatches and remove verbose 2FA console logging.

Reviewed changes

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

Show a summary per file
File Description
src/lib/auth.ts Switches 2FA login behavior to respect a trusted-device cookie when setting mfaPending/mfa.
src/lib/2fa/webauthn.ts Expands origin resolution to support AUTH_URL, legacy NEXTAUTH_URL, and Vercel environment variables.
src/components/posts/PostCard.tsx Suppresses hydration warnings for formatted date rendering.
src/components/comments/CommentNode.tsx Suppresses hydration warnings for localized timestamp rendering.
src/components/auth/TwoFactorVerification.tsx Removes debug console.log statements from 2FA verification flows.
src/components/auth/TwoFactorGuard.tsx Removes debug logging from redirect guard logic.
src/components/ArticleCard.tsx Suppresses hydration warnings for formatted date rendering.
src/components/admin/ModerationQueue.tsx Suppresses hydration warnings for localized “Created” timestamp rendering.
package.json Adds puppeteer to dev tooling dependencies.
pnpm-lock.yaml Lockfile updates for puppeteer and transitive dependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

"drizzle-kit": "0.31.10",
"eslint": "10.1.0",
"eslint-config-next": "16.2.1",
"puppeteer": "^24.40.0",
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

puppeteer is added to devDependencies, but there are no in-repo imports or scripts referencing it (Playwright is already present, and LHCI typically uses puppeteer-core). If this isn’t immediately required, consider removing it (or documenting/adding the script that uses it) to avoid extra install time and the Chromium download footprint in CI/dev.

Suggested change
"puppeteer": "^24.40.0",

Copilot uses AI. Check for mistakes.
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