Commit Graph

778 Commits

Author SHA1 Message Date
Usman Baig
a60efeb6a7 Replace 'View all' buttons with expand icon in block headers
Add ArrowsOutSimpleIcon next to each panel title (Pages, Referrers,
Locations, Technology, Campaigns) that opens the full-data modal.
Remove the old text-based 'View all' button from the bottom of lists.
Update changelog with performance and UI improvements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:00:09 +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
8c5b452f73 Batch 8000 SVG circles into single path element in DottedMap
Instead of rendering 8000 individual <circle> elements (each a React
node to reconcile), batch all map dots into a single <path d="...">
string. Reduces DOM nodes from ~8000 to 1 for the base map layer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:47:27 +01:00
Usman Baig
5f797112ec Memoize expensive computations in Chart and Globe components
Chart: wrap chartData (Date formatting on every data point) and
metricsWithTrends in useMemo — these ran on every render.
Globe: memoize marker computation (Math.max + filter + map on every render).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:44:19 +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
c46d463533 fix: use focus-visible for tab nav ring so it only shows on keyboard 2026-03-09 23:45:41 +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
cc4f924fb8 fix: put annotations and live indicator on same row in chart footer 2026-03-09 23:03:58 +01:00
Usman Baig
5625703168 fix: move annotations and live indicator inside Card component 2026-03-09 23:00:44 +01:00
Usman Baig
7175de44af Fix metric cards grid to use md: breakpoint instead of @container queries
Tailwind 3 doesn't support container queries without a plugin.
2026-03-09 22:56:53 +01:00
Usman Baig
033d735c3a Replace dashboard BarChart with 21st.dev LineChart component
Swap the main site dashboard chart from a bar chart to a line chart
using 21st.dev's line-charts-6 component with dot grid background,
glow shadow, and animated active dots. Add Badge trend indicators
on metric cards using Phosphor icons. All existing features preserved
(annotations, comparison, export, live indicator, interval controls).

New UI primitives: line-charts-6, badge-2, card, button-1, avatar.
Added shadcn-compatible CSS variables and Tailwind color mappings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:53:35 +01:00
Usman Baig
5721d25291 Rewrite FunnelChart as proper SVG funnel with curved sides
Replaces crude clip-path divs with SVG bezier paths matching the 21st.dev
reference: smooth curved sides, background glow, divider lines, centered
percentage pills, and labels on both sides.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:20:55 +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
8c9c711296 Make Globe drag more responsive (damping 3000→800) 2026-03-09 21:56:38 +01:00
Usman Baig
652c93cbd0 Update changelog with Globe, DottedMap, theme toggle, and chart restyle 2026-03-09 16:22:41 +01:00
Usman Baig
2d7e13b098 Rewrite Globe with pure refs, remove framer-motion dependency
- Remove useMotionValue/useSpring which caused effect re-runs
  and globe destroy/recreate cycles (source of glitches)
- All state tracked via refs (phi, drag offset, pointer position)
- Effect only re-runs on theme change, not on every spring tick
- Direct delta tracking for drag instead of spring physics
- Simpler, more stable WebGL lifecycle
2026-03-09 16:18:24 +01:00
Usman Baig
58c151e2b0 Fix Globe glitches: stop resizing buffer every frame
- Set canvas size once on mount instead of every render frame
- Use actual devicePixelRatio (capped at 2) instead of hardcoded 2
- Remove redundant width*2 doubling (was 4x with devicePixelRatio:2)
- Increase spring damping 50→60, reduce stiffness 80→60 for smoother drag
2026-03-09 16:15:38 +01:00
Usman Baig
1a75b44c68 Move Globe up to top of container to fill space 2026-03-09 16:10:19 +01:00
Usman Baig
9629a5788c Add very slow auto-rotation to Globe (pauses on drag) 2026-03-09 16:07:52 +01:00
Usman Baig
464a361094 Center Globe horizontally and move up to show more surface 2026-03-09 16:05:44 +01:00
Usman Baig
12ae1a9175 Zoom in Globe and slow drag speed
- Position globe lower with overflow-hidden for cropped zoomed look
- Globe at 140% width pushed down 30% so only top portion visible
- Add radial gradient overlay at bottom for depth
- Increase movement damping 1400→3000 for slower drag
2026-03-09 16:02:47 +01:00
Usman Baig
3268a70baa Fix Globe: reduce mapBrightness to fix glitches, brighten base color
mapBrightness 6→2 fixes overblown dot artifacts, baseColor 0.3→0.5
makes the sphere visible against the dark card background
2026-03-09 15:57:33 +01:00
Usman Baig
9dba2cf2e2 Fix Globe: remove auto-spin, brighten dark mode, reduce jitter 2026-03-09 15:51:01 +01:00
Usman Baig
efd647d856 Add interactive 3D Globe tab to Locations using cobe WebGL
- Magic UI Globe component with auto-rotation and drag interaction
- Dark/light mode reactive (base color, glow, brightness)
- Country markers from visitor data using existing centroids
- Brand orange (#FD5E0F) marker color matching DottedMap

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:46:29 +01:00
Usman Baig
df2f38eb83 Scale DottedMap SVG to fill full card height 2026-03-09 15:34:23 +01:00
Usman Baig
c065853800 Make map landmass dots more prominent in both themes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:05:28 +01:00
Usman Baig
f58154f18d Bump @ciphera-net/ui to ^0.1.2 2026-03-09 14:43:35 +01:00
Usman Baig
31416f0eb2 Polish DottedMap: glow effect, tooltips, better fill
- SVG filter for orange glow behind markers
- Hover tooltips showing country name + pageview count
- Reduced viewBox height (75→68) to fill card better
- Bumped mapSamples to 8000 for crisper landmass
- Centered map vertically with flexbox wrapper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:23:48 +01:00
Usman Baig
6ccc26ab48 Replace WorldMap with Magic UI DottedMap for visitor locations
- New DottedMap component using svg-dotted-map with country centroid markers
- Marker size scales by pageview proportion (brand orange)
- Static country-centroids.ts lookup (~200 ISO codes)
- Remove react-simple-maps, i18n-iso-countries, world-atlas CDN dependency
2026-03-09 14:17:35 +01:00
Usman Baig
cbf48318ce Update package-lock.json for @ciphera-net/ui ^0.1.1 2026-03-09 13:59:07 +01:00
Usman Baig
874ff61a46 Bump @ciphera-net/ui to ^0.1.1 2026-03-09 13:58:30 +01:00
Usman Baig
0dfd0ccb3c Fix ChartContainer CSS to work without ShadCN theme, match ShadCN bar chart exactly
- ChartContainer: replace stroke-border/fill-muted (ShadCN tokens we
  don't have) with var(--chart-grid) so recharts CSS overrides actually work
- Dashboard chart: remove YAxis (ShadCN interactive bar has none)
- Remove unused formatAxisValue, formatAxisDuration, tick calculations
- Exact ShadCN structure: CartesianGrid vertical={false}, XAxis with
  tickMargin/minTickGap, single Bar with fill var(--color-{metric})

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:45:13 +01:00
Usman Baig
56225bb1ad Match ShadCN interactive bar chart style
- Remove cursor={false} to enable hover highlight
- Remove rounded bar corners for flat ShadCN look
- Remove explicit stroke/color on grid and axes (inherit from CSS)
- Use var(--color-{metric}) for bar fill
- Reduce chart height to 250px (ShadCN default)
- Simplify bar props to match ShadCN minimal pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:37:00 +01:00
Usman Baig
ad747b1772 Switch main dashboard chart from AreaChart to BarChart
ShadCN-style bar chart with rounded corners, solid fill,
clean grid, and translucent comparison bars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:31:07 +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
86c11dc16f chore: bump @ciphera-net/ui to ^0.1.0
ShadCN-quality restyle of shared UI components.
2026-03-09 13:02:06 +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
3002c4f58c docs: add hide unknown locations to changelog 2026-03-09 02:37:28 +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