feat: react to pair-code consumption in hub pair dialog#224
Merged
Conversation
Wire up the DeviceUpdateType.Paired SignalR update (API #331): add HubPaired to HubUpdateType, track a per-hub paired counter in state, and have the pair-code dialog swap to a 'Hub paired' success state once its displayed code is consumed. Fixes #177
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit b1d960b on Jul 3, 2026 11:21am UTC. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a reactive “paired” success state to the hub pair-code dialog by listening for a new SignalR update that indicates a hub has consumed a pair code.
Changes:
- Introduces a reactive
hubPairedSignalscounter map and anotifyHubPairedhelper to signal pair-code consumption per hub. - Extends SignalR
HubUpdateTypewith a newHubPairedupdate and handles it without forcing a hub list refresh. - Updates the hub pair-code dialog to snapshot a baseline counter when generating a code and switch UI to a success state once consumption is detected.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/routes/(app)/hubs/data-table-actions.svelte | Makes the pair-code dialog reactively show a “paired” success state when the displayed code is consumed. |
| src/lib/state/hubs-state.svelte.ts | Adds shared reactive state (hubPairedSignals) and a notifier function for pair consumption events. |
| src/lib/signalr/models/HubUpdateType.ts | Adds the new HubPaired update type and includes it in the type guard. |
| src/lib/signalr/handlers/DeviceUpdate.ts | Handles HubPaired by notifying the UI instead of refreshing hub list state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
The hub pair-code dialog now reacts when its displayed code is consumed, showing a paired success state.
fixes #177