Skip to content

feat: show vpn start/stop failure in app - #44

Merged
deansheather merged 2 commits into
mainfrom
dean/vpn-start-error
Mar 6, 2025
Merged

deansheather merged 2 commits into
mainfrom
dean/vpn-start-error

Conversation

@deansheather

Copy link
Copy Markdown
Collaborator

Adds red text that appears when the VPN fails to start or stop. After an error, any manual start/stop operation will clear the error.

Changes a lot of the optional components (TextBlocks, etc.) in the tray window to use bools for visibility rather than custom converters, because the logic behind whether to show them is slightly more complicated now. I could've maybe rearranged the app and shifted everything around into multiple parent containers for each condition that we check but it seemed harder than just using bools on the view model.

Most of the lines in this PR were from restructuring the XAML to make it simpler (and unindenting many lines in the process).

image

Contributes to #40

Comment thread App/ViewModels/TrayWindowViewModel.cs Outdated
[NotifyPropertyChangedFor(nameof(ShowWorkspacesHeader))]
[NotifyPropertyChangedFor(nameof(ShowNoAgentsSection))]
[NotifyPropertyChangedFor(nameof(ShowAgentsSection))]
[NotifyPropertyChangedFor(nameof(ShowFailedSection))]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ShowFailedSection doesn't depend on the lifecycle.

It really is annoying that we have to maintain these deps this way, where you have to mark the dependency, not the dependent. Harder to verify it's correct.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I definitely don't like it either. Since it's a decorator attribute I wonder if someone could write an inverse version of this using codegen or something. Maybe one already exists and I've just been doing it the dumb way

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for spotting this though!

Comment thread App/ViewModels/TrayWindowViewModel.cs Resolved
@deansheather
deansheather enabled auto-merge (squash) March 6, 2025 13:08
@deansheather
deansheather merged commit 51bf68e into main Mar 6, 2025
@deansheather
deansheather deleted the dean/vpn-start-error branch March 6, 2025 13:12
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.

2 participants