refactor: move color_u32/color_from_vec4 out of types.py - #14
Merged
Conversation
types.py is meant to hold shared data types (TelegramSource, CemiRecord, etc.), but the two imgui color-conversion helpers meant every importer pulled in imgui_bundle even for a plain dataclass. Moved them to a new dependency-free knx_gui/color.py. Fixes #13
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
types.pyis meant to hold shared data types (TelegramSource,CemiRecord,TelegramRecord, etc.), but it also defined two imgui color-conversion helpers (color_u32,color_from_vec4) — the only use ofimguiin the whole file. Anything importingtypes.pyfor a plain dataclass pulled inimgui_bundletoo.knx_gui/color.py, updated the 3 actual importers (plugins/connection/plugin.py,plugins/network/ui.py,plugins/node_editor/ui.py— 2 other files flagged in Move color_u32/color_from_vec4 out of types.py #13 turned out to be false positives from grepping the rawimgui.get_color_u32API name, not the helper).types.pyis now fully imgui-free.Fixes #13
Test plan
uv run ruff check/ruff format --checkcleanuv run pyright— 0 errorsuv run pytest— 231 passed