Commit Graph

369 Commits

Author SHA1 Message Date
Usman Baig
0112004457 fix: depth default 3 max 5, min_sessions 2, 5 nodes per column, stricter labels 2026-03-12 23:58:56 +01:00
Usman Baig
90de83ad6d fix: lower min_sessions from 3 to 1 for journey data 2026-03-12 23:30:12 +01:00
Usman Baig
4cd9544672 fix(journeys): use correct session_count property in entry point dropdown 2026-03-12 21:39:31 +01:00
Usman Baig
b3e335ec6c feat(journeys): add skeleton and error boundary 2026-03-12 21:36:27 +01:00
Usman Baig
dc1030036c feat(journeys): add Journeys page with controls and layout 2026-03-12 21:35:05 +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
Usman Baig
03e3f41e48 refactor: use bundled /behavior endpoint via useBehavior SWR hook
Replaces 4 separate frustration API calls with single useBehavior hook.
Removes manual fetchData, loading/error state, and refresh interval—SWR
handles caching, revalidation, and error state automatically.
2026-03-12 20:24:28 +01:00
Usman Baig
eb17e8e8d6 fix: hide scroll depth and trend chart when rate-limited
Frustration APIs and dashboard API are separate — when frustration
calls fail, Scroll Depth still rendered from cached SWR data,
creating a broken mixed state. Now tracks error state and hides
the bottom section entirely on failure.
2026-03-12 18:35:36 +01:00
Usman Baig
5050422a60 refactor: match frustration tables to dashboard pattern
- Remove column headers for cleaner look
- Show secondary info (avg, sessions, last seen) on hover
- Add orange percentage badge that slides in on hover
- Add empty row padding for consistent card height
2026-03-12 18:27:20 +01:00
Usman Baig
2f01be1c67 feat: polish behavior page UI with 8 improvements
- Add column headers to rage/dead click tables
- Rich empty states with icons matching dashboard pattern
- Add frustration trend comparison chart (current vs previous period)
- Show "New" badge instead of misleading "+100%" when previous period is 0
- Click-to-copy on CSS selectors with toast feedback
- Normalize min-height to 270px for consistent card sizing
- Fix page title to include site domain (Behavior · domain | Pulse)
- Add "last seen" column with relative timestamps
2026-03-12 18:03:22 +01:00
Usman Baig
9179e058f7 refactor: move scroll depth from dashboard to behavior tab 2026-03-12 16:56:26 +01:00
Usman Baig
d5aafdc48a feat: add behavior page shell 2026-03-12 16:56:00 +01:00
Usman Baig
27a9836d5a feat: add time-of-day controls to scheduled reports UI
Add send hour, day of week/month selectors to report schedule modal.
Schedule cards now show descriptive delivery times like
"Every Monday at 9:00 AM (UTC)". Timezone picker moved into modal.
2026-03-12 15:17:46 +01:00
Usman Baig
31aff95552 feat: add Reports tab to site settings with schedule CRUD 2026-03-12 14:33:05 +01:00
Usman Baig
a189952fad feat: add Peak Hours heatmap dashboard panel 2026-03-11 23:59:22 +01:00
Usman Baig
136ceff962 feat: add dividers to period selector dropdown 2026-03-11 23:47:52 +01:00
Usman Baig
b5dd5e7082 feat: add This week / This month period options and fix comparison labels 2026-03-11 23:33:24 +01:00
Usman Baig
0f5d5338f3 fix: make scroll depth block half-width and enlarge radar chart 2026-03-11 22:26:15 +01:00
Usman Baig
37eb49eb37 feat: action-scoped captcha tokens for share access and org settings
Captcha on shared dashboard and organization settings now passes
action-specific identifiers. Bumps @ciphera-net/ui to 0.2.1.
2026-03-11 11:30:21 +01:00
Usman Baig
205cdf314c perf: bound SWR cache, clean stale storage, cap annotations
Add LRU cache provider (200 entries) to prevent unbounded SWR memory
growth. Clean up stale PKCE localStorage keys on app init. Cap chart
annotations to 20 visible reference lines with overflow indicator.
2026-03-10 21:19:33 +01:00
Usman Baig
bcaa5c25f8 perf: replace real-time polling with SSE streaming
Replace 5-second setInterval polling with EventSource connection to the
new /realtime/stream SSE endpoint. The server pushes visitor updates
instead of each client independently polling. Auto-reconnects on
connection drops.
2026-03-10 18:33:17 +01:00
Usman Baig
d863004d5f perf: consolidate 7 dashboard hooks into single batch request
Replace useDashboardOverview, useDashboardPages, useDashboardLocations,
useDashboardDevices, useDashboardReferrers, useDashboardPerformance, and
useDashboardGoals with a single useDashboard hook that calls the existing
/dashboard batch endpoint. This endpoint runs all queries in parallel on
the backend and caches the result in Redis (30s TTL).

Reduces dashboard requests from 12 to 6 per refresh cycle (50% reduction).
At 1,000 concurrent users: ~6,000 req/min instead of 12,000.
2026-03-10 17:55:29 +01:00
Usman Baig
3587f93645 Scope 1s tick interval to Chart component to eliminate page-level re-renders
The setInterval that drives the "Live · Xs ago" display was at the page level,
forcing all 10+ dashboard components to re-render every second. Now it lives
inside Chart — the only consumer — so the rest of the dashboard is unaffected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:19:34 +01:00
Usman Baig
a9f42acbf6 Use ref for lastUpdatedAt to avoid extra re-render on mount
When navigating to dashboard with cached SWR data, setLastUpdatedAt
triggered a second full render of the entire dashboard immediately
after the first. Using a ref instead avoids this — the value still
updates and Chart reads it on the next 1-second tick re-render.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:03:12 +01:00
Usman Baig
88f02a244b Hoist DottedMap constants to module scope, static-import above-fold components
DottedMap: move createMap, stagger helpers, and base dots path to module
scope so they compute once on module load and survive unmount/remount
cycles — eliminates all recomputation when switching tabs.

Dashboard: restore static imports for the 5 above-fold components
(Chart, ContentStats, TopReferrers, Locations, TechSpecs) now that
their heavy computations are memoized. Keeps below-fold components
(PerformanceStats, GoalStats, ScrollDepth, Campaigns, etc.) dynamic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:51:32 +01:00
Usman Baig
ae0f6b8ffa Fix dashboard and map tab lag with memoization and code splitting
Memoize createMap() in DottedMap (was regenerating 8000 SVG dots every
render) and convert 11 heavy dashboard components to next/dynamic imports
so the page shell renders instantly instead of blocking on one massive
render pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:39:35 +01:00
Usman Baig
4babbc7555 fix: skip skeleton when SWR has cached data + lazy-load Map and Globe 2026-03-10 00:32:07 +01:00
Usman Baig
01f6d8d065 fix: remove content crossfade animation that caused lag on heavy pages
Also configure PWA service worker to use network-first for JS chunks
to prevent ChunkLoadError after deploys.
2026-03-10 00:26:50 +01:00
Usman Baig
628749a416 feat: opacity-only page transition + sliding indicator on all sub-tabs 2026-03-10 00:18:52 +01:00
Usman Baig
b88f4d438b fix: use popLayout mode so heavy pages animate in without delay 2026-03-10 00:12:59 +01:00
Usman Baig
2776c803f1 fix: use focus-visible for all button/tab/link focus rings across app
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:08:09 +01:00
Usman Baig
6f964f38f3 feat: add sliding tab indicator and content crossfade animations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:41:34 +01:00
Usman Baig
330cc134aa feat: instant tab navigation by moving SiteNav to shared layout
SiteNav now lives in the [id] layout instead of each page, so it stays
mounted during route transitions. Switching between Dashboard, Uptime,
Funnels, and Settings no longer flashes a full-page skeleton.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:35:06 +01:00
Usman Baig
92fae83772 chore: move site nav tabs above site header and update changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:21:12 +01:00
Usman Baig
242c76b763 fix: reduce funnel chart size with max-w-md constraint 2026-03-09 23:12:37 +01:00
Usman Baig
9f2032fc32 Replace custom FunnelChart with 21st.dev funnel-chart component
Drops in the exact 21st.dev FunnelChart component with motion/react,
curved bezier segments, layered rings, and spring hover animations.
Removes the previous custom SVG implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:06:31 +01:00
Usman Baig
536aebc086 Add FunnelChart visualization to replace BarChart on funnel detail page
Replaces the recharts BarChart with a custom funnel component using clip-path
trapezoid segments, framer-motion animations, and hover interactions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:12:34 +01:00
Usman Baig
3f81cb0e48 feat: adopt ShadCN chart primitives
Add ChartContainer, ChartConfig, ChartTooltip, ChartTooltipContent
primitives ported from ShadCN's chart pattern. Refactor all 3 chart
locations (dashboard, funnels, uptime) to use CSS variable-driven
theming instead of duplicated CHART_COLORS_LIGHT/DARK objects.

- Add --chart-1 through --chart-5, --chart-grid, --chart-axis CSS vars
- Remove duplicated color objects from 3 files (-223 lines)
- Add accessibilityLayer to all charts
- Rounded bar corners on funnel chart
- Tooltips use Tailwind dark classes instead of imperative style props

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:24:29 +01:00
Usman Baig
5fc6f183db feat: annotation UX improvements
- Custom calendar (DatePicker) instead of native date input
- Custom dropdown (Select) instead of native select
- EU date format (DD/MM/YYYY) in tooltips and form
- Right-click context menu on chart to add annotations
- Optional time field (HH:MM) for precise timestamps
- Escape key to dismiss, loading state on save
- Bump @ciphera-net/ui to 0.0.95
2026-03-09 04:17:58 +01:00
Usman Baig
4d99334bcf feat: add chart annotations
Inline annotation markers on the dashboard chart with create/edit/delete UI.
Color-coded categories: deploy, campaign, incident, other.
2026-03-09 03:44:05 +01:00
Usman Baig
a05e2e94b8 feat: add hide unknown locations toggle in site settings
Adds toggle in Data & Privacy > Filtering section to exclude entries
where geographic data could not be resolved from location stats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:26:15 +01:00
Usman Baig
7ff5be7c4e fix: pre-render Phosphor icons in capabilities array
The /features page mixed inline SVG JSX with Phosphor component
references in the capabilities array. The typeof check couldn't
distinguish them, causing a prerender crash:
"Objects are not valid as a React child (found: object with keys
{$$typeof, render, displayName})".

Pre-rendering Share2Icon and GlobeIcon as JSX makes all entries
consistent and eliminates the conditional entirely.
2026-03-09 02:00:32 +01:00
Usman Baig
6f1956b740 fix: chart no longer shows tomorrow's date on 7/30-day views
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:40:49 +01:00
Usman Baig
ad806e0427 fix: remove reload-based stale build recovery to stop login loop
window.location.reload() causes infinite loops when the CDN keeps
serving cached assets. Instead, silently treat Server Action failures
as no-session — the OAuth flow uses full navigations (window.location.href)
which naturally fetch fresh content from the server on return.
2026-03-07 20:02:58 +01:00
Usman Baig
6338d1dfe7 fix: prevent infinite reload loop on stale build recovery
Use sessionStorage guard so the hard reload only fires once. If the
reload doesn't fix it (CDN still serving stale JS), fall through
gracefully instead of looping forever.
2026-03-07 19:55:16 +01:00
Usman Baig
d2dfe62993 fix: recover gracefully from stale Server Action hashes after deployment
Wrap all Server Action calls (getSessionAction, exchangeAuthCode,
logoutAction) in try-catch so a cached browser bundle with old action
IDs triggers a hard reload instead of an infinite loading spinner.
2026-03-07 19:37:41 +01:00
Usman Baig
cc268c320e feat: replace ghost buttons with underline tab bar for site navigation
Dashboard, Uptime, Funnels, and Settings now use a consistent
underline tab bar with orange active indicator, matching the
existing panel tab design language.
2026-03-07 19:10:23 +01:00
Usman Baig
2acfd90bbd style: move Campaigns to 2-col grid, show UTM details on second line
Pair Campaigns with Goals & Events in a half-width grid to avoid empty
space. Show medium and campaign on a visible second line under source
name instead of subtle inline text.
2026-03-07 00:01:24 +01:00
Usman Baig
34e59894af style: redesign Campaigns panel to match dashboard layout, use filter icon
Rebuild Campaigns from table layout to simple row-based design matching
Content, Referrers, Locations, and Technology panels. Add click-to-filter
by utm_source. Change filter button icon from plus to funnel.
2026-03-06 23:52:47 +01:00
Usman Baig
2c82c1a52a fix: load full filter suggestions (up to 100) and fix Direct referrer duplicate
Filter dropdowns previously only showed ~10 values from cached dashboard
data. Now lazy-loads up to 100 values per dimension when the dropdown
opens. Also removes duplicate "Direct" entry from referrer suggestions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:27:54 +01:00