From cc15f5ed2143522a230706462a9258a38b58517c Mon Sep 17 00:00:00 2001 From: kvmil6 <24772620@emu.edu.tr> Date: Mon, 17 Aug 2026 11:58:01 +0400 Subject: [PATCH 1/3] Update docs.css --- docs_src/stylesheets/docs.css | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs_src/stylesheets/docs.css b/docs_src/stylesheets/docs.css index 02aeced..4aba6b9 100644 --- a/docs_src/stylesheets/docs.css +++ b/docs_src/stylesheets/docs.css @@ -535,7 +535,7 @@ body:not(:has(.ad-home)) .md-sidebar--primary { position: fixed; inset: 112px auto 0 0; width: 276px; - height: calc(100vh - 112px); + height: calc(100vh - 112px) !important; padding: 20px 10px 48px 14px; background: var(--ad-doc-sidebar); border-right: 1px solid var(--ad-doc-line); @@ -551,7 +551,11 @@ body:not(:has(.ad-home)) .md-sidebar--primary::-webkit-scrollbar { } body:not(:has(.ad-home)) .md-sidebar--primary .md-sidebar__scrollwrap { + height: auto !important; + max-height: none !important; + min-height: 100%; margin: 0; + overflow: visible !important; scrollbar-width: none; } @@ -560,6 +564,7 @@ body:not(:has(.ad-home)) .md-sidebar--primary .md-sidebar__scrollwrap::-webkit-s } body:not(:has(.ad-home)) .md-sidebar--primary .md-sidebar__inner { + height: auto !important; padding: 0; } @@ -695,11 +700,13 @@ body:not(:has(.ad-home)) .md-sidebar--secondary { position: sticky; top: 42px; width: 216px; - height: auto; + height: auto !important; padding: 0; } body:not(:has(.ad-home)) .md-sidebar--secondary .md-sidebar__scrollwrap { + height: auto !important; + max-height: calc(100vh - 170px) !important; margin: 0; padding: 0; } @@ -1436,7 +1443,7 @@ body:not(:has(.ad-home)) :focus-visible { body:not(:has(.ad-home)) .md-sidebar--primary { inset: 112px auto 0 0; width: min(320px, 86vw); - height: calc(100vh - 112px); + height: calc(100vh - 112px) !important; transform: translateX(-100%); transition: transform 180ms ease; box-shadow: 24px 0 60px rgba(0, 0, 0, 0.3); From d1826e8eb3f76fccea8b6429849ed26449b641ce Mon Sep 17 00:00:00 2001 From: kvmil6 <24772620@emu.edu.tr> Date: Mon, 17 Aug 2026 12:11:24 +0400 Subject: [PATCH 2/3] Fix search result layout, remove page highlight marks, and fix table full-width fit --- docs_src/javascripts/docs.js | 19 +++++ docs_src/stylesheets/docs.css | 131 ++++++++++++++++++++++++---------- mkdocs.yml | 1 - 3 files changed, 112 insertions(+), 39 deletions(-) diff --git a/docs_src/javascripts/docs.js b/docs_src/javascripts/docs.js index 991d8c7..95fee4f 100644 --- a/docs_src/javascripts/docs.js +++ b/docs_src/javascripts/docs.js @@ -135,8 +135,27 @@ onScroll(); } + function clearSearchHighlights() { + // Strip any lingering ?h= query parameter from URL + if (window.location.search.includes("h=")) { + const url = new URL(window.location.href); + url.searchParams.delete("h"); + window.history.replaceState({}, "", url.pathname + (url.search ? url.search : "") + url.hash); + } + // Unwrap any mark elements created by search highlight in page content + document.querySelectorAll(".md-content mark, .md-content__inner mark").forEach((mark) => { + const parent = mark.parentNode; + if (!parent) return; + while (mark.firstChild) { + parent.insertBefore(mark.firstChild, mark); + } + mark.remove(); + }); + } + function enhanceDocs() { labelThemeProgress(); + clearSearchHighlights(); if (document.querySelector("[data-agentdiff-home]")) return; document.body.classList.add("ad-doc-page"); enhanceSearch(); diff --git a/docs_src/stylesheets/docs.css b/docs_src/stylesheets/docs.css index 4aba6b9..9c75c9c 100644 --- a/docs_src/stylesheets/docs.css +++ b/docs_src/stylesheets/docs.css @@ -462,8 +462,10 @@ body:not(:has(.ad-home)) .md-search-result__item { body:not(:has(.ad-home)) .md-search-result__link { min-width: 0; margin: 0; - padding: 13px 18px; + padding: 10px 18px; + display: block; overflow: hidden; + transition: background 120ms ease; } body:not(:has(.ad-home)) .md-search-result__item > .md-search-result__link:not(:first-child) { @@ -480,56 +482,85 @@ body:not(:has(.ad-home)) .md-search__suggest { } body:not(:has(.ad-home)) .md-search-result__article { + display: flex !important; + align-items: center !important; + gap: 12px !important; min-width: 0; padding: 0 !important; - overflow: hidden; + margin: 0 !important; + position: static !important; color: var(--ad-doc-body); - font-size: 0.63rem; - line-height: 1.55; - overflow-wrap: anywhere; + font-size: 0.72rem; + line-height: 1.4; } -body:not(:has(.ad-home)) .md-search-result__article:has(> .md-search-result__icon) { - padding-left: 30px !important; +body:not(:has(.ad-home)) .md-search-result__icon { + position: static !important; + flex: 0 0 16px !important; + width: 16px !important; + height: 16px !important; + margin: 0 !important; + padding: 0 !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + color: var(--ad-doc-muted) !important; + opacity: 0.75; } -body:not(:has(.ad-home)) .md-search-result__icon { - top: 1px !important; - left: 0 !important; - width: 18px; - height: 18px; - transform: none !important; +body:not(:has(.ad-home)) .md-search-result__icon svg { + width: 15px !important; + height: 15px !important; + fill: currentColor !important; + display: block !important; } body:not(:has(.ad-home)) .md-search-result__article h1, body:not(:has(.ad-home)) .md-search-result__article h2, body:not(:has(.ad-home)) .md-search-result__article h3 { - margin: 0 0 4px !important; + flex: 1 1 auto; + min-width: 0; + margin: 0 !important; padding: 0 !important; color: var(--ad-doc-text); - font-size: 0.72rem !important; - font-weight: 680; - line-height: 1.35 !important; - letter-spacing: -0.02em; + font-size: 0.76rem !important; + font-weight: 600; + line-height: 1.4 !important; + letter-spacing: -0.015em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } body:not(:has(.ad-home)) .md-search-result__article h2::before { - display: none; + display: none !important; } body:not(:has(.ad-home)) .md-search-result__article p { - display: none; + display: none !important; } body:not(:has(.ad-home)) .md-search-result__article mark { - background: transparent; - color: var(--ad-doc-accent); + background: transparent !important; + color: var(--ad-doc-accent) !important; + font-weight: 600; + text-decoration: none !important; } body:not(:has(.ad-home)) .md-search-result__more { display: none !important; } +/* Ensure no highlight boxes appear in page body content */ +body:not(:has(.ad-home)) mark:not(.md-search-result mark) { + background: transparent !important; + color: inherit !important; + text-decoration: none !important; + box-shadow: none !important; + border: 0 !important; + padding: 0 !important; +} + /* Fixed navigation rail */ body:not(:has(.ad-home)) .md-sidebar--primary { position: fixed; @@ -929,49 +960,73 @@ body:not(:has(.ad-home)) .tabbed-block pre { } /* Tables */ -body:not(:has(.ad-home)) .md-typeset__table { +body:not(:has(.ad-home)) .md-typeset__table, +body:not(:has(.ad-home)) .md-typeset__scrollwrap { display: block; max-width: 100%; margin: 1.5em 0; - border: 1px solid var(--ad-doc-line); - border-radius: 10px; + padding: 0; + border: 0; + background: transparent; overflow-x: auto; overflow-y: hidden; - background: var(--ad-doc-bg); - scrollbar-gutter: stable; } body:not(:has(.ad-home)) .md-typeset table:not([class]) { - width: 100%; - border: 0; - font-size: 0.67rem; + display: table !important; + width: 100% !important; + max-width: 100%; + margin: 0; + border-collapse: separate !important; + border-spacing: 0 !important; + border: 1px solid var(--ad-doc-line) !important; + border-radius: 10px !important; + overflow: hidden !important; + background: var(--ad-doc-bg); + font-size: 0.69rem; +} + +body:not(:has(.ad-home)) .md-typeset table:not([class]) thead { + background: var(--ad-doc-panel-2); } body:not(:has(.ad-home)) .md-typeset table:not([class]) th { - padding: 13px 15px; + padding: 12px 18px; background: var(--ad-doc-panel-2); color: var(--ad-doc-text); font-family: "JetBrains Mono", monospace; - font-size: 0.56rem; + font-size: 0.58rem; + font-weight: 700; letter-spacing: 0.04em; + border-bottom: 1px solid var(--ad-doc-line); + border-top: 0; + border-left: 0; + border-right: 0; } body:not(:has(.ad-home)) .md-typeset table:not([class]) td { - padding: 13px 15px; - border-top-color: var(--ad-doc-line); + padding: 12px 18px; + border-top: 1px solid var(--ad-doc-line); + border-bottom: 0; + border-left: 0; + border-right: 0; color: var(--ad-doc-body); overflow-wrap: anywhere; } -body:not(:has(.ad-home)) .md-typeset table:not([class]) code { - white-space: nowrap; - overflow-wrap: normal; +body:not(:has(.ad-home)) .md-typeset table:not([class]) tbody tr:first-child td { + border-top: 0; } -body:not(:has(.ad-home)) .md-typeset table:not([class]) tr:hover { +body:not(:has(.ad-home)) .md-typeset table:not([class]) tr:hover td { background: var(--ad-doc-panel); } +body:not(:has(.ad-home)) .md-typeset table:not([class]) code { + white-space: nowrap; + overflow-wrap: normal; +} + /* Notices / admonitions */ body:not(:has(.ad-home)) .md-typeset .admonition, body:not(:has(.ad-home)) .md-typeset details { diff --git a/mkdocs.yml b/mkdocs.yml index ee929b5..3b0cab4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,7 +39,6 @@ theme: - navigation.path - navigation.sections - navigation.tracking - - search.highlight - content.code.annotate - content.code.copy - content.tabs.link From 730fd02a3ef497d75c167cf7d7bb949c13a8fe2e Mon Sep 17 00:00:00 2001 From: kvmil6 <24772620@emu.edu.tr> Date: Mon, 17 Aug 2026 12:32:29 +0400 Subject: [PATCH 3/3] Center search navbar, align subnav to left, add single theme toggle with system default, remove home link, and fix TOC scroll position --- docs_src/javascripts/docs.js | 38 ++++++++++ docs_src/overrides/partials/header.html | 24 +++--- docs_src/stylesheets/docs.css | 98 ++++++++++++++----------- mkdocs.yml | 6 -- tests/test_cli.py | 11 ++- 5 files changed, 113 insertions(+), 64 deletions(-) diff --git a/docs_src/javascripts/docs.js b/docs_src/javascripts/docs.js index 95fee4f..7cfd119 100644 --- a/docs_src/javascripts/docs.js +++ b/docs_src/javascripts/docs.js @@ -32,6 +32,43 @@ return Promise.resolve(); } + function setupThemeToggle() { + const toggle = document.querySelector(".ad-doc-theme-toggle"); + if (!toggle || toggle.dataset.themeEnhanced === "true") return; + toggle.dataset.themeEnhanced = "true"; + + const getPreferredScheme = () => { + const saved = localStorage.getItem("agentdiff-color-scheme"); + if (saved === "slate" || saved === "default") return saved; + return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "slate" : "default"; + }; + + const applyScheme = (scheme) => { + document.body.setAttribute("data-md-color-scheme", scheme); + const isDark = scheme === "slate"; + const title = isDark ? "Switch to light mode" : "Switch to dark mode"; + toggle.setAttribute("title", title); + toggle.setAttribute("aria-label", title); + }; + + applyScheme(getPreferredScheme()); + + toggle.addEventListener("click", () => { + const current = document.body.getAttribute("data-md-color-scheme") || getPreferredScheme(); + const next = current === "slate" ? "default" : "slate"; + localStorage.setItem("agentdiff-color-scheme", next); + applyScheme(next); + }); + + if (window.matchMedia) { + window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => { + if (!localStorage.getItem("agentdiff-color-scheme")) { + applyScheme(e.matches ? "slate" : "default"); + } + }); + } + } + function openSearch() { const searchToggle = document.getElementById("__search"); if (!searchToggle) return; @@ -155,6 +192,7 @@ function enhanceDocs() { labelThemeProgress(); + setupThemeToggle(); clearSearchHighlights(); if (document.querySelector("[data-agentdiff-home]")) return; document.body.classList.add("ad-doc-page"); diff --git a/docs_src/overrides/partials/header.html b/docs_src/overrides/partials/header.html index 9a33963..27245a4 100644 --- a/docs_src/overrides/partials/header.html +++ b/docs_src/overrides/partials/header.html @@ -1,4 +1,11 @@ {% set current_url = page.url if page else "" %} +