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

feat: better theme compatibility #99

Merged
merged 15 commits into from
Jul 3, 2024
Merged
14 changes: 14 additions & 0 deletions src/editors/TestGenerationPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@
'index.css',
),
);
// The CSS file to provide VSCode native icons
const codiconsUri = webview.asWebviewUri(
Uri.joinPath(
extensionUri,
'webview-ui',
'test-generation',
'node_modules',
'@vscode/codicons',
'dist',
'codicon.css',
),
);
// The JS file from the React build output
const scriptUri = webview.asWebviewUri(
Uri.joinPath(
Expand Down Expand Up @@ -204,6 +216,8 @@
content="style-src ${webview.cspSource}; script-src 'nonce-${nonce}';"
/>
<link rel="stylesheet" type="text/css" href="${stylesUri}" />
<link rel="stylesheet" type="text/css" href="${codiconsUri}" />

<title>Test Generation</title>

<script nonce="${nonce}">
Expand Down Expand Up @@ -235,7 +249,7 @@
*/
private _setWebviewMessageListener(webview: Webview) {
webview.onDidReceiveMessage(
async (message: any) => {

Check warning on line 252 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
switch (message.action) {
case 'ready':
this._msgQueue.ready();
Expand Down Expand Up @@ -543,7 +557,7 @@
}

class MessageQueue {
private _messages: any[];

Check warning on line 560 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
private _ready: boolean;
private _webview: Webview;

Expand All @@ -553,7 +567,7 @@
this._webview = webview;
}

enqueue(msg: any) {

Check warning on line 570 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
if (!this._ready) {
this._messages.push(msg);
return;
Expand Down
13 changes: 13 additions & 0 deletions src/sidebars/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as toast from '../toast';
import { errMsg } from '../error';
import { isValidRegion } from '../types';
import { Uri } from 'vscode';

export class ConnectViewProvider implements vscode.WebviewViewProvider {
public static readonly viewType = 'scriptiq-connect';
Expand All @@ -30,6 +31,17 @@
};

const nonce = getNonce();
// The CSS file from the React build output
const stylesUri = webviewView.webview.asWebviewUri(
Uri.joinPath(
this._extensionUri,
'webview-ui',
'connect',
'build',
'assets',
'index.css',
),
);
const scriptUri = webviewView.webview.asWebviewUri(
vscode.Uri.joinPath(
this._extensionUri,
Expand Down Expand Up @@ -64,6 +76,7 @@
content="width=device-width, initial-scale=1.0"
/>

<link rel="stylesheet" type="text/css" href="${stylesUri}" />
<title>Connect</title>
<script nonce="${nonce}">
window.creds = '${JSON.stringify(creds)}';
Expand All @@ -76,7 +89,7 @@
</html>
`;

webviewView.webview.onDidReceiveMessage(async (msg: any) => {

Check warning on line 92 in src/sidebars/connect.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
switch (msg.action) {
case 'save-credentials': {
await this.saveCredentials(
Expand Down
Loading
Loading