Brings analyticshq's Fathom-style reporting-period picker (stacksjs/analyticshq#55, #56) to loghq's /analytics view. It had preset tabs (7d/30d/90d/180d) but no custom range and no calendar — this adds both while keeping the tabs.
How it fits loghq
- URL stays the only state. loghq's four native spans go out as
?range=; every other preset and any hand-picked span goes out as?from=&to=. - Minimal server change.
analytics.stxparses?from=&to=as UTC day bounds; becausevolumeSeries/levelsByReleasealready take{fromDay, toDay}, a custom span needs no query rewrite and is still bucketed by day like180d. The range pills stop reading active while a custom span is active. - loghq vocab and theme. Presets are
7/30/90/180 days+ Today/Yesterday/This-Last month/This-Last year (no24h/1y/all— loghq doesn't have those). The CSS is themed on loghq's tokens; the range fill is--accent-soft(its green wash).
Verified
Rendered on an unguarded harness (the real view is auth-gated): component renders server-side into two calendars, loghq's green range fill (rgb(4,120,87)), today marked, future days disabled, and outside-click dismiss works. tests/unit/date-range-picker.test.ts — 9 cases over the grid/day-math, loghq's preset vocab (asserts no 24h/1y/all, has 180d), and the query it builds. pickier clean.
First of three ports (loghq → statushq → bughq); analyticshq is already live.