Skip to content

refactor(chart): migrate batch request chart to recharts#1161

Merged
mengxi-ream merged 4 commits intomainfrom
refactor/batch-request-chart-recharts
Mar 19, 2026
Merged

refactor(chart): migrate batch request chart to recharts#1161
mengxi-ream merged 4 commits intomainfrom
refactor/batch-request-chart-recharts

Conversation

@mengxi-ream
Copy link
Copy Markdown
Owner

@mengxi-ream mengxi-ream commented Mar 19, 2026

Type of Changes

  • ✨ New feature (feat)
  • πŸ› Bug fix (fix)
  • πŸ“ Documentation change (docs)
  • πŸ’„ UI/style change (style)
  • ♻️ Code refactoring (refactor)
  • ⚑ Performance improvement (perf)
  • βœ… Test related (test)
  • πŸ”§ Build or dependencies update (build)
  • πŸ”„ CI/CD related (ci)
  • 🌐 Internationalization (i18n)
  • 🧠 AI model related (ai)
  • πŸ”„ Revert a previous commit (revert)
  • πŸ“¦ Other changes that do not modify src or test files (chore)

Description

  • migrate the batch request statistics chart from @visactor/react-vchart to recharts
  • add shared chart UI primitives for the new Recharts-based card, legend, and tooltip styling
  • remove the obsolete chart theme provider and add the missing patch changeset for release automation
  • keep the follow-up lint and type-check fixes needed by the chart migration

Related Issue

How Has This Been Tested?

  • Added unit tests
  • Verified through manual testing
  • SKIP_FREE_API=true pnpm lint
  • SKIP_FREE_API=true pnpm type-check
  • SKIP_FREE_API=true pnpm test

Screenshots

  • Not included

Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly if necessary
  • My code follows the code style of this project
  • My changes do not break existing functionality
  • If my code was generated by AI, I have proofread and improved it as necessary.

Additional Information

  • The branch includes four commits: the Recharts migration, a lint follow-up, a type-check follow-up, and the new changeset.

Summary by cubic

Migrate the batch request statistics chart from @visactor/react-vchart to recharts, and introduce shared chart UI primitives for consistent legend/tooltip styling. Removes the old VChart theme provider and simplifies theming.

  • Refactors

    • Rebuilt the batch request chart with recharts (AreaChart, gradients, monotone lines, responsive layout).
    • Added shared ChartContainer, ChartTooltip(Content), ChartLegend(Content), and ChartStyle using CSS variables for light/dark themes.
    • Removed ChartThemeProvider and the VChart theme config; cleaned up options entrypoint.
    • Updated data shape to two series (originalRequest, batchRequest), sorted by day; tooltip uses thousands separators; dots show when only one point.
    • Minor fixes: stricter typing and a query meta type-guard in the selection toolbar; lint/type-check follow-ups.
  • Dependencies

    • Added recharts@^3.8.0; removed @visactor/react-vchart and @visactor/vchart.
    • Bumped several libs and tooling (e.g., @json-render/*, @openrouter/ai-sdk-provider, @orpc/client, @tanstack/react-query, shadcn, vite, eslint, wxt).
    • Added a patch changeset for @read-frog/extension.

Written for commit 70b0932. Summary will update on new commits.

Replace the batch request statistics chart with a Recharts implementation, remove the old VChart theme provider, and update the dependency lockfile for the charting change.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 19, 2026

πŸ¦‹ Changeset detected

Latest commit: 70b0932

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@read-frog/extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 19, 2026
@dosubot
Copy link
Copy Markdown

dosubot bot commented Mar 19, 2026

Documentation Updates

1 document(s) were updated by changes in this PR:

Build and Development Environment Setup
View Changes
@@ -390,8 +390,9 @@
 ## Dependency Management
 - **Pinned Versions:** All `@read-frog/*` dependencies are now pinned to specific versions (e.g., `@read-frog/[email protected]`) instead of using `latest`.
 - **Icon Strategy:** The extension uses bundled React icon components from `@remixicon/react` and `@tabler/icons-react` to avoid Content Security Policy (CSP) restrictions on dynamically loaded SVGs. For cases requiring dynamic icon loading via Iconify, the extension provides a background fetch proxy (see [Background Fetch Infrastructure](#background-fetch-infrastructure)).
-- **New Dependencies:** `tw-animate-css` is included for Tailwind animation utilities. `@remixicon/react` is included for Remix icon components.
-- **Removed:** `eslint-plugin-turbo` and related configuration have been removed. The `agentation` dev dependency has also been removed and replaced with a custom HelpButton component.
+- **Charting Library:** The project uses `recharts` (^3.8.0), a composable charting library built on React components, for rendering statistics charts such as the batch request chart.
+- **New Dependencies:** `tw-animate-css` is included for Tailwind animation utilities. `@remixicon/react` is included for Remix icon components. `recharts` is included for data visualization.
+- **Removed:** `eslint-plugin-turbo` and related configuration have been removed. The `agentation` dev dependency has also been removed and replaced with a custom HelpButton component. `@visactor/react-vchart` and `@visactor/vchart` have been removed in favor of `recharts`. The `effect` dependency has been removed.
 - **Syncpack:** Ensures consistent dependency versions. Use `pnpm syncpack:lint` to check and `pnpm syncpack:fix` to resolve mismatches.
 - **Changesets:** Handles versioning and changelogs.
 
@@ -405,7 +406,7 @@
   @source "../**/*.{ts,tsx}";
   ```
 
-- **Tailwind CSS version:** `4.2.1`
+- **Tailwind CSS version:** `4.2.2`
 
 ## Linting and Formatting
 - ESLint is managed centrally via the `@repo/eslint-config` workspace package. Each package or app extends this config as needed.
@@ -445,10 +446,10 @@
 - **Node.js version:** `>=22.0.0`
 - **pnpm version:** `10.32.1`
 - **TypeScript version:** `^5.9.3`
-- **Tailwind CSS version:** `4.2.1`
-- **ESLint version:** `^9.38.0`
-- **Vite version:** `^7.1.11` (where relevant)
-- **shadcn version:** `^3.8.5` (for UI component management)
+- **Tailwind CSS version:** `4.2.2`
+- **ESLint version:** `^10.0.3`
+- **Vite version:** `^8.0.0`
+- **shadcn version:** `^4.0.8` (for UI component management)
 - **Fumadocs, Next.js, and other major dependencies** are kept up to date. See individual `package.json` files for details.
 
 ## Internationalization (i18n)

How did I do? Any feedback?Β Β Join Discord

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid β€” if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/components/ui/base-ui/chart.tsx">

<violation number="1" location="src/components/ui/base-ui/chart.tsx:230">
P2: Use an explicit null/undefined check when rendering tooltip values; the current truthiness check hides valid `0` values.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

{itemConfig?.label || item.name}
</span>
</div>
{item.value && (
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

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

P2: Use an explicit null/undefined check when rendering tooltip values; the current truthiness check hides valid 0 values.

Prompt for AI agents
Check if this issue is valid β€” if so, understand the root cause and fix it. At src/components/ui/base-ui/chart.tsx, line 230:

<comment>Use an explicit null/undefined check when rendering tooltip values; the current truthiness check hides valid `0` values.</comment>

<file context>
@@ -0,0 +1,349 @@
+                              {itemConfig?.label || item.name}
+                            </span>
+                          </div>
+                          {item.value && (
+                            <span className="font-mono font-medium text-foreground tabular-nums">
+                              {valueFormatter
</file context>
Fix with Cubic

@mengxi-ream mengxi-ream merged commit fc167d6 into main Mar 19, 2026
7 checks passed
@mengxi-ream mengxi-ream deleted the refactor/batch-request-chart-recharts branch March 19, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant