enthought / enthought/traitsui
Refactor ui_panel.py and related code
- Dominant language
- Python
- Stars
- 306
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
The `ui_panel.py` and related modules (`ui_base.py`, `ui_modal.py`, `ui_live.py`) in the toolkit code are not good. This is a catch-all issue that we can use as a starting point for improvement:
- there is a lot of common code between backends
- the code is poorly organized, with many unrelated things in one file (as a concrete example "help" support should be popped out into it's own modules)
- the actual algorithms are not well factored (eg. multiple 50+ line methods)
- the classes are not well factored (a lot of subclassing where perhaps composition would be better)
- there are layout objects (eg. the "pseudo editors" GroupEditor subclasses) which might be good to have exposed and "live" modifiable. Currently they are created, used to help instantiate things, and then let drop. There is layout state that would be good to have access to from the `Handler` or `UI` classes to allow more dynamic control of layout.
- there are simple missing features in some backends
There are already a number of issues around this:
- #984
- #786
- #474
- #468
- #381
- #464 (this is the `_copy_context` method in `ui_modal.py`)
- #814
- #522
And probably a number more.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.