Skip to content

feat: react to pair-code consumption in hub pair dialog#224

Merged
hhvrc merged 2 commits into
developfrom
feat/pair-code-consumed-signal
Jul 3, 2026
Merged

feat: react to pair-code consumption in hub pair dialog#224
hhvrc merged 2 commits into
developfrom
feat/pair-code-consumed-signal

Conversation

@hhvrc

@hhvrc hhvrc commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The hub pair-code dialog now reacts when its displayed code is consumed, showing a paired success state.

fixes #177


Open in Stage

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
Copilot AI review requested due to automatic review settings July 3, 2026 11:17
@stage-review

stage-review Bot commented Jul 3, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 3 individual chapters for you:

Title
1 Define HubPaired update type
2 Manage hub pairing signals in state
3 Update pair dialog to react to consumption
Open in Stage

Chapters generated by Stage for commit b1d960b on Jul 3, 2026 11:21am UTC.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 hubPairedSignals counter map and a notifyHubPaired helper to signal pair-code consumption per hub.
  • Extends SignalR HubUpdateType with a new HubPaired update 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.

Comment thread src/lib/state/hubs-state.svelte.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@hhvrc hhvrc merged commit 46a12af into develop Jul 3, 2026
8 checks passed
@hhvrc hhvrc deleted the feat/pair-code-consumed-signal branch July 3, 2026 11:21
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.

Pair Code pop-ups should react when the displayed code is consumed

2 participants