Skip to content

Conversation

@NicholasCloud4
Copy link

@NicholasCloud4 NicholasCloud4 commented Aug 28, 2025

Updated the logo on the home and invoice page when user selects dark mode, it will change to the purple logo.

Summary by CodeRabbit

  • New Features

    • Logo now automatically switches to match the selected light/dark theme.
  • Style

    • Invoice page reorganized for clearer layout: refined sections, two-column header, and improved alignment/spacing.
    • Download PDF button moved to a dedicated bottom section for better visibility.
    • Placeholder text updated (e.g., “City, ZIP”) for clarity.
    • Standardized HTML5 structure across pages; no changes to content or navigation behavior.

@vercel
Copy link

vercel bot commented Aug 28, 2025

@NicholasCloud4 is attempting to deploy a commit to the Eshita's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

Added id="logoImage" to header logos in HTML, reorganized index.html and invoice.html into standard HTML5 structures, and introduced updateLogo(isDark) in script.js. The theme toggle now calls updateLogo to switch logo images based on theme. No other behavioral changes; existing navigation and invoice logic remain.

Changes

Cohort / File(s) Summary of Changes
HTML structure and identifiers
index.html, invoice.html
Reorganized markup into standard HTML5 head/body layout; added id="logoImage" to header logo images; adjusted containers/classes for form and preview; moved Download PDF button section; minor placeholder text tweaks; no new behaviors.
Theme-driven logo sync
script.js
Added global updateLogo(isDark) to swap logo src between "gilogo.png" (dark) and "gil.png" (light); invoked from theme toggle flow; no changes to initial applySavedTheme logic besides formatting.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Toggle as Theme Toggle (UI)
  participant JS as script.js
  participant DOM as Document
  participant Logo as #logoImage

  User->>Toggle: Click
  Toggle->>JS: initializeEventListeners handler
  JS->>DOM: Toggle body.dark-theme
  JS->>JS: compute isDark
  note right of JS: New: updateLogo(isDark)
  JS->>Logo: updateLogo(isDark)<br/>• isDark=true → gilogo.png<br/>• isDark=false → gil.png
  Logo-->>User: Logo reflects current theme
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • versac3s

Poem

I twitch my ears at light and night,
A logo flips—left, then right—so bright! 🌙➡️🌞
With tidy tags and forms in rows,
I stamp the invoice where it goes.
Hop, click, theme’s in flow—
Two PNGs dance; I steal the show. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
script.js (1)

25-35: Logo doesn’t sync on initial load with saved dark theme.
applySavedTheme sets icons/body but not the logo; users who previously chose dark mode will still see the light logo until they toggle. Also, the early return blocks applying the saved theme if icons are missing.

 function applySavedTheme() {
   // Retrieve the theme from local storage. Default is "light".
   const savedTheme = (window.localStorage && window.localStorage.getItem("theme")) || "light";
   const { themeToggleBtn, moonIcon, sunIcon, body } = getThemeElements();

-  if (!themeToggleBtn || !moonIcon || !sunIcon || !body) return;
+  if (!body) return;

   const isDark = savedTheme === "dark";
-  body.classList.toggle("dark-theme", isDark);
-  toggleThemeIcons(moonIcon, sunIcon, isDark);
+  body.classList.toggle("dark-theme", isDark);
+  if (moonIcon && sunIcon) toggleThemeIcons(moonIcon, sunIcon, isDark);
+  if (themeToggleBtn) themeToggleBtn.setAttribute("aria-pressed", String(isDark));
+  updateLogo(isDark);
 }
🧹 Nitpick comments (5)
index.html (2)

26-33: Make theme toggle button accessible and non-submitting.
Add type and ARIA for better a11y and to avoid accidental form submits if the button is ever placed inside a form.

-      <button id="theme-toggle" class="theme-toggle-btn">
+      <button id="theme-toggle" class="theme-toggle-btn" type="button" aria-label="Toggle dark mode" aria-pressed="false">

9-14: Preload both logo assets to avoid a visible swap on first toggle.
Preloading minimizes flicker when switching themes.

   <link rel="preconnect" href="https://fonts.googleapis.com" />
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+  <link rel="preload" as="image" href="gil.png" />
+  <link rel="preload" as="image" href="gilogo.png" />
   <link
script.js (1)

44-60: Expose theme state to assistive tech on toggle.
Keep aria-pressed in sync when users switch themes.

       const isDark = body.classList.contains("dark-theme");
 
       try {
         window.localStorage?.setItem("theme", isDark ? "dark" : "light");
       } catch (e) {
         console.warn("Failed to save theme preference:", e);
       }
+      themeToggleBtn.setAttribute("aria-pressed", String(isDark));
       toggleThemeIcons(moonIcon, sunIcon, isDark);
       updateLogo(isDark);
invoice.html (2)

27-34: Mirror accessibility and behavior improvements for the theme toggle here.

-      <button id="theme-toggle" class="theme-toggle-btn">
+      <button id="theme-toggle" class="theme-toggle-btn" type="button" aria-label="Toggle dark mode" aria-pressed="false">

11-15: Preload logo assets to reduce swap flicker on toggle.

   <link rel="preconnect" href="https://fonts.googleapis.com" />
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+  <link rel="preload" as="image" href="gil.png" />
+  <link rel="preload" as="image" href="gilogo.png" />
   <link
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 311be7c and 76c7c81.

📒 Files selected for processing (3)
  • index.html (1 hunks)
  • invoice.html (1 hunks)
  • script.js (3 hunks)
🔇 Additional comments (3)
index.html (1)

19-20: Header logo id addition aligns with JS hook. LGTM.
This enables programmatic theme-based swapping via updateLogo().

invoice.html (2)

20-21: Header logo id addition aligns with JS hook. LGTM.
This will swap correctly when dark mode is toggled.


233-236: Should the invoice preview logo follow theme as well?
Currently the preview always shows gilogo.png regardless of theme. Confirm whether that’s intentional (e.g., brand color fixed in PDFs) or if it should mirror the header behavior.

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.

1 participant