Skip to content

Conversation

@manmeetsantre
Copy link

@manmeetsantre manmeetsantre commented Dec 16, 2025

Fix logo redirect to main CircuitVerse homepage on Learn web page

Fixes #741

Changes done:

  • Updated the site header logo link on the Learn site to always redirect to the main CircuitVerse homepage (https://circuitverse.org)
  • Ensured consistent logo redirect behaviour across Learn pages

Screenshots

Before: Clicking the CircuitVerse logo reloads the Learn page
After: Clicking the CircuitVerse logo redirects to https://circuitverse.org

Preview Link(s):

✅️ By submitting this PR, I have verified the following

  • Checked to see if a similar PR has already been opened
  • Reviewed the contributing guidelines
  • Sample preview link added (will be updated after checks)
  • Tried squashing the commits into one

Kindly review and merge this pull request. Thank you!

Summary by CodeRabbit

  • New Features
    • Introduced a new site header component displaying the CircuitVerse branding and title link.
    • Added conditional search toggle functionality—search button displays when enabled in site configuration.
    • Implemented a menu toggle button for easy access to site navigation options.
    • Enhanced overall header structure with improved usability and organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Walkthrough

This PR introduces a new _includes/site-header.html partial that renders the main site header with a link-styled CircuitVerse site title, conditionally includes a search toggle button based on configuration, provides a menu toggle button, and implements appropriate ARIA attributes for accessibility.

Changes

Cohort / File(s) Change Summary
New Site Header Partial
_includes/site-header.html
Introduces header structure with site title link to CircuitVerse, conditional search toggle button with accessibility label and SVG icon, menu toggle button with ARIA attributes, and nested container for organization

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single, straightforward HTML partial with clear structure
  • Conditional rendering logic is minimal and easy to validate
  • Verify that the site title link URL correctly points to the homepage and functions as intended across all page types (particularly Learn and Explore pages)

Possibly related issues

  • #6467: This PR implements the site header partial with the link-styled CircuitVerse title, which directly addresses the objective of adding a proper site header HTML structure that enables the logo to redirect to home consistently across all pages.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: fixing the logo redirect behavior to point to the CircuitVerse homepage, which directly addresses the primary objective.
Linked Issues check ✅ Passed The code changes implement the required fix from issue #741 by introducing a site header with a logo link to the CircuitVerse homepage, ensuring consistent redirect behavior across Learn pages.
Out of Scope Changes check ✅ Passed The PR introduces only a new site header HTML partial that directly addresses the logo redirect issue; no extraneous or unrelated changes are present.
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
  • 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

Comment @coderabbitai help to get the list of available commands and usage tips.

@manmeetsantre manmeetsantre changed the title Fix logo redirect to main CircuitVerse homepage on Learn site Fix logo redirect to main CircuitVerse homepage on Learn web page Dec 16, 2025
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: 2

♻️ Duplicate comments (1)
_includes/site-header.html (1)

26-28: Same SVG attribute concern as the search toggle.

This SVG has the same missing fill/stroke attributes as the search toggle icon. Please refer to the earlier comment on lines 13-16 for verification steps.

🧹 Nitpick comments (2)
_includes/site-header.html (2)

8-12: Consider adding an ID attribute for consistency.

The menu toggle button (line 21) has id="menu-button", but the search toggle lacks an ID. Adding one (e.g., id="search-toggle") would improve consistency and make JavaScript targeting more predictable.

Apply this diff to add an ID:

     <button
+      id="search-toggle"
       class="search-toggle"
       aria-label="Toggle search"
       aria-controls="search"
       aria-expanded="false">

13-16: Consider enhancing SVG accessibility.

While the buttons have appropriate aria-label attributes, the SVG icons themselves could benefit from accessibility enhancements. Since the icons are decorative (their purpose is conveyed by the button labels), consider adding aria-hidden="true" to the SVGs, or add <title> elements within the SVGs for screen reader users.

Example for the search icon:

-      <svg viewBox="0 0 24 24" width="24" height="24">
+      <svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
         <path d="M21 21l-4.35-4.35"></path>
         <circle cx="10" cy="10" r="7"></circle>
       </svg>

Or alternatively, with a title:

-      <svg viewBox="0 0 24 24" width="24" height="24">
+      <svg viewBox="0 0 24 24" width="24" height="24" role="img">
+        <title>Search icon</title>
         <path d="M21 21l-4.35-4.35"></path>
         <circle cx="10" cy="10" r="7"></circle>
       </svg>

Also applies to: 26-28

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a01b5d and 1a10778.

📒 Files selected for processing (1)
  • _includes/site-header.html (1 hunks)
🔇 Additional comments (1)
_includes/site-header.html (1)

13-16: SVG icons are styled correctly via CSS and will render without issues.

The SVG path elements receive stroke styling from the global CSS rule svg path { stroke: $base-svg-path; } (defined in custom.scss as black), and the circle element renders with the default black fill. This approach is standard and requires no changes.

Likely an incorrect or invalid review comment.

Comment on lines +1 to +5
<header class="site-header" role="banner">
<div class="site-header-inner">
<a href="https://circuitverse.org" class="site-title lh-tight">
CircuitVerse
</a>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search for includes of site-header.html in layout and template files
rg -n "include.*site-header" --type=html --type=liquid

Repository: CircuitVerse/Interactive-Book

Length of output: 103


🏁 Script executed:

# Check the full content of site-header.html to verify SVG attributes and structure
cat -n _includes/site-header.html

Repository: CircuitVerse/Interactive-Book

Length of output: 1141


🏁 Script executed:

# Search for JavaScript files that might handle toggle functionality
fd -e "js" -e "ts" | head -20

Repository: CircuitVerse/Interactive-Book

Length of output: 345


🏁 Script executed:

# Look for toggle-related JavaScript handlers
rg -n "aria-expanded\|menu-button\|search.*toggle" --type=js --type=ts

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# List layout/template files to understand the site structure
fd -e "html" -e "liquid" | grep -i "layout\|template" | head -10

Repository: CircuitVerse/Interactive-Book

Length of output: 118


🏁 Script executed:

# Search for site-header includes with html file type only
rg -n "include.*site-header" --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Check if site-header is included in the layout files
grep -n "site-header" _layouts/circuitverse.html _layouts/home.html

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Check global_scripts.js for toggle handlers
cat -n assets/js/global_scripts.js | head -100

Repository: CircuitVerse/Interactive-Book

Length of output: 1659


🏁 Script executed:

# Search for menu-button or aria-expanded references in JavaScript
rg -n "menu-button\|aria-expanded\|search-toggle" assets/js/

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Verify site-header.html file exists
ls -la _includes/ | grep -E "site-header|header"

Repository: CircuitVerse/Interactive-Book

Length of output: 211


🏁 Script executed:

# Check the complete _layouts/home.html file
cat -n _layouts/home.html

Repository: CircuitVerse/Interactive-Book

Length of output: 239


🏁 Script executed:

# Search for any Jekyll include statements
rg -n "{% include" --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 158


🏁 Script executed:

# Check if there are any CSS files that might handle toggles
fd -e "css" -e "scss" | head -10

Repository: CircuitVerse/Interactive-Book

Length of output: 267


🏁 Script executed:

# Look for any JavaScript files that might handle menu/search toggles
rg -n "querySelector\|getElementById.*menu\|addEventListener.*aria" assets/js/

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Search for include statements using simpler pattern
rg -n "include" --type=html | head -20

Repository: CircuitVerse/Interactive-Book

Length of output: 1022


🏁 Script executed:

# Check the default layout
cat -n _layouts/default.html | head -50

Repository: CircuitVerse/Interactive-Book

Length of output: 126


🏁 Script executed:

# Search for any reference to site-header
rg -n "site-header" --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 207


🏁 Script executed:

# Check if there's a Jekyll config that might include it globally
cat -n _config.yml 2>/dev/null | head -100

Repository: CircuitVerse/Interactive-Book

Length of output: 4669


🏁 Script executed:

# Check if just-the-docs theme provides a default header
# Search for any Jekyll theme override files or documentation
find . -name "*header*" -type f | grep -v node_modules

Repository: CircuitVerse/Interactive-Book

Length of output: 133


🏁 Script executed:

# Look for Jekyll theme includes directory
ls -la _includes/ | head -20

Repository: CircuitVerse/Interactive-Book

Length of output: 1319


🏁 Script executed:

# Check if there's a _layouts directory structure
ls -la _layouts/

Repository: CircuitVerse/Interactive-Book

Length of output: 309


🏁 Script executed:

# Search for where site header might be coming from in theme files
rg -n "site-header\|site-title" --type=html --type=scss

Repository: CircuitVerse/Interactive-Book

Length of output: 101


🏁 Script executed:

# Search for site-header in ALL file types
rg -n "site-header" .

Repository: CircuitVerse/Interactive-Book

Length of output: 211


🏁 Script executed:

# Check if the just-the-docs theme might have its own header override mechanism
# Look at the full content of the theme-related files
cat -n _includes/content_header.html

Repository: CircuitVerse/Interactive-Book

Length of output: 226


🏁 Script executed:

# Search for any mention of "header" in includes
rg -n "header" _includes/ --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 247


🏁 Script executed:

# Search for any reference to just-the-docs header or how it might be overridden
rg -n "site-header" . --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 211


🏁 Script executed:

# Check if there might be a head_custom or similar override mechanism
cat -n _includes/head_custom.html

Repository: CircuitVerse/Interactive-Book

Length of output: 433


🏁 Script executed:

# Look for how just-the-docs might include a header
rg -n "header\|site-header" _layouts/ --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Check the git history to see if this file was recently added
git log --oneline _includes/site-header.html 2>/dev/null | head -5

Repository: CircuitVerse/Interactive-Book

Length of output: 142


🏁 Script executed:

# Double-check: search for any Jekyll override mechanism that might use site-header
# Check if just-the-docs has a specific mechanism
rg -n "site-header" . --type=html --type=yaml

Repository: CircuitVerse/Interactive-Book

Length of output: 211


🏁 Script executed:

# Verify the file was added in this commit
git show --name-status 1a10778 2>/dev/null | head -20

Repository: CircuitVerse/Interactive-Book

Length of output: 658


🏁 Script executed:

# Check if there's documentation on how to override just-the-docs header
cat -n README.md 2>/dev/null | head -50

Repository: CircuitVerse/Interactive-Book

Length of output: 3256


🏁 Script executed:

# Check the full git diff to see what the commit actually changed
git show 1a10778 --stat 2>/dev/null | tail -50

Repository: CircuitVerse/Interactive-Book

Length of output: 3101


🏁 Script executed:

# Look for any Jekyll/just-the-docs documentation on overriding headers
rg -n "override\|customize.*header" . --type=html --type=md 2>/dev/null | head -20

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Check if just-the-docs provides a mechanism for custom header via _includes override
# by looking at whether a site-header include would be used
rg -n "{% include.*header\|include.*site-header" . --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 188


🏁 Script executed:

# Examine if there's a way to check the actual built output or if there's documentation
ls -la | grep -i "docs\|site\|build"

Repository: CircuitVerse/Interactive-Book

Length of output: 128


🏁 Script executed:

# Search for any Jekyll includes with simpler pattern
rg -n "include" _layouts/ --type=html

Repository: CircuitVerse/Interactive-Book

Length of output: 303


🏁 Script executed:

# Check the docs directory
ls -la docs/

Repository: CircuitVerse/Interactive-Book

Length of output: 785


🏁 Script executed:

# Look for just-the-docs theme files or documentation
rg -n "just-the-docs" . --type=html --type=yaml --type=md 2>/dev/null | head -10

Repository: CircuitVerse/Interactive-Book

Length of output: 454


🏁 Script executed:

# Check if site-header might be overriding a theme file
# Just-the-docs typically uses _includes/header.html, not site-header.html
rg -n "header.html\|site.header" . --type=html --type=yaml

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Search for any Jekyll theme override documentation or mechanism
# Check if there's a way just-the-docs might auto-include a site-header
rg -n "_includes" _config.yml

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Look for any JavaScript that might dynamically include or render site-header
rg -n "site-header" assets/

Repository: CircuitVerse/Interactive-Book

Length of output: 55


🏁 Script executed:

# Final check: search all files for any reference to site-header being used
rg -n "site-header" .

Repository: CircuitVerse/Interactive-Book

Length of output: 211


🏁 Script executed:

# Check if maybe there's a theme customization or override mechanism we're missing
cat -n _includes/content_header.html

Repository: CircuitVerse/Interactive-Book

Length of output: 226


🏁 Script executed:

# Check if just-the-docs has a specific convention for auto-including site-header
# Search GitHub or documentation for just-the-docs
cat README.md | grep -i "just-the-docs\|override\|customize" | head -20

Repository: CircuitVerse/Interactive-Book

Length of output: 219


🏁 Script executed:

# Verify the commit actually added this file and check if there's anything else in the PR
git show 1a10778 _includes/site-header.html 2>/dev/null | head -50

Repository: CircuitVerse/Interactive-Book

Length of output: 1339


🏁 Script executed:

# Look for any Jekyll hooks or plugin configuration that might auto-include files
find . -name "*.yml" -o -name "*.yaml" | xargs grep -l "site-header" 2>/dev/null

Repository: CircuitVerse/Interactive-Book

Length of output: 57


File not being used—needs integration or different approach.

The site-header.html file was created but is not referenced anywhere in the site layouts. Just-the-docs renders the page header via _includes/components/header.html from the theme. To fix the logo redirect, you need to either:

  1. Override the theme's header component by creating _includes/components/header.html with the custom logo link, or
  2. Add the site-header include to _layouts/default.html or the appropriate layout file.

Additionally, the SVG paths lack fill/stroke attributes and will require CSS styling to be visible. The aria-expanded attributes are hardcoded as "false"—ensure corresponding JavaScript exists to toggle these values.

Comment on lines +8 to +12
<button
class="search-toggle"
aria-label="Toggle search"
aria-controls="search"
aria-expanded="false">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find repository structure and JavaScript files
find . -type f -name "*.js" | head -20
find . -name "_includes" -type d
ls -la _includes/ 2>/dev/null || echo "Not in root"

Repository: CircuitVerse/Interactive-Book

Length of output: 2057


🏁 Script executed:

# Search for the site-header.html file and check its content
find . -name "site-header.html" -type f

Repository: CircuitVerse/Interactive-Book

Length of output: 101


🏁 Script executed:

# Search for JavaScript that handles aria-expanded, search-toggle, or menu-button
rg -n "aria-expanded|search-toggle|menu-button" --type js
rg -n "addEventListener.*click|setAttribute.*aria" --type js -A 3

Repository: CircuitVerse/Interactive-Book

Length of output: 50386


🏁 Script executed:

# Read the site-header.html file to see the actual button implementation
cat -n _includes/site-header.html

Repository: CircuitVerse/Interactive-Book

Length of output: 1141


🏁 Script executed:

# Search for toggle or aria-related code in global_scripts.js
cat -n assets/js/global_scripts.js | head -100

Repository: CircuitVerse/Interactive-Book

Length of output: 1659


Add JavaScript handlers to dynamically update aria-expanded for toggle buttons.

Both the search toggle (lines 8-12) and menu button (lines 20-25) have aria-expanded="false" hardcoded in HTML. These must be updated dynamically via JavaScript when the buttons are clicked to maintain proper accessibility for screen reader users. Implement event listeners that toggle these attributes between "true" and "false" based on the visibility state of their controlled elements (#search and #site-nav).

Applies to lines 8-12 and 20-25.

🤖 Prompt for AI Agents
In _includes/site-header.html around lines 8-12 (and similarly lines 20-25), the
toggle buttons have aria-expanded hardcoded; add JavaScript that selects the
.search-toggle and .menu-toggle buttons and their controlled elements (#search
and #site-nav), attach click handlers that toggle the visibility state of those
targets and update the button's aria-expanded attribute to "true" when visible
and "false" when hidden; ensure the handler also sets the controlled element's
appropriate class/attribute (e.g., hidden/aria-hidden) to reflect state and use
event.key handling for Enter/Space if needed for keyboard activation.

@manmeetsantre
Copy link
Author

manmeetsantre commented Dec 24, 2025

Hi @Nihal4777 , please review this PR.
If any changes are required, kindly let me know.
Thank you!

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.

🐞 Bug "CircuitVerse" logo on Learn & Explore Tutorials pages does not redirect to Home

1 participant