[Docs] Add annotations to all website examples#7110
[Docs] Add annotations to all website examples#7110PavelVanecek wants to merge 3 commits intomainfrom
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds an Annotations panel component, integrates it into the playground toolbar, extends ToolType to include 'annotations', and updates the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ 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.62% 89.61% -0.01%
==========================================
Files 534 535 +1
Lines 40193 40315 +122
Branches 5465 5492 +27
==========================================
+ Hits 36024 36130 +106
- Misses 4161 4177 +16
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 36.39kB (0.73%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-treeshaking-cartesianAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-sankeyAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-polarAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-treemapAssets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-sunburstAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
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