feat: include ping and network stats on status tooltip#181
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds ping and network statistics to the VPN status tooltip by extending the protocol, propagating new fields through the Swift models, and updating the UI and tests to surface ping-based status.
- Extend
vpn.protoand regenerate Swift Protobuf code to include a newLastPingmessage. - Wire up
lastPingand handshake data inMenuState, updateAgentStatuslogic to account for latency, and add UI tooltips. - Add and update unit tests to verify ping‐based status, and adjust tooltip timing in the app theme.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Coder-Desktop/VPNLib/vpn.proto | Add LastPing message and import duration.proto. |
| Coder-Desktop/VPNLib/vpn.pb.swift | Generated Swift support for LastPing and new fields. |
| Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift | Remove stale TODO comments. |
| Coder-Desktop/VPN/Manager.swift | Tweak logger.log interpolation for message formatting. |
| Coder-Desktop/Coder-DesktopTests/VPNMenuStateTests.swift | Add tests for poorConnection and adjust expected statuses. |
| Coder-Desktop/Coder-DesktopTests/AgentsTests.swift | Include lastPing: nil in test agent fixtures. |
| Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift | Add statusString and .help tooltip on status dot. |
| Coder-Desktop/Coder-Desktop/VPN/MenuState.swift | Integrate LastPing into Agent model, add status logic, helpers. |
| Coder-Desktop/Coder-Desktop/Theme.swift | Define tooltipDelay constant (250 ms). |
| Coder-Desktop/Coder-Desktop/Coder_DesktopApp.swift | Set NSInitialToolTipDelay via UserDefaults. |
Comments suppressed due to low confidence (3)
Coder-Desktop/Coder-Desktop/VPN/MenuState.swift:107
- Inserting
connectingwith raw value 1 shifts all subsequent enum raw values, which may break code or persisted data relying on those values. Consider maintaining backward compatibility by explicitly assigning the original values or migrating consumers.
case connecting = 1
Coder-Desktop/Coder-Desktop/VPN/MenuState.swift:290
- There are no existing tests for the
connectingstatus path whenlastHandshakeis missing. Adding a unit test to cover this branch will ensure correct behavior for newly-started agents.
var status: AgentStatus {
Coder-Desktop/VPN/Manager.swift:324
- [nitpick] The single privacy label applies to the entire interpolated string. If some fields should remain private, consider splitting the log call or marking each interpolation segment explicitly.
logger.log(level: level, "\(log.message, privacy: .public)\(fields.isEmpty ? "" : ": \(fields)", privacy: .public)")
745cf56 to
a00c350
Compare
deansheather
reviewed
Jun 6, 2025
deansheather
approved these changes
Jun 6, 2025
Member
Author
Merge activity
|
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.

Closes #64.