feat(a2ui): support markdown in text#2659
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughText component now supports markdown rendering via a new ChangesText Markdown Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
packages/genui/a2ui/src/catalog/Text/index.tsx (1)
46-51: ⚡ Quick winAdd JSX intrinsic element declaration for
x-markdowninstead of suppressing with@ts-expect-error.The suppression hides type regressions on this render path. Since
x-markdownis not currently declared inJSX.IntrinsicElements, you can augment the namespace locally in this file or a types file to enable type checking. For example:declare namespace JSX { interface IntrinsicElements { 'x-markdown': { content: string; [key: string]: any }; } }This allows TypeScript to verify the element and its props while you develop the markdown feature.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/genui/a2ui/src/catalog/Text/index.tsx` around lines 46 - 51, Replace the "`@ts-expect-error`" suppression by adding a JSX intrinsic element declaration for 'x-markdown' (so TypeScript can type-check the render path in the variant === 'markdown' branch). Add a local namespace augmentation (in this file or a nearby types file) that extends JSX.IntrinsicElements with 'x-markdown': { content: string; [key: string]: any }, then remove the `@ts-expect-error` and render <x-markdown content={text} /> normally; reference the 'x-markdown' element and the variant === 'markdown' branch in Text/index.tsx when applying the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/genui/a2ui/src/catalog/Text/index.tsx`:
- Around line 46-51: Replace the "`@ts-expect-error`" suppression by adding a JSX
intrinsic element declaration for 'x-markdown' (so TypeScript can type-check the
render path in the variant === 'markdown' branch). Add a local namespace
augmentation (in this file or a nearby types file) that extends
JSX.IntrinsicElements with 'x-markdown': { content: string; [key: string]: any
}, then remove the `@ts-expect-error` and render <x-markdown content={text} />
normally; reference the 'x-markdown' element and the variant === 'markdown'
branch in Text/index.tsx when applying the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 87113a1b-3748-4038-ae79-22df38f21429
📒 Files selected for processing (5)
packages/genui/a2ui-playground/src/catalog/a2ui.tspackages/genui/a2ui-playground/src/mock/a2ui-gallery/markdown-text.jsonpackages/genui/a2ui/src/catalog/Text/index.tsxpackages/genui/server/next-env.d.tspackages/genui/server/tsconfig.json
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Web Explorer#9996 Bundle Size — 901.94KiB (0%).a329fb0(current) vs dae1d41 main#9993(baseline) Bundle metrics
|
| Current #9996 |
Baseline #9993 |
|
|---|---|---|
45.06KiB |
45.06KiB |
|
2.22KiB |
2.22KiB |
|
0% |
0% |
|
9 |
9 |
|
11 |
11 |
|
229 |
229 |
|
11 |
11 |
|
27.19% |
27.19% |
|
10 |
10 |
|
0 |
0 |
Bundle size by type no changes
| Current #9996 |
Baseline #9993 |
|
|---|---|---|
497.56KiB |
497.56KiB |
|
402.16KiB |
402.16KiB |
|
2.22KiB |
2.22KiB |
Bundle analysis report Branch p/a2ui-markdown Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#8422 Bundle Size — 237.17KiB (0%).a329fb0(current) vs dae1d41 main#8419(baseline) Bundle metrics
|
| Current #8422 |
Baseline #8419 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
198 |
198 |
|
80 |
80 |
|
44.73% |
44.73% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #8422 |
Baseline #8419 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.42KiB |
91.42KiB |
Bundle analysis report Branch p/a2ui-markdown Project dashboard
Generated by RelativeCI Documentation Report issue
React External#1537 Bundle Size — 695.4KiB (0%).a329fb0(current) vs dae1d41 main#1534(baseline) Bundle metrics
|
| Current #1537 |
Baseline #1534 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
17 |
17 |
|
5 |
5 |
|
8.59% |
8.59% |
|
0 |
0 |
|
0 |
0 |
Bundle analysis report Branch p/a2ui-markdown Project dashboard
Generated by RelativeCI Documentation Report issue
React MTF Example#1555 Bundle Size — 208.12KiB (0%).a329fb0(current) vs dae1d41 main#1552(baseline) Bundle metrics
|
| Current #1555 |
Baseline #1552 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
193 |
193 |
|
77 |
77 |
|
44.24% |
44.24% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #1555 |
Baseline #1552 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
96.89KiB |
96.89KiB |
Bundle analysis report Branch p/a2ui-markdown Project dashboard
Generated by RelativeCI Documentation Report issue
React Example with Element Template#691 Bundle Size — 200.08KiB (0%).a329fb0(current) vs dae1d41 main#688(baseline) Bundle metrics
Bundle size by type
|
| Current #691 |
Baseline #688 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
54.32KiB |
54.32KiB |
Bundle analysis report Branch p/a2ui-markdown Project dashboard
Generated by RelativeCI Documentation Report issue
Merging this PR will improve performance by 6.02%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
Summary by CodeRabbit
Checklist