Skip to content

Conversation

@Stonebanks-js
Copy link

🧩 Summary

FIXES #84

This pull request introduces a global theme system with persistent dark/light mode functionality.
It enhances user experience by allowing seamless theme switching across the app and retaining preference between sessions.

🛠️ Changes Made

  • Added a new index.html at project root (compatible with Vite + Tailwind + shadcn/ui setup).
  • Updated App.tsx to wrap the application with the ThemeProvider.
  • Ensured dark mode is enabled globally using Tailwind’s darkMode: 'class'.
  • Verified compatibility across all components.
  • Confirmed no TypeScript or linting issues.

✅ Verification Steps

  • Run npm install to ensure dependencies are up to date.
  • Launch the app using npm run dev.
  • Toggle between dark and light modes using the theme toggle button.
  • Refresh the browser — selected theme should persist.
  • Confirm no console errors or build warnings.

@vercel
Copy link

vercel bot commented Oct 16, 2025

@Stonebanks-js is attempting to deploy a commit to the Dhanush Nehru's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Stonebanks-js
Copy link
Author

@DhanushNehru I created this pull request before you assigned me the issue number #84, kindly assign me and add hacktoberfest 2025 labels before chekiong this PR

Also If any changes have to made, I am open to resolve the conflicts.

Thank you

@vercel
Copy link

vercel bot commented Oct 17, 2025

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

Project Deployment Preview Comments Updated (UTC)
scratchpad-scribe Ready Ready Preview Comment Oct 17, 2025 10:08am

Copy link
Contributor

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

Adds global theme toggling (dark/light) with persistence across sessions by introducing a ThemeProvider and an HTML shell for Tailwind darkMode: 'class'.

  • Wraps the app with ThemeProvider to enable system/default theming and persistence.
  • Adds an index.html shell with Tailwind-compatible classes and Vite entry script.
  • Removes CurrentUserProvider wrapper, which likely breaks user context availability.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/App.tsx Introduces ThemeProvider and restructures provider tree; removes CurrentUserProvider wrapper.
public/index.html Adds Vite HTML shell with dark mode class and root mount; currently placed under public.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +20 to +26
<BrowserRouter>
<Routes>
<Route path="/" element={<Index />} />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
<Route path="*" element={<NotFound />} />
</Routes>
</BrowserRouter>
Copy link

Copilot AI Oct 19, 2025

Choose a reason for hiding this comment

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

Removing the CurrentUserProvider wrapper disconnects any consumers of CurrentUserContext and will break features that rely on current user state. Please reintroduce the provider around the router (or the entire app) to restore context.

Suggested change
<BrowserRouter>
<Routes>
<Route path="/" element={<Index />} />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
<Route path="*" element={<NotFound />} />
</Routes>
</BrowserRouter>
<CurrentUserProvider>
<BrowserRouter>
<Routes>
<Route path="/" element={<Index />} />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
<Route path="*" element={<NotFound />} />
</Routes>
</BrowserRouter>
</CurrentUserProvider>

Copilot uses AI. Check for mistakes.
</head>
<body class="bg-background text-foreground min-h-screen">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
Copy link

Copilot AI Oct 19, 2025

Choose a reason for hiding this comment

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

Vite expects index.html at the project root to act as the HTML entry; placing it under public means Vite won't process it, and the app won't boot via this template. Move this file to the project root (./index.html) and remove/avoid duplicates under public.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en" class="dark">
Copy link

Copilot AI Oct 19, 2025

Choose a reason for hiding this comment

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

Hardcoding class="dark" forces dark mode and conflicts with defaultTheme="system" (and can cause a visible flash before ThemeProvider runs). Remove the hardcoded class and let ThemeProvider (or an inline no-FOUC script) manage the initial theme class on the root element.

Suggested change
<html lang="en" class="dark">
<html lang="en">

Copilot uses AI. Check for mistakes.
import { ThemeProvider } from "@/components/theme/provider";
import Index from "./pages/Index";
import NotFound from "./pages/NotFound";
import { CurrentUserProvider } from "@/context/CurrentUserContext";
Copy link

Copilot AI Oct 19, 2025

Choose a reason for hiding this comment

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

CurrentUserProvider is imported but no longer used in this file after removing the wrapper, which may trigger lint errors and increases noise. Either re-add the provider (recommended) or remove this unused import.

Suggested change
import { CurrentUserProvider } from "@/context/CurrentUserContext";

Copilot uses AI. Check for mistakes.
@learner-enthusiast
Copy link
Collaborator

image

your branch is giving this error in local take a frsh pull from main and merge it with your branch and re run it and please upload a screen recording of the functionalty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Dark Mode / Theme Toggle for Better UX in Low-Light Environments

3 participants