add CodeExample widget with tabs and syntax highlighting#395
Merged
JeremyDev87 merged 1 commit intomasterfrom Feb 15, 2026
Merged
add CodeExample widget with tabs and syntax highlighting#395JeremyDev87 merged 1 commit intomasterfrom
JeremyDev87 merged 1 commit intomasterfrom
Conversation
…ighting Implement the CodeExample widget with before/after code comparison, syntax highlighting via prism-react-renderer, and copy-to-clipboard functionality. Includes tab navigation, i18n support for 5 languages, accessibility improvements, and comprehensive tests. Closes #316
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the CodeExample widget for the landing page, providing before/after code comparison to showcase the value of Codingbuddy.
prism-react-renderermotion-reduce:transition-none,focus-visiblering on TabsContent)CodeExamplePropstype by removingbeforeCode/afterCodeprops (data is now self-contained)CodeExample/directory with per-component test filesChanges
New Files
widgets/CodeExample/data/examples.ts- Before/after code example datawidgets/CodeExample/lib/copyToClipboard.ts- Clipboard utilitywidgets/CodeExample/ui/CodeBlock.tsx- Syntax-highlighted code block componentwidgets/CodeExample/ui/CopyButton.tsx- Copy button with feedback states__tests__/widgets/CodeExample/CodeExample.test.tsx- Widget integration tests__tests__/widgets/CodeExample/CodeBlock.test.tsx- CodeBlock unit tests__tests__/widgets/CodeExample/CopyButton.test.tsx- CopyButton unit tests__tests__/widgets/CodeExample/copyToClipboard.test.ts- Clipboard utility testsModified Files
widgets/CodeExample/index.tsx- Full rewrite with tabs, syntax highlighting, i18ncomponents/ui/tabs.tsx- Accessibility improvementstypes/widgets.ts- Simplified CodeExampleProps to WidgetProps aliassrc/app/[locale]/@code_example/page.tsx- Simplified slot (no more code props)messages/{en,ko,ja,zh-CN,es}.json- Updated codeExample i18n keyspackage.json- Addedprism-react-rendererdependency__tests__/__helpers__/next-intl-mock.ts- Namespace-aware mock for multiple widgetsTest Plan
yarn workspace landing-page test- all tests passyarn workspace landing-page build- build succeedsCloses #316