Files
deepseek-harness/apps/desktop/src/preload-platform.ts
T
Yif f2db686404 feat(desktop): macOS hidden titlebar with vibrancy sidebar
hiddenInset titlebar with traffic lights over a vibrancy sidebar, darwin-only
via data-platform set by the desktop preload: transparent chain to the window
material, native-theme sync from the app theme source, sidebar top strip +
full hide when collapsed with reopen controls in the new
conversation.session.header.leading slot, title-row drag regions, and
fullscreen right-sidebar traffic-light clearance via the dockkit strip inset.
2026-09-15 02:26:57 +08:00

15 lines
645 B
TypeScript

/** Marks the document root with the host platform so shared Web UI CSS can scope desktop-only rules. */
/**
* Sets `data-platform` (e.g. `darwin`) on `<html>`, deferring to DOMContentLoaded
* when the preload runs before the document root exists.
*/
export function markDocumentPlatform(): void {
const mark = (): void => { document.documentElement.dataset.platform = process.platform }
// lib.dom types documentElement non-null, but a preload runs before the
// document root exists.
const root = document.documentElement as HTMLElement | null
if (root === null) window.addEventListener('DOMContentLoaded', mark)
else mark()
}