Fix: Shuffle Bias, jQuery Check, Global Scope Issues, Scroll Handling, and Outdated Configurations#773
Conversation
… GA config, and GitHub Actions version
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis pull request makes small infrastructure and content adjustments across the repository: it updates a GitHub Actions checkout action from v2 to v4 and removes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
assets/js/module.js (1)
2351-2353: Use document/page scroll fallback when#scrollcountis absent.Line 2352 falls back to
0, which can miscalculatemyon scrollable pages not using#scrollcount. Prefer a window/document scroll fallback.♻️ Proposed fix
var scrollEl = document.getElementById("scrollcount"); -var scrollTop = scrollEl ? scrollEl.scrollTop : 0; +var scrollTop = scrollEl + ? scrollEl.scrollTop + : (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0); my = e.pageY - offsetY + scrollTop;
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bb3cdf7d-9c60-4493-87e9-06bfc12d0110
📒 Files selected for processing (5)
.github/scripts/assign-or-comment.js.github/workflows/deploy.yml_config.ymlassets/js/module.jsassets/js/quiz.js
💤 Files with no reviewable changes (1)
- .github/scripts/assign-or-comment.js
| # Footer content | ||
| # appears at the bottom of every page's main content | ||
| footer_content: "Copyright © 2026 Contributors to CircuitVerse. Distributed under a [CC-by-sa] license." | ||
| footer_content: "Copyright © {% assign current_year = 'now' | date: '%Y' %}{{ current_year }} Contributors to CircuitVerse. Distributed under a [CC-by-sa] license." |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find where footer_content is used in templates/layouts
rg -n 'footer_content' --type html --type liquid -g '*.html' -g '*.md'
# Check the just-the-docs theme's footer implementation if vendored
fd -e html -e md | xargs grep -l 'footer_content' 2>/dev/null | head -5Repository: CircuitVerse/Interactive-Book
Length of output: 103
🏁 Script executed:
#!/bin/bash
# Search for footer_content without problematic file type specifications
rg 'footer_content' -n
# Also look at the _config.yml file structure
head -100 _config.ymlRepository: CircuitVerse/Interactive-Book
Length of output: 4214
🏁 Script executed:
#!/bin/bash
# Find all template/layout files in common Jekyll locations
find . -type f \( -name "*.html" -o -name "*.liquid" -o -name "*.md" \) | grep -E '(_includes|_layouts|_sass)' | head -20
# List directory structure to understand theme setup
ls -laRepository: CircuitVerse/Interactive-Book
Length of output: 2457
🏁 Script executed:
#!/bin/bash
# Search for footer_content in _layouts and _includes
rg 'footer_content' _layouts/ _includes/ 2>/dev/null
# Check what's in _layouts directory
ls -la _layouts/
# Check what's in _includes directory
ls -la _includes/Repository: CircuitVerse/Interactive-Book
Length of output: 1882
🌐 Web query:
just-the-docs Jekyll theme footer_content Liquid processing
💡 Result:
In the Just the Docs Jekyll theme, the footer_content configuration option in _config.yml is deprecated and still supported for backward compatibility, but it does not process Liquid templating. It displays static HTML strings directly at the bottom of every page's main content. For robust markup and Liquid-based content (e.g., using Jekyll variables, loops, conditionals), create a custom _includes/footer_custom.html file in your site. This file is processed as a standard Jekyll include with full Liquid support and appears at the bottom of every page's main content, replacing or supplementing the deprecated footer_content. Example legacy footer_content (static HTML, no Liquid): footer_content: "Copyright © 2017-2020 Patrick Marsceill. Distributed by an <a href="https://github.com/just-the-docs/just-the-docs/tree/main/LICENSE.txt\">MIT license." Example _includes/footer_custom.html (with Liquid):
Copyright © {{ site.time | date: '%Y' }} {{ site.author | default: site.title | escape }}. Powered by Jekyll with Just the Docs.
{% if site.github.repository %} {{ site.github.repository }} {% endif %}Citations:
- 1: https://just-the-docs.com/docs/configuration/
- 2: https://just-the-docs.com/docs/customization
- 3: https://v0-3-3-docs.just-the-docs.com/docs/configuration/
- 4: https://just-the-docs.github.io/just-the-docs/docs/customization/
🏁 Script executed:
#!/bin/bash
# Check if footer_custom.html exists
find . -name "*footer*" -type f
# Also check the content of content_footer.html since it exists
cat _includes/content_footer.htmlRepository: CircuitVerse/Interactive-Book
Length of output: 195
Liquid tags in footer_content are not processed by just-the-docs.
The just-the-docs theme treats footer_content from _config.yml as static HTML only. The Liquid expression {% assign current_year = 'now' | date: '%Y' %}{{ current_year }} will render literally in the footer instead of displaying the current year.
To fix this, create _includes/footer_custom.html with the Liquid logic:
Copyright © {{ 'now' | date: '%Y' }} Contributors to CircuitVerse. Distributed under a [CC-by-sa] license.This is the officially supported approach by just-the-docs for dynamic footer content. Alternatively, remove the footer_content config and place the footer logic in the theme's footer template directly.
… GA config, and GitHub Actions version
📄 PR Description
🔍 Summary
This PR fixes multiple code quality, correctness, and maintenance issues across the repository. It also incorporates review feedback to improve scroll handling robustness.
✅ Changes Made
Replaced biased shuffle with Fisher–Yates algorithm
Fixed incorrect jQuery null check using .length
Removed unnecessary console.log calls impacting performance
Removed invalid #!/bin/bash from JavaScript file
Updated deprecated Google Analytics (UA → GA4)
Replaced hardcoded year with dynamic handling (see note below)
Upgraded GitHub Action from actions/checkout@v2 → v4
Fixed global variable leakage using proper scoping
Improved scroll calculation fallback when #scrollcount is absent