Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CodeBlock class to accept rx.color in custom_style #3168

Merged
merged 9 commits into from
May 1, 2024

Conversation

khhan0130
Copy link
Contributor

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Changes the types accepted in the CodeBlock class (components/datadisplay/code.py) custom_style from Union[str, Var] to Union[str, Var, Color]. Fixes the issue where rx.color does not work in the markdown component map, at least for code blocks.

Includes one test under /tests/components/core/test_colors.py.
pytest passes the new tests, and there is one failure, although this was the case even before I made any changes.
A couple other changes were made with poetry run black reflex tests, which should not have any functional effect.

Fixes #2957 (hopefully)

@Lendemor
Copy link
Collaborator

As of a recent PR, we're not using black anymore (aside for .pyi files, but they're not edited manually anyway),
but ruff-format instead.

Run pre-commit on your PR to make it pass the tests.

@khhan0130
Copy link
Contributor Author

khhan0130 commented Apr 26, 2024

Hopefully I've fixed the issue. Let me know if there's still any problems.

Edit: Made a few more changes. Now, hopefully I've actually fixed the issues...

@khhan0130
Copy link
Contributor Author

The pre-commit check seems to be failing here, but it works on my end. Any ideas?
image

@picklelo
Copy link
Contributor

picklelo commented May 1, 2024

@khhan0130 I think you just need to run poetry run ruff --fix reflex. I tried to push to your PR but I got permission issues

@khhan0130
Copy link
Contributor Author

khhan0130 commented May 1, 2024

@picklelo Thanks. Think the issue was that I didn't update reflex with poetry install, so ruff was getting a TOML parse error. Think it should be fixed now.

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

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

thanks for adding! and for persisting with the linter :)

@picklelo picklelo merged commit be93b12 into reflex-dev:main May 1, 2024
46 checks passed
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.

rx.color does not work in markdown component map
3 participants