Skip to content

🎨 feat: Add Responsive Global Light/Dark Theme Toggle (#408)#433

Merged
vijaypatil477 merged 1 commit into
vijaypatil477:mainfrom
Yash191220:feature/theme-toggle
Jun 2, 2026
Merged

🎨 feat: Add Responsive Global Light/Dark Theme Toggle (#408)#433
vijaypatil477 merged 1 commit into
vijaypatil477:mainfrom
Yash191220:feature/theme-toggle

Conversation

@Yash191220
Copy link
Copy Markdown
Contributor

✦ Summary

This pull request adds full Light Mode support to Debugra, introducing a responsive Dark/Light theme toggle in the navigation bar of both the landing page and the main collaborative editor. The theme preference is persisted across sessions in localStorage and automatically synchronizes Monaco Editor's theme dynamically between vs-dark and vs (light).

Fixes #408


🚀 Key Features Implemented

1. Global Theme Context Manager

  • Created a robust React Context and custom hook (src/context/ThemeContext.jsx) to handle theme preferences (dark/light).
  • Automatically updates the HTML document root with the data-theme attribute and syncs selections to localStorage under the debugra-global-theme key.
  • Shared wrapper initialized globally at the router level (src/App.jsx).

2. Premium Light Mode Aesthetics (src/index.css)

  • Styled a premium, eye-friendly light mode using a curated VS Code Light-inspired color system (light-gray panels #f3f3f3, pure white cards #ffffff, and sharp charcoal typography #1f1f23).
  • Refactored the Landing Page Editor Mockup (chrome, toolbar, code, stdout/stderr panels) to utilize dynamic theme variables instead of hardcoded hex colors, enabling the mockup editor to shift system themes beautifully!
  • Enhanced landing page responsive items, scrollbars, bento cards, and dropdown headers.

3. Integrated Monaco Theme Syncing (src/components/Editor/EditorPage.jsx)

  • Programmed a useEffect inside the editor view to watch the global system theme.
  • Switching system themes automatically transitions the Monaco editor to vs light mode, and restoring dark theme restores the system dark default (debugra-dark).

4. Color-Adaptive System Notifications

  • Shifted the react-hot-toast <Toaster> to use color custom properties. Success and error notifications now dynamically adapt their backgrounds, borders, and text colors to the active system theme.

5. Code Health & Linter Bug Fixes

  • Linter Bug Resolved: Fixed a pre-existing ESLint error in src/components/Editor/AudioChannel.jsx where the invalid attribute playsInline was used on an <audio> tag. This makes the local repository lint checks completely clean (0 errors!).

🛠️ Verification & Code Quality Status

We ran full validation checks to ensure zero code issues are introduced:

  • npm run format:check: PASS (100% compliant with Prettier layout rules).
  • npm run lint: PASS (Clean compile with zero linter errors).

⟡ Screenshots / UI Comparison

Before (Hardcoded Dark Theme) After (Modern Premium Light Theme)
Topbar Dark Smooth transition toggling layout components, mockup frames, and Monaco Editor natively!

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@Yash191220 is attempting to deploy a commit to the omkh4242g-1671's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the gssoc Official GSSoC '26 issue tag label May 30, 2026
@github-actions
Copy link
Copy Markdown

Hi @Yash191220, thanks for contributing to Debugra! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@github-actions github-actions Bot added gssoc:approved GSSoC '26 Approved issue level:critical GSSoC '26 Critical difficulty issue quality:exceptional Exceptional code quality contribution type:design Tactile visual design and UI alignments type:feature New functional feature additions labels May 30, 2026
@vijaypatil477
Copy link
Copy Markdown
Owner

@Yash191220 please solve the conflict

@Yash191220 Yash191220 force-pushed the feature/theme-toggle branch from 73d8d0f to 3cd1022 Compare June 2, 2026 04:55
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

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

Project Deployment Actions Updated (UTC)
debugra Ready Ready Preview, Comment Jun 2, 2026 7:46am

@vijaypatil477 vijaypatil477 merged commit ba8e9f5 into vijaypatil477:main Jun 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC '26 Approved issue gssoc Official GSSoC '26 issue tag level:critical GSSoC '26 Critical difficulty issue quality:exceptional Exceptional code quality contribution type:design Tactile visual design and UI alignments type:feature New functional feature additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add Dark/Light Theme Toggle Button

2 participants