fix: token input screen is closed after switching between Toolbox and browser #72
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.
rough draft to fix UI state management in the authentication flow which today has 3 pages. If user closes
Toolbox in any of these three pages (for example to go and copy the token from a browser), then when it comes back in Toolbox does not remember which was the last visible UiPage.
until JetBrains improves Toolbox state management, we can work around the problem by having only one
UiPage with three "steps" in it, similar to a wizard. With this approach we can have complete control over
the state of the page.
to be noted that I've also looked over two other approaches. The first idea was to manage the stat
ourselves, but that didn’t work out as Toolbox doesn’t clearly tell us when the user clicks the Back
button vs. when they close the window. So we can’t reliably figure out which page to show when it reopens.
another option was changing the auth flow entirely and adding custom redirect URLs for Toolbox plugins.
But that would only work with certain Coder versions, which might not be ideal.
resolves token input screen is closed after I closed Toolbox popup to copy token in browser #45