Commit Graph

220 Commits

Author SHA1 Message Date
Usman Baig
3c17895d64 feat(settings): unified settings modal with context switcher (Phase 1)
New unified settings modal accessible via `,` keyboard shortcut.
Three-context switcher: Site (with site dropdown), Workspace, Account.
Horizontal tabs per context with animated transitions.

Phase 1 tabs implemented:
- Site → General (name, timezone, domain, tracking script with copy)
- Site → Goals (CRUD with inline create/edit)
- Workspace → General (org name, slug, danger zone)
- Workspace → Billing (plan card, usage, cancel/resume, portal)
- Account → Profile (wraps existing ProfileSettings)

Phase 2 tabs show "Coming soon" placeholder:
- Site: Visibility, Privacy, Bot & Spam, Reports, Integrations
- Workspace: Members, Notifications, Audit Log
- Account: Security, Devices

Old settings pages and profile modal remain functional.
2026-03-23 20:57:20 +01:00
Usman Baig
a3c1af7c95 fix: frontend consistency audit — 55 files cleaned up
Consistency fixes:
- Extract getThisWeekRange/getThisMonthRange to shared lib/utils/dateRanges.ts
  (removed 4 identical copy-pasted definitions)
- Add error boundaries for behavior, cdn, search, pagespeed pages
  (4 new error.tsx files — previously fell through to generic parent error)
- Add "View setup guide" CTA to empty states on journeys and behavior pages
  (previously showed text with no actionable button)
- Fix non-lazy useState initializer in funnel detail page
- Fix Bot & Spam settings header from text-xl to text-2xl (matches all other sections)
- Add useMinimumLoading to PageSpeed skeleton (consistent with all other pages)

Cleanup:
- Remove 438 redundant dark: class prefixes (app is dark-mode only)
  text-neutral-500 dark:text-neutral-400 → text-neutral-400 (206 occurrences)
  text-neutral-900 dark:text-white → text-white (232 occurrences)
- Remove dead @stripe/react-stripe-js and @stripe/stripe-js packages
  (billing migrated to Polar, no code imports Stripe)
- Remove duplicate motion package (framer-motion is the one actually used)
2026-03-23 19:50:16 +01:00
Usman Baig
eca21bf627 feat(billing): update frontend for polar migration
Update billing types, remove invoice preview, replace Stripe invoice
display with Polar orders, update tax ID from array to single object,
remove upcoming invoice amount display.
2026-03-23 16:36:54 +01:00
Usman Baig
55a08301f4 fix(build): extract FAVICON_SERVICE_URL to prevent server-side createContext error
The share/[id] layout is a server component that imported FAVICON_SERVICE_URL
from icons.tsx, pulling in the entire React icon registry and triggering
createContext on the server. Moved the constant to its own favicon.ts module.
2026-03-23 13:29:53 +01:00
Usman Baig
75bf8acd1e refactor(referrers): unify icon, display name, and favicon into single registry
Replace three separate data structures (getReferrerIcon if-chain,
REFERRER_DISPLAY_OVERRIDES, REFERRER_PREFER_ICON) with a single
REFERRER_REGISTRY. All matching is now exact key/hostname lookup
via resolveReferrer() — no more substring includes() that caused
collisions like t.co matching reddit.com.
2026-03-23 13:21:15 +01:00
Usman Baig
4064f7eabf fix(referrers): prevent t.co substring match on reddit.com
"reddit.com".includes("t.co") was true, causing Reddit to show the
X icon. Use exact match or slash-delimited check instead.
2026-03-23 13:12:57 +01:00
Usman Baig
508bb006a8 fix(referrers): replace low-res Google favicon globe with proper icons
Detect Google's 16x16 default globe fallback via naturalWidth on load
and fall back to Phosphor icons. Add Chrome icon for googlechrome.github.io,
CursorClick for Direct, and abbreviation support (ig, fb, yt).
2026-03-23 12:23:10 +01:00
Usman Baig
bba25c722a feat(pagespeed): manual check section, consistent dot indicators
- Add "Additional items to manually check" collapsed section
- Replace triangle/square severity icons with consistent filled circles
- Empty circle (border only) for informative/unscored audits
2026-03-22 23:45:36 +01:00
Usman Baig
98429f82f5 feat(pagespeed): render audit sub-group headers in diagnostics
Group audits within each category by sub-group (e.g., "Names and
Labels", "Contrast") with small uppercase headers, matching the
pagespeed.web.dev layout.
2026-03-22 22:03:13 +01:00
Usman Baig
8649f37bb9 feat(pagespeed): split diagnostics by category (Performance, Accessibility, Best Practices, SEO)
Each Lighthouse category gets its own card with failing audits sorted
by impact and collapsed passed audits. Matches pagespeed.web.dev layout.
2026-03-22 19:52:49 +01:00
Usman Baig
fcbf21b715 feat(pagespeed): render page load filmstrip between hero and metrics
Horizontal scrollable filmstrip showing page rendering progression
with timing labels. Appears between the score hero and metrics card.
2026-03-22 19:43:44 +01:00
Usman Baig
b0e6db36a1 feat(pagespeed): add screenshot display and expandable diagnostics
- Page screenshot thumbnail next to score gauges
- Expandable audit rows with description and detail items table
- Shows URLs, HTML snippets, wasted bytes/ms for each failing element
- AuditRow component replaces flat diagnostic rows
2026-03-22 18:54:45 +01:00
Usman Baig
2fd9bf82f1 fix(pagespeed): poll for results after async check trigger
Backend now returns 202 immediately. Frontend polls every 5s for up
to 2 minutes until new results appear, then shows success toast.
2026-03-22 18:35:17 +01:00
Usman Baig
d1af25266b fix(pagespeed): increase fetch timeout for manual PSI checks to 120s
PSI checks run mobile + desktop sequentially (up to 60s total).
The default 30s client timeout was causing false network errors.
2026-03-22 18:28:06 +01:00
Usman Baig
780dd464a1 feat(pagespeed): add API client, SWR hooks, and sidebar navigation
- PageSpeed API client with types for config, checks, and audits
- SWR hooks: usePageSpeedConfig, usePageSpeedLatest, usePageSpeedHistory
- GaugeIcon added to sidebar under Infrastructure group
2026-03-22 18:05:17 +01:00
Usman Baig
6a1698b794 feat: add Notifications section to settings with Reports and Alerts
- Adds purpose field to report schedule API client
- Adds useAlertSchedules SWR hook
- Reorganizes settings: Reports tab becomes Notifications tab
- Groups existing Reports and new Alerts subsections
- Alert channels reuse report delivery infrastructure (email, Slack, Discord, webhooks)
2026-03-22 16:57:04 +01:00
Usman Baig
1d26819727 feat: simplify uptime page to single auto-managed monitor with toggle
Rewrites uptime page from 978 to ~370 lines. Removes all monitor CRUD
UI (modals, monitor list, selection state). Adds enable/disable toggle
and empty state. Reads the single auto-managed monitor.
2026-03-22 16:51:42 +01:00
Usman Baig
5c30043550 feat: remove uptime CRUD functions from API client
Removes create/update/delete/list monitor functions and request types.
Keeps getUptimeStatus and getMonitorChecks for the simplified UI.
2026-03-22 16:47:15 +01:00
Usman Baig
b7e92abb40 feat: persist script feature toggles to backend
Features (scroll, 404, outbound, downloads, frustration, storage, ttl)
are saved to site.script_features JSONB column on every toggle change.
Values are read from the site object on load.
2026-03-22 15:31:45 +01:00
Usman Baig
430e6f5d48 feat: use session cookie auth for public dashboard password flow
handlePasswordSubmit now calls POST /public/sites/:id/auth which
sets an HttpOnly cookie. All subsequent API calls authenticate via
cookie automatically — no password in URLs, no captcha state needed
for data fetching. Simplifies share page state management.
2026-03-22 14:45:25 +01:00
Usman Baig
ef21004519 fix: skip auth token refresh for public API endpoints
Public dashboard endpoints use password auth, not session tokens.
A 401 on /public/ should surface to the caller (for password prompt),
not trigger a token refresh that fails and shows "Session expired".
2026-03-22 13:47:02 +01:00
Usman Baig
42b7363cf9 feat: add Bot & Spam settings tab with session review UI 2026-03-22 13:16:07 +01:00
Usman Baig
5008992f59 feat: replace Phosphor brand icons with real SVG logos
Uses @icons-pack/react-simple-icons for available brands (Google,
Facebook, Instagram, GitHub, YouTube, Reddit, etc.) and inline SVGs
for brands missing from the package (X, LinkedIn, OpenAI, Bing).
All icons now show actual brand logos with correct colors.
2026-03-21 23:38:55 +01:00
Usman Baig
5b0d0e1dc1 fix: use Phosphor icons for all known referrers, skip unreliable favicons
Google's favicon service returns wrong/low-quality icons for known
services. Now all major platforms, search engines, and AI assistants
use their Phosphor icon directly. Favicons only fetched for unknown
domains.
2026-03-21 23:22:31 +01:00
Usman Baig
e6d840abb9 docs: simplify GTM integration guide for auto-detect domain 2026-03-19 13:58:09 +01:00
Usman Baig
73fc47e910 fix: support GTM and tag managers via window.pulseConfig fallback
Script detection now also searches by src URL and supports a global
config object (window.pulseConfig) for environments where data-*
attributes are not preserved on the injected script element.
2026-03-19 13:45:21 +01:00
Usman Baig
bf3097c26e fix: invert macOS and PlayStation icons in dark mode
Both logos are dark/black and disappear against dark backgrounds.
Apply dark:invert CSS filter to flip them to white in dark mode.
2026-03-19 13:19:08 +01:00
Usman Baig
1696e428ab feat: add real OS logo icons for 16 operating systems
Replace Phosphor generic icons with branded logos from
ngeenx/operating-system-logos. Covers Windows, macOS, Linux, Android,
iOS, ChromeOS, HarmonyOS, KaiOS, Tizen, webOS, FreeBSD, OpenBSD,
NetBSD, PlayStation, Xbox, and Nintendo.
2026-03-19 11:23:29 +01:00
Usman Baig
a7ac2cb9d7 feat: add browser logo icons for all detected browsers
Use real browser logos from alrra/browser-logos (SVG where available,
PNG fallback for archived browsers). Replaces the generic globe icon
with actual Chrome, Firefox, Safari, Edge, Opera, Brave, Vivaldi, Arc,
Samsung Internet, UC Browser, Yandex, Waterfox, Pale Moon, DuckDuckGo,
Maxthon, Silk, Puffin, Tor, and Opera Mini logos.
2026-03-19 11:09:16 +01:00
Usman Baig
e464b87471 feat: add filtered traffic page to admin dashboard
Add admin page at /admin/filtered-traffic showing domains blocked by the
referrer spam filter with reason badges and date range selector. Helps
operators monitor spam filtering and catch false positives.
2026-03-19 10:11:28 +01:00
Usman Baig
2474d6558f feat: Linear-style sidebar with explicit toggle
Rewrite sidebar from scratch: 256px expanded, 56px collapsed via
click toggle + [ keyboard shortcut. Two-phase CSS transitions (labels
fade then width contracts). Contextual ContentHeader replaces
UtilityBar (no logo, just actions). Remove framer-motion sidebar
primitive, hover-to-expand, and sidebar-context.
2026-03-18 16:33:35 +01:00
Usman Baig
80ae8311dc feat: static header + collapsible sidebar navigation
Replace floating pill header with static variant for authenticated
views. Add collapsible sidebar with site picker, grouped navigation
(Analytics/Infrastructure), and mobile overlay drawer. Remove
horizontal SiteNav tab bar.
2026-03-18 15:30:27 +01:00
Usman Baig
d5b594d6f9 feat(funnels): update frontend types and API client for funnels v2 2026-03-18 14:20:15 +01:00
Usman Baig
10ad276c38 feat: add soft-delete API functions and deleted_at to Site type 2026-03-18 11:15:14 +01:00
Usman Baig
8287a38b43 chore: add 429 errors 2026-03-16 11:06:41 +01:00
Usman Baig
9528eca443 fix: handle 204 No Content responses in API client
Prevent error toasts on successful delete operations by checking for
204 status before attempting to parse response body as JSON.
2026-03-15 12:23:05 +01:00
Usman Baig
b305b5345b refactor: remove performance insights (Web Vitals) feature entirely
Remove Performance tab, PerformanceStats component, settings toggle,
Web Vitals observers from tracking script, and all related API types
and SWR hooks. Duration tracking is preserved.
2026-03-14 22:47:33 +01:00
Usman Baig
7247281ce2 feat: move performance to dedicated tab, fix 0/99999 metrics bug
Performance metrics moved from dashboard into a new Performance tab.
Fixed null handling so "No data" shows instead of misleading zeros.
Script no longer sends INP=0 when no interaction occurred.
2026-03-14 22:01:44 +01:00
Usman Baig
2512be0d57 fix: bunnycdn logo and api key security 2026-03-14 21:08:42 +01:00
Usman Baig
fb85c431f0 feat: add BunnyCDN integration 2026-03-14 20:46:26 +01:00
Usman Baig
8f00193e0f feat: add Search panel to dashboard and enrich Search tab
Dashboard: compact Search Performance panel showing top 5 queries,
clicks, impressions, and avg position alongside Campaigns.

Search tab: clicks/impressions trend chart, top query position
tracker cards, and new queries badge.
2026-03-14 18:05:05 +01:00
Usman Baig
af29bb77cd fix: stop retrying rate-limited and auth-failed requests
SWR was retrying 429/401/403 responses with exponential backoff,
which cascaded into a flood of failed requests when the tab regained
focus. Now skips retries entirely for these status codes.
2026-03-14 17:16:23 +01:00
Usman Baig
34c705549b feat: add Google Search Console integration UI
Search Console page with overview cards, top queries/pages tables,
and query↔page drill-down. Integrations tab in Settings for
connect/disconnect flow. New Search tab in site navigation.
2026-03-14 15:36:37 +01:00
Usman Baig
25210013d3 feat: centralise date/time formatting with European conventions
All dates now use day-first ordering (14 Mar 2025) and 24-hour time
(14:30) via a single formatDate.ts module, replacing scattered inline
toLocaleDateString/toLocaleTimeString calls across 12 files.
2026-03-14 13:31:30 +01:00
Usman Baig
7ba5e063ca feat: add free plan to pricing page and enforce 1-site limit
Show the free tier (€0, 1 site, 5k pageviews, 6 months retention)
as the first card on the pricing page. Enforce a 1-site limit for
free plan users in the frontend.
2026-03-13 21:28:04 +01:00
Usman Baig
8f06c9168a feat: show verified/unverified badge on site cards 2026-03-13 16:32:26 +01:00
Usman Baig
6380f216aa perf: migrate Settings, Funnels, and Uptime to SWR data fetching
Replace manual useState/useEffect fetch patterns with SWR hooks so
cached data renders instantly on tab revisit. Skeleton loading now
only appears on the initial cold load, not every navigation.

New hooks: useFunnels, useUptimeStatus, useGoals, useReportSchedules,
useSubscription — all with background revalidation.
2026-03-13 12:21:55 +01:00
Usman Baig
1c26e4cc6c fix: resolve intermittent auth errors when navigating between tabs
Token refresh race condition: when multiple requests got 401 simultaneously,
queued retries reused stale headers and the initiator fell through without
throwing on retry failure. Now retries regenerate headers (fresh request ID
and CSRF token), and both retry failure and refresh failure throw explicitly.

SWR cache is now invalidated after token refresh so stale error responses
are not served from cache.
2026-03-13 10:52:02 +01:00
Usman Baig
7336f9126e feat(journeys): add frontend API client and SWR hooks 2026-03-12 21:24:39 +01:00
Usman Baig
6964be9610 refactor: remove realtime visitors detail page
Remove the individual session journey page and make the live visitor
count a static indicator. Prepares for the new aggregated User Journeys
feature (v0.17).
2026-03-12 20:45:58 +01:00