Skip to content

Fix: layout, bundle size, lazy loading and deps vulnerabilities - #83

Merged
Friedrich482 merged 16 commits into
mainfrom
features
Aug 6, 2025
Merged

Friedrich482 merged 16 commits into
mainfrom
features

Conversation

@Friedrich482

@Friedrich482 Friedrich482 commented Aug 6, 2025 •

Copy link
Copy Markdown
Owner

Commits

  • init: layout

    • added borders around all different sections of the dashboard
    • moved the GroupByDropDown.tsx component in the title of the pages
  • fix: dashboard bundle size

    • added some manual chunks in the vite.config.ts to reduce the final bundle size of the main chunk
    • removed the fly.toml file since it is no longer required
    • bumped the extension version to 0.0.20
    • styles improvement in the skeleton component
  • build: version bumps

    • fixed the errors in the api and updated the versions of many packages
    • removed the package-lock.json from the api and the extension
    • removed the pipe validator from the main.ts in the api since it is no longer used
    • bumped zod to v4 in the packages/common
  • build: zod

    • bumped zod to version 4.0.14 across the monorepo: in the apps: dashboard and vscode-extension
  • fix: dependencies vulnerabilities

    • reduced the number of dependencies vulnerabilities from 13 to 2
  • fix: deps vulnerabilities

    • fixed the remaining dependencies vulnerabilities in the monorepo
  • build: vite chunks

    • split the build file in many chunks depending of the libraries; each chunk is less than 500kb
  • fix: layout and skeleton

    • renamed the visualizer filename in the vite.config.ts from stats.html to deps.html
    • removed the text size changes from the CustomRangeDatesSelector
    • made the DashboardTitle and ProjectTitle like paragraphs with a proper loading skeleton
  • feat: ScrollToTopButton

    • added a ScrollToTop button component in the packages/ui components and used it in the Layout of the dashboard
    • adjusted the skeleton background color in light mode
  • build: dashboard

    • reverted back to a simple manual chunking in the vite.config.ts
    • prevented the deps.html file to be copied in the bundle of the dashboard when packaging the extension
  • build: lazy

    • made all the components using recharts lazy loaded to reduce the bundle size
    • added manual chunks for almost all libraries to reduce the bundle size
  • fix: skeleton

    • fixed the layout issues of the skeleton when getting the time spent on the period, either globally or on a project
  • fix: error boundaries

    • fixed the display of the error boundaries on the root dashboard page and on the project page
  • feat: dashboard preview

    • specifically defined a port to preview the dashboard when it is built and used it to configure the vite.config.ts and the main.ts in the api

Summary by CodeRabbit

  • New Features

    • Added a "Scroll to Top" button for improved navigation in the dashboard.
    • Introduced a new dropdown for grouping data in dashboard and project views.
    • Added a utility for formatting Zod validation errors.
  • Enhancements

    • Improved dashboard and project page layouts, including new containers, better spacing, and accessibility updates.
    • Lazy-loaded chart components for faster initial load times.
    • Enhanced error fallback UIs for charts and project titles.
    • Optimized dashboard build with bundle splitting and dependency visualization.
  • Dependency Updates

    • Upgraded major dependencies across API, dashboard, and VSCode extension, including NestJS, Zod, and esbuild.
    • Updated TypeScript and ESLint tooling.
  • Bug Fixes / Style

    • Adjusted responsive breakpoints and styling for buttons, legends, and skeleton loaders.
    • Improved accessibility attributes for interactive elements.
  • Chores

    • Removed unused files and updated configuration files for deployment and build processes.
    • Refined TypeScript and package configuration for better maintainability.

-added borders around all different sections of the dashboard
- moved the `GroupByDropDown` component in the title of the pages
- added some manual chunks in the vite config to reduce the final bundle size of the main chunk
- removed the `fly.toml` file since it is no longer required
- bumped the extension version to `0.0.20`
- styles improvement in the `skeleton` component
- fixed the errors in the api and updated the versions of many packages
- removed the `package-lock.json` from the api and the extension
- removed the pipe validator from the `main.ts` in the api since it is no longer used
- bumped zod to v4 in the packages/common
- bumped zod to version 4.0.14 across the monorepo: in the apps: `dashboard` and `vscode-extension`
- reduced the number of dependencies vulnerabilities from 13 to 2
- fixed the remaining dependencies vulnerabilities in the monorepo
-  split the build file in many chunks depending of the libraries; each chunk is less than 500kb
- renamed the visualizer filename in the `vite.config.ts` from "stats" to "deps"
- removed the text size changes from the `CustomRangeDatesSelector`
-  made the `DashboardTitle` and `ProjectTitle` like paragraphs with a proper loading skeleton
- added a `ScrollToTop` button component in the `packages/ui` components and used it in the `Layout` of the dashboard
- adjusted the skeleton background color in light mode
- reverted back to a simple manual chunking in the `vite.config.ts`
- prevented the deps.html file to be copied in the bundle of the dashboard when packaging the extension
- made all the components using recharts lazy loaded to reduce the bundle size
- added manual chunks for almost all libraries to reduce the bundle size
- fixed the layout issues of the skeleton when getting the time spent on the period, either globally or on a project
- fixed the display of the error boundaries on the root dashboard page and on the project page
- specifically defined a port to preview the dashboard when it is built and used it to configure the `vite.config.ts` and the `main.ts` in the api
@coderabbitai

coderabbitai Bot commented Aug 6, 2025 •

Copy link
Copy Markdown

Walkthrough

This change set primarily updates dependencies across multiple packages, introduces new utility functions and UI components, refactors and enhances dashboard and project page layouts, and improves configuration for build and deployment. Key updates include major dependency bumps (notably zod and NestJS), the addition of a scroll-to-top button, improved error formatting utilities, lazy loading of chart components, and enhanced build chunking and visualization.

Changes

Cohort / File(s) Change Summary
API Dependency and Config Upgrades
apps/api/package.json, apps/api/tsconfig.json
Upgrades NestJS, zod, and other dependencies; refines TypeScript config to target ES2022 and adjusts include/exclude patterns.
Dashboard Dependency and Build Enhancements
apps/dashboard/package.json, apps/dashboard/vite.config.ts
Upgrades zod, adds rollup-plugin-visualizer, configures manual chunking for dependencies, and sets preview port.
VSCode Extension Version and Dependency Bumps
apps/vscode-extension/package.json, apps/vscode-extension/README.md
Bumps extension version, updates esbuild and zod dependencies, updates version badge in README.
VSCode Extension Build Logic
apps/vscode-extension/build.js
Modifies dashboard asset copying to exclude deps.html from being copied.
Dashboard Layout and UI Refactors
apps/dashboard/src/components/ChartGroupWrapper.tsx, apps/dashboard/src/components/CustomRangeDatesSelector.tsx, apps/dashboard/src/components/dashboard-page/Dashboard.tsx, apps/dashboard/src/components/dashboard-page/DashboardTitle.tsx, apps/dashboard/src/components/dashboard-page/GroupByDropDown.tsx, apps/dashboard/src/components/dashboard-page/TimeSpentOnPeriod.tsx, apps/dashboard/src/components/dashboard-page/charts/PeriodLanguagesChart.tsx, apps/dashboard/src/components/dashboard-page/charts/PeriodTimeChart.tsx, apps/dashboard/src/components/layout/Layout.tsx, apps/dashboard/src/components/project-page/Project.tsx, apps/dashboard/src/components/project-page/ProjectTitle.tsx, apps/dashboard/src/components/project-page/TimeSpentOnProject.tsx, apps/dashboard/src/components/project-page/charts/CircularPacking.tsx, apps/dashboard/src/components/project-page/charts/ProjectLanguagesTimeOnPeriodChart.tsx, apps/dashboard/src/components/project-page/charts/ProjectTimeOnPeriodChart.tsx, apps/dashboard/src/components/project-page/files-list/FilesList.tsx
Refactors component layouts, introduces lazy loading for charts, adds GroupBy dropdown, improves error fallback UIs, updates responsive classes, and adds a scroll-to-top button.
Dashboard Utility Update
apps/dashboard/src/utils/getPeriodStoreValuesFromURL.ts
Switches error formatting utility import from formatZodIssues to formatZodError.
Dashboard HTML Minor Update
apps/dashboard/index.html
Adds class="relative" to the root div.
Web App Dependency Tweak
apps/web/package.json
Reorders dependencies and changes react/react-dom versioning to caret ranges.
Common Package Updates
packages/common/package.json, packages/common/src/constants.ts, packages/common/src/formatZodError.ts, packages/common/src/formatZodIssues.ts
Upgrades zod, adds dashboard preview port constant, introduces new error formatting utility, removes old error formatting utility.
UI Library Additions and Tweaks
packages/ui/src/components/ScrollToTopButton.tsx, packages/ui/src/components/ui/skeleton.tsx
Adds a scroll-to-top button component and updates skeleton background classes for theme compatibility.
Root Dependency Overrides
package.json
Adds an overrides section to pin specific dependency versions and resolve sub-dependencies.
Deployment Config Removal
fly.toml
Removes Fly.io deployment configuration for the API.
VSCode Extension Utility Import Fix
apps/vscode-extension/src/utils/global-state/getGlobalStateData.ts
Updates import path for error formatting utility.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Dashboard
  participant ChartComponent
  participant ErrorBoundary
  participant SuspenseBoundary

  User->>Dashboard: Visits dashboard page
  Dashboard->>SuspenseBoundary: Loads chart group (lazy)
  SuspenseBoundary->>ChartComponent: Dynamically import chart
  ChartComponent-->>SuspenseBoundary: Render chart or loading
  ChartComponent-->>ErrorBoundary: If error, render fallback
  ErrorBoundary-->>Dashboard: Show error UI if chart fails
Loading
sequenceDiagram
  participant User
  participant ScrollToTopButton

  User->>ScrollToTopButton: Scrolls down page
  ScrollToTopButton->>User: Button appears
  User->>ScrollToTopButton: Clicks button
  ScrollToTopButton->>User: Smoothly scrolls to top
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A hop, a skip, a scroll to the top,
Dependencies rise, old errors drop.
Lazy charts load with a shimmer and gleam,
Zod’s new tricks make error reports clean.
With buttons and badges and configs anew—
This bunny’s delighted to code here with you!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d486aa and 1349bc9.

📒 Files selected for processing (1)
  • apps/dashboard/src/utils/getPeriodStoreValuesFromURL.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/dashboard/src/utils/getPeriodStoreValuesFromURL.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch features

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Friedrich482 Friedrich482 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes reviewed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (6)
apps/dashboard/src/components/project-page/charts/ProjectLanguagesTimeOnPeriodChart.tsx (1)

84-85: Consistent responsive naming – same concern as PeriodLanguagesChart

See the comment in PeriodLanguagesChart.tsx. Apply whichever decision (keep arbitrary, introduce alias, or revert to max-small) uniformly across chart components to avoid drift.

apps/dashboard/src/components/dashboard-page/GroupByDropDown.tsx (1)

35-37: Dropped absolute positioning – check collision with neighbouring controls

className now: flex max-w-24 items-center gap-4

👍 Simpler and less brittle, but the button no longer has an explicit width or positioning. On very long “Group by” labels (e.g., translations), text may overflow the max-w-24 constraint and shift sibling elements.

Consider:

-className="flex max-w-24 items-center gap-4"
+className="flex max-w-24 items-center gap-2 truncate"

so text truncates gracefully instead of growing wider.

packages/ui/src/components/ScrollToTopButton.tsx (1)

33-33: Consider making scroll threshold configurable.

The hardcoded 200px threshold could be made configurable for better reusability across different use cases.

-const ScrollToTopButton = () => {
+const ScrollToTopButton = ({ threshold = 200 }: { threshold?: number } = {}) => {
   const [isVisible, setIsVisible] = useState(false);

   const handleScrollToTopButtonVisibility = () => {
-    setIsVisible(window.scrollY > 200);
+    setIsVisible(window.scrollY > threshold);
   };
apps/dashboard/src/components/dashboard-page/DashboardTitle.tsx (1)

11-15: Consider using semantic HTML over ARIA roles for better accessibility.

Replacing <h1> with <div role="heading" aria-level={1}> reduces accessibility and SEO benefits. Semantic HTML elements like <h1> are more universally supported by screen readers and search engines.

-  <div
-    className="rounded-md border p-3 text-center text-2xl"
-    role="heading"
-    aria-level={1}
-  >
+  <h1 className="rounded-md border p-3 text-center text-2xl">
packages/common/src/formatZodError.ts (1)

3-5: Add explicit return type for better type safety.

The function correctly wraps zod's prettifyError method, which is a good approach for leveraging the library's native functionality.

-export const formatZodError = (error: ZodError) => {
+export const formatZodError = (error: ZodError): string => {
   return z.prettifyError(error);
 };
apps/api/tsconfig.json (1)

16-16: Consider target/lib version alignment.

Using ES2022 lib features with ES6 target may cause runtime issues if ES2022 features are used that don't have ES6 equivalents. Consider updating target to match lib version or documenting this intentional choice.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d53c11 and 01dfcf3.

⛔ Files ignored due to path filters (3)
  • apps/api/package-lock.json is excluded by !**/package-lock.json
  • apps/vscode-extension/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (37)
  • .npmrc (1 hunks)
  • apps/api/package.json (1 hunks)
  • apps/api/src/main.ts (1 hunks)
  • apps/api/tsconfig.json (2 hunks)
  • apps/dashboard/index.html (1 hunks)
  • apps/dashboard/package.json (2 hunks)
  • apps/dashboard/src/components/ChartGroupWrapper.tsx (1 hunks)
  • apps/dashboard/src/components/CustomRangeDatesSelector.tsx (1 hunks)
  • apps/dashboard/src/components/dashboard-page/Dashboard.tsx (1 hunks)
  • apps/dashboard/src/components/dashboard-page/DashboardTitle.tsx (1 hunks)
  • apps/dashboard/src/components/dashboard-page/GroupByDropDown.tsx (1 hunks)
  • apps/dashboard/src/components/dashboard-page/TimeSpentOnPeriod.tsx (1 hunks)
  • apps/dashboard/src/components/dashboard-page/charts/PeriodLanguagesChart.tsx (1 hunks)
  • apps/dashboard/src/components/dashboard-page/charts/PeriodTimeChart.tsx (0 hunks)
  • apps/dashboard/src/components/layout/Layout.tsx (2 hunks)
  • apps/dashboard/src/components/project-page/Project.tsx (2 hunks)
  • apps/dashboard/src/components/project-page/ProjectTitle.tsx (1 hunks)
  • apps/dashboard/src/components/project-page/TimeSpentOnProject.tsx (1 hunks)
  • apps/dashboard/src/components/project-page/charts/CircularPacking.tsx (1 hunks)
  • apps/dashboard/src/components/project-page/charts/ProjectLanguagesTimeOnPeriodChart.tsx (1 hunks)
  • apps/dashboard/src/components/project-page/charts/ProjectTimeOnPeriodChart.tsx (0 hunks)
  • apps/dashboard/src/components/project-page/files-list/FilesList.tsx (1 hunks)
  • apps/dashboard/src/utils/getPeriodStoreValuesFromURL.ts (1 hunks)
  • apps/dashboard/vite.config.ts (2 hunks)
  • apps/vscode-extension/README.md (1 hunks)
  • apps/vscode-extension/build.js (1 hunks)
  • apps/vscode-extension/package.json (3 hunks)
  • apps/vscode-extension/src/utils/global-state/getGlobalStateData.ts (1 hunks)
  • apps/web/package.json (1 hunks)
  • fly.toml (0 hunks)
  • package.json (1 hunks)
  • packages/common/package.json (1 hunks)
  • packages/common/src/constants.ts (1 hunks)
  • packages/common/src/formatZodError.ts (1 hunks)
  • packages/common/src/formatZodIssues.ts (0 hunks)
  • packages/ui/src/components/ScrollToTopButton.tsx (1 hunks)
  • packages/ui/src/components/ui/skeleton.tsx (1 hunks)
💤 Files with no reviewable changes (4)
  • apps/dashboard/src/components/project-page/charts/ProjectTimeOnPeriodChart.tsx
  • fly.toml
  • apps/dashboard/src/components/dashboard-page/charts/PeriodTimeChart.tsx
  • packages/common/src/formatZodIssues.ts
🧰 Additional context used
🧬 Code Graph Analysis (6)
apps/dashboard/src/components/layout/Layout.tsx (1)
packages/ui/src/lib/utils.ts (1)
  • cn (4-6)
packages/ui/src/components/ui/skeleton.tsx (1)
packages/ui/src/lib/utils.ts (1)
  • cn (4-6)
apps/dashboard/src/components/CustomRangeDatesSelector.tsx (1)
packages/ui/src/components/ui/button.tsx (1)
  • Button (27-27)
apps/api/src/main.ts (1)
packages/common/src/constants.ts (2)
  • DASHBOARD_PORT (9-9)
  • DASHBOARD_PREVIEW_PORT (11-11)
apps/dashboard/vite.config.ts (1)
packages/common/src/constants.ts (2)
  • DASHBOARD_PORT (9-9)
  • DASHBOARD_PREVIEW_PORT (11-11)
apps/dashboard/src/components/ChartGroupWrapper.tsx (1)
packages/ui/src/lib/utils.ts (1)
  • cn (4-6)
🪛 Biome (2.1.2)
apps/dashboard/src/components/project-page/Project.tsx

[error] 37-37: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

🔇 Additional comments (46)
apps/dashboard/index.html (1)

11-11: LGTM! Root positioning setup for new UI components.

The addition of relative class to the root div appropriately supports absolute/fixed positioned components like the new ScrollToTopButton mentioned in the PR objectives.

apps/dashboard/src/components/project-page/TimeSpentOnProject.tsx (1)

8-8: Improved text wrapping for better readability.

Changing from text-nowrap to text-wrap allows longer duration strings to wrap appropriately, improving the user experience when displaying time values.

apps/dashboard/src/components/project-page/charts/CircularPacking.tsx (1)

45-58: Excellent UI and accessibility improvements.

The enhanced control panel styling with fixed width, borders, and padding creates a cohesive design. The addition of dynamic accessibility attributes (title and aria-label) for both Play/Pause and Reset buttons significantly improves screen reader support, with the Play/Pause labels correctly reflecting the current animation state.

apps/dashboard/src/components/layout/Layout.tsx (3)

5-5: Good addition of scroll-to-top functionality.

The import of ScrollToTopButton aligns with the PR objectives for UI improvements and enhances user navigation experience.


22-22: Appropriate addition of loader identification.

Adding id="loader" to the main content wrapper provides proper element identification while maintaining existing loading state styling with the cn utility.


26-26: Well-positioned ScrollToTopButton component.

The ScrollToTopButton is appropriately placed after the main content but before the Footer, ensuring it's available throughout the application navigation without interfering with existing layout structure.

apps/dashboard/src/components/dashboard-page/TimeSpentOnPeriod.tsx (1)

25-25: Good text styling improvement and cleanup.

Replacing cn("text-nowrap") with direct "text-pretty" className improves text readability and removes unnecessary complexity. The removal of the unused cn import is also good cleanup. This change aligns with similar text display improvements across other components.

apps/dashboard/src/components/dashboard-page/charts/PeriodLanguagesChart.tsx (1)

93-94: Custom breakpoint max-[30rem]:hidden – verify Tailwind config & naming convention

Arbitrary breakpoints are fine with the JIT compiler, but we now have at least three variants in the codebase (max-small, max-chart, and this max-[30rem]).
Before this proliferates, confirm that:

  1. 30rem (≈ 480 px) is the intended value across the design system, and
  2. There is either a documented convention or a theme.screens alias for this size.

Otherwise the next refactor will be painful.

apps/dashboard/src/components/project-page/ProjectTitle.tsx (1)

6-7: Removal of small-screen font override – double-check readability

max-[25.625rem]:text-2xl is gone, so very narrow devices will now always render text-3xl.
If that was an intentional design decision, all good. If not, expect truncated titles or wrapping issues on ~410 px screens.

packages/ui/src/components/ui/skeleton.tsx (1)

9-12: Good move to separate light/dark background tokens

Switching from a single bg-primary/10 to dark:bg-accent bg-input aligns with the color-system guidelines and eliminates the semi-transparent overlay that sometimes clashed with dark mode.
LGTM.

apps/dashboard/src/components/project-page/files-list/FilesList.tsx (1)

84-91: Enhanced error boundary UI looks good!

The custom FallbackComponent provides better visual consistency and responsive styling for error states. The comprehensive className with responsive breakpoints ensures proper layout across different screen sizes.

packages/ui/src/components/ScrollToTopButton.tsx (1)

33-33: Verify fixed positioning doesn't conflict with existing UI elements.

The fixed positioning with right-1 bottom-5 z-50 should be tested to ensure it doesn't overlap with other fixed elements like navigation bars, chat widgets, or cookie banners.

apps/dashboard/src/components/CustomRangeDatesSelector.tsx (2)

20-48: Good semantic improvement with paragraph wrapper.

Wrapping the text nodes in a paragraph element with text-pretty class improves semantic HTML structure and text rendering.


30-30: Verified isolation of responsive text class removal

  • Searched across all .tsx files for max-[25.625rem]:text-base; no other occurrences found.
  • The class was only applied in apps/dashboard/src/components/CustomRangeDatesSelector.tsx (and has been removed from both <Button> instances).

No code changes are required—removal is isolated to this component.

apps/dashboard/src/components/ChartGroupWrapper.tsx (1)

1-19: Excellent improvements to component flexibility and semantics!

The changes enhance the component in multiple ways:

  • Optional className prop increases reusability
  • <section> element improves semantic HTML over generic <div>
  • Proper use of cn utility for class merging follows established patterns
  • TypeScript typing is correct

These changes align well with the UI enhancement objectives.

apps/dashboard/src/components/dashboard-page/Dashboard.tsx (2)

8-16: Excellent lazy loading implementation for bundle optimization!

Converting the chart components to lazy loading with dynamic imports will significantly improve initial page load performance by reducing the main bundle size. This aligns perfectly with the PR's bundle size optimization objectives.


24-67: Great layout restructuring with proper error boundaries.

The new wrapper structure provides:

  • Consistent visual grouping with borders and padding
  • Proper error handling for each chart with custom fallback styling
  • Appropriate suspense boundaries for lazy-loaded components

The layout improvements enhance the dashboard's visual consistency and user experience.

apps/dashboard/src/components/dashboard-page/DashboardTitle.tsx (3)

4-4: LGTM! Good centralization of GroupByDropDown.

The addition of GroupByDropDown in the dashboard header aligns well with the PR objective to centralize this control. The layout with stacked dropdowns in a floating left container provides good UX.

Also applies to: 16-19


21-21: LGTM! Improved layout and alignment.

The styling adjustments improve visual alignment:

  • text-start provides better left alignment for content
  • inline-block align-top improves vertical alignment consistency
  • Icon positioning adjustments enhance visual balance

Also applies to: 25-26, 32-32


12-12: LGTM! Consistent with layout enhancement objectives.

The addition of borders and padding aligns well with the PR objective to add borders around dashboard sections for better visual separation.

apps/dashboard/src/components/project-page/Project.tsx (5)

14-14: LGTM! Proper lazy loading implementation for bundle optimization.

The conversion to lazy-loaded chart components is well-implemented and aligns with the PR objective to reduce bundle size. The use of React.lazy() with dynamic imports follows React best practices.

Also applies to: 41-49


6-6: LGTM! Consistent layout pattern with proper error handling.

The addition of GroupByDropDown follows the same pattern as DashboardTitle, providing UI consistency. The proper wrapping with error and suspense boundaries ensures robust component behavior.

Also applies to: 60-75


13-13: LGTM! Consistent error UI with good visual design.

The enhanced error fallback UI maintains consistency with other components while providing clear visual feedback. The responsive icon sizing and positioning adjustments improve the overall user experience.

Also applies to: 30-35


78-111: LGTM! Comprehensive chart wrapper with proper lazy loading and error handling.

The chart components are properly wrapped with error and suspense boundaries, ensuring robust lazy loading behavior. The custom error fallback for FilesCirclePackingChart with specific dimensions is appropriate for its visual requirements.


37-37: False positive: ErrorBoundary requires children as prop.

The static analysis warning is incorrect. The react-error-boundary library's ErrorBoundary component specifically requires children as a prop, not JSX children. This is the correct usage according to the library's API.

packages/common/src/constants.ts (1)

11-11: LGTM!

Adding DASHBOARD_PREVIEW_PORT with value 4173 (Vite's default preview port) follows good practices by centralizing port configuration and maintaining consistency with the existing DASHBOARD_PORT constant.

apps/vscode-extension/src/utils/global-state/getGlobalStateData.ts (1)

5-5: LGTM!

The import path update correctly reflects the refactoring from formatZodIssues to formatZodError, maintaining consistent error handling functionality.

apps/web/package.json (1)

15-18: Version-range loosening – make sure React/Next stay in lock-step
Changing react / react-dom from exact to caret allows npm to pull newer minor / patch releases automatically. That is fine, but next@15.x pins a specific tested React version. Mismatch can break Fast Refresh or the compiler.

Please sanity-check with npm ls react react-dom next after install or lock them together in overrides.

package.json (1)

37-47: Wide-scope overrides – verify downstream breakage
Forcing esbuild@0.25.8, micromatch, braces, etc., is useful for CVE mitigation, but several build tools (Vite, tsup, tsc-alias, etc.) sometimes hard-pin older esbuild APIs. Run a cold install + build on CI to catch any “unsupported loader” or “unknown option” errors after these overrides.

apps/vscode-extension/package.json (2)

5-6: Major zod upgrade – audit runtime code
zod v4 is a breaking release (changed error shape, dropped ZodError.issues optional chaining, etc.). The extension code still imports ZodError and accesses .issues in several places (e.g. src/utils/*.ts). Make sure those call-sites were migrated; otherwise the extension will crash at runtime.


125-126: Dev-only esbuild now in sync with workspace override – nice
Good catch upgrading to 0.25.8; the extension build will benefit from the bug-fixes and avoids duplicate binaries. 👍

apps/vscode-extension/README.md (1)

11-11: Changelog badge updated – no issues
The version badge correctly reflects 0.0.20.

apps/dashboard/package.json (2)

52-52: Good addition for bundle analysis.

Adding rollup-plugin-visualizer supports the PR's bundle optimization objectives and will help monitor bundle sizes over time.


33-33: Zod 4.0.14 version confirmed
Zod v4.0.14 is the latest stable release (published July 30, 2025) and the version bump in apps/dashboard/package.json is valid. Because 4.x includes breaking changes, please:

  • Review your Zod schemas and usages against the v4 migration guide (https://zod.dev/v4/migration).
  • Run the full test suite to catch any compatibility issues.
apps/vscode-extension/build.js (1)

34-41: Well-implemented exclusion of build artifact.

Properly excludes the rollup-plugin-visualizer generated file from the VSCode extension package, preventing unnecessary bloat while maintaining clean separation of development artifacts.

apps/api/tsconfig.json (1)

26-27: Good explicit include/exclude configuration.

Adding explicit include and exclude paths improves TypeScript compiler performance and clarity about which files are processed.

apps/dashboard/vite.config.ts (4)

1-1: Good integration of new dependencies and constants.

Proper import of the new preview port constant and rollup-plugin-visualizer aligns with the bundle optimization strategy.

Also applies to: 6-6


12-15: Effective bundle analysis setup.

The visualizer plugin configuration with automatic opening and custom filename will help monitor bundle optimization progress.


20-22: Consistent preview port configuration.

Using the shared DASHBOARD_PREVIEW_PORT constant ensures consistency with API CORS configuration.


32-72: Comprehensive manual chunking strategy.

The manual chunking configuration is well-organized, grouping related dependencies logically. This should significantly improve bundle caching and reduce initial load times by allowing selective loading of feature-specific chunks.

apps/api/src/main.ts (3)

2-2: Consistent constant usage.

Good use of the shared DASHBOARD_PREVIEW_PORT constant for consistency across the monorepo.


8-13: Improved CORS configuration maintainability.

The computed allowedClients array is more maintainable than inline configuration and properly supports both localhost and 127.0.0.1 addresses across multiple ports, including the preview port.


18-18: Verify global validation pipe removal impact

I ran searches for ValidationPipe and common class-validator decorators under apps/api/src, but found no occurrences. That suggests there’s currently no per-route or decorator-based validation to replace the removed global pipe. Please manually confirm that:

  • Every controller/handler applies its own ValidationPipe (e.g. via @UsePipes(new ValidationPipe()))
  • All DTOs use class-validator decorators (e.g. @IsString(), @IsOptional(), etc.)
  • Validation is implemented elsewhere (middleware, interceptor, etc.) before request handling

If none of the above is true, you’ll need to reintroduce validation (globally or per-endpoint) to avoid breaking data integrity.

apps/api/package.json (3)

24-41: Add explicit rxjs peer to avoid implicit resolution

Nest v11 peer-depends on rxjs@^7, but the package is not declared here. Depending on the installer, rxjs may be hoisted from a transitive dep at an incompatible version, breaking DI and interceptors at runtime.

+    "rxjs": "^7.8.0",

Locking the peer removes this uncertainty.


65-70: Confirm ts-jest@29.4 supports TypeScript 5.9

typescript jumped to 5.9.2 while ts-jest is still 29.4.1. Historically, ts-jest lags one or two minor TS versions; incompatible pairs cause cryptic transform errors during tests.

Run the test suite; if failures appear, upgrade to ts-jest@30 (if available) or pin typescript down to the latest version officially supported by ts-jest.


32-40: No action needed for bcrypt, ulid, or zod imports/usages

All call-sites are already using the correct named imports and there are no .safeParse calls to update:

• bcrypt
• import * as bcrypt and import { compare } remain valid in v6.
• ulid
• Using import { ulid } matches the ESM-first v3 API.
• zod
• No safeParse usage found—no adjustments required.

Please ensure your integration tests pass after upgrading.

Comment thread .npmrc Outdated
Comment thread apps/api/package.json
Comment thread apps/api/package.json
Comment thread apps/dashboard/src/utils/getPeriodStoreValuesFromURL.ts Outdated
"dependencies": {
"date-fns": "^4.1.0",
"zod": "^3.24.3"
"zod": "4.0.14"

@coderabbitai coderabbitai Bot Aug 6, 2025 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify zod v4.0.14 compatibility and breaking changes.

The upgrade from zod v3.24.3 to v4.0.14 represents a major version bump that likely includes breaking changes. Additionally, using a fixed version instead of a caret range removes update flexibility.


🌐 Web query:

What are the breaking changes in zod version 4.0.14 compared to version 3.24.3? Does zod version 4.0.14 exist?

💡 Result:

Yes, Zod version 4.0.14 exists. This release includes several updates and fixes, such as:

  • Fixing typos in the documentation.
  • Adding JSON Schema draft-04 output support.
  • Improving tuple recursive inference.
  • Avoiding infinite loops in defineLazy.

(newreleases.io)

Regarding breaking changes between Zod versions 3.24.3 and 4.0.14, Zod 4 introduces several significant changes that may affect existing codebases:

  1. Error Handling Overhaul: The error customization API has been streamlined. The message parameter is now deprecated in favor of the error parameter, which offers a more consistent approach to error handling. (v4.zod.dev)

  2. Deprecation of .format() and .flatten() Methods: These methods on ZodError have been deprecated. Instead, developers are encouraged to use the top-level z.treeifyError() function for error formatting. (v4.zod.dev)

  3. Changes in .default() Behavior: The application of .default() has been modified. In Zod 4, if the input is undefined, ZodDefault short-circuits the parsing process and returns the default value directly. This change may impact code that relies on the previous behavior. (v4.zod.dev)

  4. Deprecation of .strict() and .passthrough() Methods: These methods on ZodObject have been deprecated in favor of the top-level z.strictObject() and z.looseObject() functions. (v4.zod.dev)

  5. Removal of .nonstrict() and .deepPartial() Methods: The .nonstrict() method, an alias for .strip(), has been removed. Additionally, .deepPartial() has been removed due to its complex implementation and potential for misuse. (v4.zod.dev)

  6. Changes in z.number() and z.string() Methods:

    • z.number(): Infinite values (POSITIVE_INFINITY and NEGATIVE_INFINITY) are no longer considered valid.
    • z.string(): String formats like .email(), .uuid(), and .url() have been moved to the top-level z namespace, and the method forms (e.g., z.string().email()) are now deprecated. (v4.zod.dev)
  7. Deprecation of .merge() Method: The .merge() method on ZodObject has been deprecated in favor of .extend(), which provides the same functionality with better TypeScript performance. (v4.zod.dev)

These changes aim to improve the consistency and performance of Zod but may require code modifications when upgrading from version 3.24.3 to 4.0.14.

Citations:


Action Required: Address Zod v4.0.14 Breaking Changes

The dependency was upgraded from ^3.24.3 to 4.0.14, a major release that introduces several breaking changes. Please review and update all usages accordingly:

• Error API overhaul
– message parameter deprecated in favor of error
– Replace .format()/.flatten()with top-levelz.treeifyError()`

• Default behavior
– .default() now short-circuits on undefined, returning the default before parsing

• Object schemas
– .strict() and .passthrough() deprecated → use z.strictObject() / z.looseObject()
– .merge() deprecated → use .extend()
– .nonstrict() and .deepPartial() removed

• Primitive validators
– z.number() no longer allows Infinity/-Infinity
– String validators moved to top-level (e.g. use z.email(), z.url(), z.uuid() instead of z.string().email(), etc.)

Next steps:

  1. Search the codebase for all deprecated methods listed above.
  2. Replace with their v4 equivalents.
  3. Test parsing logic to ensure .default() changes don’t introduce regressions.
🤖 Prompt for AI Agents
In packages/common/package.json at line 41, the Zod dependency was upgraded from
version 3 to 4.0.14, which includes multiple breaking changes. You need to
search the entire codebase for deprecated Zod methods such as .format(),
.flatten(), .strict(), .passthrough(), .merge(), .nonstrict(), and
.deepPartial(), and replace them with their v4 equivalents like
z.treeifyError(), z.strictObject(), z.looseObject(), and .extend(). Also update
primitive validators to the new top-level methods and adjust any .default()
usage to account for its new short-circuit behavior. Finally, thoroughly test
all parsing logic to ensure no regressions occur due to these changes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already put this on my todo list, all the deprecated apis will be replaced in the next pr

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Friedrich482 Perfect! That's a smart approach to keep the scope of this PR focused while systematically addressing the Zod v4 migration in the next one. Thanks for confirming that the deprecated APIs are on your radar for the upcoming PR.

Looking forward to seeing the migration handled properly! 🐰

  /|   /|   
 ( :v:  ) 
  |(_)|

Comment thread packages/ui/src/components/ScrollToTopButton.tsx
- updated the import on the `formatZodError` function in the `getPeriodStoreValuesFromURL` in the dashboard
- removed the `legacy-peer-deps` annotation in the `.npmrc` file
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.

1 participant