Release v0.1.3 2026-07-11

This commit is contained in:
Warren H
2026-07-11 23:23:02 -04:00
parent 076f6cf97c
commit b48b3a4f8f
103 changed files with 6708 additions and 454 deletions
+8 -6
View File
@@ -3,16 +3,14 @@ import { subscribeDisplaySurface, type DisplaySurface } from "../platform/displa
import { subscribeControllerToken } from "../input/controller";
export function DualDisplayFrame({ top, bottom }: { top: ReactNode; bottom: ReactNode }) {
const [activeSurface, setActiveSurface] = useState<DisplaySurface>(() =>
new URLSearchParams(window.location.search).get("display") === "bottom" ? "bottom" : "top"
);
const dedicatedSurface = new URLSearchParams(window.location.search).get("display");
const [activeSurface, setActiveSurface] = useState<DisplaySurface>(() => dedicatedSurface === "bottom" ? "bottom" : "top");
const activeSurfaceRef = useRef(activeSurface);
activeSurfaceRef.current = activeSurface;
useEffect(() => {
if (!document.documentElement.classList.contains("native-platform")) return;
const dedicatedSurface = new URLSearchParams(window.location.search).has("display");
if (dedicatedSurface) return;
if (dedicatedSurface === "top" || dedicatedSurface === "bottom") return;
const toggle = () => setActiveSurface((surface) => surface === "top" ? "bottom" : "top");
const unsubscribeSurface = subscribeDisplaySurface(setActiveSurface);
const unsubscribeController = subscribeControllerToken(({ token, repeat }) => {
@@ -29,7 +27,11 @@ export function DualDisplayFrame({ top, bottom }: { top: ReactNode; bottom: Reac
unsubscribeSurface();
unsubscribeController();
};
}, []);
}, [dedicatedSurface]);
if (dedicatedSurface === "top" || dedicatedSurface === "bottom") {
return <div className={`dedicated-display-surface dedicated-${dedicatedSurface}`}>{dedicatedSurface === "top" ? top : bottom}</div>;
}
return (
<div className={`device-frame active-${activeSurface}`}>