Skip to content

fix(react): hydrate search on idle for keyboard shortcuts - #1062

Merged
AugustinMauroy merged 1 commit into
nodejs:mainfrom
LitoMore:fix-cmd-k
Sep 3, 2026
Merged

fix(react): hydrate search on idle for keyboard shortcuts#1062
AugustinMauroy merged 1 commit into
nodejs:mainfrom
LitoMore:fix-cmd-k

Conversation

@LitoMore

@LitoMore LitoMore commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes the Cmd/Ctrl+K for the Beta Docs page https://beta.docs.nodejs.org.

The search box currently hydrates only after pointerover, focusin, or touchstart. As a result, the Cmd/Ctrl+K listener is not registered until the user interacts with the search button, so the shortcut can appear to work intermittently.

Hydrate the search box on idle instead, allowing the shortcut to work without requiring prior interaction. The Orama database remains lazy-loaded until the first search.

Validation

Open the Beta Docs page, and press the Cmd/Ctrl+K immediately. Nothing should have happened until you pointerover/focusin/touchstart the search box.

Related Issues

None

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@LitoMore
LitoMore requested a review from a team as a code owner September 1, 2026 14:01
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Sep 1, 2026 2:03pm UTC

Request Review

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.60%. Comparing base (da5d8e6) to head (ed03162).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1062      +/-   ##
==========================================
+ Coverage   90.57%   90.60%   +0.02%     
==========================================
  Files         217      217              
  Lines       20755    20802      +47     
  Branches     1969     1974       +5     
==========================================
+ Hits        18799    18847      +48     
+ Misses       1949     1948       -1     
  Partials        7        7              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

api-links Generator

Performance estimate (single CI run)

  • Generation time: 3.6% faster (1.39 s → 1.34 s)
  • Peak memory: 1.3% higher (357.94 MB → 362.49 MB)

legacy-html Generator

Performance estimate (single CI run)

  • Generation time: 0.8% faster (20.80 s → 20.64 s)
  • Peak memory: 5.4% higher (2.20 GB → 2.32 GB)

legacy-json Generator

Performance estimate (single CI run)

  • Generation time: 14.6% slower (7.79 s → 8.93 s)
  • Peak memory: 1.5% lower (1.86 GB → 1.83 GB)

llms-txt Generator

Performance estimate (single CI run)

  • Generation time: 1.1% faster (8.22 s → 8.13 s)
  • Peak memory: 1.7% higher (1.76 GB → 1.79 GB)

orama-db Generator

Output size: 1 file changed · net +1.00 B

File size details
File Main PR Change
orama-db.json 9.22 MB 9.22 MB +1.00 B (+0.0%)

Performance estimate (single CI run)

  • Generation time: 2.8% faster (8.81 s → 8.56 s)
  • Peak memory: 0.2% higher (1.81 GB → 1.82 GB)

web Generator

Output size: 61 files changed · net +2.19 KB

File size details
File Main PR Change
assets/SearchBox-B4VQonTj.js 84.77 KB -84.77 KB (-100.0%)
assets/SearchBox-DG92TD8s.js 84.73 KB +84.73 KB
assets/dist-DIwsMtEe.js 30.43 KB -30.43 KB (-100.0%)
assets/dist-B26NADar.js 30.43 KB +30.43 KB
assets/SideBar-BLamfkFk.js 25.62 KB -25.62 KB (-100.0%)
assets/SideBar-CjBadrhw.js 25.62 KB +25.62 KB
assets/client-DRvY8Gzd.js 21.61 KB -21.61 KB (-100.0%)
assets/client-4iZeL51X.js 21.61 KB +21.61 KB
assets/config-IkLyzSmT.js 18.12 KB +18.12 KB
assets/Combination-BUcOJ5Y-.js 16.13 KB -16.13 KB (-100.0%)
assets/Combination-CxHszNCH.js 16.13 KB +16.13 KB
assets/config-DjBbQymG.js 16.13 KB -16.13 KB (-100.0%)
assets/ThemeToggle-1V8NPt7q.js 13.63 KB -13.63 KB (-100.0%)
assets/ThemeToggle-BiPwS7Mk.js 13.63 KB +13.63 KB
assets/dist-D1u_tkxL.js 10.20 KB -10.20 KB (-100.0%)
assets/dist-CFCFWCOC.js 10.20 KB +10.20 KB
assets/Layout-oYllGoSo.js 10.13 KB -10.13 KB (-100.0%)
assets/Layout-CUxkUi7c.js 10.13 KB +10.13 KB
assets/compat-CcIAhA8U.js 10.12 KB -10.12 KB (-100.0%)
assets/compat-BfD7Rki1.js 10.12 KB +10.12 KB
assets/Tooltip-DQD8Ewo6.js 7.93 KB -7.93 KB (-100.0%)
assets/Tooltip-B1qxbKhZ.js 7.93 KB +7.93 KB
assets/dist-Dj0Sqkvo.js 6.99 KB -6.99 KB (-100.0%)
assets/dist-CJIhfaBd.js 6.99 KB +6.99 KB
assets/jsx-runtime-C6QFhwKF.js 5.67 KB -5.67 KB (-100.0%)
assets/jsx-runtime-C1lMY1Gc.js 5.67 KB +5.67 KB
assets/dist-mb038oPe.js 3.94 KB -3.94 KB (-100.0%)
assets/dist-Be2dd_0a.js 3.94 KB +3.94 KB
assets/CodeTabs-9186pDFN.js 3.88 KB -3.88 KB (-100.0%)
assets/CodeTabs-BD_awTKo.js 3.88 KB +3.88 KB
assets/CodeBox-Ym4vlsQj.js 3.44 KB -3.44 KB (-100.0%)
assets/CodeBox-rmTAsZ80.js 3.44 KB +3.44 KB
assets/hooks.module-Bk2z4xNO.js 3.37 KB -3.37 KB (-100.0%)
assets/hooks.module-DD1kwafY.js 3.37 KB +3.37 KB
assets/FunctionSignature-BpmgMnum.js 2.28 KB -2.28 KB (-100.0%)
assets/FunctionSignature-NlwGJqjn.js 2.28 KB +2.28 KB
assets/Banner-XvKbSbln.js 2.19 KB -2.19 KB (-100.0%)
assets/Banner-CzZyrjk_.js 2.19 KB +2.19 KB
assets/ChangeHistory-DgDvtNV7.js 1.75 KB -1.75 KB (-100.0%)
assets/ChangeHistory-BWtPs3Vy.js 1.75 KB +1.75 KB
assets/DataTag-DjunEPBj.js 844.00 B -844.00 B (-100.0%)
assets/DataTag-D0-uPG2c.js 844.00 B +844.00 B
assets/DocumentationIndex-BPC5dV7C.js 833.00 B +833.00 B
assets/DocumentationIndex-DkMj2fAG.js 821.00 B -821.00 B (-100.0%)
assets/ArrowUpRightIcon-DxdUI-2m.js 618.00 B -618.00 B (-100.0%)
assets/ArrowUpRightIcon-D_vQL-jL.js 618.00 B +618.00 B
assets/Badge-CpY4waKP.js 607.00 B -607.00 B (-100.0%)
assets/Badge-CrWNCPt_.js 607.00 B +607.00 B
assets/AlertBox-DyR-D-Wy.js 591.00 B -591.00 B (-100.0%)
assets/AlertBox-Cm5aaJjh.js 591.00 B +591.00 B
assets/CodeBracketIcon-BRpToSe8.js 512.00 B -512.00 B (-100.0%)
assets/CodeBracketIcon-BjSANaWS.js 512.00 B +512.00 B
assets/dist-y-2gACS_.js 477.00 B -477.00 B (-100.0%)
assets/dist-CwHhEqdL.js 477.00 B +477.00 B
assets/ChevronDownIcon-GZzIVrWC.js 468.00 B -468.00 B (-100.0%)
assets/ChevronDownIcon-CCMdSGlD.js 468.00 B +468.00 B
all.html 32.12 MB 32.12 MB +236.00 B (+0.0%)
assets/Blockquote-CREM-fhs.js 167.00 B -167.00 B (-100.0%)
assets/Blockquote-CJmAj-5m.js 167.00 B +167.00 B
assets/withIsland-BXXKiqC-.js 105.00 B -105.00 B (-100.0%)
assets/withIsland-D2VqDqbr.js 105.00 B +105.00 B

Performance estimate (single CI run)

  • Generation time: 1.7% faster (83.76 s → 82.37 s)
  • Peak memory: 3.5% higher (5.76 GB → 5.96 GB)

@AugustinMauroy
AugustinMauroy merged commit dd8646a into nodejs:main Sep 3, 2026
23 checks passed
@LitoMore
LitoMore deleted the fix-cmd-k branch September 3, 2026 18:59
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.

4 participants