Skip to content

Commit 795106d

Browse files
committed
web: frame the rendered-HTML iframe as a page preview (fills width/height)
The .html rendered view used an edge-to-edge iframe with a magic-number height, which read awkwardly. Frame it as a white "page" on a padded backdrop that fills the panel's full width and height (block iframe, rounded border, subtle shadow).
1 parent ddc10d6 commit 795106d

5 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/pyclawd/web/static/assets/index-BE7CGXqf.js renamed to src/pyclawd/web/static/assets/index-BX1_g5ME.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pyclawd/web/static/assets/index-Do9wbQPX.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/pyclawd/web/static/assets/index-j7A6L7cf.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pyclawd/web/static/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>pyclawd web</title>
7-
<script type="module" crossorigin src="/assets/index-BE7CGXqf.js"></script>
8-
<link rel="stylesheet" crossorigin href="/assets/index-Do9wbQPX.css">
7+
<script type="module" crossorigin src="/assets/index-BX1_g5ME.js"></script>
8+
<link rel="stylesheet" crossorigin href="/assets/index-j7A6L7cf.css">
99
</head>
1010
<body>
1111
<div id="root"></div>

src/pyclawd/web_frontend/src/components/DiffView.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,17 @@ function RenderedFile({ project, path, kind }: { project: string; path: string;
274274
);
275275
}
276276
// HTML: render in a sandboxed iframe with no allowances → scripts and same-origin
277-
// access are blocked, so viewing a repo's .html file is safe.
277+
// access are blocked, so viewing a repo's .html file is safe. The iframe is framed
278+
// as a white "page" on a padded backdrop that fills the panel's width and height.
278279
return (
279-
<iframe
280-
title={`rendered ${path}`}
281-
sandbox=""
282-
srcDoc={data.content}
283-
className="h-[calc(100vh-150px)] w-full border-0 bg-white"
284-
/>
280+
<div className="h-[calc(100vh-92px)] w-full bg-panel2 p-4">
281+
<iframe
282+
title={`rendered ${path}`}
283+
sandbox=""
284+
srcDoc={data.content}
285+
className="block h-full w-full rounded-md border border-line bg-white shadow-sm"
286+
/>
287+
</div>
285288
);
286289
}
287290

0 commit comments

Comments
 (0)