Skip to content

remove rich#5033

Closed
adhami3310 wants to merge 12 commits intomainfrom
karl-marx
Closed

remove rich#5033
adhami3310 wants to merge 12 commits intomainfrom
karl-marx

Conversation

@adhami3310
Copy link
Copy Markdown
Member

there are a few remaining [bold]

Comment thread reflex/utils/console.py Fixed
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 26, 2025

CodSpeed Performance Report

Merging #5033 will not alter performance

Comparing karl-marx (34bb97f) with main (07e056c)

Summary

✅ 12 untouched benchmarks

Comment thread reflex/utils/console.py Dismissed
Comment thread reflex/utils/console.py Dismissed
Comment thread reflex/utils/console.py
@staticmethod
def _moveup(lines: int):
for _ in range(lines):
sys.stdout.write("\x1b[A")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this kind of stuff go to stderr? or maybe take a stream field so its easier to change later

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

does windows even support these ANSI codes reliably?

rich was at least giving us a cross platform abstraction

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's not per OS, more like, per terminal

Comment thread reflex/utils/exec.py
console.print(
f"App running at: [bold green]{url}[/bold green]{' (Frontend-only mode)' if not backend_present else ''}"
"App running at: "
+ colored(url, "green", attrs=("bold",))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

underline on the link would be nice

Comment thread reflex/utils/console.py
msg = colored(msg, color, attrs=["bold"] if bold else [])

if IS_REPRENTER_ACTIVE:
print("\n" + msg, flush=True, **kwargs) # noqa: T201
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this doesn't seem like quite the right logic. it causes a bunch of log lines interleaved with status messages. in rich the printed lines seem to go above the status line without leaving artifacts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this doesn't seem like quite the right logic. it causes a bunch of log lines interleaved with status messages. in rich the printed lines seem to go above the status line without leaving artifacts.

this is actually not my experience, in mine i get double progress bars whenever i hit a deprecation warning or such, with rich

@masenf
Copy link
Copy Markdown
Collaborator

masenf commented Mar 27, 2025

overall i'm a little hesitant on this change still.

image

it needs more testing on different platforms and with different log levels

@masenf
Copy link
Copy Markdown
Collaborator

masenf commented Mar 6, 2026

Thank you for contributing to Reflex. I am closing this old or stale PR for now, but please refresh and reopen it if you believe this issue is still relevant.

@masenf masenf closed this Mar 6, 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.

3 participants