[Docs] Add annotations to all website examples#7110
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughAdds a new AnnotationsPanel component, exposes it as a selectable tool in the playground toolbar, extends the ToolType union to include 'annotations', and bumps the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CodeEditorWithPreview
participant ToolFrame
participant AnnotationsPanel
participant RechartsAnnotationsPortal
User->>CodeEditorWithPreview: open tools menu / select "Annotations"
CodeEditorWithPreview->>ToolFrame: activate tool 'annotations'
ToolFrame->>AnnotationsPanel: render panel component
AnnotationsPanel->>RechartsAnnotationsPortal: mount annotations portal
RechartsAnnotationsPortal-->>AnnotationsPanel: provide annotations UI
AnnotationsPanel-->>User: display annotations UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@www/src/components/Playground/ToolFrame.tsx`:
- Line 6: The example metadata type that defines defaultTool needs to include
'annotations' so examples can open the annotations panel by default: update the
union for the defaultTool property in the example metadata/type declaration (the
type used in www/src/docs/exampleComponents/types.ts, e.g. ExampleMeta or
ExampleComponentProps) to 'source' | 'devtools' | 'controls' | 'annotations' to
match ToolType, and ensure any related casts or usages (such as where
example.defaultTool is passed into CodeEditorWithPreview in APIViewNew or props
of CodeEditorWithPreview) accept the new union.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e3bb82d7-90b9-425c-963c-b1d99d2d8450
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
package.jsonwww/src/components/CodeEditorWithPreview.tsxwww/src/components/Playground/AnnotationsPanel.tsxwww/src/components/Playground/ToolFrame.tsx
| * The allowed types of tools in the playground. | ||
| */ | ||
| export type ToolType = 'source' | 'devtools' | 'controls'; | ||
| export type ToolType = 'source' | 'devtools' | 'controls' | 'annotations'; |
There was a problem hiding this comment.
Propagate 'annotations' to the example metadata type too.
Line 6 updates ToolType, but www/src/docs/exampleComponents/types.ts still restricts defaultTool to 'source' | 'devtools' | 'controls'. Because www/src/views/APIViewNew.tsx passes example.defaultTool through to CodeEditorWithPreview, examples still can't open the annotations panel by default.
Suggested follow-up change
- defaultTool?: 'source' | 'devtools' | 'controls';
+ defaultTool?: 'source' | 'devtools' | 'controls' | 'annotations';🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@www/src/components/Playground/ToolFrame.tsx` at line 6, The example metadata
type that defines defaultTool needs to include 'annotations' so examples can
open the annotations panel by default: update the union for the defaultTool
property in the example metadata/type declaration (the type used in
www/src/docs/exampleComponents/types.ts, e.g. ExampleMeta or
ExampleComponentProps) to 'source' | 'devtools' | 'controls' | 'annotations' to
match ToolType, and ensure any related casts or usages (such as where
example.defaultTool is passed into CodeEditorWithPreview in APIViewNew or props
of CodeEditorWithPreview) accept the new union.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7110 +/- ##
=======================================
Coverage 89.61% 89.61%
=======================================
Files 534 535 +1
Lines 40294 40315 +21
Branches 5492 5493 +1
=======================================
+ Hits 36109 36130 +21
Misses 4177 4177
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportBundle size has no change ✅ |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
1 similar comment
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
0ff63a7 to
c695cac
Compare
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
@ckifer have a look at the annotations and let me know what you think https://recharts.github.io/recharts/pr-7110/www/
|
|
@PavelVanecek they look pretty sweet! Dark mode not great tho lol |


Description
Docs only. 7 different annotation components with 3 different snapping modes.
There are some small bugs, I will fix that in the devtools repository.
Related Issue
Is this good enough to close #1678?
Summary by CodeRabbit
New Features
Chores