Merge pull request #328 from AmirYunus/fix/305-hud-horizontal-scrollbar

fix(hud): avoid horizontal scrollbar when recording on Windows
This commit is contained in:
Sid
2026-05-02 23:23:00 -07:00
committed by GitHub
2 changed files with 21 additions and 1 deletions
+14
View File
@@ -25,6 +25,20 @@ export default function App() {
document.documentElement.style.background = "transparent";
document.getElementById("root")?.style.setProperty("background", "transparent");
}
// HUD is a fixed-size BrowserWindow; pin the document shell and hide overflow
// so the renderer can't introduce scrollbars (see issue #305).
if (type === "hud-overlay") {
document.documentElement.style.height = "100%";
document.documentElement.style.overflow = "hidden";
document.body.style.height = "100%";
document.body.style.margin = "0";
document.body.style.overflow = "hidden";
const root = document.getElementById("root");
root?.style.setProperty("height", "100%");
root?.style.setProperty("min-height", "0");
root?.style.setProperty("overflow", "hidden");
}
}, [windowType]);
useEffect(() => {
+7 -1
View File
@@ -314,7 +314,13 @@ export function LaunchWindow() {
};
return (
<div className={`w-screen h-screen overflow-x-hidden bg-transparent ${styles.electronDrag}`}>
// Root fills the HUD window only. Avoid w-screen/h-screen (100vw/100vh):
// 100vw can exceed the inner layout width when scrollbars affect the
// viewport (notably on Windows), causing a horizontal scrollbar once the
// recording toolbar widened (issue #305).
<div
className={`h-full w-full min-w-0 max-w-full overflow-x-hidden overflow-y-hidden bg-transparent ${styles.electronDrag}`}
>
{systemLocaleSuggestion && (
<div
className={`fixed top-8 left-1/2 z-30 w-[calc(100vw-1rem)] max-w-[520px] -translate-x-1/2 rounded-xl border border-white/15 bg-[rgba(20,20,28,0.95)] p-3 shadow-2xl backdrop-blur-xl text-white animate-in fade-in-0 zoom-in-95 duration-200 ${styles.electronNoDrag}`}