refactor: open search from titlebar command
This commit is contained in:
@@ -9,18 +9,20 @@ 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("onFocus={handleSourceFocus}"), "focusing the titlebar field opens Search");
|
||||
assert(source.includes("suppressRestoredFocusRef.current"), "restored dialog focus does not immediately reopen Search");
|
||||
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("<Dialog"), "Search uses the shared Dialog component");
|
||||
assert(source.includes("portal"), "the Search dialog portals above the complete shell");
|
||||
assert(source.includes("calculateSearchOverlayLayout"), "the overlay is anchored to the titlebar field");
|
||||
assert(source.includes("calculateSearchOverlayLayout"), "the overlay position is derived from the titlebar command");
|
||||
assert(source.includes("listSearchProviders"), "the overlay loads the complete filter catalogue");
|
||||
assert(source.includes("limit: 50"), "the overlay requests full result windows rather than titlebar suggestions");
|
||||
assert(source.includes("response?.next_cursor"), "the overlay retains cursor pagination");
|
||||
assert(source.includes('usePlatformUiCapabilities<SearchContextsUiCapability>("search.contexts")'), "contextual Search contributions are consumed");
|
||||
assert(!source.includes("navigate(`/search"), "normal Search interaction no longer opens a page route");
|
||||
assert(layoutSource.includes("anchor.left - left"), "desktop input placement is derived from the original field");
|
||||
assert(styles.includes(".global-search-source.is-overlay-open"), "the original field is hidden while its overlay counterpart is active");
|
||||
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.");
|
||||
|
||||
Reference in New Issue
Block a user