Skip to content

Refactor dashboards and fix HMR with date handling improvements#106

Closed
conorbranagan wants to merge 6 commits intomasterfrom
conorbranagan/add-persona-dashboard-variations-4eo2an
Closed

Refactor dashboards and fix HMR with date handling improvements#106
conorbranagan wants to merge 6 commits intomasterfrom
conorbranagan/add-persona-dashboard-variations-4eo2an

Conversation

@conorbranagan
Copy link
Copy Markdown

@conorbranagan conorbranagan commented Nov 26, 2025

Changes

This PR includes several improvements to the dashboard and prototype infrastructure:

  • Restructured marketing attribution dashboard: Reorganized the marketing attribution dashboard page for better maintainability and clarity
  • Removed hardcoded navigation: Eliminated hardcoded navigation from prototypes layout to improve flexibility and reusability
  • Date object handling: Updated timeseries data to use Date objects instead of strings for more robust date handling and manipulation
  • Persona dashboard prototypes: Added new persona dashboard prototypes with proper navigation layout
  • Fixed dials HMR: Resolved Hot Module Replacement (HMR) issues for dials by implementing a window-based singleton pattern

Related Task

View Niteshift Task


TL;DR

Refactored dashboards, improved date handling, and introduced the @niteshift/dials SDK for runtime design parameter controls, which also fixed HMR issues.

What changed?

  • Niteshift Dials SDK:
    • Introduced a new @niteshift/dials package for runtime design parameter controls, including:
      • Core DialRegistry for managing and persisting dial values.
      • DialsProvider and DialsOverlay React components for UI and context.
      • Various control components (ColorControl, SpacingControl, VariantControl, BooleanControl, NumberControl) for different dial types.
      • Custom React hooks (useDial, useDynamicBoolean, useDynamicColor, useDynamicNumber, useDynamicSpacing, useDynamicVariant) for integrating dials into components.
      • Comprehensive unit tests and build configurations.
    • Integrated the @niteshift/dials SDK into the main application (src/app/Providers.tsx, src/app/layout.tsx).
    • Updated CLAUDE.md with documentation for the new SDK.
  • Dashboard Refactoring and Prototypes:
    • Restructured the marketing attribution dashboard page.
    • Removed hardcoded navigation from prototypes layout, introducing a new PrototypesLayout component.
    • Added new persona dashboard prototypes (hybrid, marketing-attribution, product-analytics, revenue-operations) with dynamic customization via @niteshift/dials.
    • Enhanced WebsiteMetricsBar, WebsitePage, and WebsitePanels components to use TypographyContext and @niteshift/dials for dynamic styling.
    • Added "Overview Alt" to website navigation.
  • Date Handling:
    • Updated timeseries data to use Date objects instead of strings for improved date handling.
  • Component Enhancements:
    • MetricCard component now supports enhanced text customization for labels and values.
  • Build and Dependencies:
    • Added a postinstall script to package.json to build the @niteshift/dials workspace.
    • Updated pnpm-lock.yaml to reflect dependency changes.

Description generated by Mesa. Update settings

smehmood and others added 4 commits November 25, 2025 13:13
Introduces a complete design dials system that allows designers and PMs
to adjust UI parameters at runtime without code changes.

**Dials SDK (`packages/dials/`):**
- useDynamicColor: Color values with design system integration
- useDynamicSpacing: Spacing/padding/margin controls
- useDynamicVariant: Discrete choice selections
- useDynamicBoolean: Toggle/feature flag controls
- useDynamicNumber: Numeric values with min/max/step
- DialsOverlay: Compact Leva-inspired UI (Ctrl+D to toggle)
- DialsProvider: React context for dial state management
- Design manifest integration for design system tokens

**App Integration:**
- Added DialsProvider to app Providers
- Example dials on WebsitePage (metrics bar, panels, navigation)
- MetricCard component with adjustable typography dials
- TypeScript manifest at src/config/niteshift-manifest.ts

**Documentation:**
- Comprehensive CLAUDE.md section on dials usage
- Best practices for preserving original appearance
- Examples for all dial types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The static class property singleton pattern doesn't survive HMR
when module boundaries get crossed. New dials would register with
a fresh registry instance while DialsOverlay stayed subscribed to
the old one.

Fix: Store the singleton on `window.__NITESHIFT_DIALS_REGISTRY__`
so it persists across module re-evaluations during hot reload.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@conorbranagan conorbranagan changed the title Add persona dashboard prototypes & fix dials HMR Refactor timeseries, add persona dashboard, fix HMR Nov 26, 2025
@conorbranagan conorbranagan changed the title Refactor timeseries, add persona dashboard, fix HMR Refactor prototypes & timeseries data handling Nov 26, 2025
@conorbranagan conorbranagan changed the title Refactor prototypes & timeseries data handling Refactor dashboards and fix HMR with date handling improvements Nov 26, 2025
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