Skip to content

Show errors more prominently and show token source #228

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 25, 2023
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Apr 22, 2023

There is the little bubble in the lower right corner but I think showing the error next to the field or in the table can help identify problems more quickly and in cases where we prompt for a token again I think it is a bit non-obvious at first why it suddenly appears when there is no accompanying text.

Also hoping it will help in cases like #226 where "nothing to show" could mean the workspaces list response was empty or it could mean any number of things went wrong while trying to connect.

As I was doing this I made the token nullable which meant I would have to add a null check in connect as it pulled from the local model even though technically it could never be null (we always set it before calling connect) so I refactored it to not rely on the local model, you just pass things in now.

@code-asher code-asher changed the title Show token information and errors in more prominently Show token information and errors more prominently Apr 22, 2023
@code-asher code-asher changed the title Show token information and errors more prominently Show token source and errors more prominently Apr 22, 2023
@code-asher code-asher changed the title Show token source and errors more prominently Show errors more prominently and show token source Apr 22, 2023
@code-asher code-asher marked this pull request as ready for review April 23, 2023 23:07
@code-asher code-asher requested a review from johnstcn April 23, 2023 23:08
Base automatically changed from custom-locations to main April 24, 2023 23:41
Should make it easier to test.  This meant not calling
askTokenAndConnect because it interacts with the global model.

Initially I was trying to figure out a way to wait progress dialog
background job so you could then retry but I am not sure how to do that
so I went with passing in a callback.

Also launching a new coroutine since otherwise it blocked the current
job and threw a warning, I think it disliked the invokeAndWait of the
token dialog from inside the job.
Instead of just "Nothing to show" it will show the last error or the
status if we are currently trying to connect.
Now it will say whether the token was from the config or was the last
known token and if it fails there will be an error message.  You could
always check the error in the bottom right but this way it is more
obvious why the token dialog has reappeared.

Also if the URL has changed there is no point trying to use the token
we had stored for the previous URL.
@code-asher code-asher merged commit 68952f9 into main Apr 25, 2023
@code-asher code-asher deleted the surface-status branch April 25, 2023 00:06
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