Port Kaleido Desktop to macOS

macOS (Apple silicon) now plays, browses and updates like Windows:

- Video: libmpv's render API draws into a CAOpenGLLayer beneath the
  WKWebView, with the miniplayer rectangle, HDR passthrough through
  extended dynamic range (PQ/BT.2020) and display-sleep prevention.
- Window: native traffic lights on the top bar's centre line, hidden
  with the player's controls; the page's caption buttons are Windows-only.
- Interface: macOS shortcut labels (⌘K, ⌘[, ⌃⌘F), Plex identifies the
  player as a Mac, and header values are kept ASCII (Mac computer names
  usually contain a curly apostrophe).
- The window appears without waiting for an animation frame, which
  WKWebView doesn't run in a hidden window.
- Credentials: release builds use the Keychain and are signed with a
  lasting self-signed certificate so access survives updates; debug
  builds keep tokens in a private file to avoid prompts on every rebuild.
- Bundling: scripts/fetch-libmpv.sh makes Homebrew's libmpv and its
  libraries self-contained; scripts/build.sh builds the .app, .dmg and
  signed update archive.

Releases now carry both platforms: publish-release.mjs uploads each
machine's build into one release, and update-manifest.mjs writes the
feed from that release's assets, refusing while a platform is missing.

The updater uses a new signing key (public key in tauri.conf.json), so
existing installs must be reinstalled once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah Kuntz 2026-11-02 15:14:40 -07:00
parent a3c05e9062
commit 7d0803481b
39 changed files with 1191 additions and 230 deletions

View file

@ -11,7 +11,7 @@ import { PageLoader } from '../ui/primitives';
import { Splash } from '../screens/Splash';
import { SignIn } from '../screens/SignIn';
import { ServerPicker } from '../screens/ServerPicker';
import { win } from '../platform/native';
import { isMac, win } from '../platform/native';
import { usePlayer } from '../player/store';
import { PlayerOverlay } from '../player/PlayerOverlay';
import { DialogHost } from '../screens/dialogs/DialogHost';
@ -100,13 +100,13 @@ function useGlobalShortcuts() {
if ((e.ctrlKey || e.metaKey) && (e.key === 'k' || e.key === 'f')) {
e.preventDefault();
navigate({ name: 'search' });
} else if (e.altKey && e.key === 'ArrowLeft') {
} else if ((e.altKey && e.key === 'ArrowLeft') || (isMac && e.metaKey && e.key === '[')) {
e.preventDefault();
useRouter.getState().back();
} else if (e.altKey && e.key === 'ArrowRight') {
} else if ((e.altKey && e.key === 'ArrowRight') || (isMac && e.metaKey && e.key === ']')) {
e.preventDefault();
useRouter.getState().forward();
} else if (e.key === 'F11') {
} else if (e.key === 'F11' || (isMac && e.metaKey && e.ctrlKey && e.key.toLowerCase() === 'f')) {
e.preventDefault();
win.isFullscreen().then((fs) => win.setFullscreen(!fs));
} else if ((e.key === 'Escape' || e.key === 'Backspace') && !isTyping(e.target) && !document.querySelector('.menu-layer, .dialog-layer')) {
@ -225,7 +225,16 @@ export function App() {
useEffect(() => {
useSession.getState().init();
// The window appears once the first frame is painted (no white flash).
requestAnimationFrame(() => win.show());
// WKWebView runs no animation frames until its window is shown, so a
// timeout stands in there.
let shown = false;
const show = () => {
if (!shown) win.show();
shown = true;
};
requestAnimationFrame(show);
const fallback = setTimeout(show, 150);
return () => clearTimeout(fallback);
}, []);
useEffect(() => {

View file

@ -5,7 +5,7 @@ import { useSettings } from './settings';
import { Icon } from '../ui/Icon';
import { KaleidoMark } from '../ui/primitives';
import { openMenu, type MenuItem } from '../ui/overlays';
import { isNative, win } from '../platform/native';
import { isMac, isNative, shortcut, win } from '../platform/native';
import { useDownloads } from '../downloads/store';
import { useHomeUsers } from './useHomeUsers';
@ -16,17 +16,18 @@ const NAV = [
{ id: 'downloads', label: 'Downloads', route: { name: 'downloads' } as const },
];
/** Caption buttons drawn by the page; macOS shows its own traffic lights instead. */
export function WindowControls() {
const [maximized, setMaximized] = useState(false);
useEffect(() => {
if (!isNative) return;
if (!isNative || isMac) return;
let off: (() => void) | undefined;
const sync = () => win.isMaximized().then(setMaximized);
sync();
win.onResized(sync).then((u) => (off = u));
return () => off?.();
}, []);
if (!isNative) return null;
if (!isNative || isMac) return null;
return (
<div className="window-controls">
<button aria-label="Minimize" onClick={() => win.minimize()}>
@ -109,7 +110,7 @@ export function TopBar({ solid }: { solid: boolean }) {
</nav>
</div>
<div className="topbar-right" data-tauri-drag-region>
<button className={`icon-btn${active === 'search' ? ' on' : ''}`} aria-label="Search" title="Search (Ctrl+K)" onClick={() => navigate({ name: 'search' })}>
<button className={`icon-btn${active === 'search' ? ' on' : ''}`} aria-label="Search" title={`Search (${shortcut('K')})`} onClick={() => navigate({ name: 'search' })}>
<Icon name="search" size={19} />
</button>
<button className={`icon-btn${active === 'settings' ? ' on' : ''}`} aria-label="Settings" title="Settings" onClick={() => navigate({ name: 'settings', mode: 'app', tab: 'general' })}>

View file

@ -54,7 +54,7 @@ export const useSession = create<SessionState>((set, get) => ({
async init() {
const info = await appInfo();
configureClient({ version: info.version, deviceName: info.deviceName });
configureClient({ version: info.version, deviceName: info.deviceName, platformVersion: info.osVersion });
let token = await secrets.get('account-token');
const stored = loadStoredServer();