-
{children}
- {action}
+
+ {icon && (
+
+ {icon}
+
+ )}
+
+ {title &&
{title}
}
+
{children}
+
+ {action &&
{action}
}
)
}
-export function ErrorLine({ error }: { error: unknown }) {
+export function ErrorLine({ error, className = '' }: { error: unknown; className?: string }) {
if (!error) return null
- return
{error instanceof Error ? error.message : String(error)}
+ return (
+
+
+
{error instanceof Error ? error.message : String(error)}
+
+ )
}
-/** Lazy loaded square project icon with a neutral fallback. */
+/** Lazy loaded square project icon with a neutral framed fallback. */
export function Thumb({ src, size = 32 }: { src: string | null | undefined; size?: number }) {
return src ? (
-

+

) : (
-
+
)
}
diff --git a/apps/desktop/src/index.css b/apps/desktop/src/index.css
index d16eb57..ccd5c10 100644
--- a/apps/desktop/src/index.css
+++ b/apps/desktop/src/index.css
@@ -1,19 +1,186 @@
@import 'tailwindcss';
-@theme {
- --color-bg: #000;
- --color-fg: #fff;
- --color-muted: #8b8b8b;
- --color-line: #1f1f1f;
- --color-line-strong: #333;
- --color-hover: #0e0e0e;
- --color-raise: #0a0a0a;
- --color-accent: #7ee8ff;
- --color-ok: #5fd38d;
- --color-warn: #f5c451;
- --color-bad: #ff6b6b;
- --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Inter, sans-serif;
- --font-mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
+/* ============================================================================
+ BeaconSync 2.0 Design System: Floating Inset Workspace (Dark & Light).
+ Semantic tokens guarantee WCAG AA+ contrast across all surfaces and controls.
+ ============================================================================ */
+
+:root,
+:root[data-theme='dark'] {
+ color-scheme: dark;
+
+ --c-shell: #08090c;
+ --c-bg: #0f1117;
+ --c-sidebar: #0b0d12;
+ --c-surface: #151822;
+ --c-surface-2: #1c212e;
+ --c-input: #0c0e14;
+ --c-console: #090a0e;
+ --c-hover: rgba(255, 255, 255, 0.05);
+ --c-active: rgba(245, 179, 66, 0.13);
+ --c-overlay: rgba(4, 5, 8, 0.78);
+
+ --c-fg: #f3f5f8;
+ --c-fg-secondary: #c7cedb;
+ --c-muted: #99a2b5;
+ --c-subtle: #858fa3;
+
+ --c-line: rgba(255, 255, 255, 0.08);
+ --c-line-strong: rgba(255, 255, 255, 0.15);
+ --c-line-hover: rgba(255, 255, 255, 0.25);
+
+ --c-accent: #f5b342;
+ --c-accent-hover: #ffc55e;
+ --c-accent-text: #f8c66b;
+ --c-accent-fg: #140f04;
+ --c-accent-soft: rgba(245, 179, 66, 0.13);
+ --c-accent-border: rgba(245, 179, 66, 0.30);
+
+ --c-ok: #3dd68c;
+ --c-ok-soft: rgba(61, 214, 140, 0.12);
+ --c-ok-border: rgba(61, 214, 140, 0.28);
+
+ --c-info: #5ec2f2;
+ --c-info-soft: rgba(94, 194, 242, 0.12);
+ --c-info-border: rgba(94, 194, 242, 0.28);
+
+ --c-warn: #f5b342;
+ --c-warn-soft: rgba(245, 179, 66, 0.12);
+ --c-warn-border: rgba(245, 179, 66, 0.28);
+
+ --c-bad: #f87171;
+ --c-bad-soft: rgba(248, 113, 113, 0.12);
+ --c-bad-border: rgba(248, 113, 113, 0.30);
+
+ --c-ring: rgba(245, 179, 66, 0.85);
+ --c-scroll: rgba(255, 255, 255, 0.16);
+ --c-scroll-hover: rgba(255, 255, 255, 0.28);
+
+ --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2399a2b5' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ --sh-xs: 0 1px 2px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
+ --sh-sm: 0 4px 14px -3px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
+ --sh-md: 0 14px 36px -8px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(255, 255, 255, 0.06);
+ --sh-lg: 0 28px 68px -12px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.08);
+ --sh-canvas: 0 2px 16px -4px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.045);
+ --sh-accent: 0 1px 2px rgba(0, 0, 0, 0.36), 0 5px 16px -4px rgba(245, 179, 66, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.30);
+}
+
+:root[data-theme='light'] {
+ color-scheme: light;
+
+ --c-shell: #ebe8e0;
+ --c-bg: #faf9f6;
+ --c-sidebar: #f2f0ea;
+ --c-surface: #ffffff;
+ --c-surface-2: #eeebe3;
+ --c-input: #ffffff;
+ --c-console: #f3f1ec;
+ --c-hover: rgba(20, 22, 28, 0.048);
+ --c-active: rgba(158, 90, 4, 0.11);
+ --c-overlay: rgba(17, 19, 24, 0.48);
+
+ --c-fg: #14161b;
+ --c-fg-secondary: #333946;
+ --c-muted: #4e5666;
+ --c-subtle: #5d6575;
+
+ --c-line: rgba(20, 22, 27, 0.09);
+ --c-line-strong: rgba(20, 22, 27, 0.16);
+ --c-line-hover: rgba(20, 22, 27, 0.28);
+
+ --c-accent: #9e5a04;
+ --c-accent-hover: #834902;
+ --c-accent-text: #8c4f03;
+ --c-accent-fg: #ffffff;
+ --c-accent-soft: rgba(158, 90, 4, 0.10);
+ --c-accent-border: rgba(158, 90, 4, 0.28);
+
+ --c-ok: #126b33;
+ --c-ok-soft: rgba(18, 107, 51, 0.09);
+ --c-ok-border: rgba(18, 107, 51, 0.24);
+
+ --c-info: #075985;
+ --c-info-soft: rgba(7, 89, 133, 0.09);
+ --c-info-border: rgba(7, 89, 133, 0.24);
+
+ --c-warn: #92400e;
+ --c-warn-soft: rgba(146, 64, 14, 0.10);
+ --c-warn-border: rgba(146, 64, 14, 0.25);
+
+ --c-bad: #b91c1c;
+ --c-bad-soft: rgba(185, 28, 28, 0.09);
+ --c-bad-border: rgba(185, 28, 28, 0.24);
+
+ --c-ring: rgba(158, 90, 4, 0.85);
+ --c-scroll: rgba(20, 22, 27, 0.18);
+ --c-scroll-hover: rgba(20, 22, 27, 0.32);
+
+ --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%234e5666' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ --sh-xs: 0 1px 2px rgba(20, 22, 27, 0.05);
+ --sh-sm: 0 4px 12px -2px rgba(20, 22, 27, 0.08), 0 1px 3px rgba(20, 22, 27, 0.04);
+ --sh-md: 0 14px 32px -6px rgba(20, 22, 27, 0.15), 0 2px 6px -2px rgba(20, 22, 27, 0.06);
+ --sh-lg: 0 24px 60px -12px rgba(20, 22, 27, 0.24), 0 0 0 1px rgba(20, 22, 27, 0.06);
+ --sh-canvas: 0 2px 12px -3px rgba(20, 22, 27, 0.08), 0 0 0 1px rgba(20, 22, 27, 0.06);
+ --sh-accent: 0 1px 2px rgba(131, 73, 2, 0.24), 0 5px 14px -4px rgba(158, 90, 4, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.20);
+}
+
+@theme inline {
+ --color-shell: var(--c-shell);
+ --color-bg: var(--c-bg);
+ --color-sidebar: var(--c-sidebar);
+ --color-surface: var(--c-surface);
+ --color-surface-2: var(--c-surface-2);
+ --color-input: var(--c-input);
+ --color-console: var(--c-console);
+ --color-hover: var(--c-hover);
+ --color-active: var(--c-active);
+ --color-overlay: var(--c-overlay);
+
+ --color-fg: var(--c-fg);
+ --color-fg-secondary: var(--c-fg-secondary);
+ --color-muted: var(--c-muted);
+ --color-subtle: var(--c-subtle);
+
+ --color-line: var(--c-line);
+ --color-line-strong: var(--c-line-strong);
+ --color-line-hover: var(--c-line-hover);
+
+ --color-accent: var(--c-accent);
+ --color-accent-hover: var(--c-accent-hover);
+ --color-accent-text: var(--c-accent-text);
+ --color-accent-fg: var(--c-accent-fg);
+ --color-accent-soft: var(--c-accent-soft);
+ --color-accent-border: var(--c-accent-border);
+
+ --color-ok: var(--c-ok);
+ --color-ok-soft: var(--c-ok-soft);
+ --color-ok-border: var(--c-ok-border);
+
+ --color-info: var(--c-info);
+ --color-info-soft: var(--c-info-soft);
+ --color-info-border: var(--c-info-border);
+
+ --color-warn: var(--c-warn);
+ --color-warn-soft: var(--c-warn-soft);
+ --color-warn-border: var(--c-warn-border);
+
+ --color-bad: var(--c-bad);
+ --color-bad-soft: var(--c-bad-soft);
+ --color-bad-border: var(--c-bad-border);
+
+ --color-ring: var(--c-ring);
+
+ --shadow-theme-xs: var(--sh-xs);
+ --shadow-theme-sm: var(--sh-sm);
+ --shadow-theme-md: var(--sh-md);
+ --shadow-theme-lg: var(--sh-lg);
+ --shadow-theme-canvas: var(--sh-canvas);
+ --shadow-theme-accent: var(--sh-accent);
+
+ --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
+ --font-mono: ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}
html,
@@ -24,14 +191,14 @@ body,
body {
margin: 0;
- background: #000;
- color: #fff;
+ background: var(--c-shell);
+ color: var(--c-fg);
font-family: var(--font-sans);
font-size: 13px;
- line-height: 1.4;
+ line-height: 1.45;
-webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
user-select: none;
- color-scheme: dark;
}
input,
@@ -40,27 +207,102 @@ select {
user-select: text;
}
+button,
+a,
+select,
+input[type='checkbox'] {
+ cursor: pointer;
+}
+
+button:disabled,
+select:disabled,
+input:disabled {
+ cursor: not-allowed;
+}
+
+@layer base {
+ :focus-visible {
+ outline: 2px solid var(--c-ring);
+ outline-offset: 1px;
+ }
+
+ input:focus-visible,
+ textarea:focus-visible,
+ select:focus-visible {
+ outline: none;
+ box-shadow: 0 0 0 2px var(--c-ring);
+ }
+}
+
+/* Scrollbars */
::-webkit-scrollbar {
- width: 10px;
- height: 10px;
+ width: 9px;
+ height: 9px;
}
+
::-webkit-scrollbar-thumb {
- background: #262626;
- border: 3px solid #000;
- border-radius: 6px;
+ background: var(--c-scroll);
+ border: 2px solid transparent;
+ background-clip: content-box;
+ border-radius: 999px;
+}
+
+::-webkit-scrollbar-thumb:hover {
+ background: var(--c-scroll-hover);
+ border: 2px solid transparent;
+ background-clip: content-box;
}
+
::-webkit-scrollbar-track {
background: transparent;
}
+/* Native select styled cleanly across both themes */
select {
appearance: none;
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b8b8b' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
+ padding-right: 28px !important;
+ background-image: var(--select-chevron);
background-repeat: no-repeat;
background-position: right 9px center;
- padding-right: 26px !important;
}
option {
- background: #000;
+ background: var(--c-surface);
+ color: var(--c-fg);
+}
+
+/* Subtle dialog & popover entrance */
+@keyframes dialog-in {
+ from {
+ opacity: 0;
+ transform: translateY(6px) scale(0.985);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+ }
+}
+
+@keyframes fade-in {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+.animate-dialog {
+ animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
+}
+
+.animate-fade {
+ animation: fade-in 140ms ease-out;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .animate-dialog,
+ .animate-fade {
+ animation: none;
+ }
}
diff --git a/apps/desktop/src/lib/theme.ts b/apps/desktop/src/lib/theme.ts
new file mode 100644
index 0000000..038f33b
--- /dev/null
+++ b/apps/desktop/src/lib/theme.ts
@@ -0,0 +1,143 @@
+// Theme management: system, light, or dark. Persists in localStorage, updates
+// `data-theme` and `color-scheme` on , and syncs the native Tauri window
+// chrome when running inside the desktop shell.
+
+import { getCurrentWindow } from '@tauri-apps/api/window'
+import { create } from 'zustand'
+
+export type ThemeMode = 'system' | 'light' | 'dark'
+export type ResolvedTheme = 'light' | 'dark'
+
+const STORAGE_KEY = 'beaconsync-theme'
+
+// Kept in sync with `--c-shell` in `src/index.css` and `backgroundColor` in `src-tauri/tauri.conf.json`
+// and `src-tauri/tauri.windows.conf.json` (which repeats the whole window entry).
+const WINDOW_BG: Record
= {
+ dark: '#08090c',
+ light: '#ebe8e0',
+}
+
+const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'
+const isLinux = isBrowser && navigator.userAgent.includes('Linux')
+
+function readStoredMode(): ThemeMode {
+ if (!isBrowser) return 'dark'
+ try {
+ const raw = window.localStorage.getItem(STORAGE_KEY)
+ if (raw === 'light' || raw === 'dark' || raw === 'system') return raw
+ } catch {
+ // Storage unavailable; fall back to system.
+ }
+ return 'system'
+}
+
+function systemPreference(): ResolvedTheme {
+ if (!isBrowser) return 'dark'
+ return window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
+}
+
+export function resolveTheme(mode: ThemeMode): ResolvedTheme {
+ return mode === 'system' ? systemPreference() : mode
+}
+
+function applyDomTheme(resolved: ResolvedTheme) {
+ if (!isBrowser) return
+ const root = document.documentElement
+ root.dataset.theme = resolved
+ root.style.colorScheme = resolved
+}
+
+function syncWindowBg(resolved: ResolvedTheme) {
+ if (!isBrowser || !('__TAURI_INTERNALS__' in window)) return
+ try {
+ void getCurrentWindow().setBackgroundColor(WINDOW_BG[resolved]).catch(() => {})
+ } catch {
+ // Ignore outside native Tauri window context.
+ }
+}
+
+let hasNativeThemeOverride = false
+
+async function syncNativeTheme(mode: ThemeMode, resolved: ResolvedTheme) {
+ if (!isBrowser || !('__TAURI_INTERNALS__' in window)) return
+ try {
+ const win = getCurrentWindow()
+ // On Linux, tao 0.37.2's `setTheme(null)` clears GTK's dark preference instead of
+ // restoring system follow, so leave GTK's native preference untouched and sync only the
+ // webview background color.
+ if (isLinux) {
+ await win.setBackgroundColor(WINDOW_BG[resolved])
+ return
+ }
+ if (mode !== 'system') {
+ hasNativeThemeOverride = true
+ await win.setTheme(mode)
+ await win.setBackgroundColor(WINDOW_BG[resolved])
+ return
+ }
+ if (hasNativeThemeOverride) {
+ hasNativeThemeOverride = false
+ await win.setTheme(null)
+ const actual = systemPreference()
+ if (useTheme.getState().mode === 'system') {
+ applyDomTheme(actual)
+ useTheme.setState({ resolved: actual })
+ await win.setBackgroundColor(WINDOW_BG[actual])
+ return
+ }
+ }
+ await win.setBackgroundColor(WINDOW_BG[resolved])
+ } catch {
+ // Ignore outside native Tauri window context.
+ }
+}
+
+interface ThemeState {
+ mode: ThemeMode
+ resolved: ResolvedTheme
+ setMode: (mode: ThemeMode) => void
+}
+
+const initialMode = readStoredMode()
+const initialResolved = resolveTheme(initialMode)
+
+export const useTheme = create()((set) => ({
+ mode: initialMode,
+ resolved: initialResolved,
+ setMode: (mode) => {
+ const resolved = resolveTheme(mode)
+ if (isBrowser) {
+ try {
+ window.localStorage.setItem(STORAGE_KEY, mode)
+ } catch {
+ // Ignore storage errors.
+ }
+ }
+ applyDomTheme(resolved)
+ set({ mode, resolved })
+ void syncNativeTheme(mode, resolved)
+ },
+}))
+
+let initialized = false
+
+/** Call once before React mounts so the first paint uses the active theme. */
+export function initTheme() {
+ if (!isBrowser || initialized) return
+ initialized = true
+
+ const { mode, resolved } = useTheme.getState()
+ applyDomTheme(resolved)
+ void syncNativeTheme(mode, resolved)
+
+ const mq = window.matchMedia?.('(prefers-color-scheme: dark)')
+ if (!mq) return
+ const onChange = () => {
+ if (useTheme.getState().mode !== 'system') return
+ const next = systemPreference()
+ applyDomTheme(next)
+ syncWindowBg(next)
+ useTheme.setState({ resolved: next })
+ }
+ mq.addEventListener('change', onChange)
+}
diff --git a/apps/desktop/src/main.tsx b/apps/desktop/src/main.tsx
index 233a445..9580bbe 100644
--- a/apps/desktop/src/main.tsx
+++ b/apps/desktop/src/main.tsx
@@ -3,6 +3,10 @@ import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { App } from './App'
import './index.css'
+import { initTheme } from './lib/theme'
+
+// Apply saved or OS theme before first paint so light/dark never flickers.
+initTheme()
const client = new QueryClient({
defaultOptions: {
diff --git a/apps/desktop/src/views/Import.tsx b/apps/desktop/src/views/Import.tsx
index a9e25db..9caa934 100644
--- a/apps/desktop/src/views/Import.tsx
+++ b/apps/desktop/src/views/Import.tsx
@@ -1,6 +1,7 @@
import { useQuery } from '@tanstack/react-query'
import { open } from '@tauri-apps/plugin-dialog'
import { useDeferredValue, useState } from 'react'
+import { DownloadIcon, FileArchiveIcon, FolderIcon, SearchIcon } from '../components/Icons'
import { PageHeader } from '../components/PageHeader'
import { Button, Empty, ErrorLine, Input, Tabs, Thumb } from '../components/ui'
import { call } from '../lib/api'
@@ -26,18 +27,18 @@ export function ImportView() {
const hasCf = (settings.data?.curseforge_key ?? '') !== ''
return (
<>
-
-
-
-
+
+ },
+ { value: 'modrinth', label: 'Modrinth modpacks', icon: },
+ ...(hasCf
+ ? [{ value: 'curseforge' as const, label: 'CurseForge modpacks', icon: }]
+ : []),
+ ]}
+ />
{tab === 'file' &&
}
{tab === 'modrinth' &&
}
@@ -59,17 +60,32 @@ function FromDisk() {
if (dir) folder.mutate(dir)
}
return (
-
-
-
Modpack file
-
.mrpack, CurseForge .zip or a Prism Launcher export.
+
+
+
+
+
+
+
Modpack file
+
+ Import a .mrpack, CurseForge{' '}
+ .zip, or a Prism Launcher export.
+
+
-
-
Existing instance
-
A Prism or MultiMC instance folder. Its files stay as they are.
+
+
+
+
+
+
Existing instance
+
+ Track an existing Prism or MultiMC instance folder. Its files stay untouched right where they are.
+
+
@@ -88,25 +104,39 @@ function Modrinth() {
})
const install = useImport((project: string) => call('install_modrinth_pack', { project }), 'Installing modpack')
return (
-
-
- setQ(e.target.value)} className="w-full max-w-md" />
-
+
+
}
+ placeholder="Search Modrinth modpacks"
+ value={q}
+ onChange={(e) => setQ(e.target.value)}
+ className="w-full max-w-md"
+ />
- {results.data?.hits.map((h) => (
-
install.mutate(h.project_id)} disabled={install.isPending}>
- Install
-
- }
- />
- ))}
+ {results.data?.hits.length === 0 && (
+ } title="No modpacks found">
+ Try a different keyword.
+
+ )}
+ {results.data && results.data.hits.length > 0 && (
+
+ {results.data.hits.map((h) => (
+ install.mutate(h.project_id)} disabled={install.isPending}>
+
+ Install
+
+ }
+ />
+ ))}
+
+ )}
)
}
@@ -121,26 +151,39 @@ function CurseForge() {
})
const install = useImport((id: number) => call('install_curseforge_pack', { id }), 'Installing modpack')
return (
-
-
- setQ(e.target.value)} className="w-full max-w-md" />
-
+
+
}
+ placeholder="Search CurseForge modpacks"
+ value={q}
+ onChange={(e) => setQ(e.target.value)}
+ className="w-full max-w-md"
+ />
- {results.data?.length === 0 &&
No modpacks found}
- {results.data?.map((m) => (
-
install.mutate(m.id)} disabled={install.isPending}>
- Install
-
- }
- />
- ))}
+ {results.data?.length === 0 && (
+ } title="No modpacks found">
+ Try a different keyword.
+
+ )}
+ {results.data && results.data.length > 0 && (
+
+ {results.data.map((m) => (
+ install.mutate(m.id)} disabled={install.isPending}>
+
+ Install
+
+ }
+ />
+ ))}
+
+ )}
)
}
@@ -159,14 +202,14 @@ export function ResultRow({
action: React.ReactNode
}) {
return (
-
-
+
+
- {title}
+ {title}
{meta}
-
{description}
+
{description}
{action}
diff --git a/apps/desktop/src/views/Join.tsx b/apps/desktop/src/views/Join.tsx
index c28438f..2a43618 100644
--- a/apps/desktop/src/views/Join.tsx
+++ b/apps/desktop/src/views/Join.tsx
@@ -1,7 +1,8 @@
import { useQuery } from '@tanstack/react-query'
import { useState } from 'react'
+import { GitBranchIcon, LinkCodeIcon, PlayIcon, SearchIcon, ServerIcon } from '../components/Icons'
import { PageHeader } from '../components/PageHeader'
-import { Button, Input } from '../components/ui'
+import { Button, Input, Tag } from '../components/ui'
import { call } from '../lib/api'
import { loaderText, shortId } from '../lib/format'
import { keys, useAction, useApp } from '../lib/store'
@@ -30,74 +31,114 @@ export function JoinView({ initial }: { initial?: string }) {
return (
<>
-
-
-
-
- {p && (
-
-
-
{p.name}
-
- by {p.owner} · Minecraft {p.minecraft} · {loaderText(p.loader)}
-
- {p.description &&
{p.description}
}
+
+
+
+
+
+
+ Share code or link
-
- - Latest version
- - {p.latest ? p.latest.name : 'Nothing published yet'}
- - Servers
- -
- {p.servers.length === 0 && None}
- {p.servers.map((s) => (
-
- ● {s.name}{' '}
- {s.address}
- {s.commit && · {shortId(s.commit)}}
-
- ))}
-
-
-
- {mine && (
-
- )}
-
-
-
- {mine
- ? 'Editing continues your pack on this computer from its newest saved version. Playing only follows its updates.'
- : "Playing keeps you on the owner's updates. Your own copy can be changed freely and can still get updates later."}
-
+
- )}
+
+ {p && (
+
+
+
+
{p.name}
+
+ Minecraft {p.minecraft}
+
+ {loaderText(p.loader)}
+
+
+ Published by {p.owner}
+
+ {p.description &&
{p.description}
}
+
+
+
+
+ - Latest version
+ -
+ {p.latest ? (
+
+ {p.latest.name}
+
+ ) : (
+ Nothing published yet
+ )}
+
+ - Servers
+ -
+ {p.servers.length === 0 && None attached}
+ {p.servers.map((srv) => (
+
+
+
+ {srv.name}
+ {srv.address}
+ {srv.commit && {shortId(srv.commit)}}
+
+ ))}
+
+
+
+
+ {mine && (
+
+ )}
+
+
+
+
+
+ {mine
+ ? 'Editing continues your pack on this computer from its newest saved version. Playing only follows its updates.'
+ : "Playing keeps you on the owner's updates. Your own copy can be changed freely and can still get updates later."}
+
+
+
+ )}
+
>
)
diff --git a/apps/desktop/src/views/Library.tsx b/apps/desktop/src/views/Library.tsx
index 8d00fba..59d1375 100644
--- a/apps/desktop/src/views/Library.tsx
+++ b/apps/desktop/src/views/Library.tsx
@@ -1,58 +1,221 @@
import { useQuery } from '@tanstack/react-query'
import { useState } from 'react'
+import {
+ ChevronRightIcon,
+ CubeIcon,
+ DiffIcon,
+ DownloadIcon,
+ GridViewIcon,
+ LinkCodeIcon,
+ ListViewIcon,
+ PlayIcon,
+ PlusIcon,
+ SearchIcon,
+ ServerIcon,
+} from '../components/Icons'
import { InstanceIcon } from '../components/InstanceIcon'
-import { PageHeader } from '../components/PageHeader'
import { Button, Empty, ErrorLine, Input, Tag } from '../components/ui'
import { call } from '../lib/api'
import { LOADER_LABEL } from '../lib/format'
import { keys, useAction, useApp } from '../lib/store'
import type { LibraryItem } from '../lib/types'
+type Layout = 'grid' | 'list'
+
+const LAYOUT_KEY = 'beaconsync-library-layout'
+
+function readLayout(): Layout {
+ try {
+ return window.localStorage.getItem(LAYOUT_KEY) === 'list' ? 'list' : 'grid'
+ } catch {
+ return 'grid'
+ }
+}
+
+const LIST_COLS =
+ 'grid-cols-[minmax(140px,1fr)_72px_124px_48px_132px_auto] @max-[760px]:grid-cols-[minmax(140px,1fr)_64px_120px_auto]'
+
export function LibraryView() {
const go = useApp((s) => s.go)
const set = useApp((s) => s.set)
const [filter, setFilter] = useState('')
+ const [layout, setLayout] = useState
(readLayout)
+
// Cheap folder listing; refetch on open so instances made in Prism show up.
const library = useQuery({ queryKey: keys.library, queryFn: () => call('list_instances'), refetchOnMount: 'always' })
- const items = (library.data ?? []).filter((i) => i.name.toLowerCase().includes(filter.trim().toLowerCase()))
+ const all = library.data ?? []
+ const q = filter.trim().toLowerCase()
+ const filtered = all.filter((i) => !q || i.name.toLowerCase().includes(q) || i.minecraft.toLowerCase().includes(q))
+ const tracked = filtered.filter((i) => i.tracked)
+ const untracked = filtered.filter((i) => !i.tracked)
+
+ // Show the featured Hero Stage when there is at least one tracked pack and no active search filter.
+ const hero = !q && layout === 'grid' ? tracked[0] : undefined
+ const restTracked = hero ? tracked.slice(1) : tracked
+
+ const pickLayout = (next: Layout) => {
+ setLayout(next)
+ try {
+ window.localStorage.setItem(LAYOUT_KEY, next)
+ } catch {
+ // Ignore storage errors.
+ }
+ }
return (
- <>
-
- setFilter(e.target.value)} className="w-48" />
-
-
+
+ {/* Studio Gallery Top Toolbar */}
+
+
+
Library
+ {all.length > 0 && (
+
+ {all.filter((i) => i.tracked).length} tracked
+ {all.some((i) => !i.tracked) ? ` · ${all.filter((i) => !i.tracked).length} in Prism` : ''}
+
+ )}
+
+
+ {all.length > 0 && (
+ <>
+
}
+ placeholder="Filter packs…"
+ value={filter}
+ onChange={(e) => setFilter(e.target.value)}
+ className="w-48"
+ />
+
+
+
+
+ >
+ )}
+
-
+
+
-
- {library.data && library.data.length === 0 ? (
-
set({ newPackOpen: true })}>New pack}>
- No packs yet. Create one, import a modpack or join with a code.
+ {library.error && (
+
+
+
+ )}
+
+ {library.data && all.length === 0 ? (
+ }
+ title="Start your first modpack"
+ action={
+
+
+
+
+
+ }
+ >
+ Create a pack from scratch, import a Modrinth or CurseForge modpack, or join a friend's pack with a share code.
- ) : (
-
-
-
Name
-
Minecraft
-
Loader
-
Mods
-
State
-
+ ) : filtered.length === 0 && library.data ? (
+
} title="No matching packs">
+ No packs match "{filter.trim()}".
+
+ ) : layout === 'list' ? (
+
+
+
+ Name
+ MC
+ Loader
+ Mods
+ Status
+ Actions
+
+ {filtered.map((i) => (
+
|
+ ))}
- {items.map((i) => (
-
|
- ))}
+
+ ) : (
+
+ {hero &&
}
+
+ {restTracked.length > 0 && (
+
+ {hero && (
+
+ More tracked packs ({restTracked.length})
+
+ )}
+
+ {restTracked.map((i) => (
+
+ ))}
+
+
+ )}
+
+ {untracked.length > 0 && (
+
+
+
+ Detected in Prism Launcher ({untracked.length})
+
+ Track any instance to version, share, and deploy it
+
+
+ {untracked.map((i) => (
+
+ ))}
+
+
+ )}
)}
- >
+
)
}
-function Row({ item }: { item: LibraryItem }) {
+function usePackRowActions(item: LibraryItem) {
const go = useApp((s) => s.go)
const open = () => item.tracked && go({ name: 'pack', path: item.path, tab: 'mods' })
const badges = useQuery({
@@ -67,41 +230,241 @@ function Row({ item }: { item: LibraryItem }) {
done: `${item.name} is now tracked`,
})
const play = useAction(() => call('launch', { path: item.path }), { label: 'Starting Minecraft', done: 'Minecraft is starting' })
+ return { go, open, badges, track, play }
+}
+
+/** Featured spotlight banner for the primary tracked pack. */
+function HeroPack({ item }: { item: LibraryItem }) {
+ const { go, open, badges, play } = usePackRowActions(item)
+ const settings = useQuery({ queryKey: keys.settings, queryFn: () => call('get_settings') })
+ const subscriber = item.role === 'subscriber'
+
+ return (
+
+
+
+
+
+
+ Featured Pack
+ {subscriber && (
+
+ Joined
+
+ )}
+ {item.upstream && from {item.upstream}}
+ {badges.data && badges.data.unsaved > 0 && !subscriber && (
+
+ {badges.data.unsaved} unsaved
+
+ )}
+ {badges.data?.update && (
+
+ Update available
+
+ )}
+
+
+
{item.name}
+
+
+
+ Minecraft {item.minecraft}
+
+ ·
+
+ {LOADER_LABEL[item.loader.kind]}
+ {item.loader.version ? ` ${item.loader.version}` : ''}
+
+ ·
+
+ {item.mod_count} mod{item.mod_count === 1 ? '' : 's'}
+
+
+
+
+
+
+
+
+
+
+ {/* Quick-jump studio shortcuts */}
+
+
+ {!subscriber && (
+ <>
+
+ {settings.data?.signed_in && (
+
+ )}
+ >
+ )}
+
+
+ )
+}
+
+function PackCard({ item }: { item: LibraryItem }) {
+ const { open, badges, track, play } = usePackRowActions(item)
+
+ return (
+
+ {/* Flat solid header band */}
+
+
+
+ {item.minecraft}
+
+
+ {LOADER_LABEL[item.loader.kind]}
+
+
+
+
+
+
+
+
+
+ {item.tracked ? (
+
+ ) : (
+
{item.name}
+ )}
+
+ {item.loader.version ? `${LOADER_LABEL[item.loader.kind]} ${item.loader.version}` : LOADER_LABEL[item.loader.kind]}
+
+
+
+
+ {!item.tracked && Prism instance}
+ {item.role === 'subscriber' && (
+
+ Joined
+
+ )}
+ {item.upstream && from {item.upstream}}
+ {badges.data && badges.data.unsaved > 0 && item.role !== 'subscriber' && (
+
+ {badges.data.unsaved} unsaved
+
+ )}
+ {badges.data?.update && (
+
+ Update available
+
+ )}
+
+
+
+
+
+ {item.mod_count} mod{item.mod_count === 1 ? '' : 's'}
+
+
+ {!item.tracked && (
+
+ )}
+
+
+
+
+
+ )
+}
+
+function Row({ item }: { item: LibraryItem }) {
+ const { open, badges, track, play } = usePackRowActions(item)
return (
-
-
-
{item.name}
- {item.role === 'subscriber' &&
joined}
- {item.upstream &&
from {item.upstream}}
+
+
+ {item.tracked ? (
+
+ ) : (
+ {item.name}
+ )}
+ {item.role === 'subscriber' && Joined}
+ {item.upstream && from {item.upstream}}
-
{item.minecraft}
-
+ {item.minecraft}
+
{LOADER_LABEL[item.loader.kind]} {item.loader.version}
- {item.mod_count}
-
+
{item.mod_count}
+
{!item.tracked && Not tracked}
- {badges.data && badges.data.unsaved > 0 && item.role !== 'subscriber' && {badges.data.unsaved} unsaved}
- {badges.data?.update && Update available}
+ {badges.data && badges.data.unsaved > 0 && item.role !== 'subscriber' && (
+
+ {badges.data.unsaved} unsaved
+
+ )}
+ {badges.data?.update && (
+
+ Update
+
+ )}
-
e.stopPropagation()}>
+
{!item.tracked && (
)}
-
)
}
-
diff --git a/apps/desktop/src/views/NewPack.tsx b/apps/desktop/src/views/NewPack.tsx
index a39009e..86d3198 100644
--- a/apps/desktop/src/views/NewPack.tsx
+++ b/apps/desktop/src/views/NewPack.tsx
@@ -61,49 +61,68 @@ function NewPackDialog({ onClose }: { onClose: () => void }) {
return (