Skip to content

feat(dashboard-editor): add WebSocket config, HITL proposals, and structured preview#30

Merged
dimakis merged 2 commits intomainfrom
feat/dashboard-editor-v2
Feb 14, 2026
Merged

feat(dashboard-editor): add WebSocket config, HITL proposals, and structured preview#30
dimakis merged 2 commits intomainfrom
feat/dashboard-editor-v2

Conversation

@dimakis
Copy link
Owner

@dimakis dimakis commented Feb 14, 2026

Summary

  • WebSocket client: Add lightweight ws_command() helper for one-shot HA WebSocket operations (connect, auth, command, close). Used for Lovelace dashboard config where REST API returns 404 but WebSocket works.
  • Dashboard read/write: get_dashboard_config() now uses WebSocket as primary with REST fallback; new save_dashboard_config() deploys via WebSocket lovelace/config/save.
  • HITL dashboard proposals: New DASHBOARD proposal type with dashboard_config JSONB column, Alembic migration, seek_approval + deploy route support. Dashboard edits go through approval workflow before deployment.
  • Editor submit flow: Dashboard editor YAML submit parses, validates, and creates a dashboard proposal via POST /proposals. Inline success/error feedback.
  • Structured preview: Collapsible tree panel showing dashboard structure (views -> sections -> cards) with types, titles, and entity references.
  • Proposals UI: Dashboard icon (LayoutDashboard), type label, and dashboard_config field added to Proposals page components.
  • Gaps closed: lovelace/config read/write gap removed from src/ha/gaps.py.

Test plan

  • Unit tests for WebSocket client (7 tests: happy path, auth errors, command errors, timeout, connection failure, save, cleanup)
  • Unit tests for dashboard config read/write (16 tests: WS primary, REST fallback, save, error handling, _get_ws_url)
  • Unit tests for DASHBOARD proposal type (7 tests: enum, config field, YAML generation)
  • Unit tests for seek_approval dashboard flow (2 tests: create + validation)
  • Unit tests for dashboard deploy route (1 test: WS save dispatch)
  • All existing proposal tests updated with dashboard_config fixture field (41 tests pass)
  • make ci-local passes (2741 tests, ruff, mypy, bandit all green)

Made with Cursor

dimakis and others added 2 commits February 14, 2026 16:15
…ype safety

- Extract BaseAgent and AgentContext from agents/__init__.py into agents/base.py
  (reduces __init__.py from 502 to ~50 lines of re-exports)
- Extract LibrarianAgent into agents/librarian.py alongside LibrarianWorkflow
- Extract get_all_tools/get_architect_tools from tools/__init__.py into tools/registry.py
  (reduces __init__.py from 212 to ~100 lines)
- Fix circular imports: 5 agent submodules now import BaseAgent from agents.base
- Centralize test auth helpers (make_test_settings, make_test_jwt) in tests/helpers/auth.py
  (deduplicates ~360 lines across 12 test files)
- Replace unsafe asyncio.sleep(10) with Event.wait() in timeout tests
- Fix mypy errors in tools/registry.py and reduce mypy override list by 5 modules
- Fix import sorting and missing __all__ exports

Co-authored-by: Cursor <cursoragent@cursor.com>
…uctured preview

- Add lightweight WebSocket client (ws_command) for HA one-shot commands
- Implement dashboard config read via WS with REST fallback, write via WS
- Add DASHBOARD proposal type with dashboard_config JSONB column + migration
- Extend seek_approval tool and deploy route for dashboard proposals
- Wire editor submit to create HITL dashboard proposals
- Add collapsible structure preview panel (views -> sections -> cards)
- Add dashboard icon/type to Proposals page
- Close lovelace/config read/write gap in gaps registry

Co-authored-by: Cursor <cursoragent@cursor.com>
@dimakis dimakis merged commit 9f352e8 into main Feb 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant