Merged
Conversation
Each panel now receives a size-specific rendered schema via render_for_panel. _PANEL_SIZE_TO_MODEL is indexed directly so unsupported tab counts raise KeyError immediately rather than silently falling through to MAIN_32.
…total_tabs Stop orphan panels on unsupported total_tabs: move _PANEL_SIZE_TO_MODEL lookup and render_for_panel before self._panels / self._serial_to_panel registration; wrap in try/except that calls panel.stop() on failure. Add PanelInstance.total_tabs property mirroring serial_number pattern. Remove the defensive-cleanup loop from the unsupported-size test and assert no panel is registered after the KeyError. Hoist inline imports in test_bootstrap_single.py to module level.
There was a problem hiding this comment.
Pull request overview
This PR updates the simulator to serve Homie schema content that matches each panel’s configured tab count (e.g., 40/48 tabs), and improves robustness around panel startup/reload failures by tracking errors per config and continuing reload processing.
Changes:
- Add
render_for_panel()to patch the circuitspace.formatrange based ontotal_tabsand recomputetypesSchemaHashfrom the renderedtypescontent. - Enforce stricter
total_tabslifecycle/validation: engine raises before initialization; unsupported sizes fail at start time and do not register panels. - Make reload resilient to per-config failures and surface per-panel start errors in the dashboard list.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/span_panel_simulator/schema.py |
Adds schema rendering per panel size and content-derived hashing. |
src/span_panel_simulator/app.py |
Renders per-panel schema at startup; validates supported sizes; reload continues on per-path failures and records errors. |
src/span_panel_simulator/engine.py |
Makes total_tabs strict post-initialization and uses required config key access for snapshots/unmapped tabs. |
src/span_panel_simulator/panel.py |
Adds guarded total_tabs property mirroring serial_number lifecycle behavior. |
src/span_panel_simulator/dashboard/routes.py |
Injects per-filename startup errors into panel list view model. |
src/span_panel_simulator/dashboard/context.py |
Extends dashboard context with get_panel_start_errors. |
src/span_panel_simulator/dashboard/templates/partials/panels_list_rows.html |
Displays an error badge with hover text when a panel has a start error. |
src/span_panel_simulator/dashboard/static/dashboard.css |
Styles the new error badge. |
tests/test_schema.py |
Adds coverage for schema rendering, hash derivation, determinism, and non-mutation. |
tests/test_bootstrap_single.py |
Verifies schema endpoint serves rendered format/hash for a 40-tab schema. |
tests/test_panel.py |
Tests strict total_tabs lifecycle and 40-tab snapshot model/size behavior. |
tests/test_app.py |
Tests unsupported sizes fail without registration and that reload continues despite peer failures. |
pyproject.toml / src/span_panel_simulator/__init__.py / add-on metadata |
Version bump to 1.0.11 and Python requirement alignment. |
span_panel_simulator/CHANGELOG.md |
Documents behavior changes and fixes. |
uv.lock |
Updates lock metadata/artifacts consistent with Python 3.12 support and dependencies. |
AGENTS.md / CLAUDE.md |
Formatting-only updates. |
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.
No description provided.