Repository navigation
feat: debug menu - #66
Conversation
✅ Deploy Preview for device-database-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Ten quick taps triggered double-tap zoom on mobile and weren't usable with a keyboard or screen reader. The switches now live on /debug, which works with any input and can be linked to.
|
Replaced the tap gesture with a no index, not linked |
|
Found a cache bug: the route cache keys on the URL only, but SSR output now depends on the feature cookie. Cached pages (
Removed the in-process cache, so caching is now left to the CDN (Cloudflare in prod, Netlify in previews). Pages only send |
… that set cookies Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
there are some upcoming features that we'd like to deploy, but not yet make available by default.
...feature flags to the rescue!
this introduces a debug menu that be accessed by tapping 10 times quickly and repeatedly.
it allows toggling feature flags that can be detected in a csr context, through css queries, and during ssr.
flags are persisted as a cookie so they are modifiable and observable from both contexts.
it also introduces the concept of shareable feature enablement URLs that encode which set of features should be enabled as query parameters.
these override the set of currently configured features so complicated "tap 10 times, then enable a + b + c" instructions aren't required when asking someone to test a feature
debug.menu.mov
getting the global
Astrocontext is a bit gnarly, and requires a middleware and someAsyncLocalStoragetrickeryfrontend/src/utilities/feature.ts
Lines 48 to 61 in a874380
frontend/src/middleware.ts
Lines 31 to 40 in a874380
ideally this one goes in after being rebased on a feature that needs gating, while also removing the placeholder
"foo"feature