Skip to content

feat: add sync_status to dashboard cards with per-state styling#1065

Merged
raman325 merged 2 commits intomainfrom
feat/sync-status-dashboard
Apr 20, 2026
Merged

feat: add sync_status to dashboard cards with per-state styling#1065
raman325 merged 2 commits intomainfrom
feat/sync-status-dashboard

Conversation

@raman325
Copy link
Copy Markdown
Owner

Proposed change

Adds granular sync status display to both dashboard cards, leveraging the new sync_status attribute from #1062.

Slot card:

  • Distinct icons per sync state: check-circle (in sync), clock-outline (out of sync), sync (syncing), alert-circle (suspended)
  • Color-coded: green, orange, orange, red respectively
  • Shows "Suspended" text instead of last-synced time when suspended
  • Status text inherits the state color for emphasis

Lock-codes card:

  • Red warning banner "Sync suspended — lock is unreachable" when the lock's slot sync managers are suspended
  • Card border turns red with reduced opacity for visual emphasis

Backend:

  • sync_status field added to subscribe_lock_codes websocket response when suspended

TypeScript types:

  • sync_status?: string added to SlotCardLockStatus and LockCoordinatorData interfaces

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Slot card:
- Shows distinct icons per sync state (check-circle, clock-outline,
  sync, alert-circle)
- Color-coded: green (in sync), orange (out of sync/syncing),
  red (suspended)
- Status text shows "Suspended" instead of last-synced time when
  suspended

Lock-codes card:
- Warning banner "Sync suspended — lock is unreachable" when
  coordinator has slot_sync_mgrs_suspended set
- Card border turns red with reduced opacity for visual emphasis

Backend:
- sync_status included in subscribe_lock_codes response when suspended

Entire-Checkpoint: 06fd64996697
Copilot AI review requested due to automatic review settings April 20, 2026 17:38
@github-actions github-actions Bot added python Pull requests that update Python code javascript Pull requests that update javascript code enhancement New feature or request labels Apr 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.43%. Comparing base (1d71a2b) to head (2b9a8d4).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1065      +/-   ##
==========================================
+ Coverage   95.28%   95.43%   +0.15%     
==========================================
  Files          45       45              
  Lines        4962     4994      +32     
  Branches      495      503       +8     
==========================================
+ Hits         4728     4766      +38     
+ Misses        234      228       -6     
Flag Coverage Δ
python 97.14% <100.00%> (+<0.01%) ⬆️
typescript 90.84% <100.00%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
custom_components/lock_code_manager/websocket.py 97.38% <100.00%> (+0.01%) ⬆️
ts/lock-codes-card.styles.ts 100.00% <ø> (ø)
ts/lock-codes-card.ts 86.62% <100.00%> (+0.15%) ⬆️
ts/shared-styles.ts 100.00% <ø> (ø)
ts/slot-card.styles.ts 100.00% <ø> (ø)
ts/slot-card.ts 89.40% <100.00%> (+1.54%) ⬆️
ts/types.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

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

Adds granular sync-status display to Lock Code Manager’s Lovelace cards (slot + lock-codes), using the new sync_status attribute and a suspended-state banner, plus backend websocket support to surface suspension state.

Changes:

  • Slot card: render per-lock sync state with distinct icons/text, and special handling for suspended (hide last-synced time).
  • Lock-codes card: show a “Sync suspended — lock is unreachable” banner and suspended card styling.
  • Backend/types/styles: extend TS interfaces and websocket subscribe_lock_codes payload to include sync_status when suspended; add shared error color + new status indicator classes.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ts/types.ts Extends frontend data contracts with optional sync_status.
ts/slot-card.ts Uses sync_status to pick icon/text/state classes; suppresses last-synced when suspended.
ts/slot-card.styles.ts Adds styling hooks for suspended/syncing status text.
ts/shared-styles.ts Introduces --lcm-error-color and shared .lcm-sync-icon classes for new states.
ts/lock-codes-card.ts Adds suspended detection and banner rendering.
ts/lock-codes-card.styles.ts Adds suspended border/opacity styling and banner styles.
custom_components/lock_code_manager/websocket.py Adds sync_status: "suspended" to subscribe_lock_codes response when slot sync is suspended.
custom_components/lock_code_manager/www/generated/lock-code-manager.js Regenerates bundled frontend to include the new UI/typing/styling changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ts/slot-card.styles.ts
Comment thread ts/slot-card.ts
Comment thread ts/lock-codes-card.ts
Comment thread custom_components/lock_code_manager/websocket.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 7781fc868eea
@raman325 raman325 force-pushed the feat/sync-status-dashboard branch from 0a5d207 to 2b9a8d4 Compare April 20, 2026 19:33
@raman325 raman325 merged commit bc5acfc into main Apr 20, 2026
20 checks passed
@raman325 raman325 deleted the feat/sync-status-dashboard branch April 20, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update javascript code python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants