Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
24.99k stars 764 forks source link

Visual glitch while switching radio buttons #4785

Open jakubziebin opened 1 month ago

jakubziebin commented 1 month ago

Hello, We have a problem with the RadioButtons buttons located in the RadioSet. When switching the buttons, sometimes the situation with the video appears. issue_textual.webm Unfortunately, it is not possible to reproduce the problem with MRE (or it is so difficult). We do a workaround for this problem by adding a refresh call in the watch__selected method. Workaround code:

class MyRadioSet(RadioSet):
    def watch__selected(self) -> None:
        super().watch__selected()
        self.refresh(layout=True)

Textual diagnose:

# Textual Diagnostics

## Versions

| Name    | Value  |
|---------|--------|
| Textual | 0.73.0 |
| Rich    | 13.7.0 |

## Python

| Name           | Value                                                  |
|----------------|--------------------------------------------------------|
| Version        | 3.10.6                                                 |
| Implementation | CPython                                                |
| Compiler       | GCC 11.4.0                                             |
| Executable     | /home/dev/.pyenv/versions/3.10.6/envs/clive/bin/python |

## Operating System

| Name    | Value                                                            |
|---------|------------------------------------------------------------------|
| System  | Linux                                                            |
| Release | 6.5.0-44-generic                                                 |
| Version | #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 |

## Terminal

| Name                 | Value          |
|----------------------|----------------|
| Terminal Application | GNOME Terminal |
| TERM                 | xterm-256color |
| COLORTERM            | truecolor      |
| FORCE_COLOR          | *Not set*      |
| NO_COLOR             | *Not set*      |

## Rich Console options

| Name           | Value                |
|----------------|----------------------|
| size           | width=133, height=43 |
| legacy_windows | False                |
| min_width      | 1                    |
| max_width      | 133                  |
| is_terminal    | True                 |
| encoding       | utf-8                |
| max_height     | 43                   |
| justify        | None                 |
| overflow       | None                 |
| no_wrap        | False                |
| highlight      | None                 |
| markup         | None                 |
| height         | None                 |
willmcgugan commented 1 month ago

@jakubziebin Without an MRE it is going to be difficult to diagnose.

I see you are doing some kind of customization, can you at least let us know what you changed over the defaults?