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

Simplify WebView initialization #98

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Simplify WebView initialization #98

wants to merge 15 commits into from

Conversation

tomaszgolebiowski
Copy link
Collaborator

This PR refactors the code associated with webview. The changes allow to:

  • code simplification
  • faster loading of the chat window
  • no more active waiting
  • orginal loading animation instend of 'Loading Cody chat...'

Most of the code related to webview is now in the WebViewNotificationHandlers.cs and CodyWebView.cs files. The code takes advantage of the fact that webview loads files from disk and no longer needs the results returned by the agent during initialization (e.g. SetHtml notification). This means that the webview can now load independently of notifications from the agent which greatly simplifies the entire code.

@PiotrKarczmarz
Copy link
Collaborator

Let's treat it as an experiment for now. There are some nice concepts here, that we could potentially bring to the main, if it will be stable enough.

Tomasz Gołębiowski added 2 commits September 27, 2024 11:47
# Conflicts:
#	src/Cody.Core/Infrastructure/WebViewsManager.cs
#	src/Cody.VisualStudio.Tests/ChatLoggedBasicTests.cs
#	src/Cody.VisualStudio.Tests/ChatNotLoggedStateTests.cs
#	src/Cody.VisualStudio/Client/AgentClientProviderOptions.cs
#	src/Cody.VisualStudio/CodyPackage.cs
@abeatrix
Copy link
Collaborator

i tried building from this branch but my chat is stuck in loading:

Screenshot 2024-09-30 110647

@tomaszgolebiowski
Copy link
Collaborator Author

@abeatrix I have made improvements to the code, please check it out

@abeatrix
Copy link
Collaborator

abeatrix commented Oct 2, 2024

@abeatrix I have made improvements to the code, please check it out

I got a new error on starting the build
image

Tomasz Gołębiowski added 2 commits October 2, 2024 16:08
Copy link

github-actions bot commented Oct 2, 2024

Test Results

10 tests  ±0   10 ✅ ±0   2m 22s ⏱️ - 14m 36s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit a10bf8f. ± Comparison against base commit 57697d1.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@PiotrKarczmarz PiotrKarczmarz left a comment

Choose a reason for hiding this comment

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

It needs a little more work. Based on that PR, I will create a separate branch that will "transplant" simplified control made by Tomasz, with additional changes.

I'm marking this PR as draft, so it won't be accidently merged.

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.

3 participants