Repository navigation
fix(docs): repair broken Ctrl+K search - #91
Merged
Merged
Conversation
`.brand` is nested inside `.sidebar-head`, so `brand.nextSibling` is not a child of `nav.sidebar`. Calling `sidebar.insertBefore(trigger, brand.nextSibling)` threw "Child to insert before is not a child of this node", aborting the search IIFE and breaking Ctrl+K search entirely. Anchor the insert to `.sidebar-nav` instead, placing the trigger above the nav list, with an appendChild fallback. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Deploying dang with
|
| Latest commit: |
819876b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://731b7284.dang-3kk.pages.dev |
| Branch Preview URL: | https://fix-search-insertbefore.dang-3kk.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Docs search was completely broken — the browser console showed:
Root cause
docs/js/search.jsinserted the search trigger with:But
.brandis nested inside.sidebar-head(docs/html/page.tmpl), not directly undernav.sidebar. Sobrand.nextSiblingis the toggle<label>— a child of.sidebar-head, not ofsidebar— andinsertBeforerejects it. The thrown exception aborted the search IIFE, disabling Ctrl+K / search entirely.Fix
Anchor the insert to a real child of
sidebar, the.sidebar-navdiv, placing the trigger just above the nav links, with anappendChildfallback if it's absent.🤖 Generated with Claude Code