- Notifications
You must be signed in to change notification settings - Fork3
fix: display offline workspaces#39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix: display offline workspaces#39
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ethanndickson commentedFeb 10, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
f5fdeeb
toc1bc5ad
Compared434e77
to024d7e3
Comparea9e3504
tocaf84f1
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
caf84f1
toce1883e
Compare// `.alert` from SwiftUI doesn't play nice when the calling view is in the | ||
// menu bar. | ||
private func showAlert() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If you use.alert
, the menu bar window dismisses itself, and takes the alert with it - it basically doesn't work at all.
This olderNSAlert
API creates a temporary, managed, window instead.
If we need to create popup alerts for something that's part of the normal user flow later, we'll need to find a better way.
@Environment(\.dismiss) var dismiss | ||
@EnvironmentObject var vpn: VPN | ||
var msg: String { | ||
"\(vpn.menuState.invalidAgents.count) invalid \(vpn.menuState.invalidAgents.count > 1 ? "agents" : "agent").." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Are we purposefully calling it an invalid agent or should we stick to invalid workspace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good point. Let's stick with agent for now since this an internal error we're surfacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. Only one question regarding naming consistency
7ffa48b
intoethan/quarantine-workaroundUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The app previously didn't match the proposed design (and the Windows app) and display offline workspaces with a gray status.
Also improves the app's handling of invalid agents, indicating to the user that something went wrong. Clicking the button opens an alert with info. It's possible for invalid agents to resolve themselves, such as if the workspace update is sent at a later time.
Formatting these legacy API alert messages (such as to uncentre the text) is a pain, but ideally users never see these errors in the first place, so I think it's okay.
Also, for some reason I had the display of an agent in the list as always .coder. Whilst it usually is that value, if there's multiple agents in a workspace coderd will not send .coder as a FQDN, in which case we should instead display the next shortest FQDN, which we do now.