Skip to content

Add code block integration coverage - #6520

Open
Alek99 wants to merge 5 commits into
mainfrom
issue-6484-code-block-tests
Open

Add code block integration coverage#6520
Alek99 wants to merge 5 commits into
mainfrom
issue-6484-code-block-tests

Conversation

@Alek99

@Alek99 Alek99 commented May 16, 2026

Copy link
Copy Markdown
Member

Summary

  • add Playwright coverage for rx.code_block rendering options, line numbers, wrapping, and copy buttons
  • ensure custom_style is passed through to react-syntax-highlighter as customStyle
  • preserve pre-wrap behavior when wrap_long_lines is enabled

Fixes #6484

Tests

  • uv run pytest tests/units/components/datadisplay/test_code.py
  • uv run pytest tests/integration/tests_playwright/test_code_block.py
  • uv run ruff check packages/reflex-components-code/src/reflex_components_code/code.py tests/integration/tests_playwright/test_code_block.py
  • uv run ruff format --check packages/reflex-components-code/src/reflex_components_code/code.py tests/integration/tests_playwright/test_code_block.py
  • uv run pyright packages/reflex-components-code/src/reflex_components_code/code.py
  • git diff --check

@codspeed-hq

codspeed-hq Bot commented May 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing issue-6484-code-block-tests (2589312) with main (333b78b)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@FarhanAliRaza
FarhanAliRaza marked this pull request as ready for review August 6, 2026 12:51
@FarhanAliRaza
FarhanAliRaza requested a review from a team as a code owner August 6, 2026 12:51
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds integration coverage for code-block rendering, wrapping, themes, line numbers, and copy buttons while improving reactive custom styles and preserving wrapping when code-tag properties are supplied.

  • Tracks state variables embedded in custom_style.
  • Merges whiteSpace: pre-wrap into compatible code-tag styles.
  • Adds unit and Playwright coverage for the affected behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-components-code/src/reflex_components_code/code.py Tracks reactive custom-style dependencies and merges pre-wrap styling into dictionary-based code-tag properties.
tests/integration/tests_playwright/test_code_block.py Adds browser coverage for code rendering, themes, line numbers, wrapping, custom props, and clipboard controls.
tests/units/components/datadisplay/test_code.py Adds unit coverage confirming that state dependencies embedded in custom styles are collected.
packages/reflex-components-code/news/6520.bugfix.md Documents the custom-style reactivity and wrapping fixes.

Reviews (5): Last reviewed commit: "Merge branch 'main' into issue-6484-code..." | Re-trigger Greptile

Comment thread packages/reflex-components-code/src/reflex_components_code/code.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 836335ec90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/reflex-components-code/src/reflex_components_code/code.py

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/reflex-components-code/src/reflex_components_code/code.py
Comment thread tests/integration/tests_playwright/test_code_block.py Outdated
Comment thread packages/reflex-components-code/src/reflex_components_code/code.py
FarhanAliRaza
FarhanAliRaza previously approved these changes Aug 6, 2026
@masenf masenf added the skip-changelog For doc/internal changes label Aug 6, 2026
The one-shot locator.evaluate() span check raced PrismAsyncLight's async
grammar load and consistently failed on CI runners; replace it with an
auto-waiting expect. Add the reflex-components-code news fragment
required by the changelog check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog For doc/internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration tests for rx.code_block

3 participants