Skip to content

refactor(app): the narrow query and hook from @frostyard/lodge-ui - #80

Merged
bketelsen merged 1 commit into
mainfrom
ui/narrow
Oct 21, 2026
Merged

bketelsen merged 1 commit into
mainfrom
ui/narrow

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Step 4 of the UI library migration (Brian, 2026-10-21). NARROW, isNarrow and useNarrow come from lodge-ui. The package's hook reads matchMedia without a guard, and two tests run in jsdom, which has none, so the test setup gives jsdom a desktop matchMedia (never narrow). No visual change. Gates: make check, make ui-check.

app/narrow.ts no longer carries its own media query or hook: NARROW is
lodge-ui's NARROW_QUERY and useNarrow is its own (@frostyard/lodge-ui/theme
and ./react, ui/v0.1.0).

Two tests run in jsdom, which has no matchMedia, and the package's hook
reads it without a guard (tests that run in happy-dom have it). The testing
setup gives jsdom a desktop window's matchMedia, never narrow, rather than
keeping a guarded copy of the hook in the app.

No visual or behaviour change: the query is the same string, and the hook
follows window.matchMedia as before.

Gates: make ui-check (783 tests) and make check.
@bketelsen
bketelsen merged commit 25dbbf6 into main Oct 21, 2026
4 checks passed
@frostyard-machines
frostyard-machines deleted the ui/narrow branch October 26, 2026 00:20
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.

1 participant