Skip to content

docs: use readthedocs search addons for cross-project search in main search bar - #320

Merged
mergify[bot] merged 2 commits into
flux-framework:masterfrom
grondo:xss-v2
Apr 16, 2026
Merged

docs: use readthedocs search addons for cross-project search in main search bar#320
mergify[bot] merged 2 commits into
flux-framework:masterfrom
grondo:xss-v2

Conversation

@grondo

@grondo grondo commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Supposedly if we stop trying to implement a special search box ourselves, the RTD search "Addons" feature will override the site search with its own search box which supports searching all subprojects.

Again, to test I need to create a PR so a preview will be built.

Fixes #318

@garlick

garlick commented Apr 16, 2026

Copy link
Copy Markdown
Member

Ooh that might be working!

@grondo

grondo commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, finally getting somewhere 🙄

@grondo

grondo commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I'm pushing incremental work here because the only way to test is the readthedocs PR builds...

grondo and others added 2 commits April 16, 2026 06:55
Problem: sphinx_immaterial performs single-project client-side search
with no way to reach flux-framework subproject documentation. RTD
Addons (enabled by default since October 2024) provides native
cross-project search but was only accessible via the bottom-right
flyout, not the top-bar search input.

Override partials/search.html to render a search input that lacks
sphinx_immaterial's data-md-component attributes so the theme ignores
it, then dispatch the readthedocs-search-show custom event on
focus/click to open the RTD Addons cross-project search modal from
the header. Position the bar absolutely within .md-header__inner and
center it with left:50% + translate(-50%,-50%) so it stays centered
regardless of flex siblings. Falls back to sphinx_immaterial's
standard search for local builds where RTD Addons is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Problem: The RTD Addons search modal uses light mode regardless
of the site's color scheme. CSS custom properties set on body
are insufficient because the shadow DOM's :host rules override
inherited values in the cascade. The .filters-title element inside
the shadow root also uses a hardcoded background: rgb(252,252,252)
that no external custom property could reach.

Set all --readthedocs-search-* overrides directly on the
readthedocs-search host element so light-DOM author styles beat :host
rules. For elements with hardcoded values, inject a <style> into the
shadow root when the slate scheme is active; CSS custom properties
pierce the shadow boundary so the injected rule can reference
--readthedocs-search-content-background-color. A MutationObserver
re-applies the style when the user toggles the color scheme.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@grondo grondo changed the title docs: try again to fix cross-project search docs: use readthedocs search addons for cross-project search in main search bar Apr 16, 2026
@grondo

grondo commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Ok, this seems to be working now. The cross-project search seems to be working in the RTD PR preview as well.

@wihobbs wihobbs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@grondo grondo added the merge-when-passing mark PR for auto-merging by mergify.io bot label Apr 16, 2026
@mergify mergify Bot added the queued label Apr 16, 2026
@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-04-16 14:35 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-16 14:35 UTC · at 31c75ecceefcc9d0cd2efb012654dcada4d743e2

This pull request spent 25 seconds in the queue, including 3 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:flux-framework
    • check-neutral = docs/readthedocs.org:flux-framework
    • check-skipped = docs/readthedocs.org:flux-framework
  • any of [🛡 GitHub branch protection]:
    • check-success = ensure latest examples built
    • check-neutral = ensure latest examples built
    • check-skipped = ensure latest examples built
  • any of [🛡 GitHub branch protection]:
    • check-success = spell-and-linkcheck
    • check-neutral = spell-and-linkcheck
    • check-skipped = spell-and-linkcheck
  • any of [🛡 GitHub branch protection]:
    • check-success = validate commits
    • check-neutral = validate commits
    • check-skipped = validate commits

@mergify
mergify Bot merged commit 5e58b45 into flux-framework:master Apr 16, 2026
7 of 8 checks passed
@mergify mergify Bot removed the queued label Apr 16, 2026
@grondo
grondo deleted the xss-v2 branch April 16, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-passing mark PR for auto-merging by mergify.io bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the search bar search the manpages

3 participants