Skip to content

fix: prevent theme flash on settings page and remove duplicate main.js import - #645

Open
GeethaBurigalla wants to merge 1 commit into
Kuldeeep18:mainfrom
GeethaBurigalla:fix/theme-persistence-503
Open

fix: prevent theme flash on settings page and remove duplicate main.js import#645
GeethaBurigalla wants to merge 1 commit into
Kuldeeep18:mainfrom
GeethaBurigalla:fix/theme-persistence-503

Conversation

@GeethaBurigalla

@GeethaBurigalla GeethaBurigalla commented Jul 11, 2026

Copy link
Copy Markdown

Description

Theme persistence (localStorage + restore on load) is already implemented via theme-boot.js and main.js. This PR fixes two gaps that undermined it:

  1. settings.html was missing theme-boot.js in <head>, causing a flash of light mode on load — the one page with the actual toggle switch.
  2. campaign-builder.html imported main.js twice, double-registering theme and other event listeners.

Resolves #503.

Summary by CodeRabbit

  • New Features
    • Added a complete campaign-building experience for creating, editing, sequencing, and launching campaigns.
    • Added conditional yes/no branching, lead selection and enrollment, connected-account loading, and campaign restoration from saved campaigns.
    • Added email template loading and insertion.
    • Added AI Email Studio for generating and inserting email content.
    • Added campaign settings and launch controls.
  • Style
    • Improved theme initialization on the settings page.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b1eb873a-4058-4aa1-90f3-f7bf4cce6cb1

📥 Commits

Reviewing files that changed from the base of the PR and between 4a33158 and 884ef95.

📒 Files selected for processing (2)
  • frontend/campaign-builder.html
  • frontend/settings.html
💤 Files with no reviewable changes (1)
  • frontend/campaign-builder.html

📝 Walkthrough

Walkthrough

The campaign builder now embeds its client runtime for sequence editing, campaign operations, templates, and AI email generation. The settings page also loads a theme bootstrap script.

Changes

Campaign builder runtime

Layer / File(s) Summary
Campaign builder interactions and API flow
frontend/campaign-builder.html
An inline ES module manages builder state and views, conditional step editing, campaign save/enrollment/launch requests, email templates, AI-generated email insertion, connected accounts, modals, and campaign restoration.
Settings page theme bootstrap
frontend/settings.html
The settings page loads theme-boot.js from the document head.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • Kuldeeep18/LeadOrbit#308: Modifies campaign-builder client interactions involving step nodes, tab switching, and conditional branching.

Suggested labels: frontend, level:advanced

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the theme flash fix and the duplicate main.js import removal.
Linked Issues check ✅ Passed The changes address #503 by restoring the saved theme on load to keep the user's preference across sessions.
Out of Scope Changes check ✅ Passed The described changes stay focused on theme persistence and removing the duplicate import.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@GeethaBurigalla

Copy link
Copy Markdown
Author

Hello reviewer!! Turns out theme persistence is already built (theme-boot.js + main.js already have getTheme/setTheme/toggleTheme, cross-tab sync, Ctrl+T shortcut). So I just fixed what was actually broken: settings.html was missing theme-boot.js so it flashed light mode on load, and campaign-builder.html was importing main.js twice.

Kept it minimal — happy to add the toggle to other pages too if you want that instead.

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.

🌙 Remember User Theme Preference Across Sessions

1 participant