Skip to content
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

fix: render chat welcome if session init fails #195933

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

joyceerhl
Copy link
Contributor

@joyceerhl joyceerhl commented Oct 18, 2023

Followup to 23234ef, if we had some initial persisted session data we will temporarily show that, but if initializing a session from that fails, e.g. because the provider wasn't found, we will now render the welcome view

cc @roblourens

@joyceerhl joyceerhl self-assigned this Oct 18, 2023
@joyceerhl joyceerhl enabled auto-merge (squash) October 18, 2023 18:50
@VSCodeTriageBot VSCodeTriageBot added this to the October 2023 milestone Oct 18, 2023
@joyceerhl joyceerhl merged commit fc474f6 into main Oct 18, 2023
7 checks passed
@joyceerhl joyceerhl deleted the dev/joyceerhl/atomic-yak branch October 18, 2023 19:06
@@ -121,6 +123,16 @@ export class ChatViewPane extends ViewPane implements IChatViewPane {
sessionId = this.viewState.sessionId;
}

// Render the welcome view if this session gets disposed at any point,
// including if the provider registration fails
const disposeListener = sessionId ? this._register(this.chatService.onDidDisposeSession((e) => {
Copy link
Member

Choose a reason for hiding this comment

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

This flow is a little confusing, what case is this covering? And this will fire when the model is cleared normally too. Does this.didProviderRegistrationFail need to be reset somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is meant to cover the case where we have view state to restore but couldn't find a provider for it (i.e. user had a chat conversation and then signed out)--we should show a welcome view in this case because otherwise the chat window would be in an unusable state. Thoughts on instead having the chat service explicitly signal this case by throwing an UnknownProviderError that we can catch here in the view pane?

Alex0007 pushed a commit to Alex0007/vscode that referenced this pull request Oct 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants