Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(editor): Content Browser asset ops + live fs sync + Output Log UE5 interactions

esengine3779ba073060
diff --git a/desktop/electron/main.ts b/desktop/electron/main.ts
index 0e0d463dc..4387a718c 100644
--- a/desktop/electron/main.ts
+++ b/desktop/electron/main.ts
@@ -1,6 +1,7 @@
import { app, BrowserWindow, shell, ipcMain, dialog, protocol } from 'electron';
import { fileURLToPath } from 'node:url';
import { readFile } from 'node:fs/promises';
+import { existsSync } from 'node:fs';
import path from 'node:path';
import {
openProject,
@@ -8,14 +9,20 @@ import {
readInRoot,
writeInRoot,
readDirInRoot,
+ renameInRoot,
+ mkdirInRoot,
+ duplicateInRoot,
+ statInRoot,
saveWorkspace,
resolveInRoot,
+ META_EXT,
} from './projectFs';
import { listRecents, addRecent, listTemplates, createFromTemplate } from './launcher';
import { buildProjectScripts } from './buildScripts';
import { extractProjectSchemas } from './extractSchemas';
import { scanAssetDatabase } from './assetDb';
import { cookAssets } from './cookAssets';
+import { startProjectWatch, stopProjectWatch } from './projectWatcher';
import { resolveScripts } from '../src/project/format';
import type { WorkspaceState } from '../src/project/format';
@@ -112,6 +119,13 @@ const requireRoot = (): string => {
return projectRoot;
};
+// Adopt a freshly opened project as the active root + (re)start the fs watcher
+// so on-disk changes push to the renderer.
+function adoptRoot(root: string): void {
+ projectRoot = root;
+ if (win) startProjectWatch(root, win.webContents);
+}
+
ipcMain.handle('project:openDialog', async () => {
if (!win) return null;
const res = await dialog.showOpenDialog(win, {
@@ -120,13 +134,13 @@ ipcMain.handle('project:openDialog', async () => {
});
if (res.canceled || res.filePaths.length === 0) return null;
const opened = await openProject(res.filePaths[0]);
- projectRoot = opened.root;
+ adoptRoot(opened.root);
return opened;
});
ipcMain.handle('project:open', async (_e, root: string) => {
const opened = await openProject(root);
- projectRoot = opened.root;
+ adoptRoot(opened.root);
return opened;
});
@@ -135,6 +149,24 @@ ipcMain.handle('fs:write', (_e, relPath: string, contents: string) =>
writeInRoot(requireRoot(), relPath, contents),
);
ipcMain.handle('fs:readdir', (_e, relPath: string) => readDirInRoot(requireRoot(), relPath));
+ipcMain.handle('fs:rename', (_e, fromRel: string, toRel: string) =>
+ renameInRoot(requireRoot(), fromRel, toRel),
+);
+ipcMain.handle('fs:mkdir', (_e, relPath: string) => mkdirInRoot(requireRoot(), relPath));
+ipcMain.handle('fs:duplicate', (_e, relPath: string) => duplicateInRoot(requireRoot(), relPath));
+ipcMain.handle('fs:stat', (_e, relPath: string) => statInRoot(requireRoot(), relPath));
+// Delete to the OS trash (recoverable, not an unrecoverable rm) — the asset's
+// `.meta` sidecar goes with it so no orphan stays in the registry.
+ipcMain.handle('fs:trash', async (_e, relPath: string) => {
+ const abs = resolveInRoot(requireRoot(), relPath);
+ await shell.trashItem(abs);
+ const meta = abs + META_EXT;
+ if (existsSync(meta)) await shell.trashItem(meta);
+});
+// Reveal a file/folder in the OS file manager (Finder / Explorer).
+ipcMain.handle('shell:showItem', (_e, relPath: string) => {
+ shell.showItemInFolder(resolveInRoot(requireRoot(), relPath));
+});
ipcMain.handle('workspace:save', (_e, ws: WorkspaceState) => saveWorkspace(requireRoot(), ws));
// Bundle the open project's startup script (manifest scripts.main, default
@@ -236,5 +268,6 @@ app.on('activate', () => {
app.on('window-all-closed', () => {
win = null;
+ stopProjectWatch();
if (process.platform !== 'darwin') app.quit();
});
diff --git a/desktop/electron/preload.ts b/desktop/electron/preload.ts
index 14b72ab46..70dcdbe34 100644
--- a/desktop/electron/preload.ts
+++ b/desktop/electron/preload.ts
@@ -47,6 +47,33 @@ const api = {
write: (relPath: string, contents: string): Promise<void> =>
ipcRenderer.invoke('fs:write', relPath, contents),
readDir: (relPath: string): Promise<DirEntry[]> => ipcRenderer.invoke('fs:readdir', relPath),
+ /** Rename / move; a file's `.meta` sidecar travels with it (identity stable). */
+ rename: (fromRel: string, toRel: string): Promise<void> =>
+ ipcRenderer.invoke('fs:rename', fromRel, toRel),
+ /** Create a folder (refuses if it already exists). */
+ mkdir: (relPath: string): Promise<void> => ipcRenderer.invoke('fs:mkdir', relPath),
+ /** Duplicate a file/folder next to itself (new uuid); returns the new path. */
+ duplicate: (relPath: string): Promise<string> => ipcRenderer.invoke('fs:duplicate', relPath),
+ /** Delete to the OS trash (recoverable), sidecar included. */
+ trash: (relPath: string): Promise<void> => ipcRenderer.invoke('fs:trash', relPath),
+ /** Size + modified time (for the asset tooltip / inspector metadata). */
+ stat: (relPath: string): Promise<{ size: number; mtimeMs: number; isDir: boolean }> =>
+ ipcRenderer.invoke('fs:stat', relPath),
+ /**
+ * Subscribe to project file changes (main pushes after on-disk edits, incl.
+ * edits made outside the editor). Returns an unsubscribe fn. This is the
+ * editor's reusable main→renderer push primitive.
+ */
+ onChange: (cb: (paths: string[]) => void): (() => void) => {
+ const listener = (_e: unknown, payload: { paths: string[] }) => cb(payload.paths);
+ ipcRenderer.on('project:fsChanged', listener);
+ return () => ipcRenderer.removeListener('project:fsChanged', listener);
+ },
+ },
+ // OS shell integration.
+ shell: {
+ /** Reveal a file/folder in Finder / Explorer. */
+ showItem: (relPath: string): Promise<void> => ipcRenderer.invoke('shell:showItem', relPath),
},
workspace: {
save: (ws: WorkspaceState): Promise<void> => ipcRenderer.invoke('workspace:save', ws),
diff --git a/desktop/electron/projectFs.ts b/desktop/electron/projectFs.ts
index 045ff19bf..b1bc64b2b 100644
--- a/desktop/electron/projectFs.ts
+++ b/desktop/electron/projectFs.ts
@@ -6,8 +6,9 @@
* refused, so a compromised/buggy renderer can't read or write arbitrary files.
* See RC12 §E7.
*/
-import { readFile, writeFile, readdir, mkdir } from 'node:fs/promises';
+import { readFile, writeFile, readdir, mkdir, rename, cp, stat } from 'node:fs/promises';
import { existsSync } from 'node:fs';
+import { randomUUID } from 'node:crypto';
import path from 'node:path';
import {
PROJECT_MANIFEST_FILE,
@@ -74,6 +75,97 @@ export async function readDirInRoot(root: string, relPath: string): Promise<DirE
return entries.map((e) => ({ name: e.name, isDir: e.isDirectory() }));
}
+/** Sidecar suffix carrying an asset's uuid/type/importer (see assetDb). */
+export const META_EXT = '.meta';
+
+/** Project-relative, forward-slashed form of an absolute path under `root`. */
+const toRel = (root: string, abs: string): string => path.relative(root, abs).split(path.sep).join('/');
+
+/** Yield every file (recursively) under an absolute directory. */
+async function* walkFiles(absDir: string): AsyncGenerator<string> {
+ for (const e of await readdir(absDir, { withFileTypes: true })) {
+ const p = path.join(absDir, e.name);
+ if (e.isDirectory()) yield* walkFiles(p);
+ else yield p;
+ }
+}
+
+/**
+ * Rename / move a file or folder within the project. A file's `.meta` sidecar
+ * travels with it so rename preserves asset identity (uuid). Refuses to clobber
+ * an existing destination.
+ */
+export async function renameInRoot(root: string, fromRel: string, toRelPath: string): Promise<void> {
+ const from = resolveInRoot(root, fromRel);
+ const to = resolveInRoot(root, toRelPath);
+ if (from === to) return;
+ if (existsSync(to)) throw new Error(`"${toRelPath}" already exists`);
+ await mkdir(path.dirname(to), { recursive: true });
+ await rename(from, to);
+ const fromMeta = from + META_EXT;
+ if (existsSync(fromMeta)) await rename(fromMeta, to + META_EXT);
+}
+
+/** Create a folder; refuses if it already exists (the caller owns name choice). */
+export async function mkdirInRoot(root: string, relPath: string): Promise<void> {
+ const abs = resolveInRoot(root, relPath);
+ if (existsSync(abs)) throw new Error(`"${relPath}" already exists`);
+ await mkdir(abs, { recursive: true });
+}
+
+/** Assign a fresh uuid to a `.meta` file (a duplicated asset must not share one). */
+async function regenMetaUuid(metaAbs: string): Promise<void> {
+ try {
+ const meta = JSON.parse(await readFile(metaAbs, 'utf8'));
+ meta.uuid = randomUUID();
+ await writeFile(metaAbs, JSON.stringify(meta, null, 2) + '\n', 'utf8');
+ } catch {
+ // Leave a malformed sidecar untouched — the scanner will warn on it anyway.
+ }
+}
+
+/**
+ * Duplicate a file or folder next to itself ("foo.png" → "foo copy.png", then
+ * "foo copy 2.png"…). Every copied `.meta` sidecar gets a NEW uuid — two assets
+ * can't share an identity in the registry. Returns the new project-relative path.
+ */
+export async function duplicateInRoot(root: string, relPath: string): Promise<string> {
+ const from = resolveInRoot(root, relPath);
+ if (!existsSync(from)) throw new Error(`"${relPath}" does not exist`);
+ const isDir = (await stat(from)).isDirectory();
+
+ const dir = path.dirname(from);
+ const base = path.basename(from);
+ const ext = isDir ? '' : path.extname(base);
+ const stem = base.slice(0, base.length - ext.length);
+ let to = '';
+ for (let i = 1; ; i++) {
+ to = path.join(dir, `${stem}${i === 1 ? ' copy' : ` copy ${i}`}${ext}`);
+ if (!existsSync(to)) break;
+ }
+
+ await cp(from, to, { recursive: true });
+ if (isDir) {
+ for await (const f of walkFiles(to)) if (f.endsWith(META_EXT)) await regenMetaUuid(f);
+ } else {
+ const fromMeta = from + META_EXT;
+ if (existsSync(fromMeta)) {
+ await cp(fromMeta, to + META_EXT);
+ await regenMetaUuid(to + META_EXT);
+ }
+ }
+ return toRel(root, to);
+}
+
+/** Size + modified time for the asset tooltip / inspector metadata. */
+export async function statInRoot(
+ root: string,
+ relPath: string,
+): Promise<{ size: number; mtimeMs: number; isDir: boolean }> {
+ const s = await stat(resolveInRoot(root, relPath));
+ return { size: s.size, mtimeMs: s.mtimeMs, isDir: s.isDirectory() };
+}
+
/** Persist editor-local workspace state to `.esengine/workspace.json`. */
export async function saveWorkspace(root: string, workspace: WorkspaceState): Promise<void> {
const dir = path.join(root, WORKSPACE_DIR);
diff --git a/desktop/electron/projectWatcher.ts b/desktop/electron/projectWatcher.ts
new file mode 100644
index 000000000..dad41dc15
--- /dev/null
+++ b/desktop/electron/projectWatcher.ts
@@ -0,0 +1,72 @@
+/**
+ * @file Project filesystem watcher (REARCH_ASSETS A2 — live asset sync).
+ *
+ * Watches the open project root and pushes a debounced, coalesced change event to
+ * the renderer so the asset registry + Content Browser stay in sync with on-disk
+ * reality — including edits made OUTSIDE the editor (Finder, git, build output,
+ * the cook step). This is the editor's first main→renderer PUSH channel; the rest
+ * of the bridge is request/response.
+ *
+ * Uses native recursive `fs.watch` (no dependency). Recursive watching is native
+ * on macOS + Windows; on Linux `fs.watch` is non-recursive, so it degrades to the
+ * top level there — a chokidar swap behind this same IPC contract is the
+ * cross-platform upgrade if/when Linux dev matters.
+ */
+import { watch, type FSWatcher } from 'node:fs';
+import type { WebContents } from 'electron';
+
+// Our own cache writes (assets.json / schemas.json / scripts.mjs under
+// `.esengine`) MUST be ignored — refreshing on them would loop. Plus the usual
+// heavy/irrelevant noise dirs.
+const IGNORED = ['.esengine', 'node_modules', '.git', 'dist', 'build'];
+
+/** True if a project-relative path is watcher noise (an ignored dir or its tree). */
+export function isIgnoredPath(rel: string): boolean {
+ const norm = rel.replace(/\\/g, '/');
+ return IGNORED.some((d) => norm === d || norm.startsWith(`${d}/`));
+}
+
+const DEBOUNCE_MS = 180;
+
+let watcher: FSWatcher | null = null;
+let timer: ReturnType<typeof setTimeout> | null = null;
+let pending = new Set<string>();
+
+/** Stop watching (project switch / window close). */
+export function stopProjectWatch(): void {
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ pending = new Set();
+ if (watcher) {
+ watcher.close();
+ watcher = null;
+ }
+}
+
+/**
+ * Watch `root` and push `project:fsChanged` to `wc` (debounced + coalesced) on
+ * any change outside the ignored set. Replaces any existing watch. Failure to
+ * watch is non-fatal — the editor's own mutations still refresh optimistically.
+ */
+export function startProjectWatch(root: string, wc: WebContents): void {
+ stopProjectWatch();
+ try {
+ watcher = watch(root, { recursive: true }, (_event, filename) => {
+ if (!filename) return; // no path → can't filter safely (would risk the cache loop)
+ const rel = filename.toString().replace(/\\/g, '/');
+ if (isIgnoredPath(rel)) return;
+ pending.add(rel);
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(() => {
+ const paths = [...pending];
+ pending = new Set();
+ timer = null;
+ if (!wc.isDestroyed()) wc.send('project:fsChanged', { paths });
+ }, DEBOUNCE_MS);
+ });
+ } catch (err) {
+ console.warn('[watcher] could not watch project root', err);
+ }
+}
diff --git a/desktop/src/App.tsx b/desktop/src/App.tsx
index f11e356a0..a90a1cb30 100644
--- a/desktop/src/App.tsx
+++ b/desktop/src/App.tsx
@@ -3,6 +3,8 @@ import { MenuBar } from '@/layout/MenuBar';
import { Toolbar } from '@/layout/Toolbar';
import { StatusBar } from '@/layout/StatusBar';
import { DockLayout } from '@/layout/DockLayout';
+import { ActivityBar } from '@/layout/ActivityBar';
+import { ContentDrawer } from '@/layout/ContentDrawer';
import { defaultSession } from '@/engine/EditorSession';
import { Launcher } from '@/launcher/Launcher';
import { Toaster } from '@/components/Toaster';
@@ -17,6 +19,12 @@ export function App() {
// backspace-to-delete-text aren't hijacked.
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
+ // Ctrl+Space summons the Content Drawer — works even from a field.
+ if ((e.ctrlKey || e.metaKey) && e.code === 'Space') {
+ e.preventDefault();
+ useEditorStore.getState().toggleContentDrawer();
+ return;
+ }
const el = document.activeElement as HTMLElement | null;
if (el && (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.isContentEditable)) {
return;
@@ -51,9 +59,11 @@ export function App() {
<MenuBar />
<Toolbar />
<main className="shell__workspace">
+ <ActivityBar />
<DockLayout />
</main>
<StatusBar />
+ <ContentDrawer />
<Toaster />
</div>
);
diff --git a/desktop/src/components/AddComponentMenu.tsx b/desktop/src/components/AddComponentMenu.tsx
index 6e72cf031..6cbefec3d 100644
--- a/desktop/src/components/AddComponentMenu.tsx
+++ b/desktop/src/components/AddComponentMenu.tsx
@@ -1,9 +1,9 @@
/**
* @file AddComponentMenu.tsx
- * @brief UE5-style "Add Component" picker — a portaled popover with a search
- * box, category-grouped entries, per-component icons, and full keyboard
- * navigation (type to filter, ↑/↓ to move, Enter to add, Esc to close).
- * Replaces the flat ContextMenu list the inspector used before.
+ * @brief "Add Component" picker — a centered command-palette modal with a
+ * search box, category-grouped entries, per-component icons, and full
+ * keyboard navigation (type to filter, ↑/↓ to move, Enter to add, Esc to
+ * close). Markup + styling follow the design (.ac picker).
*/
import { useEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
@@ -17,9 +17,6 @@ export interface AddComponentEntry {
category: string;
}
-const WIDTH = 248;
-const MAX_H = 380;
-
function groupByCategory(entries: AddComponentEntry[]) {
const byCat = new Map<string, AddComponentEntry[]>();
for (const e of entries) {
@@ -42,14 +39,10 @@ function groupByCategory(entries: AddComponentEntry[]) {
}
export function AddComponentMenu({
- x,
- y,
entries,
onAdd,
onClose,
}: {
- x: number;
- y: number;
entries: AddComponentEntry[];
onAdd: (name: string) => void;
onClose: () => void;
@@ -59,7 +52,7 @@ export function AddComponentMenu({
const inputRef = useRef<HTMLInputElement>(null);
const activeRef = useRef<HTMLButtonElement>(null);
- // Focus the search on open (type-to-filter immediately, like UE5).
+ // Focus the search on open (type-to-filter immediately).
useEffect(() => {
inputRef.current?.focus();
}, []);
@@ -67,7 +60,7 @@ export function AddComponentMenu({
// Dismiss on an outside press (clicks inside stopPropagation below) or Esc.
// Deliberately NOT on scroll: the picker owns a scrollable list (the wheel
// scrolls it), and the popover is position:fixed so it stays put even if the
- // inspector behind scrolls — UE5 keeps the dropdown open while you scroll it.
+ // inspector behind scrolls — keep the dropdown open while you scroll it.
useEffect(() => {
const close = () => onClose();
const onKey = (e: KeyboardEvent) => {
@@ -122,62 +115,58 @@ export function AddComponentMenu({
}
};
- // Keep the popover on-screen near the trigger.
- const left = Math.max(8, Math.min(x, window.innerWidth - WIDTH - 8));
- const top = Math.max(8, Math.min(y, window.innerHeight - MAX_H - 8));
-
return createPortal(
- <div
- className="addcomp"
- role="menu"
- style={{ left, top, width: WIDTH, maxHeight: MAX_H }}
- onMouseDown={(e) => e.stopPropagation()}
- >
- <div className="addcomp__search">
- <Search size={13} strokeWidth={1.9} />
- <input
- ref={inputRef}
- className="addcomp__input"
- placeholder="Search Components"
- value={query}
- spellCheck={false}
- onChange={(e) => setQuery(e.target.value)}
- onKeyDown={onKeyDown}
- />
- </div>
+ <div className="ac-scrim open" onMouseDown={onClose}>
+ <div className="ac" role="dialog" onMouseDown={(e) => e.stopPropagation()}>
+ <div className="ac-search">
+ <Search size={15} strokeWidth={1.9} />
+ <input
+ ref={inputRef}
+ placeholder="Search components…"
+ value={query}
+ spellCheck={false}
+ onChange={(e) => setQuery(e.target.value)}
+ onKeyDown={onKeyDown}
+ />
+ <kbd className="esc">Esc</kbd>
+ </div>
- <div className="addcomp__list">
- {flat.length === 0 ? (
- <p className="addcomp__empty">
- {entries.length === 0 ? 'All components added' : 'No matching components'}
- </p>
- ) : (
- groups.map((g) => (
- <div key={g.category} className="addcomp__group">
- <div className="addcomp__cat">{g.category}</div>
- {g.items.map((it) => {
- const idx = flat.indexOf(it);
- const isActive = idx === active;
- return (
- <button
- key={it.name}
- ref={isActive ? activeRef : undefined}
- type="button"
- role="menuitem"
- className={`addcomp__item${isActive ? ' is-active' : ''}`}
- onMouseEnter={() => setActive(idx)}
- onClick={() => commit(it.name)}
- >
- <span className="addcomp__icon">
- <ComponentIcon name={it.name} />
- </span>
- <span className="addcomp__label">{it.label}</span>
- </button>
- );
- })}
+ <div className="ac-body">
+ {flat.length === 0 ? (
+ <div className="ac-empty">
+ {entries.length === 0 ? 'All components added' : 'No matching components'}
</div>
- ))
- )}
+ ) : (
+ groups.map((g) => (
+ <div key={g.category}>
+ <div className="ac-sec">{g.category}</div>
+ {g.items.map((it) => {
+ const idx = flat.indexOf(it);
+ const isActive = idx === active;
+ return (
+ <button
+ key={it.name}
+ ref={isActive ? activeRef : undefined}
+ type="button"
+ className={`ac-item${isActive ? ' sel' : ''}`}
+ onMouseEnter={() => setActive(idx)}
+ onClick={() => commit(it.name)}
+ >
+ <span className="ai">
+ <ComponentIcon name={it.name} size={16} />
+ </span>
+ <span className="at">
+ <div className="an">{it.label}</div>
+ <div className="ad">{it.name}</div>
+ </span>
+ <span className="ak">↵</span>
+ </button>
+ );
+ })}
+ </div>
+ ))
+ )}
+ </div>
</div>
</div>,
document.body,
diff --git a/desktop/src/components/Menu.tsx b/desktop/src/components/Menu.tsx
index 7eb62286f..4af3524cc 100644
--- a/desktop/src/components/Menu.tsx
+++ b/desktop/src/components/Menu.tsx
@@ -5,13 +5,21 @@
* (labels, shortcuts, checkmarks, disabled state, separators) and the
* context-menu dismiss behaviour live in a single place.
*/
-import { useEffect } from 'react';
+import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react';
import { createPortal } from 'react-dom';
import { Check } from 'lucide-react';
export type MenuItem =
| { sep: true }
- | { label: string; shortcut?: string; onClick: () => void; disabled?: boolean; checked?: boolean };
+ | {
+ label: string;
+ shortcut?: string;
+ onClick: () => void;
+ disabled?: boolean;
+ checked?: boolean;
+ icon?: ReactNode;
+ danger?: boolean;
+ };
/**
* The contents of a menu — separators and item buttons. Renders inside a
@@ -50,7 +58,10 @@ export function MenuItems({ items, onSelect }: { items: MenuItem[]; onSelect: ()
/**
* A right-click context menu: portaled to the document body, positioned at the
- * cursor, dismissed on an outside press, a scroll, or Escape.
+ * cursor, dismissed on an outside press, a scroll, or Escape. The position is
+ * clamped to the viewport after measuring — so a menu summoned near the right or
+ * bottom edge (e.g. the inspector's component "⋯") flips back on-screen instead
+ * of overflowing the window and getting clipped.
*/
export function ContextMenu({
x,
@@ -63,6 +74,21 @@ export function ContextMenu({
items: MenuItem[];
onClose: () => void;
}) {
+ const ref = useRef<HTMLDivElement>(null);
+ const [pos, setPos] = useState({ left: x, top: y });
+
+ // Measure the rendered menu and pull it back inside the viewport (runs before
+ // paint, so the clamped position is the first thing shown — no flash off-edge).
+ useLayoutEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const r = el.getBoundingClientRect();
+ const pad = 8;
+ const left = x + r.width > window.innerWidth - pad ? Math.max(pad, window.innerWidth - r.width - pad) : x;
+ const top = y + r.height > window.innerHeight - pad ? Math.max(pad, window.innerHeight - r.height - pad) : y;
+ setPos({ left, top });
+ }, [x, y]);
+
useEffect(() => {
const close = () => onClose();
const onKey = (e: KeyboardEvent) => {
@@ -80,12 +106,33 @@ export function ContextMenu({
return createPortal(
<div
- className="menu-dropdown menu-dropdown--ctx"
+ ref={ref}
+ className="ctx"
role="menu"
- style={{ left: x, top: y }}
+ style={{ left: pos.left, top: pos.top }}
onMouseDown={(e) => e.stopPropagation()}
>
- <MenuItems items={items} onSelect={onClose} />
+ {items.map((it, i) =>
+ 'sep' in it ? (
+ <div key={i} className="ctx-sep" />
+ ) : (
+ <button
+ key={i}
+ type="button"
+ role="menuitem"
+ className={`ctx-item${it.danger ? ' danger' : ''}`}
+ disabled={it.disabled}
+ onClick={() => {
+ onClose();
+ it.onClick();
+ }}
+ >
+ <span className="ci">{it.checked ? <Check size={13} strokeWidth={2.4} /> : it.icon}</span>
+ <span className="cl">{it.label}</span>
+ {it.shortcut ? <span className="ck">{it.shortcut}</span> : null}
+ </button>
+ ),
+ )}
</div>,
document.body,
);
diff --git a/desktop/src/engine/schema.ts b/desktop/src/engine/schema.ts
index 6ac8aae64..76517e85e 100644
--- a/desktop/src/engine/schema.ts
+++ b/desktop/src/engine/schema.ts
@@ -49,7 +49,7 @@ export function componentDefaults(def: AnyComp): Record<string, unknown> {
return (def as unknown as { _default: Record<string, unknown> })._default;
}
-// Add-Component picker categories, in display order (UE5 groups the picker by
+// Add-Component picker categories, in display order (the picker is grouped by
// category). Editor-side presentation policy — the engine has no category metadata
// today, so builtins are mapped/heuristic'd here; user/script components are
// authoritatively bucketed under "Scripts" via the engine's getUserComponents().
diff --git a/desktop/src/launcher/Launcher.tsx b/desktop/src/launcher/Launcher.tsx
index 9f194b879..fa30b120e 100644
--- a/desktop/src/launcher/Launcher.tsx
+++ b/desktop/src/launcher/Launcher.tsx
@@ -4,11 +4,11 @@ import { useEditorStore } from '@/store/editorStore';
import { ProjectStore } from '@/project/ProjectStore';
import type { RecentEntry, TemplateEntry } from '@/project/format';
-// Project browser shown before a project is open. Structure borrows Unity Hub
-// (persistent top actions, build-aware project list, grid/list views) and UE5's
-// Project Browser (template gallery + a create panel), worn in Estella's
-// "stellar instrument" identity. Recent / Open / New-from-template are wired to
-// ProjectStore + the recents / template IPC.
+// Project browser shown before a project is open. A hub layout — persistent top
+// actions, a build-aware project list with grid/list views, and a template
+// gallery + create panel — worn in Estella's "stellar instrument" identity.
+// Recent / Open / New-from-template are wired to ProjectStore + the recents /
+// template IPC.
type View = 'recent' | 'new';
type Layout = 'grid' | 'list';
diff --git a/desktop/src/layout/ActivityBar.tsx b/desktop/src/layout/ActivityBar.tsx
new file mode 100644
index 000000000..0b7be9e93
--- /dev/null
+++ b/desktop/src/layout/ActivityBar.tsx
@@ -0,0 +1,49 @@
+// Far-left icon rail (activity bar). Reveals docked panels and toggles the
+// Content Drawer — the summoned quick-access surface.
+import { ListTree, SlidersHorizontal, FolderOpen, Terminal, Settings } from 'lucide-react';
+import { useEditorStore } from '@/store/editorStore';
+import { dockApi } from '@/layout/dockApi';
+import { Toasts } from '@/store/Toasts';
+
+export function ActivityBar() {
+ const contentDrawer = useEditorStore((s) => s.contentDrawer);
+ const toggleContentDrawer = useEditorStore((s) => s.toggleContentDrawer);
+
+ return (
+ <div className="activity">
+ <button
+ type="button"
+ className="act"
+ title="Toggle right dock"
+ onClick={() => dockApi.toggleCollapse('outliner', 'width')}
+ >
+ <ListTree size={19} strokeWidth={1.7} />
+ </button>
+ <button type="button" className="act" title="Details" onClick={() => dockApi.reveal('details')}>
+ <SlidersHorizontal size={19} strokeWidth={1.7} />
+ </button>
+ <button
+ type="button"
+ className={`act${contentDrawer ? ' active' : ''}`}
+ title="Content Drawer (Ctrl+Space)"
+ onClick={toggleContentDrawer}
+ >
+ <FolderOpen size={19} strokeWidth={1.7} />
+ </button>
+ <button type="button" className="act" title="Output Log" onClick={() => dockApi.reveal('log')}>
+ <Terminal size={19} strokeWidth={1.7} />
+ </button>
+
+ <span className="act-spacer" />
+
+ <button
+ type="button"
+ className="act"
+ title="Settings"
+ onClick={() => Toasts.push('Settings — coming soon', 'info', 1600)}
+ >
+ <Settings size={19} strokeWidth={1.7} />
+ </button>
+ </div>
+ );
+}
diff --git a/desktop/src/layout/ContentDrawer.tsx b/desktop/src/layout/ContentDrawer.tsx
new file mode 100644
index 000000000..409c13b66
--- /dev/null
+++ b/desktop/src/layout/ContentDrawer.tsx
@@ -0,0 +1,41 @@
+// Content Drawer — the Content Browser slides up over the workspace as a quick
+// overlay (Ctrl+Space), on top of the docked Content Browser tab. Dismisses on
+// outside click or Esc.
+import { useEffect } from 'react';
+import { FolderOpen, X } from 'lucide-react';
+import { useEditorStore } from '@/store/editorStore';
+import { ContentBrowser } from '@/panels/ContentBrowser';
+
+export function ContentDrawer() {
+ const open = useEditorStore((s) => s.contentDrawer);
+ const setOpen = useEditorStore((s) => s.setContentDrawer);
+
+ useEffect(() => {
+ if (!open) return;
+ const onKey = (e: KeyboardEvent) => {
+ if (e.key === 'Escape') setOpen(false);
+ };
+ window.addEventListener('keydown', onKey);
+ return () => window.removeEventListener('keydown', onKey);
+ }, [open, setOpen]);
+
+ return (
+ <div className={`scrim${open ? ' open' : ''}`} onMouseDown={() => setOpen(false)}>
+ <div className="drawer" onMouseDown={(e) => e.stopPropagation()}>
+ <div className="drawer-head">
+ <span className="drawer-title">
+ <span className="ic">
+ <FolderOpen size={16} strokeWidth={1.8} />
+ </span>
+ Content Browser
+ </span>
+ <span className="drawer-sp" />
+ <button type="button" className="drawer-x" title="Close (Esc)" onClick={() => setOpen(false)}>
+ <X size={15} strokeWidth={2} />
+ </button>
+ </div>
+ <div className="drawer-body">{open && <ContentBrowser />}</div>
+ </div>
+ </div>
+ );
+}
diff --git a/desktop/src/layout/DockLayout.tsx b/desktop/src/layout/DockLayout.tsx
index bd24e3d8d..00af19e0d 100644
--- a/desktop/src/layout/DockLayout.tsx
+++ b/desktop/src/layout/DockLayout.tsx
@@ -5,6 +5,7 @@ import { Viewport } from '@/panels/Viewport';
import { Details } from '@/panels/Details';
import { ContentBrowser } from '@/panels/ContentBrowser';
import { OutputLog } from '@/panels/OutputLog';
+import { dockApi } from '@/layout/dockApi';
// Each dock panel is a thin wrapper so dockview owns mount/unmount.
const components: Record<string, FC<IDockviewPanelProps>> = {
@@ -15,26 +16,29 @@ const components: Record<string, FC<IDockviewPanelProps>> = {
log: () => <OutputLog />,
};
-const LAYOUT_KEY = 'estella.editor.layout.v1';
+// Bumped to v5 (tabbed docking): Viewport center, right column Outliner-over-
+// Details, and Content Browser + Output Log as sibling tabs along the bottom
+// (resize/close via dockview). The Content Drawer (Ctrl+Space) is a separate
+// quick-access overlay on top.
+const LAYOUT_KEY = 'estella.editor.layout.v5';
function buildDefaultLayout(api: DockviewReadyEvent['api']) {
- // Viewport is the anchor; everything docks around it — the UE5 arrangement.
+ // Viewport is the anchor; the right column stacks Outliner over Details.
api.addPanel({ id: 'viewport', component: 'viewport', title: 'Viewport' });
api.addPanel({
id: 'outliner',
component: 'outliner',
title: 'World Outliner',
- position: { referencePanel: 'viewport', direction: 'left' },
- initialWidth: 264,
+ position: { referencePanel: 'viewport', direction: 'right' },
+ initialWidth: 340,
});
api.addPanel({
id: 'details',
component: 'details',
title: 'Details',
- position: { referencePanel: 'viewport', direction: 'right' },
- initialWidth: 332,
+ position: { referencePanel: 'outliner', direction: 'below' },
});
api.addPanel({
@@ -42,10 +46,10 @@ function buildDefaultLayout(api: DockviewReadyEvent['api']) {
component: 'content',
title: 'Content Browser',
position: { referencePanel: 'viewport', direction: 'below' },
- initialHeight: 248,
+ initialHeight: 240,
});
- // Output Log shares the bottom group as a sibling tab of Content Browser.
+ // Output Log shares the bottom group as a sibling tab of the Content Browser.
api.addPanel({
id: 'log',
component: 'log',
@@ -57,6 +61,7 @@ function buildDefaultLayout(api: DockviewReadyEvent['api']) {
export function DockLayout() {
const onReady = (event: DockviewReadyEvent) => {
const { api } = event;
+ dockApi.set(api); // expose to the activity bar (reveal/focus panels)
const saved = localStorage.getItem(LAYOUT_KEY);
if (saved) {
diff --git a/desktop/src/layout/MenuBar.tsx b/desktop/src/layout/MenuBar.tsx
index 1097fd78f..eb0178938 100644
--- a/desktop/src/layout/MenuBar.tsx
+++ b/desktop/src/layout/MenuBar.tsx
@@ -1,5 +1,5 @@
// Top menu bar — functional dropdowns wired to the real editor commands
-// (project open/save, history, entity ops, view toggles), in the UE5 menu idiom.
+// (project open/save, history, entity ops, view toggles), in a classic menu idiom.
// The window is frameless (titleBarStyle: hiddenInset) so this strip doubles as
// the drag region; the menus + dropdowns opt out of dragging.
import { useEffect, useRef, useState, useSyncExternalStore } from 'react';
@@ -131,7 +131,7 @@ export function MenuBar() {
{
label: 'About Estella',
onClick: () => void window.estella?.getVersion?.()
- .then((v) => window.alert(`Estella Editor${v ? ' · ' + v : ''}\nA UE5-style editor for the Estella 2D engine.`))
+ .then((v) => window.alert(`Estella Editor${v ? ' · ' + v : ''}\nA modern editor for the Estella 2D engine.`))
.catch(() => window.alert('Estella Editor')),
},
],
@@ -140,15 +140,17 @@ export function MenuBar() {
return (
<div className="menubar" ref={barRef}>
- <div className="menubar__brand">
- <Mark />
- <span className="menubar__title">Estella</span>
+ <div className="brand">
+ <span className="brand-mark">
+ <Mark />
+ </span>
+ <span className="brand-name">Estella</span>
</div>
- <nav className="menubar__menus">
+ <nav className="menus">
{menus.map((m) => (
- <div key={m.title} className="menubar__menu">
+ <div key={m.title} className="menubar__menu" style={{ position: 'relative', display: 'flex' }}>
<button
- className={`menubar__item${open === m.title ? ' is-open' : ''}`}
+ className={`menu${open === m.title ? ' is-open' : ''}`}
type="button"
onClick={() => setOpen((o) => (o === m.title ? null : m.title))}
onMouseEnter={() => setOpen((o) => (o ? m.title : o))}
@@ -163,13 +165,14 @@ export function MenuBar() {
</div>
))}
</nav>
+ <div className="menubar-spacer" />
{project ? (
- <div className="menubar__project">
- <span className="menubar__project-name">{project.name}</span>
+ <div className="menubar-title">
+ <strong>{project.name}</strong>
{project.currentScene ? (
<>
- <span className="menubar__sep">/</span>
- <span className="menubar__scene mono">{project.currentScene.split('/').pop()}</span>
+ <span className="sep">/</span>
+ <span className="mono">{project.currentScene.split('/').pop()}</span>
</>
) : null}
</div>
diff --git a/desktop/src/layout/StatusBar.tsx b/desktop/src/layout/StatusBar.tsx
index 2e41687cd..ae882068d 100644
--- a/desktop/src/layout/StatusBar.tsx
+++ b/desktop/src/layout/StatusBar.tsx
@@ -1,41 +1,52 @@
import { useSyncExternalStore } from 'react';
-import { Circle, Gauge, MousePointer2, Boxes } from 'lucide-react';
+import { Gauge, MousePointer2, Boxes, FolderOpen } from 'lucide-react';
import { useEditorStore } from '@/store/editorStore';
import { useSelection } from '@/store/selectionStore';
import { StatsStore } from '@/engine/StatsStore';
// Bottom status strip — live engine telemetry (real FPS / entity count / cursor
-// world position) reads in the mono face.
+// world position) reads in the mono face. Anchors the Content Drawer.
export function StatusBar() {
const isPlaying = useEditorStore((s) => s.isPlaying);
+ const contentDrawer = useEditorStore((s) => s.contentDrawer);
+ const toggleContentDrawer = useEditorStore((s) => s.toggleContentDrawer);
const selectedIds = useSelection((s) => s.selectedIds);
const stats = useSyncExternalStore(StatsStore.subscribe, StatsStore.getSnapshot);
return (
- <footer className="statusbar">
- <div className="statusbar__left">
- <span className={`statusbar__dot${isPlaying ? ' is-live' : ''}`}>
- <Circle size={8} fill="currentColor" strokeWidth={0} />
+ <footer className="status">
+ <div className="grp">
+ <button
+ type="button"
+ className={`cb-btn${contentDrawer ? ' active' : ''}`}
+ title="Content Drawer (Ctrl+Space)"
+ onClick={toggleContentDrawer}
+ >
+ <FolderOpen size={12} strokeWidth={1.9} />
+ Content Drawer
+ </button>
+ <span className="sitem">
+ <span className={`sdot${isPlaying ? ' live' : ''}`} />
{isPlaying ? 'Running' : 'Edit Mode'}
</span>
- <span className="statusbar__item">
+ <span className="sitem">
{selectedIds.size ? `${selectedIds.size} selected` : 'No selection'}
</span>
</div>
- <div className="statusbar__right mono">
- <span className="statusbar__item">
- <MousePointer2 size={11} strokeWidth={1.85} />
- {stats.cursor ? `${stats.cursor.x}, ${stats.cursor.y}` : '—'}
- </span>
- <span className="statusbar__item">
- <Gauge size={11} strokeWidth={1.85} /> {stats.fps} fps
- </span>
- <span className="statusbar__item">
- <Boxes size={11} strokeWidth={1.85} /> {stats.entities} entities
- </span>
- <span className="statusbar__item statusbar__item--engine">esengine 0.10.0</span>
- </div>
+ <span className="sp" />
+
+ <span className="sitem mono">
+ <MousePointer2 size={11} strokeWidth={1.85} />
+ {stats.cursor ? `${stats.cursor.x}, ${stats.cursor.y}` : '—'}
+ </span>
+ <span className="sitem mono">
+ <Gauge size={11} strokeWidth={1.85} /> {stats.fps} fps
+ </span>
+ <span className="sitem mono">
+ <Boxes size={11} strokeWidth={1.85} /> {stats.entities} entities
+ </span>
+ <span className="sitem smute">esengine 0.10.0</span>
</footer>
);
}
diff --git a/desktop/src/layout/Toolbar.tsx b/desktop/src/layout/Toolbar.tsx
index 9eb0926dd..e9aae401b 100644
--- a/desktop/src/layout/Toolbar.tsx
+++ b/desktop/src/layout/Toolbar.tsx
@@ -13,7 +13,6 @@ import {
Pause,
Square as Stop,
Eye,
- Smartphone,
Hammer,
type LucideIcon,
} from 'lucide-react';
@@ -41,19 +40,17 @@ function TBtn({
active,
disabled,
onClick,
- tone,
}: {
icon: LucideIcon;
label: string;
active?: boolean;
disabled?: boolean;
onClick?: () => void;
- tone?: 'run';
}) {
return (
<button
type="button"
- className={`tbtn${active ? ' is-active' : ''}${tone ? ` tbtn--${tone}` : ''}`}
+ className={`tbtn${active ? ' on' : ''}`}
title={label}
aria-label={label}
aria-pressed={active}
@@ -78,7 +75,7 @@ export function Toolbar() {
return (
<div className="toolbar">
- <div className="toolbar__group">
+ <div className="tgroup">
<TBtn
icon={Save}
label={`Save Scene${hint('project.save')}`}
@@ -86,9 +83,9 @@ export function Toolbar() {
/>
</div>
- <span className="toolbar__div" />
+ <span className="tdiv" />
- <div className="toolbar__group">
+ <div className="tgroup">
<TBtn
icon={Undo2}
label={`${undoLabel ? `Undo ${undoLabel}` : 'Undo'}${hint('edit.undo')}`}
@@ -103,9 +100,9 @@ export function Toolbar() {
/>
</div>
- <span className="toolbar__div" />
+ <span className="tdiv" />
- <div className="toolbar__group" role="radiogroup" aria-label="Transform tool">
+ <div className="tgroup" role="radiogroup" aria-label="Transform tool">
{TOOLS.map((t) => (
<TBtn
key={t.mode}
@@ -117,42 +114,41 @@ export function Toolbar() {
))}
</div>
- <span className="toolbar__div" />
+ <span className="tdiv" />
- <div className="toolbar__group">
+ <div className="tgroup">
<TBtn icon={Magnet} label="Snapping" active={snapping} onClick={() => commands.run('view.toggleSnapping')} />
<TBtn icon={Grid3x3} label="Show Grid" active={showGrid} onClick={() => commands.run('view.toggleGrid')} />
</div>
- {/* Play controls sit dead-center — the focal action, like UE5. */}
- <div className="toolbar__center">
- <div className="playbar">
- <TBtn
- icon={Play}
- label={isPlaying ? 'Restart' : `Play${hint('play.toggle')}`}
- tone="run"
- active={isPlaying}
- onClick={() => commands.run('play.toggle')}
- />
- <TBtn icon={Pause} label="Pause" active={isPaused} onClick={togglePause} />
- <TBtn icon={Stop} label="Stop" onClick={stop} />
- </div>
- </div>
+ <span className="tspacer" />
- <div className="toolbar__group toolbar__right">
- <TBtn icon={Eye} label="Show Gizmos" active={showGizmos} onClick={() => commands.run('view.toggleGizmos')} />
- <button type="button" className="chip" title="Build target">
- <Smartphone size={13} strokeWidth={1.85} />
- <span>Web</span>
- </button>
+ {/* Play controls sit dead-center — the focal action. */}
+ <div className={`play-wrap${isPlaying ? ' playing' : ''}${isPaused ? ' paused' : ''}`}>
<button
type="button"
- className="chip chip--accent"
- title="Build project scripts"
- onClick={() => commands.run('build.scripts')}
+ className="play-main"
+ title={isPlaying ? 'Restart' : `Play${hint('play.toggle')}`}
+ onClick={() => commands.run('play.toggle')}
>
- <Hammer size={13} strokeWidth={1.85} />
- <span>Build</span>
+ <Play size={15} strokeWidth={1.9} fill="currentColor" />
+ {isPlaying ? 'Restart' : 'Play'}
+ </button>
+ <button type="button" className="play-side" title="Pause" disabled={!isPlaying} onClick={togglePause}>
+ <Pause size={14} strokeWidth={1.9} fill="currentColor" />
+ </button>
+ <button type="button" className="play-side" title="Stop" disabled={!isPlaying} onClick={stop}>
+ <Stop size={12} strokeWidth={1.9} fill="currentColor" />
+ </button>
+ </div>
+
+ <span className="tspacer" />
+
+ <div className="tgroup">
+ <TBtn icon={Eye} label="Show Gizmos" active={showGizmos} onClick={() => commands.run('view.toggleGizmos')} />
+ <button type="button" className="tbtn" title="Build project scripts" onClick={() => commands.run('build.scripts')}>
+ <Hammer size={15} strokeWidth={1.85} />
+ <span className="lbl">Build</span>
</button>
</div>
</div>
diff --git a/desktop/src/layout/dockApi.ts b/desktop/src/layout/dockApi.ts
new file mode 100644
index 000000000..63d652d59
--- /dev/null
+++ b/desktop/src/layout/dockApi.ts
@@ -0,0 +1,34 @@
+/**
+ * @file dockApi.ts
+ * @brief A tiny holder for the live dockview api so non-dock chrome (the activity
+ * bar) can reveal/focus docked panels without threading the api through
+ * React. DockLayout sets it on ready; callers guard against null.
+ */
+import type { DockviewApi } from 'dockview';
+
+let api: DockviewApi | null = null;
+// Remembered pre-collapse sizes, per panel id (so a re-expand restores them).
+const sizes = new Map<string, number>();
+
+export const dockApi = {
+ set(next: DockviewApi | null) {
+ api = next;
+ },
+ /** Bring a docked panel to the front of its group (no-op if absent). */
+ reveal(id: string) {
+ api?.getPanel(id)?.api.setActive();
+ },
+ /** Collapse a panel's group to its header / expand it back (click-to-toggle). */
+ toggleCollapse(id: string, axis: 'width' | 'height') {
+ const panel = api?.getPanel(id);
+ if (!panel) return;
+ const prev = sizes.get(id);
+ if (prev != null) {
+ panel.api.setSize(axis === 'width' ? { width: prev } : { height: prev });
+ sizes.delete(id);
+ } else {
+ sizes.set(id, axis === 'width' ? panel.api.width : panel.api.height);
+ panel.api.setSize(axis === 'width' ? { width: 0 } : { height: 0 });
+ }
+ },
+};
diff --git a/desktop/src/main.tsx b/desktop/src/main.tsx
index f08633216..0872c9651 100644
--- a/desktop/src/main.tsx
+++ b/desktop/src/main.tsx
@@ -14,12 +14,23 @@ import './theme/global.css';
import 'dockview/dist/styles/dockview.css';
import './theme/dockview-theme.css';
import './theme/app.css';
+import './theme/inspector.css';
+import './theme/outliner.css';
+import './theme/log.css';
+import './theme/viewport.css';
+import './theme/content.css';
+import './theme/chrome.css';
+import './theme/menus.css';
import './theme/launcher.css';
import { App } from './App';
import { LogStore } from './store/LogStore';
+import { initFsWatch } from './project/fsWatch';
// Capture console (editor + SDK + wasm) into the Output Log panel from startup.
LogStore.install();
+// Live-sync the asset registry + Content Browser with on-disk changes (incl.
+// edits made outside the editor) via the main-process project watcher.
+initFsWatch();
createRoot(document.getElementById('root')!).render(
<StrictMode>
diff --git a/desktop/src/panels/ContentBrowser.tsx b/desktop/src/panels/ContentBrowser.tsx
index 5802577ea..13ef8b8ce 100644
--- a/desktop/src/panels/ContentBrowser.tsx
+++ b/desktop/src/panels/ContentBrowser.tsx
@@ -1,20 +1,28 @@
-import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from 'react';
-import { ChevronRight, Search, Plus, LayoutGrid, Import, FolderOpen, ArrowLeft, ArrowRight, ArrowUp } from 'lucide-react';
+import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
+import { createPortal } from 'react-dom';
+import { ChevronRight, Search, LayoutGrid, List, Import, FolderOpen, FolderPlus, ArrowLeft, ArrowRight, ArrowUp } from 'lucide-react';
import { AssetIcon, assetTint } from '@/components/icons';
import { ContextMenu, type MenuItem } from '@/components/Menu';
import { ProjectStore } from '@/project/ProjectStore';
+import { EditorHistory } from '@/engine/EditorHistory';
import { Toasts } from '@/store/Toasts';
+import { useSelection } from '@/store/selectionStore';
+import { IMAGE_RE, assetTypeOf as assetType, TYPE_CODE } from '@/project/assetMeta';
+import { fsRefresh } from '@/project/fsWatch';
import type { DirEntry } from '@/project/format';
import type { AssetType } from '@/types';
-const IMAGE_RE = /\.(png|jpe?g|webp|gif)$/i;
const TILE_MIN = 64;
const TILE_MAX = 152;
const TILE_KEY = 'estella.content.tileSize';
-// Lazily read a project-relative directory (or [] when null / no project / error).
+const errMsg = (e: unknown) => (e instanceof Error ? e.message : String(e));
+
+// Lazily read a project-relative directory (or [] when null / no project / error),
+// re-reading whenever the path changes or an fs mutation bumps fsRefresh.
function useDir(relPath: string | null): DirEntry[] {
const [entries, setEntries] = useState<DirEntry[]>([]);
+ const version = useSyncExternalStore(fsRefresh.subscribe, fsRefresh.get);
useEffect(() => {
if (relPath == null || !window.estella?.fs) {
setEntries([]);
@@ -28,14 +36,136 @@ function useDir(relPath: string | null): DirEntry[] {
return () => {
alive = false;
};
- }, [relPath]);
+ }, [relPath, version]);
return entries;
}
+// Inline name editor for a tile / list row (UE5 rename + new-folder flow): commits
+// on Enter or blur, cancels on Escape, and pre-selects the base name (sans
+// extension). Stops pointer/key events so it doesn't trigger the tile's
+// select/open/drag while editing.
+function RenameInput({
+ name,
+ onCommit,
+ onCancel,
+}: {
+ name: string;
+ onCommit: (value: string) => void;
+ onCancel: () => void;
+}) {
+ const canceled = useRef(false);
+ return (
+ <input
+ className="cb-rename"
+ defaultValue={name}
+ autoFocus
+ spellCheck={false}
+ onFocus={(e) => {
+ const dot = name.lastIndexOf('.');
+ e.target.setSelectionRange(0, dot > 0 ? dot : name.length);
+ }}
+ onMouseDown={(e) => e.stopPropagation()}
+ onClick={(e) => e.stopPropagation()}
+ onDoubleClick={(e) => e.stopPropagation()}
+ onKeyDown={(e) => {
+ e.stopPropagation();
+ if (e.key === 'Enter') e.currentTarget.blur();
+ else if (e.key === 'Escape') {
+ canceled.current = true;
+ e.currentTarget.blur();
+ }
+ }}
+ onBlur={(e) => (canceled.current ? onCancel() : onCommit(e.target.value))}
+ />
+ );
+}
+
+function formatBytes(n: number): string {
+ if (n < 1024) return `${n} B`;
+ const units = ['KB', 'MB', 'GB'];
+ let v = n;
+ let i = -1;
+ do {
+ v /= 1024;
+ i++;
+ } while (v >= 1024 && i < units.length - 1);
+ return `${v.toFixed(v < 10 ? 1 : 0)} ${units[i]}`;
+}
+
+function TipRow({ k, v, mono }: { k: string; v: string; mono?: boolean }) {
+ return (
+ <div className="cb-tip-row">
+ <span className="k">{k}</span>
+ <span className={`v${mono ? ' mono' : ''}`}>{v}</span>
+ </div>
+ );
+}
+
+// UE5-style hover card: the metadata you can't see at a glance (type / path /
+// reference / image dimensions / disk size / modified). Anchored beside the tile,
+// clamped on-screen, non-interactive. Fetches stat + dimensions lazily on show.
+function AssetTooltip({ path, entry, rect }: { path: string; entry: DirEntry; rect: DOMRect }) {
+ const ref = useRef<HTMLDivElement>(null);
+ const [pos, setPos] = useState({ left: rect.right + 10, top: rect.top });
+ const [stat, setStat] = useState<{ size: number; mtimeMs: number } | null>(null);
+ const [dims, setDims] = useState<string | null>(null);
+
+ const type: AssetType = entry.isDir ? 'folder' : assetType(entry.name);
+ const isImg = !entry.isDir && IMAGE_RE.test(entry.name);
+ const assetReference = entry.isDir ? null : ProjectStore.assetRef(path);
+
+ useEffect(() => {
+ let alive = true;
+ window.estella?.fs
+ ?.stat(path)
+ .then((s) => alive && setStat(s))
+ .catch(() => {});
+ return () => {
+ alive = false;
+ };
+ }, [path]);
+
+ useEffect(() => {
+ if (!isImg) return;
+ const img = new Image();
+ img.onload = () => setDims(`${img.naturalWidth} × ${img.naturalHeight}`);
+ img.src = `estella://project/${path}`;
+ return () => {
+ img.onload = null;
+ };
+ }, [isImg, path]);
+
+ // Clamp beside the tile (flip to the left / lift up near an edge).
+ useLayoutEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const r = el.getBoundingClientRect();
+ const pad = 8;
+ let left = rect.right + 10;
+ if (left + r.width > window.innerWidth - pad) left = Math.max(pad, rect.left - r.width - 10);
+ let top = rect.top;
+ if (top + r.height > window.innerHeight - pad) top = Math.max(pad, window.innerHeight - r.height - pad);
+ setPos({ left, top });
+ }, [rect, stat, dims]);
+
+ return createPortal(
+ <div ref={ref} className="cb-tip" style={{ left: pos.left, top: pos.top }}>
+ <div className="cb-tip-name">{entry.name}</div>
+ <TipRow k="Type" v={entry.isDir ? 'Folder' : TYPE_CODE[type] || type} />
+ {dims && <TipRow k="Dimensions" v={dims} />}
+ {!entry.isDir && stat && <TipRow k="Size" v={formatBytes(stat.size)} />}
+ {stat && <TipRow k="Modified" v={new Date(stat.mtimeMs).toLocaleString()} />}
+ <TipRow k="Path" v={path} mono />
+ {assetReference && <TipRow k="Reference" v={assetReference} mono />}
+ </div>,
+ document.body,
+ );
+}
+
const join = (dir: string, name: string) => (dir ? `${dir}/${name}` : name);
const parentOf = (p: string) => (p.includes('/') ? p.slice(0, p.lastIndexOf('/')) : '');
-// Folder navigation with a back/forward history (UE5 Content Browser nav arrows).
+// Folder navigation with a back/forward history (the breadcrumb nav arrows).
function useNav() {
const [nav, setNav] = useState<{ hist: string[]; i: number }>({ hist: [''], i: 0 });
const cwd = nav.hist[nav.i];
@@ -50,18 +180,16 @@ function useNav() {
return { cwd, go, back, forward, up, reset, canBack: nav.i > 0, canForward: nav.i < nav.hist.length - 1, canUp: cwd !== '' };
}
-// Asset type label from the file extension (drives the icon + tile caption).
-function assetType(name: string): AssetType {
- const ext = name.split('.').pop()?.toLowerCase() ?? '';
- if (IMAGE_RE.test(name)) return ext === 'png' || ext === 'webp' ? 'texture' : 'sprite';
- if (ext === 'esscene') return 'scene';
- if (ext === 'ogg' || ext === 'mp3' || ext === 'wav') return 'audio';
- if (ext === 'ts' || ext === 'js') return 'script';
- if (ext === 'atlas' || ext === 'skel') return 'spine';
- if (ext === 'esprefab') return 'prefab';
- if (ext === 'esmat') return 'material';
- return 'file';
-}
+// Always-visible type filter chips (each toggles a group of asset types). A chip
+// is active when all its types are in the filter set; "All" clears the filter.
+const CHIP_GROUPS: { label: string; types: AssetType[]; color: string }[] = [
+ { label: 'Image', types: ['texture', 'sprite'], color: assetTint('texture') },
+ { label: 'Prefab', types: ['prefab'], color: assetTint('prefab') },
+ { label: 'Scene', types: ['scene'], color: assetTint('scene') },
+ { label: 'Script', types: ['script'], color: assetTint('script') },
+ { label: 'Audio', types: ['audio'], color: assetTint('audio') },
+ { label: 'Material', types: ['material'], color: assetTint('material') },
+];
function FolderNode({
path,
@@ -83,23 +211,24 @@ function FolderNode({
return (
<>
<div
- className={`content__folder${cwd === path ? ' is-active' : ''}`}
- style={{ paddingLeft: depth * 14 + 6 }}
+ className={`tr${cwd === path ? ' sel' : ''}${open ? ' open' : ''}`}
+ style={{ paddingLeft: depth * 12 + 6 }}
title={name}
onClick={() => onSelect(path)}
>
- <button
- type="button"
- className={`content__folder-twist${open ? ' is-open' : ''}`}
+ <span
+ className={`tw${subdirs.length ? '' : ' leaf'}`}
onClick={(e) => {
e.stopPropagation();
setOpen((o) => !o);
}}
>
- <ChevronRight size={12} strokeWidth={2} />
- </button>
- <AssetIcon type="folder" size={14} />
- <span className="content__folder-name">{name}</span>
+ <ChevronRight size={10} strokeWidth={2.6} />
+ </span>
+ <span className="ti">
+ <AssetIcon type="folder" size={14} />
+ </span>
+ <span className="tn">{name}</span>
</div>
{open && subdirs.map((d) => (
<FolderNode key={d.name} path={join(path, d.name)} name={d.name} depth={depth + 1} cwd={cwd} onSelect={onSelect} />
@@ -112,8 +241,26 @@ export function ContentBrowser() {
const project = useSyncExternalStore(ProjectStore.subscribe, ProjectStore.getSnapshot);
const { cwd, go, back, forward, up, reset, canBack, canForward, canUp } = useNav();
const [query, setQuery] = useState('');
- const [ctx, setCtx] = useState<{ x: number; y: number; path: string } | null>(null);
- const [selected, setSelected] = useState<string | null>(null);
+ // A right-click menu: on an item (target set) or on empty space (target null).
+ const [ctx, setCtx] = useState<{ x: number; y: number; target: { path: string; entry: DirEntry } | null } | null>(null);
+ const [renaming, setRenaming] = useState<string | null>(null);
+ const [hover, setHover] = useState<{ path: string; entry: DirEntry; rect: DOMRect } | null>(null);
+ const hoverTimer = useRef<number | null>(null);
+ const [filters, setFilters] = useState<Set<AssetType>>(new Set());
+
+ const clearHover = useCallback(() => {
+ if (hoverTimer.current) {
+ clearTimeout(hoverTimer.current);
+ hoverTimer.current = null;
+ }
+ setHover(null);
+ }, []);
+ useEffect(() => () => clearHover(), [clearHover]);
+ // Asset selection lives in the shared store (unified inspector): selecting an
+ // asset drives the Details panel + clears any entity selection.
+ const selected = useSelection((s) => s.selectedAsset);
+ const selectAsset = useSelection((s) => s.selectAsset);
+ const [view, setView] = useState<'grid' | 'list'>('grid');
const [tileSize, setTileSize] = useState<number>(() => {
const v = Number(localStorage.getItem(TILE_KEY));
return v >= TILE_MIN && v <= TILE_MAX ? v : 96;
@@ -123,18 +270,111 @@ export function ContentBrowser() {
// Reset navigation + selection when the open project changes.
useEffect(() => {
reset();
- setSelected(null);
- }, [project?.name, reset]);
+ selectAsset(null);
+ }, [project?.name, reset, selectAsset]);
// Selection doesn't survive a folder change.
- useEffect(() => setSelected(null), [cwd]);
+ useEffect(() => selectAsset(null), [cwd, selectAsset]);
const entries = useDir(project ? cwd : null);
const q = query.trim().toLowerCase();
const items = useMemo(() => {
- const list = q ? entries.filter((e) => e.name.toLowerCase().includes(q)) : entries;
+ const list = entries.filter((e) => {
+ if (q && !e.name.toLowerCase().includes(q)) return false;
+ // Folders always show (they're navigation); a type filter narrows files.
+ if (filters.size > 0 && !e.isDir && !filters.has(assetType(e.name))) return false;
+ return true;
+ });
// Folders first, then files; both alphabetical.
return [...list].sort((a, b) => (a.isDir === b.isDir ? a.name.localeCompare(b.name) : a.isDir ? -1 : 1));
- }, [entries, q]);
+ }, [entries, q, filters]);
+
+ // Double-click: enter folders; open scenes as the editor document (guarding
+ // unsaved edits — history is cleared on open, so canUndo ≈ "edited this session").
+ const onOpen = (path: string, isDir: boolean, name: string) => {
+ if (isDir) {
+ go(path);
+ return;
+ }
+ if (assetType(name) === 'scene') {
+ if (EditorHistory.canUndo() && !window.confirm(`Open ${name}? Unsaved changes will be lost.`)) return;
+ void ProjectStore.openScene(path);
+ }
+ };
+
+ // After any fs mutation: re-read open directories + re-scan the asset registry
+ // (so `@uuid:` refs stay resolvable and the inspector reflects new paths).
+ const refreshFs = useCallback(() => {
+ fsRefresh.bump();
+ void ProjectStore.refreshAssets();
+ }, []);
+
+ const copy = (text: string, label: string) => {
+ void navigator.clipboard?.writeText(text);
+ Toasts.push(label, 'info', 1600);
+ };
+
+ const commitRename = async (path: string, raw: string) => {
+ setRenaming(null);
+ const name = raw.trim();
+ const cur = path.slice(path.lastIndexOf('/') + 1);
+ if (!name || name === cur) return;
+ if (/[\\/]/.test(name)) {
+ Toasts.push('Name can’t contain slashes', 'error');
+ return;
+ }
+ const dest = join(parentOf(path), name);
+ try {
+ await window.estella.fs.rename(path, dest);
+ refreshFs();
+ selectAsset(dest);
+ } catch (e) {
+ Toasts.push(`Rename failed: ${errMsg(e)}`, 'error');
+ }
+ };
+
+ const duplicate = async (path: string) => {
+ try {
+ const next = await window.estella.fs.duplicate(path);
+ refreshFs();
+ selectAsset(next);
+ } catch (e) {
+ Toasts.push(`Duplicate failed: ${errMsg(e)}`, 'error');
+ }
+ };
+
+ const remove = async (path: string, name: string) => {
+ if (!window.confirm(`Delete “${name}”? It will be moved to the trash.`)) return;
+ try {
+ await window.estella.fs.trash(path);
+ refreshFs();
+ if (selected === path) selectAsset(null);
+ } catch (e) {
+ Toasts.push(`Delete failed: ${errMsg(e)}`, 'error');
+ }
+ };
+
+ const newFolder = async () => {
+ const taken = new Set(entries.map((e) => e.name));
+ let name = 'New Folder';
+ for (let i = 2; taken.has(name); i++) name = `New Folder ${i}`;
+ const path = join(cwd, name);
+ try {
+ await window.estella.fs.mkdir(path);
+ refreshFs();
+ selectAsset(path);
+ setRenaming(path); // drop straight into rename, like UE5
+ } catch (e) {
+ Toasts.push(`New folder failed: ${errMsg(e)}`, 'error');
+ }
+ };
+
+ const showInExplorer = async (path: string) => {
+ try {
+ await window.estella.shell.showItem(path);
+ } catch (e) {
+ Toasts.push(`Couldn’t reveal: ${errMsg(e)}`, 'error');
+ }
+ };
// Breadcrumb segments: Project › folder › subfolder, each a jump target.
const crumbs = useMemo(() => {
@@ -147,21 +387,65 @@ export function ContentBrowser() {
return out;
}, [cwd, project?.name]);
- const ctxItems: MenuItem[] = ctx
- ? [
- {
- label: 'Copy Path',
- onClick: () => {
- void navigator.clipboard?.writeText(ctx.path);
- Toasts.push('Copied path', 'info', 1600);
- },
- },
- ]
- : [];
+ // Shared interaction binding for an asset, reused by the grid tile and the
+ // list row so both views behave identically (drag-assign, select, open, menu).
+ const bindItem = (path: string, e: DirEntry) => ({
+ draggable: !e.isDir && renaming !== path,
+ onDragStart: (ev: React.DragEvent) => {
+ clearHover();
+ ev.dataTransfer.effectAllowed = 'copy';
+ ev.dataTransfer.setData('application/x-estella-asset', path);
+ ev.dataTransfer.setData('text/plain', path);
+ },
+ onClick: () => selectAsset(path),
+ onDoubleClick: () => onOpen(path, e.isDir, e.name),
+ onMouseEnter: (ev: React.MouseEvent) => {
+ if (renaming) return;
+ const rect = ev.currentTarget.getBoundingClientRect();
+ if (hoverTimer.current) clearTimeout(hoverTimer.current);
+ hoverTimer.current = window.setTimeout(() => setHover({ path, entry: e, rect }), 450);
+ },
+ onMouseLeave: clearHover,
+ onContextMenu: (ev: React.MouseEvent) => {
+ ev.preventDefault();
+ ev.stopPropagation(); // don't fall through to the empty-space menu
+ clearHover();
+ selectAsset(path);
+ setCtx({ x: ev.clientX, y: ev.clientY, target: { path, entry: e } });
+ },
+ });
+
+ const ctxItems: MenuItem[] = (() => {
+ if (!ctx) return [];
+ if (!ctx.target) {
+ // Empty-space menu (acts on the current folder).
+ return [
+ { label: 'New Folder', icon: <FolderPlus size={14} />, onClick: () => void newFolder() },
+ { sep: true },
+ { label: 'Show in Explorer', onClick: () => void showInExplorer(cwd) },
+ ];
+ }
+ const { path, entry } = ctx.target;
+ const isScene = !entry.isDir && assetType(entry.name) === 'scene';
+ const ref = entry.isDir ? null : ProjectStore.assetRef(path);
+ return [
+ ...(entry.isDir || isScene
+ ? [{ label: 'Open', onClick: () => onOpen(path, entry.isDir, entry.name) }]
+ : []),
+ { label: 'Rename', onClick: () => setRenaming(path) },
+ { label: 'Duplicate', onClick: () => void duplicate(path) },
+ { sep: true },
+ { label: 'Copy Path', onClick: () => copy(path, 'Copied path') },
+ ...(ref ? [{ label: 'Copy Reference', onClick: () => copy(ref, 'Copied reference') }] : []),
+ { label: 'Show in Explorer', onClick: () => void showInExplorer(path) },
+ { sep: true },
+ { label: 'Delete', danger: true, onClick: () => void remove(path, entry.name) },
+ ];
+ })();
if (!project) {
return (
- <div className="panel content">
+ <div className="panel">
<div className="empty">
<FolderOpen size={24} strokeWidth={1.4} />
<p>Open a project to browse its assets.</p>
@@ -171,121 +455,212 @@ export function ContentBrowser() {
}
return (
- <div className="panel content">
- <div className="panel__toolbar">
- <button type="button" className="btn-soft" disabled title="Import (coming soon)">
- <Import size={13} strokeWidth={1.85} /> Import
- </button>
- <button type="button" className="btn-soft" disabled title="Add (coming soon)">
- <Plus size={13} strokeWidth={1.85} /> Add
- </button>
- <div className="searchbox searchbox--grow">
- <Search size={13} strokeWidth={1.85} />
- <input
- className="searchbox__input"
- placeholder="Search assets"
- spellCheck={false}
- value={query}
- onChange={(e) => setQuery(e.target.value)}
- />
+ <div className="panel">
+ <div className="cb-work">
+ {/* ── Sources (left) ── */}
+ <div className="cb-panel cb-src">
+ <div className="cb-head">
+ <span className="pt">Sources</span>
+ </div>
+ <div className="cb-src-body">
+ <div className="cb-sec">Folders</div>
+ <FolderNode path="" name={project.name} depth={0} cwd={cwd} onSelect={go} />
+ </div>
</div>
- <label className="content__size" title="Thumbnail size">
- <LayoutGrid size={14} strokeWidth={1.85} />
- <input
- type="range"
- min={TILE_MIN}
- max={TILE_MAX}
- step={4}
- value={tileSize}
- onChange={(e) => setTileSize(Number(e.target.value))}
- />
- </label>
- </div>
- <div className="content__nav">
- <button type="button" className="content__navbtn" disabled={!canBack} onClick={back} title="Back">
- <ArrowLeft size={14} strokeWidth={2} />
- </button>
- <button type="button" className="content__navbtn" disabled={!canForward} onClick={forward} title="Forward">
- <ArrowRight size={14} strokeWidth={2} />
- </button>
- <button type="button" className="content__navbtn" disabled={!canUp} onClick={up} title="Up one level">
- <ArrowUp size={14} strokeWidth={2} />
- </button>
- <div className="breadcrumb">
- {crumbs.map((c, i) => (
- <span key={c.path} className="breadcrumb__item">
- {i > 0 && <ChevronRight className="breadcrumb__sep" size={12} strokeWidth={2} />}
- <button
- type="button"
- className={`breadcrumb__seg${i === crumbs.length - 1 ? ' is-current' : ''}`}
- onClick={() => go(c.path)}
- >
- {c.name}
+ {/* ── Main (center) ── */}
+ <div className="cb-panel cb-main">
+ <div className="cb-bar">
+ <div className="cb-nav">
+ <button type="button" disabled={!canBack} onClick={back} title="Back">
+ <ArrowLeft size={15} strokeWidth={2} />
</button>
- </span>
- ))}
- </div>
- </div>
+ <button type="button" disabled={!canForward} onClick={forward} title="Forward">
+ <ArrowRight size={15} strokeWidth={2} />
+ </button>
+ <button type="button" disabled={!canUp} onClick={up} title="Up one level">
+ <ArrowUp size={15} strokeWidth={2} />
+ </button>
+ </div>
+ <div className="crumbs">
+ {crumbs.map((c, i) => (
+ <Fragment key={c.path}>
+ {i > 0 && <span className="sep">›</span>}
+ <span
+ className={`cr${i === crumbs.length - 1 ? ' cur' : ''}`}
+ onClick={() => go(c.path)}
+ >
+ {c.name}
+ </span>
+ </Fragment>
+ ))}
+ </div>
+ <div className="search cb-search">
+ <Search size={13} strokeWidth={1.9} />
+ <input
+ placeholder="Search assets"
+ spellCheck={false}
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ />
+ </div>
+ <div className="cb-seg">
+ <button type="button" className={view === 'grid' ? 'on' : ''} title="Grid view" onClick={() => setView('grid')}>
+ <LayoutGrid size={13} strokeWidth={1.9} />
+ </button>
+ <button type="button" className={view === 'list' ? 'on' : ''} title="List view" onClick={() => setView('list')}>
+ <List size={13} strokeWidth={1.9} />
+ </button>
+ </div>
+ <button type="button" className="cb-ghost" title="New Folder" onClick={() => void newFolder()}>
+ <FolderPlus size={13} strokeWidth={1.9} />
+ </button>
+ <button type="button" className="cb-add" disabled title="Import (coming soon)">
+ <Import size={13} strokeWidth={1.9} /> Import
+ </button>
+ </div>
- <div className="content__split">
- <div className="content__tree">
- <FolderNode path="" name={project.name} depth={0} cwd={cwd} onSelect={go} />
- </div>
+ <div className="cb-chips">
+ <button
+ type="button"
+ className={`chip${filters.size === 0 ? ' on' : ''}`}
+ onClick={() => setFilters(new Set())}
+ >
+ All
+ </button>
+ {CHIP_GROUPS.map((g) => {
+ const active = g.types.every((t) => filters.has(t));
+ return (
+ <button
+ key={g.label}
+ type="button"
+ className={`chip${active ? ' on' : ''}`}
+ onClick={() =>
+ setFilters((prev) => {
+ const next = new Set(prev);
+ if (active) g.types.forEach((t) => next.delete(t));
+ else g.types.forEach((t) => next.add(t));
+ return next;
+ })
+ }
+ >
+ <span className="d" style={{ background: g.color }} />
+ {g.label}
+ </button>
+ );
+ })}
+ </div>
- <div
- className="content__grid"
- style={{ gridTemplateColumns: `repeat(auto-fill, minmax(${tileSize}px, 1fr))` }}
- onClick={(e) => {
- if (e.target === e.currentTarget) setSelected(null);
- }}
- >
- {items.map((e) => {
- const path = join(cwd, e.name);
- const type = e.isDir ? 'folder' : assetType(e.name);
- return (
- <button
- key={e.name}
- type="button"
- className={`tile${selected === path ? ' is-selected' : ''}`}
- // Files are draggable onto inspector asset fields / the viewport
- // (drag-assign / instantiate); the payload is the project-relative
- // path, resolved to a @uuid: ref on drop.
- draggable={!e.isDir}
- onDragStart={(ev) => {
- ev.dataTransfer.effectAllowed = 'copy';
- ev.dataTransfer.setData('application/x-estella-asset', path);
- ev.dataTransfer.setData('text/plain', path);
- }}
- onClick={() => setSelected(path)}
- onDoubleClick={() => e.isDir && go(path)}
- onContextMenu={(ev) => {
- ev.preventDefault();
- setSelected(path);
- setCtx({ x: ev.clientX, y: ev.clientY, path });
- }}
- >
- <span className="tile__thumb">
- {!e.isDir && IMAGE_RE.test(e.name) ? (
- <img className="tile__img" src={`estella://project/${path}`} alt="" draggable={false} />
- ) : (
- <AssetIcon type={type} />
- )}
- </span>
- <span className="tile__name">{e.name}</span>
- <span className="tile__type">{type}</span>
- <span className="tile__bar" style={{ background: assetTint(type) }} />
- </button>
- );
- })}
- {items.length === 0 && <p className="inspector-note">{q ? 'No assets match.' : 'Empty folder.'}</p>}
- </div>
- </div>
+ <div
+ className={`cb-scroll${view === 'list' ? ' list' : ''}`}
+ onScroll={clearHover}
+ onClick={(e) => {
+ if (e.target === e.currentTarget) selectAsset(null);
+ }}
+ onContextMenu={(e) => {
+ // Items stopPropagation, so reaching here = a right-click on empty space.
+ e.preventDefault();
+ clearHover();
+ setCtx({ x: e.clientX, y: e.clientY, target: null });
+ }}
+ >
+ {view === 'grid' ? (
+ <div className="cb-grid" style={{ ['--tile' as string]: `${tileSize}px` } as React.CSSProperties}>
+ {items.map((e) => {
+ const path = join(cwd, e.name);
+ const type: AssetType = e.isDir ? 'folder' : assetType(e.name);
+ const isImg = !e.isDir && IMAGE_RE.test(e.name);
+ return (
+ <div
+ key={e.name}
+ className={`asset${e.isDir ? ' folder' : ''}${selected === path ? ' sel' : ''}`}
+ // Files drag onto inspector asset fields / the viewport (assign / instantiate).
+ {...bindItem(path, e)}
+ >
+ <div className="th">
+ {isImg ? (
+ <img src={`estella://project/${path}`} alt="" draggable={false} />
+ ) : (
+ <AssetIcon type={type} size={30} />
+ )}
+ {!e.isDir && TYPE_CODE[type] && <span className="badge">{TYPE_CODE[type]}</span>}
+ </div>
+ <div
+ className="nm"
+ style={e.isDir ? undefined : ({ ['--tc' as string]: assetTint(type) } as React.CSSProperties)}
+ >
+ {renaming === path ? (
+ <RenameInput
+ name={e.name}
+ onCommit={(v) => void commitRename(path, v)}
+ onCancel={() => setRenaming(null)}
+ />
+ ) : (
+ <span>{e.name}</span>
+ )}
+ </div>
+ </div>
+ );
+ })}
+ {items.length === 0 && (
+ <div className="cb-empty" style={{ gridColumn: '1 / -1' }}>
+ {q ? 'No assets match.' : 'Empty folder.'}
+ </div>
+ )}
+ </div>
+ ) : (
+ <div className="cb-list">
+ <div className="lh">
+ <span>Name</span>
+ <span>Type</span>
+ </div>
+ {items.map((e) => {
+ const path = join(cwd, e.name);
+ const type: AssetType = e.isDir ? 'folder' : assetType(e.name);
+ return (
+ <div key={e.name} className={`lr${selected === path ? ' sel' : ''}`} {...bindItem(path, e)}>
+ <span className="ln">
+ <AssetIcon type={type} size={15} />
+ {renaming === path ? (
+ <RenameInput
+ name={e.name}
+ onCommit={(v) => void commitRename(path, v)}
+ onCancel={() => setRenaming(null)}
+ />
+ ) : (
+ <span className="t">{e.name}</span>
+ )}
+ </span>
+ <span className="c">{e.isDir ? '' : TYPE_CODE[type] || type}</span>
+ </div>
+ );
+ })}
+ {items.length === 0 && <div className="cb-empty">{q ? 'No assets match.' : 'Empty folder.'}</div>}
+ </div>
+ )}
+ </div>
- <div className="content__path mono">
- {items.length} items{selected ? ' · 1 selected' : ''}
+ <div className="cb-foot">
+ <span>
+ {items.length} items{selected ? ' · 1 selected' : ''}
+ </span>
+ <span className="sp" />
+ {view === 'grid' && (
+ <input
+ type="range"
+ title="Thumbnail size"
+ min={TILE_MIN}
+ max={TILE_MAX}
+ step={4}
+ value={tileSize}
+ onChange={(ev) => setTileSize(Number(ev.target.value))}
+ />
+ )}
+ </div>
+ </div>
</div>
+ {hover && !ctx && <AssetTooltip path={hover.path} entry={hover.entry} rect={hover.rect} />}
{ctx && <ContextMenu x={ctx.x} y={ctx.y} items={ctxItems} onClose={() => setCtx(null)} />}
</div>
);
diff --git a/desktop/src/panels/Details.tsx b/desktop/src/panels/Details.tsx
index e2f7b2bb8..97ec5d4ae 100644
--- a/desktop/src/panels/Details.tsx
+++ b/desktop/src/panels/Details.tsx
@@ -1,5 +1,29 @@
import { useMemo, useRef, useState, useSyncExternalStore } from 'react';
-import { Box, ChevronDown, MoreHorizontal, Plus, Search } from 'lucide-react';
+import {
+ Box,
+ Camera,
+ Check,
+ ChevronRight,
+ Code2,
+ Component as ComponentIcon,
+ Copy,
+ Filter,
+ FolderOpen,
+ Image as ImageIcon,
+ MoreHorizontal,
+ Move3d,
+ Package,
+ Plus,
+ Search,
+ Square,
+ Trash2,
+ Volume2,
+ X,
+ type LucideIcon,
+} from 'lucide-react';
+import { AssetIcon, assetTint } from '@/components/icons';
+import { Toasts } from '@/store/Toasts';
+import { baseName, assetTypeOf, TYPE_CODE, IMAGE_RE } from '@/project/assetMeta';
import { useSelection } from '@/store/selectionStore';
import { EngineHost } from '@/engine/EngineHost';
import { SceneStore } from '@/engine/SceneStore';
@@ -10,11 +34,37 @@ import { modelAddableComponentEntries } from '@/engine/schema';
import { ProjectStore } from '@/project/ProjectStore';
import { ContextMenu } from '@/components/Menu';
import { AddComponentMenu } from '@/components/AddComponentMenu';
-import type { InspectorComponent, InspectorField, EntityId } from '@/types';
+import type { InspectorComponent, InspectorField, EntityId, NodeKind } from '@/types';
const AXES = ['x', 'y', 'z'];
const fmt = (n: number) => String(Math.round(n * 1000) / 1000);
+// Component domain → header glyph, derived from the component name (the engine
+// exposes no category metadata). The icon hue is neutral by design — set in CSS.
+function componentIcon(name: string): LucideIcon {
+ const n = name.toLowerCase();
+ if (/transform/.test(n)) return Move3d;
+ if (/camera/.test(n)) return Camera;
+ if (/sprite|render|mesh|image|text|spine/.test(n)) return ImageIcon;
+ if (/rigidbody|physics|body/.test(n)) return Box;
+ if (/collider|collision/.test(n)) return Square;
+ if (/audio|sound/.test(n)) return Volume2;
+ if (/script|controller|behaviour|behavior|\bai\b|logic/.test(n)) return Code2;
+ return ComponentIcon;
+}
+
+const KIND_LABEL: Record<NodeKind, string> = {
+ camera: 'Camera',
+ sprite: 'Sprite',
+ spine: 'Spine',
+ physics: 'Physics',
+ ui: 'UI',
+ audio: 'Audio',
+ group: 'Group',
+ light: 'Light',
+ empty: 'Entity',
+};
+
// Each control reports gesture boundaries (onBegin/onEnd) so one focus→blur, one
// click, or one drag-scrub becomes a single undo step; onCommit applies live.
interface ControlGesture {
@@ -22,6 +72,42 @@ interface ControlGesture {
onEnd?: () => void;
}
+// Drag-to-scrub. The affordance lives on the property LABEL (scalars) or the
+// colored axis TAB (vectors) — NOT the input — so the field stays a plain
+// click-to-type box. Press + drag horizontally to nudge: Shift = fine (0.01/px),
+// Alt = coarse (1/px), else 0.1/px; a press under the 3px threshold is ignored.
+function useScrub(value: number, onCommit: (n: number) => void, onBegin?: () => void, onEnd?: () => void) {
+ const scrub = useRef<{ x: number; base: number; moved: boolean } | null>(null);
+ return {
+ onPointerDown: (e: React.PointerEvent) => {
+ if (e.button !== 0) return;
+ e.preventDefault();
+ scrub.current = { x: e.clientX, base: value, moved: false };
+ e.currentTarget.setPointerCapture(e.pointerId);
+ },
+ onPointerMove: (e: React.PointerEvent) => {
+ const s = scrub.current;
+ if (!s) return;
+ const dx = e.clientX - s.x;
+ if (!s.moved) {
+ if (Math.abs(dx) < 3) return;
+ s.moved = true;
+ onBegin?.();
+ }
+ const step = e.shiftKey ? 0.01 : e.altKey ? 1 : 0.1;
+ onCommit(Math.round((s.base + dx * step) * 1000) / 1000);
+ },
+ onPointerUp: (e: React.PointerEvent) => {
+ const s = scrub.current;
+ scrub.current = null;
+ if (!s) return;
+ e.currentTarget.releasePointerCapture?.(e.pointerId);
+ if (s.moved) onEnd?.();
+ },
+ };
+}
+
+// Plain click-to-type numeric input. `suffix` (e.g. °) shows in the resting value.
function NumField({
value,
suffix,
@@ -31,46 +117,49 @@ function NumField({
}: ControlGesture & { value: number; suffix?: string; onCommit: (n: number) => void }) {
const [editing, setEditing] = useState(false);
const [text, setText] = useState('');
- // Drag-to-scrub (the UE5 numeric idiom): press + drag horizontally to nudge
- // the value; a press with no drag falls through to focusing the field to type.
- const scrub = useRef<{ x: number; base: number; moved: boolean } | null>(null);
-
- const onPointerDown = (e: React.PointerEvent<HTMLInputElement>) => {
- if (editing || e.button !== 0) return;
- e.preventDefault(); // don't focus yet — let a press-without-drag focus on pointerup
- scrub.current = { x: e.clientX, base: value, moved: false };
- e.currentTarget.setPointerCapture(e.pointerId);
- };
- const onPointerMove = (e: React.PointerEvent<HTMLInputElement>) => {
- const s = scrub.current;
- if (!s) return;
- const dx = e.clientX - s.x;
- if (!s.moved) {
- if (Math.abs(dx) < 3) return; // movement threshold separates scrub from click
- s.moved = true;
- onBegin?.();
- }
- const step = e.shiftKey ? 0.01 : e.altKey ? 1 : 0.1; // Shift = fine, Alt = coarse
- onCommit(Math.round((s.base + dx * step) * 1000) / 1000);
- };
- const onPointerUp = (e: React.PointerEvent<HTMLInputElement>) => {
- const s = scrub.current;
- scrub.current = null;
- if (!s) return;
- e.currentTarget.releasePointerCapture?.(e.pointerId);
- if (s.moved) onEnd?.();
- else e.currentTarget.focus(); // a click → type
- };
+ return (
+ <span className="field">
+ <input
+ value={editing ? text : fmt(value) + (suffix ?? '')}
+ spellCheck={false}
+ onFocus={() => {
+ setText(fmt(value));
+ setEditing(true);
+ onBegin?.();
+ }}
+ onBlur={() => {
+ setEditing(false);
+ onEnd?.();
+ }}
+ onChange={(e) => {
+ setText(e.target.value);
+ const n = parseFloat(e.target.value);
+ if (!Number.isNaN(n)) onCommit(n);
+ }}
+ />
+ </span>
+ );
+}
+// One vector component — the colored X/Y/Z tab IS the scrub handle.
+function VecField({
+ axis,
+ value,
+ onBegin,
+ onEnd,
+ onCommit,
+}: ControlGesture & { axis: string; value: number; onCommit: (n: number) => void }) {
+ const scrub = useScrub(value, onCommit, onBegin, onEnd);
+ const [editing, setEditing] = useState(false);
+ const [text, setText] = useState('');
return (
- <span className="num-wrap">
+ <span className="vfield">
+ <i className={`ax ${axis}`} {...scrub}>
+ {axis.toUpperCase()}
+ </i>
<input
- className="num num--solo num--scrub"
value={editing ? text : fmt(value)}
spellCheck={false}
- onPointerDown={onPointerDown}
- onPointerMove={onPointerMove}
- onPointerUp={onPointerUp}
onFocus={() => {
setText(fmt(value));
setEditing(true);
@@ -86,7 +175,6 @@ function NumField({
if (!Number.isNaN(n)) onCommit(n);
}}
/>
- {suffix && <span className="num__unit">{suffix}</span>}
</span>
);
}
@@ -100,19 +188,18 @@ function VecControl({
return (
<div className="vec">
{value.map((n, i) => (
- <span key={i} className={`vec__axis vec__axis--${AXES[i]}`}>
- {AXES[i].toUpperCase()}
- <NumField
- value={n}
- onBegin={onBegin}
- onEnd={onEnd}
- onCommit={(v) => {
- const next = value.slice();
- next[i] = v;
- onChange(next);
- }}
- />
- </span>
+ <VecField
+ key={i}
+ axis={AXES[i]}
+ value={n}
+ onBegin={onBegin}
+ onEnd={onEnd}
+ onCommit={(v) => {
+ const next = value.slice();
+ next[i] = v;
+ onChange(next);
+ }}
+ />
))}
</div>
);
@@ -125,9 +212,8 @@ function BoolControl({
onChange,
}: ControlGesture & { value: boolean; onChange: (v: boolean) => void }) {
return (
- <button
- type="button"
- className={`switch${value ? ' is-on' : ''}`}
+ <span
+ className={`toggle${value ? ' on' : ''}`}
role="switch"
aria-checked={value}
onClick={() => {
@@ -135,9 +221,7 @@ function BoolControl({
onChange(!value);
onEnd?.();
}}
- >
- <span className="switch__thumb" />
- </button>
+ />
);
}
@@ -150,24 +234,25 @@ function StringControl({
const [editing, setEditing] = useState(false);
const [text, setText] = useState('');
return (
- <input
- className="text-input"
- value={editing ? text : value}
- spellCheck={false}
- onFocus={() => {
- setText(value);
- setEditing(true);
- onBegin?.();
- }}
- onBlur={() => {
- setEditing(false);
- onEnd?.();
- }}
- onChange={(e) => {
- setText(e.target.value);
- onChange(e.target.value);
- }}
- />
+ <span className="field">
+ <input
+ value={editing ? text : value}
+ spellCheck={false}
+ onFocus={() => {
+ setText(value);
+ setEditing(true);
+ onBegin?.();
+ }}
+ onBlur={() => {
+ setEditing(false);
+ onEnd?.();
+ }}
+ onChange={(e) => {
+ setText(e.target.value);
+ onChange(e.target.value);
+ }}
+ />
+ </span>
);
}
@@ -178,23 +263,32 @@ function ColorControl({
onChange,
}: ControlGesture & { value: string; onChange: (v: string) => void }) {
return (
- <span className="color">
- <input
- type="color"
- className="color__picker"
- value={value}
- onFocus={onBegin}
- onBlur={onEnd}
- onChange={(e) => onChange(e.target.value)}
- />
- <span className="color__hex mono">{value}</span>
- </span>
+ <>
+ <label className="sw" style={{ background: value }}>
+ <input
+ type="color"
+ value={value}
+ onFocus={onBegin}
+ onBlur={onEnd}
+ onChange={(e) => onChange(e.target.value)}
+ style={{ position: 'absolute', width: 0, height: 0, opacity: 0, pointerEvents: 'none' }}
+ />
+ </label>
+ <span className="field">
+ <input
+ value={value}
+ spellCheck={false}
+ onFocus={onBegin}
+ onBlur={onEnd}
+ onChange={(e) => onChange(e.target.value)}
+ />
+ </span>
+ </>
);
}
-// An asset-ref field: a drop target showing the bound asset (texture thumbnail +
-// name) with a clear button. Drag-assign drops a project-relative path; clear
-// sets the ref to 0 (none). The ref itself is a portable `@uuid:` string.
+// An asset-ref field: a drop target showing the bound asset (thumbnail + name).
+// The trailing button clears when bound (×), or reads as the pick affordance.
function AssetControl({
value,
assetType,
@@ -223,7 +317,7 @@ function AssetControl({
return (
<div
- className={`asset-field${over ? ' is-over' : ''}`}
+ className={`assetref${over ? ' is-over' : ''}`}
title={info?.path}
onDragOver={(e) => {
e.preventDefault();
@@ -232,73 +326,58 @@ function AssetControl({
onDragLeave={() => setOver(false)}
onDrop={onDrop}
>
- <span className="asset-field__thumb">
+ <span className="th">
{assetType === 'texture' && info ? (
<img src={`estella://project/${info.path}`} alt="" draggable={false} />
) : (
- <Box size={13} strokeWidth={1.6} />
+ <Box size={11} strokeWidth={1.7} />
)}
</span>
- <span className="asset-field__name">{info ? info.name : 'None'}</span>
- {info && (
- <button
- type="button"
- className="asset-field__clear"
- title="Clear"
- onClick={() => {
- onBegin?.();
- onChange(0);
- onEnd?.();
- }}
- >
- ×
- </button>
- )}
+ <span className="an">{info ? info.name : 'None'}</span>
+ <button
+ type="button"
+ className="pk"
+ title={info ? 'Clear' : 'Pick'}
+ onClick={() => {
+ if (!info) return;
+ onBegin?.();
+ onChange(0);
+ onEnd?.();
+ }}
+ >
+ {info ? <X size={11} strokeWidth={2} /> : <Search size={11} strokeWidth={2} />}
+ </button>
</div>
);
}
-function FieldRow({
- entity,
- comp,
- field,
-}: {
- entity: EntityId;
- comp: string;
- field: InspectorField;
-}) {
- // The gesture (focus→blur, one click, or a drag-scrub) coalesces into a single
- // undo step; SceneCommands owns the before/after capture and recording.
+function FieldRow({ entity, comp, field }: { entity: EntityId; comp: string; field: InspectorField }) {
const apply = (value: number | boolean | string | number[]) =>
SceneCommands.setField(entity, comp, field.key, field.type, value as never);
const begin = () => SceneCommands.beginGesture(`Edit ${field.label}`);
const end = () => SceneCommands.endGesture();
+ // Scalars (number/angle) scrub from the label; vectors from their axis tabs.
+ const isScalar = field.type === 'number' || field.type === 'angle';
+ const labelScrub = useScrub(isScalar ? (field.value as number) : 0, apply, begin, end);
+
let control;
switch (field.type) {
case 'number':
control = <NumField value={field.value as number} onBegin={begin} onEnd={end} onCommit={apply} />;
break;
case 'angle':
- control = (
- <NumField value={field.value as number} suffix="°" onBegin={begin} onEnd={end} onCommit={apply} />
- );
+ control = <NumField value={field.value as number} suffix="°" onBegin={begin} onEnd={end} onCommit={apply} />;
break;
case 'vec2':
case 'vec3':
- control = (
- <VecControl value={field.value as number[]} onBegin={begin} onEnd={end} onChange={apply} />
- );
+ control = <VecControl value={field.value as number[]} onBegin={begin} onEnd={end} onChange={apply} />;
break;
case 'bool':
- control = (
- <BoolControl value={field.value as boolean} onBegin={begin} onEnd={end} onChange={apply} />
- );
+ control = <BoolControl value={field.value as boolean} onBegin={begin} onEnd={end} onChange={apply} />;
break;
case 'color':
- control = (
- <ColorControl value={field.value as string} onBegin={begin} onEnd={end} onChange={apply} />
- );
+ control = <ColorControl value={field.value as string} onBegin={begin} onEnd={end} onChange={apply} />;
break;
case 'asset':
control = (
@@ -312,16 +391,17 @@ function FieldRow({
);
break;
default:
- control = (
- <StringControl value={String(field.value)} onBegin={begin} onEnd={end} onChange={apply} />
- );
+ control = <StringControl value={String(field.value)} onBegin={begin} onEnd={end} onChange={apply} />;
}
return (
- <label className="field">
- <span className="field__label">{field.label}</span>
- <span className="field__control">{control}</span>
- </label>
+ <div className="prop">
+ <span className={`prop-label${isScalar ? ' scrub' : ''}`} {...(isScalar ? labelScrub : {})}>
+ {field.label}
+ </span>
+ <div className="prop-value">{control}</div>
+ <button type="button" className="prop-reset" tabIndex={-1} />
+ </div>
);
}
@@ -338,48 +418,116 @@ function ComponentSection({
onToggle: () => void;
onMore: (e: React.MouseEvent, name: string) => void;
}) {
+ const Icon = componentIcon(comp.name);
return (
- <section className="cblock">
- <header className="cblock__head" onClick={onToggle}>
- <ChevronDown
- size={13}
- strokeWidth={2}
- className={`cblock__twist${collapsed ? ' is-collapsed' : ''}`}
- />
- <span className="cblock__name">{comp.label}</span>
+ <section className={`comp${collapsed ? '' : ' open'}`}>
+ <header className="comp-head" onClick={onToggle}>
+ <span className="comp-arrow">
+ <ChevronRight size={9} strokeWidth={3} />
+ </span>
+ {/* Component enable — visual for now; per-component enable isn't yet exposed. */}
+ <span className="comp-chk on" onClick={(e) => e.stopPropagation()}>
+ <Check size={9} strokeWidth={3.2} />
+ </span>
+ <span className="comp-icon">
+ <Icon size={13} strokeWidth={1.9} />
+ </span>
+ <span className="comp-name">{comp.label}</span>
<button
type="button"
- className="cblock__more"
+ className="comp-menu"
title="Component options"
onClick={(e) => {
e.stopPropagation();
onMore(e, comp.name);
}}
>
- <MoreHorizontal size={15} strokeWidth={2} />
+ <MoreHorizontal size={13} strokeWidth={2} />
</button>
</header>
- {!collapsed && (
- <div className="cblock__fields">
- {comp.fields.map((f) => (
- <FieldRow key={f.key} entity={entity} comp={comp.name} field={f} />
- ))}
+ <div className="comp-body">
+ <div className="cinner">
+ <div className="comp-fields">
+ {comp.fields.map((f) => (
+ <FieldRow key={f.key} entity={entity} comp={comp.name} field={f} />
+ ))}
+ </div>
</div>
- )}
+ </div>
</section>
);
}
+// Asset view of the unified inspector — shown when an asset (not an entity) is
+// selected (in the content browser). Only fields the fs layer provides; the
+// preview is the image itself or the type glyph.
+function AssetInspector({ path }: { path: string }) {
+ const name = baseName(path);
+ const type = assetTypeOf(name);
+ const isImage = IMAGE_RE.test(name);
+ return (
+ <div className="insp">
+ <div className="cb-detail-body" style={{ flex: 1, minHeight: 0, overflowY: 'auto' }}>
+ <div className="cb-prev">
+ <div className="pv">
+ {isImage ? (
+ <img src={`estella://project/${path}`} alt="" draggable={false} />
+ ) : (
+ <AssetIcon type={type} size={48} />
+ )}
+ </div>
+ </div>
+ <div className="cb-dt">
+ <div className="an">
+ {name}
+ {TYPE_CODE[type] && (
+ <span className="tg" style={{ background: assetTint(type) }}>
+ {TYPE_CODE[type]}
+ </span>
+ )}
+ </div>
+ <div className="ap">{path}</div>
+ <div className="cb-meta">
+ <div className="cb-mr">
+ <span className="k">Type</span>
+ <span className="v">{type}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div className="cb-act">
+ {type === 'scene' && (
+ <button type="button" className="primary" onClick={() => void ProjectStore.openScene(path)}>
+ <FolderOpen size={13} strokeWidth={1.85} /> Open Scene
+ </button>
+ )}
+ <button
+ type="button"
+ className="ghost"
+ onClick={() => {
+ void navigator.clipboard?.writeText(path);
+ Toasts.push('Copied path', 'info', 1600);
+ }}
+ >
+ <Copy size={13} strokeWidth={1.85} /> Copy Path
+ </button>
+ </div>
+ </div>
+ );
+}
+
export function Details() {
const engine = useSyncExternalStore(EngineHost.subscribe, EngineHost.getSnapshot);
const revision = useSyncExternalStore(SceneStore.subscribe, SceneStore.getRevision);
const selectedId = useSelection((s) => s.selectedId);
+ const selectedAsset = useSelection((s) => s.selectedAsset);
const ready = engine.status === 'ready' && selectedId != null;
const [query, setQuery] = useState('');
const [collapsed, setCollapsed] = useState<Set<string>>(new Set());
const [compMenu, setCompMenu] = useState<{ x: number; y: number; comp: string } | null>(null);
- const [addMenu, setAddMenu] = useState<{ x: number; y: number } | null>(null);
+ const [addOpen, setAddOpen] = useState(false);
+ const [filtOn, setFiltOn] = useState(false);
const toggle = (name: string) =>
setCollapsed((prev) => {
const next = new Set(prev);
@@ -397,7 +545,7 @@ export function Details() {
);
// Inspector search: keep components whose name matches (all fields), or that
- // have any matching field (only the matches), like UE5's Details filter.
+ // have any matching field (only the matches) — the Details filter behaviour.
const visible = useMemo(() => {
const q = query.trim().toLowerCase();
if (!q) return components;
@@ -413,12 +561,21 @@ export function Details() {
return out;
}, [components, query]);
+ // Unified inspector: an asset selection (mutually exclusive with entities)
+ // renders the asset view in this same panel.
+ if (selectedAsset) {
+ return <AssetInspector path={selectedAsset} />;
+ }
+
if (!entity || selectedId == null) {
return (
- <div className="panel">
- <div className="empty">
- <Box size={26} strokeWidth={1.4} />
- <p>Select an entity to inspect its components.</p>
+ <div className="insp">
+ <div className="insp-empty">
+ <div className="ei">
+ <Box size={22} strokeWidth={1.4} />
+ </div>
+ <div className="et">No selection</div>
+ <div className="es">Select an entity in the scene, or an asset in the Content Browser.</div>
</div>
</div>
);
@@ -426,46 +583,74 @@ export function Details() {
const modelEntity = SceneModel.entityBySource(selectedId);
- return (
- <div className="panel">
- <div className="inspector-head">
- <input
- key={selectedId}
- className="inspector-head__name"
- defaultValue={entity.name}
- spellCheck={false}
- onBlur={(e) => SceneCommands.renameEntity(selectedId, e.target.value)}
- />
- <span className="inspector-head__id mono">#{selectedId}</span>
- </div>
+ // Prefab-instance identity (real tag data): the `prefab` ref lives on the
+ // instance root, so non-root members resolve it by walking up to their root.
+ const prefabTag = SceneModel.prefabTag(selectedId);
+ const prefabRef = prefabTag
+ ? prefabTag.prefab ?? SceneModel.prefabTag(prefabTag.instanceRoot)?.prefab
+ : undefined;
+ const prefabName = prefabRef ? ProjectStore.assetInfo(prefabRef)?.name ?? null : null;
- <div className="inspector-bar">
- <button
- type="button"
- className="add-component"
- title="Add Component"
- onClick={(e) => {
- const r = e.currentTarget.getBoundingClientRect();
- setAddMenu({ x: r.left, y: r.bottom + 4 });
- }}
- >
- <Plus size={14} strokeWidth={2.4} />
- Add
- <ChevronDown size={12} strokeWidth={2.4} className="add-component__caret" />
- </button>
- <div className="inspector-search">
+ return (
+ <div className="insp">
+ <div className="insp-head">
+ <div className="search">
<Search size={13} strokeWidth={1.9} />
<input
- className="inspector-search__input"
placeholder="Search"
value={query}
spellCheck={false}
onChange={(e) => setQuery(e.target.value)}
/>
</div>
+ <button
+ type="button"
+ className={`filt-btn${filtOn ? ' on' : ''}`}
+ title="Filter properties"
+ onClick={() => setFiltOn((v) => !v)}
+ >
+ <Filter size={14} strokeWidth={1.9} />
+ </button>
+ </div>
+
+ <div className="ent-head">
+ <div className="ent-row1">
+ <input
+ key={selectedId}
+ className="ent-name"
+ defaultValue={entity.name}
+ spellCheck={false}
+ onBlur={(e) => SceneCommands.renameEntity(selectedId, e.target.value)}
+ />
+ </div>
+ <div className="ent-meta">
+ <span className="pill">
+ <span className="pk">Type</span>
+ {KIND_LABEL[entity.kind]}
+ </span>
+ <span className="pill">
+ <span className="pk">ID</span>
+ {selectedId}
+ </span>
+ </div>
+ {prefabName && (
+ <div className="prefab-bar" title={prefabRef}>
+ <span className="pic">
+ <Package size={13} strokeWidth={1.8} />
+ </span>
+ <span className="pn">{prefabName}</span>
+ </div>
+ )}
+ </div>
+
+ <div className="insp-addrow">
+ <button type="button" className="insp-add" title="Add Component" onClick={() => setAddOpen(true)}>
+ <Plus size={13} strokeWidth={2.4} />
+ Add Component
+ </button>
</div>
- <div className="panel__body">
+ <div className="insp-body">
{visible.map((comp) => (
<ComponentSection
key={comp.name}
@@ -477,7 +662,7 @@ export function Details() {
/>
))}
{query && visible.length === 0 && (
- <p className="inspector-note">No components match “{query}”.</p>
+ <div className="filter-empty">No components match “{query}”.</div>
)}
</div>
@@ -486,18 +671,21 @@ export function Details() {
x={compMenu.x}
y={compMenu.y}
items={[
- { label: 'Remove Component', onClick: () => SceneCommands.removeComponent(selectedId, compMenu.comp) },
+ {
+ label: 'Remove Component',
+ danger: true,
+ icon: <Trash2 size={13} strokeWidth={1.9} />,
+ onClick: () => SceneCommands.removeComponent(selectedId, compMenu.comp),
+ },
]}
onClose={() => setCompMenu(null)}
/>
)}
- {addMenu && modelEntity && (
+ {addOpen && modelEntity && (
<AddComponentMenu
- x={addMenu.x}
- y={addMenu.y}
entries={modelAddableComponentEntries(modelEntity)}
onAdd={(name) => SceneCommands.addComponent(selectedId, name)}
- onClose={() => setAddMenu(null)}
+ onClose={() => setAddOpen(false)}
/>
)}
</div>
diff --git a/desktop/src/panels/Outliner.tsx b/desktop/src/panels/Outliner.tsx
index 1d6e5c5eb..2b89e09ee 100644
--- a/desktop/src/panels/Outliner.tsx
+++ b/desktop/src/panels/Outliner.tsx
@@ -6,10 +6,24 @@ import { EngineHost } from '@/engine/EngineHost';
import { SceneStore } from '@/engine/SceneStore';
import { SceneQuery } from '@/engine/SceneQuery';
import { SceneCommands } from '@/engine/SceneCommands';
+import { SceneModel } from '@/engine/SceneModel';
import { ProjectStore } from '@/project/ProjectStore';
import { NodeIcon } from '@/components/icons';
import { ContextMenu, type MenuItem } from '@/components/Menu';
-import type { SceneNode, EntityId } from '@/types';
+import type { SceneNode, EntityId, NodeKind } from '@/types';
+
+// Entity kind → the label shown in the outliner's right-hand "Type" column.
+const KIND_TYPE: Record<NodeKind, string> = {
+ camera: 'Camera',
+ sprite: 'Sprite',
+ spine: 'Spine',
+ physics: 'Physics',
+ ui: 'UI',
+ audio: 'Audio',
+ group: 'Group',
+ light: 'Light',
+ empty: 'Entity',
+};
interface RowProps {
node: SceneNode;
@@ -29,7 +43,6 @@ interface RowProps {
function Row(props: RowProps) {
const { node, depth, forceExpand, renaming, dropId } = props;
const selectedIds = useSelection((s) => s.selectedIds);
- const selectedId = useSelection((s) => s.selectedId);
const expanded = useEditorStore((s) => s.expanded);
const toggleExpanded = useEditorStore((s) => s.toggleExpanded);
@@ -37,17 +50,27 @@ function Row(props: RowProps) {
const isOpen = forceExpand || expanded.has(node.id);
const isSelected = selectedIds.has(node.id);
const isRenaming = renaming === node.id;
+ // Prefab-instance members read with a warm icon tint (mirrors the inspector's
+ // prefab ribbon) so instances are distinguishable in the tree (real tag data).
+ const isPrefab = SceneModel.prefabTag(node.id) != null;
+
+ // Right-column type label: prefab instances read "Prefab", others by kind,
+ // each suffixed with the child count when it has any (real data).
+ const childCount = node.children?.length ?? 0;
+ const baseType = isPrefab ? 'Prefab' : (KIND_TYPE[node.kind] ?? 'Entity');
+ const typeLabel = childCount > 0 ? `${baseType} · ${childCount}` : baseType;
return (
<>
<div
className={
- `tree-row${isSelected ? ' is-selected' : ''}` +
- `${selectedId === node.id ? ' is-primary' : ''}` +
- `${node.visible ? '' : ' is-hidden'}` +
- `${dropId === node.id ? ' is-drop' : ''}`
+ `row${isSelected ? ' sel' : ''}` +
+ `${isOpen ? ' open' : ''}` +
+ `${node.visible ? '' : ' hidden'}` +
+ `${isPrefab ? ' prefab' : ''}` +
+ `${dropId === node.id ? ' drop' : ''}`
}
- style={{ paddingLeft: depth * 14 + 6 }}
+ style={{ paddingLeft: depth * 14 }}
draggable={!isRenaming}
onClick={(e) => props.onRowClick(node.id, e)}
onContextMenu={(e) => props.onContextMenu(e, node.id)}
@@ -55,24 +78,23 @@ function Row(props: RowProps) {
onDragOver={(e) => props.onDragOverRow(node.id, e)}
onDrop={(e) => props.onDropRow(node.id, e)}
>
- <button
- type="button"
- className={`tree-row__twist${hasChildren ? '' : ' is-leaf'}${isOpen ? ' is-open' : ''}`}
+ <span
+ className={`twist${hasChildren ? '' : ' leaf'}`}
onClick={(e) => {
e.stopPropagation();
if (hasChildren) toggleExpanded(node.id);
}}
>
- {hasChildren && <ChevronRight size={12} strokeWidth={2} />}
- </button>
+ <ChevronRight size={9} strokeWidth={3} />
+ </span>
- <span className={`tree-row__icon tree-row__icon--${node.kind}`}>
+ <span className="ricon">
<NodeIcon kind={node.kind} />
</span>
{isRenaming ? (
<input
- className="tree-row__rename"
+ className="rname-edit"
defaultValue={node.name}
autoFocus
spellCheck={false}
@@ -88,24 +110,28 @@ function Row(props: RowProps) {
onBlur={(e) => props.onCommitRename(node.id, e.target.value)}
/>
) : (
- <span className="tree-row__name" onDoubleClick={() => props.onStartRename(node.id)}>
+ <span className="rname" onDoubleClick={() => props.onStartRename(node.id)}>
{node.name}
</span>
)}
- <span className="tree-row__actions">
- {node.locked && <Lock size={12} strokeWidth={1.85} className="tree-row__lock" />}
- <button
- type="button"
- className="tree-row__vis"
- title="Toggle visibility"
- onClick={(e) => {
- e.stopPropagation();
- SceneCommands.setEntityVisible(node.id, !node.visible);
- }}
- >
- {node.visible ? <Eye size={13} strokeWidth={1.85} /> : <EyeOff size={13} strokeWidth={1.85} />}
- </button>
+ <span className="rtype">{typeLabel}</span>
+
+ <span
+ className="rvis"
+ title="Toggle visibility"
+ onClick={(e) => {
+ e.stopPropagation();
+ SceneCommands.setEntityVisible(node.id, !node.visible);
+ }}
+ >
+ {node.locked ? (
+ <Lock size={12} strokeWidth={1.85} />
+ ) : node.visible ? (
+ <Eye size={13} strokeWidth={1.85} />
+ ) : (
+ <EyeOff size={13} strokeWidth={1.85} />
+ )}
</span>
</div>
@@ -205,7 +231,7 @@ export function Outliner() {
const onContextMenu = (e: React.MouseEvent, id: EntityId) => {
e.preventDefault();
// Right-clicking outside the current selection selects just that entity;
- // right-clicking within it keeps the multi-selection (UE5 behaviour).
+ // right-clicking within it keeps the multi-selection.
if (!useSelection.getState().selectedIds.has(id)) select(id);
setCtx({ x: e.clientX, y: e.clientY, id });
};
@@ -290,23 +316,29 @@ export function Outliner() {
return (
<div className="panel">
- <div className="panel__toolbar">
- <div className="searchbox">
+ <div className="phead">
+ <div className="search">
<Search size={13} strokeWidth={1.85} />
<input
- className="searchbox__input"
placeholder="Search entities"
spellCheck={false}
value={query}
onChange={(e) => setQuery(e.target.value)}
/>
</div>
- <button type="button" className="iconbtn" title="Add entity" onClick={addEntity}>
+ <button type="button" className="pbtn" title="Add entity" onClick={addEntity}>
<Plus size={15} strokeWidth={2} />
</button>
</div>
+ {tree.length > 0 && (
+ <div className="outliner-cols">
+ <span className="c-name">Name</span>
+ <span className="c-type">Type</span>
+ <span className="c-vis" />
+ </div>
+ )}
<div
- className="panel__body tree"
+ className="pbody"
onDragOver={(e) => {
if (dragIds.current || isAssetDrag(e)) e.preventDefault();
}}
diff --git a/desktop/src/panels/OutputLog.tsx b/desktop/src/panels/OutputLog.tsx
index 68a0a3fd9..01deac57f 100644
--- a/desktop/src/panels/OutputLog.tsx
+++ b/desktop/src/panels/OutputLog.tsx
@@ -1,16 +1,132 @@
-import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
-import { Trash2, ArrowDownToLine, Search } from 'lucide-react';
-import { LogStore, type LogLevel } from '@/store/LogStore';
+import {
+ useEffect,
+ useLayoutEffect,
+ useMemo,
+ useRef,
+ useState,
+ useSyncExternalStore,
+} from 'react';
+import { createPortal } from 'react-dom';
+import { Trash2, ArrowDownToLine, Search, Clock, ListFilter, Check } from 'lucide-react';
+import { LogStore, type LogLevel, type LogEntry } from '@/store/LogStore';
+import { ContextMenu, type MenuItem } from '@/components/Menu';
+import { Toasts } from '@/store/Toasts';
type Filter = 'all' | LogLevel;
+const NO_CAT = '(no category)';
+const TIME_KEY = 'estella.log.showTime';
+
+// Plain-text rendering of a row for copy / save — always carries the full record
+// (time + category + verbosity) regardless of what columns the panel is showing.
+function formatEntry(e: LogEntry): string {
+ const src = e.source ? ` [${e.source}]` : '';
+ return `[${e.time}]${src} ${e.level.toUpperCase()}: ${e.message}`;
+}
+
+function saveLog(rows: LogEntry[]): void {
+ const text = rows.map(formatEntry).join('\n');
+ const blob = new Blob([text], { type: 'text/plain;charset=utf-8' });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = `OutputLog-${new Date().toISOString().slice(0, 19).replace(/[:T]/g, '-')}.txt`;
+ a.click();
+ URL.revokeObjectURL(url);
+ Toasts.push(`Saved ${rows.length} lines`, 'info', 1800);
+}
+
+// A stay-open category filter popover (UE5's "Categories" submenu): toggling one
+// category must not dismiss the menu, so this can't reuse the click-to-close
+// ContextMenu. Anchored under the trigger, clamped on-screen, closes on an
+// outside press / scroll / Escape.
+function CategoryMenu({
+ anchor,
+ categories,
+ hidden,
+ onToggle,
+ onShowAll,
+ onHideAll,
+ onClose,
+}: {
+ anchor: { left: number; top: number };
+ categories: [string, number][];
+ hidden: Set<string>;
+ onToggle: (src: string) => void;
+ onShowAll: () => void;
+ onHideAll: () => void;
+ onClose: () => void;
+}) {
+ const ref = useRef<HTMLDivElement>(null);
+ const [pos, setPos] = useState(anchor);
+
+ useLayoutEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const r = el.getBoundingClientRect();
+ const pad = 8;
+ const left =
+ anchor.left + r.width > window.innerWidth - pad
+ ? Math.max(pad, window.innerWidth - r.width - pad)
+ : anchor.left;
+ setPos({ left, top: anchor.top });
+ }, [anchor]);
+
+ useEffect(() => {
+ const close = () => onClose();
+ const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onClose();
+ window.addEventListener('mousedown', close);
+ window.addEventListener('scroll', close, true);
+ window.addEventListener('keydown', onKey);
+ return () => {
+ window.removeEventListener('mousedown', close);
+ window.removeEventListener('scroll', close, true);
+ window.removeEventListener('keydown', onKey);
+ };
+ }, [onClose]);
+
+ return createPortal(
+ <div
+ ref={ref}
+ className="ctx log-cats"
+ role="menu"
+ style={{ left: pos.left, top: pos.top }}
+ onMouseDown={(e) => e.stopPropagation()}
+ >
+ <div className="lc-head">
+ <button type="button" className="lc-act" onClick={onShowAll}>
+ Show All
+ </button>
+ <button type="button" className="lc-act" onClick={onHideAll}>
+ Hide All
+ </button>
+ </div>
+ <div className="ctx-sep" />
+ {categories.length === 0 && <div className="lc-none">No categories yet</div>}
+ {categories.map(([src, count]) => (
+ <button key={src || NO_CAT} type="button" className="ctx-item" onClick={() => onToggle(src)}>
+ <span className="ci">{!hidden.has(src) ? <Check size={13} strokeWidth={2.4} /> : null}</span>
+ <span className="cl">{src || NO_CAT}</span>
+ <span className="ck">{count}</span>
+ </button>
+ ))}
+ </div>,
+ document.body,
+ );
+}
export function OutputLog() {
const entries = useSyncExternalStore(LogStore.subscribe, LogStore.getSnapshot);
const [filter, setFilter] = useState<Filter>('all');
const [query, setQuery] = useState('');
+ const [hidden, setHidden] = useState<Set<string>>(new Set());
+ const [showTime, setShowTime] = useState(() => localStorage.getItem(TIME_KEY) !== '0');
+ const [catAnchor, setCatAnchor] = useState<{ left: number; top: number } | null>(null);
+ const [ctx, setCtx] = useState<{ x: number; y: number; selection: string } | null>(null);
const bodyRef = useRef<HTMLDivElement>(null);
const stick = useRef(true); // stay pinned to the bottom unless the user scrolls up
+ useEffect(() => localStorage.setItem(TIME_KEY, showTime ? '1' : '0'), [showTime]);
+
const counts = useMemo(() => {
let warn = 0;
let error = 0;
@@ -21,14 +137,22 @@ export function OutputLog() {
return { warn, error };
}, [entries]);
+ // Distinct sources (with counts) for the category filter, alphabetical.
+ const categories = useMemo(() => {
+ const m = new Map<string, number>();
+ for (const e of entries) m.set(e.source, (m.get(e.source) ?? 0) + 1);
+ return [...m.entries()].sort((a, b) => a[0].localeCompare(b[0]));
+ }, [entries]);
+
const visible = useMemo(() => {
const q = query.trim().toLowerCase();
return entries.filter(
(e) =>
(filter === 'all' || e.level === filter) &&
+ !hidden.has(e.source) &&
(!q || e.message.toLowerCase().includes(q) || e.source.toLowerCase().includes(q)),
);
- }, [entries, filter, query]);
+ }, [entries, filter, query, hidden]);
// Auto-scroll to the newest line while pinned to the bottom.
useEffect(() => {
@@ -48,60 +172,124 @@ export function OutputLog() {
}
};
- const Pill = ({ id, label, badge }: { id: Filter; label: string; badge?: number }) => (
+ const toggleCat = (src: string) =>
+ setHidden((prev) => {
+ const next = new Set(prev);
+ if (next.has(src)) next.delete(src);
+ else next.add(src);
+ return next;
+ });
+
+ // Capture the live selection at right-click time: opening the menu (a mousedown
+ // elsewhere) would otherwise collapse it before "Copy" reads it.
+ const onContextMenu = (e: React.MouseEvent) => {
+ e.preventDefault();
+ setCtx({ x: e.clientX, y: e.clientY, selection: window.getSelection()?.toString() ?? '' });
+ };
+
+ const ctxItems: MenuItem[] = ctx
+ ? [
+ {
+ label: 'Copy',
+ disabled: !ctx.selection,
+ onClick: () => void navigator.clipboard?.writeText(ctx.selection),
+ },
+ {
+ label: 'Copy All',
+ disabled: visible.length === 0,
+ onClick: () => void navigator.clipboard?.writeText(visible.map(formatEntry).join('\n')),
+ },
+ { sep: true },
+ { label: 'Save Log…', disabled: entries.length === 0, onClick: () => saveLog(entries) },
+ { sep: true },
+ { label: 'Clear', danger: true, onClick: () => LogStore.clear() },
+ ]
+ : [];
+
+ const Chip = ({ id, label, count }: { id: Filter; label: string; count?: number }) => (
<button
type="button"
- className={`pill${filter === id ? ' is-active' : ''}`}
+ className={`log-chip${id !== 'all' ? ` ${id}` : ''}${filter === id ? ' on' : ''}`}
onClick={() => setFilter(id)}
>
- {id !== 'all' && <i className={`dot dot--${id}`} />}
+ {id !== 'all' && <i className="d" />}
{label}
- {badge ? <span className="pill__badge">{badge}</span> : null}
+ {count ? <span className="ct">{count}</span> : null}
</button>
);
return (
- <div className="panel log">
- <div className="panel__toolbar">
- <div className="log__filters">
- <Pill id="all" label="All" />
- <Pill id="info" label="Info" />
- <Pill id="warn" label="Warnings" badge={counts.warn} />
- <Pill id="error" label="Errors" badge={counts.error} />
+ <div className="panel">
+ <div className="phead">
+ <div className="log-chips">
+ <Chip id="all" label="All" />
+ <Chip id="info" label="Info" />
+ <Chip id="warn" label="Warnings" count={counts.warn} />
+ <Chip id="error" label="Errors" count={counts.error} />
</div>
- <div className="log__tools">
- <div className="log__search">
- <Search size={12} strokeWidth={1.9} />
- <input
- value={query}
- spellCheck={false}
- placeholder="Filter"
- onChange={(e) => setQuery(e.target.value)}
- />
- </div>
- <button type="button" className="iconbtn" title="Scroll to bottom" onClick={scrollToBottom}>
- <ArrowDownToLine size={14} strokeWidth={1.85} />
- </button>
- <button type="button" className="iconbtn" title="Clear log" onClick={() => LogStore.clear()}>
- <Trash2 size={14} strokeWidth={1.85} />
- </button>
+ <div className="log-search">
+ <Search size={12} strokeWidth={1.9} />
+ <input
+ value={query}
+ spellCheck={false}
+ placeholder="Filter"
+ onChange={(e) => setQuery(e.target.value)}
+ />
</div>
+ <button
+ type="button"
+ className={`pbtn${hidden.size > 0 ? ' on' : ''}`}
+ title="Categories"
+ onClick={(e) => {
+ const r = e.currentTarget.getBoundingClientRect();
+ setCatAnchor((a) => (a ? null : { left: r.left, top: r.bottom + 4 }));
+ }}
+ >
+ <ListFilter size={14} strokeWidth={1.85} />
+ </button>
+ <button
+ type="button"
+ className={`pbtn${showTime ? ' on' : ''}`}
+ title="Show timestamps"
+ onClick={() => setShowTime((s) => !s)}
+ >
+ <Clock size={14} strokeWidth={1.85} />
+ </button>
+ <button type="button" className="pbtn" title="Scroll to bottom" onClick={scrollToBottom}>
+ <ArrowDownToLine size={14} strokeWidth={1.85} />
+ </button>
+ <button type="button" className="pbtn" title="Clear log" onClick={() => LogStore.clear()}>
+ <Trash2 size={14} strokeWidth={1.85} />
+ </button>
</div>
- <div ref={bodyRef} className="panel__body log__body mono" onScroll={onScroll}>
+ <div ref={bodyRef} className="log-body" onScroll={onScroll} onContextMenu={onContextMenu}>
{visible.map((e) => (
- <div key={e.id} className={`logline logline--${e.level}`}>
- <span className="logline__time">{e.time}</span>
- <span className="logline__source">{e.source}</span>
- <span className="logline__msg">{e.message}</span>
+ <div key={e.id} className={`log-row ${e.level}`}>
+ {showTime && <span className="lt">{e.time} </span>}
+ {e.source && <span className="ls">{e.source} </span>}
+ <span className="lm">{e.message}</span>
</div>
))}
{visible.length === 0 && (
- <div className="log__empty">
+ <div className="log-empty">
{entries.length === 0 ? 'No log output yet.' : 'No entries match the filter.'}
</div>
)}
</div>
+
+ {catAnchor && (
+ <CategoryMenu
+ anchor={catAnchor}
+ categories={categories}
+ hidden={hidden}
+ onToggle={toggleCat}
+ onShowAll={() => setHidden(new Set())}
+ onHideAll={() => setHidden(new Set(categories.map(([s]) => s)))}
+ onClose={() => setCatAnchor(null)}
+ />
+ )}
+ {ctx && <ContextMenu x={ctx.x} y={ctx.y} items={ctxItems} onClose={() => setCtx(null)} />}
</div>
);
}
diff --git a/desktop/src/panels/Viewport.tsx b/desktop/src/panels/Viewport.tsx
index e8a39360b..13db3d199 100644
--- a/desktop/src/panels/Viewport.tsx
+++ b/desktop/src/panels/Viewport.tsx
@@ -91,10 +91,30 @@ function entityClientCenter(id: number): { cx: number; cy: number } | null {
return { cx: rect.left + cv.x, cy: rect.top + cv.y };
}
-function VBtn({ icon: Icon, label, active, onClick }: { icon: LucideIcon; label: string; active?: boolean; onClick: () => void }) {
+function OvTool({
+ icon: Icon,
+ label,
+ kbd,
+ active,
+ onClick,
+}: {
+ icon: LucideIcon;
+ label: string;
+ kbd?: string;
+ active?: boolean;
+ onClick: () => void;
+}) {
return (
- <button type="button" className={`vbtn${active ? ' is-active' : ''}`} title={label} aria-label={label} aria-pressed={active} onClick={onClick}>
+ <button
+ type="button"
+ className={`ovbtn ov-tool${active ? ' active' : ''}`}
+ title={label}
+ aria-label={label}
+ aria-pressed={active}
+ onClick={onClick}
+ >
<Icon size={14} strokeWidth={1.9} />
+ {kbd && <kbd>{kbd}</kbd>}
</button>
);
}
@@ -112,6 +132,8 @@ export function Viewport() {
const dragRef = useRef<Drag | null>(null);
const [zoomPct, setZoomPct] = useState(100);
const engine = useSyncExternalStore(EngineHost.subscribe, EngineHost.getSnapshot);
+ // Sampled a few times a second (not per frame) — drives the corner HUD.
+ const stats = useSyncExternalStore(StatsStore.subscribe, StatsStore.getSnapshot);
// Scene cameras don't render in edit mode (the viewport is the editor camera),
// so draw each as a gizmo (icon + authored view rect). The id set updates on
@@ -324,16 +346,25 @@ export function Viewport() {
return (
<div className="viewport">
- <div className="viewport__toolbar">
- {TOOLS.map((t) => (
- <VBtn key={t.mode} icon={t.icon} label={`${t.label} (${t.key})`} active={tool === t.mode} onClick={() => commands.run(`tool.${t.mode}`)} />
- ))}
- <span className="viewport__toolbar-div" />
- <VBtn icon={Grid3x3} label="Show Grid" active={showGrid} onClick={() => commands.run('view.toggleGrid')} />
- <VBtn icon={Eye} label="Show Gizmos" active={showGizmos} onClick={() => commands.run('view.toggleGizmos')} />
- <VBtn icon={Magnet} label="Snapping" active={snapping} onClick={() => commands.run('view.toggleSnapping')} />
- <span className="viewport__toolbar-div" />
- <VBtn icon={Frame} label="Frame Selected (F)" onClick={() => commands.run('view.frameSelected')} />
+ <div className="ov ov-tl">
+ <div className="ov-cluster">
+ {TOOLS.map((t) => (
+ <OvTool
+ key={t.mode}
+ icon={t.icon}
+ label={`${t.label} (${t.key})`}
+ kbd={t.key}
+ active={tool === t.mode}
+ onClick={() => commands.run(`tool.${t.mode}`)}
+ />
+ ))}
+ <span className="ov-divider" />
+ <OvTool icon={Grid3x3} label="Show Grid" active={showGrid} onClick={() => commands.run('view.toggleGrid')} />
+ <OvTool icon={Eye} label="Show Gizmos" active={showGizmos} onClick={() => commands.run('view.toggleGizmos')} />
+ <OvTool icon={Magnet} label="Snapping" active={snapping} onClick={() => commands.run('view.toggleSnapping')} />
+ <span className="ov-divider" />
+ <OvTool icon={Frame} label="Frame Selected (F)" kbd="F" onClick={() => commands.run('view.frameSelected')} />
+ </div>
</div>
{/* The engine canvas mounts here; pointer events drive pick + transform + pan. */}
@@ -392,7 +423,34 @@ export function Viewport() {
</div>
)}
- <div className="viewport__overlay viewport__overlay--bl mono">{zoomPct}%</div>
+ {engine.status === 'ready' && (
+ <div className="vp-perf" aria-hidden="true">
+ <div className="pr h">
+ <span className="k">FPS</span>
+ <span className="v">{stats.fps}</span>
+ </div>
+ <div className="ps" />
+ <div className="pr">
+ <span className="k">Entities</span>
+ <span className="v">{stats.entities}</span>
+ </div>
+ </div>
+ )}
+
+ <div className="vp-coord">
+ <div className="ro">
+ {stats.cursor ? (
+ <>
+ <strong>
+ {stats.cursor.x}, {stats.cursor.y}
+ </strong>{' '}
+ · {zoomPct}%
+ </>
+ ) : (
+ `${zoomPct}%`
+ )}
+ </div>
+ </div>
{isPlaying && <div className="viewport__playflag">● PLAY</div>}
</div>
diff --git a/desktop/src/project/ProjectStore.ts b/desktop/src/project/ProjectStore.ts
index 6197c33d2..06d6ad5de 100644
--- a/desktop/src/project/ProjectStore.ts
+++ b/desktop/src/project/ProjectStore.ts
@@ -346,6 +346,22 @@ class ProjectStoreImpl {
return UUID_PREFIX + uuid;
}
+ /**
+ * Re-scan the asset DB into the uuid↔path registry. Call after a Content
+ * Browser mutation (rename / delete / duplicate / import) so refs stay
+ * resolvable and the inspector reflects the new paths.
+ */
+ async refreshAssets(): Promise<void> {
+ await this.buildAssetRegistry();
+ }
+
+ /** A tracked asset's portable `@uuid:` ref for a project-relative path (Copy
+ * Reference), or null if the path isn't an indexed asset. */
+ assetRef(path: string): string | null {
+ const uuid = this.pathToUuid.get(path);
+ return uuid ? UUID_PREFIX + uuid : null;
+ }
+
/** Display info for an asset ref (`@uuid:`), or null (none / unresolved). For
* the inspector's asset control: the project-relative path + a leaf name. */
assetInfo(ref: unknown): { path: string; name: string } | null {
@@ -400,6 +416,18 @@ class ProjectStoreImpl {
await window.estella.fs.write(relPath, JSON.stringify(data, null, 2) + '\n');
}
+ /**
+ * Open a different scene file as the editor document (Content Browser
+ * double-click). Persists it as the last-opened scene and reloads the world
+ * (which clears history + selection — the caller guards unsaved changes).
+ */
+ async openScene(relPath: string): Promise<void> {
+ if (!this.state) return;
+ await this.persistLastScene(relPath);
+ await this.loadCurrentScene();
+ Toasts.push(`Opened ${relPath.split('/').pop() ?? relPath}`, 'info', 1600);
+ }
+
private async persistLastScene(relPath: string): Promise<void> {
const st = this.state;
if (!st) return;
diff --git a/desktop/src/project/assetMeta.ts b/desktop/src/project/assetMeta.ts
new file mode 100644
index 000000000..917782768
--- /dev/null
+++ b/desktop/src/project/assetMeta.ts
@@ -0,0 +1,38 @@
+/**
+ * @file assetMeta.ts
+ * @brief Asset-type derivation shared by the Content Browser and the unified
+ * Details inspector (so selecting an asset resolves the same type/badge
+ * everywhere). Type is inferred from the file extension.
+ */
+import type { AssetType } from '@/types';
+
+export const IMAGE_RE = /\.(png|jpe?g|webp|gif)$/i;
+
+/** Asset type from a file name's extension. */
+export function assetTypeOf(name: string): AssetType {
+ const ext = name.split('.').pop()?.toLowerCase() ?? '';
+ if (IMAGE_RE.test(name)) return ext === 'png' || ext === 'webp' ? 'texture' : 'sprite';
+ if (ext === 'esscene') return 'scene';
+ if (ext === 'ogg' || ext === 'mp3' || ext === 'wav') return 'audio';
+ if (ext === 'ts' || ext === 'js') return 'script';
+ if (ext === 'atlas' || ext === 'skel') return 'spine';
+ if (ext === 'esprefab') return 'prefab';
+ if (ext === 'esmat') return 'material';
+ return 'file';
+}
+
+/** Short uppercase code shown in a tile's corner badge / detail tag, per type. */
+export const TYPE_CODE: Record<AssetType, string> = {
+ folder: '',
+ file: '',
+ scene: 'SCN',
+ prefab: 'PFB',
+ texture: 'TEX',
+ sprite: 'IMG',
+ material: 'MAT',
+ spine: 'SPN',
+ audio: 'AUD',
+ script: 'TS',
+};
+
+export const baseName = (p: string) => (p.includes('/') ? p.slice(p.lastIndexOf('/') + 1) : p);
diff --git a/desktop/src/project/fsWatch.ts b/desktop/src/project/fsWatch.ts
new file mode 100644
index 000000000..2d0a1ea05
--- /dev/null
+++ b/desktop/src/project/fsWatch.ts
@@ -0,0 +1,44 @@
+/**
+ * @file Live filesystem ↔ editor-asset sync (REARCH_ASSETS A2, renderer side).
+ *
+ * `fsRefresh` is a bump signal every `useDir` subscribes to (re-read directories).
+ * `initFsWatch` subscribes ONCE to the main-process watcher so changes on disk —
+ * including edits made OUTSIDE the editor (Finder, git, build output, cooking) —
+ * refresh the asset registry + Content Browser, not just the editor's own ops.
+ */
+import { ProjectStore } from './ProjectStore';
+
+const listeners = new Set<() => void>();
+let version = 0;
+
+/** A re-read signal shared by every mounted `useDir` (no prop/context threading). */
+export const fsRefresh = {
+ bump: () => {
+ version++;
+ for (const l of listeners) l();
+ },
+ subscribe: (fn: () => void) => {
+ listeners.add(fn);
+ return () => {
+ listeners.delete(fn);
+ };
+ },
+ get: () => version,
+};
+
+let inited = false;
+let debounce: ReturnType<typeof setTimeout> | null = null;
+
+/** Subscribe to the main-process project watcher (call once at startup). */
+export function initFsWatch(): void {
+ if (inited || !window.estella?.fs?.onChange) return;
+ inited = true;
+ window.estella.fs.onChange(() => {
+ // Coalesce back-to-back bursts; one scan + one bump per quiet window.
+ if (debounce) clearTimeout(debounce);
+ debounce = setTimeout(() => {
+ void ProjectStore.refreshAssets();
+ fsRefresh.bump();
+ }, 60);
+ });
+}
diff --git a/desktop/src/store/editorStore.ts b/desktop/src/store/editorStore.ts
index f0e14f1ef..a7f4426c2 100644
--- a/desktop/src/store/editorStore.ts
+++ b/desktop/src/store/editorStore.ts
@@ -33,6 +33,13 @@ interface EditorState {
toggleGrid: () => void;
toggleGizmos: () => void;
toggleSnapping: () => void;
+
+ // Content Drawer — a quick-access overlay: the Content Browser slides up over
+ // the workspace (Ctrl+Space), dismissing on outside click / Esc. It sits ON
+ // TOP of the docked Content Browser tab, not a replacement.
+ contentDrawer: boolean;
+ toggleContentDrawer: () => void;
+ setContentDrawer: (open: boolean) => void;
}
export const useEditorStore = create<EditorState>((set) => ({
@@ -65,4 +72,8 @@ export const useEditorStore = create<EditorState>((set) => ({
toggleGrid: () => set((s) => ({ showGrid: !s.showGrid })),
toggleGizmos: () => set((s) => ({ showGizmos: !s.showGizmos })),
toggleSnapping: () => set((s) => ({ snapping: !s.snapping })),
+
+ contentDrawer: false,
+ toggleContentDrawer: () => set((s) => ({ contentDrawer: !s.contentDrawer })),
+ setContentDrawer: (contentDrawer) => set({ contentDrawer }),
}));
diff --git a/desktop/src/store/selectionStore.ts b/desktop/src/store/selectionStore.ts
index 83ab1039f..f89de6088 100644
--- a/desktop/src/store/selectionStore.ts
+++ b/desktop/src/store/selectionStore.ts
@@ -14,16 +14,25 @@ import type { EntityId } from '@/types';
*
* `selectedId` is the primary/active entity (drives the Details panel + viewport
* gizmo); `selectedIds` is the full multi-selection set.
+ *
+ * The inspector is UNIFIED: selection is either an entity OR an asset (a content
+ * path), never both — selecting one clears the other. The Details panel renders
+ * whichever is active (entity → components, asset → asset metadata), so there's a
+ * single inspector surface, no duplicate "details" column in the content browser.
*/
interface SelectionState {
selectedId: EntityId | null;
selectedIds: Set<EntityId>;
+ /** The selected asset (project-relative path), mutually exclusive with entities. */
+ selectedAsset: string | null;
/** Replace the selection with a single entity (or clear it with null). */
select: (id: EntityId | null) => void;
/** Ctrl/Cmd-click: add/remove one entity from the selection. */
toggleSelect: (id: EntityId) => void;
/** Shift-click / box: replace the selection with a set, with a primary. */
selectMany: (ids: EntityId[], primary: EntityId) => void;
+ /** Select an asset (or clear with null); clears any entity selection. */
+ selectAsset: (path: string | null) => void;
/** Remove one id from the selection (despawn self-healing). */
dropId: (id: EntityId) => void;
}
@@ -41,9 +50,15 @@ export function createSelectionStore(model: SceneModelImpl) {
const useStore = create<SelectionState>((set) => ({
selectedId: null,
selectedIds: new Set<EntityId>(),
+ selectedAsset: null,
+ // Selecting an entity clears the asset selection (unified inspector).
select: (selectedId) =>
- set({ selectedId, selectedIds: selectedId != null ? new Set([selectedId]) : new Set() }),
+ set({
+ selectedId,
+ selectedIds: selectedId != null ? new Set([selectedId]) : new Set(),
+ selectedAsset: null,
+ }),
toggleSelect: (id) =>
set((s) => {
@@ -52,13 +67,18 @@ export function createSelectionStore(model: SceneModelImpl) {
next.delete(id);
const primary =
s.selectedId === id ? (next.size ? [...next][next.size - 1] : null) : s.selectedId;
- return { selectedIds: next, selectedId: primary };
+ return { selectedIds: next, selectedId: primary, selectedAsset: null };
}
next.add(id);
- return { selectedIds: next, selectedId: id };
+ return { selectedIds: next, selectedId: id, selectedAsset: null };
}),
- selectMany: (ids, primary) => set({ selectedIds: new Set(ids), selectedId: primary }),
+ selectMany: (ids, primary) =>
+ set({ selectedIds: new Set(ids), selectedId: primary, selectedAsset: null }),
+
+ // Selecting an asset clears any entity selection (mutually exclusive).
+ selectAsset: (selectedAsset) =>
+ set({ selectedAsset, selectedId: null, selectedIds: new Set() }),
dropId: (id) =>
set((s) => {
diff --git a/desktop/src/theme/app.css b/desktop/src/theme/app.css
index 5e86bf8b6..4a670382f 100644
--- a/desktop/src/theme/app.css
+++ b/desktop/src/theme/app.css
@@ -13,8 +13,11 @@
flex: 1;
min-height: 0;
position: relative;
+ display: flex; /* activity bar (left) + dockview (fill) */
}
.shell__workspace .dv-dockview {
+ flex: 1;
+ min-width: 0;
height: 100%;
}
@@ -237,13 +240,13 @@
color: var(--text-hi);
}
.chip--accent {
- color: var(--void);
+ color: var(--on-accent);
background: var(--star);
border-color: var(--star);
}
.chip--accent:hover {
background: var(--star-hi);
- color: var(--void);
+ color: var(--on-accent);
}
/* ------------------------------------------------------------- statusbar --- */
@@ -455,6 +458,12 @@
.tree-row.is-selected .tree-row__icon {
color: var(--star-hi);
}
+/* Prefab-instance rows: warm icon tint, kept even when selected (the warm hue is
+ the prefab's identity, mirroring the inspector ribbon). */
+.tree-row.is-prefab .tree-row__icon,
+.tree-row.is-prefab.is-selected .tree-row__icon {
+ color: var(--info-warm);
+}
.tree-row__name {
flex: 1;
font-size: var(--fs-sm);
@@ -462,6 +471,35 @@
overflow: hidden;
text-overflow: ellipsis;
}
+/* Right-hand type column (kind + child count), muted so the name leads. */
+.tree-row__type {
+ flex-shrink: 0;
+ padding-left: 8px;
+ font-size: var(--fs-2xs);
+ color: var(--text-faint);
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+}
+.tree-row.is-selected .tree-row__type {
+ color: var(--text-dim);
+}
+
+/* Column header strip above the tree (Name | Type). */
+.tree-cols {
+ display: flex;
+ align-items: center;
+ flex-shrink: 0;
+ height: 20px;
+ padding: 0 30px 0 12px;
+ border-bottom: 1px solid var(--line-soft);
+ font-size: var(--fs-2xs);
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ color: var(--text-faint);
+}
+.tree-cols__name {
+ flex: 1;
+}
.tree-row__rename {
flex: 1;
min-width: 0;
@@ -530,6 +568,8 @@
}
/* Selection outline around the selected entity (rAF-driven, below the gizmo). */
+/* Selected-entity outline — the iconic orange, with a dark halo for contrast
+ over any scene color. The blue accent stays reserved for UI chrome. */
.viewport__selection {
position: absolute;
top: 0;
@@ -537,8 +577,10 @@
z-index: 1;
opacity: 0;
pointer-events: none;
- border: 1px solid var(--star);
- box-shadow: 0 0 0 1px rgba(14, 15, 18, 0.6);
+ border: 1px solid var(--sel);
+ box-shadow:
+ 0 0 0 1px rgba(14, 15, 18, 0.7),
+ inset 0 0 0 1px rgba(14, 15, 18, 0.4);
will-change: transform, width, height, opacity;
}
.viewport__stage.has-grid {
@@ -627,8 +669,39 @@
border-radius: var(--r-sm);
border: 1px solid var(--line);
}
+.viewport__overlay--bl b {
+ color: var(--text-hi);
+ font-weight: 600;
+}
-/* Floating viewport toolbar (gizmo mode + view toggles + frame), UE5-style. */
+/* Top-right telemetry HUD. Shows only measured stats — FPS + live entity
+ count; no fabricated draw-call / triangle counters. */
+.viewport__hud {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ z-index: 2;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 1px;
+ font-family: var(--font-mono);
+ font-size: var(--fs-xs);
+ color: var(--text-dim);
+ text-align: right;
+ pointer-events: none;
+}
+.viewport__hud span {
+ display: inline-flex;
+ gap: 6px;
+}
+.viewport__hud b {
+ color: var(--text-hi);
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
+}
+
+/* Floating viewport toolbar (gizmo mode + view toggles + frame). */
.viewport__toolbar {
position: absolute;
top: 10px;
@@ -780,12 +853,53 @@
.inspector-head__name:focus {
border-color: var(--star-line);
}
+/* Entity kind tag (Sprite / Physics / Camera / ...) — real data from readEntity. */
+.inspector-head__kind {
+ flex-shrink: 0;
+ padding: 2px 7px;
+ font-size: var(--fs-2xs);
+ font-weight: 600;
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ color: var(--text-dim);
+ background: var(--srf-3);
+ border: 1px solid var(--line);
+ border-radius: var(--r-sm);
+}
.inspector-head__id {
font-size: var(--fs-xs);
color: var(--text-faint);
}
-/* Top inspector toolbar: UE5-style compact "+ Add" button + inline search field. */
+/* Prefab-instance ribbon: warm-sand tint sets an instance apart from local
+ entities. Informational — surfaces the source prefab's name (real tag data). */
+.inspector-prefab {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ padding: 6px 10px;
+ background: var(--info-warm-soft);
+ border-bottom: 1px solid var(--info-warm-line);
+ font-size: var(--fs-xs);
+ color: var(--text-dim);
+ flex-shrink: 0;
+}
+.inspector-prefab__icon {
+ display: grid;
+ place-items: center;
+ color: var(--info-warm);
+ flex-shrink: 0;
+}
+.inspector-prefab__name {
+ min-width: 0;
+ color: var(--text-hi);
+ font-weight: 500;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* Top inspector toolbar: compact "+ Add" button + inline search field. */
.inspector-bar {
display: flex;
align-items: center;
@@ -794,7 +908,7 @@
border-bottom: 1px solid var(--line-soft);
flex-shrink: 0;
}
-/* Inspector field/component search (UE5 Details filter). */
+/* Inspector field/component search (the Details filter). */
.inspector-search {
display: flex;
align-items: center;
@@ -873,12 +987,34 @@
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
+/* Domain icon, tinted by component category (transform/render/physics/...).
+ The hue is the component's identity — set inline from the derived category. */
+.cblock__icon {
+ display: grid;
+ place-items: center;
+ width: 16px;
+ flex-shrink: 0;
+}
.cblock__name {
flex: 1;
font-size: var(--fs-sm);
font-weight: 600;
color: var(--text-hi);
}
+/* OVERRIDE-style badge slot (prefab-instance component diverged from its asset).
+ Styled now; rendered only once per-component override data is exposed. */
+.cblock__badge {
+ flex-shrink: 0;
+ padding: 1px 5px;
+ font-size: 9px;
+ font-weight: 700;
+ letter-spacing: 0.5px;
+ text-transform: uppercase;
+ color: var(--star-hi);
+ background: var(--srf-3);
+ border: 1px solid var(--line);
+ border-radius: var(--r-xs);
+}
.cblock__more {
color: var(--text-faint);
display: grid;
@@ -912,6 +1048,14 @@
overflow: hidden;
text-overflow: ellipsis;
}
+/* Scalar rows scrub from the label: ew-resize hint + brighten on hover. */
+.field__label--scrub {
+ cursor: ew-resize;
+ user-select: none;
+}
+.field__label--scrub:hover {
+ color: var(--text);
+}
.field__control {
min-width: 0;
}
@@ -922,32 +1066,51 @@
grid-auto-columns: 1fr;
gap: 5px;
}
+/* Axis cell: a filled colored X/Y/Z tab butting a neutral numeric well. The tab
+ carries the axis hue so a row scans by axis; the field stays neutral so the
+ numbers themselves read clean. */
.vec__axis {
display: flex;
- align-items: center;
- gap: 5px;
- font-size: var(--fs-2xs);
- font-weight: 600;
- color: var(--text-faint);
+ align-items: stretch;
background: var(--input);
border: 1px solid var(--line);
border-radius: var(--r-sm);
- padding-left: 7px;
overflow: hidden;
}
.vec__axis:focus-within {
border-color: var(--star-line);
}
-/* Axis color lives on the X/Y/Z letter, not a left inset bar — no rounded
- box-with-bar motif (matches the nav / tree selected restyle). */
-.vec__axis--x {
- color: #ff7a85;
+.vec__axis .num-wrap {
+ flex: 1;
+ min-width: 0;
+ border: none;
+ background: none;
+ padding-right: 6px;
}
-.vec__axis--y {
- color: #46d08a;
+.vec__tab {
+ display: grid;
+ place-items: center;
+ width: 17px;
+ flex-shrink: 0;
+ font-family: var(--font-mono);
+ font-size: var(--fs-2xs);
+ font-weight: 700;
+ color: #fff;
+ background: var(--srf-5);
+ cursor: ew-resize; /* the tab IS the scrub handle (drag X/Y/Z to nudge) */
+ user-select: none;
}
-.vec__axis--z {
- color: var(--star-hi);
+.vec__axis--x .vec__tab {
+ background: var(--ax-x);
+}
+.vec__axis--y .vec__tab {
+ background: var(--ax-y);
+}
+.vec__axis--z .vec__tab {
+ background: var(--ax-z);
+}
+.vec .num {
+ padding-left: 7px;
}
.num {
width: 100%;
@@ -976,13 +1139,6 @@
background: none;
border: none;
}
-/* Drag-to-scrub affordance: ew-resize when idle, text caret when typing. */
-.num--scrub {
- cursor: ew-resize;
-}
-.num--scrub:focus {
- cursor: text;
-}
.num__unit {
font-size: var(--fs-2xs);
color: var(--text-faint);
@@ -1231,7 +1387,7 @@
opacity: 0.75;
}
-/* UE5-style Add Component picker: search + category groups + icons, keyboard-nav. */
+/* Add Component picker: search + category groups + icons, keyboard-nav. */
.addcomp {
position: fixed;
z-index: 200;
@@ -1355,7 +1511,7 @@
color: var(--text-hi);
}
/* The twist + folder glyph keep their size; only the name takes the slack
- and truncates with an ellipsis (UE5 Sources tree — long names clip, full
+ and truncates with an ellipsis (Sources tree — long names clip, full
name shows on hover via the row's title). */
.content__folder-twist,
.content__folder > svg {
@@ -1424,20 +1580,6 @@
overflow: hidden;
text-overflow: ellipsis;
}
-.tile__type {
- font-size: var(--fs-2xs);
- color: var(--text-faint);
- text-transform: uppercase;
- letter-spacing: 0.04em;
-}
-/* Type color bar (UE5 tiles read by type at a glance). */
-.tile__bar {
- width: 70%;
- height: 3px;
- border-radius: 2px;
- margin-top: 1px;
- opacity: 0.85;
-}
.tile.is-selected {
background: var(--star-dim);
border-color: var(--star-line);
@@ -1471,6 +1613,7 @@
.breadcrumb {
display: flex;
align-items: center;
+ flex: 1;
min-width: 0;
margin-left: 4px;
overflow: hidden;
@@ -1516,6 +1659,48 @@
accent-color: var(--star);
cursor: ew-resize;
}
+
+/* Always-visible type filter chip row (each chip toggles a type group). */
+.content__chips {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ flex-shrink: 0;
+ padding: 6px 8px;
+ border-bottom: 1px solid var(--line-soft);
+ overflow-x: auto;
+}
+.content__chips::-webkit-scrollbar {
+ height: 0;
+}
+.cchip {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ flex-shrink: 0;
+ height: 22px;
+ padding: 0 10px;
+ background: transparent;
+ border: 1px solid var(--line);
+ border-radius: 999px;
+ color: var(--text-dim);
+ font-size: var(--fs-xs);
+}
+.cchip:hover {
+ color: var(--text);
+ border-color: var(--line-strong);
+}
+.cchip.is-active {
+ color: var(--text-hi);
+ background: var(--star-dim);
+ border-color: var(--star-line);
+}
+.cchip__dot {
+ width: 6px;
+ height: 6px;
+ flex-shrink: 0;
+ border-radius: 50%;
+}
.content__path {
flex-shrink: 0;
padding: 5px 12px;
@@ -1524,6 +1709,182 @@
color: var(--text-faint);
}
+/* Tile corner badge (type code) + a type-hued bottom edge on the thumbnail, so
+ a grid reads by type at a glance (Content Browser tiles). */
+.tile__thumb {
+ position: relative;
+}
+.tile__edge {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 2px;
+ opacity: 0.9;
+}
+.tile__badge {
+ position: absolute;
+ right: 3px;
+ bottom: 3px;
+ height: 13px;
+ padding: 0 3px;
+ display: grid;
+ place-items: center;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ font-weight: 700;
+ letter-spacing: 0.03em;
+ color: var(--text-dim);
+ background: rgba(10, 10, 12, 0.82);
+ border-radius: var(--r-xs);
+}
+
+/* Grid ⇄ list view toggle (segmented). */
+.content__viewtoggle {
+ display: inline-flex;
+ gap: 1px;
+ padding: 2px;
+ background: var(--input);
+ border: 1px solid var(--line);
+ border-radius: var(--r-sm);
+}
+.content__viewtoggle button {
+ display: grid;
+ place-items: center;
+ width: 24px;
+ height: 20px;
+ border-radius: var(--r-xs);
+ color: var(--text-dim);
+}
+.content__viewtoggle button:hover {
+ color: var(--text-hi);
+}
+.content__viewtoggle button.is-active {
+ background: var(--srf-4);
+ color: var(--text-hi);
+}
+
+/* List view: compact rows (icon + name + type) instead of thumbnails. */
+.content__list {
+ overflow: auto;
+ padding: 4px;
+}
+.content__row {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ height: 26px;
+ padding: 0 8px;
+ border-radius: var(--r-sm);
+ color: var(--text);
+}
+.content__row:hover {
+ background: var(--hover);
+}
+.content__row.is-selected {
+ background: var(--star-dim);
+ color: var(--text-hi);
+}
+.content__row-name {
+ flex: 1;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: var(--fs-sm);
+}
+.content__row-type {
+ flex-shrink: 0;
+ font-size: var(--fs-2xs);
+ font-family: var(--font-mono);
+ color: var(--text-faint);
+ text-transform: uppercase;
+}
+
+/* Selected-asset detail pane (right column of the browser). Shows only what we
+ actually know — name, project path, type, and an image preview; no fabricated
+ size/modified/reference stats (the fs layer doesn't expose them). */
+.content__detail {
+ border-left: 1px solid var(--groove);
+ background: var(--srf-2);
+ display: flex;
+ flex-direction: column;
+ gap: 9px;
+ padding: 12px;
+ overflow: auto;
+}
+.content__detail-preview {
+ width: 100%;
+ aspect-ratio: 1;
+ display: grid;
+ place-items: center;
+ background: var(--void);
+ border: 1px solid var(--line);
+ border-radius: var(--r-md);
+ overflow: hidden;
+ color: var(--text-dim);
+}
+.content__detail-preview img {
+ width: 100%;
+ height: 100%;
+ object-fit: contain;
+}
+.content__detail-name {
+ font-size: var(--fs-md);
+ font-weight: 600;
+ color: var(--text-hi);
+ word-break: break-word;
+}
+.content__detail-meta {
+ display: flex;
+ flex-direction: column;
+ gap: 5px;
+}
+.content__detail-row {
+ display: flex;
+ gap: 8px;
+ font-size: var(--fs-xs);
+}
+.content__detail-key {
+ flex-shrink: 0;
+ width: 46px;
+ color: var(--text-faint);
+}
+.content__detail-val {
+ min-width: 0;
+ color: var(--text);
+ font-family: var(--font-mono);
+ word-break: break-all;
+}
+.content__detail-type {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--text);
+ font-family: inherit;
+ text-transform: capitalize;
+}
+.content__detail-actions {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ margin-top: 2px;
+}
+.content__detail-actions .btn-soft {
+ width: 100%;
+ justify-content: center;
+}
+.btn-soft.is-primary {
+ color: var(--on-accent);
+ background: var(--star);
+ border-color: var(--star);
+}
+.btn-soft.is-primary:hover {
+ color: var(--on-accent);
+ background: var(--star-hi);
+ border-color: var(--star-hi);
+}
+
/* ------------------------------------------------------------ output log --- */
.log__filters {
display: flex;
@@ -1571,16 +1932,53 @@
font-size: var(--fs-xs);
line-height: 1.7;
}
+/* Log row: icon · time · source · message, with a 2px left severity bar (the
+ Output Log convention) rather than a full-row tint — the bar scans without
+ washing the text. Message hue still carries the level. */
.logline {
display: grid;
- grid-template-columns: 64px 78px 1fr;
+ grid-template-columns: 16px 64px 78px 1fr;
gap: 10px;
- padding: 1px 12px;
+ align-items: center;
+ padding: 1px 12px 1px 14px;
color: var(--text);
+ position: relative;
+}
+.logline::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 2px;
+ background: transparent;
+}
+.logline--warn::before {
+ background: var(--warn);
+}
+.logline--error::before {
+ background: var(--error);
}
.logline:hover {
background: var(--hover);
}
+.logline__icon {
+ display: grid;
+ place-items: center;
+ color: var(--text-faint);
+}
+.logline--info .logline__icon {
+ color: var(--text-dim);
+}
+.logline--success .logline__icon {
+ color: var(--run);
+}
+.logline--warn .logline__icon {
+ color: var(--warn);
+}
+.logline--error .logline__icon {
+ color: var(--error);
+}
.logline__time {
color: var(--text-faint);
}
@@ -1590,9 +1988,6 @@
.logline--warn .logline__msg {
color: var(--warn);
}
-.logline--error {
- background: rgba(255, 107, 107, 0.06);
-}
.logline--error .logline__msg {
color: var(--error);
}
diff --git a/desktop/src/theme/chrome.css b/desktop/src/theme/chrome.css
new file mode 100644
index 000000000..c2116c135
--- /dev/null
+++ b/desktop/src/theme/chrome.css
@@ -0,0 +1,246 @@
+/* =============================================================================
+ @file chrome.css
+ @brief Menubar + toolbar + status bar — adopted verbatim from the design's
+ authored stylesheet (ue5/shell.css), with two editor-only tweaks: the menubar
+ reserves space for the macOS traffic lights and acts as the window drag region.
+ ========================================================================== */
+
+/* ── Menubar ── */
+.menubar {
+ height: var(--h-menubar);
+ flex-shrink: 0;
+ background: var(--srf-0);
+ display: flex;
+ align-items: center;
+ border-bottom: 1px solid var(--border);
+ padding-left: 72px; /* clear the macOS traffic lights */
+ -webkit-app-region: drag; /* the strip is the window drag region */
+}
+.brand { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 11px; }
+.brand-mark {
+ width: 18px;
+ height: 18px;
+ display: grid;
+ place-items: center;
+ color: var(--acc);
+ border: 1px solid var(--acc-lo);
+ border-radius: var(--r-sm);
+ background: linear-gradient(160deg, var(--srf-3), var(--srf-2));
+}
+.brand-name { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.02em; color: var(--text); }
+.menus { display: flex; align-items: center; -webkit-app-region: no-drag; }
+.menu {
+ padding: 4px 9px;
+ font-size: var(--fs-sm);
+ color: var(--text-dim);
+ border-radius: var(--r-sm);
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.menu:hover, .menu.is-open { color: var(--text); background: var(--srf-3); }
+.menubar-spacer { flex: 1; height: 100%; }
+.menubar-title { font-size: var(--fs-xs); color: var(--text-mute); display: flex; align-items: center; gap: 6px; padding-right: 12px; }
+.menubar-title strong { color: var(--text-dim); font-weight: 600; }
+.menubar-title .sep { opacity: 0.5; }
+
+/* ── Toolbar (modes left · play center · actions right) ── */
+.toolbar {
+ height: var(--h-toolbar);
+ flex-shrink: 0;
+ background: var(--srf-3);
+ border-bottom: 1px solid var(--border);
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ padding: 0 8px;
+ position: relative;
+ z-index: 40;
+}
+.tgroup { display: flex; align-items: center; gap: 2px; }
+.tdiv { width: 1px; height: 22px; background: var(--border-line); margin: 0 6px; }
+.tspacer { flex: 1; }
+.tbtn {
+ height: 30px;
+ min-width: 30px;
+ padding: 0 7px;
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ justify-content: center;
+ color: var(--text-dim);
+ border-radius: var(--r-md);
+ font-size: var(--fs-xs);
+ transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
+}
+.tbtn:hover { color: var(--text); background: var(--srf-4); }
+.tbtn:active { background: var(--srf-5); transform: translateY(0.5px); }
+.tbtn.on { color: #fff; background: var(--acc); }
+.tbtn:disabled { opacity: 0.4; pointer-events: none; }
+.tbtn .lbl { font-weight: 500; }
+
+/* Play cluster */
+.play-wrap { display: flex; align-items: stretch; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
+.play-main {
+ display: inline-flex;
+ align-items: center;
+ gap: 7px;
+ height: 30px;
+ padding: 0 14px 0 12px;
+ background: var(--acc);
+ color: #fff;
+ font-weight: 600;
+ font-size: var(--fs-sm);
+ transition: background var(--t-fast);
+}
+.play-main:hover { background: var(--acc-hi); }
+.play-side { width: 28px; display: grid; place-items: center; background: var(--acc); color: rgba(255, 255, 255, 0.85); border-left: 1px solid rgba(0, 0, 0, 0.25); transition: background var(--t-fast); }
+.play-side:hover { background: var(--acc-hi); }
+.play-side:disabled { opacity: 0.45; pointer-events: none; }
+.play-wrap.playing .play-main, .play-wrap.playing .play-side { background: var(--error); }
+.play-wrap.playing .play-main:hover { background: #e36a6a; }
+.play-wrap.paused .play-main, .play-wrap.paused .play-side { background: var(--warn); }
+
+/* ── Status bar ── */
+.status {
+ height: var(--h-status);
+ flex-shrink: 0;
+ background: var(--srf-0);
+ border-top: 1px solid var(--border);
+ display: flex;
+ align-items: center;
+ padding: 0 8px;
+ font-size: var(--fs-xs);
+ color: var(--text-dim);
+}
+.status .grp { display: flex; align-items: center; gap: 4px; }
+.status .sp { flex: 1; }
+.sitem {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ height: 18px;
+ padding: 0 7px;
+ border-radius: var(--r-sm);
+ transition: background var(--t-fast), color var(--t-fast);
+}
+.sitem.click { cursor: pointer; }
+.sitem.click:hover { background: var(--srf-3); color: var(--text); }
+.sitem strong { color: var(--text); font-weight: 600; }
+.sitem.mono { font-family: var(--mono); }
+.sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-mute); }
+.sdot.live { background: var(--play); }
+.smute { color: var(--text-mute); }
+/* Keep the status strip (with the Content-Drawer toggle) above the drawer/scrim. */
+.status { position: relative; z-index: 103; }
+/* Persistent Content Browser toggle — the single anchor, bottom-left. */
+.cb-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ height: 19px;
+ padding: 0 10px;
+ border-radius: var(--r-sm);
+ color: var(--text-dim);
+ font-size: var(--fs-xs);
+ font-weight: 500;
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.cb-btn:hover { color: var(--text); background: var(--srf-3); }
+.cb-btn.active { color: #fff; background: var(--acc); }
+
+/* ── Activity bar (far-left icon rail) ── */
+.activity {
+ width: var(--w-activity);
+ flex-shrink: 0;
+ background: var(--srf-0);
+ border-right: 1px solid var(--border);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 6px 0;
+ gap: 2px;
+}
+.act {
+ width: 34px;
+ height: 34px;
+ display: grid;
+ place-items: center;
+ color: var(--text-mute);
+ border-radius: var(--r-md);
+ position: relative;
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.act:hover { color: var(--text); background: var(--srf-3); }
+.act.active { color: var(--text); background: var(--srf-3); }
+.act.active::before {
+ content: '';
+ position: absolute;
+ left: -6px;
+ top: 50%;
+ width: 3px;
+ height: 20px;
+ border-radius: var(--r-pill);
+ background: var(--acc);
+ transform: translateY(-50%);
+ animation: act-rail var(--t-slow) var(--e-spring);
+}
+@keyframes act-rail {
+ from { transform: translateY(-50%) scaleY(0.2); opacity: 0; }
+ to { transform: translateY(-50%) scaleY(1); opacity: 1; }
+}
+.act-spacer { flex: 1; }
+
+/* ── Content Drawer (slides up over the workspace) ── */
+.scrim {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: var(--h-status);
+ z-index: 100;
+ background: var(--overlay);
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity var(--t) var(--e-out);
+}
+.scrim.open { opacity: 1; pointer-events: auto; }
+.drawer {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: var(--h-status);
+ z-index: 101;
+ height: 46vh;
+ min-height: 320px;
+ background: var(--srf-2);
+ border-top: 2px solid var(--acc);
+ box-shadow: var(--shadow-3);
+ display: flex;
+ flex-direction: column;
+ transform: translateY(calc(100% + var(--h-status)));
+ transition: transform var(--t-slow) var(--e-spring);
+}
+.scrim.open .drawer { transform: translateY(0); }
+.drawer-head {
+ height: 42px;
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 0 14px;
+ border-bottom: 1px solid var(--border);
+}
+.drawer-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-md); color: var(--text); }
+.drawer-title .ic { color: var(--acc-hi); }
+.drawer-sp { flex: 1; }
+.drawer-x {
+ width: 26px;
+ height: 26px;
+ display: grid;
+ place-items: center;
+ color: var(--text-mute);
+ border-radius: var(--r-sm);
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.drawer-x:hover { color: var(--text); background: var(--srf-4); }
+.drawer-body { flex: 1; min-height: 0; display: flex; }
+.drawer-body > .panel { flex: 1; min-width: 0; }
diff --git a/desktop/src/theme/content.css b/desktop/src/theme/content.css
new file mode 100644
index 000000000..d4717974c
--- /dev/null
+++ b/desktop/src/theme/content.css
@@ -0,0 +1,124 @@
+/* =============================================================================
+ @file content.css
+ @brief Content Browser styles — adopted verbatim from the design's authored
+ stylesheet (ue5-content-browser.html): three columns (sources / grid+list /
+ detail), asset tiles with type-color footer + badge, filter chips, footer.
+ `.chip` is scoped to `.cb-chips` (the bare `.chip` is the toolbar chip).
+ ========================================================================== */
+
+.cb-work { flex: 1; display: flex; min-height: 0; background: var(--srf-0); }
+.cb-panel { display: flex; flex-direction: column; min-height: 0; background: var(--srf-2); }
+.cb-head { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; background: var(--srf-3); border-bottom: 1px solid var(--border); flex-shrink: 0; }
+.cb-head .pt { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
+.cb-head .sp { flex: 1; }
+.cb-ico { width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-mute); border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
+.cb-ico:hover { color: var(--text); background: var(--srf-4); }
+
+/* ── Sources (left) ── */
+.cb-src { width: 168px; flex-shrink: 0; border-right: 1px solid var(--border); }
+.cb-src-body { flex: 1; overflow-y: auto; padding: 5px; }
+.cb-sec { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-mute); padding: 9px 8px 3px; }
+.tr { display: flex; align-items: center; gap: 6px; height: 27px; padding: 0 6px; border-radius: var(--r-sm); cursor: pointer; position: relative; user-select: none; transition: background var(--t-fast); }
+.tr:hover { background: var(--srf-3); }
+.tr.sel { background: var(--acc-soft); }
+.tr.sel::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 2px; background: var(--acc); }
+.tr .tw { width: 14px; display: grid; place-items: center; color: var(--text-mute); flex-shrink: 0; }
+.tr .tw svg { transition: transform var(--t-fast) var(--e-out); }
+.tr.open .tw svg { transform: rotate(90deg); }
+.tr .tw.leaf { visibility: hidden; }
+.tr .ti { color: var(--text-dim); display: grid; place-items: center; flex-shrink: 0; }
+.tr.sel .ti { color: var(--acc-hi); }
+.tr .tn { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+
+/* ── Main (center) ── */
+.cb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
+.cb-bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--srf-2); }
+.cb-nav { display: flex; gap: 1px; }
+.cb-nav button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-dim); border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
+.cb-nav button:hover { color: var(--text); background: var(--srf-4); }
+.cb-nav button:disabled { color: var(--text-mute); opacity: 0.4; }
+.crumbs { display: flex; align-items: center; gap: 2px; font-size: var(--fs-sm); min-width: 0; flex: 1; overflow: hidden; }
+.crumbs .cr { padding: 3px 6px; border-radius: var(--r-sm); color: var(--text-dim); cursor: pointer; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
+.crumbs .cr:hover { color: var(--text); background: var(--srf-3); }
+.crumbs .cr.cur { color: var(--text); font-weight: 600; }
+.crumbs .sep { color: var(--text-mute); }
+.cb-search { width: 200px; height: 26px; flex-shrink: 0; }
+.cb-seg { display: flex; gap: 1px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px; flex-shrink: 0; }
+.cb-seg button { width: 26px; height: 22px; display: grid; place-items: center; color: var(--text-mute); border-radius: var(--r-xs); }
+.cb-seg button.on { color: #fff; background: var(--acc); }
+.cb-seg button:hover:not(.on) { color: var(--text); }
+.cb-add { height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; background: var(--acc); color: #fff; font-weight: 600; font-size: var(--fs-xs); border-radius: var(--r-sm); transition: background var(--t-fast); flex-shrink: 0; }
+.cb-add:hover { background: var(--acc-hi); }
+.cb-add:disabled { opacity: 0.45; }
+.cb-ghost { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-dim); background: var(--srf-3); border: 1px solid var(--border-line); border-radius: var(--r-sm); flex-shrink: 0; transition: color var(--t-fast), background var(--t-fast); }
+.cb-ghost:hover { color: var(--text); background: var(--srf-4); }
+
+/* Inline rename editor (tiles + list rows). */
+.cb-rename { width: 100%; min-width: 0; font: inherit; color: var(--text); background: var(--inset); border: 1px solid var(--acc); border-radius: var(--r-xs); padding: 1px 4px; outline: none; text-align: center; }
+.lr .cb-rename { text-align: left; }
+
+/* Hover metadata card (UE5-style quick-glance; non-interactive). */
+.cb-tip { position: fixed; z-index: 135; min-width: 180px; max-width: 340px; padding: 8px 10px; background: var(--srf-3); border: 1px solid var(--border-line); border-radius: var(--r-md); box-shadow: var(--shadow-3); pointer-events: none; font-size: var(--fs-xs); }
+.cb-tip-name { font-weight: 600; color: var(--text); margin-bottom: 6px; word-break: break-word; }
+.cb-tip-row { display: flex; gap: 10px; line-height: 1.7; }
+.cb-tip-row .k { width: 70px; flex-shrink: 0; color: var(--text-mute); }
+.cb-tip-row .v { flex: 1; min-width: 0; color: var(--text-dim); word-break: break-word; }
+.cb-tip-row .v.mono { font-family: var(--mono); font-size: var(--fs-2xs); }
+
+.cb-chips { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
+.cb-chips .chip { height: 24px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; font-size: var(--fs-xs); color: var(--text-dim); background: var(--srf-3); border: 1px solid var(--border-line); border-radius: var(--r-pill); white-space: nowrap; flex-shrink: 0; transition: all var(--t-fast); }
+.cb-chips .chip:hover { color: var(--text); border-color: var(--text-mute); }
+.cb-chips .chip.on { color: #fff; background: var(--acc); border-color: var(--acc); }
+.cb-chips .chip .d { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
+
+.cb-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
+/* grid view */
+.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 104px), 1fr)); gap: 10px; align-content: start; }
+.asset { position: relative; border-radius: var(--r-md); cursor: pointer; outline: 1px solid transparent; transition: outline-color var(--t-fast), transform var(--t-fast); }
+.asset:hover { outline-color: var(--border-line); transform: translateY(-1px); }
+.asset.sel { outline: 2px solid var(--acc); }
+.asset .th { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--r-md) var(--r-md) 0 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); overflow: hidden; background: var(--srf-4); }
+.asset .th img { width: 100%; height: 100%; object-fit: cover; }
+.asset .th .badge { position: absolute; top: 5px; left: 5px; font-size: 8px; font-weight: 700; letter-spacing: 0.4px; padding: 1px 4px; border-radius: var(--r-xs); background: rgba(0, 0, 0, 0.5); color: #fff; font-family: var(--mono); }
+.asset .nm { display: flex; align-items: center; gap: 4px; padding: 6px 7px; font-size: var(--fs-xs); color: var(--text); background: var(--srf-3); border-radius: 0 0 var(--r-md) var(--r-md); border-top: 2px solid var(--tc, var(--text-mute)); }
+.asset .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.folder .th { background: none; color: var(--cat-collision); }
+.folder .nm { border-top-color: transparent; }
+/* list view */
+.cb-list { display: flex; flex-direction: column; }
+.lh, .lr { display: grid; grid-template-columns: 1fr 90px; align-items: center; gap: 8px; padding: 0 10px; height: 30px; }
+.lh { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-mute); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--srf-2); }
+.lr { border-radius: var(--r-sm); cursor: pointer; transition: background var(--t-fast); }
+.lr:hover { background: var(--srf-3); }
+.lr.sel { background: var(--acc-soft); }
+.lr .ln { display: flex; align-items: center; gap: 8px; min-width: 0; }
+.lr .ln .t { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.lr .c { font-size: var(--fs-xs); color: var(--text-dim); font-family: var(--mono); }
+.cb-empty { padding: 50px; text-align: center; color: var(--text-mute); }
+.cb-empty .ei { width: 44px; height: 44px; margin: 0 auto 10px; display: grid; place-items: center; border: 1px dashed var(--border-line); border-radius: var(--r-lg); }
+
+/* ── Detail (right) ── */
+.cb-detail { width: 232px; flex-shrink: 0; border-left: 1px solid var(--border); }
+.cb-detail-body { flex: 1; overflow-y: auto; }
+.cb-prev { height: 168px; display: grid; place-items: center; background: repeating-conic-gradient(#1c1c21 0 25%, #18181c 0 50%) 0 / 22px 22px; border-bottom: 1px solid var(--border); position: relative; color: rgba(255, 255, 255, 0.9); }
+.cb-prev .pv { position: absolute; inset: 16px; border-radius: var(--r-sm); display: grid; place-items: center; overflow: hidden; }
+.cb-prev .pv img { max-width: 100%; max-height: 100%; object-fit: contain; }
+.cb-dt { padding: 11px 13px; }
+.cb-dt .an { font-size: var(--fs-md); font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; word-break: break-word; }
+.cb-dt .an .tg { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: var(--r-xs); color: #fff; flex-shrink: 0; font-family: var(--mono); }
+.cb-dt .ap { font-size: var(--fs-2xs); color: var(--text-mute); font-family: var(--mono); margin-top: 3px; word-break: break-all; }
+.cb-meta { margin-top: 12px; display: flex; flex-direction: column; gap: 1px; }
+.cb-mr { display: flex; align-items: center; height: 26px; font-size: var(--fs-sm); }
+.cb-mr .k { width: 76px; color: var(--text-mute); flex-shrink: 0; }
+.cb-mr .v { color: var(--text-dim); font-family: var(--mono); font-size: var(--fs-xs); }
+.cb-act { padding: 11px 13px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
+.cb-act button { height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--fs-sm); border-radius: var(--r-sm); transition: background var(--t-fast); }
+.cb-act .primary { background: var(--acc); color: #fff; font-weight: 600; }
+.cb-act .primary:hover { background: var(--acc-hi); }
+.cb-act .ghost { background: var(--srf-3); color: var(--text-dim); border: 1px solid var(--border-line); }
+.cb-act .ghost:hover { color: var(--text); background: var(--srf-4); }
+
+/* footer: thumb size */
+.cb-foot { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 12px; border-top: 1px solid var(--border); background: var(--srf-2); flex-shrink: 0; font-size: var(--fs-xs); color: var(--text-dim); }
+.cb-foot .sp { flex: 1; }
+.cb-foot input[type='range'] { width: 110px; accent-color: var(--acc); cursor: ew-resize; }
diff --git a/desktop/src/theme/dockview-theme.css b/desktop/src/theme/dockview-theme.css
index ae6e70425..a9fd1c9ec 100644
--- a/desktop/src/theme/dockview-theme.css
+++ b/desktop/src/theme/dockview-theme.css
@@ -14,26 +14,25 @@
.dockview-theme-abyss.dockview-theme-estella {
--dv-group-view-background-color: var(--panel);
- /* Tab strip */
- --dv-tabs-and-actions-container-background-color: var(--elevated);
- --dv-tabs-and-actions-container-height: 28px;
+ /* Tab strip — darkest groove; the active tab fills with the panel color so it
+ merges into the body (the design's .ptabs / .ptab). */
+ --dv-tabs-and-actions-container-background-color: var(--srf-0);
+ --dv-tabs-and-actions-container-height: var(--h-tab);
--dv-tabs-and-actions-container-font-size: var(--fs-sm);
--dv-tab-divider-color: transparent;
- /* Active group, focused tab */
- --dv-activegroup-visiblepanel-tab-background-color: var(--panel);
- --dv-activegroup-visiblepanel-tab-color: var(--text-hi);
- /* Active group, background tabs */
- --dv-activegroup-hiddenpanel-tab-background-color: var(--elevated);
- --dv-activegroup-hiddenpanel-tab-color: var(--text-dim);
- /* Inactive group */
- --dv-inactivegroup-visiblepanel-tab-background-color: var(--panel);
- --dv-inactivegroup-visiblepanel-tab-color: var(--text);
- --dv-inactivegroup-hiddenpanel-tab-background-color: var(--elevated);
- --dv-inactivegroup-hiddenpanel-tab-color: var(--text-faint);
+ /* Active visible tab = panel color; background tabs = transparent on the strip. */
+ --dv-activegroup-visiblepanel-tab-background-color: var(--srf-2);
+ --dv-activegroup-visiblepanel-tab-color: var(--text);
+ --dv-activegroup-hiddenpanel-tab-background-color: transparent;
+ --dv-activegroup-hiddenpanel-tab-color: var(--text-mute);
+ --dv-inactivegroup-visiblepanel-tab-background-color: var(--srf-2);
+ --dv-inactivegroup-visiblepanel-tab-color: var(--text-dim);
+ --dv-inactivegroup-hiddenpanel-tab-background-color: transparent;
+ --dv-inactivegroup-hiddenpanel-tab-color: var(--text-mute);
- /* Structure */
- --dv-separator-border: var(--line);
+ /* Structure — dark groove between docked panels, not a light hairline. */
+ --dv-separator-border: var(--groove);
--dv-paneview-header-border-color: var(--line);
--dv-active-sash-color: var(--star-line);
--dv-paneview-active-outline-color: var(--star);
@@ -48,18 +47,54 @@
--dv-tabs-container-scrollbar-color: var(--line-strong);
}
-/* The focused group gets a subtle neutral top-edge; the active TAB carries the
- one starlight accent (its underline), so blue stays reserved for selection. */
-.dockview-theme-estella .dv-groupview.dv-active-group > .dv-tabs-and-actions-container {
- box-shadow: inset 0 1px 0 0 var(--line-strong);
+/* Tabs follow the design's .ptab: flat, segmented (a groove between tabs), the
+ active tab fills with the panel color and carries an accent line on TOP that
+ slides in on activation; a 1px bottom line in the panel color hides the strip
+ border so the active tab merges into the body. */
+.dockview-theme-estella .dv-tabs-and-actions-container {
+ background: var(--srf-0);
+ border-bottom: 1px solid var(--border);
+}
+.dockview-theme-estella .dv-tabs-container,
+.dockview-theme-estella .dv-void-container,
+.dockview-theme-estella .dv-right-actions-container,
+.dockview-theme-estella .dv-left-actions-container {
+ background: var(--srf-0);
}
-
-/* Tabs: hairline-separated, instrument-like, with a starlight underline when active. */
.dockview-theme-estella .dv-tab {
- border-right: 1px solid var(--line-soft);
- padding: 0 12px;
+ position: relative;
+ border-right: 1px solid var(--border);
+ padding: 0 15px;
letter-spacing: 0.01em;
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.dockview-theme-estella .dv-tab:not(.dv-active-tab):hover {
+ background: var(--srf-1);
+ color: var(--text-dim);
+}
+/* Top accent line — the tab-switch animation (scaleX in). */
+.dockview-theme-estella .dv-tab::after {
+ content: '';
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ height: 2px;
+ background: var(--acc);
+ transform: scaleX(0);
+ transition: transform var(--t) var(--e-out);
+}
+.dockview-theme-estella .dv-tab.dv-active-tab::after {
+ transform: scaleX(1);
}
-.dockview-theme-estella .dv-tab.dv-active-tab {
- box-shadow: inset 0 -2px 0 0 var(--star);
+/* Bottom merge line — hides the strip border under the active tab. */
+.dockview-theme-estella .dv-tab.dv-active-tab::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: -1px;
+ height: 1px;
+ background: var(--srf-2);
+ z-index: 1;
}
diff --git a/desktop/src/theme/inspector.css b/desktop/src/theme/inspector.css
new file mode 100644
index 000000000..f42be4164
--- /dev/null
+++ b/desktop/src/theme/inspector.css
@@ -0,0 +1,143 @@
+/* =============================================================================
+ @file inspector.css
+ @brief Inspector (Details) styles — adopted verbatim from the design's authored
+ stylesheet (ue5/shell.css) so the panel renders as the design, not a
+ re-interpretation. Token vocabulary (--acc/--border/--mono…) resolves through
+ the compat aliases in tokens.css. Imported after app.css so it owns the
+ inspector; the one local deviation is scoping `.pill` to `.ent-meta` (the
+ bare `.pill` is the Output Log filter pill elsewhere).
+ ========================================================================== */
+
+/* panel search field (shared header control the inspector head reuses) */
+.search {
+ flex: 1;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ background: var(--inset);
+ border: 1px solid var(--border);
+ border-radius: var(--r-sm);
+ padding: 0 8px;
+ color: var(--text-mute);
+ transition: border-color var(--t-fast), box-shadow var(--t-fast);
+}
+.search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
+.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: var(--fs-sm); color: var(--text); }
+.search input::placeholder { color: var(--text-mute); }
+
+/* ════════════════════════ INSPECTOR (Details) ════════════════════════ */
+.insp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
+.insp-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
+.insp-head .search { height: 26px; }
+.insp-add { height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px;
+ background: var(--acc); color: #fff; font-weight: 600; font-size: var(--fs-xs); border-radius: var(--r-sm);
+ transition: background var(--t-fast); white-space: nowrap; }
+.insp-add:hover { background: var(--acc-hi); }
+.filt-btn { width: 28px; height: 26px; display: grid; place-items: center; color: var(--text-mute); border: 1px solid var(--border-line); border-radius: var(--r-sm); flex-shrink: 0; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
+.filt-btn:hover { color: var(--text); background: var(--srf-4); }
+.filt-btn.on { color: var(--warn); border-color: rgba(211,162,60,0.4); background: rgba(211,162,60,0.12); }
+/* Add Component at the TOP of Details */
+.insp-addrow { padding: 8px; border-bottom: 1px solid var(--border); }
+.insp-addrow .insp-add { width: 100%; height: 30px; justify-content: center; }
+
+.insp-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
+
+/* entity header */
+.ent-head { padding: 8px; border-bottom: 1px solid var(--border); background: var(--srf-2); }
+.ent-row1 { display: flex; align-items: center; gap: 7px; }
+.ent-chk { width: 16px; height: 16px; border: 1px solid var(--border-line); border-radius: var(--r-sm); display: grid; place-items: center; color: transparent; background: var(--inset); flex-shrink: 0; transition: all var(--t-fast); }
+.ent-chk.on { background: var(--acc); border-color: var(--acc); color: #fff; }
+.ent-name { flex: 1; min-width: 0; height: 28px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 9px; font-size: var(--fs-md); font-weight: 600; color: var(--text); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
+.ent-name:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
+.ent-static { width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-mute); border: 1px solid var(--border); border-radius: var(--r-sm); transition: all var(--t-fast); flex-shrink: 0; }
+.ent-static.on { color: var(--acc-hi); border-color: var(--acc-lo); background: var(--acc-soft); }
+.ent-meta { display: flex; gap: 6px; margin-top: 7px; }
+.ent-meta .pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; background: var(--srf-3); border: 1px solid var(--border-line); border-radius: var(--r-sm); font-size: var(--fs-xs); color: var(--text-dim); cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
+.ent-meta .pill:hover { border-color: var(--border-line); color: var(--text); background: var(--srf-4); }
+.ent-meta .pill .pk { color: var(--text-mute); }
+.ent-meta .pill .cv { opacity: .5; }
+.prefab-bar { display: flex; align-items: center; gap: 7px; margin-top: 7px; padding: 5px 8px; background: var(--acc-soft); border: 1px solid rgba(47,136,214,0.25); border-radius: var(--r-sm); font-size: var(--fs-xs); }
+.prefab-bar .pic { color: var(--acc-hi); flex-shrink: 0; display: grid; place-items: center; }
+.prefab-bar .pn { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.prefab-bar button { font-size: var(--fs-2xs); color: var(--acc-hi); padding: 2px 5px; border-radius: var(--r-xs); transition: background var(--t-fast); }
+.prefab-bar button:hover { background: var(--acc-soft-2); }
+
+/* component / category */
+.comp { border-bottom: 1px solid var(--border); }
+.comp-head { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px 0 0; background: var(--srf-3); cursor: pointer; position: relative; user-select: none; transition: background var(--t-fast); }
+.comp-head:hover { background: var(--srf-4); }
+.comp-head::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border-line); }
+.comp-arrow { width: 20px; display: grid; place-items: center; color: var(--text-mute); }
+.comp-arrow svg { transition: transform var(--t-fast) var(--e-out); }
+.comp.open .comp-arrow svg { transform: rotate(90deg); }
+.comp-chk { width: 14px; height: 14px; border: 1px solid var(--border-line); border-radius: var(--r-xs); display: grid; place-items: center; color: transparent; background: var(--inset); flex-shrink: 0; transition: all var(--t-fast); }
+.comp-chk.on { background: var(--acc); border-color: var(--acc); color: #fff; }
+.comp-icon { color: var(--text-dim); display: grid; place-items: center; }
+.comp-name { font-weight: 600; font-size: var(--fs-sm); color: var(--text); flex: 1; }
+.comp.override .comp-name::after { content: ''; display: inline-block; width: 5px; height: 5px; background: var(--warn); border-radius: 50%; margin-left: 7px; vertical-align: middle; }
+.comp-badge { font-size: var(--fs-2xs); color: var(--text-mute); font-family: var(--mono); }
+.comp-menu { width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-mute); border-radius: var(--r-sm); opacity: 0; transition: opacity var(--t-fast), color var(--t-fast), background var(--t-fast); }
+.comp-head:hover .comp-menu { opacity: 1; }
+.comp-menu:hover { color: var(--text); background: var(--srf-5); }
+.comp-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-slow) var(--e-out); }
+.comp.open .comp-body { grid-template-rows: 1fr; }
+.comp-body > .cinner { overflow: hidden; }
+.comp-fields { padding: 5px 8px 8px; }
+
+/* property rows (label col + value col, reset on right) */
+.prop { display: grid; grid-template-columns: 38% 1fr 18px; align-items: center; gap: 4px; min-height: var(--h-prop); padding: 1px 0; position: relative; }
+.prop-label { font-size: var(--fs-sm); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 2px; }
+.prop-label.scrub { cursor: ew-resize; user-select: none; }
+.prop-label.scrub:hover { color: var(--text); }
+.prop.modified .prop-label { color: var(--text); }
+.prop.modified .prop-label::before { content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%); width: 3px; height: 13px; border-radius: 2px; background: var(--warn); }
+.prop-value { display: flex; align-items: center; gap: 4px; min-width: 0; }
+.prop-reset { width: 16px; height: 16px; display: grid; place-items: center; color: var(--warn); opacity: 0; transition: opacity var(--t-fast); justify-self: center; }
+.prop:hover .prop-reset.show, .prop.modified .prop-reset.show { opacity: .85; }
+.prop-reset:hover { opacity: 1 !important; }
+
+.field { height: 22px; flex: 1; min-width: 0; display: flex; align-items: center; background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-sm); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
+.field:focus-within { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
+.field input { width: 100%; min-width: 0; background: none; border: none; outline: none; padding: 0 7px; font-size: var(--fs-sm); color: var(--text); font-family: var(--mono); }
+.field select { width: 100%; background: none; border: none; outline: none; padding: 0 6px; font-size: var(--fs-sm); color: var(--text); appearance: none; cursor: pointer; }
+.vec { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; flex: 1; min-width: 0; }
+.vfield { height: 22px; display: flex; align-items: center; background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; min-width: 0; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
+.vfield:focus-within { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
+.ax { width: 16px; height: 100%; display: grid; place-items: center; font-size: 9px; font-weight: 700; font-family: var(--mono); color: #fff; cursor: ew-resize; flex-shrink: 0; font-style: normal; }
+.ax.x { background: var(--ax-x); }
+.ax.y { background: var(--ax-y); }
+.ax.z { background: var(--ax-z); }
+.ax.w, .ax.h { background: var(--srf-5); color: var(--text-dim); }
+.vfield input { width: 100%; min-width: 0; background: none; border: none; outline: none; padding: 0 5px; font-size: var(--fs-xs); color: var(--text); font-family: var(--mono); }
+
+.sw { width: 22px; height: 18px; border-radius: var(--r-xs); border: 1px solid var(--border-line); flex-shrink: 0; cursor: pointer; }
+.slider { flex: 1; height: 6px; background: var(--inset); border-radius: var(--r-pill); position: relative; cursor: pointer; }
+.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acc); border-radius: var(--r-pill); }
+.slider .thumb { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--text); transform: translate(-50%,-50%); box-shadow: var(--shadow-1); }
+.toggle { width: 30px; height: 17px; border-radius: var(--r-pill); background: var(--srf-5); position: relative; cursor: pointer; flex-shrink: 0; transition: background var(--t-fast); }
+.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--text-dim); transition: left var(--t-fast) var(--e-out), background var(--t-fast); }
+.toggle.on { background: var(--acc); }
+.toggle.on::after { left: 15px; background: #fff; }
+.assetref { flex: 1; min-width: 0; height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 3px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-sm); transition: border-color var(--t-fast); cursor: pointer; }
+.assetref:hover { border-color: var(--border-line); }
+.assetref.is-over { border-color: var(--acc); background: var(--acc-soft); }
+.assetref .th { width: 16px; height: 16px; border-radius: 2px; background: var(--srf-4); display: grid; place-items: center; color: var(--text-mute); flex-shrink: 0; overflow: hidden; }
+.assetref .th img { width: 100%; height: 100%; object-fit: contain; }
+.assetref .an { flex: 1; font-size: var(--fs-xs); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.assetref .pk { color: var(--text-mute); display: grid; place-items: center; }
+
+/* advanced sub-section */
+.subfold { display: flex; align-items: center; gap: 5px; height: 22px; margin-top: 4px; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .5px; color: var(--text-mute); cursor: pointer; }
+.subfold svg { transition: transform var(--t-fast) var(--e-out); }
+.subfold.open svg { transform: rotate(90deg); }
+.subbody { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t) var(--e-out); }
+.subfold.open + .subbody { grid-template-rows: 1fr; }
+.subbody > div { overflow: hidden; }
+
+/* empty / multi states */
+.insp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; padding: 40px 24px; text-align: center; color: var(--text-mute); }
+.insp-empty .ei { width: 46px; height: 46px; display: grid; place-items: center; color: var(--text-mute); border: 1px dashed var(--border-line); border-radius: var(--r-lg); }
+.insp-empty .et { font-size: var(--fs-md); color: var(--text-dim); font-weight: 600; }
+.insp-empty .es { font-size: var(--fs-sm); line-height: 1.5; }
+.filter-empty { padding: 24px; text-align: center; color: var(--text-mute); font-size: var(--fs-sm); }
diff --git a/desktop/src/theme/launcher.css b/desktop/src/theme/launcher.css
index 4ecab0480..2ba27bec3 100644
--- a/desktop/src/theme/launcher.css
+++ b/desktop/src/theme/launcher.css
@@ -1,7 +1,7 @@
/* =============================================================================
Estella Launcher (project browser). Stellar-instrument identity from
- tokens.css; structure borrows Unity Hub (persistent top actions, build-aware
- list) + UE5 (template gallery + create panel). Signature: projects on a star
+ tokens.css; a hub layout — persistent top actions, a build-aware project
+ list, and a template gallery + create panel. Signature: projects on a star
chart — faint starfield, starlight glow on focus, a constellation mark.
========================================================================== */
diff --git a/desktop/src/theme/log.css b/desktop/src/theme/log.css
new file mode 100644
index 000000000..16d7717cb
--- /dev/null
+++ b/desktop/src/theme/log.css
@@ -0,0 +1,91 @@
+/* =============================================================================
+ @file log.css
+ @brief Output Log styles — adopted verbatim from the design's authored
+ stylesheet (ue5/shell.css): severity filter chips + a 2px left-bar log row.
+ ========================================================================== */
+
+.log-chips { display: flex; gap: 6px; align-items: center; }
+.log-chip {
+ height: 22px;
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ padding: 0 9px;
+ border: 1px solid var(--border-line);
+ border-radius: var(--r-pill);
+ color: var(--text-mute);
+ font-size: var(--fs-xs);
+ font-weight: 500;
+ cursor: pointer;
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.log-chip .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
+.log-chip:hover { color: var(--text-dim); }
+.log-chip.on { background: var(--srf-4); color: var(--text-dim); }
+.log-chip.info.on { color: var(--acc-hi); }
+.log-chip.warn.on { color: var(--warn); }
+.log-chip.error.on { color: var(--error); }
+.log-chip .ct { font-variant-numeric: tabular-nums; opacity: 0.85; }
+
+.log-search {
+ margin-left: auto;
+ flex: 0 1 150px;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ background: var(--inset);
+ border: 1px solid var(--border);
+ border-radius: var(--r-sm);
+ padding: 0 8px;
+ color: var(--text-mute);
+ transition: border-color var(--t-fast);
+}
+.log-search:focus-within { border-color: var(--acc); }
+.log-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: var(--fs-xs); color: var(--text); }
+.log-search input::placeholder { color: var(--text-mute); }
+
+/* The log is a selectable text stream (UE5): drag to select across lines, then
+ Ctrl+C / right-click Copy. The shell sets `user-select: none` globally, so the
+ body re-enables it explicitly. */
+.log-body {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+ padding: 6px 0;
+ font-family: var(--mono);
+ font-size: var(--fs-xs);
+ user-select: text;
+ cursor: text;
+}
+/* Rows flow inline (not a fixed-column grid) so the category never truncates and
+ selected text copies cleanly; the two-space separators are real copyable text. */
+.log-row { padding: 2px 14px; line-height: 1.6; border-left: 2px solid transparent; white-space: pre-wrap; word-break: break-word; }
+.log-row:hover { background: var(--srf-3); }
+.log-row.warn { border-left-color: var(--warn); }
+.log-row.error { border-left-color: var(--error); background: rgba(214, 90, 90, 0.07); }
+.log-row .lt { color: var(--text-mute); }
+.log-row .ls { color: var(--acc-hi); }
+.log-row.warn .ls { color: var(--warn); }
+.log-row.error .ls { color: var(--error); }
+.log-row .lm { color: var(--text-dim); }
+.log-empty { padding: 16px 14px; color: var(--text-mute); font-size: var(--fs-xs); font-family: var(--sans); }
+
+/* Active state for the header toggles (categories / timestamps). */
+.pbtn.on { color: var(--acc-hi); background: var(--srf-4); }
+
+/* Category filter popover (built on the .ctx context-menu shell). */
+.log-cats { max-height: 340px; overflow-y: auto; min-width: 184px; }
+.log-cats .lc-head { display: flex; gap: 6px; padding: 2px 4px 4px; }
+.log-cats .lc-act {
+ flex: 1;
+ height: 22px;
+ border-radius: var(--r-sm);
+ color: var(--text-dim);
+ font-size: var(--fs-2xs);
+ background: var(--srf-3);
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.log-cats .lc-act:hover { color: var(--text); background: var(--srf-4); }
+.log-cats .lc-none { padding: 6px 8px; color: var(--text-mute); font-size: var(--fs-2xs); }
+.log-cats .ck { font-variant-numeric: tabular-nums; }
diff --git a/desktop/src/theme/menus.css b/desktop/src/theme/menus.css
new file mode 100644
index 000000000..f2ce4e3a3
--- /dev/null
+++ b/desktop/src/theme/menus.css
@@ -0,0 +1,86 @@
+/* =============================================================================
+ @file menus.css
+ @brief Context menu (.ctx) + Add-Component picker (.ac) — adopted verbatim from
+ the design's authored stylesheet (ue5/shell.css). Shared across every
+ right-click / kebab menu and the component picker so they read as the design.
+ ========================================================================== */
+
+/* ════════════════════════ Context menu ════════════════════════ */
+.ctx {
+ position: fixed;
+ z-index: 140;
+ min-width: 184px;
+ background: var(--srf-3);
+ border: 1px solid var(--border-line);
+ border-radius: var(--r-md);
+ box-shadow: var(--shadow-3);
+ padding: 4px;
+ transform-origin: top left;
+}
+.ctx-item {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ width: 100%;
+ height: 28px;
+ padding: 0 9px;
+ border-radius: var(--r-sm);
+ color: var(--text-dim);
+ font-size: var(--fs-sm);
+ text-align: left;
+ cursor: pointer;
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.ctx-item:hover { color: var(--text); background: var(--acc-soft); }
+.ctx-item:disabled { color: var(--text-mute); cursor: default; background: none; }
+.ctx-item .ci { width: 14px; display: grid; place-items: center; color: var(--text-mute); flex-shrink: 0; }
+.ctx-item:hover .ci { color: var(--acc-hi); }
+.ctx-item .cl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.ctx-item .ck { margin-left: auto; font-size: var(--fs-2xs); color: var(--text-mute); }
+.ctx-item.danger:hover { background: rgba(214, 90, 90, 0.14); color: var(--error); }
+.ctx-item.danger:hover .ci { color: var(--error); }
+.ctx-sep { height: 1px; background: var(--border-line); margin: 4px 6px; }
+
+/* ════════════════════════ Add Component picker ════════════════════════ */
+.ac-scrim {
+ position: fixed;
+ inset: 0;
+ z-index: 122;
+ background: var(--overlay);
+ display: flex;
+ justify-content: center;
+ padding-top: 13vh;
+}
+.ac {
+ width: 450px;
+ max-width: 92vw;
+ max-height: 64vh;
+ display: flex;
+ flex-direction: column;
+ background: var(--srf-3);
+ border: 1px solid var(--border-line);
+ border-radius: var(--r-lg);
+ box-shadow: var(--shadow-3);
+ overflow: hidden;
+ align-self: flex-start;
+ animation: ac-in var(--t) var(--e-spring);
+}
+@keyframes ac-in {
+ from { transform: translateY(-10px) scale(0.98); }
+ to { transform: translateY(0) scale(1); }
+}
+.ac-search { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-mute); }
+.ac-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: var(--fs-md); color: var(--text); }
+.ac-search .esc { font-size: var(--fs-2xs); border: 1px solid var(--border-line); border-radius: 2px; padding: 1px 5px; }
+.ac-body { overflow-y: auto; padding: 6px; }
+.ac-sec { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-mute); font-weight: 700; padding: 8px 10px 4px; }
+.ac-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-md); color: var(--text-dim); text-align: left; transition: background var(--t-fast), color var(--t-fast); }
+.ac-item:hover, .ac-item.sel { background: var(--acc-soft); color: var(--text); }
+.ac-item .ai { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--srf-4); display: grid; place-items: center; color: var(--text-dim); flex-shrink: 0; }
+.ac-item:hover .ai, .ac-item.sel .ai { color: var(--acc-hi); }
+.ac-item .at { flex: 1; min-width: 0; }
+.ac-item .an { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
+.ac-item .ad { font-size: var(--fs-2xs); color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.ac-item .ak { font-size: var(--fs-2xs); color: var(--text-mute); opacity: 0; }
+.ac-item.sel .ak { opacity: 1; }
+.ac-empty { padding: 26px; text-align: center; color: var(--text-mute); font-size: var(--fs-sm); }
diff --git a/desktop/src/theme/outliner.css b/desktop/src/theme/outliner.css
new file mode 100644
index 000000000..5f1ee603f
--- /dev/null
+++ b/desktop/src/theme/outliner.css
@@ -0,0 +1,93 @@
+/* =============================================================================
+ @file outliner.css
+ @brief Outliner (World Outliner) + shared panel scaffolding — adopted verbatim
+ from the design's authored stylesheet (ue5/shell.css). The panel header
+ (.phead / .pbtn / .pbody) is shared with other docked panels and defined here.
+ ========================================================================== */
+
+/* Panel header (search / actions row) — shared scaffolding */
+.phead {
+ height: 32px;
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 0 8px;
+ border-bottom: 1px solid var(--border);
+}
+.pbtn {
+ width: 24px;
+ height: 24px;
+ display: grid;
+ place-items: center;
+ color: var(--text-mute);
+ border-radius: var(--r-sm);
+ flex-shrink: 0;
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.pbtn:hover { color: var(--text); background: var(--srf-4); }
+.pbody { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
+
+/* Column header strip */
+.outliner-cols {
+ display: flex;
+ align-items: center;
+ height: 22px;
+ padding: 0 8px 0 10px;
+ font-size: var(--fs-2xs);
+ color: var(--text-mute);
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ border-bottom: 1px solid var(--border);
+ background: var(--srf-2);
+ flex-shrink: 0;
+}
+.outliner-cols .c-name { flex: 1; }
+.outliner-cols .c-type { width: 78px; flex-shrink: 0; }
+.outliner-cols .c-vis { width: 24px; text-align: center; flex-shrink: 0; }
+
+/* Rows */
+.row {
+ display: flex;
+ align-items: center;
+ height: 24px;
+ padding-right: 6px;
+ font-size: var(--fs-sm);
+ color: var(--text-dim);
+ cursor: default;
+ position: relative;
+ transition: background var(--t-fast), color var(--t-fast);
+}
+.row:hover { background: var(--srf-3); color: var(--text); }
+.row.sel { background: var(--acc); color: #fff; }
+.row.sel:hover { background: var(--acc); }
+.row.drop { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); }
+.row .twist { width: 16px; height: 100%; display: grid; place-items: center; color: var(--text-mute); flex-shrink: 0; }
+.row.sel .twist { color: rgba(255, 255, 255, 0.8); }
+.row .twist svg { transition: transform var(--t-fast) var(--e-out); }
+.row.open > .twist svg { transform: rotate(90deg); }
+.row .twist.leaf { visibility: hidden; }
+.row .ricon { width: 18px; display: grid; place-items: center; color: var(--text-mute); flex-shrink: 0; }
+.row.sel .ricon { color: rgba(255, 255, 255, 0.92); }
+.row.prefab .ricon { color: var(--info-warm); }
+.row.sel.prefab .ricon { color: #fff; }
+.row .rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.row .rname-edit {
+ flex: 1;
+ min-width: 0;
+ background: var(--inset);
+ border: 1px solid var(--acc);
+ border-radius: var(--r-xs);
+ padding: 1px 5px;
+ color: var(--text);
+ font-size: var(--fs-sm);
+ outline: none;
+}
+.row .rtype { width: 78px; font-size: var(--fs-2xs); color: var(--text-mute); font-family: var(--mono); flex-shrink: 0; }
+.row.sel .rtype { color: rgba(255, 255, 255, 0.72); }
+.row .rvis { width: 24px; display: grid; place-items: center; color: var(--text-mute); opacity: 0; transition: opacity var(--t-fast), color var(--t-fast); flex-shrink: 0; }
+.row:hover .rvis, .row.sel .rvis, .row.hidden .rvis { opacity: 1; }
+.row.sel .rvis { color: rgba(255, 255, 255, 0.8); }
+.row .rvis:hover { color: var(--text); }
+.row.sel .rvis:hover { color: #fff; }
+.row.hidden .rname { color: var(--text-mute); }
diff --git a/desktop/src/theme/tokens.css b/desktop/src/theme/tokens.css
index 257e32df8..276c64c16 100644
--- a/desktop/src/theme/tokens.css
+++ b/desktop/src/theme/tokens.css
@@ -1,51 +1,98 @@
/* =============================================================================
- Estella Editor — design tokens
- Identity: a precise, professional instrument. Near-neutral dark surfaces with
- only a faint cool cast (not saturated navy), flat hairline structure (no
- glows), one restrained blue accent, and a monospace face reserved for live
- data so numbers read like an instrument. Tuned toward DCC-tool neutrality
- (UE5 / Blender / VS Code) over decorative game-UI styling.
+ @file tokens.css
+ @brief Estella Editor design tokens — the "azure" line.
+
+ Identity: a precise, professional DCC-grade instrument — near-black neutral
+ slate surfaces, one restrained azure accent, the iconic orange viewport
+ selection, and a monospace face reserved for live data so numbers read like
+ an instrument.
+
+ The canonical palette is the `--srf-*` surface ramp + the semantic groups
+ below. Legacy names (`--void` / `--star` / `--line` …) are kept as aliases so
+ the existing shell + panels keep resolving — only their *values* moved onto
+ the new ramp. Prefer the canonical names in new work.
========================================================================== */
:root {
- /* — Surfaces: near-neutral dark ramp, a hair of cool cast, darkest at the
- viewport void. Inputs sit DARKER than their panel (UE5-style wells). — */
- --void: #0e0f12; /* viewport / deepest stage */
- --base: #17181b; /* app background behind panels */
- --panel: #1d1f23; /* panel body */
- --elevated: #25272c; /* toolbars, tab strips, headers */
- --raised: #2c2f35; /* popovers, dropdowns */
- --input: #15161a; /* fields, wells (darker than panel) */
+ /* — Canonical surface ramp: near-black neutral slate. Chrome
+ recedes to the darkest groove; panels sit a step up; inputs sit BELOW
+ their panel as wells. — */
+ --srf-0: #0a0a0c; /* window chrome / deepest groove: menubar, statusbar, dock seams */
+ --srf-1: #121215; /* viewport / app canvas behind panels */
+ --srf-2: #19191d; /* panel body */
+ --srf-3: #212127; /* raised: toolbars, tab strips, headers */
+ --srf-4: #2a2a31; /* hover surface / popovers */
+ --srf-5: #34343d; /* pressed / selected surface */
+ --srf-6: #3f3f49; /* strongest */
+ --inset: #0e0e11; /* input wells (sit darker than their panel) */
+
+ /* — Legacy surface aliases (shell + panels consume these names) — */
+ --void: var(--srf-1); /* viewport canvas */
+ --base: var(--srf-0); /* app chrome: menubar / statusbar / shell bg / dock seams */
+ --panel: var(--srf-2);
+ --elevated: var(--srf-3);
+ --raised: var(--srf-4);
+ --input: var(--inset);
--hover: rgba(255, 255, 255, 0.05);
--pressed: rgba(255, 255, 255, 0.08);
- --glass-rgb: 14, 15, 18; /* neutral base for floating overlays (was navy-tinted) */
-
- /* — Structure: neutral hairlines do the visual work, not boxes — */
- --line: #2b2e34;
- --line-soft: #232529;
- --line-strong: #3a3e46;
-
- /* — Text: neutral contrast ramp (blue cast removed) — */
- --text-hi: #ecedf0;
- --text: #c3c6cc;
- --text-dim: #888c94;
- --text-faint: #5b5f68;
-
- /* — Accent: one restrained blue. Flat — the glow is a crisp 1px ring, no blur. — */
- --star: #4c8fd6;
- --star-hi: #6ba6e6;
- --star-dim: rgba(76, 143, 214, 0.15);
- --star-line: rgba(76, 143, 214, 0.5);
+ --glass-rgb: 10, 10, 12; /* near-black neutral base for floating overlays */
+
+ /* — Structure: a dark groove for panel edges, faint light hairlines for
+ internal dividers (structure reads from grooves, not boxes). — */
+ --groove: #060608; /* dark inset between docked panels */
+ --line: rgba(255, 255, 255, 0.085); /* internal hairline */
+ --line-soft: rgba(255, 255, 255, 0.045);
+ --line-strong: rgba(255, 255, 255, 0.14);
+
+ /* — Text: neutral contrast ramp — */
+ --text-hi: #e8e9eb; /* headers / live values */
+ --text: #cbccd0;
+ --text-dim: #9a9ba1;
+ --text-faint: #696a71;
+
+ /* — Accent: one restrained azure. Big fills can drop to --star-deep so
+ primary buttons read pro, not web-bright. Glow is a crisp 1px ring. — */
+ --star: #2f88d6; /* primary: active controls, focus rings, selection tint */
+ --star-hi: #4aa6ec; /* hover / links / selected icon */
+ --star-deep: #20689f; /* pressed / deep fill */
+ --star-dim: rgba(47, 136, 214, 0.18); /* selected-row tint */
+ --star-soft: rgba(47, 136, 214, 0.3); /* stronger tint */
+ --star-line: rgba(47, 136, 214, 0.55); /* focus ring / active border */
--star-glow: 0 0 0 1px var(--star-line);
- --nebula: #8d72d8; /* secondary accent, used sparingly */
+ --on-accent: #f3f7fc; /* text / icon on a filled accent surface */
+ --nebula: #b272d6; /* secondary accent, used sparingly */
+
+ /* — Viewport selection: the iconic orange. Reserved for selected entities. — */
+ --sel: #f0871f;
+ --sel-hi: #ffa040;
+ --sel-soft: rgba(240, 135, 31, 0.16);
+
+ /* — Prefab / asset-ref identity: warm sand, sets instances apart from locals. — */
+ --info-warm: #d4b08e;
+ --info-warm-soft: rgba(212, 176, 142, 0.13);
+ --info-warm-line: rgba(212, 176, 142, 0.22);
+
+ /* — Axes (X red / Y green / Z blue), desaturated but distinguishable. — */
+ --ax-x: #cf5b53;
+ --ax-y: #80b94a;
+ --ax-z: #4a8fd6;
+
+ /* — Category identity: component header bars / icons read by domain. — */
+ --cat-transform: #4a8fd6;
+ --cat-render: #b272d6;
+ --cat-physics: #46b08c;
+ --cat-collision: #e08c43;
+ --cat-audio: #d672a6;
+ --cat-script: #69b86c;
/* — Semantic (muted, flat) — */
- --run: #4cae87; /* play / running */
- --run-glow: 0 0 0 1px rgba(76, 174, 135, 0.45);
- --create: #2c9a55; /* additive/create actions (UE5 "+Add" green), distinct from play */
+ --run: #46a04a; /* play / running (compile-green) */
+ --run-hi: #58bd5c;
+ --run-glow: 0 0 0 1px rgba(70, 160, 74, 0.45);
+ --create: #2c9a55; /* additive "+Add" actions, distinct from play */
--create-hi: #34b163;
- --warn: #e0a049; /* amber / warnings */
- --error: #e06464;
+ --warn: #d3a23c; /* amber / warnings */
+ --error: #d65a5a;
/* — Type — */
--font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
@@ -55,22 +102,63 @@
--fs-xs: 11px;
--fs-sm: 12px;
--fs-md: 13px;
- --fs-lg: 15px;
+ --fs-lg: 14px;
- /* — Geometry: crisper, more square (tool-like, less soft) — */
- --r-xs: 3px;
- --r-sm: 4px;
- --r-md: 6px;
- --r-lg: 8px;
+ /* — Geometry: tight, crisp, more square. — */
+ --r-xs: 2px;
+ --r-sm: 3px;
+ --r-md: 4px;
+ --r-lg: 6px;
--u: 4px; /* spacing unit */
- /* — Chrome heights (tightened a notch for density) — */
- --h-titlebar: 28px;
- --h-toolbar: 36px;
- --h-statusbar: 22px;
+ /* — Chrome heights / dock widths — */
+ --h-titlebar: 30px;
+ --h-toolbar: 42px;
+ --h-statusbar: 24px;
+ --h-tab: 30px;
+ --h-prop: 24px; /* inspector property row */
+ --w-activity: 44px;
+
+ /* — Motion: snappy, restrained, a slight spring on summoned surfaces. — */
+ --e-out: cubic-bezier(0.2, 0, 0, 1);
+ --e-spring: cubic-bezier(0.22, 1.15, 0.36, 1);
+ --t-fast: 100ms;
+ --t: 160ms;
+ --t-slow: 240ms;
/* — Elevation — */
- --shadow-pop: 0 8px 28px -6px rgba(0, 0, 0, 0.55), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
+ --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
+ --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.45);
+ --shadow-3: 0 14px 34px rgba(0, 0, 0, 0.55), 0 3px 8px rgba(0, 0, 0, 0.4);
+ --shadow-pop: var(--shadow-3);
--shadow-panel: 0 1px 0 0 rgba(255, 255, 255, 0.02) inset;
+
+ /* ── Design-CSS compat aliases ────────────────────────────────────────────
+ The panel styles are adopted verbatim from the design's authored stylesheet,
+ which names tokens differently (--acc / --border / --text-mute / --mono …).
+ These aliases resolve that vocabulary onto the canonical set above, so the
+ design CSS drops in unchanged. ──────────────────────────────────────────*/
+ --acc: var(--star);
+ --acc-hi: var(--star-hi);
+ --acc-lo: var(--star-deep);
+ --acc-soft: var(--star-dim);
+ --acc-soft-2: var(--star-soft);
+ --border: var(--groove);
+ --border-soft: var(--line-soft);
+ --border-line: var(--line);
+ --text-mute: var(--text-faint);
+ --play: var(--run);
+ --play-hi: var(--run-hi);
+ --sans: var(--font-ui);
+ --mono: var(--font-mono);
+ --r-pill: 999px;
+ --e-io: cubic-bezier(0.45, 0, 0.15, 1);
+ --scroll: rgba(255, 255, 255, 0.08);
+ --scroll-hi: rgba(255, 255, 255, 0.18);
+ --overlay: rgba(5, 6, 9, 0.55);
+ --h-menubar: var(--h-titlebar);
+ --h-status: var(--h-statusbar);
+ --w-leftdock: 286px;
+ --w-rightdock: 366px;
}
diff --git a/desktop/src/theme/viewport.css b/desktop/src/theme/viewport.css
new file mode 100644
index 000000000..041ebf4c6
--- /dev/null
+++ b/desktop/src/theme/viewport.css
@@ -0,0 +1,108 @@
+/* =============================================================================
+ @file viewport.css
+ @brief Viewport floating overlays — adopted verbatim from the design's authored
+ stylesheet (ue5/shell.css): the frosted tool cluster, the perf HUD, and the
+ coord readout. The engine canvas mount + gizmo/selection live in app.css.
+ ========================================================================== */
+
+.ov { position: absolute; z-index: 4; }
+.ov-cluster {
+ display: flex;
+ align-items: center;
+ gap: 1px;
+ padding: 3px;
+ background: rgba(18, 18, 21, 0.72);
+ -webkit-backdrop-filter: blur(16px) saturate(1.1);
+ backdrop-filter: blur(16px) saturate(1.1);
+ border: 1px solid var(--border-line);
+ border-radius: var(--r-lg);
+ box-shadow: var(--shadow-2);
+}
+.ov-tl { top: 10px; left: 10px; }
+.ov-tr { top: 10px; right: 10px; }
+.ovbtn {
+ height: 26px;
+ padding: 0 8px;
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--text-dim);
+ font-size: var(--fs-xs);
+ font-weight: 500;
+ border-radius: var(--r-md);
+ transition: color var(--t-fast), background var(--t-fast);
+}
+.ovbtn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
+.ovbtn.open { color: var(--text); background: rgba(255, 255, 255, 0.1); }
+.ovbtn .ic { color: var(--text-mute); }
+.ovbtn.open .ic, .ovbtn:hover .ic { color: var(--text-dim); }
+.ovbtn .val { font-family: var(--mono); color: var(--text); }
+.ovbtn .cv { opacity: 0.5; transition: transform var(--t-fast); }
+.ovbtn.open .cv { transform: rotate(180deg); }
+.ov-tool { width: 30px; height: 30px; padding: 0; justify-content: center; position: relative; }
+.ov-tool.active { color: #fff; background: var(--acc); }
+.ov-tool kbd {
+ position: absolute;
+ bottom: -2px;
+ right: -2px;
+ font-size: 8px;
+ color: var(--text-mute);
+ background: var(--srf-3);
+ border: 1px solid var(--border-line);
+ border-radius: 2px;
+ padding: 0 2px;
+ opacity: 0;
+ transition: opacity var(--t-fast);
+}
+.ov-tool:hover kbd { opacity: 1; }
+.ov-divider { width: 1px; height: 16px; background: var(--border-line); margin: 0 3px; }
+
+/* perf widget (bottom-right) */
+.vp-perf {
+ position: absolute;
+ bottom: 10px;
+ right: 10px;
+ z-index: 4;
+ min-width: 128px;
+ padding: 7px 9px;
+ background: rgba(18, 18, 21, 0.72);
+ -webkit-backdrop-filter: blur(14px);
+ backdrop-filter: blur(14px);
+ border: 1px solid var(--border-line);
+ border-radius: var(--r-lg);
+ box-shadow: var(--shadow-2);
+ font-family: var(--mono);
+ font-size: var(--fs-xs);
+ pointer-events: none;
+}
+.vp-perf .pr { display: flex; justify-content: space-between; line-height: 1.7; }
+.vp-perf .pr .k { color: var(--text-mute); }
+.vp-perf .pr .v { color: var(--text); }
+.vp-perf .pr.h .v { color: var(--text); font-size: var(--fs-md); }
+.vp-perf .ps { height: 1px; background: var(--border-line); margin: 5px -9px; }
+
+/* coord readout (bottom-left) */
+.vp-coord {
+ position: absolute;
+ bottom: 10px;
+ left: 10px;
+ z-index: 4;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ font-family: var(--mono);
+ font-size: var(--fs-xs);
+ color: var(--text-dim);
+ pointer-events: none;
+}
+.vp-coord .ro {
+ background: rgba(18, 18, 21, 0.72);
+ -webkit-backdrop-filter: blur(14px);
+ backdrop-filter: blur(14px);
+ border: 1px solid var(--border-line);
+ border-radius: var(--r-sm);
+ padding: 3px 8px;
+ width: max-content;
+}
+.vp-coord .ro strong { color: var(--text); }
+.vp-coord .hint { color: var(--text-mute); font-family: var(--sans); padding-left: 2px; }
diff --git a/desktop/tests/project-fs.test.ts b/desktop/tests/project-fs.test.ts
new file mode 100644
index 000000000..8a49bad70
--- /dev/null
+++ b/desktop/tests/project-fs.test.ts
@@ -0,0 +1,116 @@
+/**
+ * @file Project filesystem mutations (Content Browser asset ops). Covers the
+ * non-obvious correctness: rename carries the `.meta` sidecar (asset
+ * identity is stable), duplicate assigns a FRESH uuid (two assets can't
+ * share one in the registry), and the root sandbox refuses escapes.
+ */
+import { describe, it, expect, beforeEach, afterEach } from 'vitest';
+import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, existsSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import path from 'node:path';
+import {
+ resolveInRoot,
+ renameInRoot,
+ mkdirInRoot,
+ duplicateInRoot,
+ statInRoot,
+} from '../electron/projectFs';
+import { isIgnoredPath } from '../electron/projectWatcher';
+
+let root: string;
+const read = (rel: string) => readFileSync(path.join(root, rel), 'utf8');
+const meta = (uuid: string, type = 'texture') =>
+ JSON.stringify({ uuid, version: '2.0', type, importer: {} }, null, 2) + '\n';
+
+beforeEach(() => {
+ root = mkdtempSync(path.join(tmpdir(), 'estella-fs-'));
+ mkdirSync(path.join(root, 'assets'), { recursive: true });
+ writeFileSync(path.join(root, 'assets', 'hero.png'), 'PNG');
+ writeFileSync(path.join(root, 'assets', 'hero.png.meta'), meta('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'));
+});
+
+afterEach(() => rmSync(root, { recursive: true, force: true }));
+
+describe('isIgnoredPath (watcher noise filter)', () => {
+ it('ignores the editor cache + heavy dirs (no refresh loop)', () => {
+ // `.esengine` is where we write assets.json — refreshing on it would loop.
+ expect(isIgnoredPath('.esengine/cache/assets.json')).toBe(true);
+ expect(isIgnoredPath('node_modules/foo/index.js')).toBe(true);
+ expect(isIgnoredPath('.git/HEAD')).toBe(true);
+ expect(isIgnoredPath('build/out.png')).toBe(true);
+ });
+ it('does not ignore real assets', () => {
+ expect(isIgnoredPath('assets/hero.png')).toBe(false);
+ expect(isIgnoredPath('scenes/main.esscene')).toBe(false);
+ // a file merely starting with an ignored name (not a dir boundary) is fine
+ expect(isIgnoredPath('distortion.png')).toBe(false);
+ });
+});
+
+describe('resolveInRoot', () => {
+ it('refuses paths that escape the root', () => {
+ expect(() => resolveInRoot(root, '../secret')).toThrow(/escapes/);
+ expect(() => resolveInRoot(root, '/etc/passwd')).toThrow(/escapes/);
+ });
+});
+
+describe('renameInRoot', () => {
+ it('moves the file and its .meta sidecar together (uuid preserved)', async () => {
+ await renameInRoot(root, 'assets/hero.png', 'assets/villain.png');
+ expect(existsSync(path.join(root, 'assets', 'hero.png'))).toBe(false);
+ expect(existsSync(path.join(root, 'assets', 'hero.png.meta'))).toBe(false);
+ expect(read('assets/villain.png')).toBe('PNG');
+ expect(JSON.parse(read('assets/villain.png.meta')).uuid).toBe('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
+ });
+
+ it('refuses to clobber an existing destination', async () => {
+ writeFileSync(path.join(root, 'assets', 'taken.png'), 'X');
+ await expect(renameInRoot(root, 'assets/hero.png', 'assets/taken.png')).rejects.toThrow(/already exists/);
+ });
+});
+
+describe('mkdirInRoot', () => {
+ it('creates a folder and refuses if it already exists', async () => {
+ await mkdirInRoot(root, 'assets/sprites');
+ expect(existsSync(path.join(root, 'assets', 'sprites'))).toBe(true);
+ await expect(mkdirInRoot(root, 'assets/sprites')).rejects.toThrow(/already exists/);
+ });
+});
+
+describe('statInRoot', () => {
+ it('reports size + isDir for files and folders', async () => {
+ const file = await statInRoot(root, 'assets/hero.png');
+ expect(file.isDir).toBe(false);
+ expect(file.size).toBe(3); // "PNG"
+ expect(typeof file.mtimeMs).toBe('number');
+ const dir = await statInRoot(root, 'assets');
+ expect(dir.isDir).toBe(true);
+ });
+});
+
+describe('duplicateInRoot', () => {
+ it('copies a file to "… copy" and assigns the sidecar a fresh uuid', async () => {
+ const rel = await duplicateInRoot(root, 'assets/hero.png');
+ expect(rel).toBe('assets/hero copy.png');
+ expect(read('assets/hero copy.png')).toBe('PNG');
+ const dupUuid = JSON.parse(read('assets/hero copy.png.meta')).uuid;
+ expect(dupUuid).not.toBe('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
+ expect(dupUuid).toMatch(/^[0-9a-f-]{36}$/);
+ });
+
+ it('increments the suffix when a copy already exists', async () => {
+ await duplicateInRoot(root, 'assets/hero.png');
+ const rel2 = await duplicateInRoot(root, 'assets/hero.png');
+ expect(rel2).toBe('assets/hero copy 2.png');
+ });
+
+ it('recurses into a folder and regenerates every nested uuid', async () => {
+ mkdirSync(path.join(root, 'assets', 'pack'));
+ writeFileSync(path.join(root, 'assets', 'pack', 'a.png'), 'A');
+ writeFileSync(path.join(root, 'assets', 'pack', 'a.png.meta'), meta('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'));
+ const rel = await duplicateInRoot(root, 'assets/pack');
+ expect(rel).toBe('assets/pack copy');
+ expect(read('assets/pack copy/a.png')).toBe('A');
+ expect(JSON.parse(read('assets/pack copy/a.png.meta')).uuid).not.toBe('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb');
+ });
+});