Skip to content

Commit bb89c0e

Browse files
sync(1c502b5f): fix: address Copilot AI code quality findings (HYP-201) (#58)
Source: https://github.com/hyperide/hyper-saas/commit/1c502b5f1dc5e8195feb06f434d371c4680a7b4a
1 parent 950c88e commit bb89c0e

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

‎vscode-extension/hypercanvas-preview/src/PreviewPanel.ts‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,10 @@ export class PreviewPanel {
608608
*/
609609
private _getHtmlForWebview(): string {
610610
const webview = this._panel?.webview;
611+
if (!webview) {
612+
// Fallback HTML if the webview panel is not available
613+
return '<!DOCTYPE html><html><body><p>Preview is not available.</p></body></html>';
614+
}
611615
const nonce = this._getNonce();
612616

613617
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'out', 'webview-preview-panel.js'));
@@ -618,6 +622,7 @@ export class PreviewPanel {
618622
<head>
619623
<meta charset="UTF-8">
620624
<meta name="viewport" content="width=device-width, initial-scale=1.0">
625+
<!-- unsafe-inline required: React applies styles via style={{}} attributes in PreviewPanelApp -->
621626
<meta http-equiv="Content-Security-Policy" content="
622627
default-src 'none';
623628
frame-src *;
@@ -628,15 +633,6 @@ export class PreviewPanel {
628633
">
629634
<title>HyperCanvas Preview</title>
630635
<link rel="stylesheet" href="${cssUri}">
631-
<style>
632-
html, body, #root {
633-
margin: 0;
634-
padding: 0;
635-
width: 100%;
636-
height: 100%;
637-
overflow: hidden;
638-
}
639-
</style>
640636
</head>
641637
<body>
642638
<div id="root"></div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** Stub: Monaco editor is not needed in VS Code extension */
22
export default () => null;
33
export const loader = { config: () => {} };
4-
export const Delayer = class {
4+
export class Delayer {
55
trigger() {
66
return Promise.resolve();
77
}
8-
};
8+
}

0 commit comments

Comments
 (0)