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: don't show welcome view between reloads #195928

Merged
merged 3 commits into from Oct 18, 2023

Conversation

joyceerhl
Copy link
Contributor

@joyceerhl joyceerhl commented Oct 18, 2023

cc @roblourens take 2

  • ensure that after signing in, chat renders its initial state
  • ensure that the welcome view doesn't flash in and out of existence between reloads
  • limitation of this approach: if the user has signed in, had a chat, then signed out, they won't see the welcome message

@joyceerhl joyceerhl self-assigned this Oct 18, 2023
@joyceerhl joyceerhl enabled auto-merge (squash) October 18, 2023 18:19
@VSCodeTriageBot VSCodeTriageBot added this to the October 2023 milestone Oct 18, 2023
@joyceerhl joyceerhl merged commit 23234ef into main Oct 18, 2023
7 checks passed
@joyceerhl joyceerhl deleted the dev/joyceerhl/additional-primate branch October 18, 2023 18:34
@@ -66,6 +66,11 @@ export class ChatViewPane extends ViewPane implements IChatViewPane {
// View state for the ViewPane is currently global per-provider basically, but some other strictly per-model state will require a separate memento.
this.memento = new Memento('interactive-session-view-' + this.chatViewOptions.providerId, this.storageService);
this.viewState = this.memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE) as IViewPaneState;
this._register(this.chatService.onDidRegisterProvider(({ providerId }) => {
if (providerId === this.chatViewOptions.providerId && !this._widget?.viewModel) {
this.updateModel();
Copy link
Member

Choose a reason for hiding this comment

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

Won't this still not use the persisted session? I think you need to do all of this

let sessionId: string | undefined;
if (this.chatService.transferredSessionData) {
sessionId = this.chatService.transferredSessionData.sessionId;
this.viewState.inputValue = this.chatService.transferredSessionData.inputValue;
} else {
sessionId = this.viewState.sessionId;
}
const initialModel = sessionId ? this.chatService.getOrRestoreSession(sessionId) : undefined;
this.updateModel(initialModel);

Alex0007 pushed a commit to Alex0007/vscode that referenced this pull request Oct 26, 2023
* fix: rerender chat pane when provider is added

* fix: don't show welcome view between reloads
@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