Skip to content

Use hideFind() and showFind() when retainContextWhenHidden enabled#161174

Merged
mjbvz merged 5 commits intomicrosoft:mainfrom
MachineMitch21:mitch/157424
Sep 21, 2022
Merged

Use hideFind() and showFind() when retainContextWhenHidden enabled#161174
mjbvz merged 5 commits intomicrosoft:mainfrom
MachineMitch21:mitch/157424

Conversation

@MachineMitch21
Copy link
Copy Markdown
Contributor

I suspect this PR will fix the issue noted with #157424. However, I was unable to test because Code - OSS Dev wouldn't activate the extension I was trying to test with. I am attaching a short (but feels long) video showing the result I'm getting while trying to test.

But, to summarize the video, I startup Code - OSS from vscode with the code changes applied, I install a dummy extension with code to create web view panel using vsce and Install by VSIX, I show that the Runtime Status remains as "Not yet activated", then I attempt to run the extension command which creates the web view panel. I am shown an error message (FYI -- It takes rougly 20 seconds to show the error after I run the command) saying that the command is not available (presumably just because the extension isn't getting loaded).

I'm guessing some kind of disconnect between what the command pallet sees and what the app sees when the ext would get activated 🤷. I know it's not ideal to submit a PR without having been able to successfully test the change, but I was unable to find any useful information about running custom extensions from Code - OSS. (Besides what I saw at #23831) With that in mind, I am open to trying things if anyone has any ideas.

157424_test_attempts.mp4

// We previously hid find when we did this.release()
// https://github.com/microsoft/vscode/issues/157424
if (this._options.retainContextWhenHidden) {
this._webview.value.showFind();
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz Sep 19, 2022

Choose a reason for hiding this comment

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

What if the find widget wasn't previously showing when the webview was hidden? Will this cause it to show?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the callout! That does indeed need to be handled.

I'll start looking into a way to handle that cleanly. Preferably the solution would avoid any more state variables, but it may end up being necessary. Just depends how everything is currently implemented so I'll dig into it a bit more.

@MachineMitch21
Copy link
Copy Markdown
Contributor Author

Apologies for all the amendments. Github workflow is much different than Gerrit...

@mjbvz mjbvz merged commit bdf82d9 into microsoft:main Sep 21, 2022
@mjbvz
Copy link
Copy Markdown
Collaborator

mjbvz commented Sep 21, 2022

Thanks!

@mjbvz mjbvz added this to the September 2022 milestone Sep 21, 2022
@mjbvz
Copy link
Copy Markdown
Collaborator

mjbvz commented Sep 21, 2022

This will be in the next insiders build and go out to stable with VS Code 1.72

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2022
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.

2 participants