Skip to content

♥️ Algolia DocSearch results are duplicated and search bar spans full viewport width #22788

Closed

Description

@Jen-Uno

Current behavior

The Algolia DocSearch integration in the docs site has several issues:

  1. Duplicate search results: The DocSearch crawler indexes breadcrumb navigation, heading-level anchors, and same-titled pages from different sections, producing duplicate or near-duplicate results.
  2. Search bar spans full viewport width: When the search modal opens, the search input bar stretches across the entire screen instead of staying within the modal. This is caused by docfx's default CSS rule header { position: fixed; top: 0; left: 0; } unintentionally applying to DocSearch's <header class="DocSearch-SearchBar"> element.
  3. Search not visible in local builds: The custom TOC template (toc.html.tmpl) that renders the DocSearch button is silently ignored by newer docfx versions, which expect toc.html.primary.tmpl.

Expected behavior

  • Search results should be unique and deduplicated
  • The search bar should stay within the modal bounds (~560px)
  • Search should be visible and functional in local doc builds

How to reproduce

  1. Visit the docs site and open DocSearch (Cmd+K)
  2. Search for "MVUX" or any common term
  3. Observe duplicate results and the search input spanning the full viewport width

Workaround

None

Works on

All platforms (browser-based docs site)

Issues found and fixed

  1. Breadcrumb duplicates — The crawler indexed <div id="breadcrumb"> content as separate search records with #breadcrumb anchors. Fixed by filtering those in transformItems and adding data-docsearch-exclude to the breadcrumb template.

  2. Same-page heading duplicates — DocSearch creates one record per heading level, so a single page could appear multiple times. Fixed with URL-based deduplication that keeps only the first hit per base page URL.

  3. Same-titled different pages — Pages like workshop variants shared identical titles, making results look like duplicates. Fixed by detecting same-titled groups and appending a distinguishing URL path segment to the display text (updating both _snippetResult and _highlightResult so DocSearch actually renders it).

  4. Navigation noise in index — The crawler was indexing navbar, footer, and sidebar content. Fixed by adding data-docsearch-exclude to those elements via new template overrides (affix.tmpl.partial, footer.tmpl.partial, breadcrumb.tmpl.partial, and _navbar.tmpl.partial).

  5. Search bar spanning full viewport width — docfx's default CSS header { position: fixed; top: 0; left: 0; } was applied to DocSearch's <header class="DocSearch-SearchBar">, pulling it out of the 560px modal. Fixed with a CSS override in main.css.

  6. Search not visible in local builds — The custom TOC template was named toc.html.tmpl but docfx 2.73+ expects toc.html.primary.tmpl, so the #docsearch container was silently missing. Fixed by renaming the file and pinning the docfx version.

Activity

  1. Jen-Uno commented on Mar 6, 2026

    @Jen-Uno
    ContributorAuthor

    Documentation Issues Validation Recap (2026-03-05)

    Scope: All open issues in unoplatform/uno with any label containing "documentation" (kind/documentation, project/documentation 📖).
    Branch: fix/algolia-docsearch-duplicates-and-layout (PR #22789)
    Total issues reviewed: 34


    Resolved (4 issues — closed)

    Issue Title Evidence
    #20559 Document Rider "Default system browser" error Documented in doc/articles/create-an-app-rider.md (~L160)
    #20780 Add docs for adding Uno to existing solution Guide at doc/articles/guides/how-to-add-uno-to-an-existing-solution.md
    #21780 WebAssembly Hot Reload in VS Code VS Code columns + WASM rows in working-with-xaml-hot-reload.md
    #22020 HRI states not fully documented Full HRI section at working-with-xaml-hot-reload.md (~L324)

    Partially Resolved (1 issue — left open)

    Issue Title Evidence
    #22268 Explain how to reference .js scripts in WASM JS interop guides exist (wasm-javascript-1/2/3.md) but don't cover arbitrary CDN/node_modules scripts

    Persists — Content Gaps (18 issues)

    Issue Title Finding
    #19837 C# Markup examples in control docs Only ResponsiveView.md has C# Markup; all others XAML-only
    #19845 Template README.md too minimal ReadMe.md in templates has only 2 links
    #20450 Template item type clarification No comparison guide (UserControl vs Templated Control vs ResourceDictionary)
    #20615 Input doc outdated for Skia renderers Lacks renderer-specific guidance for Skia mode
    #20928 x:True/x:False scope limitations Supported but limitations not documented
    #20955 Refresh Silverlight migration tutorial Still uses IdentityServer4, UWP references
    #20999 Server project Web SDK vs WASM SDK Docs exist but don't clarify SDK distinction
    #21104 Server-side WebAssembly tutorials No tutorials for WASM as server-side UI
    #21276 Contributing guide outdated No Skia renderer guidance in contributing intro
    #21444 WebView2 API scope documentation Limited CoreWebView2 coverage not documented
    #21616 UnoAssets build action docs No user-facing documentation exists
    #21735 Outdated "Skia WPF" naming in tables Found in 5+ doc files
    #21782 Broken singleproject-vs-reload link Link returns 404; referenced in 4+ locations
    #21856 MCP WPF migration link on homepage No prominent link from homepage/get-started
    #21999 Desktop namespace prefix missing Not in platform-specific XAML prefix table
    #22214 SKCanvasElement troubleshooting No troubleshooting section exists
    #22267 Uno MCP for GitHub Copilot PRs No documentation for PR review MCP workflow
    #22462 Desktop toast/notification guidance No desktop notification docs exist

    Persists — UX/Layout & TOC (5 issues)

    Issue Title Finding
    #20449 Split large doc pages into sub-topics TabBar docs still single 720-line file
    #22340 Toolkit/Themes TOC duplication Material getting-started in both Toolkit and Themes TOC
    #22341 Tutorials/Samples TOC confusion "Next Steps" vs "Additional Resources" naming mismatch
    #22342 Uno.UI/Extensions TOC structure "Overview" after "Samples & Tutorials"; questionable order
    #20884 Samples page sorting/metadata No per-entry metadata for sorting/filtering

    Persists — Docs Infrastructure (2 issues)

    Issue Title Finding
    #21978 Docs infrastructure improvements Edit-this-page works; no link validation; crawler exclusions partially done (PR #22789)
    #22520 Implement PageFind Algolia DocSearch still active; PageFind not integrated

    Persists — Tutorials & Feature Requests (3 issues)

    Issue Title Finding
    #21977 Content Structure & UX epic Tracking issue; sub-items persist
    #21979 Feature/API Reference Coverage epic Tracking issue; sub-items persist
    #22333 DevServer troubleshooting nested repos No nested repo/monorepo MCP guidance

    Persists — Content (1 issue)

    Issue Title Finding
    #22607 SignalR tutorial outdated References aspnetcore-7.0, VS2019, Startup.cs pattern
  2. self-assigned this
    on Mar 6, 2026
  3. github-actions commented on Jul 5, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  4. added
    stale
    on Jul 5, 2026
  5. removed
    stale
    on Jul 9, 2026
  6. changed the title [-]fix: Algolia DocSearch results are duplicated and search bar spans full viewport width[/-] [+]♥️ Algolia DocSearch results are duplicated and search bar spans full viewport width[/+] on Jul 27, 2026
  7. added theissue type on Jul 27, 2026
  8. added this to the Platform 6.7 milestone on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions