Files
spacedrive/apps/web/src/platform.ts
Jamie Pine 6dfeccf211 Add public shares design docs and remote-access server improvements
- Add SHARE-000..011 task specs and docs/design/shares.md defining
  the sd.app public sharing architecture and wire protocols
- Rework INDEX-010 to scope ephemeral UUID reconciliation per-library
  instead of a single global map, since core can have multiple
  libraries loaded at once
- Add sidecar serving and configurable bind host to apps/server, and
  wire the web platform's daemon status to the server's own origin
- Add quick preview button to the file inspector, with a null-safe
  useOptionalExplorer for use outside the explorer context
2026-07-28 17:31:23 -07:00

35 lines
1.0 KiB
TypeScript

import type { Platform } from "@sd/interface/platform";
/**
* Web platform implementation for Spacedrive server
*
* This provides a minimal platform abstraction for the web client.
* Unlike Tauri, web platform cannot access native file system or daemon state directly.
*/
export const platform: Platform = {
platform: "web",
openLink(url: string) {
window.open(url, "_blank", "noopener,noreferrer");
},
// sd-server serves the UI, RPC, and sidecars from a single origin, so the
// sidecar base URL is wherever this page was loaded from. Without this the
// ServerContext never gets a serverUrl and thumbnails silently never load.
async getDaemonStatus() {
return {
is_running: true,
socket_path: "",
server_url: window.location.origin,
started_by_us: false,
};
},
confirm(message: string, callback: (result: boolean) => void) {
callback(window.confirm(message));
},
// Web-specific implementations (no native capabilities)
// File pickers, daemon control, etc. are not available on web
};