Show pending channel migration status on Thread config page#51608
Open
raman325 wants to merge 6 commits intohome-assistant:devfrom
Open
Show pending channel migration status on Thread config page#51608raman325 wants to merge 6 commits intohome-assistant:devfrom
raman325 wants to merge 6 commits intohome-assistant:devfrom
Conversation
Add an alert banner inside the network card that displays when a Thread channel change is in progress, with a live countdown timer and cancel button. Uses hybrid approach: client-side countdown for responsiveness with periodic server sync every 30s for accuracy. Requires new backend WebSocket commands (otbr/get_pending_dataset and otbr/delete_pending_dataset) to be implemented in home-assistant core. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show current and target channels with bold formatting and arrow separator. Add "migration in" prefix before the countdown timer. Fix alert overlap with border router count by adding margin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Open
11 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds UI feedback to the Thread integration config page so users can see (and cancel) an in-progress/pending OTBR channel migration, including a live countdown and periodic server re-sync to keep the timer accurate.
Changes:
- Added new translation strings for pending channel change status, countdown formatting, cancel action, and completion message.
- Implemented pending channel migration alert banner with client-side ticking + periodic refresh and a cancel action.
- Added OTBR WebSocket helpers/types to fetch and delete the pending dataset.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/translations/en.json |
Adds new UI strings for the pending channel migration alert and countdown formatting. |
src/panels/config/integrations/integration-panels/thread/thread-config-panel.ts |
Renders a pending migration banner, manages countdown/sync timers, and adds cancel handling for pending channel changes. |
src/data/otbr.ts |
Adds OTBRPendingDataset plus WS helpers to get/delete pending datasets. |
- Wrap countdown timer in aria-hidden span for screen reader compat - Guard setTimeout callback with isConnected check - Defer refresh to after tick loop to avoid multiple refreshes - Clear pending state and timers when otbrInfo unavailable - Use localized error title for cancel failure dialog - Change "migration" to "cutover" in countdown text - Fix prettier formatting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace custom tick-based countdown with hui-timestamp-display component that manages its own per-second updates internally. Store end_time (Date) instead of decrementing delay. Use setTimeout for completion detection instead of per-second tick checking. This removes ~60 lines of timer management code (countdown interval, tick handler, timer update logic) in favor of the existing HA component. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove success state, completion migrations tracking, and sync interval. The alert simply disappears when the timer expires and _refresh() is called. Inline the completion scheduling into _refreshPendingDatasets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
simplified the implementation:
screenshot updated |
MindFreeze
approved these changes
Apr 19, 2026
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.
Proposed change
When a Thread channel change is initiated, the OTBR schedules a migration with a delay (default 5 minutes). Currently, once the user confirms the channel change, there is no visual indication that a migration is in progress. This PR adds a persistent alert banner inside the network card that shows:
hui-timestamp-displaycomponent with relative time formatting (auto-localized)The implementation uses
hui-timestamp-displayfor self-updating countdown rendering and a periodic server sync (every 30 seconds) to stay accurate and detect external cancellations. When the countdown reaches zero, a brief success message appears before the alert auto-clears.Screenshots
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: