Conversation
…eModel for the screen dict in techui-support yaml entities
Also added new 'base_prefix' computed value for Entity to just return the PV prefix without any colons or suffixes
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #276 +/- ##
==========================================
- Coverage 96.55% 96.27% -0.29%
==========================================
Files 17 17
Lines 1075 1101 +26
==========================================
+ Hits 1038 1060 +22
- Misses 37 41 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Screen labels leak between mappings, and existing suffixes support mappings lose their overrides.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Refactors entity lookup to use full PV keys while supporting root-prefix discovery.
Changes:
- Adds full-PV entity registration and prefix lookup.
- Introduces typed support-screen mappings.
- Updates generator behavior and tests.
| File | Description |
|---|---|
src/techui_builder/builder.py |
Refactors entity storage and lookup. |
src/techui_builder/models.py |
Adds base prefixes and typed screen models. |
src/techui_builder/generate.py |
Uses typed screen mappings and macro overrides. |
src/techui_builder/utils.py |
Defines public module exports. |
tests/conftest.py |
Updates fixtures for new models. |
tests/test_builder.py |
Tests full and root-prefix lookups. |
tests/test_generate.py |
Updates typed screen access. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| screen_macros: Annotated[ | ||
| dict[str, str] | None, |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| .removesuffix(":") | ||
| ) | ||
| component.macros["label"] = component_name | ||
| if not self.label_flag: |
There was a problem hiding this comment.
Isn't this already in the previous PR that was approved and merged, is this branched from that?

Summary
Refactors the entity registry from root-PV-keyed to full-PV-keyed, enabling both direct lookups (e.g. BL19I-MO-DCM-01:BRAGG → single motor) and root-prefix lookups (e.g. BL19I-MO-DCM-01 → all motors) through a single helper method.
This supports a stripped-down techui.yaml where only custom components need explicit entries, while simple components are auto-discovered by root PV.
Changes
Entity.base_prefixcomputed propertydefaultdict[str, list[Entity]]→dict[str, Entity]; newget_entities_for_prefix()helper that collects from exact match + root-prefix children;create_screens()updated to use itbuilder_with_entitiesfixture and 4 tests covering single match, root+children, no-match, and root-without-root-entity