Skip to content

Dashboard refactor - #3

Open
adiraju13 wants to merge 3 commits into
customer-mirror/base/InsForge-InsForge-1512-20260701T172458Zfrom
customer-mirror/head/InsForge-InsForge-1512-20260701T172458Z
Open

Dashboard refactor#3
adiraju13 wants to merge 3 commits into
customer-mirror/base/InsForge-InsForge-1512-20260701T172458Zfrom
customer-mirror/head/InsForge-InsForge-1512-20260701T172458Z

Conversation

@adiraju13

Copy link
Copy Markdown

Summary

How did you test this change?


Summary by cubic

Unifies analytics into a single useAnalytics module with shared analyticsQueryKeys, updating pages and query invalidation. Centralizes tracking and flags via trackEvent + constants, and moves EmptyState, LoadingState, and Skeleton to @insforge/ui (adds EmptyState.visual).

  • Refactors

    • Added useAnalytics hooks and analyticsQueryKeys; removed PostHog-specific hooks.
    • Renamed RequirePosthogConnection to RequireAnalyticsConnection.
    • Centralized tracking: trackPostHog -> trackEvent; introduced ANALYTICS_EVENTS, FEATURE_FLAGS, and FEATURE_FLAG_VARIANTS; replaced inline strings.
    • Removed DashboardsListCard, RecentReplaysCard, and analyticsService.getDashboards.
    • Moved EmptyState, LoadingState, and Skeleton to @insforge/ui and added EmptyState.visual; bumped @insforge/ui to 0.1.4.
  • Migration

    • Import EmptyState, LoadingState, and Skeleton (and their props) from @insforge/ui.
    • Use trackEvent with ANALYTICS_EVENTS, FEATURE_FLAGS, and FEATURE_FLAG_VARIANTS from #lib/analytics/constants.
    • Replace legacy hooks with useAnalytics exports (useAnalyticsConnection, useWebOverview, useWebStats, useTrend, useRetention, useRecordings, useShareToken) and use analyticsQueryKeys.
    • Swap RequirePosthogConnection for RequireAnalyticsConnection.

Written for commit 29f027a. Summary will update on new commits.

Review in cubic

Note

Consolidate analytics hooks and move shared UI components to the UI package

  • Replaces seven individual analytics hooks with a single useAnalytics.ts module that standardizes all query keys under an ['analytics', ...] namespace.
  • Moves EmptyState, LoadingState, and Skeleton from the dashboard into the @insforge/ui package (version 0.1.4), updating all import sites across the dashboard.
  • Renames trackPostHog to trackEvent and introduces constants.ts for ANALYTICS_EVENTS and FEATURE_FLAGS, replacing all inline string literals across layout and feature components.
  • Removes DashboardsListCard, RecentReplaysCard, usePosthogDashboards, and analyticsService.getDashboards() as unused code.
  • EmptyState gains an optional visual prop (ReactNode) rendered when no icon or image is provided.

Changes since InsForge#1512 opened

  • Replaced hard-coded string literal 'd_test' with constant FEATURE_FLAG_VARIANTS.D_TEST for DASHBOARD_V4_EXPERIMENT flag comparisons [29f027a]
  • Added FEATURE_FLAG_VARIANTS constant object to analytics constants module [29f027a]
  • Added test suites for EmptyState, LoadingState, and Skeleton UI components [29f027a]

Macroscope summarized 19d306e.

Summary by CodeRabbit

  • New Features

    • EmptyState gains a new visual prop for richer empty-state displays.
  • Bug Fixes

    • Shared UI components (EmptyState, LoadingState, Skeleton) consolidated for consistent visuals.
  • Refactor

    • Analytics moved from provider-specific to a generic analytics layer with unified hooks and query keys.
    • Removed legacy dashboard/replay UI pieces and updated analytics event/feature-flag usage.
  • Tests

    • Added tests for EmptyState, LoadingState, and Skeleton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants