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
25.76k stars 795 forks source link

fix(tabbed content): prevent duplicate ids error #5216

Closed TomJGooding closed 2 weeks ago

TomJGooding commented 2 weeks ago

Fixes https://github.com/Textualize/textual/issues/5215 where removing then adding a pane could crash with a DuplicateIds exception.

Rather than assigning the ID based on the current tab count, this adds a _cumulative_tab_count to ensure added panes have a unique ID.

Please review the following checklist.

TomJGooding commented 2 weeks ago

This doesn't fix the highlighting issue when tabs are removed (https://github.com/Textualize/textual/issues/5215#issuecomment-2462555201), but that should probably be a separate issue/PR.