Merge pull request #92 from jonathanhefner/responsive-basic-host
Enable responsive width growing in `basic-host`
This commit is contained in:
commit
4200a46fc2
2 changed files with 8 additions and 7 deletions
|
|
@ -239,8 +239,13 @@ export function newAppBridge(serverInfo: ServerInfo, iframe: HTMLIFrameElement):
|
||||||
if (isBorderBox) {
|
if (isBorderBox) {
|
||||||
width += parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
|
width += parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
|
||||||
}
|
}
|
||||||
from.width = `${iframe.offsetWidth}px`;
|
// Use min-width instead of width to allow responsive growing.
|
||||||
iframe.style.width = to.width = `${width}px`;
|
// With auto-resize (the default), the app reports its minimum content
|
||||||
|
// width; we honor that as a floor but allow the iframe to expand when
|
||||||
|
// the host layout allows. And we use `min(..., 100%)` so that the iframe
|
||||||
|
// shrinks with its container.
|
||||||
|
from.minWidth = `${iframe.offsetWidth}px`;
|
||||||
|
iframe.style.minWidth = to.minWidth = `min(${width}px, 100%)`;
|
||||||
}
|
}
|
||||||
if (height !== undefined) {
|
if (height !== undefined) {
|
||||||
if (isBorderBox) {
|
if (isBorderBox) {
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@
|
||||||
.toolCallInfoPanel {
|
.toolCallInfoPanel {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
max-width: 1120px;
|
|
||||||
animation: slideDown 0.3s ease-out;
|
animation: slideDown 0.3s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,13 +106,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.appIframePanel {
|
.appIframePanel {
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
flex: 1 0 auto;
|
width: 100%;
|
||||||
height: 600px;
|
height: 600px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 3px dashed #888;
|
border: 3px dashed #888;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue