Refactor: Clean up unused chart and navigation imports, and make sidebar skeleton width deterministic.#2
Conversation
…bar skeleton width deterministic.
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase by removing unused imports and fixing a potential hydration issue with the sidebar skeleton component. The changes improve code cleanliness by eliminating dead imports while making the sidebar skeleton width deterministic to prevent React hydration mismatches.
Changes:
- Removed unused Lucide icon imports (Ruler, Calculator) from navigation configuration
- Removed unused recharts imports (ResponsiveContainer, Tooltip) from chart components
- Changed sidebar skeleton width from random to fixed value to avoid hydration warnings
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/config/navigation.ts | Removed unused Ruler and Calculator icon imports |
| src/components/ui/sidebar.tsx | Changed skeleton width from random to deterministic fixed value; minor formatting cleanup |
| src/components/layout/sidebar/app-sidebar.tsx | Removed unused LucideIcon and NavGroup type imports |
| src/components/charts/pie-chart.tsx | Removed unused ResponsiveContainer import |
| src/components/charts/bar-chart.tsx | Removed unused ResponsiveContainer import |
| src/components/charts/area-chart.tsx | Removed unused Tooltip and ResponsiveContainer imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Deterministic width to avoid impure function warning | ||
| // Using a fixed pattern that provides visual variety | ||
| const width = "70%" |
There was a problem hiding this comment.
The fixed width solution solves the hydration mismatch issue, but removes visual variety. Consider making the width configurable via an optional prop (e.g., width?: string) that defaults to "70%". This would allow consumers to provide different widths for multiple skeleton instances while maintaining deterministic behavior.
No description provided.