-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adds initial WebView extension implementation #325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good next step. Can you create follow-on issues for letting the agent choose a port dynamically (to avoid conflicts) and enabling agent session auth?
Added: https://github.com/rstudio/publishing-client/issues?q=is%3Aissue+is%3Aopen+label%3Apositron+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why it is necessary to "Reload Webviews". I'm sure that is a temporary thing, but looking forward to seeing if we can move past that requirement.
|
||
const terminal = vscode.window.createTerminal(); | ||
terminal.show(); | ||
terminal.sendText(`publisher publish-ui test/sample-content/fastapi-simple --listen=${url} --skip-browser-session-auth`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was never able to get the publisher
command to work even with just configure
. I had to change this to just run
to get it to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you recall if you ran just build
from the root beforehand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did, but could never get publisher
to work. Not sure why.
content="default-src 'none'; frame-src ${uri} ${cspsrc} https:; img-src ${cspsrc} https:; script-src ${cspsrc}; style-src ${cspsrc};" | ||
/> | ||
</head> | ||
<body style="padding: 0;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay this is weird... pulling this down and running it I see the CSS, but it isn't being applied?
I've tried re-running, hard refreshing, reloading the window, am I missing something that I need to do to get this CSS to be applied? If I edit the CSS in the dev-tools it gets updated, but no matter what I've done the iFrame starts small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Did you call Publisher: Open Assistant
again from the VSCode command pallet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did. After discussing with @tdstein we discovered this was because of:
Refused to apply inline style because it violates the following Content Security Policy
directive: "style-src 'self' https://*.vscode-cdn.net". Either the 'unsafe-inline' keyword
, a hash ('sha256-mHgUAqxc8GPXM/QhzkHrHujcrQTU9fd6ZjWz+icxKcA='), or a
nonce ('nonce-...') is required to enable inline execution. Note that hashes do not
apply to event handlers, style attributes and javascript: navigations unless the
'unsafe-hashes' keyword is present.
Going to address in a follow-up
@dotNomad - I am merging so that I can keep moving forward. Let's follow up on the issue you ran into. |
Intent
Adds an initial implementation of embedding the Assistant (Wizard /
publish-ui
) in a WebView. The UI is embedded in an iframe.Type of Change
Approach
Implementation is based on this documentation: https://code.visualstudio.com/api/advanced-topics/remote-extensions#option-1-use-asexternaluri
Known Issues
iframe
does not fill the screen.Note that this is just a work-in-progress implementation.
Next Steps
Automated Tests
Directions for Reviewers
just configure
, which will alias the executable. This assume the executable has already been build (i.e.,just build
in root).publishing-client
root directory in new window.You should see a terminal launch the server. The UI should open in a separate panel.
Checklist