Skip to content

fix(cli): add missing chart types to plugin list command - #666

Merged
alfredo1996 merged 1 commit into
release/2.0from
fix/issue-662-cli-plugin-list
May 2, 2026
Merged

fix(cli): add missing chart types to plugin list command#666
alfredo1996 merged 1 commit into
release/2.0from
fix/issue-662-cli-plugin-list

Conversation

@alfredo1996

@alfredo1996 alfredo1996 commented May 2, 2026

Copy link
Copy Markdown
Owner

Closes #662

Summary

  • Added circle-packing and choropleth to the hardcoded builtInCharts array in cli/src/commands/plugin.ts
  • Updated comment to reference the canonical source: app/src/plugins/chart-types.ts

Test plan

  • npx tsc --noEmit -p cli/tsconfig.json passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Two new chart types are now available in the plugin system: circle-packing and choropleth. These additions expand your visualization capabilities and provide new options for data presentation and analysis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown

Walkthrough

The runPluginList function's built-in chart registry in cli/src/commands/plugin.ts is updated to include two missing chart types ("circle-packing" and "choropleth") and a synchronization comment referencing the canonical source app/src/plugins/chart-types.ts is added.

Changes

Built-in Chart Registry Sync

Layer / File(s) Summary
Sync Documentation
cli/src/commands/plugin.ts
Comment updated to explicitly require keeping builtInCharts in sync with app/src/plugins/chart-types.ts.
Chart Type Registry
cli/src/commands/plugin.ts
builtInCharts array extended with "circle-packing" and "choropleth" chart types.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #662: it adds missing chart types but does not fully implement the proposed solution of importing from chart-types.ts. Consider importing the chart types from the canonical source app/src/plugins/chart-types.ts instead of maintaining a separate hardcoded array.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding missing chart types (circle-packing and choropleth) to the plugin list command.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the missing chart types in the plugin list command; no out-of-scope changes detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-662-cli-plugin-list

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@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.

🧹 Nitpick comments (1)
cli/src/commands/plugin.ts (1)

137-159: ⚡ Quick win

Avoid duplicating the built-in chart list here.

Adding the missing chart types fixes today’s gap, but builtInCharts is still a second source of truth. The next chart addition can drift again unless the CLI reads from the canonical app/src/plugins/chart-types.ts list directly.

♻️ Suggested change
-  // Keep in sync with app/src/plugins/chart-types.ts
-  const builtInCharts = [
-    "bar",
-    "line",
-    "pie",
-    "table",
-    "single-value",
-    "graph",
-    "map",
-    "json",
-    "parameter-select",
-    "form",
-    "markdown",
-    "iframe",
-    "gauge",
-    "sankey",
-    "sunburst",
-    "radar",
-    "treemap",
-    "gantt",
-    "circle-packing",
-    "choropleth",
-  ];
+  import { CHART_TYPES } from "../../app/src/plugins/chart-types.js";
+  const builtInCharts = [...CHART_TYPES];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/commands/plugin.ts` around lines 137 - 159, Replace the duplicated
builtInCharts array with a single import of the canonical chart types export
from the chart-types module and use that exported list wherever builtInCharts is
referenced; specifically remove the local builtInCharts constant and import the
exported chart-types value (e.g., exported const chartTypes) and assign or
re-export it so functions that reference builtInCharts continue to work, and add
a small runtime check (throw or log) if the imported list is missing or not an
array to fail fast.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cli/src/commands/plugin.ts`:
- Around line 137-159: Replace the duplicated builtInCharts array with a single
import of the canonical chart types export from the chart-types module and use
that exported list wherever builtInCharts is referenced; specifically remove the
local builtInCharts constant and import the exported chart-types value (e.g.,
exported const chartTypes) and assign or re-export it so functions that
reference builtInCharts continue to work, and add a small runtime check (throw
or log) if the imported list is missing or not an array to fail fast.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 30221794-36cd-4c55-b260-f11f415ecca5

📥 Commits

Reviewing files that changed from the base of the PR and between 1b8c880 and 636f20b.

📒 Files selected for processing (1)
  • cli/src/commands/plugin.ts

@sonarqubecloud

sonarqubecloud Bot commented May 2, 2026

Copy link
Copy Markdown

@alfredo1996
alfredo1996 merged commit c2e123c into release/2.0 May 2, 2026
10 of 13 checks passed
@alfredo1996
alfredo1996 deleted the fix/issue-662-cli-plugin-list branch May 16, 2026 17:47
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