fix: paired device removal and improve widget functionality#40
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the mobile/desktop pairing UX and expands the widget/usage pipeline to include 7‑day utilization (notably for Codex), while also improving paired-device removal behavior.
Changes:
- Add 7‑day usage fields (Claude Code + Codex) to widget data, push payloads, and UI rendering.
- Make paired device/desktop removal “optimistic” (remove from UI immediately, then best-effort notify + disconnect).
- Add local rename support and show paired relay host info in Settings UIs.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| RxCodeWidget/RxCodeWidgetData.swift | Extends widget snapshot model to include weekly usage fields. |
| RxCodeWidget/RxCodeWidget.swift | Renders both 5h and 7d usage bars; updates previews/placeholder data. |
| RxCodeMobile/Views/MobileSettingsView.swift | Adds rename UI, shows relay host, and updates Codex usage display to 7-day. |
| RxCodeMobile/State/MobileAppState+Sync.swift | Includes weekly usage in widget snapshot; makes unpair/removal optimistic. |
| RxCodeMobile/State/MobileAppState+Persistence.swift | Persists relay URL and adds local rename for paired desktops. |
| RxCodeMobile/State/MobileAppState+Inbound.swift | Records relay URL when pairing is accepted; logs relay info. |
| RxCodeMobile/State/MobileAppState.swift | Adds relayURL + relayDisplayName to paired desktop model. |
| RxCodeMobile/AppDelegate.swift | Applies weekly usage fields from background widget push payloads. |
| RxCode/Views/Settings/MobileSettingsTab.swift | Adds rename UI and relay host display for paired mobile devices. |
| RxCode/Services/MobileSyncService+LiveActivity.swift | Sends weekly usage in widget snapshot APNs payload. |
| RxCode/Services/MobileSyncService.swift | Updates usage provider shape; optimistic unpair; adds rename + relay URL persistence. |
| RxCode/Services/CodexAppServer+Process.swift | Updates logging to reflect 7-day usage. |
| RxCode/Services/CodexAppServer+Parsing.swift | Parses 7-day Codex rate limit window and resets timestamp. |
| RxCode/App/RxCodeApp.swift | Switches Codex secondary limit label/value to 7-day. |
| RxCode/App/AppState+Lifecycle.swift | Provides weekly usage values to MobileSyncService widget snapshot provider. |
| Packages/Tests/RxCodeSyncTests/PayloadTests.swift | Updates payload decoding expectations for Codex 7-day usage. |
| Packages/Sources/RxCodeSync/Protocol/Payload.swift | Updates documentation to reflect Codex 7-day usage. |
| Packages/Sources/RxCodeSync/APNs/EncryptedAlert.swift | Extends widget snapshot payload schema + initializer for weekly usage. |
| Packages/Sources/RxCodeChatKit/StatusLineView.swift | Updates Codex UI segment from 24h to 7d usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+141
to
+152
| // 5-hour usage with solid bar | ||
| usageBarRow( | ||
| period: "5h", | ||
| percent: fiveHour, | ||
| barStyle: .solid | ||
| ) | ||
| // 7-day usage with striped/dimmed bar | ||
| usageBarRow( | ||
| period: "7d", | ||
| percent: weekly, | ||
| barStyle: .dimmed | ||
| ) |
Comment on lines
291
to
+298
| /// Remove a paired device and notify it before forgetting its pubkey. | ||
| func unpair(_ device: PairedDevice) async { | ||
| try? await client.send(.unpair(UnpairPayload(reason: "desktop")), toHex: device.pubkeyHex) | ||
| pairedDevices.removeAll { $0.pubkeyHex == device.pubkeyHex } | ||
| let pubkeyHex = device.pubkeyHex | ||
|
|
||
| // Optimistically remove from UI first for immediate feedback | ||
| pairedDevices.removeAll { $0.pubkeyHex == pubkeyHex } | ||
| savePairedDevices() | ||
| subscribedSessions.removeValue(forKey: pubkeyHex) |
Comment on lines
+72
to
73
| let sevenDay = windows.first { $0.durationMinutes == 10_080 } | ||
| ?? windows.first { $0.durationMinutes != fiveHour?.durationMinutes } |
| var pairedAt: Date | ||
| var lastSeen: Date? | ||
| /// The relay server URL this desktop was paired through. | ||
| var relayURL: String? |
Contributor
Author
|
🎉 This PR is included in version 1.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
No description provided.