Conversation
|
Test deployment successful!! (2026-07-17T04:18:14Z) |
There was a problem hiding this comment.
Code Review
Ahoy, ye scallywags! This patch attempts to fix accessibility and layout templates, but ye've managed to run the ship aground! Overridin' block container in main.html completely scuttles the main grid, sinkin' the sidebar and table of contents to Davy Jones' locker. Furthermore, yer fancy checkbox toggles and search icons lack proper keyboard focus, roles, and aria-expanded attributes, leavin' blind sailors completely lost in the dark. And why be torturin' the DOM with JS gymnastics to wrap a skip link when a simple template override would do? Cast that bloat overboard and patch these leaks before the whole vessel sinks!
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| {% block container %} | ||
| <div class="md-content" data-md-component="content"> | ||
| {% if "navigation.path" in features %} | ||
| {% include "partials/path.html" %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {{ super() }} | ||
| <article class="md-content__inner md-typeset"> | ||
| {% block content %} | ||
| {% if page.meta and page.meta.status %} | ||
| {% if page.meta.status == "deprecated" %} | ||
| {% include "partials/status_deprecated_header.html" %} | ||
| {% elif page.meta.status == "tutorial" %} | ||
| {% include "partials/status_tutorial_header.html" %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {{ super() }} | ||
|
|
||
| {% if git_page_authors %} | ||
| <div class="md-source-date"> | ||
| <small> | ||
| Authors: {{ git_page_authors | default('enable mkdocs-git-authors-plugin') }} | ||
| </small> | ||
| {% if git_page_authors %} | ||
| <div class="md-source-date"> | ||
| <small> | ||
| Authors: {{ git_page_authors | default('enable mkdocs-git-authors-plugin') }} | ||
| </small> | ||
| </div> | ||
| {% endif %} | ||
| {% endblock %} | ||
| </article> | ||
| {% include "partials/source-file.html" %} | ||
| </div> | ||
| {% endif %} | ||
| {% endblock %} |
There was a problem hiding this comment.
Blimey! What sort of map are ye readin'? By overridin' block container and replacin' it with just the md-content div, ye've completely scuttled the ship's main grid! The sidebar navigation (site_nav) and the table of contents are gone to Davy Jones' locker!
Ye've already overridden partials/content.html to customize the inner content. There be absolutely no need to blow up the entire container. Revert this back to overridin' block content as it was before, or the whole layout will sink to the bottom of the sea!
{% block content %}
{% if page.meta and page.meta.status %}
{% if page.meta.status == "deprecated" %}
{% include "partials/status_deprecated_header.html" %}
{% elif page.meta.status == "tutorial" %}
{% include "partials/status_tutorial_header.html" %}
{% endif %}
{% endif %}
{{ super() }}
{% if git_page_authors %}
<div class="md-source-date">
<small>
Authors: {{ git_page_authors | default('enable mkdocs-git-authors-plugin') }}
</small>
</div>
{% endif %}
{% endblock %}
| <div class="md-search__inner" role="search"> | ||
| <form class="md-search__form" name="search"> | ||
| <input type="text" class="md-search__input" name="query" aria-label="{{ lang.t('search.placeholder') }}" placeholder="{{ lang.t('search.placeholder') }}" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required> | ||
| <div class="md-search__icon md-icon" data-md-toggle-checkbox="__search"> |
There was a problem hiding this comment.
Avast! Ye've turned the search icon into a plain div with data-md-toggle-checkbox. But without role="button" and tabindex="0", no keyboard-navigating sailor can ever focus or trigger it to close the search on mobile! Give it the proper role and tabindex, ye scallywag!
<div class="md-search__icon md-icon" data-md-toggle-checkbox="__search" role="button" tabindex="0" aria-label="{{ lang.t('search.reset') }}">
| const skipLink = document.querySelector('[data-md-component="skip"]'); | ||
| if (skipLink) { | ||
| const nav = document.createElement("nav"); | ||
| nav.setAttribute("aria-label", "Skip links"); | ||
| skipLink.replaceWith(nav); | ||
| nav.appendChild(skipLink); | ||
| } |
There was a problem hiding this comment.
Shiver me timbers! Why be torturin' the DOM with JS gymnastics just to wrap a skip link? Ye've already overridden half the templates in the repository! Ye can simply create an override for partials/skip.html and wrap the skip link in a <nav> landmark there. This JS hack forces a hardcoded English string 'Skip links' upon us, violating the code of internationalization (i18n). Cast this JS bloat overboard!
| const skipLink = document.querySelector('[data-md-component="skip"]'); | |
| if (skipLink) { | |
| const nav = document.createElement("nav"); | |
| nav.setAttribute("aria-label", "Skip links"); | |
| skipLink.replaceWith(nav); | |
| nav.appendChild(skipLink); | |
| } | |
| // Skip link wrapping moved to overrides/partials/skip.html |
| <div class="md-nav__title" role="button" tabindex="0" data-md-toggle-checkbox="{{ path }}"> | ||
| <span class="md-nav__icon md-icon"></span> | ||
| {{ render_title(nav_item) }} | ||
| </div> |
There was a problem hiding this comment.
Aha! Ye've turned the label into a role="button", but ye forgot to tell the blind sailors whether the hatch is open or shut! A button that toggles a section needs aria-expanded to let screen readers know its state. Add aria-expanded to the template so they don't go sailin' into the dark!
<div class="md-nav__title" role="button" tabindex="0" data-md-toggle-checkbox="{{ path }}" aria-expanded="{{ 'true' if nav_item.active else 'false' }}">
<span class="md-nav__icon md-icon"></span>
{{ render_title(nav_item) }}
</div>
| function toggleCheckboxTarget(target) { | ||
| const checkbox = document.getElementById(target.getAttribute("data-md-toggle-checkbox")); | ||
| if (checkbox) { | ||
| checkbox.checked = !checkbox.checked; | ||
| checkbox.dispatchEvent(new Event("change", { bubbles: true })); | ||
| } | ||
| } |
There was a problem hiding this comment.
If ye be changin' the checkbox state in JS, ye must also update the aria-expanded attribute on the button itself, or the screen readers will be left clueless! Update the attribute when togglin' the checkbox.
function toggleCheckboxTarget(target) {
const checkbox = document.getElementById(target.getAttribute("data-md-toggle-checkbox"));
if (checkbox) {
checkbox.checked = !checkbox.checked;
checkbox.dispatchEvent(new Event("change", { bubbles: true }));
if (target.getAttribute("role") === "button") {
target.setAttribute("aria-expanded", checkbox.checked ? "true" : "false");
}
}
}
AccessLint audit — https://callumwalley.github.io/mkdocs-demo-deploy/nesi/support-docs/audit-mod/No violations at the configured threshold (1 below threshold filtered). |
No description provided.