mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-10-30 22:37:13 +08:00
* fix: ensure compound foreground tokens are matched correctly in inspector - Sort theme tokens by length descending to prioritize longer matches - Fixes issue where text-muted-foreground showed as text-muted - Ensures compound tokens like card-foreground, primary-foreground are captured fully * refactor: optimize theme inspector for performance - Move regex creation to module level to prevent recreation on each render - Memoize event handlers with useCallback to prevent child re-renders - Extract state update logic into separate memoized functions - Create separate component for class items to enable granular memoization - Add custom prop comparison for better React.memo optimization - Extract classNames computation to dedicated hook Reduces re-renders significantly in inspector components * refactor: optimize theme inspector scroll performance - Add ref-based overlay state tracking to prevent unnecessary re-renders - Cache scrollable viewport element to avoid repeated DOM queries - Implement efficient scroll event handling with early exit conditions - Add comprehensive performance documentation and inline comments - Separate viewport discovery from scroll event management for better organization * refactor inspector hooks and fix minor functionality * remove toggleInspector on edit * feat: Add segment styles and add inspector overlay bounds * update color-picker animated styles and fix timer * fix: Unwanted elements for overlay and add specific classes for missing els * refactor: Improve layout and styling in inspector components - Adjusted spacing in InspectorClassItem for better alignment - Enhanced InspectorOverlay with a title and separator for clarity - Updated ThemePreviewPanel to refine button size and inspector toggle visibility * fix: focus color now works from any tab * improve inspector overlay styles