Skip to content

fix: add missing code block props#208

Closed
lawreka wants to merge 5 commits intomainfrom
kathryn/update-codeblock
Closed

fix: add missing code block props#208
lawreka wants to merge 5 commits intomainfrom
kathryn/update-codeblock

Conversation

@lawreka
Copy link
Contributor

@lawreka lawreka commented Mar 10, 2026

Summary

parent CodeBlock that is exported was missing a few props (isParentCodeGroup and shouldHighlight) - it should pass all of its props to the Base Code Block component. slightly refactors the props destructuring

Test Plan

  • all code block stories looking good

Note

Low Risk
Small wrapper-component fix that mainly affects prop forwarding and conditional rendering, with limited blast radius to code-block UI behavior.

Overview
Fixes the exported CodeBlock wrapper to expose and forward additional props (isParentCodeGroup, shouldHighlight) by passing the full params through to BaseCodeBlock instead of selectively overriding props.

Also updates askAiButton rendering to consistently respect hideAskAiButton in both header and floating-button layouts, and slightly refactors prop destructuring to avoid dropping/duplicating values.

Written by Cursor Bugbot for commit d7e94af. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

children?: ReactNode;
copyButtonProps?: CopyToClipboardButtonProps;
isParentCodeGroup?: boolean;
shouldHighlight?: boolean;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant prop declarations in extending interface

Low Severity

Adding isParentCodeGroup and shouldHighlight to CodeBlockProps creates redundancy with BaseCodeBlockProps, which extends CodeBlockProps and re-declares the exact same two properties. Only forceExtract is actually unique to BaseCodeBlockProps. If the types diverge in the future (e.g., one becomes required), the override in BaseCodeBlockProps could silently mask the change.

Fix in Cursor Fix in Web

@lawreka
Copy link
Contributor Author

lawreka commented Mar 10, 2026

closing to take another approach

@lawreka lawreka closed this Mar 10, 2026
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