-
Notifications
You must be signed in to change notification settings - Fork 236
Fix logo redirect to main CircuitVerse homepage on Learn web page #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix logo redirect to main CircuitVerse homepage on Learn web page #742
Conversation
WalkthroughThis PR introduces a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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/strokeattributes 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-labelattributes, the SVG icons themselves could benefit from accessibility enhancements. Since the icons are decorative (their purpose is conveyed by the button labels), consider addingaria-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
📒 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.
| <header class="site-header" role="banner"> | ||
| <div class="site-header-inner"> | ||
| <a href="https://circuitverse.org" class="site-title lh-tight"> | ||
| CircuitVerse | ||
| </a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Search for includes of site-header.html in layout and template files
rg -n "include.*site-header" --type=html --type=liquidRepository: 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.htmlRepository: CircuitVerse/Interactive-Book
Length of output: 1141
🏁 Script executed:
# Search for JavaScript files that might handle toggle functionality
fd -e "js" -e "ts" | head -20Repository: 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=tsRepository: 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 -10Repository: 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=htmlRepository: 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.htmlRepository: CircuitVerse/Interactive-Book
Length of output: 55
🏁 Script executed:
# Check global_scripts.js for toggle handlers
cat -n assets/js/global_scripts.js | head -100Repository: 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.htmlRepository: CircuitVerse/Interactive-Book
Length of output: 239
🏁 Script executed:
# Search for any Jekyll include statements
rg -n "{% include" --type=htmlRepository: 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 -10Repository: 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 -20Repository: CircuitVerse/Interactive-Book
Length of output: 1022
🏁 Script executed:
# Check the default layout
cat -n _layouts/default.html | head -50Repository: CircuitVerse/Interactive-Book
Length of output: 126
🏁 Script executed:
# Search for any reference to site-header
rg -n "site-header" --type=htmlRepository: 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 -100Repository: 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_modulesRepository: CircuitVerse/Interactive-Book
Length of output: 133
🏁 Script executed:
# Look for Jekyll theme includes directory
ls -la _includes/ | head -20Repository: 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=scssRepository: 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.htmlRepository: CircuitVerse/Interactive-Book
Length of output: 226
🏁 Script executed:
# Search for any mention of "header" in includes
rg -n "header" _includes/ --type=htmlRepository: 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=htmlRepository: 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.htmlRepository: 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=htmlRepository: 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 -5Repository: 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=yamlRepository: 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 -20Repository: 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 -50Repository: 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 -50Repository: 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 -20Repository: 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=htmlRepository: 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=htmlRepository: 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 -10Repository: 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=yamlRepository: 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.ymlRepository: 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.htmlRepository: 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 -20Repository: 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 -50Repository: 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/nullRepository: 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:
- Override the theme's header component by creating
_includes/components/header.htmlwith the custom logo link, or - Add the site-header include to
_layouts/default.htmlor 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.
| <button | ||
| class="search-toggle" | ||
| aria-label="Toggle search" | ||
| aria-controls="search" | ||
| aria-expanded="false"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 fRepository: 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 3Repository: 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.htmlRepository: 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 -100Repository: 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.
|
Hi @Nihal4777 , please review this PR. |
Fix logo redirect to main CircuitVerse homepage on Learn web page
Fixes #741
Changes done:
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
Kindly review and merge this pull request. Thank you!
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.