fix(web): follow composer and rail layout
This commit is contained in:
@@ -389,8 +389,10 @@ export function createStructuredConnection(
|
||||
|
||||
// ---- composer ----
|
||||
function autoResize(): void {
|
||||
input.style.height = "auto";
|
||||
input.style.height = `${Math.min(input.scrollHeight, 160)}px`;
|
||||
updateTranscriptLayout(() => {
|
||||
input.style.height = "auto";
|
||||
input.style.height = `${Math.min(input.scrollHeight, 160)}px`;
|
||||
});
|
||||
}
|
||||
input.addEventListener("input", autoResize);
|
||||
input.addEventListener("keydown", (e) => {
|
||||
@@ -446,8 +448,11 @@ export function createStructuredConnection(
|
||||
// ---- narrow-pane rail collapse (a split pane, not just the viewport) ----
|
||||
const NARROW_BREAKPOINT = 560;
|
||||
const resizeObserver = new ResizeObserver((entries) => {
|
||||
if (disposed) return;
|
||||
const width = entries[0]?.contentRect.width ?? bodyEl.clientWidth;
|
||||
bodyEl.classList.toggle("st-narrow", width < NARROW_BREAKPOINT);
|
||||
const narrow = width < NARROW_BREAKPOINT;
|
||||
if (bodyEl.classList.contains("st-narrow") === narrow) return;
|
||||
updateTranscriptLayout(() => bodyEl.classList.toggle("st-narrow", narrow));
|
||||
});
|
||||
resizeObserver.observe(bodyEl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user