import { readFileSync } from "node:fs"; function assert(condition, message) { if (!condition) throw new Error(message); } const source = readFileSync("src/components/GlobalSearch.tsx", "utf8"); const layoutSource = readFileSync("src/components/searchOverlayLayout.ts", "utf8"); const styles = readFileSync("src/styles/search.css", "utf8"); assert(source.includes("titlebar-icon-link titlebar-search-button"), "Search uses the shared titlebar icon-button appearance"); assert(source.includes("onClick={openOverlay}"), "clicking the titlebar Search command opens Search"); assert(!source.includes("sourceInputRef"), "the titlebar no longer reserves a persistent Search field"); assert(source.includes("("search.contexts")'), "contextual Search contributions are consumed"); assert(!source.includes("navigate(`/search"), "normal Search interaction no longer opens a page route"); assert(layoutSource.includes("const inputWidth = width"), "the opened query field spans the Search overlay"); assert(layoutSource.includes("(viewportWidth - width) / 2"), "the Search overlay is centered in the viewport"); assert(styles.includes("margin-top: 8px"), "results follow the opened query field without overlap"); assert(styles.includes(".search-overlay-results-panel"), "full Search results have a bounded overlay panel"); console.log("Search overlay structure checks passed.");