Skip to content

Fix/homie schema panel size#27

Merged
cayossarian merged 16 commits intomainfrom
fix/homie-schema-panel-size
Apr 20, 2026
Merged

Fix/homie schema panel size#27
cayossarian merged 16 commits intomainfrom
fix/homie-schema-panel-size

Conversation

@cayossarian
Copy link
Copy Markdown
Member

No description provided.

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 circuit space.format range based on total_tabs and recompute typesSchemaHash from the rendered types content.
  • Enforce stricter total_tabs lifecycle/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.

@cayossarian cayossarian merged commit 3fe843a into main Apr 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants