Skip to content

feat: add theme toggle and improve error handling#39

Open
riccardogiorato wants to merge 5 commits intoNutlope:mainfrom
riccardogiorato:claude/fix-critical-crashes-8Ayrw
Open

feat: add theme toggle and improve error handling#39
riccardogiorato wants to merge 5 commits intoNutlope:mainfrom
riccardogiorato:claude/fix-critical-crashes-8Ayrw

Conversation

@riccardogiorato
Copy link
Copy Markdown
Collaborator

Summary

This PR adds dark mode support with a theme toggle component and improves error handling and UI robustness across the application.

Key Changes

  • Theme Support: Added ThemeToggle component with light/dark/system theme options using next-themes

    • Integrated ThemeProvider into root layout with class-based theme attribute
    • Added theme toggle button to top menu with smooth icon transitions
    • Configured suppressHydrationWarning on html element to prevent hydration mismatches
  • Error Handling: Improved error handling in preview client

    • Added error state detection for resume and username queries
    • Display user-friendly error messages with page refresh option
    • Gracefully handle both Error instances and unknown error types
  • Null Safety: Fixed potential null reference issues in resume editing

    • Added optional chaining and nullish coalescing (??) for skills array throughout EditResume component
    • Prevents crashes when skills array is undefined
  • URL Parsing: Added error handling for website URL parsing in resume header

    • Wrapped new URL() call in try-catch to handle invalid URLs
    • Falls back to displaying raw URL string if parsing fails
  • UI Improvements:

    • Fixed whitespace handling in summary section with whitespace-pre-wrap class
    • Improved top menu layout with flexbox gap spacing
    • Minor formatting cleanup in signed-out menu

Implementation Details

  • Uses lucide-react icons for theme toggle UI
  • Leverages next-themes library for theme management
  • Maintains accessibility with proper ARIA labels and screen reader text
  • All theme-related components are client-side rendered with 'use client' directive

https://claude.ai/code/session_017oUgH1Y6iZmosXcmutVYKF

claude added 2 commits March 10, 2026 12:58
- Fix Nutlope#37: Add error state handling in PreviewClient when resumeQuery or
  usernameQuery fails, showing a user-friendly error message with a
  refresh button instead of an infinite loading spinner or crash

- Fix Nutlope#36: Prevent crash in Header.tsx when website URL is malformed by
  wrapping new URL() in a try/catch block

- Fix Nutlope#36: Prevent crash in EditResume when resume.header.skills is
  undefined/null (legacy data) by using nullish coalescing (?? []) in
  all skills array operations

https://claude.ai/code/session_017oUgH1Y6iZmosXcmutVYKF
- Add ThemeToggle component with Sun/Moon/Monitor icons dropdown
  (Light, Dark, System options) using next-themes + existing CSS vars
- Wire ThemeProvider into layout.tsx with suppressHydrationWarning
- Place ThemeToggle in TopMenu header, visible for all users
- Fix Nutlope#31/Nutlope#33: add whitespace-pre-wrap to Summary component so
  multi-line descriptions render with correct line breaks

https://claude.ai/code/session_017oUgH1Y6iZmosXcmutVYKF
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 12, 2026

@claude is attempting to deploy a commit to the Together AI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
self-so Ready Ready Preview, Comment Mar 14, 2026 0:32am

Request Review

- Soften dark background from near-black (3.9%) to dark gray (9%)
- Replace all hardcoded colors with semantic tokens:
  text-design-black → text-foreground
  text-design-gray/text-gray-* → text-muted-foreground
  bg-gray-100 → bg-muted
  bg-design-black → bg-primary
  border-gray-* → border-border/border
  hover:bg-gray-100 → hover:bg-muted
- Add dark:invert to SVG icons (logo, github, x, sparkle, arrows)
  so they stay visible on dark backgrounds
- Apply changes to: page.tsx, Footer, TopMenu, upload client

https://claude.ai/code/session_017oUgH1Y6iZmosXcmutVYKF
- CustomSpinner: add dark:invert so black SVG paths show on dark bg
- PreviewActionbar: replace bg-[#fcfcfc]/bg-white/border-neutral-300/
  text-design-black/bg-design-black/bg-design-white with semantic
  bg-card/bg-background/border-border/text-foreground/bg-primary tokens;
  add dark:invert to link icon; fix spinner border color
- preview/client.tsx: border-neutral-300 → border-border on resume card

https://claude.ai/code/session_017oUgH1Y6iZmosXcmutVYKF
Updated the Tech stack section header to emphasize importance.
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