Skip to content

Revert Algolia lazy loading to fix search not appearing#364

Merged
JakeSCahill merged 1 commit intomainfrom
fix/revert-algolia-lazy-loading
Feb 6, 2026
Merged

Revert Algolia lazy loading to fix search not appearing#364
JakeSCahill merged 1 commit intomainfrom
fix/revert-algolia-lazy-loading

Conversation

@JakeSCahill
Copy link
Copy Markdown
Contributor

@JakeSCahill JakeSCahill commented Feb 6, 2026

Summary

https://deploy-preview-364--docs-ui.netlify.app/

  • Reverts the Algolia lazy loading that was introduced for performance optimization
  • The lazy loading caused the search UI to not appear because the #autocomplete div was empty and invisible until user interaction
  • Restores the original defer-based script loading which ensures Algolia initializes on DOMContentLoaded

Problem

The lazy loading approach required users to click on an invisible empty div to trigger script loading. Since there was no visual indicator, users couldn't discover the search functionality.

Solution

Revert to loading Algolia scripts with defer attribute, which loads them asynchronously but initializes on DOMContentLoaded, making the search UI immediately visible.

The lazy loading approach caused the search UI to not appear because
the #autocomplete div was empty and invisible until user interaction
triggered script loading. This broke discoverability since users
couldn't see there was a search to click on.

Reverts to the original defer-based loading which ensures Algolia
initializes on DOMContentLoaded and the search UI is immediately visible.
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 6, 2026

Deploy Preview for docs-ui ready!

Name Link
🔨 Latest commit 3b896f0
🔍 Latest deploy log https://app.netlify.com/projects/docs-ui/deploys/6985b8c92b44dd0008891073
😎 Deploy Preview https://deploy-preview-364--docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 37 (🟢 up 2 from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (no change from production)
SEO: 89 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

These changes simplify the Algolia script loading mechanism across two template files. The lazy-loading initialization that previously waited for script readiness, dispatched custom events on user interaction, and handled pending focus is replaced with a simpler approach: static script and stylesheet tags with deferred loading attributes, paired with a single DOMContentLoaded call to initialize Algolia. This removes approximately 94 lines of dynamic script management logic while consolidating the initialization to rely on built-in readiness checks within initAlgolia.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • kbatuigas
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: reverting Algolia lazy loading to fix a search visibility issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly explains the problem, solution, and changes made to revert Algolia lazy loading and fix the search UI visibility issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/revert-algolia-lazy-loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JakeSCahill JakeSCahill requested review from a team and paulohtb6 February 6, 2026 09:48
@Feediver1
Copy link
Copy Markdown
Contributor

Leaving this one up to @paulohtb6 for review :-)

Feediver1
Feediver1 approved these changes Feb 6, 2026
@Feediver1
Copy link
Copy Markdown
Contributor

Leaving this one up to @paulohtb6 for review :-)

Never mind--I approved

@JakeSCahill JakeSCahill merged commit ed7b574 into main Feb 6, 2026
6 checks passed
@JakeSCahill JakeSCahill deleted the fix/revert-algolia-lazy-loading branch February 6, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants