Scripts & automation
Internal reference for client-side runtime scripts and the commands we use to verify UI changes.
Runtime initializers
| Script | When it loads | Purpose |
|---|---|---|
src/scripts/core/base-layout.ts | Every page | Initializes theme, header vars, mobile menu, nav dropdowns, search overlay, and feature script dispatch. |
src/scripts/routes/article/init.ts | When page type is docs/learn/guides | Loads content-route behaviors (read progress, in-page nav, glossary/link preview helpers, and page tools). |
src/scripts/guides/contextual-hooks.ts | When guide-specific bot affordances are present | Loads contextual Support Bot hooks for Ask AI, walkthrough, and product-selection affordances. |
src/scripts/shared/nav-search.ts | Every page | Header/mobile search autosuggest and query handling. |
src/scripts/shared/nav-dropdowns.ts | Via base-layout.ts | Desktop/mobile dropdown open state, split-click behavior, and nav actions. |
src/scripts/shared/search-overlay.ts | Via base-layout.ts | Cmd/Ctrl+K overlay and Ask AI trigger handling. |
src/scripts/shared/nav-tooltips.ts | When [data-nav-tooltip] exists | Tooltip behavior for external-link and status indicators. |
src/scripts/shared/status-overall.ts | When [data-statuspal-badge] exists | Derives overall status state and applies it to nav status dots. |
Verification commands
Standard checks before shipping Labs UI changes.
npm run build
node scripts/ux/interaction-smoke.mjs
Notes
Keep this page focused on runtime behavior and verification commands. Detailed implementation docs should live with the owning feature.