mirror of
https://github.com/hanzoai/extension.git
synced 2026-10-31 21:57:06 +00:00
The extension's one React surface (the answer engine) now draws its composer with the canonical @hanzo/ui components on @hanzo/gui — Textarea (line-driven auto-grow replaces the DOM-measured resize effect) and the send Button (isLoading replaces the hand-rolled spinner) — mounted under GuiProvider with the shipped gui-config, the same substrate web/desktop/mobile share. Build gains the gui runtime's web resolution (.web.* first, react-native -> react-native-web, defined process.env); vitest mirrors it with the same stub/inline recipe @hanzo/ui's own render suites use. newtab budget raised 200 -> 500 deliberately (485.9 measured; the gui runtime is the weight, paid for one component system across every Hanzo surface). Sign-in copy is sentence case everywhere, ending the popup-vs-sidebar spec disagreement. e2e: 29 passed (newtab/popup/sidebar/popup-tools, real Chromium, built bundle); unit: 272 passed; budgets green. 1.9.42 Co-authored-by: Hanzo Dev <[email protected]>
18 lines
616 B
TypeScript
18 lines
616 B
TypeScript
/**
|
|
* jsdom/Node do not implement `matchMedia`, and @hanzogui/select reads it at
|
|
* MODULE scope — the shim has to exist before any component module is imported.
|
|
* Static, no-listener, matches nothing: the suites assert markup, not
|
|
* responsive behaviour.
|
|
*/
|
|
if (typeof window !== 'undefined' && !window.matchMedia)
|
|
window.matchMedia = ((query: string) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: () => {},
|
|
removeListener: () => {},
|
|
addEventListener: () => {},
|
|
removeEventListener: () => {},
|
|
dispatchEvent: () => false,
|
|
})) as typeof window.matchMedia;
|