Free Motion Capture for Everyone 💀✨
TypeScript
start bringing in skellycam-ui update
jonmatthis7f1401db4abb
diff --git a/freemocap-ui/.gitignore b/freemocap-ui/.gitignoreindex 44980415..5beaf797 100644--- a/freemocap-ui/.gitignore+++ b/freemocap-ui/.gitignore@@ -25,13 +25,10 @@ release*.sw?#lockfile-package-lock.json-pnpm-lock.yaml-yarn.lock/test-results//playwright-report//playwright/.cache/*.exepyapp-*-*.zip\ No newline at end of file+*.zipdiff --git a/freemocap-ui/.npmrc b/freemocap-ui/.npmrcindex 45c8cd74..55ec5192 100644--- a/freemocap-ui/.npmrc+++ b/freemocap-ui/.npmrc@@ -1,6 +1,5 @@# For electron-builder# https://github.com/electron-userland/electron-builder/issues/6289#issuecomment-1042620422-shamefully-hoist=true# For China 🇨🇳 developers# electron_mirror=https://npmmirror.com/mirrors/electron/diff --git a/freemocap-ui/.vite/deps_temp_11f3a1c5/package.json b/freemocap-ui/.vite/deps_temp_11f3a1c5/package.jsondeleted file mode 100644index 3dbc1ca5..00000000--- a/freemocap-ui/.vite/deps_temp_11f3a1c5/package.json+++ /dev/null@@ -1,3 +0,0 @@-{- "type": "module"-}diff --git a/freemocap-ui/README.md b/freemocap-ui/README.mdindex 8386c138..42c904ab 100644--- a/freemocap-ui/README.md+++ b/freemocap-ui/README.md@@ -1,93 +1,162 @@-# electron-vite-react+# FreeMoCap UI-[](https://github.com/vitejs/awesome-vite)----[](https://nodejs.org/about/releases)+React/Electron desktop interface for FreeMoCap — live multi-camera streaming, recording, and synchronized playback.-English | [简体中文](README.zh-CN.md)+Built with **React 19**, **TypeScript**, **Material UI**, **Redux Toolkit**, and packaged as an **Electron** desktop app via [electron-vite](https://github.com/electron-vite/electron-vite-react).-## 👀 Overview+----📦 Ready out of the box-🎯 Based on the-official [template-react-ts](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts), project-structure will be familiar to you-🌱 Easily extendable and customizable-💪 Supports Node.js API in the renderer process-🔩 Supports C/C++ native addons-🐞 Debugger configuration included-🖥 Easy to implement multiple windows+## Quick Start-## 🛫 Quick Setup+```bash+npm install+npm run dev # Vite dev server + Electron+```++The UI expects the FreeMoCap Python server running on `localhost:53117` (default). Start the server first:-```sh-# clone the project-git clone https://github.com/electron-vite/electron-vite-react.git+```bash+# From the repo root+python -m freemocap+```-# enter the project directory-cd electron-vite-react+----# install dependency-npm install+## Pages-# develop-npm run dev-```+### Cameras (`/cameras`)++Live multi-camera view with real-time WebSocket streaming. Configure camera resolution, framerate, exposure, and rotation. Start/stop recordings from here.++### Playback (`/playback`)++Browse and play back recorded sessions with frame-perfect multi-camera synchronization.++**Recording Browser** — lists all recordings from `~/freemocap_data/recordings/`, sorted newest-first. Each entry shows:++- Number of camera streams+- Total recording size on disk+- Recording duration and frame count (read from timestamp CSVs)+- Effective FPS+- Relative time ("2h ago", "3d ago")++You can also type or paste a custom folder path to load any recording.-## 🐞 Debug+**Synced Video Player** — opens all camera streams in a responsive grid. Key features:-+- **Frame-locked synchronization** — every camera displays the exact same frame number at all times, driven by a single authoritative counter+- **Per-camera overlays** — frame number (top-right, green), camera ID (bottom-left), SMPTE timecode (bottom-right)+- **Smooth native playback** — uses `HTMLVideoElement.play()` for hardware-decoded rendering, with a rAF drift-correction loop for sync+- **Frame stepping** — ←/→ keys step 1 frame, Shift+←/→ step 10 frames+- **Variable speed** — 0.1× through 8× with frame-lock maintained at all rates+- **Keyboard shortcuts** — Space (play/pause), Home/End (jump to start/end)-## 📂 Directory structure+----Familiar React application structure, just with `electron` folder on the top :wink:-*Files in this folder will be separated from your React application and built into `dist-electron`*+## Project Structure-```tree-├── electron Electron-related code-│ ├── main Main-process source code-│ └── preload Preload-scripts source code+```+src/+├── pages/+│ ├── CamerasPage.tsx # Live camera view+│ ├── PlaybackPage.tsx # Recording browser → synced player+│ └── WelcomePage.tsx # Landing / home+│+├── components/+│ ├── playback/+│ │ ├── SyncedVideoPlayer.tsx # Core frame-locked multi-video player+│ │ ├── PlaybackControls.tsx # Transport bar (play, seek, step, speed)+│ │ ├── RecordingBrowser.tsx # Recording list with metadata + manual path+│ │ └── index.ts # Barrel exports+│ │+│ ├── camera-views/ # CameraView, CameraViewsGrid+│ ├── camera-config-panel/ # Resolution, framerate, exposure controls+│ ├── camera-config-tree-view/ # Sidebar camera tree+│ ├── camera-view-settings-overlay/ # Image scale slider+│ ├── framerate-viewer/ # Real-time FPS D3 charts+│ ├── recording-info-panel/ # Recording path, start/stop, settings+│ ├── video-folder-panel/ # Legacy folder picker (Electron IPC)+│ ├── ui-components/ # Header, Footer, LeftPanel, ThemeToggle+│ └── common/ # ErrorBoundary+│+├── services/+│ ├── server/+│ │ ├── ServerContextProvider.tsx # WebSocket lifecycle+│ │ └── server-helpers/+│ │ ├── server-urls.ts # API endpoint URLs+│ │ ├── websocket-connection.ts # WebSocket manager+│ │ ├── canvas-manager.ts # Canvas rendering+│ │ └── frame-processor/ # Binary frame parsing+│ └── electron-ipc/ # Electron main ↔ renderer IPC│-├── release Generated after production build, contains executables-│ └── {version}-│ ├── {os}-{os_arch} Contains unpacked application executable-│ └── {app_name}_{version}.{ext} Installer for the application+├── store/+│ ├── store.ts # Redux store configuration+│ ├── hooks.ts # useAppDispatch, useAppSelector+│ └── slices/+│ ├── cameras/ # Camera state, detection, config+│ ├── recording/ # Recording state, start/stop thunks+│ ├── videos/ # Video file state, folder selection+│ ├── framerate/ # FPS tracking data+│ ├── log-records/ # Server log entries+│ └── theme/ # Light/dark mode│-├── public Static assets-└── src Renderer source code, your React application+└── layout/+ ├── AppContent.tsx # Top-level app wrapper+ ├── BaseContentRouter.tsx # React Router routes+ └── BasePanelLayout.tsx # Resizable panel layout (react-resizable-panels)```-<!---## 🚨 Be aware+----This template integrates Node.js API to the renderer process by default. If you want to follow **Electron Security Concerns** you might want to disable this feature. You will have to expose needed API by yourself.+## Key Dependencies-To get started, remove the option as shown below. This will [modify the Vite configuration and disable this feature](https://github.com/electron-vite/vite-plugin-electron-renderer#config-presets-opinionated).+| Package | Purpose |+|---------|---------|+| `react` / `react-dom` | UI framework |+| `@mui/material` | Component library |+| `@reduxjs/toolkit` / `react-redux` | State management |+| `react-router-dom` | Client-side routing |+| `react-resizable-panels` | Draggable panel layout |+| `d3` | Framerate charts |+| `electron` | Desktop packaging |+| `vite` | Build tool and dev server |-```diff-# vite.config.ts+----export default {- plugins: [- ...-- // Use Node.js API in the Renderer-process-- renderer({-- nodeIntegration: true,-- }),- ...- ],-}+## Build++```bash+npm run build # Production build (renderer + electron)+npm run build:unpack # Build unpacked app for testing```--->-## 🔧 Additional features+See `electron-builder.json` for packaging configuration.++---++## Server Communication++The UI talks to the Python server over two channels:++**HTTP REST** — camera control, recording management, and playback. Base URL defaults to `http://localhost:53117`. Key playback endpoints:++- `GET /freemocap/playback/recordings` — list all recordings with metadata (size, frames, duration, fps)+- `POST /freemocap/playback/load` — load a recording folder+- `GET /freemocap/playback/video/{video_id}` — stream a video file (supports HTTP range requests for seeking)+- `GET /freemocap/playback/timestamps/{video_id}` — get timestamp CSV info++**WebSocket** — real-time binary frame streaming at `ws://localhost:53117/freemocap/websocket/connect`. Delivers synchronized multi-frame payloads (one JPEG per camera per frame event) plus JSON log messages.++---++## Playback Sync Architecture-1. electron-updater 👉 [see docs](src/components/update/README.md)-1. playwright+The `SyncedVideoPlayer` component guarantees frame-perfect synchronization across all camera views:-## ❔ FAQ+1. **Native playback** — all `<video>` elements use `.play()` for smooth hardware decoding+2. **Authoritative counter** — a `requestAnimationFrame` loop computes the current frame from `wall-clock elapsed × fps × playbackRate`+3. **Drift correction** — every ~3 ticks, each video's `.currentTime` is compared against the target; videos drifting >0.5 frames are force-seeked back+4. **Single source of truth** — the frame number overlay on every camera comes from the authoritative counter, never from individual video elements+5. **Pause/step** — sets `.currentTime` directly on all elements (no `.play()` involved)-- [C/C++ addons, Node.js modules - Pre-Bundling](https://github.com/electron-vite/vite-plugin-electron-renderer#dependency-pre-bundling)-- [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron-renderer#dependencies-vs-devdependencies)+This hybrid approach delivers smooth rendering while maintaining the hard sync guarantee.diff --git a/freemocap-ui/electron-builder.json b/freemocap-ui/electron-builder.jsonindex af64df5d..bef24ea3 100644--- a/freemocap-ui/electron-builder.json+++ b/freemocap-ui/electron-builder.json@@ -1,48 +1,106 @@{"appId": "freemocap.app",+ "productName": "freemocap","directories": {"output": "release/${version}"},"files": ["dist-electron","dist",- "freemocap_server.exe",+ "freemocap_server*","../shared/freemocap-logo/freemocap-favicon.ico","../shared/freemocap-logo/freemocap-logo.png"],- "icon": "../shared/freemocap-logo/freemocap-favicon.ico","asar": true,"asarUnpack": [- "**/freemocap_server.exe",+ "**/freemocap_server*","**/freemocap-logo.png"],- "mac": {- "artifactName": "${productName}_${version}_installer.${ext}",- "target": [- "dmg",- "zip"- ]- },+ "compression": "maximum",+"win": {+ "icon": "../shared/freemocap-logo/freemocap-favicon.ico","target": [{"target": "nsis",- "arch": [- "x64"- ]+ "arch": ["x64"]}],- "artifactName": "${productName}_${version}_installer.${ext}"+ "artifactName": "${productName}_${version}_${arch}_installer.${ext}"},"nsis": {"oneClick": false,"perMachine": false,"allowToChangeInstallationDirectory": true,- "deleteAppDataOnUninstall": false+ "deleteAppDataOnUninstall": false,+ "language": "1033"+ },++ "mac": {+ "icon": "../shared/freemocap-logo/freemocap-logo.png",+ "category": "public.app-category.video",+ "target": [+ {+ "target": "dmg",+ "arch": ["x64", "arm64"]+ },+ {+ "target": "zip",+ "arch": ["x64", "arm64"]+ }+ ],+ "artifactName": "${productName}_${version}_${arch}_installer.${ext}",+ "hardenedRuntime": true,+ "notarize": true,+ "extendInfo": {+ "NSCameraUsageDescription": "FreeMoCap needs camera access to capture video for motion capture recording.",+ "NSMicrophoneUsageDescription": "FreeMoCap needs microphone access to record audio alongside video.",+ "NSCameraUseContinuityCameraDeviceType": true+ }+ },+ "dmg": {+ "contents": [+ { "x": 130, "y": 220 },+ { "x": 410, "y": 220, "type": "link", "path": "/Applications" }+ ]+ },++ "linux": {+ "icon": "../shared/freemocap-logo/freemocap-logo.png",+ "category": "Video",+ "target": [+ {+ "target": "AppImage",+ "arch": ["x64", "arm64"]+ },+ {+ "target": "deb",+ "arch": ["x64", "arm64"]+ }+ ],+ "artifactName": "${productName}_${version}_${arch}.${ext}",+ "desktop": {+ "entry": {+ "Name": "FreeMoCap",+ "Comment": "Camera backend for FreeMoCap",+ "Categories": "Video;AudioVideo;"+ }+ }+ },+ "deb": {+ "depends": [+ "libgl1-mesa-glx",+ "libglib2.0-0",+ "libsm6",+ "libxext6",+ "libxrender1",+ "libv4l-0"+ ]},+"publish": {- "provider": "generic",- "channel": "latest",- "url": "https://github.com/freemocap/freemocap"+ "provider": "github",+ "owner": "freemocap",+ "repo": "freemocap"}}diff --git a/freemocap-ui/electron/main/api.ts b/freemocap-ui/electron/main/api.tsindex dfcd9030..edca8f6e 100644--- a/freemocap-ui/electron/main/api.ts+++ b/freemocap-ui/electron/main/api.ts@@ -196,11 +196,12 @@ export const api = t.router({let logoPath: string | null = null;// Check for logo in order of preference- if (fs.existsSync(APP_PATHS.SKELLYCAM_LOGO_PNG_SHARED_PATH)) {- logoPath = APP_PATHS.SKELLYCAM_LOGO_PNG_SHARED_PATH;- } else if (fs.existsSync(APP_PATHS.SKELLYCAM_LOGO_PNG_RESOURCES_PATH)) {- logoPath = APP_PATHS.SKELLYCAM_LOGO_PNG_RESOURCES_PATH;- }+ if (fs.existsSync(APP_PATHS.FREEMOCAP_LOGO_PNG_SHARED_PATH)) {+ logoPath = APP_PATHS.FREEMOCAP_LOGO_PNG_SHARED_PATH;+ } else if (fs.existsSync(APP_PATHS.FREEMOCAP_LOGO_PNG_RESOURCES_PATH)) {+ logoPath = APP_PATHS.FREEMOCAP_LOGO_PNG_RESOURCES_PATH;+ }+if (!logoPath) {console.error('Logo file not found in any expected location');@@ -222,10 +223,10 @@ export const api = t.router({getLogoPngPath: t.procedure.query(() => {- if (fs.existsSync(APP_PATHS.SKELLYCAM_LOGO_PNG_SHARED_PATH)) {- return APP_PATHS.SKELLYCAM_LOGO_PNG_SHARED_PATH;+ if (fs.existsSync(APP_PATHS.FREEMOCAP_LOGO_PNG_SHARED_PATH)) {+ return APP_PATHS.FREEMOCAP_LOGO_PNG_SHARED_PATH;}- return APP_PATHS.SKELLYCAM_LOGO_PNG_RESOURCES_PATH;+ return APP_PATHS.FREEMOCAP_LOGO_PNG_RESOURCES_PATH;}),}),});diff --git a/freemocap-ui/electron/main/app-paths.ts b/freemocap-ui/electron/main/app-paths.tsindex c06a7b04..2cf1fec9 100644--- a/freemocap-ui/electron/main/app-paths.ts+++ b/freemocap-ui/electron/main/app-paths.ts@@ -75,8 +75,8 @@ export const APP_PATHS = {__dirname,"../../../shared/freemocap-logo/freemocap-favicon.ico"),- SKELLYCAM_LOGO_PNG_RESOURCES_PATH: path.join(getResourcesPath(), 'dist/freemocap-logo.png'),- SKELLYCAM_LOGO_PNG_SHARED_PATH:path.resolve(+ FREEMOCAP_LOGO_PNG_RESOURCES_PATH: path.join(getResourcesPath(), 'dist/freemocap-logo.png'),+ FREEMOCAP_LOGO_PNG_SHARED_PATH:path.resolve(__dirname,"../../../shared/freemocap-logo/freemocap-logo.png"),diff --git a/freemocap-ui/electron/main/services/menu-builder.ts b/freemocap-ui/electron/main/services/menu-builder.tsindex 97745687..2e4aefc2 100644--- a/freemocap-ui/electron/main/services/menu-builder.ts+++ b/freemocap-ui/electron/main/services/menu-builder.ts@@ -80,7 +80,7 @@ const DEFAULT_LABELS: MenuLabels = {menuDocumentation: 'Documentation',menuGitHubRepository: 'GitHub Repository',menuReportIssue: 'Report an Issue…',- menuAbout: 'About SkellyCam',+ menuAbout: 'About FreeMoCap',menuCheckForUpdates: 'Check for Updates…',menuPlayback: 'Playback',home: 'Home',diff --git a/freemocap-ui/package.json b/freemocap-ui/package.jsonindex 583e221b..ea58db68 100644--- a/freemocap-ui/package.json+++ b/freemocap-ui/package.json@@ -1,11 +1,11 @@{"name": "freemocap",- "version": "2.0.0",+ "version": "2.0.0-alpha.1","main": "dist-electron/main/index.js",- "description": "FreeMocap - Free open source markerless motion capture for everyone.",- "homepage": "https://freemocap.org",+ "description": "FreeMoCap - Free Open Source Markerless Motion Capture For Everyone","author": "Skelly FreeMocap <[email protected]>","license": "AGPL-3.0-or-later",+ "homepage": "https://github.com/freemocap/freemocap","debug": {"env": {"VITE_DEV_SERVER_URL": "http://127.0.0.1:7777/"@@ -14,68 +14,47 @@"type": "module","scripts": {"dev": "cross-env NODE_ENV=development vite",- "demo": "cross-env NODE_ENV=production vite build && electron .",- "build": "cross-env NODE_ENV=production && tsc && vite build && electron-builder",+ "build": "tsc && vite build && electron-builder","preview": "vite preview",- "test": "vitest run",- "test:watch": "vitest","pree2e": "vite build --mode=test","e2e": "playwright test"},"dependencies": {- "@dnd-kit/core": "^6.3.1",- "@dnd-kit/modifiers": "^9.0.0",- "@dnd-kit/sortable": "^10.0.0",- "@dnd-kit/utilities": "^3.2.2","@emotion/react": "^11.13.3","@emotion/styled": "^11.13.0",- "@ffmpeg/ffmpeg": "^0.12.10",- "@ffmpeg/util": "^0.12.1","@fontsource/roboto": "^5.1.0",- "@monaco-editor/react": "^4.6.0",- "@msgpack/msgpack": "^3.0.0-beta2","@mui/icons-material": "^6.4.5","@mui/material": "^6.1.1","@mui/x-tree-view": "^7.29.1",- "@react-three/drei": "^10.4.2",- "@react-three/fiber": "^9.1.4","@reduxjs/toolkit": "^2.5.1","@trpc/client": "^11.5.1","@trpc/server": "^11.5.1",- "axios": "^1.7.7","country-flag-icons": "^1.6.14","d3": "^7.9.0","electron-updater": "^6.1.8","i18next-browser-languagedetector": "^8.2.1",- "exploration": "^1.6.0",- "js-yaml": "^4.1.0",- "react-i18next": "^16.5.4","react-grid-layout": "^2.2.2",+ "react-i18next": "^16.5.4","react-redux": "^9.1.2","react-resizable-panels": "^2.1.7",- "react-router": "^6.26.2","react-router-dom": "^6.26.2",- "react-use": "^17.5.1",- "smol-toml": "^1.3.1","superjson": "^2.2.2",- "three": "^0.178.0","tree-kill": "^1.2.2","zod": "^4.1.5"},"devDependencies": {"@playwright/test": "^1.42.1","@types/d3": "^7.4.3",- "@types/js-yaml": "^4.0.9","@types/react": "^19.2.14","@types/react-dom": "^19.2.3","@vitejs/plugin-react": "^4.3.3","cross-env": "^7.0.3","electron": "^35.0.3","electron-builder": "^26.8.1",+ "electron-devtools-installer": "^4.0.0","react": "^19.1.0","react-dom": "^19.1.0","vite": "^7.3.1",- "vitest": "^3.2.1","vite-plugin-electron": "^0.28.8","vite-plugin-electron-renderer": "^0.14.5"}diff --git a/freemocap-ui/src/__tests__/calibration-slice.test.ts b/freemocap-ui/src/__tests__/calibration-slice.test.tsdeleted file mode 100644index 03141e76..00000000--- a/freemocap-ui/src/__tests__/calibration-slice.test.ts+++ /dev/null@@ -1,287 +0,0 @@-import { describe, it, expect } from 'vitest';-import {- calibrationSlice,- calibrationConfigUpdated,- calibrationProgressUpdated,- calibrationErrorCleared,- manualCalibrationRecordingPathChanged,- manualCalibrationRecordingPathCleared,- calibrationDirectoryInfoUpdated,- resetCalibrationState,- CalibrationConfig,- CalibrationState,- CalibrationDirectoryInfo,-} from '@/store/slices/calibration/calibration-slice';--const reducer = calibrationSlice.reducer;--// ----------------------------------------------------------------------------// Helpers-// -----------------------------------------------------------------------------function getInitialState(): CalibrationState {- return reducer(undefined, { type: 'unknown' });-}--// ----------------------------------------------------------------------------// Initial state-// -----------------------------------------------------------------------------describe('calibrationSlice initial state', () => {- it('has correct default config values matching backend defaults', () => {- const state = getInitialState();- // These MUST match CalibrationPipelineConfig defaults on the backend- expect(state.config.charucoBoardXSquares).toBe(5);- expect(state.config.charucoBoardYSquares).toBe(3);- expect(state.config.charucoSquareLength).toBe(1);- expect(state.config.solverMethod).toBe('anipose');- expect(state.config.useGroundplane).toBe(false);- });-- it('starts not recording', () => {- const state = getInitialState();- expect(state.isRecording).toBe(false);- expect(state.recordingProgress).toBe(0);- });-- it('starts with no error', () => {- const state = getInitialState();- expect(state.error).toBeNull();- });-- it('starts with no loading', () => {- const state = getInitialState();- expect(state.isLoading).toBe(false);- });-});--// ----------------------------------------------------------------------------// calibrationConfigUpdated-// -----------------------------------------------------------------------------describe('calibrationConfigUpdated', () => {- it('merges partial config update', () => {- const state = getInitialState();- const updated = reducer(state, calibrationConfigUpdated({- charucoBoardXSquares: 7,- }));- expect(updated.config.charucoBoardXSquares).toBe(7);- // Other fields should be preserved- expect(updated.config.charucoBoardYSquares).toBe(3);- expect(updated.config.charucoSquareLength).toBe(1);- expect(updated.config.solverMethod).toBe('anipose');- });-- it('can update solver method', () => {- const state = getInitialState();- const updated = reducer(state, calibrationConfigUpdated({- solverMethod: 'pyceres',- }));- expect(updated.config.solverMethod).toBe('pyceres');- });-- it('can update useGroundplane', () => {- const state = getInitialState();- const updated = reducer(state, calibrationConfigUpdated({- useGroundplane: true,- }));- expect(updated.config.useGroundplane).toBe(true);- });-- it('can update multiple fields at once', () => {- const state = getInitialState();- const updated = reducer(state, calibrationConfigUpdated({- charucoBoardXSquares: 9,- charucoBoardYSquares: 7,- charucoSquareLength: 39.5,- }));- expect(updated.config.charucoBoardXSquares).toBe(9);- expect(updated.config.charucoBoardYSquares).toBe(7);- expect(updated.config.charucoSquareLength).toBe(39.5);- });-});--// ----------------------------------------------------------------------------// Progress and error-// -----------------------------------------------------------------------------describe('calibrationProgressUpdated', () => {- it('sets recording progress', () => {- const state = getInitialState();- const updated = reducer(state, calibrationProgressUpdated(42.5));- expect(updated.recordingProgress).toBe(42.5);- });-});--describe('calibrationErrorCleared', () => {- it('clears error', () => {- const state: CalibrationState = {- ...getInitialState(),- error: 'something went wrong',- };- const updated = reducer(state, calibrationErrorCleared());- expect(updated.error).toBeNull();- });-});--// ----------------------------------------------------------------------------// Manual recording path-// -----------------------------------------------------------------------------describe('manual recording path', () => {- it('sets manual path', () => {- const state = getInitialState();- const updated = reducer(state, manualCalibrationRecordingPathChanged('/custom/path'));- expect(updated.manualCalibrationRecordingPath).toBe('/custom/path');- });-- it('clears manual path', () => {- const state: CalibrationState = {- ...getInitialState(),- manualCalibrationRecordingPath: '/custom/path',- };- const updated = reducer(state, manualCalibrationRecordingPathCleared());- expect(updated.manualCalibrationRecordingPath).toBeNull();- });-});--// ----------------------------------------------------------------------------// Directory info-// -----------------------------------------------------------------------------describe('calibrationDirectoryInfoUpdated', () => {- it('stores directory info', () => {- const state = getInitialState();- const info: CalibrationDirectoryInfo = {- exists: true,- canRecord: true,- canCalibrate: true,- cameraCalibrationTomlPath: '/tmp/cal/calibration.toml',- hasSynchronizedVideos: true,- hasVideos: true,- errorMessage: null,- };- const updated = reducer(state, calibrationDirectoryInfoUpdated(info));- expect(updated.directoryInfo).toEqual(info);- });-});--// ----------------------------------------------------------------------------// Reset-// -----------------------------------------------------------------------------describe('resetCalibrationState', () => {- it('resets everything to initial state', () => {- const modified: CalibrationState = {- config: {- liveTrackCharuco: false,- charucoBoardXSquares: 9,- charucoBoardYSquares: 7,- charucoSquareLength: 40,- minSharedViewsPerCamera: 300,- autoStopOnMinViewCount: false,- solverMethod: 'pyceres',- useGroundplane: true,- },- isRecording: true,- recordingProgress: 50,- isLoading: true,- error: 'some error',- lastCalibrationRecordingPath: '/some/path',- manualCalibrationRecordingPath: '/manual/path',- directoryInfo: null,- };- const reset = reducer(modified, resetCalibrationState());- const fresh = getInitialState();- expect(reset).toEqual(fresh);- });-});--// ----------------------------------------------------------------------------// Async thunk reducers (pending/fulfilled/rejected)-// -----------------------------------------------------------------------------describe('startCalibrationRecording thunk reducers', () => {- it('pending sets isLoading and clears error', () => {- const state: CalibrationState = {- ...getInitialState(),- error: 'old error',- };- const updated = reducer(state, {- type: 'calibration/startRecording/pending',- });- expect(updated.isLoading).toBe(true);- expect(updated.error).toBeNull();- });-- it('fulfilled sets isRecording and resets progress', () => {- const state: CalibrationState = {- ...getInitialState(),- isLoading: true,- };- const updated = reducer(state, {- type: 'calibration/startRecording/fulfilled',- payload: { success: true },- });- expect(updated.isLoading).toBe(false);- expect(updated.isRecording).toBe(true);- expect(updated.recordingProgress).toBe(0);- });-- it('fulfilled stores calibrationRecordingPath if provided', () => {- const state: CalibrationState = {- ...getInitialState(),- isLoading: true,- };- const updated = reducer(state, {- type: 'calibration/startRecording/fulfilled',- payload: {- success: true,- calibrationRecordingPath: '/new/recording/path',- },- });- expect(updated.lastCalibrationRecordingPath).toBe('/new/recording/path');- });-- it('rejected sets error', () => {- const state: CalibrationState = {- ...getInitialState(),- isLoading: true,- };- const updated = reducer(state, {- type: 'calibration/startRecording/rejected',- payload: 'Connection refused',- });- expect(updated.isLoading).toBe(false);- expect(updated.error).toBe('Connection refused');- });-});--describe('stopCalibrationRecording thunk reducers', () => {- it('fulfilled stops recording', () => {- const state: CalibrationState = {- ...getInitialState(),- isRecording: true,- isLoading: true,- recordingProgress: 80,- };- const updated = reducer(state, {- type: 'calibration/stopRecording/fulfilled',- payload: { success: true },- });- expect(updated.isLoading).toBe(false);- expect(updated.isRecording).toBe(false);- expect(updated.recordingProgress).toBe(0);- });-});--describe('updateCalibrationConfigOnServer thunk reducers', () => {- it('rejected sets error', () => {- const state = getInitialState();- const updated = reducer(state, {- type: 'calibration/updateConfig/rejected',- payload: 'Server error',- });- expect(updated.error).toBe('Server error');- });-});diff --git a/freemocap-ui/src/__tests__/message-type-guards.test.ts b/freemocap-ui/src/__tests__/message-type-guards.test.tsdeleted file mode 100644index 2ce2c58e..00000000--- a/freemocap-ui/src/__tests__/message-type-guards.test.ts+++ /dev/null@@ -1,197 +0,0 @@-import { describe, it, expect } from 'vitest';-import {- isSettingsStateMessage,- isLogRecord,- isFramerateUpdate,-} from '@/services/server/server-helpers/websocket-message-types';--// ----------------------------------------------------------------------------// isSettingsStateMessage-// -----------------------------------------------------------------------------describe('isSettingsStateMessage', () => {- it('returns true for valid settings/state message', () => {- const msg = {- message_type: 'settings/state',- settings: {- cameras: {},- pipeline: {},- calibration: {},- mocap: {},- },- version: 1,- };- expect(isSettingsStateMessage(msg)).toBe(true);- });-- it('returns false if message_type is wrong', () => {- const msg = {- message_type: 'settings/patch',- settings: {},- version: 1,- };- expect(isSettingsStateMessage(msg)).toBe(false);- });-- it('returns false if message_type is missing', () => {- const msg = {- settings: {},- version: 1,- };- expect(isSettingsStateMessage(msg)).toBe(false);- });-- it('returns false if settings is missing', () => {- const msg = {- message_type: 'settings/state',- version: 1,- };- expect(isSettingsStateMessage(msg)).toBe(false);- });-- it('returns false if settings is null', () => {- const msg = {- message_type: 'settings/state',- settings: null,- version: 1,- };- expect(isSettingsStateMessage(msg)).toBe(false);- });-- it('returns false if version is missing', () => {- const msg = {- message_type: 'settings/state',- settings: {},- };- expect(isSettingsStateMessage(msg)).toBe(false);- });-- it('returns false if version is not a number', () => {- const msg = {- message_type: 'settings/state',- settings: {},- version: '1',- };- expect(isSettingsStateMessage(msg)).toBe(false);- });-- it('returns false for null', () => {- expect(isSettingsStateMessage(null)).toBe(false);- });-- it('returns false for undefined', () => {- expect(isSettingsStateMessage(undefined)).toBe(false);- });-- it('returns false for a string', () => {- expect(isSettingsStateMessage('hello')).toBe(false);- });-- it('returns false for a number', () => {- expect(isSettingsStateMessage(42)).toBe(false);- });-- it('returns false for an empty object', () => {- expect(isSettingsStateMessage({})).toBe(false);- });-});--// ----------------------------------------------------------------------------// isLogRecord-// -----------------------------------------------------------------------------describe('isLogRecord', () => {- it('returns true for valid log record', () => {- const msg = {- message_type: 'log_record',- levelname: 'INFO',- message: 'Something happened',- levelno: 20,- };- expect(isLogRecord(msg)).toBe(true);- });-- it('returns false if message_type is wrong', () => {- const msg = {- message_type: 'not_log',- levelname: 'INFO',- message: 'nope',- };- expect(isLogRecord(msg)).toBe(false);- });-- it('returns false if levelname missing', () => {- const msg = {- message_type: 'log_record',- message: 'no level',- };- expect(isLogRecord(msg)).toBe(false);- });-- it('returns false if message missing', () => {- const msg = {- message_type: 'log_record',- levelname: 'INFO',- };- expect(isLogRecord(msg)).toBe(false);- });-- it('returns false for null', () => {- expect(isLogRecord(null)).toBe(false);- });-});--// ----------------------------------------------------------------------------// isFramerateUpdate-// -----------------------------------------------------------------------------describe('isFramerateUpdate', () => {- it('returns true for valid framerate update', () => {- const msg = {- message_type: 'framerate_update',- camera_group_id: 'group-0',- backend_framerate: { fps: 30 },- frontend_framerate: { fps: 28 },- };- expect(isFramerateUpdate(msg)).toBe(true);- });-- it('returns false if message_type is wrong', () => {- const msg = {- message_type: 'not_framerate',- camera_group_id: 'group-0',- backend_framerate: {},- frontend_framerate: {},- };- expect(isFramerateUpdate(msg)).toBe(false);- });-- it('returns false if camera_group_id missing', () => {- const msg = {- message_type: 'framerate_update',- backend_framerate: {},- frontend_framerate: {},- };- expect(isFramerateUpdate(msg)).toBe(false);- });-- it('returns false if backend_framerate is not an object', () => {- const msg = {- message_type: 'framerate_update',- camera_group_id: 'group-0',- backend_framerate: 30,- frontend_framerate: {},- };- expect(isFramerateUpdate(msg)).toBe(false);- });-- it('returns false if frontend_framerate is null', () => {- const msg = {- message_type: 'framerate_update',- camera_group_id: 'group-0',- backend_framerate: {},- frontend_framerate: null,- };- expect(isFramerateUpdate(msg)).toBe(false);- });-});diff --git a/freemocap-ui/src/__tests__/mocap-slice.test.ts b/freemocap-ui/src/__tests__/mocap-slice.test.tsdeleted file mode 100644index 6877e6bb..00000000--- a/freemocap-ui/src/__tests__/mocap-slice.test.ts+++ /dev/null@@ -1,234 +0,0 @@-import { describe, it, expect } from 'vitest';-import {- mocapSlice,- mocapDetectorConfigReplaced,- mocapDetectorConfigUpdated,- skeletonFilterConfigReplaced,- skeletonFilterConfigUpdated,- mocapErrorCleared,- resetMocapState,- MEDIAPIPE_REALTIME_PRESET,- MEDIAPIPE_POSTHOC_PRESET,- DEFAULT_ESTIMATOR_CONFIG,- DEFAULT_REALTIME_FILTER_CONFIG,- MocapState,-} from '@/store/slices/mocap/mocap-slice';--const reducer = mocapSlice.reducer;--function getInitialState(): MocapState {- return reducer(undefined, { type: 'unknown' });-}--// ----------------------------------------------------------------------------// Initial state — defaults must match backend-// -----------------------------------------------------------------------------describe('mocapSlice initial state', () => {- it('has detector config matching MEDIAPIPE_REALTIME_PRESET', () => {- const state = getInitialState();- expect(state.config.detector).toEqual(MEDIAPIPE_REALTIME_PRESET);- });-- it('has skeleton_filter config matching DEFAULT_REALTIME_FILTER_CONFIG', () => {- const state = getInitialState();- expect(state.config.skeleton_filter).toEqual(DEFAULT_REALTIME_FILTER_CONFIG);- });-- it('starts not recording', () => {- const state = getInitialState();- expect(state.isRecording).toBe(false);- expect(state.recordingProgress).toBe(0);- });-- it('starts with no error', () => {- const state = getInitialState();- expect(state.error).toBeNull();- });-});--// ----------------------------------------------------------------------------// Default constants match backend values-// -----------------------------------------------------------------------------describe('default constants match backend', () => {- describe('MEDIAPIPE_REALTIME_PRESET', () => {- // These must match MEDIAPIPE_TRACKER_REALTIME_PRESET in skellytracker- it('has model_complexity 0', () => {- expect(MEDIAPIPE_REALTIME_PRESET.model_complexity).toBe(0);- });- it('has static_image_mode false', () => {- expect(MEDIAPIPE_REALTIME_PRESET.static_image_mode).toBe(false);- });- it('has smooth_landmarks true', () => {- expect(MEDIAPIPE_REALTIME_PRESET.smooth_landmarks).toBe(true);- });- });-- describe('DEFAULT_ESTIMATOR_CONFIG', () => {- // Must match EstimatorConfig defaults in bone_length_estimator.py- it('has max_samples 500', () => {- expect(DEFAULT_ESTIMATOR_CONFIG.max_samples).toBe(500);- });- it('has min_samples_for_full_confidence 100', () => {- expect(DEFAULT_ESTIMATOR_CONFIG.min_samples_for_full_confidence).toBe(100);- });- it('has iqr_confidence_sensitivity 10.0', () => {- expect(DEFAULT_ESTIMATOR_CONFIG.iqr_confidence_sensitivity).toBe(10.0);- });- });-- describe('DEFAULT_REALTIME_FILTER_CONFIG', () => {- // Must match RealtimeFilterConfig defaults in realtime_skeleton_filter.py- it('has min_cutoff 0.005', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.min_cutoff).toBe(0.005);- });- it('has beta 0.3', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.beta).toBe(0.3);- });- it('has d_cutoff 1.0', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.d_cutoff).toBe(1.0);- });- it('has height_meters 1.75', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.height_meters).toBe(1.75);- });- it('has noise_sigma 0.015', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.noise_sigma).toBe(0.015);- });- it('has max_reprojection_error_px 60.0', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.max_reprojection_error_px).toBe(60.0);- });- it('has max_velocity_m_per_s 50.0', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.max_velocity_m_per_s).toBe(50.0);- });- it('has max_rejected_streak 5', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.max_rejected_streak).toBe(5);- });- it('has max_prediction_frames 15', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.max_prediction_frames).toBe(15);- });- it('has prediction_velocity_decay 0.75', () => {- expect(DEFAULT_REALTIME_FILTER_CONFIG.prediction_velocity_decay).toBe(0.75);- });- });-});--// ----------------------------------------------------------------------------// Detector config reducers-// -----------------------------------------------------------------------------describe('mocapDetectorConfigReplaced', () => {- it('replaces entire detector config', () => {- const state = getInitialState();- const updated = reducer(state, mocapDetectorConfigReplaced(MEDIAPIPE_POSTHOC_PRESET));- expect(updated.config.detector).toEqual(MEDIAPIPE_POSTHOC_PRESET);- expect(updated.config.detector.model_complexity).toBe(2);- });-});--describe('mocapDetectorConfigUpdated', () => {- it('merges partial update into detector config', () => {- const state = getInitialState();- const updated = reducer(state, mocapDetectorConfigUpdated({- model_complexity: 1,- }));- expect(updated.config.detector.model_complexity).toBe(1);- // Other fields preserved- expect(updated.config.detector.smooth_landmarks).toBe(true);- });-});--// ----------------------------------------------------------------------------// Skeleton filter config reducers-// -----------------------------------------------------------------------------describe('skeletonFilterConfigReplaced', () => {- it('replaces entire filter config', () => {- const state = getInitialState();- const customFilter = {- ...DEFAULT_REALTIME_FILTER_CONFIG,- beta: 0.99,- max_rejected_streak: 10,- };- const updated = reducer(state, skeletonFilterConfigReplaced(customFilter));- expect(updated.config.skeleton_filter.beta).toBe(0.99);- expect(updated.config.skeleton_filter.max_rejected_streak).toBe(10);- });-});--describe('skeletonFilterConfigUpdated', () => {- it('merges partial update into filter config', () => {- const state = getInitialState();- const updated = reducer(state, skeletonFilterConfigUpdated({ beta: 0.1 }));- expect(updated.config.skeleton_filter.beta).toBe(0.1);- // Other fields preserved from DEFAULT_REALTIME_FILTER_CONFIG- expect(updated.config.skeleton_filter.min_cutoff).toBe(0.005);- expect(updated.config.skeleton_filter.max_rejected_streak).toBe(5);- });-});--// ----------------------------------------------------------------------------// Error handling-// -----------------------------------------------------------------------------describe('mocapErrorCleared', () => {- it('clears error', () => {- const state: MocapState = { ...getInitialState(), error: 'oops' };- const updated = reducer(state, mocapErrorCleared());- expect(updated.error).toBeNull();- });-});--// ----------------------------------------------------------------------------// Reset-// -----------------------------------------------------------------------------describe('resetMocapState', () => {- it('resets to initial state', () => {- const modified: MocapState = {- ...getInitialState(),- config: {- detector: MEDIAPIPE_POSTHOC_PRESET,- skeleton_filter: { ...DEFAULT_REALTIME_FILTER_CONFIG, beta: 99 },- },- isRecording: true,- error: 'err',- };- const reset = reducer(modified, resetMocapState());- expect(reset).toEqual(getInitialState());- });-});--// ----------------------------------------------------------------------------// Async thunk reducers-// -----------------------------------------------------------------------------describe('startMocapRecording thunk reducers', () => {- it('pending sets isLoading', () => {- const state = getInitialState();- const updated = reducer(state, { type: 'mocap/startRecording/pending' });- expect(updated.isLoading).toBe(true);- expect(updated.error).toBeNull();- });-- it('fulfilled sets isRecording', () => {- const state: MocapState = { ...getInitialState(), isLoading: true };- const updated = reducer(state, {- type: 'mocap/startRecording/fulfilled',- payload: { success: true },- });- expect(updated.isLoading).toBe(false);- expect(updated.isRecording).toBe(true);- expect(updated.recordingProgress).toBe(0);- });-- it('rejected sets error', () => {- const state: MocapState = { ...getInitialState(), isLoading: true };- const updated = reducer(state, {- type: 'mocap/startRecording/rejected',- payload: 'Network error',- });- expect(updated.isLoading).toBe(false);- expect(updated.error).toBe('Network error');- });-});diff --git a/freemocap-ui/src/__tests__/settings-slice.test.ts b/freemocap-ui/src/__tests__/settings-slice.test.tsdeleted file mode 100644index 2d655a4c..00000000--- a/freemocap-ui/src/__tests__/settings-slice.test.ts+++ /dev/null@@ -1,181 +0,0 @@-import { describe, it, expect } from 'vitest';-import {- settingsSlice,- serverSettingsUpdated,- serverSettingsCleared,- ServerSettingsState,-} from '@/store/slices/settings/settings-slice';-import type {- FreeMoCapSettings,- SettingsStateMessage,-} from '@/store/slices/settings/settings-types';--const reducer = settingsSlice.reducer;--// ----------------------------------------------------------------------------// Helpers-// -----------------------------------------------------------------------------function makeSettings(overrides?: Partial<FreeMoCapSettings>): FreeMoCapSettings {- return {- cameras: {},- pipeline: {- config: null,- is_connected: false,- pipeline_id: null,- camera_group_id: null,- is_paused: false,- },- calibration: {- config: {- calibration_recording_folder: null,- charuco_board_x_squares: 5,- charuco_board_y_squares: 3,- charuco_square_length: 1,- solver_method: 'anipose',- use_groundplane: false,- pyceres_solver_config: {},- },- is_recording: false,- recording_progress: 0,- last_recording_path: null,- has_calibration_toml: false,- },- mocap: {- config: {- detector: {},- skeleton_filter: {- min_cutoff: 0.005,- beta: 0.3,- d_cutoff: 1.0,- fabrik_tolerance: 1e-4,- fabrik_max_iterations: 20,- height_meters: 1.75,- noise_sigma: 0.015,- estimator_config: {- max_samples: 500,- min_samples_for_full_confidence: 100,- iqr_confidence_sensitivity: 10.0,- },- max_reprojection_error_px: 60.0,- max_velocity_m_per_s: 50.0,- max_rejected_streak: 5,- max_prediction_frames: 15,- prediction_velocity_decay: 0.75,- },- },- is_recording: false,- recording_progress: 0,- last_recording_path: null,- },- vmc: {- enabled: false,- host: '127.0.0.1',- port: 39539,- },- ...overrides,- };-}--function makeStateMessage(- version: number,- settingsOverrides?: Partial<FreeMoCapSettings>,-): SettingsStateMessage {- return {- message_type: 'settings/state',- settings: makeSettings(settingsOverrides),- version,- };-}--const initialState: ServerSettingsState = {- settings: null,- version: -1,- lastUpdated: null,- isInitialized: false,-};--// ----------------------------------------------------------------------------// Tests-// -----------------------------------------------------------------------------describe('settingsSlice', () => {- it('has correct initial state', () => {- const state = reducer(undefined, { type: 'unknown' });- expect(state.settings).toBeNull();- expect(state.version).toBe(-1);- expect(state.lastUpdated).toBeNull();- expect(state.isInitialized).toBe(false);- });-- describe('serverSettingsUpdated', () => {- it('applies a settings/state message with version > current', () => {- const msg = makeStateMessage(1);- const state = reducer(initialState, serverSettingsUpdated(msg));- expect(state.settings).toEqual(msg.settings);- expect(state.version).toBe(1);- expect(state.isInitialized).toBe(true);- expect(state.lastUpdated).not.toBeNull();- });-- it('ignores a settings/state message with version <= current', () => {- const firstMsg = makeStateMessage(5);- const state1 = reducer(initialState, serverSettingsUpdated(firstMsg));-- const staleMsg = makeStateMessage(3, {- calibration: {- ...makeSettings().calibration,- is_recording: true,- },- });- const state2 = reducer(state1, serverSettingsUpdated(staleMsg));-- // Should not have changed- expect(state2.version).toBe(5);- expect(state2.settings!.calibration.is_recording).toBe(false);- });-- it('ignores a settings/state message with same version', () => {- const msg = makeStateMessage(5);- const state1 = reducer(initialState, serverSettingsUpdated(msg));-- const sameVersionMsg = makeStateMessage(5, {- calibration: {- ...makeSettings().calibration,- is_recording: true,- },- });- const state2 = reducer(state1, serverSettingsUpdated(sameVersionMsg));- expect(state2.settings!.calibration.is_recording).toBe(false);- });-- it('applies newer version after an older one', () => {- const msg1 = makeStateMessage(1);- const state1 = reducer(initialState, serverSettingsUpdated(msg1));-- const msg2 = makeStateMessage(2, {- calibration: {- ...makeSettings().calibration,- is_recording: true,- },- });- const state2 = reducer(state1, serverSettingsUpdated(msg2));- expect(state2.version).toBe(2);- expect(state2.settings!.calibration.is_recording).toBe(true);- });- });-- describe('serverSettingsCleared', () => {- it('resets to initial state', () => {- const msg = makeStateMessage(5);- const populated = reducer(initialState, serverSettingsUpdated(msg));- expect(populated.isInitialized).toBe(true);-- const cleared = reducer(populated, serverSettingsCleared());- expect(cleared.settings).toBeNull();- expect(cleared.version).toBe(-1);- expect(cleared.lastUpdated).toBeNull();- expect(cleared.isInitialized).toBe(false);- });- });-});diff --git a/freemocap-ui/src/components/LogTerminal.tsx b/freemocap-ui/src/components/LogTerminal.tsxindex a59d0524..9e8267b8 100644--- a/freemocap-ui/src/components/LogTerminal.tsx+++ b/freemocap-ui/src/components/LogTerminal.tsx@@ -2,8 +2,6 @@import {alpha,Box,- Chip,- Collapse,IconButton,TextField,ToggleButton,@@ -11,25 +9,33 @@ import {Tooltip,useTheme,} from "@mui/material";-import {useEffect, useRef, useState} from "react";-import {useAppDispatch, useAppSelector} from "@/store";+import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";+import { useServer } from "@/services/server/ServerContextProvider";+import { LogRecord, LogSnapshot } from "@/services/server/server-helpers/log-store";import {- selectFilteredLogs,- selectHasErrors,- selectLogCountsByLevel,- selectLogsPaused-} from "@/store/slices/log-records/logs-selectors";-import {logsCleared, logsFiltered, logsPaused} from "@/store/slices/log-records/log-records-slice";-import {LogRecord} from "@/store/slices/log-records/logs-types";-import {- Delete as DeleteIcon,+ DeleteSweep as DeleteSweepIcon,Pause as PauseIcon,PlayArrow as PlayArrowIcon,Search as SearchIcon,- Warning as WarningIcon+ Warning as WarningIcon,+ ContentCopy as ContentCopyIcon,+ Save as SaveIcon,+ SaveAlt as ScrollToBottomIcon,} from "@mui/icons-material";+import { useTranslation } from "react-i18next";++const LOG_POLL_INTERVAL_MS = 500;++/** Height of a single line of monospace text in the log view. */+const LINE_HEIGHT = 20;++/** Vertical padding added to each log entry. */+const ROW_PADDING = 8;-const LOG_COLORS = {+/** Extra rows rendered above/below the visible viewport. */+const OVERSCAN = 10;++const LOG_COLORS: Record<string, string> = {TRACE: "#ccc",DEBUG: "#88ccFF",INFO: "#00E5FF",@@ -38,195 +44,430 @@ const LOG_COLORS = {WARNING: "#FFFF66",ERROR: "#FF6666",CRITICAL: "#FF0000",-} as const;+};-const LogEntryComponent = ({ log }: { log: LogRecord }) => {- const [expanded, setExpanded] = useState(false);- const color =- LOG_COLORS[log.levelname.toUpperCase() as keyof typeof LOG_COLORS] || "#ccc";- const theme = useTheme();+// ---------------------------------------------------------------------------+// URL linkification — splits text on http/https URLs and renders them as+// clickable <a> tags. When split() is called with a capture group, matched+// segments land at odd indices, so i % 2 === 1 identifies URLs.+// ---------------------------------------------------------------------------- const renderWithFormatting = (text: string | null | undefined): React.ReactNode => {- if (!text) return null;+const URL_REGEX = /(https?:\/\/[^\s)"'>\]]+)/g;- return text.split("\n").map((line, i) => (- <div- key={i}- style={{- whiteSpace: "pre-wrap",- fontFamily: "monospace",- lineHeight: "1.2",- }}- >- {line}- </div>- ));- };+const Linkify = ({ text }: { text: string }) => {+ const parts = text.split(URL_REGEX);+ if (parts.length === 1) return <>{text}</>;return (- <Box- sx={{- mb: 0.5,+ <>+ {parts.map((part, i) =>+ i % 2 === 1 ? (+ <a+ key={i}+ href={part}+ target="_blank"+ rel="noopener noreferrer"+ style={{ color: "#58a6ff", textDecoration: "underline" }}+ onClick={(e) => e.stopPropagation()}+ >+ {part}+ </a>+ ) : (+ <span key={i}>{part}</span>+ )+ )}+ </>+ );+};++// ---------------------------------------------------------------------------+// Variable-height virtualization helpers.+// Each log entry's height depends on the number of lines in its message.+// Single-line messages get a compact row; multi-line messages expand to+// show every line, rendered with preserved whitespace like a real terminal.+// ---------------------------------------------------------------------------++/** Count lines in a message. A message with no newlines has 1 line. */+const countLines = (text: string): number => {+ if (!text) return 1;+ let count = 1;+ for (let i = 0; i < text.length; i++) {+ if (text[i] === "\n") count++;+ }+ return count;+};++/** Compute the pixel height of a log entry based on its line count. */+const getRowHeight = (log: LogRecord): number => {+ const lines = countLines(log.message);+ if (lines === 1) {+ // Single-line: one line of text + padding+ return LINE_HEIGHT + ROW_PADDING;+ }+ // Multi-line: header line + all message lines + padding+ return LINE_HEIGHT + lines * LINE_HEIGHT + ROW_PADDING;+};++/**+ * Build a prefix-sum array of cumulative heights for variable-height virtualization.+ * prefixHeights[i] = total height of rows 0..i-1 (the Y offset of row i).+ * prefixHeights[n] = total height of all rows.+ */+const buildPrefixHeights = (logs: LogRecord[]): number[] => {+ const prefixes = new Array<number>(logs.length + 1);+ prefixes[0] = 0;+ for (let i = 0; i < logs.length; i++) {+ prefixes[i + 1] = prefixes[i] + getRowHeight(logs[i]);+ }+ return prefixes;+};++/** Binary search for the first row whose bottom edge is past the given Y offset. */+const findStartIndex = (prefixHeights: number[], y: number): number => {+ let lo = 0;+ let hi = prefixHeights.length - 2;+ while (lo < hi) {+ const mid = (lo + hi) >>> 1;+ if (prefixHeights[mid + 1] <= y) {+ lo = mid + 1;+ } else {+ hi = mid;+ }+ }+ return lo;+};++// ---------------------------------------------------------------------------+// Lightweight log entry — renders multi-line messages with preserved whitespace+// ---------------------------------------------------------------------------++const LogEntryRow = React.memo(({ log, style }: { log: LogRecord; style: React.CSSProperties }) => {+ const [expanded, setExpanded] = useState(false);+ const color = LOG_COLORS[log.levelname.toUpperCase()] || "#ccc";+ const multiLine = log.message.includes("\n");++ return (+ <div+ style={{+ ...style,borderLeft: `2px solid ${color}`,- pl: 1,- backgroundColor: expanded- ? alpha(color, 0.1)- : theme.palette.mode === "dark"- ? "rgba(0,0,0,0.2)"- : "rgba(0,0,0,0.05)",+ paddingLeft: 8,+ paddingTop: ROW_PADDING / 2,+ paddingBottom: ROW_PADDING / 2,+ backgroundColor: expanded ? `${color}1a` : "rgba(0,0,0,0.2)",cursor: "pointer",- transition: "background-color 0.1s",- "&:hover": {- backgroundColor: alpha(- color,- theme.palette.mode === "dark" ? 0.05 : 0.1- ),- },+ fontFamily: "monospace",+ fontSize: "0.85em",+ lineHeight: `${LINE_HEIGHT}px`,+ overflow: "hidden",+ position: "relative",}}- onClick={() => setExpanded(!expanded)}+ onClick={() => setExpanded((prev) => !prev)}>- <Box sx={{ display: "flex", gap: 1, alignItems: "center", py: 0.5 }}>- <span- style={{- color: theme.palette.mode === "dark" ? "#888" : "#555",- fontSize: "0.9em",- minWidth: "140px",- }}- >+ {/* Header line: timestamp + level badge + first line (or entire message if single-line) */}+ <div style={{ whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>+ <span style={{ color: "#888", marginRight: 8, fontSize: "0.9em" }}>{log.asctime}</span>- <Chip- size="small"- label={log.levelname}- sx={{+ <span+ style={{backgroundColor: color,color: "#000",- height: 16,- fontSize: "0.8em",- minWidth: "60px",- ".MuiChip-label": {- px: 1,- },+ padding: "1px 5px",+ borderRadius: 2,+ fontSize: "0.75em",+ fontWeight: 600,+ marginRight: 8,+ display: "inline-block",+ lineHeight: "normal",+ verticalAlign: "middle",}}- />- <span+ >+ {log.levelname}+ </span>+ <span style={{ color: "#fff" }}>+ <Linkify text={multiLine ? log.message.split("\n")[0] : log.message} />+ </span>+ </div>++ {/* Multi-line message body: remaining lines rendered with preserved whitespace */}+ {multiLine && (+ <divstyle={{- color: theme.palette.mode === "dark" ? "#fff" : "#000",- flexGrow: 1,- fontSize: "0.9em",+ whiteSpace: "pre",+ color: "#fff",+ paddingLeft: 4,}}>- {renderWithFormatting(log.message)}- </span>- </Box>+ <Linkify text={log.message.split("\n").slice(1).join("\n")} />+ </div>+ )}- <Collapse in={expanded}>- <Box- sx={{- pl: 2,- py: 1,- fontSize: "0.8em",- color: theme.palette.mode === "dark" ? "#888" : "#555",- borderTop: "1px solid",- fontFamily: 'monospace',- borderColor:- theme.palette.mode === "dark"- ? "rgba(255,255,255,0.1)"- : "rgba(0,0,0,0.1)",+ {/* Expanded overlay for log metadata (click to toggle) */}+ {expanded && (+ <div+ style={{+ position: "absolute",+ top: "100%",+ left: 0,+ right: 0,+ zIndex: 10,+ backgroundColor: "#1a1a1a",+ borderLeft: `2px solid ${color}`,+ borderBottom: `1px solid ${color}`,+ boxShadow: "0 4px 12px rgba(0,0,0,0.5)",+ overflow: "auto",+ maxHeight: 400,}}+ onClick={(e) => e.stopPropagation()}>- <div>- Location: {log.module}:{log.funcName}:Line#{log.lineno}- </div>- <div>File: {log.filename}</div>- <div>Time delta: {log.delta_t}</div>- <div>Path: {log.pathname}</div>- {log.formatted_message && (- <div>Raw message: {renderWithFormatting(log.formatted_message)}</div>- )}- <div>- Thread: {log.threadName} (ID: {log.thread})- </div>- <div>- Process: {log.processName} (ID: {log.process})- </div>+ <LogEntryDetail log={log} color={color} />+ </div>+ )}+ </div>+ );+});+LogEntryRow.displayName = "LogEntryRow";- {(log.exc_info || log.exc_text) && (- <div>- <div>Exception details:</div>- {log.exc_info && <div>{renderWithFormatting(log.exc_info)}</div>}- {log.exc_text && <div>{renderWithFormatting(log.exc_text)}</div>}- </div>- )}-- {log.stack_info && (- <div>- <div>Stack Trace:</div>- <pre- style={{- whiteSpace: "pre-wrap",- background:- theme.palette.mode === "dark" ? "#111" : "#f5f5f5",- padding: 8,- borderRadius: 4,- margin: "8px 0",- }}- >- {renderWithFormatting(log.stack_info)}- </pre>- </div>- )}- </Box>- </Collapse>- </Box>+const LogEntryDetail = ({ log, color }: { log: LogRecord; color: string }) => {+ const { t } = useTranslation();++ return (+ <div+ style={{+ paddingLeft: 16,+ paddingTop: 6,+ paddingBottom: 6,+ fontSize: "0.8em",+ color: "#888",+ borderTop: "1px solid rgba(255,255,255,0.1)",+ whiteSpace: "pre-wrap",+ lineHeight: "1.4",+ overflow: "visible",+ }}+ onClick={(e) => e.stopPropagation()}+ >+ <div>Location: {log.module}:{log.funcName}:Line#{log.lineno}</div>+ <div>{t("fileLabel")}: {log.filename}</div>+ <div>{t("timeDelta")}: {log.delta_t}</div>+ <div>{t("pathLabel")}: <Linkify text={log.pathname} /></div>+ {log.formatted_message && (+ <div>{t("rawMessage")}: <Linkify text={log.formatted_message} /></div>+ )}+ <div>Thread: {log.threadName} (ID: {log.thread})</div>+ <div>Process: {log.processName} (ID: {log.process})</div>+ {(log.exc_info || log.exc_text) && (+ <div>+ <div>{t("exceptionDetails")}:</div>+ {log.exc_info && <div><Linkify text={log.exc_info} /></div>}+ {log.exc_text && <div><Linkify text={log.exc_text} /></div>}+ </div>+ )}+ {log.stack_info && (+ <div>+ <div>{t("stackTrace")}:</div>+ <pre+ style={{+ whiteSpace: "pre-wrap",+ background: "#111",+ padding: 8,+ borderRadius: 4,+ margin: "8px 0",+ }}+ >+ <Linkify text={log.stack_info} />+ </pre>+ </div>+ )}+ </div>);};+// ---------------------------------------------------------------------------+// Filtering+// ---------------------------------------------------------------------------++function applyFilters(+ entries: LogRecord[],+ selectedLevels: string[],+ searchText: string,+): LogRecord[] {+ let filtered = entries;++ if (selectedLevels.length > 0) {+ filtered = filtered.filter(log =>+ selectedLevels.includes(log.levelname.toLowerCase())+ );+ }++ if (searchText) {+ const searchLower = searchText.toLowerCase();+ filtered = filtered.filter(log =>+ log.message.toLowerCase().includes(searchLower) ||+ log.module.toLowerCase().includes(searchLower) ||+ log.funcName.toLowerCase().includes(searchLower) ||+ log.formatted_message?.toLowerCase().includes(searchLower)+ );+ }++ return filtered;+}++// ---------------------------------------------------------------------------+// LogTerminal+// ---------------------------------------------------------------------------+export const LogTerminal = () => {const theme = useTheme();- const dispatch = useAppDispatch();- const logs = useAppSelector(selectFilteredLogs);- const isPaused = useAppSelector(selectLogsPaused);- const hasErrors = useAppSelector(selectHasErrors);- const logCounts = useAppSelector(selectLogCountsByLevel);+ const { t } = useTranslation();+ const { getLogStore } = useServer();++ const [snapshot, setSnapshot] = useState<LogSnapshot>({+ entries: [],+ hasErrors: false,+ countsByLevel: {},+ version: 0,+ });+ const [isPaused, setIsPaused] = useState(false);const [selectedLevels, setSelectedLevels] = useState<string[]>([]);const [searchText, setSearchText] = useState<string>("");const [showSearch, setShowSearch] = useState(false);- const logEndRef = useRef<HTMLDivElement>(null);+ const [copyFeedback, setCopyFeedback] = useState(false);++ // Virtualization state+ const scrollContainerRef = useRef<HTMLDivElement>(null);+ const [scrollTop, setScrollTop] = useState(0);+ const [containerHeight, setContainerHeight] = useState(0);const shouldAutoScroll = useRef(true);- // Update filter when levels or search text changes+ /** Track last snapshot version so we skip no-op polls. */+ const lastVersionRef = useRef(-1);++ // Poll the mutable LogStore on a fixed interval.useEffect(() => {- dispatch(logsFiltered({- levels: selectedLevels,- searchText: searchText- }));- }, [selectedLevels, searchText, dispatch]);+ if (isPaused) return;++ const poll = () => {+ const snap = getLogStore().getSnapshot();+ // Skip setState entirely if nothing changed — avoids React reconciliation+ if (snap.version === lastVersionRef.current) return;+ lastVersionRef.current = snap.version;+ setSnapshot(snap);+ };++ // Immediate snapshot when unpausing+ poll();++ const interval = setInterval(poll, LOG_POLL_INTERVAL_MS);+ return () => clearInterval(interval);+ }, [getLogStore, isPaused]);++ const filteredLogs = applyFilters(snapshot.entries, selectedLevels, searchText);++ // Build prefix-sum height array for variable-height virtualization.+ // Recomputed when filteredLogs changes (memoized to avoid recalc on scroll).+ const prefixHeights = useMemo(() => buildPrefixHeights(filteredLogs), [filteredLogs]);+ const totalHeight = prefixHeights[filteredLogs.length] || 0;++ // Track container height via ResizeObserver+ useEffect(() => {+ const container = scrollContainerRef.current;+ if (!container) return;++ const observer = new ResizeObserver((entries) => {+ for (const entry of entries) {+ setContainerHeight(Math.round(entry.contentRect.height));+ }+ });+ observer.observe(container);+ return () => observer.disconnect();+ }, []);- // Auto-scroll to bottom when new logs arrive (if not paused)+ // Auto-scroll to bottom when new logs arrive.+ // Deferred via requestAnimationFrame so that the DOM has painted the+ // updated totalHeight before we read scrollHeight — without this, the+ // scroll position gets set against a stale (shorter) scrollHeight and+ // then snaps back once layout catches up, causing a visible bounce.useEffect(() => {- if (!isPaused && shouldAutoScroll.current) {- logEndRef.current?.scrollIntoView({ behavior: "smooth" });+ if (!isPaused && shouldAutoScroll.current && scrollContainerRef.current) {+ requestAnimationFrame(() => {+ const el = scrollContainerRef.current;+ if (el) {+ el.scrollTop = el.scrollHeight;+ }+ });}- }, [logs, isPaused]);+ }, [filteredLogs, isPaused]);++ const handleScroll = useCallback(() => {+ const el = scrollContainerRef.current;+ if (!el) return;+ setScrollTop(el.scrollTop);+ // Tight tolerance (< 2px) accounts for sub-pixel rounding while+ // ensuring the user must be truly at the bottom to re-engage+ // auto-scroll. A large tolerance causes auto-scroll to stay active+ // when the user is trying to read entries near the bottom.+ const isAtBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 2;+ shouldAutoScroll.current = isAtBottom;+ }, []);++ const scrollToBottom = useCallback(() => {+ const el = scrollContainerRef.current;+ if (el) {+ el.scrollTop = el.scrollHeight;+ shouldAutoScroll.current = true;+ }+ }, []);++ // Compute visible row window using variable-height prefix sums+ const startIdx = Math.max(0, findStartIndex(prefixHeights, scrollTop) - OVERSCAN);+ const endScrollTop = scrollTop + containerHeight;+ const endIdx = Math.min(filteredLogs.length, findStartIndex(prefixHeights, endScrollTop) + 1 + OVERSCAN);+ const offsetY = prefixHeights[startIdx];++ const formatLogsForExport = useCallback((): string => {+ return filteredLogs.map((log) =>+ `[${log.asctime}] [${log.levelname}] ${log.module}:${log.funcName}:${log.lineno} - ${log.message}`+ ).join('\n');+ }, [filteredLogs]);++ const handleCopyToClipboard = useCallback(async () => {+ const text = formatLogsForExport();+ await navigator.clipboard.writeText(text);+ setCopyFeedback(true);+ setTimeout(() => setCopyFeedback(false), 2000);+ }, [formatLogsForExport]);++ const handleSaveToDisk = useCallback(() => {+ const text = formatLogsForExport();+ const blob = new Blob([text], { type: 'text/plain' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `freemocap-logs-${new Date().toISOString().replace(/[:.]/g, '-')}.txt`;+ document.body.appendChild(a);+ a.click();+ document.body.removeChild(a);+ URL.revokeObjectURL(url);+ }, [formatLogsForExport]);const handleLevelToggle = (_: React.MouseEvent<HTMLElement>, newLevels: string[]): void => {setSelectedLevels(newLevels);};const handlePauseToggle = (): void => {- dispatch(logsPaused(!isPaused));+ setIsPaused(prev => !prev);};const handleClear = (): void => {- dispatch(logsCleared());- };-- const handleScroll = (e: React.UIEvent<HTMLDivElement>): void => {- const element = e.currentTarget;- const isAtBottom = element.scrollHeight - element.scrollTop <= element.clientHeight + 50;- shouldAutoScroll.current = isAtBottom;+ getLogStore().clear();+ setSelectedLevels([]);+ setSearchText("");+ setShowSearch(false);+ setIsPaused(false);+ lastVersionRef.current = -1;+ setSnapshot({ entries: [], hasErrors: false, countsByLevel: {}, version: 0 });};return (@@ -239,6 +480,7 @@ export const LogTerminal = () => {theme.palette.mode === "dark" ? "#1a1a1a" : theme.palette.grey[100],}}>+ {/* Toolbar */}<Boxsx={{p: 0.5,@@ -257,11 +499,11 @@ export const LogTerminal = () => {fontWeight: "bold",}}>- Server Logs+ {t('serverLogs')}</span>- {hasErrors && (- <Tooltip title="Errors detected">+ {snapshot.hasErrors && (+ <Tooltip title={t("errorsDetected")}><WarningIconsx={{color: LOG_COLORS.ERROR,@@ -294,7 +536,7 @@ export const LogTerminal = () => {}}>{Object.entries(LOG_COLORS).map(([level, color]) => {- const count = logCounts[level] || 0;+ const count = snapshot.countsByLevel[level] || 0;return (<ToggleButtonkey={level}@@ -336,6 +578,36 @@ export const LogTerminal = () => {</ToggleButtonGroup><Box sx={{ ml: "auto", display: "flex", gap: 0.5 }}>+ <Tooltip title={copyFeedback ? t("copied") : t("copyLogsToClipboard")}>+ <IconButton+ size="small"+ onClick={handleCopyToClipboard}+ sx={{ color: copyFeedback ? theme.palette.success.main : theme.palette.text.secondary }}+ >+ <ContentCopyIcon fontSize="small" />+ </IconButton>+ </Tooltip>++ <Tooltip title={t("saveLogsToFile")}>+ <IconButton+ size="small"+ onClick={handleSaveToDisk}+ sx={{ color: theme.palette.text.secondary }}+ >+ <SaveIcon fontSize="small" />+ </IconButton>+ </Tooltip>++ <Tooltip title="Scroll to bottom">+ <IconButton+ size="small"+ onClick={scrollToBottom}+ sx={{ color: theme.palette.text.secondary }}+ >+ <ScrollToBottomIcon fontSize="small" />+ </IconButton>+ </Tooltip>+<IconButtonsize="small"onClick={() => setShowSearch(!showSearch)}@@ -359,7 +631,7 @@ export const LogTerminal = () => {onClick={handleClear}sx={{ color: theme.palette.text.secondary }}>- <DeleteIcon fontSize="small" />+ <DeleteSweepIcon fontSize="small" /></IconButton></Box></Box>@@ -369,7 +641,7 @@ export const LogTerminal = () => {<TextFieldsize="small"fullWidth- placeholder="Search logs..."+ placeholder={t("searchLogs")}value={searchText}onChange={(e) => setSearchText(e.target.value)}InputProps={{@@ -379,43 +651,25 @@ export const LogTerminal = () => {</Box>)}- <Box- sx={{+ {/* Virtualized log list */}+ <div+ ref={scrollContainerRef}+ onScroll={handleScroll}+ style={{flex: 1,overflowY: "auto",- p: 1,- "&::-webkit-scrollbar": {- width: "8px",- backgroundColor: "transparent",- },- "&::-webkit-scrollbar-thumb": {- backgroundColor:- theme.palette.mode === "dark"- ? "rgba(255, 255, 255, 0.2)"- : "rgba(0, 0, 0, 0.2)",- borderRadius: "4px",- "&:hover": {- backgroundColor:- theme.palette.mode === "dark"- ? "rgba(255, 255, 255, 0.3)"- : "rgba(0, 0, 0, 0.3)",- },- },- "&::-webkit-scrollbar-track": {- backgroundColor: "transparent",- },- // For Firefox- scrollbarWidth: "thin",+ overflowX: "auto",+ position: "relative",+ scrollbarWidth: "thin" as any,scrollbarColor:theme.palette.mode === "dark"? "rgba(255, 255, 255, 0.2) transparent": "rgba(0, 0, 0, 0.2) transparent",}}- onScroll={handleScroll}>- {logs.length === 0 ? (- <Box- sx={{+ {filteredLogs.length === 0 ? (+ <div+ style={{display: "flex",justifyContent: "center",alignItems: "center",@@ -423,17 +677,35 @@ export const LogTerminal = () => {color: theme.palette.text.disabled,}}>- {isPaused ? "Logging paused" : "No logs to display"}- </Box>+ {isPaused ? t("loggingPaused") : t("noLogsToDisplay")}+ </div>) : (- <>- {logs.map((log, i) => (- <LogEntryComponent key={`${log.created}-${log.thread}-${i}`} log={log} />- ))}- <div ref={logEndRef} />- </>+ // Outer div creates the full scrollable height+ <div style={{ height: totalHeight, position: "relative" }}>+ {/* Inner div is offset to the first visible row */}+ <div+ style={{+ position: "absolute",+ top: offsetY,+ left: 0,+ right: 0,+ }}+ >+ {filteredLogs.slice(startIdx, endIdx).map((log, i) => {+ const rowIdx = startIdx + i;+ const rowHeight = prefixHeights[rowIdx + 1] - prefixHeights[rowIdx];+ return (+ <LogEntryRow+ key={`${log.created}-${log.thread}-${rowIdx}`}+ log={log}+ style={{ height: rowHeight }}+ />+ );+ })}+ </div>+ </div>)}- </Box>+ </div></Box>);};diff --git a/freemocap-ui/src/components/MenuNavigationListener.tsx b/freemocap-ui/src/components/MenuNavigationListener.tsxdeleted file mode 100644index ac7e41ee..00000000--- a/freemocap-ui/src/components/MenuNavigationListener.tsx+++ /dev/null@@ -1,26 +0,0 @@-import React, { useEffect } from 'react';-import { useNavigate } from 'react-router-dom';--/**- * Invisible component that listens for navigation events from the- * native Electron menu (via the 'navigate' IPC channel) and forwards- * them to react-router.- *- * Must be rendered inside a Router.- */-export const MenuNavigationListener: React.FC = () => {- const navigate = useNavigate();-- useEffect(() => {- const electronAPI = (window as any).electronAPI;- if (!electronAPI?.onNavigate) return;-- const cleanup = electronAPI.onNavigate((route: string) => {- navigate(route);- });-- return cleanup;- }, [navigate]);-- return null;-};diff --git a/freemocap-ui/src/components/PauseUnpauseButton.tsx b/freemocap-ui/src/components/PauseUnpauseButton.tsxdeleted file mode 100644index f3e80222..00000000--- a/freemocap-ui/src/components/PauseUnpauseButton.tsx+++ /dev/null@@ -1,72 +0,0 @@-// freemocap-ui/src/components/PauseUnpauseButton.tsx-import React, {useState} from 'react';-import {Button, CircularProgress, keyframes, Tooltip} from '@mui/material';-import {styled} from '@mui/system';-import PlayArrowIcon from '@mui/icons-material/PlayArrow';-import PauseIcon from '@mui/icons-material/Pause';-import {pauseUnpauseThunk} from "@/store/slices/cameras/old-camera-thunks/pause-unpause-thunk";--interface PauseUnpauseButtonProps {- disabled?: boolean;-}--const pulseAnimation = keyframes`- 0% {- background-color: rgba(25, 118, 210, 0.8);- }- 50% {- background-color: rgba(25, 118, 210, 1);- }- 100% {- background-color: rgba(25, 118, 210, 0.8);- }-`;--const PulsingButton = styled(Button)<{ pulsing?: boolean }>(({pulsing}) => ({- // backgroundColor: '#1976d2', // MUI primary blue- borderRadius: '80px',- padding: '16px',- '&:hover': {- backgroundColor: '#1565c0', // Darker blue on hover- },- ...(pulsing && {- animation: `${pulseAnimation} 1.5s infinite ease-in-out`,- }),--}));--export const PauseUnpauseButton: React.FC<PauseUnpauseButtonProps> = ({- disabled = false- }) => {- const [isPaused, setIsPaused] = useState(false);- const [isLoading, setIsLoading] = useState(false);--- const handleClick = async () => {- setIsLoading(true);-- try {- await pauseUnpauseThunk();- // Toggle the paused state after successful API call- setIsPaused(prev => !prev);- } catch (error) {- console.error('Failed to pause/unpause cameras:', error);- } finally {- setIsLoading(false);- }- };-- return (- <Tooltip title={isPaused ? "Unpause all cameras" : "Pause all cameras"} >- <PulsingButton- onClick={handleClick}- variant="contained"- pulsing={isPaused ? true : undefined}- fullWidth- disabled={disabled || isLoading}- startIcon={isLoading ? <CircularProgress/> : isPaused ? <PlayArrowIcon/> : <PauseIcon/>}- >- </PulsingButton>- </Tooltip>- );-};diff --git a/freemocap-ui/src/components/ServerConnectionStatus.tsx b/freemocap-ui/src/components/ServerConnectionStatus.tsxindex 2da18b11..8fb894c2 100644--- a/freemocap-ui/src/components/ServerConnectionStatus.tsx+++ b/freemocap-ui/src/components/ServerConnectionStatus.tsx@@ -1,112 +1,767 @@-import React from "react";-import {Box, Chip, Tooltip, useTheme} from "@mui/material";-import WifiIcon from "@mui/icons-material/Wifi";-import WifiOffIcon from "@mui/icons-material/WifiOff";-import CheckIcon from "@mui/icons-material/Check";-import {CollapsibleSidebarSection} from "@/components/common/CollapsibleSidebarSection";-import {useServer} from "@/hooks/useServer";+import React, { useState, useEffect, useCallback, useRef } from 'react';+import {+ Box,+ Typography,+ IconButton,+ Button,+ Collapse,+ Tooltip,+ CircularProgress,+ Select,+ MenuItem,+ FormControl,+ InputLabel,+ Chip,+ Switch,+ FormControlLabel,+ TextField,+} from '@mui/material';+import { useTheme } from '@mui/material/styles';+import WifiIcon from '@mui/icons-material/Wifi';+import WifiOffIcon from '@mui/icons-material/WifiOff';+import PlayArrowIcon from '@mui/icons-material/PlayArrow';+import StopIcon from '@mui/icons-material/Stop';+import RestartAltIcon from '@mui/icons-material/RestartAlt';+import ExpandMoreIcon from '@mui/icons-material/ExpandMore';+import ExpandLessIcon from '@mui/icons-material/ExpandLess';+import RefreshIcon from '@mui/icons-material/Refresh';+import FolderOpenIcon from '@mui/icons-material/FolderOpen';+import { useServer } from '@/services/server/ServerContextProvider';+import { useTranslation } from "react-i18next";+import { useElectronIPC } from '@/services';+import { DEFAULT_HOST, DEFAULT_PORT } from '@/services/server/server-helpers/server-urls';++interface ExecutableCandidate {+ name: string;+ path: string;+ description: string;+ isValid?: boolean;+ error?: string;+ resolvedPath?: string;+}++const AUTO_CONNECT_DELAY_MS = 2000;+const WS_RECONNECT_INTERVAL_MS = 3000;++const STORAGE_KEYS = {+ SELECTED_EXE_PATH: 'freemocap:selectedExePath',+ PANEL_EXPANDED: 'freemocap:serverPanelExpanded',+ AUTO_LAUNCH_SERVER: 'freemocap:autoLaunchServer',+ AUTO_CONNECT_WS: 'freemocap:autoConnectWs',+ SERVER_HOST: 'freemocap:serverHost',+ SERVER_PORT: 'freemocap:serverPort',+} as const;++function loadFromStorage<T>(key: string, fallback: T): T {+ try {+ const raw = localStorage.getItem(key);+ if (raw === null) return fallback;+ return JSON.parse(raw) as T;+ } catch {+ return fallback;+ }+}++function saveToStorage(key: string, value: unknown): void {+ try {+ localStorage.setItem(key, JSON.stringify(value));+ } catch (err) {+ console.error(`Failed to save ${key} to localStorage:`, err);+ }+}export const ServerConnectionStatus: React.FC = () => {const theme = useTheme();- const {isConnected, connect, disconnect, connectedCameraIds} = useServer();+ const { isConnected, connect, disconnect, connectedCameraIds, updateServerConnection } = useServer();+ const { t } = useTranslation();+ const { isElectron, api } = useElectronIPC();++ // Persisted UI state+ const [expanded, setExpanded] = useState(() => loadFromStorage(STORAGE_KEYS.PANEL_EXPANDED, false));+ const [selectedExePath, setSelectedExePath] = useState(() => loadFromStorage(STORAGE_KEYS.SELECTED_EXE_PATH, ''));+ const [autoLaunchServer, setAutoLaunchServer] = useState(() => loadFromStorage(STORAGE_KEYS.AUTO_LAUNCH_SERVER, true));+ const [autoConnectWs, setAutoConnectWs] = useState(() => loadFromStorage(STORAGE_KEYS.AUTO_CONNECT_WS, true));+ const [serverHost, setServerHost] = useState(() => loadFromStorage(STORAGE_KEYS.SERVER_HOST, DEFAULT_HOST));+ const [serverPort, setServerPort] = useState(() => loadFromStorage(STORAGE_KEYS.SERVER_PORT, DEFAULT_PORT));++ // Text field drafts (applied on blur/enter so we don't reconnect on every keystroke)+ const [hostDraft, setHostDraft] = useState(serverHost);+ const [portDraft, setPortDraft] = useState(String(serverPort));++ // Transient state+ const [serverRunning, setServerRunning] = useState(false);+ const [serverLoading, setServerLoading] = useState(false);+ const [currentExePath, setCurrentExePath] = useState<string | null>(null);+ const [candidates, setCandidates] = useState<ExecutableCandidate[]>([]);+ const [candidatesLoading, setCandidatesLoading] = useState(false);+ const [processInfo, setProcessInfo] = useState<{ pid: number | undefined; killed: boolean } | null>(null);+ const [error, setError] = useState<string | null>(null);++ // Track whether the initial auto-launch has been attempted so we only fire once+ const autoLaunchFiredRef = useRef(false);+ // Guard against concurrent startServer calls from the auto-launch effect+ const serverLaunchingRef = useRef(false);++ // ── Persistence effects ──++ useEffect(() => { saveToStorage(STORAGE_KEYS.PANEL_EXPANDED, expanded); }, [expanded]);+ useEffect(() => { saveToStorage(STORAGE_KEYS.SELECTED_EXE_PATH, selectedExePath); }, [selectedExePath]);+ useEffect(() => { saveToStorage(STORAGE_KEYS.AUTO_LAUNCH_SERVER, autoLaunchServer); }, [autoLaunchServer]);+ useEffect(() => { saveToStorage(STORAGE_KEYS.AUTO_CONNECT_WS, autoConnectWs); }, [autoConnectWs]);+ useEffect(() => { saveToStorage(STORAGE_KEYS.SERVER_HOST, serverHost); }, [serverHost]);+ useEffect(() => { saveToStorage(STORAGE_KEYS.SERVER_PORT, serverPort); }, [serverPort]);++ // Apply persisted host/port to the server connection on mount+ useEffect(() => {+ updateServerConnection(serverHost, serverPort);+ }, []); // eslint-disable-line react-hooks/exhaustive-deps++ // ── Server status polling ──++ const pollServerStatus = useCallback(async () => {+ if (!isElectron || !api) return;+ try {+ const running = await api.pythonServer.isRunning.query();+ setServerRunning(running);+ const info = await api.pythonServer.getProcessInfo.query();+ setProcessInfo(info);+ const exePath = await api.pythonServer.getExecutablePath.query();+ setCurrentExePath(exePath);+ } catch (err) {+ console.error('Failed to poll server status:', err);+ }+ }, [isElectron, api]);++ // ── Candidate management ──++ const loadCandidates = useCallback(async () => {+ if (!isElectron || !api) return;+ setCandidatesLoading(true);+ try {+ const result = await api.pythonServer.getExecutableCandidates.query();+ const typed = result as ExecutableCandidate[];+ setCandidates(typed);+ if (!selectedExePath) {+ const firstValid = typed.find((c) => c.isValid);+ if (firstValid) {+ setSelectedExePath(firstValid.path);+ }+ }+ } catch (err) {+ console.error('Failed to load executable candidates:', err);+ setError(`Failed to load candidates: ${err instanceof Error ? err.message : String(err)}`);+ } finally {+ setCandidatesLoading(false);+ }+ }, [isElectron, api, selectedExePath]);++ const refreshCandidates = useCallback(async () => {+ if (!isElectron || !api) return;+ setCandidatesLoading(true);+ setError(null);+ try {+ const result = await api.pythonServer.refreshCandidates.mutate();+ const typed = result as ExecutableCandidate[];+ setCandidates(typed);+ const firstValid = typed.find((c) => c.isValid);+ if (firstValid) {+ setSelectedExePath(firstValid.path);+ }+ } catch (err) {+ console.error('Failed to refresh candidates:', err);+ setError(`Failed to refresh: ${err instanceof Error ? err.message : String(err)}`);+ } finally {+ setCandidatesLoading(false);+ }+ }, [isElectron, api]);++ const browseForExecutable = useCallback(async () => {+ if (!isElectron || !api) return;+ try {+ const filePath = await api.fileSystem.selectExecutableFile.mutate();+ if (filePath) {+ setSelectedExePath(filePath);+ }+ } catch (err) {+ console.error('Failed to browse for executable:', err);+ setError(`Browse failed: ${err instanceof Error ? err.message : String(err)}`);+ }+ }, [isElectron, api]);++ // ── Server actions ──++ const startServer = useCallback(async () => {+ if (!isElectron || !api) return;+ if (serverLaunchingRef.current) return;+ serverLaunchingRef.current = true;+ setServerLoading(true);+ setError(null);+ try {+ const exePath = selectedExePath || null;+ await api.pythonServer.start.mutate({ exePath });+ await pollServerStatus();+ } catch (err) {+ console.error('Failed to start server:', err);+ setError(`Start failed: ${err instanceof Error ? err.message : String(err)}`);+ } finally {+ setServerLoading(false);+ serverLaunchingRef.current = false;+ }+ }, [isElectron, api, selectedExePath, pollServerStatus]);++ const stopServer = useCallback(async () => {+ if (!isElectron || !api) return;+ setServerLoading(true);+ setError(null);+ try {+ disconnect();+ await api.pythonServer.stop.mutate();+ await pollServerStatus();+ } catch (err) {+ console.error('Failed to stop server:', err);+ setError(`Stop failed: ${err instanceof Error ? err.message : String(err)}`);+ } finally {+ setServerLoading(false);+ }+ }, [isElectron, api, pollServerStatus, disconnect]);++ const resetServer = useCallback(async () => {+ if (!isElectron || !api) return;+ setServerLoading(true);+ setError(null);+ try {+ disconnect();+ await api.pythonServer.stop.mutate();+ await new Promise((resolve) => setTimeout(resolve, 500));+ const exePath = selectedExePath || null;+ await api.pythonServer.start.mutate({ exePath });+ await pollServerStatus();+ } catch (err) {+ console.error('Failed to reset server:', err);+ setError(`Reset failed: ${err instanceof Error ? err.message : String(err)}`);+ } finally {+ setServerLoading(false);+ }+ }, [isElectron, api, selectedExePath, pollServerStatus, disconnect]);++ // ── Initial load: poll status + load candidates ──++ useEffect(() => {+ if (isElectron && api) {+ pollServerStatus();+ loadCandidates();+ }+ }, [isElectron, api, pollServerStatus, loadCandidates]);++ // ── Poll server status periodically ──++ useEffect(() => {+ if (!isElectron || !api) return;+ const interval = setInterval(pollServerStatus, 5000);+ return () => clearInterval(interval);+ }, [isElectron, api, pollServerStatus]);++ // ── Auto-launch server on mount (once) ──+ // Waits for candidates to be loaded so selectedExePath is populated,+ // then fires a single launch attempt if the server is not already running.++ useEffect(() => {+ if (!isElectron || !api) return;+ if (!autoLaunchServer) return;+ if (autoLaunchFiredRef.current) return;+ if (candidatesLoading) return; // wait for candidates to load+ if (serverRunning || serverLoading) return;++ autoLaunchFiredRef.current = true;+ console.log('Auto-launching server...');+ startServer();+ }, [isElectron, api, autoLaunchServer, candidatesLoading, serverRunning, serverLoading, startServer]);++ // ── WebSocket auto-reconnect loop ──+ // When autoConnectWs is on and we're not connected, periodically call connect().+ // The underlying WebSocketConnection handles deduplication of CONNECTING state.++ useEffect(() => {+ if (!autoConnectWs) return;+ if (isConnected) return;++ // Fire one immediate attempt+ connect();++ const interval = setInterval(() => {+ if (!isConnected) {+ connect();+ }+ }, WS_RECONNECT_INTERVAL_MS);++ return () => clearInterval(interval);+ }, [autoConnectWs, isConnected, connect]);- const handleToggle = (e: React.MouseEvent): void => {+ // ── Toggle handlers ──++ const handleToggleAutoLaunch = useCallback((e: React.MouseEvent) => {+ e.stopPropagation();+ setAutoLaunchServer((prev) => !prev);+ }, []);++ const handleToggleAutoConnectWs = useCallback((e: React.MouseEvent) => {+ e.stopPropagation();+ setAutoConnectWs((prev) => {+ const next = !prev;+ if (!next) {+ // User is turning off auto-connect — disconnect now+ disconnect();+ }+ return next;+ });+ }, [disconnect]);++ const handleToggleServerRunning = useCallback((e: React.MouseEvent) => {+ e.stopPropagation();+ if (serverRunning) {+ stopServer();+ } else {+ startServer();+ }+ }, [serverRunning, startServer, stopServer]);++ const handleToggleWsConnected = useCallback((e: React.MouseEvent) => {e.stopPropagation();if (isConnected) {+ // Turn off auto-connect so it doesn't immediately reconnect+ setAutoConnectWs(false);disconnect();} else {+ setAutoConnectWs(true);connect();}- };-- // Original cyan/red color mapping- const colors = isConnected- ? {- bg: "rgba(0, 255, 255, 0.1)",- border: "rgba(0, 255, 255, 0.5)",- text: "#00ffff",- hoverBg: "rgba(0, 255, 255, 0.2)",+ }, [isConnected, connect, disconnect]);++ const applyHostPort = useCallback(() => {+ const trimmedHost = hostDraft.trim();+ const parsedPort = parseInt(portDraft, 10);+ if (!trimmedHost) return;+ if (isNaN(parsedPort) || parsedPort < 1 || parsedPort > 65535) return;++ setServerHost(trimmedHost);+ setServerPort(parsedPort);+ updateServerConnection(trimmedHost, parsedPort);+ }, [hostDraft, portDraft, updateServerConnection]);++ const handleHostPortKeyDown = useCallback((e: React.KeyboardEvent) => {+ if (e.key === 'Enter') {+ applyHostPort();}- : {- bg: "rgba(255, 0, 0, 0.1)",- border: "rgba(255, 0, 0, 0.5)",- text: "#f44336",- hoverBg: "rgba(255, 0, 0, 0.2)",- };+ }, [applyHostPort]);++ // ── Derived values ──++ const wsStatusColor = isConnected ? '#00ffff' : '#f44336';+ const serverStatusColor = serverRunning ? theme.palette.success.main : theme.palette.text.disabled;++ const validCandidates = candidates.filter((c) => c.isValid);+ const invalidCandidates = candidates.filter((c) => !c.isValid);++ // ── Render ──return (- <CollapsibleSidebarSection- icon={- isConnected ? (- <WifiIcon sx={{color: "inherit"}} />- ) : (- <WifiOffIcon sx={{color: "inherit"}} />- )- }- title="WebSocket"- summaryContent={- isConnected && connectedCameraIds.length > 0 ? (- <Chip- label={`${connectedCameraIds.length} cam${connectedCameraIds.length !== 1 ? "s" : ""}`}- size="small"- variant="outlined"- sx={{- height: 18,- fontSize: 10,- borderColor: "rgba(255,255,255,0.4)",- color: "inherit",- }}- />- ) : null- }- primaryControl={- <Tooltip title={isConnected ? "Click to disconnect" : "Click to connect"}>- <Box- onClick={handleToggle}- sx={{- display: "flex",- alignItems: "center",- gap: 0.75,- cursor: "pointer",- borderRadius: 1,- border: `2px solid ${colors.border}`,- backgroundColor: colors.bg,- px: 2,- py: 0.5,- transition: "all 0.2s ease",- "&:hover": {- backgroundColor: colors.hoverBg,- transform: "translateY(-1px)",- boxShadow: `0 2px 8px ${colors.border}`,- },- }}+ <Box+ sx={{+ borderBottom: `1px solid ${theme.palette.divider}`,+ backgroundColor: theme.palette.mode === 'dark'+ ? 'rgba(0, 0, 0, 0.2)'+ : 'rgba(0, 0, 0, 0.02)',+ }}+ >+ {/* ── Collapsed summary row ── */}+ <Box+ onClick={() => setExpanded((prev) => !prev)}+ sx={{+ display: 'flex',+ alignItems: 'center',+ gap: 0.5,+ px: 1.5,+ py: 0.5,+ cursor: 'pointer',+ '&:hover': { backgroundColor: 'rgba(255,255,255,0.03)' },+ }}+ >+ {/* Status labels */}+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, flex: 1, minWidth: 0 }}>+ {/* WS toggle button */}+ <Tooltip title={isConnected ? t('disconnectWebSocket') : t('connectWebSocket')}>+ <IconButton+ size="small"+ onClick={handleToggleWsConnected}+ sx={{ p: 0.25, color: wsStatusColor }}+ >+ {isConnected ? (+ <WifiIcon sx={{ fontSize: 16 }} />+ ) : (+ <WifiOffIcon sx={{ fontSize: 16 }} />+ )}+ </IconButton>+ </Tooltip>++ <Typography+ variant="caption"+ sx={{ fontWeight: 500, color: wsStatusColor, whiteSpace: 'nowrap', fontSize: '0.7rem' }}>- {isConnected ? (- <CheckIcon sx={{fontSize: 18, color: colors.text}} />- ) : null}- <Box- component="span"+ {isConnected ? t('connected') : autoConnectWs ? t('connecting') : t('off')}+ </Typography>++ {isElectron && (+ <>+ <Box sx={{ mx: 0.25, color: theme.palette.text.disabled, fontSize: '0.7rem' }}>|</Box>++ {/* Server toggle button */}+ <Tooltip title={serverRunning ? t('stopServer') : t('launchServer')}>+ <IconButton+ size="small"+ onClick={handleToggleServerRunning}+ disabled={serverLoading}+ sx={{ p: 0.25, color: serverStatusColor }}+ >+ {serverLoading ? (+ <CircularProgress size={14} />+ ) : serverRunning ? (+ <StopIcon sx={{ fontSize: 16 }} />+ ) : (+ <PlayArrowIcon sx={{ fontSize: 16 }} />+ )}+ </IconButton>+ </Tooltip>++ <Typography+ variant="caption"+ sx={{ fontWeight: 500, color: serverStatusColor, whiteSpace: 'nowrap', fontSize: '0.7rem' }}+ >+ {serverLoading ? t('working') : serverRunning ? t('running') : t('stopped')}+ </Typography>+ </>+ )}++ {isConnected && connectedCameraIds.length > 0 && (+ <Chip+ label={`${connectedCameraIds.length} cam${connectedCameraIds.length !== 1 ? 's' : ''}`}+ size="small"sx={{- fontSize: 14,- fontWeight: 700,- lineHeight: 1,- color: colors.text,- whiteSpace: "nowrap",+ height: 18,+ fontSize: '0.6rem',+ ml: 0.5,+ backgroundColor: 'rgba(0, 255, 255, 0.1)',+ color: '#00ffff',}}- >- {isConnected ? "Connected" : "Connect"}+ />+ )}+ </Box>++ {expanded ? (+ <ExpandLessIcon sx={{ fontSize: 16, color: theme.palette.text.secondary }} />+ ) : (+ <ExpandMoreIcon sx={{ fontSize: 16, color: theme.palette.text.secondary }} />+ )}+ </Box>++ {/* ── Expanded panel ── */}+ <Collapse in={expanded}>+ <Box sx={{ px: 1.5, pb: 1.5, display: 'flex', flexDirection: 'column', gap: 1.5 }}>+ {/* ── Server Process Section (Electron only) ── */}+ {isElectron && (+ <Box sx={{ border: `1px solid ${theme.palette.divider}`, borderRadius: 1, p: 1 }}>+ <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 0.5 }}>+ <Typography+ variant="caption"+ sx={{ fontWeight: 600, color: theme.palette.text.secondary }}+ >+ SERVER PROCESS+ </Typography>+ <FormControlLabel+ control={+ <Switch+ size="small"+ checked={autoLaunchServer}+ onClick={handleToggleAutoLaunch}+ onChange={() => {}} // controlled via onClick with stopPropagation+ />+ }+ label={+ <Typography variant="caption" sx={{ fontSize: '0.65rem', color: theme.palette.text.secondary }}>+ {t('autoLaunch')}+ </Typography>+ }+ sx={{ mr: 0, ml: 0, height: 24 }}+ labelPlacement="start"+ />+ </Box>++ {/* Status line */}+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, mb: 1 }}>+ <Box+ sx={{+ width: 8,+ height: 8,+ borderRadius: '50%',+ backgroundColor: serverRunning+ ? theme.palette.success.main+ : theme.palette.error.main,+ }}+ />+ <Typography variant="caption" sx={{ color: theme.palette.text.primary }}>+ {serverRunning ? t('running') : t('stopped')}+ {processInfo?.pid && ` (PID: ${processInfo.pid})`}+ </Typography>+ </Box>++ {/* Executable selector */}+ <FormControl fullWidth size="small" sx={{ mb: 1 }}>+ <InputLabel sx={{ fontSize: '0.75rem' }}>{t('executable')}</InputLabel>+ <Select+ value={selectedExePath}+ onChange={(e) => setSelectedExePath(e.target.value)}+ label={t("executable")}+ disabled={serverRunning || serverLoading}+ sx={{ fontSize: '0.75rem' }}+ >+ {validCandidates.map((candidate) => (+ <MenuItem key={candidate.path} value={candidate.path} sx={{ fontSize: '0.75rem' }}>+ <Box>+ <Typography variant="caption" sx={{ fontWeight: 600 }}>+ {candidate.name}+ </Typography>+ <Typography+ variant="caption"+ sx={{+ display: 'block',+ color: theme.palette.text.secondary,+ fontSize: '0.65rem',+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ whiteSpace: 'nowrap',+ maxWidth: 250,+ }}+ >+ {candidate.path}+ </Typography>+ </Box>+ </MenuItem>+ ))}+ {invalidCandidates.length > 0 && validCandidates.length > 0 && (+ <MenuItem disabled divider sx={{ fontSize: '0.65rem', opacity: 0.5 }}>+ — invalid —+ </MenuItem>+ )}+ {invalidCandidates.map((candidate) => (+ <MenuItem+ key={candidate.path}+ value={candidate.path}+ disabled+ sx={{ fontSize: '0.75rem', opacity: 0.4 }}+ >+ <Tooltip title={candidate.error || t('invalid')} placement="right">+ <Typography variant="caption">+ {candidate.name} — {candidate.error || 'not found'}+ </Typography>+ </Tooltip>+ </MenuItem>+ ))}+ </Select>+ </FormControl>++ {/* Browse + Refresh row */}+ <Box sx={{ display: 'flex', gap: 0.5, mb: 1 }}>+ <Tooltip title={t('browseForExecutable')}>+ <IconButton+ size="small"+ onClick={browseForExecutable}+ disabled={serverRunning || serverLoading}+ sx={{ border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}+ >+ <FolderOpenIcon sx={{ fontSize: 16 }} />+ </IconButton>+ </Tooltip>+ <Tooltip title={t('refreshCandidates')}>+ <IconButton+ size="small"+ onClick={refreshCandidates}+ disabled={serverRunning || candidatesLoading}+ sx={{ border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}+ >+ {candidatesLoading ? (+ <CircularProgress size={14} />+ ) : (+ <RefreshIcon sx={{ fontSize: 16 }} />+ )}+ </IconButton>+ </Tooltip>+ </Box>++ {/* Action buttons */}+ <Box sx={{ display: 'flex', gap: 0.5 }}>+ <Button+ variant="contained"+ size="small"+ color="success"+ startIcon={serverLoading ? <CircularProgress size={14} color="inherit" /> : <PlayArrowIcon />}+ onClick={() => startServer()}+ disabled={serverRunning || serverLoading}+ sx={{ flex: 1, fontSize: '0.7rem', textTransform: 'none' }}+ >+ Launch+ </Button>+ <Button+ variant="contained"+ size="small"+ color="error"+ startIcon={serverLoading ? <CircularProgress size={14} color="inherit" /> : <StopIcon />}+ onClick={() => stopServer()}+ disabled={!serverRunning || serverLoading}+ sx={{ flex: 1, fontSize: '0.7rem', textTransform: 'none' }}+ >+ Stop+ </Button>+ <Button+ variant="outlined"+ size="small"+ startIcon={serverLoading ? <CircularProgress size={14} /> : <RestartAltIcon />}+ onClick={() => resetServer()}+ disabled={!serverRunning || serverLoading}+ sx={{ flex: 1, fontSize: '0.7rem', textTransform: 'none' }}+ >+ Reset+ </Button>+ </Box>++ {/* Running executable path */}+ {currentExePath && (+ <Tooltip title={currentExePath} placement="bottom">+ <Typography+ variant="caption"+ sx={{+ mt: 0.5,+ display: 'block',+ color: theme.palette.text.secondary,+ fontSize: '0.6rem',+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ whiteSpace: 'nowrap',+ }}+ >+ {t('runningPath', { path: currentExePath })}+ </Typography>+ </Tooltip>+ )}++ {/* Error display */}+ {error && (+ <Typography+ variant="caption"+ sx={{+ mt: 0.5,+ display: 'block',+ color: theme.palette.error.main,+ fontSize: '0.65rem',+ wordBreak: 'break-word',+ }}+ >+ {error}+ </Typography>+ )}+ </Box>+ )}++ {/* ── WebSocket Section ── */}+ <Box sx={{ border: `1px solid ${theme.palette.divider}`, borderRadius: 1, p: 1 }}>+ <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 0.5 }}>+ <Typography+ variant="caption"+ sx={{ fontWeight: 600, color: theme.palette.text.secondary }}+ >+ WEBSOCKET CONNECTION+ </Typography>+ <FormControlLabel+ control={+ <Switch+ size="small"+ checked={autoConnectWs}+ onClick={handleToggleAutoConnectWs}+ onChange={() => {}}+ />+ }+ label={+ <Typography variant="caption" sx={{ fontSize: '0.65rem', color: theme.palette.text.secondary }}>+ {t('autoConnect')}+ </Typography>+ }+ sx={{ mr: 0, ml: 0, height: 24 }}+ labelPlacement="start"+ />+ </Box>++ {/* Host / Port inputs */}+ <Box sx={{ display: 'flex', gap: 0.5, mb: 1 }}>+ <TextField+ size="small"+ label={t("host")}+ value={hostDraft}+ onChange={(e) => setHostDraft(e.target.value)}+ onBlur={applyHostPort}+ onKeyDown={handleHostPortKeyDown}+ disabled={isConnected}+ slotProps={{ inputLabel: { sx: { fontSize: '0.7rem' } }, input: { sx: { fontSize: '0.75rem' } } }}+ sx={{ flex: 3 }}+ />+ <TextField+ size="small"+ label={t("port")}+ type="number"+ value={portDraft}+ onChange={(e) => setPortDraft(e.target.value)}+ onBlur={applyHostPort}+ onKeyDown={handleHostPortKeyDown}+ disabled={isConnected}+ slotProps={{+ inputLabel: { sx: { fontSize: '0.7rem' } },+ input: { sx: { fontSize: '0.75rem' } },+ htmlInput: { min: 1, max: 65535 },+ }}+ sx={{ flex: 1 }}+ />+ </Box>++ <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>+ <Box+ sx={{+ width: 8,+ height: 8,+ borderRadius: '50%',+ backgroundColor: isConnected ? '#00ffff' : theme.palette.error.main,+ }}+ />+ <Typography variant="caption" sx={{ color: theme.palette.text.primary, flex: 1 }}>+ {isConnected ? t('connected') : autoConnectWs ? t('connecting') : t('disconnected')}+ {isConnected && connectedCameraIds.length > 0+ ? ` — ${connectedCameraIds.length} camera${connectedCameraIds.length !== 1 ? 's' : ''}`+ : ''}+ </Typography>++ <Button+ variant={isConnected ? 'outlined' : 'contained'}+ size="small"+ color={isConnected ? 'error' : 'info'}+ startIcon={isConnected ? <WifiOffIcon /> : <WifiIcon />}+ onClick={(e) => {+ e.stopPropagation();+ handleToggleWsConnected(e);+ }}+ sx={{ fontSize: '0.7rem', textTransform: 'none' }}+ >+ {isConnected ? t('disconnect') : t('connect')}+ </Button></Box></Box>- </Tooltip>- }- defaultExpanded={false}- >- {/* Future: server address, port, reconnect behavior settings */}- <Box sx={{p: 2, color: theme.palette.text.secondary, fontSize: 14}}>- {isConnected- ? "WebSocket connection active. Click the button to disconnect."- : "No active connection. Click the button to connect."}- </Box>- </CollapsibleSidebarSection>+ </Box>+ </Collapse>+ </Box>);};diff --git a/freemocap-ui/src/components/calibration-control-panel/CalibrationControlPanel.tsx b/freemocap-ui/src/components/calibration-control-panel/CalibrationControlPanel.tsxdeleted file mode 100644index dc296868..00000000--- a/freemocap-ui/src/components/calibration-control-panel/CalibrationControlPanel.tsx+++ /dev/null@@ -1,624 +0,0 @@-import React, {useCallback, useEffect, useMemo, useState} from "react";-import {- Alert,- Box,- Button,- Checkbox,- Chip,- FormControl,- FormControlLabel,- IconButton,- InputAdornment,- InputLabel,- MenuItem,- Select,- Stack,- TextField,- Tooltip,- Typography,- useTheme,-} from "@mui/material";-import SquareFootIcon from "@mui/icons-material/SquareFoot";-import PlayArrowIcon from "@mui/icons-material/PlayArrow";-import StopIcon from "@mui/icons-material/Stop";-import FolderOpenIcon from "@mui/icons-material/FolderOpen";-import ClearIcon from "@mui/icons-material/Clear";-import CheckCircleIcon from "@mui/icons-material/CheckCircle";-import InfoIcon from "@mui/icons-material/Info";-import CloseIcon from "@mui/icons-material/Close";-import FiberManualRecordIcon from "@mui/icons-material/FiberManualRecord";-import {CollapsibleSidebarSection} from "@/components/common/CollapsibleSidebarSection";-import {useCalibration} from "@/hooks/useCalibration";-import {useElectronIPC} from "@/services";-import {CalibrationSolverSection} from "@/components/calibration-control-panel/CalibrationSolverSection";--type BoardPreset = "5x3" | "7x5" | "custom";--interface BoardPresetConfig {- xSquares: number;- ySquares: number;-}--const BOARD_PRESETS: Record<Exclude<BoardPreset, "custom">, BoardPresetConfig> = {- "5x3": {xSquares: 5, ySquares: 3},- "7x5": {xSquares: 7, ySquares: 5},-};--export const CalibrationControlPanel: React.FC = () => {- const theme = useTheme();- const [localError, setLocalError] = useState<string | null>(null);- const {api} = useElectronIPC();-- const {- config,- error,- isLoading,- isRecording,- recordingProgress,- canStartRecording,- canCalibrate,- calibrationRecordingPath,- directoryInfo,- isUsingManualPath,- updateCalibrationConfig,- dispatchStopCalibrationRecording,- dispatchStartCalibrationRecording,- setManualRecordingPath,- clearManualRecordingPath,- validateDirectory,- calibrateSelectedRecording,- clearError,- } = useCalibration();-- useEffect(() => {- if (calibrationRecordingPath) {- validateDirectory(calibrationRecordingPath);- }- }, [calibrationRecordingPath, validateDirectory]);-- const currentPreset = useMemo<BoardPreset>(() => {- for (const [preset, presetConfig] of Object.entries(BOARD_PRESETS)) {- if (- presetConfig.xSquares === config.charucoBoardXSquares &&- presetConfig.ySquares === config.charucoBoardYSquares- ) {- return preset as BoardPreset;- }- }- return "custom";- }, [config.charucoBoardXSquares, config.charucoBoardYSquares]);-- const handleClearError = useCallback((): void => {- clearError();- setLocalError(null);- }, [clearError]);-- const handlePresetChange = useCallback(- (preset: BoardPreset): void => {- if (preset === "custom") return;- const presetConfig = BOARD_PRESETS[preset];- updateCalibrationConfig({- charucoBoardXSquares: presetConfig.xSquares,- charucoBoardYSquares: presetConfig.ySquares,- });- },- [updateCalibrationConfig]- );-- const handleXSquaresChange = useCallback(- (value: string): void => {- const numValue = parseInt(value, 10);- if (!isNaN(numValue) && numValue > 0) {- updateCalibrationConfig({charucoBoardXSquares: numValue});- }- },- [updateCalibrationConfig]- );-- const handleYSquaresChange = useCallback(- (value: string): void => {- const numValue = parseInt(value, 10);- if (!isNaN(numValue) && numValue > 0) {- updateCalibrationConfig({charucoBoardYSquares: numValue});- }- },- [updateCalibrationConfig]- );-- const handleSelectDirectory = async (): Promise<void> => {- if (!api) {- console.warn("Electron API not available");- return;- }- try {- const result: string | null = await api.fileSystem.selectDirectory.mutate();- if (result) {- await setManualRecordingPath(result);- }- } catch (err) {- console.error("Failed to select directory:", err);- setLocalError("Failed to select directory");- }- };-- const handlePathInputChange = async (- e: React.ChangeEvent<HTMLInputElement>- ): Promise<void> => {- const newPath: string = e.target.value;- if (newPath.includes("~") && api) {- try {- const home: string = await api.fileSystem.getHomeDirectory.query();- const expanded: string = newPath.replace(- /^~([/\\])?/,- home ? `${home}$1` : ""- );- await setManualRecordingPath(expanded);- } catch (err) {- console.error("Failed to expand home directory:", err);- await setManualRecordingPath(newPath);- }- } else {- await setManualRecordingPath(newPath);- }- };-- const handleClearManualPath = useCallback((): void => {- clearManualRecordingPath();- }, [clearManualRecordingPath]);-- const displayError = error || localError || directoryInfo?.errorMessage;-- const pathHelperText = useMemo(() => {- if (isUsingManualPath) return "Using custom path";- return "Using default recording directory";- }, [isUsingManualPath]);-- // Derive status for collapsed summary- const statusLabel = isRecording- ? `Recording ${recordingProgress.toFixed(0)}%`- : isLoading- ? "Processing..."- : directoryInfo?.cameraCalibrationTomlPath- ? "Calibrated"- : "Idle";-- const statusColor = isRecording- ? theme.palette.error.main- : isLoading- ? theme.palette.warning.main- : directoryInfo?.cameraCalibrationTomlPath- ? theme.palette.success.main- : theme.palette.grey[600];-- // Primary control: compact start/stop recording toggle in the header- const headerRecordButton = isRecording ? (- <Tooltip title="Stop calibration recording">- <IconButton- size="small"- onClick={(e: React.MouseEvent) => {- e.stopPropagation();- dispatchStopCalibrationRecording();- }}- disabled={isLoading}- sx={{- color: theme.palette.error.light,- border: `1.5px solid ${theme.palette.error.light}`,- borderRadius: 1,- p: 0.5,- "&:hover": {backgroundColor: "rgba(244,67,54,0.15)"},- }}- >- <StopIcon fontSize="small" />- </IconButton>- </Tooltip>- ) : (- <Tooltip title={canStartRecording ? "Start calibration recording" : "Cannot record yet"}>- <span>- <IconButton- size="small"- onClick={(e: React.MouseEvent) => {- e.stopPropagation();- dispatchStartCalibrationRecording();- }}- disabled={!canStartRecording || isLoading}- sx={{- color: "inherit",- border: "1.5px solid rgba(255,255,255,0.25)",- borderRadius: 1,- p: 0.5,- "&:hover": {backgroundColor: "rgba(255,255,255,0.1)"},- "&.Mui-disabled": {- color: "rgba(255,255,255,0.3)",- borderColor: "rgba(255,255,255,0.1)",- },- }}- >- <FiberManualRecordIcon fontSize="small" />- </IconButton>- </span>- </Tooltip>- );-- return (- <CollapsibleSidebarSection- icon={<SquareFootIcon sx={{color: "inherit"}} />}- title="Calibration"- summaryContent={- <Chip- label={statusLabel}- size="small"- sx={{- height: 20,- fontSize: 11,- fontWeight: 600,- backgroundColor: statusColor,- color: theme.palette.getContrastText(statusColor),- }}- />- }- primaryControl={headerRecordButton}- defaultExpanded={false}- >- <Box sx={{p: 2, bgcolor: "background.paper"}}>- <Stack spacing={2}>- {/* Error Display */}- {displayError && (- <Alert severity="error" onClose={handleClearError}>- {displayError}- </Alert>- )}-- {/* Live Tracker Toggle */}- <FormControlLabel- control={- <Checkbox- checked={config.liveTrackCharuco}- onChange={(e) =>- updateCalibrationConfig({- liveTrackCharuco: e.target.checked,- })- }- disabled={isLoading}- sx={{- "&.Mui-checked": {- color: theme.palette.text.primary,- },- }}- />- }- label="Live Track Charuco Board"- />-- {/* Recording Controls */}- <Stack direction="row" spacing={2}>- <Button- variant="contained"- color="primary"- startIcon={<PlayArrowIcon />}- onClick={dispatchStartCalibrationRecording}- disabled={!canStartRecording || isLoading}- fullWidth- >- Start Calibration Recording- </Button>- {isRecording && (- <Button- variant="contained"- color="error"- startIcon={<StopIcon />}- onClick={dispatchStopCalibrationRecording}- disabled={isLoading}- fullWidth- >- Stop Recording- </Button>- )}- </Stack>-- {/* Recording Path Input */}- <TextField- label="Calibration Recording Path"- value={calibrationRecordingPath}- onChange={handlePathInputChange}- fullWidth- size="small"- helperText={pathHelperText}- InputProps={{- endAdornment: (- <InputAdornment position="end">- {isUsingManualPath && (- <Tooltip title="Clear manual path (revert to default)">- <IconButton- onClick={handleClearManualPath}- edge="end"- size="small"- >- <ClearIcon fontSize="small" />- </IconButton>- </Tooltip>- )}- <Tooltip title="Select directory">- <IconButton- onClick={handleSelectDirectory}- edge="end"- >- <FolderOpenIcon />- </IconButton>- </Tooltip>- </InputAdornment>- ),- }}- />-- {/* Directory Status Info */}- {directoryInfo && (- <Box- sx={{- p: 1.5,- borderRadius: 1,- border: `2px solid ${theme.palette.divider}`,- }}- >- <Stack spacing={1}>- <Box- sx={{- display: "flex",- alignItems: "center",- gap: 1,- }}- >- <InfoIcon fontSize="small" color="info" />- <Typography variant="caption" fontWeight="medium">- Calibration Folder Status- </Typography>- </Box>-- <Box- sx={{- display: "flex",- gap: 1,- flexWrap: "wrap",- }}- >- <Chip- label={- directoryInfo.exists- ? "Directory exists"- : "Directory will be created"- }- size="small"- color={directoryInfo.exists ? "success" : "default"}- icon={- directoryInfo.exists ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={directoryInfo.exists ? "filled" : "outlined"}- sx={- !directoryInfo.exists- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- <Chip- label="Has videos"- size="small"- color={directoryInfo.hasVideos ? "success" : "default"}- icon={- directoryInfo.hasVideos ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={directoryInfo.hasVideos ? "filled" : "outlined"}- sx={- !directoryInfo.hasVideos- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- <Chip- label="Has synchronized_videos"- size="small"- color={- directoryInfo.hasSynchronizedVideos- ? "success"- : "default"- }- icon={- directoryInfo.hasSynchronizedVideos ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={- directoryInfo.hasSynchronizedVideos- ? "filled"- : "outlined"- }- sx={- !directoryInfo.hasSynchronizedVideos- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- <Chip- label="Has calibration TOML"- size="small"- color={- directoryInfo.cameraCalibrationTomlPath- ? "success"- : "default"- }- icon={- directoryInfo.cameraCalibrationTomlPath ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={- directoryInfo.cameraCalibrationTomlPath- ? "filled"- : "outlined"- }- sx={- !directoryInfo.cameraCalibrationTomlPath- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- </Box>-- {directoryInfo.cameraCalibrationTomlPath && (- <Box sx={{mt: 1}}>- <Typography variant="caption" color="text.secondary">- Found calibration file:- </Typography>- <Typography- variant="caption"- sx={{- fontFamily: "monospace",- display: "block",- color: "success.main",- wordBreak: "break-all",- }}- >- {directoryInfo.cameraCalibrationTomlPath}- </Typography>- </Box>- )}- </Stack>- </Box>- )}-- {/* Board Size Configuration */}- <Stack direction="row" spacing={2}>- <FormControl size="small" sx={{minWidth: 140}}>- <InputLabel id="board-preset-label">Preset</InputLabel>- <Select- labelId="board-preset-label"- value={currentPreset}- label="Preset"- onChange={(e) =>- handlePresetChange(e.target.value as BoardPreset)- }- disabled={isLoading}- sx={{color: theme.palette.text.primary}}- >- <MenuItem value="5x3">5×3</MenuItem>- <MenuItem value="7x5">7×5</MenuItem>- <MenuItem value="custom">Custom</MenuItem>- </Select>- </FormControl>- <TextField- label="X Squares"- type="number"- value={config.charucoBoardXSquares}- onChange={(e) => handleXSquaresChange(e.target.value)}- disabled={isLoading}- size="small"- sx={{flex: 1}}- inputProps={{min: 2, max: 20}}- />- <TextField- label="Y Squares"- type="number"- value={config.charucoBoardYSquares}- onChange={(e) => handleYSquaresChange(e.target.value)}- disabled={isLoading}- size="small"- sx={{flex: 1}}- inputProps={{min: 2, max: 20}}- />- </Stack>-- {/* Square Length */}- <TextField- label="Square Length (mm)"- type="number"- value={config.charucoSquareLength}- onChange={(e) =>- updateCalibrationConfig({- charucoSquareLength: parseFloat(e.target.value) || 0,- })- }- disabled={isLoading}- size="small"- fullWidth- inputProps={{min: 1, step: 0.1}}- />-- {/* Solver Method & Groundplane */}- <CalibrationSolverSection />-- {/* Recording Progress */}- {isRecording && (- <Box sx={{width: "100%"}}>- <Typography- variant="caption"- color="text.secondary"- gutterBottom- >- Recording in Progress: {recordingProgress.toFixed(0)}%- </Typography>- <Box- sx={{- width: "100%",- height: 8,- bgcolor: "grey.300",- borderRadius: 1,- overflow: "hidden",- }}- >- <Box- sx={{- width: `${recordingProgress}%`,- height: "100%",- bgcolor: theme.palette.primary.main,- transition: "width 0.3s",- }}- />- </Box>- </Box>- )}-- {/* Calibrate Button */}- <Button- variant="contained"- color="secondary"- onClick={calibrateSelectedRecording}- disabled={!canCalibrate || isLoading}- fullWidth- >- Calibrate Selected Recording- </Button>- </Stack>- </Box>- </CollapsibleSidebarSection>- );-};diff --git a/freemocap-ui/src/components/calibration-control-panel/CalibrationSolverSection.tsx b/freemocap-ui/src/components/calibration-control-panel/CalibrationSolverSection.tsxdeleted file mode 100644index 4e2dee23..00000000--- a/freemocap-ui/src/components/calibration-control-panel/CalibrationSolverSection.tsx+++ /dev/null@@ -1,75 +0,0 @@-import React from "react";-import {- FormControl,- FormControlLabel,- InputLabel,- MenuItem,- Select,- Stack,- Switch,- Typography,- useTheme,-} from "@mui/material";-import {useCalibration} from "@/hooks/useCalibration";-import {CalibrationSolverMethod} from "@/store/slices/calibration";--/**- * Calibration solver method and groundplane controls.- *- * Drop this into CalibrationControlPanel's Stack, after the- * square length TextField and before the recording progress section.- */-export const CalibrationSolverSection: React.FC = () => {- const theme = useTheme();- const {config, updateCalibrationConfig, isLoading} = useCalibration();-- return (- <Stack spacing={2}>- <Typography- variant="subtitle2"- sx={{color: theme.palette.text.secondary, fontWeight: 600}}- >- Solver Settings- </Typography>-- {/* Solver Method */}- <FormControl size="small" fullWidth>- <InputLabel id="solver-method-label">Solver Method</InputLabel>- <Select- labelId="solver-method-label"- value={config.solverMethod}- label="Solver Method"- onChange={(e) =>- updateCalibrationConfig({- solverMethod: e.target.value as CalibrationSolverMethod,- })- }- disabled={isLoading}- sx={{color: theme.palette.text.primary}}- >- <MenuItem value="anipose">Anipose (legacy)</MenuItem>- <MenuItem value="pyceres">Pyceres (bundle adjustment)</MenuItem>- </Select>- </FormControl>-- {/* Groundplane */}- <FormControlLabel- control={- <Switch- size="small"- checked={config.useGroundplane}- onChange={(_, checked) =>- updateCalibrationConfig({useGroundplane: checked})- }- disabled={isLoading}- />- }- label={- <Typography variant="body2">- Align to ground plane- </Typography>- }- />- </Stack>- );-};diff --git a/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeSection.tsx b/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeSection.tsxindex 20bf4c4e..8e470fdf 100644--- a/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeSection.tsx+++ b/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeSection.tsx@@ -1,9 +1,9 @@import React from "react";-import {TreeItem} from "@mui/x-tree-view/TreeItem";-import {useAppDispatch} from "@/store";-import {cameraDesiredConfigUpdated} from "@/store/slices/cameras/cameras-slice";-import {Camera, CameraConfig} from "@/store/slices/cameras/cameras-types";-import {CameraConfigPanel} from "@/components/camera-config-tree-view/camera-config-panel/CameraConfigPanel";+import { TreeItem } from "@mui/x-tree-view/TreeItem";+import { useAppDispatch } from "@/store";+import { cameraDesiredConfigUpdated } from "@/store/slices/cameras/cameras-slice";+import { Camera, CameraConfig } from "@/store/slices/cameras/cameras-types";+import {CameraConfigPanel} from "@/components/camera-config-panel/CameraConfigPanel";interface CameraConfigTreeSectionProps {camera: Camera;diff --git a/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeView.tsx b/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeView.tsxindex 9a6df270..09a70ee5 100644--- a/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeView.tsx+++ b/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeView.tsx@@ -1,156 +1,131 @@-import React, {useEffect, useState} from "react";-import {Box, Chip, Typography, useTheme} from "@mui/material";-import {SimpleTreeView} from "@mui/x-tree-view/SimpleTreeView";+import React, { useEffect, useState } from "react";+import {+ Box,+ Paper,+ Typography,+ useTheme,+} from "@mui/material";+import { SimpleTreeView } from "@mui/x-tree-view/SimpleTreeView";+import { TreeItem } from "@mui/x-tree-view/TreeItem";import ExpandMore from "@mui/icons-material/ExpandMore";import ChevronRight from "@mui/icons-material/ChevronRight";-import VideocamIcon from "@mui/icons-material/Videocam";-import VideoCameraFrontIcon from "@mui/icons-material/VideoCameraFront";+import VideoCameraFrontIcon from '@mui/icons-material/VideoCameraFront';-import {CollapsibleSidebarSection} from "@/components/common/CollapsibleSidebarSection";-import {CameraHeaderActions} from "./CameraHeaderActions";-import {CameraGroupTreeItem} from "./CameraGroupTreeItem";+import { CameraConfigTreeViewHeader } from "./CameraConfigTreeViewHeader";+import { CameraGroupTreeItem } from "./CameraGroupTreeItem";+import { NoCamerasPlaceholder } from "./NoCamerasPlaceholder";import {- Camera,- detectCameras,- selectCameras,- selectConnectedCameras,- selectIsLoading, selectSelectedCameras,useAppDispatch,useAppSelector,+ selectCameras,+ selectIsLoading,+ selectConnectedCameras,+ selectSelectedCameras,+ selectIsPaused,+ detectCameras,+ Camera} from "@/store";-import {useServer} from "@/hooks/useServer";+import {useServer} from "@/services/server/ServerContextProvider";+import { useTranslation } from 'react-i18next';+export const CameraConfigTreeView: React.FC = () => {const theme = useTheme();const dispatch = useAppDispatch();- const {isConnected} = useServer();-+ const { t } = useTranslation();+ const {isConnected} = useServer()+ // Redux stateconst cameras = useAppSelector(selectCameras);const isLoading = useAppSelector(selectIsLoading);const connectedCameras = useAppSelector(selectConnectedCameras);const selectedCameras = useAppSelector(selectSelectedCameras);- // Expand state for the inner camera group tree+ // Local stateconst [expandedItems, setExpandedItems] = useState<string[]>([+ "cameras-root","cameras-connected",- "cameras-available",+ "cameras-available"]);- const [isPaused, setIsPaused] = useState<boolean>(false);- const availableCameras = cameras.filter(- (cam: Camera) => cam.connectionStatus !== "connected"- );+ // Pause state from Redux (shared with keyboard shortcut)+ const isPaused = useAppSelector(selectIsPaused);++ // Group cameras by status+ const availableCameras = cameras.filter((cam: Camera) => cam.connectionStatus !== "connected");const isConnectedToCameras = connectedCameras.length > 0;+ const hasSelectedCameras = selectedCameras.length > 0;- // Detect cameras on initial connection+ // Initial camera detectionuseEffect(() => {- if (isConnected && cameras.length === 0) {- dispatch(detectCameras({filterVirtual: true}));+ if (isConnected && cameras.length === 0) {+ dispatch(detectCameras({ filterVirtual: true }));}}, [isConnected, cameras.length, dispatch]);const handleExpandedItemsChange = (- _event: React.SyntheticEvent,+ event: React.SyntheticEvent,itemIds: string[]): void => {setExpandedItems(itemIds);};- const handlePauseToggle = (): void => {- setIsPaused(!isPaused);- };-- // Build summary content: camera count chips- const summaryChips = (- <Box sx={{display: "flex", gap: 0.5, alignItems: "center"}}>- {connectedCameras.length > 0 && (- <Chip- label={`${connectedCameras.length} connected`}- size="small"- sx={{- height: 18,- fontSize: 10,- fontWeight: 600,- backgroundColor: theme.palette.success.main,- color: theme.palette.getContrastText(theme.palette.success.main),- }}- />- )}- {cameras.length > 0 && connectedCameras.length === 0 && (- <Chip- label={`${cameras.length} detected`}- size="small"- variant="outlined"- sx={{- height: 18,- fontSize: 10,- borderColor: "rgba(255,255,255,0.4)",- color: "inherit",- }}- />- )}- </Box>- );return (- <CollapsibleSidebarSection- icon={<VideocamIcon sx={{color: "inherit"}} />}- title="Cameras"- summaryContent={summaryChips}- primaryControl={- <CameraHeaderActions- isLoading={isLoading}- isPaused={isPaused}- onPauseToggle={handlePauseToggle}- />- }- defaultExpanded={true}+ <Paper+ elevation={3}+ sx={{+ borderRadius: 2,+ overflow: "hidden",+ }}>- {cameras.length === 0 ? (- <Box sx={{p: 3, textAlign: "center"}}>- <Typography variant="body2" color="text.secondary">- No cameras detected- </Typography>- <Typography- variant="caption"- color="text.disabled"- sx={{mt: 1, display: "block"}}- >- Click refresh to scan for available cameras- </Typography>- </Box>- ) : (- <SimpleTreeView- expandedItems={expandedItems}- onExpandedItemsChange={handleExpandedItemsChange}- slots={{- collapseIcon: ExpandMore,- expandIcon: ChevronRight,- }}- >- {/* Connected Cameras Group */}- {isConnectedToCameras && connectedCameras.length > 0 && (- <CameraGroupTreeItem- groupId="cameras-connected"- title="Connected Cameras"- cameras={connectedCameras}- icon={<VideoCameraFrontIcon color="success" />}- expandedItems={expandedItems}+ <SimpleTreeView+ expandedItems={expandedItems}+ onExpandedItemsChange={handleExpandedItemsChange}+ slots={{+ collapseIcon: ExpandMore,+ expandIcon: ChevronRight,+ }}+ >+ <TreeItem+ itemId="cameras-root"+ label={+ <CameraConfigTreeViewHeader+ cameraCount={cameras.length}+ isLoading={isLoading}+ isPaused={isPaused}+ hasSelectedCameras={hasSelectedCameras}/>- )}+ }+ >+ {cameras.length === 0 ? (+ <NoCamerasPlaceholder />+ ) : (+ <>+ {/* Connected Cameras Group */}+ {isConnectedToCameras && connectedCameras.length > 0 && (+ <CameraGroupTreeItem+ groupId="cameras-connected"+ title={t("connectedCameras")}+ cameras={connectedCameras}+ icon={<VideoCameraFrontIcon color="success" />}+ expandedItems={expandedItems}+ />+ )}- {/* Available Cameras Group */}- {availableCameras.length > 0 && (- <CameraGroupTreeItem- groupId="cameras-available"- title="Available Cameras"- cameras={availableCameras}- icon={<VideoCameraFrontIcon color="info" />}- expandedItems={expandedItems}- />+ {/* Available Cameras Group */}+ {availableCameras.length > 0 && (+ <CameraGroupTreeItem+ groupId="cameras-available"+ title={t("availableCameras")}+ cameras={availableCameras}+ icon={<VideoCameraFrontIcon color="info" />}+ expandedItems={expandedItems}+ />+ )}+ </>)}- </SimpleTreeView>- )}- </CollapsibleSidebarSection>+ </TreeItem>+ </SimpleTreeView>+ </Paper>);};diff --git a/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeViewHeader.tsx b/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeViewHeader.tsxindex 4adf61d9..ba08a5fb 100644--- a/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeViewHeader.tsx+++ b/freemocap-ui/src/components/camera-config-tree-view/CameraConfigTreeViewHeader.tsx@@ -2,31 +2,38 @@ import React from "react";import {Box, CircularProgress, IconButton, Stack, Tooltip, Typography, useTheme} from "@mui/material";import VideocamIcon from "@mui/icons-material/Videocam";import VideocamOffIcon from "@mui/icons-material/VideocamOff";+import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";import PauseIcon from "@mui/icons-material/Pause";import PlayArrowIcon from "@mui/icons-material/PlayArrow";import YoutubeSearchedForIcon from "@mui/icons-material/YoutubeSearchedFor";+import DeleteSweepIcon from "@mui/icons-material/DeleteSweep";-import {camerasConnectOrUpdate, closeCameras, pauseUnpauseCameras, useAppDispatch, useAppSelector} from "@/store";+import {useAppDispatch, useAppSelector} from "@/store";import {selectSelectedCameras} from "@/store/slices/cameras/cameras-selectors";-import {detectCameras,} from "@/store/slices/cameras/cameras-thunks";-+import {+ closeCameras,+ camerasConnectOrUpdate,+ detectCameras,+ pauseUnpauseCameras,+} from "@/store/slices/cameras/cameras-thunks";+import {savedSettingsCleared} from "@/store/slices/cameras/cameras-slice";+import {useTranslation} from 'react-i18next';interface CameraConfigTreeViewHeaderProps {cameraCount: number;isLoading: boolean;isPaused: boolean;- onPauseToggle: () => void;hasSelectedCameras: boolean;}export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderProps> = ({- cameraCount,- isLoading,- isPaused,- onPauseToggle,-}) => {+ cameraCount,+ isLoading,+ isPaused,+ }) => {const theme = useTheme();const dispatch = useAppDispatch();+ const {t} = useTranslation();const selectedCameras = useAppSelector(selectSelectedCameras);const hasSelected = selectedCameras.length > 0;@@ -78,7 +85,6 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderPropsetIsActionInProgress(true);try {await dispatch(pauseUnpauseCameras()).unwrap();- onPauseToggle();} catch (error) {console.error('Error pausing/unpausing cameras:', error);} finally {@@ -86,6 +92,11 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderProp}};+ const handleClearSavedSettings = (e: React.MouseEvent): void => {+ e.stopPropagation();+ dispatch(savedSettingsCleared());+ };+const handleHeaderClick = (e: React.MouseEvent): void => {e.stopPropagation();};@@ -97,18 +108,18 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderPropdisplay: "flex",alignItems: "center",py: 1,- backgroundColor: theme.palette.primary.main,+ backgroundColor: theme.palette.primary.dark,color: theme.palette.primary.contrastText,}}>- <VideocamIcon sx={{ml: 2, mr: 1}} />+ <VideocamIcon sx={{ml: 2, mr: 1}}/><Typography variant="h6" sx={{flexGrow: 1}}>- Cameras ({cameraCount})+ {t('camerasCount', {count: cameraCount})}</Typography><Stack direction="row" spacing={1} sx={{mr: 2}}>- {/* Connect/Apply Button */}- <Tooltip title={"Connect to selected cameras or update connected cameras"}>+ {/* Connect/Apply Button - Always visible, changes icon and behavior */}+ <Tooltip title={t("connectCameras")}><span><IconButtonsize="small"@@ -116,22 +127,34 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderPropsx={{color: "inherit"}}>- <VideocamIcon- sx={{- color: theme.palette.secondary.main,- border: `2px solid ${theme.palette.secondary.main}`,- borderRadius: '4px',- padding: '2px',- scale: '1.6'- }}- />-+ <Box sx={{position: 'relative', display: 'inline-flex', width: 24, height: 24}}>+ <VideocamIcon+ sx={{+ color: theme.palette.secondary.main,+ fontSize: 24,+ }}+ />+ <ArrowDownwardIcon+ sx={{+ position: 'absolute',+ top: -4,+ left: '50%',+ transform: 'translateX(-50%)',+ fontSize: 10,+ color: theme.palette.secondary.main,+ strokeWidth: 2,+ stroke: theme.palette.secondary.main,+ }}+ />+ </Box>++</IconButton></span></Tooltip>{/* Pause/Play Button - Always visible, disabled when not connected */}- <Tooltip title={isPaused ? "Resume streaming" : "Pause streaming"}>+ <Tooltip title={isPaused ? t("resumeStreaming") : t("pauseStreaming")}><span><IconButtonsize="small"@@ -140,13 +163,13 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderPropcolor: "inherit",}}>- {isPaused ? <PlayArrowIcon /> : <PauseIcon />}+ {isPaused ? <PlayArrowIcon/> : <PauseIcon/>}</IconButton></span></Tooltip>{/* Close Button - Always visible, disabled when not connected */}- <Tooltip title={"Close all cameras"}>+ <Tooltip title={t("closeAllCameras")}><span><IconButtonsize="small"@@ -155,13 +178,13 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderPropcolor: "inherit",}}>- <VideocamOffIcon />+ <VideocamOffIcon/></IconButton></span></Tooltip>{/* Refresh/Detect Button - Always visible */}- <Tooltip title="Detect available cameras">+ <Tooltip title={t("detectCameras")}><span><IconButtonsize="small"@@ -169,13 +192,26 @@ export const CameraConfigTreeViewHeader: React.FC<CameraConfigTreeViewHeaderPropsx={{color: "inherit"}}>{isLoading || isActionInProgress ? (- <CircularProgress size={20} sx={{color: "inherit"}} />+ <CircularProgress size={20} sx={{color: "inherit"}}/>) : (- <YoutubeSearchedForIcon />+ <YoutubeSearchedForIcon/>)}</IconButton></span></Tooltip>++ {/* Clear Saved Settings Button */}+ <Tooltip title={t("clearCameraSettings")}>+ <span>+ <IconButton+ size="small"+ onClick={handleClearSavedSettings}+ sx={{color: "inherit"}}+ >+ <DeleteSweepIcon/>+ </IconButton>+ </span>+ </Tooltip></Stack></Box>);diff --git a/freemocap-ui/src/components/camera-config-tree-view/CameraGroupTreeItem.tsx b/freemocap-ui/src/components/camera-config-tree-view/CameraGroupTreeItem.tsxindex fc5e7767..e65fc001 100644--- a/freemocap-ui/src/components/camera-config-tree-view/CameraGroupTreeItem.tsx+++ b/freemocap-ui/src/components/camera-config-tree-view/CameraGroupTreeItem.tsx@@ -1,8 +1,8 @@import React from "react";-import {Box, Typography} from "@mui/material";-import {TreeItem} from "@mui/x-tree-view/TreeItem";-import {CameraTreeItem} from "./CameraTreeItem";-import {Camera} from "@/store/slices/cameras/cameras-types";+import { Box, Typography } from "@mui/material";+import { TreeItem } from "@mui/x-tree-view/TreeItem";+import { CameraTreeItem } from "./CameraTreeItem";+import { Camera } from "@/store/slices/cameras/cameras-types";interface CameraGroupTreeItemProps {groupId: string;diff --git a/freemocap-ui/src/components/camera-config-tree-view/CameraHeaderActions.tsx b/freemocap-ui/src/components/camera-config-tree-view/CameraHeaderActions.tsxdeleted file mode 100644index 0cfc4016..00000000--- a/freemocap-ui/src/components/camera-config-tree-view/CameraHeaderActions.tsx+++ /dev/null@@ -1,154 +0,0 @@-import React, {useState} from "react";-import {CircularProgress, IconButton, Stack, Tooltip} from "@mui/material";-import VideocamIcon from "@mui/icons-material/Videocam";-import VideocamOffIcon from "@mui/icons-material/VideocamOff";-import PauseIcon from "@mui/icons-material/Pause";-import PlayArrowIcon from "@mui/icons-material/PlayArrow";-import YoutubeSearchedForIcon from "@mui/icons-material/YoutubeSearchedFor";-import {- camerasConnectOrUpdate,- closeCameras,- pauseUnpauseCameras,- useAppDispatch,- useAppSelector,-} from "@/store";-import {selectSelectedCameras} from "@/store/slices/cameras/cameras-selectors";-import {detectCameras} from "@/store/slices/cameras/cameras-thunks";--interface CameraHeaderActionsProps {- isLoading: boolean;- isPaused: boolean;- onPauseToggle: () => void;-}--export const CameraHeaderActions: React.FC<CameraHeaderActionsProps> = ({- isLoading,- isPaused,- onPauseToggle,-}) => {- const dispatch = useAppDispatch();- const selectedCameras = useAppSelector(selectSelectedCameras);- const hasSelected = selectedCameras.length > 0;- const [isActionInProgress, setIsActionInProgress] = useState(false);-- const handleRefreshCameras = async (e: React.MouseEvent): Promise<void> => {- e.stopPropagation();- setIsActionInProgress(true);- try {- await dispatch(detectCameras({filterVirtual: true})).unwrap();- } catch (error) {- console.error("Error detecting cameras:", error);- } finally {- setIsActionInProgress(false);- }- };-- const handleConnectOrApply = async (e: React.MouseEvent): Promise<void> => {- e.stopPropagation();- setIsActionInProgress(true);- try {- await dispatch(camerasConnectOrUpdate()).unwrap();- } catch (error) {- console.error("Error with camera operation:", error);- } finally {- setIsActionInProgress(false);- }- };-- const handleCloseCameras = async (e: React.MouseEvent): Promise<void> => {- e.stopPropagation();- setIsActionInProgress(true);- try {- await dispatch(closeCameras()).unwrap();- } catch (error) {- console.error("Error closing cameras:", error);- } finally {- setIsActionInProgress(false);- }- };-- const handlePauseUnpause = async (e: React.MouseEvent): Promise<void> => {- e.stopPropagation();- setIsActionInProgress(true);- try {- await dispatch(pauseUnpauseCameras()).unwrap();- onPauseToggle();- } catch (error) {- console.error("Error pausing/unpausing cameras:", error);- } finally {- setIsActionInProgress(false);- }- };-- const iconButtonSx = {- color: "inherit",- "&:hover": {- backgroundColor: "rgba(255,255,255,0.1)",- },- };-- return (- <Stack direction="row" spacing={0.5}>- {/* Connect/Apply */}- <Tooltip title="Connect selected cameras or apply config updates">- <span>- <IconButton- size="small"- onClick={handleConnectOrApply}- disabled={!hasSelected}- sx={iconButtonSx}- >- <VideocamIcon fontSize="small" />- </IconButton>- </span>- </Tooltip>-- {/* Pause/Resume */}- <Tooltip title={isPaused ? "Resume streaming" : "Pause streaming"}>- <span>- <IconButton- size="small"- onClick={handlePauseUnpause}- sx={iconButtonSx}- >- {isPaused ? (- <PlayArrowIcon fontSize="small" />- ) : (- <PauseIcon fontSize="small" />- )}- </IconButton>- </span>- </Tooltip>-- {/* Close All */}- <Tooltip title="Close all cameras">- <span>- <IconButton- size="small"- onClick={handleCloseCameras}- sx={iconButtonSx}- >- <VideocamOffIcon fontSize="small" />- </IconButton>- </span>- </Tooltip>-- {/* Detect/Refresh */}- <Tooltip title="Detect available cameras">- <span>- <IconButton- size="small"- onClick={handleRefreshCameras}- sx={iconButtonSx}- >- {isLoading || isActionInProgress ? (- <CircularProgress size={18} sx={{color: "inherit"}} />- ) : (- <YoutubeSearchedForIcon fontSize="small" />- )}- </IconButton>- </span>- </Tooltip>- </Stack>- );-};diff --git a/freemocap-ui/src/components/camera-config-tree-view/CameraTreeItem.tsx b/freemocap-ui/src/components/camera-config-tree-view/CameraTreeItem.tsxindex c4ba8949..2cd2c7a5 100644--- a/freemocap-ui/src/components/camera-config-tree-view/CameraTreeItem.tsx+++ b/freemocap-ui/src/components/camera-config-tree-view/CameraTreeItem.tsx@@ -5,6 +5,7 @@ import CheckCircleIcon from "@mui/icons-material/CheckCircle";import RadioButtonUncheckedIcon from "@mui/icons-material/RadioButtonUnchecked";import VideocamIcon from "@mui/icons-material/Videocam";import SettingsIcon from "@mui/icons-material/Settings";+import {useTranslation} from "react-i18next";import {CameraConfigTreeSection} from "./CameraConfigTreeSection";import {ROTATION_DEGREE_LABELS, RotationValue, useAppDispatch} from "@/store";@@ -55,6 +56,13 @@ const getConfigSummary = (config: any): string[] => {export const CameraTreeItem: React.FC<CameraTreeItemProps> = ({camera, isExpanded = false}) => {const dispatch = useAppDispatch();const theme = useTheme();+ const { t } = useTranslation();++ const statusLabelMap: Record<string, string> = {+ connected: t('connected'),+ available: t('available'),+ error: t('errorsDetected'),+ };const handleToggleSelection = (e: React.MouseEvent): void => {e.stopPropagation();@@ -182,7 +190,7 @@ export const CameraTreeItem: React.FC<CameraTreeItemProps> = ({camera, isExpande{/* Status chip */}<Chip- label={camera.connectionStatus.toUpperCase()}+ label={statusLabelMap[camera.connectionStatus] ?? camera.connectionStatus.toUpperCase()}size="small"sx={{ml: 1,diff --git a/freemocap-ui/src/components/camera-config-tree-view/NoCamerasPlaceholder.tsx b/freemocap-ui/src/components/camera-config-tree-view/NoCamerasPlaceholder.tsxindex 901538bc..0aa16d01 100644--- a/freemocap-ui/src/components/camera-config-tree-view/NoCamerasPlaceholder.tsx+++ b/freemocap-ui/src/components/camera-config-tree-view/NoCamerasPlaceholder.tsx@@ -1,8 +1,10 @@import React from "react";-import {Box, Typography} from "@mui/material";-import {TreeItem} from "@mui/x-tree-view/TreeItem";+import { Box, Typography } from "@mui/material";+import { TreeItem } from "@mui/x-tree-view/TreeItem";+import { useTranslation } from "react-i18next";export const NoCamerasPlaceholder: React.FC = () => {+ const { t } = useTranslation();return (<TreeItemitemId="no-cameras"@@ -15,14 +17,14 @@ export const NoCamerasPlaceholder: React.FC = () => {}}><Typography variant="body1" color="text.secondary">- No cameras detected+ {t('noCamerasDetected')}</Typography><Typographyvariant="caption"color="text.disabled"sx={{ mt: 1, display: "block" }}>- Click refresh to scan for available cameras+ {t('clickRefreshToScan')}</Typography></Box>}diff --git a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigExposure.tsx b/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigExposure.tsxdeleted file mode 100644index fb1bd382..00000000--- a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigExposure.tsx+++ /dev/null@@ -1,138 +0,0 @@-import React from 'react';-import {Box, Slider, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useTheme} from '@mui/material';-import {ExposureMode} from "@/store/slices/cameras/cameras-types";--interface CameraConfigExposureProps {- exposureMode: ExposureMode;- exposure: number;- onExposureModeChange: (mode: ExposureMode) => void;- onExposureValueChange: (value: number) => void;-}--const ValueLabelComponent = (props: {- children: React.ReactElement;- value: number;-}) => {- const { children, value } = props;-- return (- <Tooltip title={- <span>- {`${(1000 / Math.pow(2, -1 * value)).toFixed(3)}ms (1/2`}- <sup>{value}</sup>- {` sec)`}- </span>- }>- {children}- </Tooltip>- );-};--// Default constraints for exposure-const EXPOSURE_CONSTRAINTS = {- min: -13,- max: -4,- default: -7-};--export const CameraConfigExposure: React.FC<CameraConfigExposureProps> = ({- exposureMode = 'MANUAL',- exposure = EXPOSURE_CONSTRAINTS.default,- onExposureModeChange,- onExposureValueChange- }) => {- const theme = useTheme();-- const handleModeChange = (- event: React.MouseEvent<HTMLElement>,- newMode: string | null,- ): void => {- if (newMode !== null) {- onExposureModeChange(newMode as ExposureMode);- }- };-- const handleSliderChange = (event: Event, value: number | number[]): void => {- onExposureValueChange(value as number);- };-- const baseMarks = [- { value: EXPOSURE_CONSTRAINTS.min, label: String(EXPOSURE_CONSTRAINTS.min) },- {- value: EXPOSURE_CONSTRAINTS.default,- label: `${EXPOSURE_CONSTRAINTS.default} (default)`- },- { value: EXPOSURE_CONSTRAINTS.max, label: String(EXPOSURE_CONSTRAINTS.max) }- ];-- const marks = [- ...baseMarks,- ...(![- EXPOSURE_CONSTRAINTS.min as number,- EXPOSURE_CONSTRAINTS.default as number,- EXPOSURE_CONSTRAINTS.max as number- ].includes(exposure)- ? [{- value: exposure,- label: `${exposure}`,- }]- : []- )- ].sort((a, b) => a.value - b.value);-- return (- <Box>- <Typography variant="body2" color="text.secondary" gutterBottom>- Camera Exposure- </Typography>- <Tooltip title="Choose between automatic or manual exposure control">- <ToggleButtonGroup- color={theme.palette.primary.main as any}- value={exposureMode}- exclusive- onChange={handleModeChange}- size="small"- sx={{- '& .MuiToggleButton-root.Mui-selected': {- backgroundColor: theme.palette.primary.main,- border: `1px solid ${theme.palette.text.secondary}`,- color: theme.palette.primary.contrastText,- '&:hover': {- backgroundColor: theme.palette.primary.light,- },- }- }}- >- <ToggleButton value="MANUAL">Manual</ToggleButton>- <ToggleButton value="AUTO">Auto</ToggleButton>- <ToggleButton value="RECOMMEND">Recommend</ToggleButton>- </ToggleButtonGroup>- </Tooltip>- <Tooltip title="Adjust exposure time, e.g. cv2.VideoCapture.set(cv2.CAP_PROP_EXPOSURE, value)">- <Box sx={{ flexGrow: 1 }}>- <Slider- value={exposure}- disabled={exposureMode === 'AUTO' || exposureMode === 'RECOMMEND'}- min={EXPOSURE_CONSTRAINTS.min}- max={EXPOSURE_CONSTRAINTS.max}- step={1}- marks={marks}- valueLabelDisplay="auto"- onChange={handleSliderChange}- components={{- ValueLabel: ValueLabelComponent- }}- sx={{- color: theme.palette.primary.light,- '& .MuiSlider-thumb': {- '&:hover, &.Mui-focusVisible': {- boxShadow: `0px 0px 0px 8px ${theme.palette.primary.light}33`,- },- },- }}- />- </Box>- </Tooltip>- </Box>- );-};diff --git a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigPanel.tsx b/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigPanel.tsxdeleted file mode 100644index 312d2d75..00000000--- a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigPanel.tsx+++ /dev/null@@ -1,142 +0,0 @@-import React from "react";-import {Box, Collapse, IconButton, Tooltip, useTheme,} from "@mui/material";-import Grid from "@mui/material/Grid2";-import MediationIcon from "@mui/icons-material/Mediation";-import {CameraConfigResolution} from "./CameraConfigResolution";-import {CameraConfigExposure} from "./CameraConfigExposure";-import {CameraConfigRotation} from "./CameraConfigRotation";-import {CameraConfig, ExposureMode} from "@/store/slices/cameras/cameras-types";-import {useAppDispatch, useAppSelector} from "@/store";-import {configCopiedToAll, selectCameras} from "@/store/slices/cameras";--interface CameraConfigPanelProps {- config: CameraConfig;- onConfigChange: (newConfig: CameraConfig) => void;- isExpanded: boolean;-}--export const CameraConfigPanel: React.FC<CameraConfigPanelProps> = ({- config,- onConfigChange,- isExpanded,- }) => {- const theme = useTheme();- const dispatch = useAppDispatch();-- // Get total camera count for UI feedback- const allCameras = useAppSelector(selectCameras);- const otherCamerasCount = allCameras.length - 1;-- const handleChange = <K extends keyof CameraConfig>(- key: K,- value: CameraConfig[K]- ): void => {- onConfigChange({- ...config,- [key]: value,- });- };-- const handleCopyToAllCameras = (): void => {- dispatch(configCopiedToAll(config.camera_id));- };-- const handleResolutionChange = (width: number, height: number): void => {- handleChange("resolution", { width, height });- };-- const handleRotationChange = (value: string): void => {- handleChange("rotation", value as CameraConfig['rotation']);- };-- const handleExposureModeChange = (mode: ExposureMode): void => {- handleChange("exposure_mode", mode);- };-- const handleExposureValueChange = (value: number): void => {- handleChange("exposure", value);- };-- return (- <Collapse in={isExpanded} timeout="auto" unmountOnExit>- <Box- sx={{- p: 1.5,- ml: 7,- mr: 2,- mb: 1,- borderRadius: 1,- border: `1px solid ${theme.palette.divider}`,- backgroundColor: theme.palette.background.paper,- }}- >- <Grid container spacing={2}>- {/* Top row with Resolution and Rotation */}- <Grid size={{ xs: 12, md: 5 }}>- <CameraConfigResolution- resolution={config.resolution}- onChange={handleResolutionChange}- />- </Grid>-- <Grid size={{ xs: 12, md: 5 }}>- <CameraConfigRotation- rotation={config.rotation}- onChange={handleRotationChange}- />- </Grid>-- <Grid- size={{ xs: 12, md: 2 }}- sx={{- display: "flex",- alignItems: "center",- justifyContent: "center",- }}- >- <Tooltip- title={- otherCamerasCount > 0- ? `Copy settings to ${otherCamerasCount} other camera${- otherCamerasCount > 1 ? "s" : ""- }`- : "No other cameras to copy to"- }- >- <span>- <IconButton- size="small"- onClick={handleCopyToAllCameras}- disabled={otherCamerasCount === 0}- aria-label="Copy settings to all cameras"- sx={{- color: theme.palette.primary.main,- "&:hover": {- backgroundColor: theme.palette.primary.light,- color: theme.palette.primary.contrastText,- },- "&:disabled": {- color: theme.palette.action.disabled,- },- }}- >- <MediationIcon />- </IconButton>- </span>- </Tooltip>- </Grid>-- {/* Bottom row with Exposure controls */}- <Grid size={12}>- <CameraConfigExposure- exposureMode={config.exposure_mode}- exposure={config.exposure}- onExposureModeChange={handleExposureModeChange}- onExposureValueChange={handleExposureValueChange}- />- </Grid>- </Grid>- </Box>- </Collapse>- );-};diff --git a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigResolution.tsx b/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigResolution.tsxdeleted file mode 100644index ae59d11b..00000000--- a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigResolution.tsx+++ /dev/null@@ -1,36 +0,0 @@-import React from "react";-import {FormControl, InputLabel, MenuItem, Select, useTheme} from "@mui/material";-import {CameraConfig} from "@/store/slices/cameras/cameras-types";--interface CameraConfigResolutionProps {- resolution: CameraConfig['resolution'];- onChange: (width: number, height: number) => void;-}--export const CameraConfigResolution: React.FC<CameraConfigResolutionProps> = ({- resolution,- onChange- }) => {- const theme = useTheme();-- const handleChange = (event: any): void => {- const [width, height] = event.target.value.split('x').map(Number);- onChange(width, height);- };-- return (- <FormControl size="small" sx={{ flex: 1, color: theme.palette.text.primary }}>- <InputLabel sx={{ color: theme.palette.text.primary }}>Resolution</InputLabel>- <Select- value={`${resolution.width}x${resolution.height}`}- label="Resolution"- onChange={handleChange}- sx={{ color: theme.palette.text.primary }}- >- <MenuItem value="640x480">640 x 480</MenuItem>- <MenuItem value="1280x720">1280 x 720</MenuItem>- <MenuItem value="1920x1080">1920 x 1080</MenuItem>- </Select>- </FormControl>- );-};diff --git a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigRotation.tsx b/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigRotation.tsxdeleted file mode 100644index eabca928..00000000--- a/freemocap-ui/src/components/camera-config-tree-view/camera-config-panel/CameraConfigRotation.tsx+++ /dev/null@@ -1,59 +0,0 @@-import React from 'react';-import ToggleButton from '@mui/material/ToggleButton';-import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';-import {Box, Tooltip, useTheme} from '@mui/material';-import {ROTATION_DEGREE_LABELS, ROTATION_OPTIONS, RotationValue} from '@/store/slices/cameras/cameras-types';--interface CameraConfigRotationProps {- rotation?: RotationValue;- onChange: (rotation: RotationValue) => void;-}----export const CameraConfigRotation: React.FC<CameraConfigRotationProps> = ({- rotation = -1,- onChange- }) => {- const theme = useTheme();-- const handleChange = (- event: React.MouseEvent<HTMLElement>,- newRotation: RotationValue | null,- ): void => {- if (newRotation !== null) {- onChange(newRotation);- }- };-- return (- <Box>- <Tooltip title="Select camera image rotation">- <ToggleButtonGroup- color={theme.palette.primary.main as any}- value={rotation}- size="small"- exclusive- onChange={handleChange}- aria-label="camera rotation"- sx={{- '& .MuiToggleButton-root.Mui-selected': {- backgroundColor: theme.palette.primary.main,- color: theme.palette.primary.contrastText,- border: `1px solid ${theme.palette.text.secondary}`,- '&:hover': {- backgroundColor: theme.palette.primary.light,- },- }- }}- >- {ROTATION_OPTIONS.map((option: RotationValue) => (- <ToggleButton key={option} value={option}>- {ROTATION_DEGREE_LABELS[option]}- </ToggleButton>- ))}- </ToggleButtonGroup>- </Tooltip>- </Box>- );-};diff --git a/freemocap-ui/src/components/camera-views/CameraView.tsx b/freemocap-ui/src/components/camera-views/CameraView.tsxindex a506e5ab..14cc8f6b 100644--- a/freemocap-ui/src/components/camera-views/CameraView.tsx+++ b/freemocap-ui/src/components/camera-views/CameraView.tsx@@ -1,6 +1,6 @@-import React, {memo, useEffect, useRef} from 'react';--import {useServer} from "@/hooks/useServer";+import React, { useEffect, useRef, useMemo, memo } from 'react';+import { useServer } from '@/services/server/ServerContextProvider';+import { frontendColor, backendColor } from '@/components/framerate-viewer/FrameRateViewer';interface CameraViewProps {cameraId: string;@@ -8,69 +8,59 @@ interface CameraViewProps {maxWidth?: boolean;}+/** How often (ms) to update the FPS display text. 4Hz is plenty for a number readout. */+const FPS_UPDATE_INTERVAL_MS = 250;+/*** CameraView component - renders a canvas for a single camera feed.- * The overlay is now composited directly into the frame before rendering.+ * Wrapped in memo to prevent re-renders when props haven't changed.+ * FPS display uses direct DOM manipulation via a low-frequency setInterval+ * instead of a per-component requestAnimationFrame loop.*/export const CameraView: React.FC<CameraViewProps> = memo(({ cameraId, scale, maxWidth }) => {const canvasRef = useRef<HTMLCanvasElement>(null);- const fpsDisplayRef = useRef<HTMLSpanElement>(null);+ const displayFpsRef = useRef<HTMLSpanElement>(null);+ const serverFpsRef = useRef<HTMLSpanElement>(null);+ const { setCanvasForCamera, getFps, getServerFps } = useServer();- const { setCanvasForCamera, getFps } = useServer();- const animationFrameRef = useRef<number | null>(null);-- // Set up canvasuseEffect(() => {const canvas = canvasRef.current;+if (canvas && cameraId) {- console.log(`Setting up canvas for camera: ${cameraId}`);setCanvasForCamera(cameraId, canvas);}}, [cameraId, setCanvasForCamera]);- // Update FPS display using direct DOM manipulation to avoid React re-renders+ // Update FPS displays at a low frequency via setIntervaluseEffect(() => {- const updateFps = (): void => {- const fps = getFps(cameraId);- if (fpsDisplayRef.current && fps !== null) {- fpsDisplayRef.current.textContent = `Display FPS ${fps.toFixed(1)}`;+ const updateFps = () => {+ const displayFps = getFps(cameraId);+ if (displayFpsRef.current) {+ displayFpsRef.current.textContent = displayFps !== null+ ? `${displayFps.toFixed(1)}`+ : '--';}- animationFrameRef.current = requestAnimationFrame(updateFps);- };-- animationFrameRef.current = requestAnimationFrame(updateFps);-- return () => {- if (animationFrameRef.current !== null) {- cancelAnimationFrame(animationFrameRef.current);+ const srvFps = getServerFps();+ if (serverFpsRef.current) {+ serverFpsRef.current.textContent = srvFps !== null+ ? `${srvFps.toFixed(1)}`+ : '--';}};- }, [cameraId, getFps]);- // Calculate canvas styles based on scale and maxWidth settings- const getCanvasStyle = (): React.CSSProperties => {- const baseStyle: React.CSSProperties = {- width: '100%',- height: '100%',- objectFit: 'contain',- };+ const intervalId = setInterval(updateFps, FPS_UPDATE_INTERVAL_MS);+ return () => clearInterval(intervalId);+ }, [cameraId, getFps, getServerFps]);+ const canvasStyle = useMemo((): React.CSSProperties => {if (maxWidth) {- return baseStyle;+ return { width: '100%', height: '100%', objectFit: 'contain' };}-if (scale !== undefined && scale !== 1.0) {- return {- ...baseStyle,- width: `${scale * 100}%`,- height: `${scale * 100}%`,- };+ return { width: `${scale * 100}%`, height: `${scale * 100}%`, objectFit: 'contain' };}-- return baseStyle;- };-- const canvasStyle = getCanvasStyle();+ return { width: '100%', height: '100%', objectFit: 'contain' };+ }, [scale, maxWidth]);return (<div@@ -83,44 +73,44 @@ export const CameraView: React.FC<CameraViewProps> = memo(({ cameraId, scale, majustifyContent: 'center',backgroundColor: '#000',position: 'relative',- overflow: 'hidden',+ overflow: 'hidden'}}>- {/* Single canvas with composited image + overlay */}<canvasref={canvasRef}style={canvasStyle}/>-- {/* Info display */}<divstyle={{position: 'absolute',bottom: 8,left: 8,- backgroundColor: 'rgba(0, 0, 0, 0.7)',+ backgroundColor: 'rgba(0, 0, 0, 0.75)',color: '#fff',padding: '4px 8px',borderRadius: 4,fontSize: '12px',fontFamily: 'monospace',- pointerEvents: 'none',+ lineHeight: 1.4,}}><div>{cameraId}</div>- <div style={{ fontSize: '10px', marginTop: '2px', color: '#0f0' }}>- <span ref={fpsDisplayRef}>-- FPS</span>+ <div style={{ fontSize: '10px', marginTop: '2px', display: 'flex', gap: '6px' }}>+ <span style={{ color: frontendColor }}>+ D:<span ref={displayFpsRef}>--</span>+ </span>+ <span style={{ color: backendColor }}>+ S:<span ref={serverFpsRef}>--</span>+ </span>+ <span style={{ color: '#aaa' }}>fps</span></div></div></div>);}, (prevProps, nextProps) => {- // Custom comparison: only re-render if relevant props change- return (- prevProps.cameraId === nextProps.cameraId &&+ return prevProps.cameraId === nextProps.cameraId &&prevProps.scale === nextProps.scale &&- prevProps.maxWidth === nextProps.maxWidth- );+ prevProps.maxWidth === nextProps.maxWidth;});CameraView.displayName = 'CameraView';diff --git a/freemocap-ui/src/components/camera-views/CameraViewsGrid.tsx b/freemocap-ui/src/components/camera-views/CameraViewsGrid.tsxindex b134b423..8e9043ba 100644--- a/freemocap-ui/src/components/camera-views/CameraViewsGrid.tsx+++ b/freemocap-ui/src/components/camera-views/CameraViewsGrid.tsx@@ -1,131 +1,313 @@-import React from "react";-import {Box} from "@mui/material";-import {Panel, PanelGroup, PanelResizeHandle} from "react-resizable-panels";-import {useTheme} from "@mui/material/styles";-import {CameraView} from "./CameraView";-import {useServer} from "@/hooks/useServer";-import {CameraSettings} from "@/pages/CamerasPage";+import React, { useState, useCallback, useRef, useEffect, useMemo } from "react";+import { Box, keyframes } from "@mui/material";+import ReactGridLayout, { noCompactor } from "react-grid-layout";+import type { Layout, LayoutItem } from "react-grid-layout";+import "react-grid-layout/css/styles.css";+import "react-resizable/css/styles.css";+import { CameraView } from "./CameraView";+import { useServer } from "@/services/server/ServerContextProvider";+import { useTranslation } from "react-i18next";+import { useAppSelector } from "@/store/hooks";+import { selectConnectedCameras } from "@/store/slices/cameras/cameras-selectors";++const recordingBorderPulse = keyframes`+ 0% { border-color: #ff2020; box-shadow: 0 0 4px rgba(255, 32, 32, 0.4); }+ 50% { border-color: #aa1010; box-shadow: 0 0 8px rgba(255, 32, 32, 0.15); }+ 100% { border-color: #ff2020; box-shadow: 0 0 4px rgba(255, 32, 32, 0.4); }+`;++/** Number of abstract grid columns. More columns = finer positioning granularity. */+const GRID_COLS = 12;+const MARGIN: [number, number] = [4, 4];++interface Tiling {+ cols: number;+ rows: number;+}++/**+ * Try every possible column count for N cameras within the given container+ * dimensions and return the one that maximizes total pixel area used.+ */+function computeOptimalTiling(+ n: number,+ containerWidth: number,+ containerHeight: number,+): Tiling {+ if (n === 0) return { cols: 1, rows: 1 };+ if (n === 1) return { cols: 1, rows: 1 };++ let bestCols = 1;+ let bestArea = 0;++ for (let cols = 1; cols <= n; cols++) {+ const rows = Math.ceil(n / cols);+ const cellW = (containerWidth - MARGIN[0] * (cols - 1)) / cols;+ const cellH = (containerHeight - MARGIN[1] * (rows - 1)) / rows;++ if (cellW < 80 || cellH < 60) continue;++ const totalArea = n * cellW * cellH;+ if (totalArea > bestArea) {+ bestArea = totalArea;+ bestCols = cols;+ }+ }++ return { cols: bestCols, rows: Math.ceil(n / bestCols) };+}++/**+ * Build a tiling from a manual column count.+ */+function tilingFromColumns(n: number, cols: number): Tiling {+ if (n === 0) return { cols: 1, rows: 1 };+ const clamped = Math.max(1, Math.min(cols, n));+ return { cols: clamped, rows: Math.ceil(n / clamped) };+}++/**+ * Build a react-grid-layout layout from a tiling.+ */+function buildLayout(cameraIds: string[], tiling: Tiling): LayoutItem[] {+ const n = cameraIds.length;+ if (n === 0) return [];++ const colSpan = Math.floor(GRID_COLS / tiling.cols);++ return cameraIds.map((id, i) => ({+ i: id,+ x: (i % tiling.cols) * colSpan,+ y: Math.floor(i / tiling.cols),+ w: colSpan,+ h: 1,+ minW: 1,+ minH: 1,+ }));+}interface CameraViewsGridProps {- settings: CameraSettings;+ /** null = auto-optimize, number = manual column count */+ manualColumns: number | null;+ /** Increment to force a layout reset */resetKey: number;}-export const CameraViewsGrid: React.FC<CameraViewsGridProps> = ({settings, resetKey}) => {- const theme = useTheme();- const {connectedCameraIds} = useServer();+export const CameraViewsGrid: React.FC<CameraViewsGridProps> = ({ manualColumns, resetKey }) => {+ const { connectedCameraIds } = useServer();+ const { t } = useTranslation();+ const isRecording = useAppSelector(state => state.recording.isRecording);+ const containerRef = useRef<HTMLDivElement>(null);+ const [containerWidth, setContainerWidth] = useState<number>(800);+ const [containerHeight, setContainerHeight] = useState<number>(600);- const getColumns = (total: number): number => {- if (settings.columns !== null && settings.columns !== undefined) {- return settings.columns;+ // Measure the container's parent to avoid feedback loops+ useEffect(() => {+ const el = containerRef.current?.parentElement;+ if (!el) return;++ const measure = () => {+ const rect = el.getBoundingClientRect();+ setContainerWidth(rect.width);+ setContainerHeight(rect.height);+ };++ measure();+ const observer = new ResizeObserver(() => measure());+ observer.observe(el);+ return () => observer.disconnect();+ }, []);++ // Watch camera configs for rotation/resolution changes+ const connectedCameras = useAppSelector(selectConnectedCameras);+ const configFingerprint = useMemo(() => {+ return connectedCameras+ .map((cam) => {+ const cfg = cam.actualConfig;+ return `${cam.id}:${cfg.rotation}:${cfg.resolution.width}x${cfg.resolution.height}`;+ })+ .join("|");+ }, [connectedCameras]);++ // Compute tiling: manual column count overrides auto-optimal.+ // Stabilized with a ref to prevent flip-flop.+ const prevTilingRef = useRef<Tiling>({ cols: 1, rows: 1 });+ const tiling = useMemo(() => {+ const candidate = manualColumns !== null+ ? tilingFromColumns(connectedCameraIds.length, manualColumns)+ : computeOptimalTiling(connectedCameraIds.length, containerWidth, containerHeight);+ const prev = prevTilingRef.current;+ if (candidate.cols === prev.cols && candidate.rows === prev.rows) {+ return prev;}+ prevTilingRef.current = candidate;+ return candidate;+ }, [connectedCameraIds.length, containerWidth, containerHeight, manualColumns]);++ const [layout, setLayout] = useState<LayoutItem[]>(() =>+ buildLayout(connectedCameraIds, tiling),+ );++ // Re-tile when cameras, tiling, config, or reset changes+ useEffect(() => {+ setLayout(buildLayout(connectedCameraIds, tiling));+ }, [connectedCameraIds, tiling, resetKey, configFingerprint]);++ // Snapshot layout before drag for swap detection+ const layoutBeforeDragRef = useRef<LayoutItem[]>(layout);++ const handleDragStart = useCallback(() => {+ layoutBeforeDragRef.current = layout;+ }, [layout]);++ const handleDragStop = useCallback((_newLayout: Layout, _oldItem: LayoutItem | null, newItem: LayoutItem | null) => {+ if (!newItem) return;+ const preDrag = layoutBeforeDragRef.current;+ const draggedBefore = preDrag.find((l) => l.i === newItem.i);+ if (!draggedBefore) return;- if (total <= 1) return 1;- if (total <= 4) return 2;- if (total <= 9) return 3;- return 4;- };+ // Check if we landed on another item+ const swapTarget = preDrag.find((l) => {+ if (l.i === newItem.i) return false;+ const overlapX = newItem.x < l.x + l.w && newItem.x + newItem.w > l.x;+ const overlapY = newItem.y < l.y + l.h && newItem.y + newItem.h > l.y;+ return overlapX && overlapY;+ });++ if (swapTarget) {+ const swapped = preDrag.map((l) => {+ if (l.i === newItem.i) {+ return { ...l, x: swapTarget.x, y: swapTarget.y };+ }+ if (l.i === swapTarget.i) {+ return { ...l, x: draggedBefore.x, y: draggedBefore.y };+ }+ return l;+ });+ setLayout(swapped);+ } else {+ // Dropped in empty space — clamp to grid bounds+ const maxX = GRID_COLS - newItem.w;+ const maxY = tiling.rows - newItem.h;+ const updated = preDrag.map((l) => {+ if (l.i === newItem.i) {+ return {+ ...l,+ x: Math.max(0, Math.min(newItem.x, maxX)),+ y: Math.max(0, Math.min(newItem.y, maxY)),+ };+ }+ return l;+ });+ setLayout(updated);+ }+ }, [tiling.rows]);++ const handleLayoutChange = useCallback((_newLayout: Layout) => {}, []);++ const handleResizeStop = useCallback((newLayout: Layout) => {+ setLayout([...newLayout]);+ }, []);++ const rowHeight = useMemo(() => {+ const totalMargin = (tiling.rows - 1) * MARGIN[1];+ return Math.max(30, (containerHeight - totalMargin) / tiling.rows);+ }, [containerHeight, tiling.rows]);if (connectedCameraIds.length === 0) {return (- <Box sx={{- height: '100%',- width: '100%',- display: 'flex',- alignItems: 'center',- justifyContent: 'center',- color: 'text.secondary',- fontSize: '1.2rem',- padding: 4,- textAlign: 'center',- }}>+ <Box+ ref={containerRef}+ sx={{+ height: "100%",+ width: "100%",+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ color: "text.secondary",+ fontSize: "1.2rem",+ padding: 4,+ textAlign: "center",+ }}+ ><div>- <div>No cameras connected</div>- <div style={{fontSize: '0.9rem', marginTop: '0.5rem'}}>- Waiting for camera streams...+ <div>{t("noCamerasConnected")}</div>+ <div style={{ fontSize: "0.9rem", marginTop: "0.5rem" }}>+ {t("waitingForCameraStreams")}</div></div></Box>);}- const columns = getColumns(connectedCameraIds.length);-- // Organize cameras into rows- const rows: string[][] = [];- for (let i = 0; i < connectedCameraIds.length; i += columns) {- rows.push(connectedCameraIds.slice(i, i + columns));- }-- const defaultRowSize = 100 / rows.length;- const minRowSize = Math.max(10, 100 / (rows.length * 2));-return (- <Box sx={{- height: '100%',- width: '100%',- overflow: 'hidden',- padding: 1,- }}>- <PanelGroup key={`camera-grid-${resetKey}`} direction="vertical">- {rows.map((row, rowIndex) => {- const defaultCameraSize = 100 / row.length;- const minCameraSize = Math.max(10, 100 / (row.length * 2));-- return (- <React.Fragment key={`row-${rowIndex}`}>- <Panel- defaultSize={defaultRowSize}- minSize={minRowSize}- >- <PanelGroup direction="horizontal">- {row.map((cameraId, cameraIndex) => (- <React.Fragment key={cameraId}>- <Panel- defaultSize={defaultCameraSize}- minSize={minCameraSize}- >- <Box sx={{- height: '100%',- width: '100%',- display: 'flex',- alignItems: 'center',- justifyContent: 'center',- overflow: 'hidden',- }}>- <CameraView cameraId={cameraId}/>- </Box>- </Panel>-- {/* Horizontal resize handle between cameras in same row */}- {cameraIndex < row.length - 1 && (- <PanelResizeHandle- style={{- width: "2px",- cursor: "col-resize",- backgroundColor: theme.palette.primary.dark,- }}- />- )}- </React.Fragment>- ))}- </PanelGroup>- </Panel>-- {/* Vertical resize handle between rows */}- {rowIndex < rows.length - 1 && (- <PanelResizeHandle- style={{- height: "2px",- cursor: "row-resize",- backgroundColor: theme.palette.primary.dark,- }}- />- )}- </React.Fragment>- );- })}- </PanelGroup>+ <Box+ ref={containerRef}+ sx={{+ position: "relative",+ width: "100%",+ height: "100%",+ minHeight: 300,+ overflow: "hidden",+ "& .react-grid-placeholder": {+ backgroundColor: "primary.main",+ opacity: 0.15,+ borderRadius: "4px",+ },+ "& .react-grid-item > .react-resizable-handle": {+ zIndex: 10,+ opacity: 0.4,+ transition: "opacity 0.2s ease",+ },+ "& .react-grid-item:hover > .react-resizable-handle": {+ opacity: 1,+ },+ "& .react-grid-item > .react-resizable-handle::after": {+ width: "10px",+ height: "10px",+ right: "4px",+ bottom: "4px",+ borderRight: "2px solid rgba(255, 255, 255, 0.5)",+ borderBottom: "2px solid rgba(255, 255, 255, 0.5)",+ },+ }}+ >+ <ReactGridLayout+ width={containerWidth}+ layout={layout}+ gridConfig={{+ cols: GRID_COLS,+ rowHeight,+ margin: MARGIN,+ containerPadding: [0, 0] as [number, number],+ }}+ dragConfig={{ enabled: true }}+ resizeConfig={{ enabled: true }}+ compactor={noCompactor}+ onLayoutChange={handleLayoutChange}+ onDragStart={handleDragStart}+ onDragStop={handleDragStop}+ onResizeStop={handleResizeStop}+ >+ {connectedCameraIds.map((cameraId) => (+ <Box+ key={cameraId}+ sx={{+ overflow: "hidden",+ borderRadius: "4px",+ border: isRecording+ ? "2px solid #ff2020"+ : "1px solid rgba(255,255,255,0.15)",+ transition: "border 0.3s ease, box-shadow 0.3s ease",+ ...(isRecording && {+ animation: `${recordingBorderPulse} 3s infinite ease-in-out`,+ }),+ }}+ >+ <CameraView cameraId={cameraId} />+ </Box>+ ))}+ </ReactGridLayout></Box>);-};\ No newline at end of file+};diff --git a/freemocap-ui/src/components/camera-views/camera-view-settings-overlay/CamerasViewSettingsOverlay.tsx b/freemocap-ui/src/components/camera-views/camera-view-settings-overlay/CamerasViewSettingsOverlay.tsxdeleted file mode 100644index 4fb911aa..00000000--- a/freemocap-ui/src/components/camera-views/camera-view-settings-overlay/CamerasViewSettingsOverlay.tsx+++ /dev/null@@ -1,228 +0,0 @@-import React, {useState} from 'react';-import {Box, Button, Checkbox, FormControlLabel, IconButton, Paper, TextField, ToggleButton, ToggleButtonGroup, Tooltip} from '@mui/material';-import SettingsIcon from '@mui/icons-material/Settings';-import CloseIcon from '@mui/icons-material/Close';-import GridViewIcon from '@mui/icons-material/GridView';-import ViewInArIcon from '@mui/icons-material/ViewInAr';-import RestartAltIcon from '@mui/icons-material/RestartAlt';-import ViewColumnIcon from '@mui/icons-material/ViewColumn';-import TableRowsIcon from '@mui/icons-material/TableRows';-import {useServer} from "@/hooks/useServer";-import {CameraSettings, LayoutDirection} from "@/pages/CamerasPage";--interface CamerasViewSettingsOverlayProps {- onSettingsChange: (settings: CameraSettings) => void;- onResetViews: () => void;-}--export const CamerasViewSettingsOverlay: React.FC<CamerasViewSettingsOverlayProps> = ({- onSettingsChange,- onResetViews- }) => {- const {connectedCameraIds} = useServer();- const [isOpen, setIsOpen] = useState<boolean>(false);- const [isAuto, setIsAuto] = useState<boolean>(true);- const [manualColumns, setManualColumns] = useState<number>(2);- const [show3dView, setShow3dView] = useState<boolean>(true);- const [layoutDirection, setLayoutDirection] = useState<LayoutDirection>('horizontal');-- const getAutoColumns = (total: number): number => {- if (total <= 1) return 1;- if (total <= 4) return 2;- if (total <= 9) return 3;- return 4;- };-- const autoColumns = getAutoColumns(connectedCameraIds.length);-- const buildSettings = (overrides: Partial<{- columns: number | null;- show3dView: boolean;- layoutDirection: LayoutDirection;- }> = {}): CameraSettings => ({- columns: overrides.columns !== undefined ? overrides.columns : (isAuto ? null : manualColumns),- show3dView: overrides.show3dView !== undefined ? overrides.show3dView : show3dView,- layoutDirection: overrides.layoutDirection !== undefined ? overrides.layoutDirection : layoutDirection,- });-- const handleAutoChange = (event: React.ChangeEvent<HTMLInputElement>) => {- const checked = event.target.checked;- setIsAuto(checked);- onSettingsChange(buildSettings({columns: checked ? null : manualColumns}));- };-- const handleColumnsChange = (event: React.ChangeEvent<HTMLInputElement>) => {- const value = parseInt(event.target.value);- if (!isNaN(value) && value > 0) {- setManualColumns(value);- if (isAuto) {- setIsAuto(false);- }- onSettingsChange(buildSettings({columns: value}));- }- };-- const handle3dViewChange = (event: React.ChangeEvent<HTMLInputElement>) => {- const checked = event.target.checked;- setShow3dView(checked);- onSettingsChange(buildSettings({show3dView: checked}));- };-- const handleLayoutDirectionChange = (_event: React.MouseEvent<HTMLElement>, newDirection: LayoutDirection | null) => {- if (newDirection === null) return; // Prevent deselecting both- setLayoutDirection(newDirection);- onSettingsChange(buildSettings({layoutDirection: newDirection}));- };-- const handleResetViews = () => {- onResetViews();- };-- return (- <>- {/* Settings Button */}- <Box- sx={{- position: 'absolute',- top: 16,- right: 16,- zIndex: 1000,- }}- >- <Tooltip title={isOpen ? "Close settings" : "Grid settings"}>- <IconButton- onClick={() => setIsOpen(!isOpen)}- sx={{- backgroundColor: 'background.paper',- boxShadow: 2,- '&:hover': {- backgroundColor: 'action.hover',- },- }}- >- {isOpen ? <CloseIcon/> : <SettingsIcon/>}- </IconButton>- </Tooltip>- </Box>-- {/* Settings Panel */}- {isOpen && (- <Paper- elevation={8}- sx={{- position: 'absolute',- top: 70,- right: 16,- zIndex: 999,- padding: 2,- minWidth: 250,- }}- >- <Box sx={{display: 'flex', alignItems: 'center', gap: 1, mb: 2}}>- <GridViewIcon fontSize="small"/>- <Box sx={{fontWeight: 600}}>Grid Columns</Box>- </Box>-- <Box sx={{display: 'flex', alignItems: 'flex-start', gap: 1, mb: 3}}>- <FormControlLabel- control={- <Checkbox- checked={isAuto}- onChange={handleAutoChange}- sx={{- '&.Mui-checked': {- color: 'text.primary',- },- }}- />- }- label="Auto"- />-- <TextField- type="number"- label="Columns"- value={isAuto ? autoColumns : manualColumns}- onChange={handleColumnsChange}- fullWidth- inputProps={{- min: 1,- step: 1,- }}- helperText={isAuto ? `Auto-detected: ${autoColumns}` : "Enter any positive number"}- />- </Box>-- <Box sx={{display: 'flex', alignItems: 'center', gap: 1, mb: 2}}>- <ViewInArIcon fontSize="small"/>- <Box sx={{fontWeight: 600}}>3D View</Box>- </Box>-- <Box sx={{display: 'flex', alignItems: 'flex-start', gap: 1, mb: 2}}>- <FormControlLabel- control={- <Checkbox- checked={show3dView}- onChange={handle3dViewChange}- sx={{- '&.Mui-checked': {- color: 'text.primary',- },- }}- />- }- label="Show 3D View"- />- </Box>-- {/* Layout direction toggle — only meaningful when 3D view is visible */}- <Box sx={{- display: 'flex',- alignItems: 'center',- gap: 1,- mb: 1,- opacity: show3dView ? 1 : 0.4,- }}>- <Box sx={{fontWeight: 600, fontSize: 13}}>Layout</Box>- </Box>- <ToggleButtonGroup- value={layoutDirection}- exclusive- onChange={handleLayoutDirectionChange}- disabled={!show3dView}- size="small"- sx={{mb: 3, width: '100%'}}- >- <ToggleButton value="vertical" sx={{flex: 1, textTransform: 'none', fontSize: 12}}>- <TableRowsIcon sx={{mr: 0.5, fontSize: 16}}/>- Top / Bottom- </ToggleButton>- <ToggleButton value="horizontal" sx={{flex: 1, textTransform: 'none', fontSize: 12}}>- <ViewColumnIcon sx={{mr: 0.5, fontSize: 16}}/>- Side by Side- </ToggleButton>- </ToggleButtonGroup>-- <Button- variant="outlined"- startIcon={<RestartAltIcon/>}- onClick={handleResetViews}- fullWidth- sx={{- mt: 1,- textTransform: 'none',- color: 'text.primary',- borderColor: 'text.primary',- '&:hover': {- borderColor: 'text.primary',- backgroundColor: 'action.hover',- },- }}- >- Reset Panel Sizes- </Button>- </Paper>- )}- </>- );-};\ No newline at end of filediff --git a/freemocap-ui/src/components/camera-views/camera-view-settings-overlay/ImageScaleSlider.tsx b/freemocap-ui/src/components/camera-views/camera-view-settings-overlay/ImageScaleSlider.tsxdeleted file mode 100644index 18beb8dd..00000000--- a/freemocap-ui/src/components/camera-views/camera-view-settings-overlay/ImageScaleSlider.tsx+++ /dev/null@@ -1,65 +0,0 @@-import React from 'react';-import {Box, Slider, Tooltip, Typography, useTheme} from '@mui/material';--interface ImageScaleSliderProps {- scale: number;- onScaleChange: (value: number) => void;-}--const ValueLabelComponent = (props: {- children: React.ReactElement;- value: number;-}) => {- const {children, value} = props;-- return (- <Tooltip title={- <span>- {`Scale: ${value.toFixed(1)}`}- </span>- }>- {children}- </Tooltip>- );-};--export const ImageScaleSlider: React.FC<ImageScaleSliderProps> = ({- scale = 0.5,- onScaleChange,- }) => {- const theme = useTheme();-- const marks = [- {value: 0.1, label: '0.1'},- {value: 0.5, label: '0.5 (default)'},- {value: 2.0, label: '2.0'},- ];-- return (- <Box>- <Typography variant="body2" color="text.secondary" gutterBottom>- Image Scale- </Typography>- <Slider- value={scale}- min={0.1}- max={2.0}- step={0.1}- marks={marks}- valueLabelDisplay="auto"- onChange={(_, value) => onScaleChange(value as number)}- components={{- ValueLabel: ValueLabelComponent,- }}- sx={{- color: theme.palette.primary.light,- '& .MuiSlider-thumb': {- '&:hover, &.Mui-focusVisible': {- boxShadow: `0px 0px 0px 8px ${theme.palette.primary.light}33`,- },- },- }}- />- </Box>- );-};diff --git a/freemocap-ui/src/components/common/CollapsibleSidebarSection.tsx b/freemocap-ui/src/components/common/CollapsibleSidebarSection.tsxdeleted file mode 100644index ede732ba..00000000--- a/freemocap-ui/src/components/common/CollapsibleSidebarSection.tsx+++ /dev/null@@ -1,173 +0,0 @@-import React, {ReactNode, useCallback, useState} from "react";-import {Box, Collapse, Paper, Typography, useTheme} from "@mui/material";-import ExpandMoreIcon from "@mui/icons-material/ExpandMore";-import ChevronRightIcon from "@mui/icons-material/ChevronRight";-import DragIndicatorIcon from "@mui/icons-material/DragIndicator";-import {useDragHandle} from "@/components/common/DragHandleContext";--interface CollapsibleSidebarSectionProps {- icon: ReactNode;- title: string;- primaryControl: ReactNode;- summaryContent: ReactNode;- children: ReactNode;- defaultExpanded: boolean;-}--export const CollapsibleSidebarSection: React.FC<CollapsibleSidebarSectionProps> = ({- icon,- title,- primaryControl,- summaryContent,- children,- defaultExpanded,- }) => {- const theme = useTheme();- const [expanded, setExpanded] = useState(defaultExpanded);- const dragHandle = useDragHandle();-- const handleToggle = useCallback(() => {- setExpanded((prev) => !prev);- }, []);-- const handlePrimaryControlClick = useCallback((e: React.MouseEvent) => {- e.stopPropagation();- }, []);-- return (- <Paper- elevation={1}- sx={{- borderRadius: 1,- overflow: "hidden",- }}- >- {/* Header row — always visible, identical whether expanded or collapsed */}- <Box- onClick={handleToggle}- sx={{- display: "flex",- alignItems: "center",- cursor: "pointer",- py: 0.75,- px: dragHandle ? 0.5 : 1.5,- minHeight: 44,- backgroundColor: theme.palette.primary.main,- color: theme.palette.primary.contrastText,- userSelect: "none",- transition: "background-color 0.15s ease",- "&:hover": {- backgroundColor: theme.palette.primary.dark,- },- }}- >- {/* Drag handle — only rendered when inside a sortable context */}- {dragHandle && (- <Box- {...dragHandle.attributes}- {...dragHandle.listeners}- onClick={(e: React.MouseEvent) => e.stopPropagation()}- sx={{- display: "flex",- alignItems: "center",- cursor: "grab",- px: 0.25,- mr: 0.25,- flexShrink: 0,- opacity: 0.35,- borderRadius: 0.5,- transition: "opacity 0.15s ease, background-color 0.15s ease",- "&:hover": {- opacity: 0.9,- backgroundColor: "rgba(255,255,255,0.1)",- },- "&:active": {- cursor: "grabbing",- },- }}- >- <DragIndicatorIcon sx={{fontSize: 18}} />- </Box>- )}-- {/* Expand/collapse chevron */}- <Box- sx={{- display: "flex",- alignItems: "center",- mr: 0.5,- flexShrink: 0,- }}- >- {expanded ? (- <ExpandMoreIcon fontSize="small" />- ) : (- <ChevronRightIcon fontSize="small" />- )}- </Box>-- {/* Section icon */}- <Box- sx={{- display: "flex",- alignItems: "center",- mr: 1,- flexShrink: 0,- }}- >- {icon}- </Box>-- {/* Title */}- <Typography- variant="subtitle1"- sx={{- fontWeight: 600,- flexShrink: 0,- lineHeight: 1.3,- }}- >- {title}- </Typography>-- {/* Summary — fills remaining horizontal space */}- <Box- sx={{- flexGrow: 1,- mx: 1.5,- overflow: "hidden",- display: "flex",- alignItems: "center",- justifyContent: "flex-end",- }}- >- {summaryContent}- </Box>-- {/* Primary control — click is isolated from expand/collapse */}- <Box- onClick={handlePrimaryControlClick}- sx={{- flexShrink: 0,- display: "flex",- alignItems: "center",- pr: 0.5,- }}- >- {primaryControl}- </Box>- </Box>-- {/* Detail panel — only visible when expanded */}- <Collapse in={expanded} timeout="auto" unmountOnExit>- <Box- sx={{- backgroundColor: theme.palette.background.paper,- }}- >- {children}- </Box>- </Collapse>- </Paper>- );-};diff --git a/freemocap-ui/src/components/common/DragHandleContext.ts b/freemocap-ui/src/components/common/DragHandleContext.tsdeleted file mode 100644index 7d8f9b82..00000000--- a/freemocap-ui/src/components/common/DragHandleContext.ts+++ /dev/null@@ -1,12 +0,0 @@-import {createContext, useContext} from "react";--export interface DragHandleContextValue {- listeners: Record<string, Function> | undefined;- attributes: Record<string, any>;-}--export const DragHandleContext = createContext<DragHandleContextValue | null>(null);--export const useDragHandle = (): DragHandleContextValue | null => {- return useContext(DragHandleContext);-};diff --git a/freemocap-ui/src/components/common/ErrorBoundary.tsx b/freemocap-ui/src/components/common/ErrorBoundary.tsxindex cbe18797..5fef5af4 100644--- a/freemocap-ui/src/components/common/ErrorBoundary.tsx+++ b/freemocap-ui/src/components/common/ErrorBoundary.tsx@@ -1,4 +1,5 @@import React from "react";+import i18n from "@/i18n/i18n";// Define the types for props and stateinterface ErrorBoundaryProps {@@ -34,7 +35,7 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta// Render a custom fallback UI with error detailsreturn (<div>- <h1>Something went wrong :(</h1>+ <h1>{i18n.t('somethingWentWrong')}</h1><details style={{whiteSpace: 'pre-wrap'}}>{this.state.error && this.state.error.toString()}<br/>diff --git a/freemocap-ui/src/components/common/SortableSectionWrapper.tsx b/freemocap-ui/src/components/common/SortableSectionWrapper.tsxdeleted file mode 100644index d5ca7140..00000000--- a/freemocap-ui/src/components/common/SortableSectionWrapper.tsx+++ /dev/null@@ -1,39 +0,0 @@-import React, {ReactNode} from "react";-import {useSortable} from "@dnd-kit/sortable";-import {CSS} from "@dnd-kit/utilities";-import {DragHandleContext} from "@/components/common/DragHandleContext";--interface SortableSectionWrapperProps {- id: string;- children: ReactNode;-}--export const SortableSectionWrapper: React.FC<SortableSectionWrapperProps> = ({- id,- children,-}) => {- const {- attributes,- listeners,- setNodeRef,- transform,- transition,- isDragging,- } = useSortable({id});-- const style: React.CSSProperties = {- transform: CSS.Transform.toString(transform),- transition,- zIndex: isDragging ? 10 : undefined,- position: "relative",- opacity: isDragging ? 0.85 : 1,- };-- return (- <div ref={setNodeRef} style={style}>- <DragHandleContext.Provider value={{listeners, attributes}}>- {children}- </DragHandleContext.Provider>- </div>- );-};diff --git a/freemocap-ui/src/components/framerate-viewer/BaseD3ChartView.tsx b/freemocap-ui/src/components/framerate-viewer/BaseD3ChartView.tsxindex 1dc2aea4..5c2c86ec 100644--- a/freemocap-ui/src/components/framerate-viewer/BaseD3ChartView.tsx+++ b/freemocap-ui/src/components/framerate-viewer/BaseD3ChartView.tsx@@ -1,8 +1,9 @@// src/components/framerate-viewer/BaseD3ChartView.tsx-import {useEffect, useRef, useState} from "react"+import {useEffect, useRef, useState, useCallback, memo} from "react"import * as d3 from "d3"import {Box, Fade, IconButton, Tooltip, Typography} from "@mui/material"import {RestartAlt, ZoomIn, ZoomOut} from "@mui/icons-material"+import {useTranslation} from "react-i18next"export type ChartMargins = {top: number@@ -11,131 +12,184 @@ export type ChartMargins = {left: number}-// Define a type for elements that should be updated on zoom-export type ZoomableElement = {- selector: string;- updateFn: (selection: d3.Selection<any, any, any, any>, transform: d3.ZoomTransform) => void;+/** Persistent D3 scaffolding created once on mount/resize. */+export type ChartScaffolding = {+ svg: d3.Selection<SVGGElement, unknown, null, undefined>+ chartArea: d3.Selection<SVGGElement, unknown, null, undefined>+ xAxisG: d3.Selection<SVGGElement, unknown, null, undefined>+ yAxisG: d3.Selection<SVGGElement, unknown, null, undefined>+ width: number+ height: number+ margin: ChartMargins+}++/** Returned by initChart, stored by BaseD3ChartView for the lifetime of the scaffolding. */+export type ChartLifecycle = {+ onZoom?: (transform: d3.ZoomTransform) => void+ cleanup?: () => void}type BaseChartViewProps = {title?: string- renderChart: (params: {- svg: d3.Selection<SVGGElement, unknown, null, undefined>- chartArea: d3.Selection<SVGGElement, unknown, null, undefined>- width: number- height: number- margin: ChartMargins- transform: d3.ZoomTransform- }) => void+ /** Called once when the chart mounts or resizes. Creates persistent DOM elements (tooltip, etc). */+ initChart: (scaffolding: ChartScaffolding) => ChartLifecycle | void+ /** Called on every data update. Performs in-place D3 updates on the existing scaffolding. */+ updateChart: (scaffolding: ChartScaffolding) => voidmargin?: ChartMargins}-export default function BaseD3ChartView({- title,- renderChart,- margin = {top: 20, right: 100, bottom: 30, left: 60}- }: BaseChartViewProps) {+let nextClipId = 0++/** How often (ms) to run the imperative D3 data-update. */+const CHART_UPDATE_INTERVAL_MS = 500++export default memo(function BaseD3ChartView({+ title,+ initChart,+ updateChart,+ margin = {top: 20, right: 20, bottom: 30, left: 50},+}: BaseChartViewProps) {+ const {t} = useTranslation()const svgRef = useRef<SVGSVGElement>(null)- const chartRef = useRef<{+ const containerRef = useRef<HTMLDivElement>(null)+ const chartStateRef = useRef<{cleanup?: () => void+ onZoom?: (transform: d3.ZoomTransform) => void+ scaffolding?: ChartScaffolding}>({})- const [transform, setTransform] = useState<d3.ZoomTransform>(d3.zoomIdentity)const zoomRef = useRef<d3.ZoomBehavior<SVGSVGElement, unknown> | null>(null)+ const clipIdRef = useRef<string>(`clip-chart-${nextClipId++}`)const [showControls, setShowControls] = useState(false)+ const [containerSize, setContainerSize] = useState<{width: number; height: number}>({width: 0, height: 0})++ // Always holds the latest updateChart without triggering re-renders.+ const updateChartRef = useRef(updateChart)+ updateChartRef.current = updateChart+ // Track container size with ResizeObserveruseEffect(() => {- if (!svgRef.current) return+ const container = containerRef.current+ if (!container) return- // Clear previous chart- d3.select(svgRef.current).selectAll("*").remove()+ const observer = new ResizeObserver((entries) => {+ for (const entry of entries) {+ const {width, height} = entry.contentRect+ setContainerSize(prev => {+ const w = Math.round(width)+ const h = Math.round(height)+ if (prev.width === w && prev.height === h) return prev+ return {width: w, height: h}+ })+ }+ })+ observer.observe(container)+ return () => observer.disconnect()+ }, [])- // Set up dimensions- let width = svgRef.current.clientWidth - margin.left - margin.right- let height = svgRef.current.clientHeight - margin.top - margin.bottom- if (width < 0) {- width = 0- }- if (height < 0) {- height = 0+ // Build chart scaffolding on mount/resize — runs rarely+ useEffect(() => {+ if (!svgRef.current || containerSize.width === 0 || containerSize.height === 0) return++ // Tear down previous scaffolding+ d3.select(svgRef.current).selectAll("*").remove()+ if (chartStateRef.current.cleanup) {+ chartStateRef.current.cleanup()}- // Create SVG with a clip path for zooming+ chartStateRef.current = {}++ const width = Math.max(0, containerSize.width - margin.left - margin.right)+ const height = Math.max(0, containerSize.height - margin.top - margin.bottom)+ if (width <= 0 || height <= 0) return++ const clipId = clipIdRef.current+const svg = d3.select(svgRef.current).append("g").attr("transform", `translate(${margin.left},${margin.top})`)- // Add clip path to prevent drawing outside the chart area- svg- .append("defs")+ svg.append("defs").append("clipPath")- .attr("id", "clip-chart")+ .attr("id", clipId).append("rect").attr("width", width).attr("height", height)- // Create a group for the chart content that will be clipped- const chartArea = svg.append("g").attr("clip-path", "url(#clip-chart)")+ const chartArea = svg.append("g").attr("clip-path", `url(#${clipId})`)++ const xAxisG = svg+ .append("g")+ .attr("class", "x-axis")+ .attr("transform", `translate(0,${height})`)+ const yAxisG = svg.append("g").attr("class", "y-axis")- // Call the render function provided by the child component- const cleanup = renderChart({svg, chartArea, width, height, margin, transform})+ const scaffolding: ChartScaffolding = {svg, chartArea, xAxisG, yAxisG, width, height, margin}+ chartStateRef.current.scaffolding = scaffolding- // Store cleanup function if one is returned- if (typeof cleanup === 'function') {- chartRef.current.cleanup = cleanup+ const result = initChart(scaffolding)+ if (result) {+ chartStateRef.current.cleanup = result.cleanup+ chartStateRef.current.onZoom = result.onZoom}- // Define zoom behavior+ // Set up zoom behaviorconst zoom = d3.zoom<SVGSVGElement, unknown>().scaleExtent([0.5, 20])- .extent([- [0, 0],- [width, height],- ])+ .extent([[0, 0], [width, height]]).on("zoom", (event) => {- // Update the transform state- setTransform(event.transform)+ chartStateRef.current.onZoom?.(event.transform)})- // Store zoom reference for external controlszoomRef.current = zoom-- // Apply zoom to the SVGd3.select(svgRef.current).call(zoom)- // Cleanup functionreturn () => {- if (chartRef.current.cleanup) {- chartRef.current.cleanup()+ if (chartStateRef.current.cleanup) {+ chartStateRef.current.cleanup()+ chartStateRef.current = {}}}- }, [renderChart, margin, transform])+ }, [initChart, margin, containerSize])- // Zoom control handlers- const handleZoomIn = () => {+ // Imperative D3 data update on a fixed interval. The updateChart callback+ // (stored in the ref) reads directly from the FramerateStore each tick,+ // so no React state or re-renders are involved in the data path.+ useEffect(() => {+ const tick = () => {+ const scaffolding = chartStateRef.current.scaffolding+ if (scaffolding) updateChartRef.current(scaffolding)+ }+ tick()+ const id = setInterval(tick, CHART_UPDATE_INTERVAL_MS)+ return () => clearInterval(id)+ }, [])++ const handleZoomIn = useCallback(() => {if (svgRef.current && zoomRef.current) {d3.select(svgRef.current).transition().duration(300).call(zoomRef.current.scaleBy, 1.5)}- }+ }, [])- const handleZoomOut = () => {+ const handleZoomOut = useCallback(() => {if (svgRef.current && zoomRef.current) {d3.select(svgRef.current).transition().duration(300).call(zoomRef.current.scaleBy, 0.75)}- }+ }, [])- const handleResetZoom = () => {+ const handleResetZoom = useCallback(() => {if (svgRef.current && zoomRef.current) {d3.select(svgRef.current).transition().duration(300).call(zoomRef.current.transform, d3.zoomIdentity)}- }+ }, [])return (<Box+ ref={containerRef}sx={{width: "100%",height: "100%",position: "relative",- overflow: "hidden"+ overflow: "hidden",}}onMouseEnter={() => setShowControls(true)}onMouseLeave={() => setShowControls(false)}@@ -145,17 +199,21 @@ export default function BaseD3ChartView({variant="caption"sx={{position: "absolute",- top: 5,- left: 10,- fontSize: '0.7rem',- opacity: 0.8+ top: 2,+ left: 8,+ fontSize: "0.7rem",+ opacity: 0.9,+ zIndex: 5,+ bgcolor: "background.default",+ px: 0.5,+ borderRadius: 0.5,+ lineHeight: 1.4,}}>{title}</Typography>)}- {/* Zoom controls that fade in/out on hover */}<Fade in={showControls}><Boxsx={{@@ -171,19 +229,19 @@ export default function BaseD3ChartView({flexDirection: "column",}}>- <Tooltip title="Zoom In" placement="right">+ <Tooltip title={t("zoomIn")} placement="right"><IconButton size="small" onClick={handleZoomIn} sx={{p: 0.5}}>- <ZoomIn fontSize="small"/>+ <ZoomIn fontSize="small" /></IconButton></Tooltip>- <Tooltip title="Zoom Out" placement="right">+ <Tooltip title={t("zoomOut")} placement="right"><IconButton size="small" onClick={handleZoomOut} sx={{p: 0.5}}>- <ZoomOut fontSize="small"/>+ <ZoomOut fontSize="small" /></IconButton></Tooltip>- <Tooltip title="Reset Zoom" placement="right">+ <Tooltip title={t("resetZoom")} placement="right"><IconButton size="small" onClick={handleResetZoom} sx={{p: 0.5}}>- <RestartAlt fontSize="small"/>+ <RestartAlt fontSize="small" /></IconButton></Tooltip></Box>@@ -191,13 +249,14 @@ export default function BaseD3ChartView({<svgref={svgRef}- width="100%"- height="100%"- style={{- display: 'block',- overflow: "visible"- }}+ width={containerSize.width}+ height={containerSize.height}+ style={{display: "block", overflow: "hidden"}}/></Box>)-}+}, (prev, next) => {+ return prev.title === next.title+ && prev.initChart === next.initChart+ && prev.margin === next.margin+})diff --git a/freemocap-ui/src/components/framerate-viewer/FrameRateViewer.tsx b/freemocap-ui/src/components/framerate-viewer/FrameRateViewer.tsxindex d607e734..9abe4d80 100644--- a/freemocap-ui/src/components/framerate-viewer/FrameRateViewer.tsx+++ b/freemocap-ui/src/components/framerate-viewer/FrameRateViewer.tsx@@ -1,28 +1,22 @@// src/components/framerate-viewer/FrameRateViewer.tsximport {useState} from "react"import {Box, IconButton, Paper, Stack, Tooltip, Typography} from "@mui/material"-import {BarChart, ShowChart, ViewCompact, ViewDay} from "@mui/icons-material"+import {BarChart, ShowChart, TableChart} from "@mui/icons-material"import {alpha, useTheme} from "@mui/material/styles"import FramerateTimeseriesView from "./FramerateTimeseriesView"import FramerateHistogramView from "./FramerateHistogramView"import FramerateStatisticsView from "./FramerateStatisticsView"-import {selectFramerateViewerData, useAppSelector} from "@/store";+import { useTranslation } from "react-i18next";-type ViewType = "timeseries" | "histogram" | "both"export const frontendColor: string = "#1976D2"export const backendColor: string = "#ff4d00"export const FramerateViewerPanel = () => {const theme = useTheme()- const [viewType, setViewType] = useState<ViewType>("both")-- // Use the new selector to get all framerate data- const {- currentFrontendFramerate,- currentBackendFramerate,- recentFrontendFrameDurations,- recentBackendFrameDurations- } = useAppSelector(selectFramerateViewerData);+ const { t } = useTranslation();+ const [showStats, setShowStats] = useState(true)+ const [showTimeseries, setShowTimeseries] = useState(true)+ const [showHistogram, setShowHistogram] = useState(true)return (<Box sx={{@@ -31,7 +25,7 @@ export const FramerateViewerPanel = () => {flexDirection: 'column',backgroundColor: theme.palette.background.default,p: 0.5,- overflow: 'hidden' // Prevent content overflow+ overflow: 'hidden'}}>{/* Ultra-compact header with controls */}<Box sx={{@@ -42,49 +36,43 @@ export const FramerateViewerPanel = () => {px: 0.5}}><Typography variant="body2" fontWeight="medium" noWrap sx={{fontSize: '0.75rem'}}>- Camera Performance Metrics+ {t('cameraPerformanceMetrics')}</Typography>{/* View type selector as icon buttons */}<Stack direction="row" spacing={0.25}>- <Tooltip title="Timeline View">+ <Tooltip title={t("statisticsView")}><IconButtonsize="small"- onClick={() => setViewType("timeseries")}- color={viewType === "timeseries" ? "primary" : "default"}- sx={{padding: '2px'}}+ onClick={() => setShowStats((v) => !v)}+ sx={{padding: '2px', opacity: showStats ? 1 : 0.3}}>- <ShowChart sx={{fontSize: '1rem'}}/>+ <TableChart sx={{fontSize: '1rem'}}/></IconButton></Tooltip>- <Tooltip title="Distribution View">+ <Tooltip title={t("timelineView")}><IconButtonsize="small"- onClick={() => setViewType("histogram")}- color={viewType === "histogram" ? "primary" : "default"}- sx={{padding: '2px'}}+ onClick={() => setShowTimeseries((v) => !v)}+ sx={{padding: '2px', opacity: showTimeseries ? 1 : 0.3}}>- <BarChart sx={{fontSize: '1rem'}}/>+ <ShowChart sx={{fontSize: '1rem'}}/></IconButton></Tooltip>- <Tooltip title="Combined View">+ <Tooltip title={t("distributionView")}><IconButtonsize="small"- onClick={() => setViewType("both")}- color={viewType === "both" ? "primary" : "default"}- sx={{padding: '2px'}}+ onClick={() => setShowHistogram((v) => !v)}+ sx={{padding: '2px', opacity: showHistogram ? 1 : 0.3}}>- {theme.direction === 'ltr' ? (- <ViewDay sx={{fontSize: '1rem'}}/>- ) : (- <ViewCompact sx={{fontSize: '1rem'}}/>- )}+ <BarChart sx={{fontSize: '1rem'}}/></IconButton></Tooltip></Stack></Box>{/* Stats section - ultra compact */}+ {showStats && (<Box sx={{px: 0.25,mb: 0.25,@@ -98,22 +86,21 @@ export const FramerateViewerPanel = () => {}}><FramerateStatisticsView- frontendFramerate={currentFrontendFramerate}- backendFramerate={currentBackendFramerate}compact={true}/></Paper></Box>+ )}{/* Main visualization area with flex-based layout */}<Box sx={{flex: 1,display: 'flex',- flexDirection: viewType === 'both' ? 'row' : 'column',+ flexDirection: (showTimeseries && showHistogram) ? 'row' : 'column',gap: 0.25,- overflow: 'hidden' // Critical to prevent overflow+ overflow: 'hidden'}}>- {(viewType === 'timeseries' || viewType === 'both') && (+ {showTimeseries && (<Paperelevation={0}sx={{@@ -122,22 +109,18 @@ export const FramerateViewerPanel = () => {flexDirection: 'column',border: '1px solid',borderColor: alpha(theme.palette.divider, 0.2),- overflow: 'hidden' // Ensure chart doesn't overflow+ overflow: 'hidden'}}><FramerateTimeseriesView- frontendFramerate={currentFrontendFramerate}- backendFramerate={currentBackendFramerate}- recentFrontendFrameDurations={recentFrontendFrameDurations}- recentBackendFrameDurations={recentBackendFrameDurations}frontendColor={frontendColor}backendColor={backendColor}- title="Frame Duration Timeline"+ title={t("framerateTimeline")}/></Paper>)}- {(viewType === 'histogram' || viewType === 'both') && (+ {showHistogram && (<Paperelevation={0}sx={{@@ -146,17 +129,13 @@ export const FramerateViewerPanel = () => {flexDirection: 'column',border: '1px solid',borderColor: alpha(theme.palette.divider, 0.2),- overflow: 'hidden' // Ensure chart doesn't overflow+ overflow: 'hidden'}}><FramerateHistogramView- frontendFramerate={currentFrontendFramerate}- backendFramerate={currentBackendFramerate}- recentFrontendFrameDurations={recentFrontendFrameDurations}- recentBackendFrameDurations={recentBackendFrameDurations}frontendColor={frontendColor}backendColor={backendColor}- title="Frame Duration Distribution"+ title={t("framerateDistribution")}/></Paper>)}diff --git a/freemocap-ui/src/components/framerate-viewer/FramerateHistogramView.tsx b/freemocap-ui/src/components/framerate-viewer/FramerateHistogramView.tsxindex 38c485ce..13892f80 100644--- a/freemocap-ui/src/components/framerate-viewer/FramerateHistogramView.tsx+++ b/freemocap-ui/src/components/framerate-viewer/FramerateHistogramView.tsx@@ -1,294 +1,266 @@// src/components/framerate-viewer/FramerateHistogramView.tsx-import {useCallback} from "react"+import {useCallback, useRef} from "react"import * as d3 from "d3"import {useTheme} from "@mui/material/styles"-import {applyAxisStyles, createTooltip, renderEmptyChart} from "./d3ChartUtils"-import {CurrentFramerate} from "@/store/slices/framerate/framerate-slice";-import BaseD3ChartView from "@/components/framerate-viewer/BaseD3ChartView";+import {applyAxisStyles} from "./d3ChartUtils"+import BaseD3ChartView, {ChartScaffolding, ChartLifecycle} from "@/components/framerate-viewer/BaseD3ChartView"+import {useTranslation} from "react-i18next"+import {useServer} from "@/services/server/ServerContextProvider"type FramerateHistogramProps = {- frontendFramerate: CurrentFramerate | null- backendFramerate: CurrentFramerate | null- recentFrontendFrameDurations: number[]- recentBackendFrameDurations: number[]frontendColor: stringbackendColor: stringtitle?: string}+type HistogramBin = {x0: number; x1: number; count: number; density: number}++/**+ * Build histogram bins with a domain tight to the actual data range.+ */+function buildHistogram(fpsValues: number[]): {+ bins: HistogramBin[]+ maxDensity: number+} | null {+ if (fpsValues.length === 0) return null++ const min = Math.floor(d3.min(fpsValues)!)+ const max = Math.ceil(d3.max(fpsValues)!)++ const range = max - min+ const binWidth = range > 40 ? Math.ceil(range / 30) : 1+ const thresholds: number[] = []+ for (let v = min; v <= max; v += binWidth) {+ thresholds.push(v)+ }++ const generator = d3+ .bin<number, number>()+ .domain([min, max + binWidth])+ .thresholds(thresholds)++ const rawBins = generator(fpsValues)+ const total = fpsValues.length+ let maxDensity = 0++ const bins = rawBins.map((b) => {+ const density = b.length / total+ if (density > maxDensity) maxDensity = density+ return {+ x0: b.x0 as number,+ x1: b.x1 as number,+ count: b.length,+ density,+ }+ })++ return {bins, maxDensity}+}++/**+ * Persistent mutable state shared between initChart and updateChart.+ */+type ChartState = {+ frontendBarGroup: d3.Selection<SVGGElement, unknown, null, undefined>+ backendBarGroup: d3.Selection<SVGGElement, unknown, null, undefined>+ xScale: d3.ScaleLinear<number, number>+ yScale: d3.ScaleLinear<number, number>+ height: number+}+export default function FramerateHistogramView({- frontendFramerate,- backendFramerate,- recentFrontendFrameDurations,- recentBackendFrameDurations,- frontendColor,- backendColor,- title = "Frame Duration Distribution",- }: FramerateHistogramProps) {+ frontendColor,+ backendColor,+ title = "Framerate Distribution",+}: FramerateHistogramProps) {const theme = useTheme()+ const {t} = useTranslation()+ const stateRef = useRef<ChartState | null>(null)+ const {getFramerateStore} = useServer()++ // initChart — creates persistent groups+ const initChart = useCallback(+ ({svg, chartArea, width, height}: ChartScaffolding): ChartLifecycle => {+ const xScale = d3.scaleLinear().range([0, width])+ const yScale = d3.scaleLinear().range([height, 0])++ // Persistent bar groups — one per series, never removed+ const frontendBarGroup = chartArea.append("g").attr("class", "bars-frontend")+ const backendBarGroup = chartArea.append("g").attr("class", "bars-backend")++ // Axis labels (appended to svg root group, outside clip-path)+ svg.append("text")+ .attr("class", "x-axis-label")+ .attr("x", width / 2)+ .attr("y", height + 32)+ .attr("text-anchor", "middle")+ .style("font-family", "monospace")+ .style("font-size", "10px")+ .style("fill", theme.palette.text.secondary)+ .text("FPS")++ svg.append("text")+ .attr("class", "y-axis-label")+ .attr("transform", "rotate(-90)")+ .attr("x", -height / 2)+ .attr("y", -28)+ .attr("text-anchor", "middle")+ .style("font-family", "monospace")+ .style("font-size", "10px")+ .style("fill", theme.palette.text.secondary)+ .text("Density")++ // Persistent empty-state text (hidden by default)+ chartArea.append("text")+ .attr("class", "empty-text")+ .attr("x", width / 2)+ .attr("y", height / 2)+ .attr("text-anchor", "middle")+ .attr("dominant-baseline", "central")+ .style("font-family", "monospace")+ .style("font-size", "12px")+ .style("fill", theme.palette.text.disabled)+ .style("display", "none")++ stateRef.current = {+ frontendBarGroup,+ backendBarGroup,+ xScale,+ yScale,+ height,+ }- // Generate histogram data- const generateHistogram = (data: number[], binCount = 100) => {- if (data.length === 0) return null;+ return {+ cleanup: () => {+ stateRef.current = null+ },+ }+ },+ [theme, frontendColor, backendColor]+ )- // Calculate bins using d3's histogram generator- const histGenerator = d3.histogram()- .domain([0, d3.max(data) as number * 1.1]) // Add 10% padding to max- .thresholds(binCount);+ // updateChart — uses D3 data join for minimal DOM mutations+ const updateChart = useCallback(+ ({svg, chartArea, xAxisG, yAxisG, width, height}: ChartScaffolding) => {+ const state = stateRef.current+ if (!state) return- const bins = histGenerator(data);+ // Read fresh data directly from the store — no React state involved.+ const snapshot = getFramerateStore().getSnapshot()+ const recentFrontendDurations = snapshot.recentFrontendDurations+ const recentBackendDurations = snapshot.recentBackendDurations- // Calculate densities (normalized counts)- const totalCount = data.length;- const binCounts = bins.map(bin => bin.length);- const binDensities = binCounts.map(count => count / totalCount);+ const frontendFps = recentFrontendDurations.filter((s) => s.value > 0).map((s) => 1000 / s.value)+ const backendFps = recentBackendDurations.filter((s) => s.value > 0).map((s) => 1000 / s.value)- return {- bin_edges: bins.map(bin => bin.x0 as number),- bin_counts: binCounts,- bin_densities: binDensities- };- };-- const renderChart = useCallback(({- svg,- chartArea,- width,- height,- margin,- transform- }: {- svg: d3.Selection<SVGGElement, unknown, null, undefined>;- chartArea: d3.Selection<SVGGElement, unknown, null, undefined>;- width: number;- height: number;- margin: { top: number; right: number; bottom: number; left: number };- transform: d3.ZoomTransform;- }) => {- // Prepare the sources with histogram data- const sources = [- {- id: 'frontend',- name: frontendFramerate?.framerate_source || 'Frontend',- color: frontendColor,- histogram: generateHistogram(recentFrontendFrameDurations),- totalSamples: recentFrontendFrameDurations.length- },- {- id: 'backend',- name: backendFramerate?.framerate_source || 'Backend',- color: backendColor,- histogram: generateHistogram(recentBackendFrameDurations),- totalSamples: recentBackendFrameDurations.length- }- ];+ const frontendHist = buildHistogram(frontendFps)+ const backendHist = buildHistogram(backendFps)- // Check if we have valid histogram data- if (sources.every(s => !s.histogram)) {- renderEmptyChart(svg, width, height, theme);- return;- }+ state.height = height- // Find domain bounds from all histograms- let minX = Infinity;- let maxX = -Infinity;- let maxDensity = 0;+ const emptyText = chartArea.select<SVGTextElement>(".empty-text")- sources.forEach(source => {- if (source.histogram) {- const edges = source.histogram.bin_edges;- const densities = source.histogram.bin_densities;+ if (!frontendHist && !backendHist) {+ // Clear all bars+ state.frontendBarGroup.selectAll("rect").remove()+ state.backendBarGroup.selectAll("rect").remove()+ emptyText.style("display", null).text(t("waitingForData"))+ return+ }- if (edges.length > 0) {- minX = Math.min(minX, edges[0]);- maxX = Math.max(maxX, edges[edges.length - 1]);- }+ emptyText.style("display", "none")++ // Compute domain from all bins+ let minX = Infinity+ let maxX = -Infinity+ let maxDensity = 0- if (densities.length > 0) {- maxDensity = Math.max(maxDensity, Math.max(...densities));+ for (const hist of [frontendHist, backendHist]) {+ if (!hist) continue+ const bins = hist.bins+ if (bins.length > 0) {+ minX = Math.min(minX, bins[0].x0)+ maxX = Math.max(maxX, bins[bins.length - 1].x1)}+ maxDensity = Math.max(maxDensity, hist.maxDensity)}- });-- // If we couldn't determine bounds, use defaults- if (minX === Infinity) minX = 0;- if (maxX === -Infinity) maxX = 100;- if (maxDensity === 0) maxDensity = 1;-- // Add padding to domain- const xPadding = (maxX - minX) * 0.1;- const xDomain = [Math.max(0, minX - xPadding), maxX + xPadding];-- // Set up scales- const xScale = d3.scaleLinear().domain(xDomain).range([0, width]);- const yScale = d3.scaleLinear().domain([0, maxDensity * 1.1]).range([height, 0]);-- // Apply the current zoom transform- const xScaleZoomed = d3.scaleLinear()- .domain([Math.max(0, transform.rescaleX(xScale).domain()[0]), transform.rescaleX(xScale).domain()[1]])- .range([0, width]);-- const yScaleZoomed = d3.scaleLinear()- .domain([Math.max(0, transform.rescaleY(yScale).domain()[0]), transform.rescaleY(yScale).domain()[1]])- .range([height, 0]);- // Create axes- const xAxis = d3.axisBottom(xScaleZoomed).ticks(10).tickSize(-height);- const yAxis = d3.axisLeft(yScaleZoomed).ticks(5).tickSize(-width);-- // Add X axis with label- const xAxisGroup = svg- .append("g")- .attr("class", "x-axis")- .attr("transform", `translate(0,${height})`)- .call(xAxis);-- svg- .append("text")- .attr("transform", `translate(${width / 2}, ${height + margin.bottom - 5})`)- .style("text-anchor", "middle")- .style("font-family", "monospace")- .style("font-size", "10px")- .style("fill", theme.palette.text.secondary)- .text("Frame Duration (ms)");-- // Add Y axis with label- const yAxisGroup = svg- .append("g")- .attr("class", "y-axis")- .call(yAxis);-- svg- .append("text")- .attr("transform", "rotate(-90)")- .attr("y", 0 - margin.left)- .attr("x", 0 - height / 2)- .attr("dy", "1em")- .style("text-anchor", "middle")- .style("font-family", "monospace")- .style("font-size", "10px")- .style("fill", theme.palette.text.secondary)- .text("Density");-- // Style axes- applyAxisStyles(svg, theme);-- // Add threshold lines- // const thresholds = [- // { value: 16.67, label: "60 FPS", color: theme.palette.success.main },- // { value: 33.33, label: "30 FPS", color: theme.palette.warning.main },- // ];- //- // renderThresholdLines(chartArea, thresholds, xScaleZoomed, yScaleZoomed, width, height, false);-- // Draw histograms- sources.forEach(source => {- if (!source.histogram || source.histogram.bin_edges.length === 0) return;-- const bins = source.histogram.bin_edges.map((edge, i) => ({- x0: edge,- x1: i < source.histogram!.bin_edges.length - 1 ? source.histogram!.bin_edges[i + 1] : edge + 0.1,- density: i < source.histogram!.bin_densities.length ? source.histogram!.bin_densities[i] : 0,- count: i < source.histogram!.bin_counts.length ? source.histogram!.bin_counts[i] : 0- }));-- // Add histogram bars- chartArea- .selectAll(`.bar-${source.id}`)- .data(bins)- .enter()- .append("rect")- .attr("class", `bar-${source.id}`)- .attr("x", d => xScaleZoomed(d.x0))- .attr("width", d => Math.max(0, xScaleZoomed(d.x1) - xScaleZoomed(d.x0) - 1))- .attr("y", d => {- const y = yScaleZoomed(d.density);- // Ensure y is valid and not greater than height- return isNaN(y) ? height : Math.min(height, Math.max(0, y));- })- .attr("height", d => {- const y = yScaleZoomed(d.density);- // Calculate height ensuring it's always positive- if (isNaN(y)) return 0;- const barHeight = height - Math.min(height, Math.max(0, y));- return Math.max(0, barHeight);- })- .attr("fill", source.color)- .attr("stroke", theme.palette.background.paper)- .attr("stroke-width", 0.5)- .attr("opacity", 0.7);- });-- // Add legend- const legend = svg- .append("g")- .attr("transform", `translate(${width + 10}, 0)`)- .attr("font-family", "monospace")- .attr("font-size", "10px");-- sources.forEach((source, i) => {- if (!source.histogram) return;-- const legendItem = legend.append("g").attr("transform", `translate(0, ${i * 20})`);- legendItem.append("rect").attr("width", 12).attr("height", 12).attr("fill", source.color);- legendItem.append("text")- .attr("x", 20)- .attr("y", 10)- .style("fill", theme.palette.text.primary)- .text(`${source.name} (${source.totalSamples})`);- });-- // Add tooltip- const tooltip = createTooltip(theme);-- // Add tooltip for histogram bars- sources.forEach(source => {- if (!source.histogram) return;-- chartArea- .selectAll(`.bar-${source.id}`)- .on("mouseover", function (event, d: any) {- d3.select(this).attr("opacity", 1).attr("stroke-width", 1);-- tooltip- .style("opacity", 1)- .html(`- <div style="display: grid; grid-template-columns: auto auto; gap: 4px;">- <span style="color: ${theme.palette.text.secondary};">SOURCE:</span>- <span style="color: ${source.color};">${source.name}</span>- <span style="color: ${theme.palette.text.secondary};">RANGE:</span>- <span>${d.x0.toFixed(2)} - ${d.x1.toFixed(2)} ms</span>- <span style="color: ${theme.palette.text.secondary};">COUNT:</span>- <span>${d.count} samples</span>- <span style="color: ${theme.palette.text.secondary};">PERCENTAGE:</span>- <span>${(d.density * 100).toFixed(1)}%</span>- <span style="color: ${theme.palette.text.secondary};">FPS RANGE:</span>- <span>${(1000 / d.x1).toFixed(1)} - ${(1000 / d.x0).toFixed(1)} fps</span>- </div>- `)- .style("left", event.pageX + 10 + "px")- .style("top", event.pageY - 28 + "px");- })- .on("mouseout", function () {- d3.select(this).attr("opacity", 0.7).attr("stroke-width", 0.5);- tooltip.style("opacity", 0);- });- });-- return () => tooltip.remove();- }, [- frontendFramerate,- backendFramerate,- recentFrontendFrameDurations,- recentBackendFrameDurations,- frontendColor,- backendColor,- theme- ]);-- return (- <BaseD3ChartView- title={title}- renderChart={renderChart}- />- );++ if (minX === Infinity) minX = 0+ if (maxX === -Infinity) maxX = 60+ if (maxDensity === 0) maxDensity = 1++ const xPad = Math.max(1, (maxX - minX) * 0.05)++ state.xScale.domain([minX - xPad, maxX + xPad])+ state.yScale.domain([0, maxDensity * 1.15])++ // Update axes in-place+ const xAxisGen = d3+ .axisBottom(state.xScale)+ .ticks(Math.max(2, Math.min(8, Math.floor(width / 50))))+ .tickSize(-height)+ const yAxisGen = d3+ .axisLeft(state.yScale)+ .ticks(Math.max(2, Math.min(5, Math.floor(height / 30))))+ .tickSize(-width)++ // Clear old tick elements before redrawing to prevent SVG element accumulation.+ // The histogram domain shifts as bin ranges change, so unlike the timeseries+ // (which uses fixed relative-time ticks), we must explicitly remove stale ticks.+ xAxisG.selectAll("*").remove()+ xAxisG.call(xAxisGen)+ yAxisG.selectAll("*").remove()+ yAxisG.call(yAxisGen)+ applyAxisStyles(svg, theme)++ // D3 data join for bars — enter/update/exit pattern+ const numSources = [frontendHist, backendHist].filter(Boolean).length+ const barInset = numSources > 1 ? 1 : 0++ const updateBars = (+ group: d3.Selection<SVGGElement, unknown, null, undefined>,+ bins: HistogramBin[],+ color: string,+ srcIdx: number,+ ) => {+ const bars = group.selectAll<SVGRectElement, HistogramBin>("rect")+ .data(bins, (d) => `${d.x0}-${d.x1}`)++ // EXIT: remove bars for bins that no longer exist+ bars.exit().remove()++ // ENTER: create new bars+ const entered = bars.enter()+ .append("rect")+ .attr("fill", color)+ .attr("stroke", theme.palette.background.paper)+ .attr("stroke-width", 0.5)+ .attr("opacity", 0.7)++ // UPDATE + ENTER: update positions and sizes for all bars+ entered.merge(bars)+ .attr("x", (d) => state.xScale(d.x0) + srcIdx * barInset)+ .attr("width", (d) => {+ const w = state.xScale(d.x1) - state.xScale(d.x0) - barInset+ return Math.max(1, w)+ })+ .attr("y", (d) => {+ const y = state.yScale(d.density)+ return isNaN(y) ? height : Math.min(height, Math.max(0, y))+ })+ .attr("height", (d) => {+ const y = state.yScale(d.density)+ if (isNaN(y)) return 0+ return Math.max(0, height - Math.min(height, Math.max(0, y)))+ })+ }++ updateBars(state.frontendBarGroup, frontendHist?.bins ?? [], frontendColor, 0)+ updateBars(state.backendBarGroup, backendHist?.bins ?? [], backendColor, numSources > 1 ? 1 : 0)+ },+ [getFramerateStore, frontendColor, backendColor, theme, t]+ )++ return <BaseD3ChartView title={title} initChart={initChart} updateChart={updateChart}+ margin={{top: 20, right: 10, bottom: 42, left: 40}} />}diff --git a/freemocap-ui/src/components/framerate-viewer/FramerateStatisticsView.tsx b/freemocap-ui/src/components/framerate-viewer/FramerateStatisticsView.tsxindex d02a685f..c61511b6 100644--- a/freemocap-ui/src/components/framerate-viewer/FramerateStatisticsView.tsx+++ b/freemocap-ui/src/components/framerate-viewer/FramerateStatisticsView.tsx@@ -1,4 +1,5 @@// src/components/framerate-viewer/FramerateStatisticsView.tsx+import React from "react";import {Box,Divider,@@ -13,53 +14,48 @@ import {Typography,} from "@mui/material";import {alpha, useTheme} from "@mui/material/styles";-import {CurrentFramerate} from "@/store/slices/framerate/framerate-slice";-import {useState} from "react";+import {DetailedFramerate} from "@/services/server/server-helpers/framerate-store";+import {useEffect, useRef, useState} from "react";+import {frontendColor, backendColor} from "@/components/framerate-viewer/FrameRateViewer";+import {useTranslation} from "react-i18next";+import {useServer} from "@/services/server/ServerContextProvider";++const STATS_POLL_INTERVAL_MS = 500;type FramerateStatisticsViewProps = {- frontendFramerate: CurrentFramerate | null;- backendFramerate: CurrentFramerate | null;compact?: boolean;};-// Format number with fixed precision-const formatNumber = (num: number | null, precision = 3) => {+const formatNumber = (num: number | null, precision = 3): string => {return num !== null ? num.toFixed(precision) : "N/A";};+// --- Progressive tooltip (renders once, state is local to tooltip interaction) ---+type ProgressiveTooltipProps = {shortInfo: string;longInfo: string;children: React.ReactElement;};-// Progressive tooltip component that shows more info on clickexport const ProgressiveTooltip = ({- shortInfo,- longInfo,- children,- }: ProgressiveTooltipProps) => {+ shortInfo,+ longInfo,+ children,+}: ProgressiveTooltipProps) => {const [isExpanded, setIsExpanded] = useState(false);const theme = useTheme();-- const handleTooltipClick = (e: React.MouseEvent) => {- e.preventDefault();- setIsExpanded(!isExpanded);- };+ const {t} = useTranslation();return (<Tooltiptitle={- <Box onClick={handleTooltipClick} sx={{cursor: "pointer"}}>+ <Box onClick={(e) => { e.preventDefault(); setIsExpanded(!isExpanded); }} sx={{cursor: "pointer"}}><Typography variant="body2">{isExpanded ? longInfo : shortInfo}</Typography>- <Typography- variant="caption"- color="text.secondary"- sx={{display: "block", mt: 1, textAlign: "center"}}- >- {isExpanded ? "Click to show less" : "Click to learn more"}+ <Typography variant="caption" color="text.secondary" sx={{display: "block", mt: 1, textAlign: "center"}}>+ {isExpanded ? t("clickToShowLess") : t("clickToLearnMore")}</Typography></Box>}@@ -91,403 +87,188 @@ type HeaderCellWithTooltipProps = {align?: "inherit" | "left" | "center" | "right" | "justify";};-// Reusable tooltip component for column headersexport const HeaderCellWithTooltip = ({- label,- shortInfo,- longInfo,- style = {},- align = "center",- }: HeaderCellWithTooltipProps) => {- return (- <ProgressiveTooltip shortInfo={shortInfo} longInfo={longInfo}>- <TableCell align={align} sx={style}>- {label}- </TableCell>- </ProgressiveTooltip>- );-};+ label,+ shortInfo,+ longInfo,+ style = {},+ align = "center",+}: HeaderCellWithTooltipProps) => (+ <ProgressiveTooltip shortInfo={shortInfo} longInfo={longInfo}>+ <TableCell align={align} sx={style}>+ {label}+ </TableCell>+ </ProgressiveTooltip>+);-type FramerateRowProps = {- framerateData: CurrentFramerate | null;- colorMap: Record<string, string>;- getCellStyle: (metricType: string) => object;- isDarkMode: boolean;- theme: any;- shortTooltip: string;- longTooltip: string;-};+// --- Ref key types ----const FramerateRow = ({- framerateData,- colorMap,- getCellStyle,- isDarkMode,- theme,- shortTooltip,- longTooltip,- }: FramerateRowProps) => {- const isBackend =- framerateData?.framerate_source === "Backend" ||- (!framerateData?.framerate_source && framerateData);+const METRIC_KEYS = ["recent", "mean", "median", "stdDev", "max", "min"] as const;+type MetricKey = typeof METRIC_KEYS[number];+const ROW_KEYS = ["backend", "frontend"] as const;+type RowKey = typeof ROW_KEYS[number];+type RefKey = `${RowKey}-${MetricKey}-${"primary" | "secondary"}` | `${RowKey}-samples`;- return (- <TableRow>- <ProgressiveTooltip shortInfo={shortTooltip} longInfo={longTooltip}>- <TableCell- sx={{- fontWeight: "bold",- borderLeft: `3px solid ${colorMap.current}`,- paddingY: 0.5,- color: isDarkMode- ? isBackend- ? theme.palette.secondary.light- : theme.palette.primary.light- : isBackend- ? theme.palette.secondary.main- : theme.palette.primary.main,- cursor: "help",- }}- >- {framerateData?.framerate_source ||- (isBackend ? "Backend" : "Frontend")}- <Typography- variant="caption"- display="block"- color="text.secondary"- sx={{fontSize: "0.6rem"}}- >- {framerateData?.calculation_window_size || 0} samples- </Typography>- </TableCell>- </ProgressiveTooltip>-- <MetricCell- label="current"- colorMap={colorMap}- getCellStyle={getCellStyle}- primaryValue={framerateData?.mean_frame_duration_ms}- primarySuffix="ms"- secondaryValue={framerateData?.mean_frames_per_second}- secondarySuffix="fps"- />+// --- Extract display strings from store data ---- <MetricCell- label="min"- colorMap={colorMap}- getCellStyle={getCellStyle}- primaryValue={framerateData?.frame_duration_min}- primarySuffix="ms"- secondaryValue={- framerateData?.frame_duration_min &&- framerateData.frame_duration_min > 0- ? 1000 / framerateData.frame_duration_min- : null- }- secondarySuffix="fps"- />+function computeCellValues(+ currentData: DetailedFramerate | null,+ aggregateData: DetailedFramerate | null,+): Record<MetricKey, {primary: string; secondary: string}> & {samples: string} {+ const safeFps = (durationMs: number | null | undefined): number | null =>+ durationMs !== null && durationMs !== undefined && durationMs > 0 ? 1000 / durationMs : null;- <MetricCell- label="max"- colorMap={colorMap}- getCellStyle={getCellStyle}- primaryValue={framerateData?.frame_duration_max}- primarySuffix="ms"- secondaryValue={- framerateData?.frame_duration_max &&- framerateData.frame_duration_max > 0- ? 1000 / framerateData.frame_duration_max- : null- }- secondarySuffix="fps"- />+ return {+ recent: {+ primary: formatNumber(currentData?.mean_frames_per_second ?? null) + " fps",+ secondary: formatNumber(currentData?.mean_frame_duration_ms ?? null) + " ms",+ },+ mean: {+ primary: formatNumber(safeFps(aggregateData?.frame_duration_mean)) + " fps",+ secondary: formatNumber(aggregateData?.frame_duration_mean ?? null) + " ms",+ },+ median: {+ primary: formatNumber(safeFps(aggregateData?.frame_duration_median)) + " fps",+ secondary: formatNumber(aggregateData?.frame_duration_median ?? null) + " ms",+ },+ stdDev: {+ primary: formatNumber(aggregateData?.frame_duration_stddev ?? null) + " ms",+ secondary: formatNumber(aggregateData ? aggregateData.frame_duration_coefficient_of_variation * 100 : null) + " CV%",+ },+ max: {+ primary: formatNumber(safeFps(aggregateData?.frame_duration_min)) + " fps",+ secondary: formatNumber(aggregateData?.frame_duration_min ?? null) + " ms",+ },+ min: {+ primary: formatNumber(safeFps(aggregateData?.frame_duration_max)) + " fps",+ secondary: formatNumber(aggregateData?.frame_duration_max ?? null) + " ms",+ },+ samples: String(aggregateData?.calculation_window_size || 0),+ };+}- <MetricCell- label="mean"- colorMap={colorMap}- getCellStyle={getCellStyle}- primaryValue={framerateData?.frame_duration_mean}- primarySuffix="ms"- secondaryValue={framerateData?.frame_duration_mean && framerateData.frame_duration_mean > 0- ? 1000 / framerateData.frame_duration_mean- : null}- secondarySuffix="fps"- />+// --- Main component: renders MUI table once, updates numbers via refs ---- <MetricCell- label="median"- colorMap={colorMap}- getCellStyle={getCellStyle}- primaryValue={framerateData?.frame_duration_median}- primarySuffix="ms"- secondaryValue={framerateData?.frame_duration_median && framerateData.frame_duration_median > 0- ? 1000 / framerateData.frame_duration_median- : null}- secondarySuffix="fps"- />+export default function FramerateStatisticsView({+ compact = false,+}: FramerateStatisticsViewProps) {+ const theme = useTheme();+ const isDarkMode = theme.palette.mode === "dark";+ const {t} = useTranslation();+ const {getFramerateStore} = useServer();- <MetricCell- label="stdDev"- colorMap={colorMap}- getCellStyle={getCellStyle}- primaryValue={framerateData?.frame_duration_stddev}- primarySuffix="ms"- secondaryValue={- framerateData- ? framerateData.frame_duration_coefficient_of_variation * 100- : null- }- secondarySuffix="CV%"- />- </TableRow>- );-};+ const spanRefs = useRef<Record<string, HTMLSpanElement | null>>({});+ const setSpanRef = (key: RefKey) => (el: HTMLSpanElement | null) => {+ spanRefs.current[key] = el;+ };-type MetricCellProps = {- label: string;- colorMap: Record<string, string>;- getCellStyle: (metricType: string) => object;- primaryValue: number | null | undefined;- primarySuffix?: string;- secondaryValue?: number | null | undefined;- secondarySuffix?: string;-};+ // Poll the store and write to DOM spans — zero React re-renders.+ useEffect(() => {+ const tick = () => {+ const snapshot = getFramerateStore().getSnapshot();+ const rows: [RowKey, DetailedFramerate | null, DetailedFramerate | null][] = [+ ["backend", snapshot.currentBackendFramerate, snapshot.aggregateBackendFramerate],+ ["frontend", snapshot.currentFrontendFramerate, snapshot.aggregateFrontendFramerate],+ ];-const MetricCell = ({- label,- colorMap,- getCellStyle,- primaryValue,- primarySuffix = "",- secondaryValue,- secondarySuffix = "",- }: MetricCellProps) => {- return (- <TableCell align="center" sx={getCellStyle(label)}>- <Typography- fontWeight="bold"- fontFamily="monospace"- color={colorMap[label]}- sx={{fontSize: "0.7rem", whiteSpace: "nowrap"}}- >- {formatNumber(primaryValue ?? null)} {primarySuffix}- </Typography>- {secondaryValue !== undefined && (- <Typography- variant="caption"- color={colorMap[label]}- sx={{fontSize: "0.6rem", opacity: 0.9, whiteSpace: "nowrap"}}- >- {formatNumber(secondaryValue ?? null)} {secondarySuffix}- </Typography>- )}- </TableCell>- );-};+ for (const [rowKey, currentData, aggregateData] of rows) {+ const vals = computeCellValues(currentData, aggregateData);+ for (const metric of METRIC_KEYS) {+ const pEl = spanRefs.current[`${rowKey}-${metric}-primary`];+ if (pEl) pEl.textContent = vals[metric].primary;+ const sEl = spanRefs.current[`${rowKey}-${metric}-secondary`];+ if (sEl) sEl.textContent = vals[metric].secondary;+ }+ const samplesEl = spanRefs.current[`${rowKey}-samples`];+ if (samplesEl) samplesEl.textContent = `${vals.samples} ${t("samples")}`;+ }+ };+ tick();+ const id = setInterval(tick, STATS_POLL_INTERVAL_MS);+ return () => clearInterval(id);+ }, [getFramerateStore, t]);-export default function FramerateStatisticsView({- frontendFramerate,- backendFramerate,- compact = false,- }: FramerateStatisticsViewProps) {- const theme = useTheme();- const isDarkMode = theme.palette.mode === "dark";+ // --- Static styles ---- // Define color map with high contrast for both light and dark themesconst colorMap: Record<string, string> = {- current: isDarkMode- ? theme.palette.success.light- : theme.palette.success.main,- min: isDarkMode ? theme.palette.info.light : theme.palette.info.main,- max: isDarkMode ? theme.palette.error.light : theme.palette.error.main,+ recent: isDarkMode ? theme.palette.success.light : theme.palette.success.main,mean: isDarkMode ? theme.palette.warning.light : theme.palette.warning.main,- median: isDarkMode- ? theme.palette.warning.dark- : theme.palette.warning.dark,- stdDev: isDarkMode- ? theme.palette.primary.light- : theme.palette.primary.main,- cv: isDarkMode- ? theme.palette.secondary.light- : theme.palette.secondary.main,+ median: isDarkMode ? theme.palette.warning.dark : theme.palette.warning.dark,+ stdDev: isDarkMode ? theme.palette.primary.light : theme.palette.primary.main,+ max: isDarkMode ? theme.palette.error.light : theme.palette.error.main,+ min: isDarkMode ? theme.palette.info.light : theme.palette.info.main,};- // Generate cell style based on metric type- const getCellStyle = (metricType: string) => {- return {- backgroundColor: alpha(- colorMap[metricType] || theme.palette.grey[500],- isDarkMode ? 0.2 : 0.1- ),- borderBottom: "none",- padding: "2px 4px",- };- };+ const getCellStyle = (metricType: string) => ({+ backgroundColor: alpha(colorMap[metricType] || theme.palette.grey[500], isDarkMode ? 0.2 : 0.1),+ borderBottom: "none",+ padding: "2px 4px",+ });- // Common header cell styles- const headerCellStyle = {- fontWeight: "bold",- paddingY: 0.5,- };+ const headerCellStyle = {fontWeight: "bold", paddingY: 0.5};- // Tooltips content - short and long versionsconst tooltips = {- source: {- short: "Frontend displays frames, Backend captures frames.",- long: "The backend is the true rate at which frames are pulled/recorded from the camera, while the frontend is the rate at which they are received and displayed. Skellycam prioritizes backend performance for recording quality, so that number should stay more stable. If the frontend framerate diverges from the backend, it indicates your system resources are taxed. Consider using fewer cameras or decreasing framerate/resolution.",- },- current: {- short: "Most recent frame time and corresponding FPS.",- long: "This shows the most recent measurement of how long it takes to process a single frame (in milliseconds) and the equivalent frames per second (FPS). Lower frame times and higher FPS indicate better performance.",- },- min: {- short: "Fastest frame time (lowest latency) and highest FPS achieved.",- long: "This represents the minimum time it took to process a single frame during the sampling window. This corresponds to the maximum FPS your system achieved during optimal conditions.",- },- max: {- short: "Slowest frame time (highest latency) and lowest FPS experienced.",- long: "This represents the maximum time it took to process a single frame during the sampling window. This corresponds to the minimum FPS your system achieved during worst-case conditions. Occasional spikes are normal, but consistently high values may indicate performance issues.",- },- mean: {- short: "Average frame time and FPS across all samples.",- long: "The arithmetic mean (average) of all frame times measured during the sampling window and the corresponding FPS. This gives a good overall picture of performance but may be skewed by outliers.",- },- median: {- short: "Middle value of all frame times (50th percentile).",- long: "The median represents the middle value when all frame times are sorted from fastest to slowest. Unlike the mean, the median is not affected by extreme outliers, making it a more stable indicator of typical performance.",- },- stdDev: {- short: "Measures frame time variability. CV% is relative variability.",- long: "Standard deviation measures the amount of variation in frame times. Lower values indicate more consistent performance. The Coefficient of Variation (CV%) expresses this variability as a percentage of the mean, making it easier to compare stability across different frame rates. Lower CV% indicates more stable performance.",- },+ source: {short: t("statsSourceShort"), long: t("statsSourceLong")},+ recent: {short: t("statsCurrentShort"), long: t("statsCurrentLong")},+ mean: {short: t("statsMeanShort"), long: t("statsMeanLong")},+ median: {short: t("statsMedianShort"), long: t("statsMedianLong")},+ stdDev: {short: t("statsStdDevShort"), long: t("statsStdDevLong")},+ max: {short: t("statsMaxShort"), long: t("statsMaxLong")},+ min: {short: t("statsMinShort"), long: t("statsMinLong")},};+ // --- Render helpers (called once at mount) ---++ const renderMetricCell = (rowKey: RowKey, metric: MetricKey) => (+ <TableCell key={metric} align="center" sx={getCellStyle(metric)}>+ <Typography fontWeight="bold" fontFamily="monospace" color={colorMap[metric]} sx={{fontSize: "0.7rem", whiteSpace: "nowrap"}}>+ <span ref={setSpanRef(`${rowKey}-${metric}-primary`)}>--</span>+ </Typography>+ <Typography variant="caption" color={colorMap[metric]} sx={{fontSize: "0.6rem", opacity: 0.9, whiteSpace: "nowrap"}}>+ <span ref={setSpanRef(`${rowKey}-${metric}-secondary`)}>--</span>+ </Typography>+ </TableCell>+ );++ const renderRow = (rowKey: RowKey, sourceColor: string, sourceLabel: string, shortTooltip: string, longTooltip: string) => (+ <TableRow key={rowKey}>+ <ProgressiveTooltip shortInfo={shortTooltip} longInfo={longTooltip}>+ <TableCell sx={{fontWeight: "bold", borderLeft: `4px solid ${sourceColor}`, backgroundColor: `${sourceColor}22`, paddingY: 0.5, paddingLeft: 1, color: sourceColor, cursor: "help"}}>+ {sourceLabel}+ <Typography variant="caption" display="block" color="text.secondary" sx={{fontSize: "0.6rem"}}>+ <span ref={setSpanRef(`${rowKey}-samples`)}>--</span>+ </Typography>+ </TableCell>+ </ProgressiveTooltip>+ {METRIC_KEYS.map((metric) => renderMetricCell(rowKey, metric))}+ </TableRow>+ );++ // --- Static MUI table (rendered once) ---+return (- <TableContainer- component={Paper}- elevation={0}- sx={{- backgroundColor: "transparent",- border: "none",- overflowX: "auto",- }}- >- <Table- size="small"- padding="none"- sx={{- "& .MuiTableCell-root": {- fontSize: "0.65rem",- lineHeight: "1.1",- whiteSpace: "nowrap",- },- }}- >+ <TableContainer component={Paper} elevation={0} sx={{backgroundColor: "transparent", border: "none", overflowX: "auto"}}>+ <Table size="small" padding="none" sx={{"& .MuiTableCell-root": {fontSize: "0.65rem", lineHeight: "1.1", whiteSpace: "nowrap"}}}><TableHead><TableRow>- <HeaderCellWithTooltip- label="Source"- shortInfo={tooltips.source.short}- longInfo={tooltips.source.long}- style={{- ...headerCellStyle,- width: "12%",- color: theme.palette.text.primary,- }}- align="left"- />- <HeaderCellWithTooltip- label="Current"- shortInfo={tooltips.current.short}- longInfo={tooltips.current.long}- style={{- ...headerCellStyle,- ...getCellStyle("current"),- }}- />- <HeaderCellWithTooltip- label="Min"- shortInfo={tooltips.min.short}- longInfo={tooltips.min.long}- style={{- ...headerCellStyle,- ...getCellStyle("min"),- }}- />- <HeaderCellWithTooltip- label="Max"- shortInfo={tooltips.max.short}- longInfo={tooltips.max.long}- style={{- ...headerCellStyle,- ...getCellStyle("max"),- }}- />- <HeaderCellWithTooltip- label="Mean"- shortInfo={tooltips.mean.short}- longInfo={tooltips.mean.long}- style={{- ...headerCellStyle,- ...getCellStyle("mean"),- }}- />- <HeaderCellWithTooltip- label="Median"- shortInfo={tooltips.median.short}- longInfo={tooltips.median.long}- style={{- ...headerCellStyle,- ...getCellStyle("median"),- }}- />- <HeaderCellWithTooltip- label="StdDev/CV"- shortInfo={tooltips.stdDev.short}- longInfo={tooltips.stdDev.long}- style={{- ...headerCellStyle,- ...getCellStyle("stdDev"),- }}- />+ <HeaderCellWithTooltip label={t("source")} shortInfo={tooltips.source.short} longInfo={tooltips.source.long} style={{...headerCellStyle, width: "12%", color: theme.palette.text.primary}} align="left" />+ <HeaderCellWithTooltip label={t("Recent")} shortInfo={tooltips.recent.short} longInfo={tooltips.recent.long} style={{...headerCellStyle, ...getCellStyle("recent")}} />+ <HeaderCellWithTooltip label={t("mean")} shortInfo={tooltips.mean.short} longInfo={tooltips.mean.long} style={{...headerCellStyle, ...getCellStyle("mean")}} />+ <HeaderCellWithTooltip label={t("median")} shortInfo={tooltips.median.short} longInfo={tooltips.median.long} style={{...headerCellStyle, ...getCellStyle("median")}} />+ <HeaderCellWithTooltip label={t("stdDevCv")} shortInfo={tooltips.stdDev.short} longInfo={tooltips.stdDev.long} style={{...headerCellStyle, ...getCellStyle("stdDev")}} />+ <HeaderCellWithTooltip label={t("max")} shortInfo={tooltips.max.short} longInfo={tooltips.max.long} style={{...headerCellStyle, ...getCellStyle("max")}} />+ <HeaderCellWithTooltip label={t("min")} shortInfo={tooltips.min.short} longInfo={tooltips.min.long} style={{...headerCellStyle, ...getCellStyle("min")}} /></TableRow>- {/* Add the divider inside TableHead */}<TableRow>- <TableCell colSpan={7} sx={{padding: 0}}>- <Divider sx={{borderColor: theme.palette.divider}}/>- </TableCell>+ <TableCell colSpan={7} sx={{padding: 0}}><Divider sx={{borderColor: theme.palette.divider}} /></TableCell></TableRow></TableHead>-<TableBody>- {/* Frontend Row */}- <FramerateRow- framerateData={frontendFramerate}- colorMap={colorMap}- getCellStyle={getCellStyle}- isDarkMode={isDarkMode}- theme={theme}- shortTooltip="Displays received frames."- longTooltip="Frontend represents the UI rendering performance. It shows how quickly your display receives and renders frames. Performance issues here won't affect recording quality but may impact your ability to monitor cameras in real-time."- />-- {/* Divider between rows - now properly inside TableBody */}+ {renderRow("backend", backendColor, t("server"), t("capturesFramesFromCamera"), "Server represents the camera frame-grabbing performance. This is the true rate at which frames are pulled from the camera and saved during recording. This is the most important metric for recording quality and should remain stable even if display performance fluctuates.")}<TableRow>- <TableCell colSpan={7} sx={{padding: 0}}>- <Divider sx={{borderColor: theme.palette.divider}}/>- </TableCell>+ <TableCell colSpan={7} sx={{padding: 0}}><Divider sx={{borderColor: theme.palette.divider}} /></TableCell></TableRow>-- {/* Backend Row */}- <FramerateRow- framerateData={backendFramerate}- colorMap={colorMap}- getCellStyle={getCellStyle}- isDarkMode={isDarkMode}- theme={theme}- shortTooltip="Captures frames from camera."- longTooltip="Backend represents the camera frame-grabbing performance. This is the true rate at which frames are pulled from the camera and saved during recording. This is the most important metric for recording quality and should remain stable even if frontend performance fluctuates."- />+ {renderRow("frontend", frontendColor, t("display"), t("rendersReceivedFrames"), t("displayTooltipLong"))}</TableBody></Table></TableContainer>diff --git a/freemocap-ui/src/components/framerate-viewer/FramerateTimeseriesView.tsx b/freemocap-ui/src/components/framerate-viewer/FramerateTimeseriesView.tsxindex 41e946a2..2dee7711 100644--- a/freemocap-ui/src/components/framerate-viewer/FramerateTimeseriesView.tsx+++ b/freemocap-ui/src/components/framerate-viewer/FramerateTimeseriesView.tsx@@ -1,237 +1,267 @@// src/components/framerate-viewer/FramerateTimeseriesView.tsx-import {useCallback} from "react"+import {useCallback, useRef} from "react"import * as d3 from "d3"import {useTheme} from "@mui/material/styles"-import {CurrentFramerate} from "@/store/slices/framerate/framerate-slice"-import {applyAxisStyles, createTooltip, renderEmptyChart} from "@/components/framerate-viewer/d3ChartUtils";-import BaseD3ChartView from "@/components/framerate-viewer/BaseD3ChartView";+import {TimestampedSample} from "@/services/server/server-helpers/framerate-store"+import {applyAxisStyles} from "@/components/framerate-viewer/d3ChartUtils"+import BaseD3ChartView, {ChartScaffolding, ChartLifecycle} from "@/components/framerate-viewer/BaseD3ChartView"+import {useTranslation} from "react-i18next"+import {useServer} from "@/services/server/ServerContextProvider"type FramerateTimeseriesProps = {- frontendFramerate: CurrentFramerate | null- backendFramerate: CurrentFramerate | null- recentFrontendFrameDurations: number[]- recentBackendFrameDurations: number[]frontendColor: stringbackendColor: stringtitle?: string}-type ChartRenderProps = {- svg: d3.Selection<SVGGElement, unknown, null, undefined>;- chartArea: d3.Selection<SVGGElement, unknown, null, undefined>;- width: number;- height: number;- margin: { top: number; right: number; bottom: number; left: number };- transform: d3.ZoomTransform;-};++type FpsSample = { timestamp: number; value: number }++/** How many seconds of data the rolling window shows. */+const WINDOW_SECONDS = 60++/** Fixed relative-time tick positions (seconds ago). These never change,+ * so D3's axis join always matches existing tick elements — zero DOM churn. */+const RELATIVE_TICK_SECONDS = [0, -15, -30, -45, -60]++/**+ * Convert duration samples to FPS in-place into a reusable output array.+ * Avoids allocating a fresh array on every update call.+ */+function toFpsInPlace(+ samples: TimestampedSample[],+ out: FpsSample[],+): void {+ let writeIdx = 0+ for (let i = 0; i < samples.length; i++) {+ const s = samples[i]+ if (s.value > 0) {+ if (writeIdx < out.length) {+ out[writeIdx].timestamp = s.timestamp+ out[writeIdx].value = 1000 / s.value+ } else {+ out.push({timestamp: s.timestamp, value: 1000 / s.value})+ }+ writeIdx+++ }+ }+ out.length = writeIdx+}++/**+ * Persistent mutable state shared between initChart and updateChart.+ * Stored in a ref so it survives across data updates without triggering+ * React re-renders or D3 DOM teardown.+ */+type ChartState = {+ frontendPath: d3.Selection<SVGPathElement, unknown, null, undefined>+ backendPath: d3.Selection<SVGPathElement, unknown, null, undefined>+ xScale: d3.ScaleLinear<number, number>+ yScale: d3.ScaleLinear<number, number>+ frontendData: FpsSample[]+ backendData: FpsSample[]+ windowEnd: number+ // Reusable scratch arrays to avoid per-update allocations+ frontendFpsBuf: FpsSample[]+ backendFpsBuf: FpsSample[]+}export default function FramerateTimeseriesView({- frontendFramerate,- backendFramerate,- recentFrontendFrameDurations,- recentBackendFrameDurations,- frontendColor,- backendColor,- title = "Frame Duration Over Time"- }: FramerateTimeseriesProps) {+ frontendColor,+ backendColor,+ title = "Framerate Over Time",+}: FramerateTimeseriesProps) {const theme = useTheme()+ const {t} = useTranslation()+ const stateRef = useRef<ChartState | null>(null)+ const {getFramerateStore} = useServer()- const renderChart = useCallback(({svg, chartArea, width, height, margin, transform}: ChartRenderProps) => {- // Prepare data sources - using the recent frame durations arrays- const sources = [- {- id: "frontend",- name: frontendFramerate?.framerate_source || "Frontend",- color: frontendColor,- data: recentFrontendFrameDurations.map((value, index) => ({- timestamp: Date.now() - (recentFrontendFrameDurations.length - index) *- (frontendFramerate?.mean_frame_duration_ms || 16.67),- value- }))- },- {- id: "backend",- name: backendFramerate?.framerate_source || "Backend",- color: backendColor,- data: recentBackendFrameDurations.map((value, index) => ({- timestamp: Date.now() - (recentBackendFrameDurations.length - index) *- (backendFramerate?.mean_frame_duration_ms || 33.33),- value- }))- }- ];+ // initChart — creates persistent SVG elements that live for the chart's lifetime+ const initChart = useCallback(+ ({svg, chartArea, xAxisG, yAxisG, width, height}: ChartScaffolding): ChartLifecycle => {+ // X-axis uses relative seconds (0 = now, -60 = oldest).+ // Fixed domain means axis ticks never enter/exit — zero DOM churn.+ const xScale = d3.scaleLinear().domain([-WINDOW_SECONDS, 0]).range([0, width])+ const yScale = d3.scaleLinear().range([height, 0])- if (sources.every((s) => s.data.length === 0)) {- renderEmptyChart(svg, width, height, theme);- return;- }+ // Build the x-axis once with fixed tick values+ const xAxisGen = d3+ .axisBottom(xScale)+ .tickValues(RELATIVE_TICK_SECONDS)+ .tickSize(-height)+ .tickFormat((d) => {+ const sec = d as number+ return sec === 0 ? "now" : `${sec}s`+ })+ xAxisG.call(xAxisGen)- // Combine all data points to determine overall domain- const allData = sources.flatMap((s) => s.data);-- // Set up scales- const xScale = d3- .scaleTime()- .domain(d3.extent(allData, (d) => new Date(d.timestamp)) as [Date, Date])- .range([0, width]);-- // Calculate y domain with some padding- const yMax = d3.max(allData, (d) => d.value) as number;- const yPadding = Math.max(1, yMax * 0.1);-- const yScale = d3- .scaleLinear()- .domain([0, yMax + yPadding])- .range([height, 0]);-- // Apply the current zoom transform- const xScaleZoomed = transform.rescaleX(xScale);- const yScaleZoomed = transform.rescaleY(yScale);-- // Create axes- const xAxis = d3- .axisBottom(xScaleZoomed)- .ticks(5)- .tickSize(-height)- .tickFormat(d3.timeFormat("%H:%M:%S") as any);-- const yAxis = d3.axisLeft(yScaleZoomed).ticks(10).tickSize(-width);-- // Add X axis- const xAxisGroup = svg- .append("g")- .attr("class", "x-axis")- .attr("transform", `translate(0,${height})`)- .call(xAxis);-- xAxisGroup- .selectAll("text")- .style("text-anchor", "end")- .attr("dx", "-.8em")- .attr("dy", ".15em")- .attr("transform", "rotate(-45)");-- // Add Y axis- const yAxisGroup = svg- .append("g")- .attr("class", "y-axis")- .call(yAxis);-- // Add Y axis label- svg- .append("text")- .attr("transform", "rotate(-90)")- .attr("y", 0 - margin.left)- .attr("x", 0 - height / 2)- .attr("dy", "1em")- .style("text-anchor", "middle")- .style("font-family", "monospace")- .style("font-size", "14px")- .style("fill", theme.palette.text.secondary)- .text("Frame Duration (ms)");-- // Style axes- applyAxisStyles(svg, theme);-- // Add threshold lines- // const thresholds = [- // { value: 16.67, label: "60 FPS", color: theme.palette.success.main },- // { value: 33.33, label: "30 FPS", color: theme.palette.warning.main },- // ];- //- // renderThresholdLines(chartArea, thresholds, xScaleZoomed, yScaleZoomed, width, height, true);-- // Create line generator- const line = d3- .line<{ timestamp: number, value: number }>()- .x((d) => xScaleZoomed(new Date(d.timestamp)))- .y((d) => yScaleZoomed(d.value))- .curve(d3.curveLinear);-- // Add lines and points for each source- sources.forEach((source) => {- if (source.data.length === 0) return;-- // Add the line path- chartArea- .append("path")- .datum(source.data)+ // Build the y-axis with initial placeholder ticks+ const yAxisGen = d3+ .axisLeft(yScale)+ .ticks(Math.max(2, Math.min(5, Math.floor(height / 30))))+ .tickSize(-width)+ yAxisG.call(yAxisGen)++ applyAxisStyles(chartArea, theme)++ // Axis labels (appended to svg root group, outside clip-path)+ svg.append("text")+ .attr("class", "x-axis-label")+ .attr("x", width / 2)+ .attr("y", height + 32)+ .attr("text-anchor", "middle")+ .style("font-family", "monospace")+ .style("font-size", "10px")+ .style("fill", theme.palette.text.secondary)+ .text("Time")++ svg.append("text")+ .attr("class", "y-axis-label")+ .attr("transform", "rotate(-90)")+ .attr("x", -height / 2)+ .attr("y", -28)+ .attr("text-anchor", "middle")+ .style("font-family", "monospace")+ .style("font-size", "10px")+ .style("fill", theme.palette.text.secondary)+ .text("FPS")++ // Persistent path elements — one per series, never removed+ const frontendPath = chartArea.append("path").attr("fill", "none")- .attr("stroke", source.color)+ .attr("stroke", frontendColor).attr("stroke-width", 1.5)- .attr("d", line);-- });-- // Add legend- const legend = svg- .append("g")- .attr("transform", `translate(${width + 10}, 0)`)- .attr("font-family", "monospace")- .attr("font-size", "10px");-- sources.forEach((source, i) => {- if (source.data.length === 0) return;-- const legendItem = legend.append("g").attr("transform", `translate(0, ${i * 20})`);- legendItem.append("rect").attr("width", 12).attr("height", 12).attr("fill", source.color);- legendItem.append("text")- .attr("x", 20)- .attr("y", 10)- .style("fill", theme.palette.text.primary)- .text(source.name);- });-- // Add tooltip- const tooltip = createTooltip(theme);-- // Add tooltip for data points- sources.forEach((source) => {- if (source.data.length === 0) return;-- chartArea- .selectAll(`.data-point-${source.id}`)- .on("mouseover", function (event: MouseEvent, d: any) {- const element = this as unknown as SVGCircleElement;- d3.select(element).attr("r", 5).attr("fill", d3.color(source.color)!.brighter(0.5).toString());-- tooltip- .style("opacity", 1)- .html(`- <div style="display: grid; grid-template-columns: auto auto; gap: 4px;">- <span style="color: ${theme.palette.text.secondary};">SOURCE:</span>- <span style="color: ${source.color};">${source.name}</span>- <span style="color: ${theme.palette.text.secondary};">TIME:</span>- <span>${new Date(d.timestamp).toISOString().substr(11, 12)}</span>- <span style="color: ${theme.palette.text.secondary};">DURATION:</span>- <span>${d.value.toFixed(2)} ms</span>- <span style="color: ${theme.palette.text.secondary};">FPS:</span>- <span>${(1000 / d.value).toFixed(2)}</span>- </div>- `)- .style("left", event.pageX + 10 + "px")- .style("top", event.pageY - 28 + "px");- })- .on("mouseout", function (event: MouseEvent, d: any) {- d3.select(this).attr("r", 3).attr("fill", source.color);- tooltip.style("opacity", 0);- });- });-- return () => tooltip.remove();- }, [- frontendFramerate,- backendFramerate,- recentFrontendFrameDurations,- recentBackendFrameDurations,- frontendColor,- backendColor,- theme- ]);-- return (- <BaseD3ChartView- title={title}- renderChart={renderChart}- />- );++ const backendPath = chartArea.append("path")+ .attr("fill", "none")+ .attr("stroke", backendColor)+ .attr("stroke-width", 1.5)++ // Persistent empty-state text (hidden by default)+ chartArea.append("text")+ .attr("class", "empty-text")+ .attr("x", width / 2)+ .attr("y", height / 2)+ .attr("text-anchor", "middle")+ .attr("dominant-baseline", "central")+ .style("font-family", "monospace")+ .style("font-size", "12px")+ .style("fill", theme.palette.text.disabled)+ .style("display", "none")++ stateRef.current = {+ frontendPath,+ backendPath,+ xScale,+ yScale,+ frontendData: [],+ backendData: [],+ windowEnd: 0,+ frontendFpsBuf: [],+ backendFpsBuf: [],+ }++ return {+ cleanup: () => {+ stateRef.current = null+ },+ }+ },+ [theme, frontendColor, backendColor]+ )++ // updateChart — only mutates path `d` attrs and y-axis ticks. Zero DOM adds/removes for x-axis.+ const updateChart = useCallback(+ ({svg, yAxisG, width, height}: ChartScaffolding) => {+ const state = stateRef.current+ if (!state) return++ // Read fresh data directly from the store — no React state involved.+ const snapshot = getFramerateStore().getSnapshot()+ const recentFrontendDurations = snapshot.recentFrontendDurations+ const recentBackendDurations = snapshot.recentBackendDurations++ // Convert durations→FPS using reusable scratch buffers+ toFpsInPlace(recentFrontendDurations, state.frontendFpsBuf)+ toFpsInPlace(recentBackendDurations, state.backendFpsBuf)++ const frontendFps = state.frontendFpsBuf+ const backendFps = state.backendFpsBuf++ const emptyText = svg.select<SVGTextElement>(".empty-text")++ if (frontendFps.length === 0 && backendFps.length === 0) {+ state.frontendPath.attr("d", null)+ state.backendPath.attr("d", null)+ emptyText.style("display", null).text(t("waitingForData"))+ return+ }++ emptyText.style("display", "none")++ // Find latest timestamp without allocating+ let latestTimestamp = -Infinity+ for (let i = 0; i < frontendFps.length; i++) {+ if (frontendFps[i].timestamp > latestTimestamp) latestTimestamp = frontendFps[i].timestamp+ }+ for (let i = 0; i < backendFps.length; i++) {+ if (backendFps[i].timestamp > latestTimestamp) latestTimestamp = backendFps[i].timestamp+ }++ const windowEnd = latestTimestamp+ const windowStart = windowEnd - WINDOW_SECONDS * 1000+ state.windowEnd = windowEnd++ // Filter to window+ state.frontendData = frontendFps.filter((d) => d.timestamp >= windowStart)+ state.backendData = backendFps.filter((d) => d.timestamp >= windowStart)++ if (state.frontendData.length === 0 && state.backendData.length === 0) {+ state.frontendPath.attr("d", null)+ state.backendPath.attr("d", null)+ emptyText.style("display", null).text(t("waitingForData"))+ return+ }++ // Compute y-domain without allocating a merged array+ let yMin = Infinity+ let yMax = -Infinity+ for (let i = 0; i < state.frontendData.length; i++) {+ const v = state.frontendData[i].value+ if (v < yMin) yMin = v+ if (v > yMax) yMax = v+ }+ for (let i = 0; i < state.backendData.length; i++) {+ const v = state.backendData[i].value+ if (v < yMin) yMin = v+ if (v > yMax) yMax = v+ }++ const yRange = yMax - yMin+ const yPadding = Math.max(1, yRange * 0.3)+ state.yScale.domain([Math.max(0, yMin - yPadding), yMax + yPadding])++ // Only y-axis needs updating (domain changes with data).+ // X-axis is fixed at [-60, 0] with stable tick elements.+ const yAxisGen = d3+ .axisLeft(state.yScale)+ .ticks(Math.max(2, Math.min(5, Math.floor(height / 30))))+ .tickSize(-width)+ yAxisG.call(yAxisGen)+ applyAxisStyles(svg, theme)++ // Line generator maps absolute timestamps → relative seconds for the fixed x-axis+ const line = d3+ .line<FpsSample>()+ .x((d) => state.xScale((d.timestamp - windowEnd) / 1000))+ .y((d) => state.yScale(d.value))+ .curve(d3.curveLinear)++ state.frontendPath.attr("d", state.frontendData.length > 0 ? line(state.frontendData) : null)+ state.backendPath.attr("d", state.backendData.length > 0 ? line(state.backendData) : null)+ },+ [getFramerateStore, frontendColor, backendColor, theme, t]+ )++ return <BaseD3ChartView title={title} initChart={initChart} updateChart={updateChart}+ margin={{top: 20, right: 10, bottom: 42, left: 40}}/>}diff --git a/freemocap-ui/src/components/framerate-viewer/d3ChartUtils.ts b/freemocap-ui/src/components/framerate-viewer/d3ChartUtils.tsindex f29950d1..1e7c70fc 100644--- a/freemocap-ui/src/components/framerate-viewer/d3ChartUtils.ts+++ b/freemocap-ui/src/components/framerate-viewer/d3ChartUtils.ts@@ -2,27 +2,10 @@import * as d3 from "d3"import {Theme} from "@mui/material/styles"-export function createTooltip(theme: Theme) {- return d3- .select("body")- .append("div")- .style("position", "absolute")- .style("background-color", theme.palette.mode === "dark" ? "rgba(0, 0, 0, 0.85)" : "rgba(255, 255, 255, 0.9)")- .style("border", `1px solid ${theme.palette.divider}`)- .style("border-radius", "4px")- .style("padding", "8px")- .style("font-family", "monospace")- .style("font-size", "12px")- .style("pointer-events", "none")- .style("opacity", 0)- .style("z-index", 1000)- .style("color", theme.palette.text.primary)-}-export function applyAxisStyles(svg: d3.Selection<SVGGElement, unknown, null, undefined>,theme: Theme-) {+): void {svg.selectAll(".tick line").attr("stroke", theme.palette.divider).attr("stroke-dasharray", "2,2")@@ -37,62 +20,32 @@ export function renderEmptyChart(svg: d3.Selection<SVGGElement, unknown, null, undefined>,width: number,height: number,- theme: Theme-) {- // Create empty scales- const xScale = d3.scaleLinear().domain([0, 100]).range([0, width])- const yScale = d3.scaleLinear().domain([0, 10]).range([height, 0])-- // Create axes- const xAxis = d3.axisBottom(xScale).ticks(10).tickSize(-height)- const yAxis = d3.axisLeft(yScale).ticks(5).tickSize(-width)-- // Add X axis- svg- .append("g")- .attr("class", "x-axis")- .style("font-family", "monospace")- .style("font-size", "10px")- .style("color", theme.palette.text.secondary)- .attr("transform", `translate(0,${height})`)- .call(xAxis)-- // Add Y axis- svg- .append("g")- .attr("class", "y-axis")- .style("font-family", "monospace")- .style("font-size", "10px")- .style("color", theme.palette.text.secondary)- .call(yAxis)-- // Style grid lines- svg.selectAll(".tick line").attr("stroke", theme.palette.divider).attr("stroke-dasharray", "2,2")-- // Add "No data" message+ theme: Theme,+ text: string = "Waiting for data…"+): void {svg.append("text").attr("x", width / 2).attr("y", height / 2).attr("text-anchor", "middle")+ .attr("dominant-baseline", "central").style("font-family", "monospace")- .style("font-size", "14px")+ .style("font-size", "12px").style("fill", theme.palette.text.disabled)- .text("No data available")+ .text(text)}export function renderThresholdLines(chartArea: d3.Selection<SVGGElement, unknown, null, undefined>,- thresholds: { value: number, label: string, color: string }[],- xScale: any, // Allow both time and linear scales+ thresholds: {value: number; label: string; color: string}[],+ xScale: any,yScale: d3.ScaleLinear<number, number>,width: number,height: number,isHorizontal: boolean-) {+): void {thresholds.forEach((threshold) => {if (isHorizontal) {- // Horizontal threshold line (for time series)chartArea.append("line").attr("class", "threshold-line")@@ -104,7 +57,6 @@ export function renderThresholdLines(.attr("stroke-width", 1).attr("stroke-dasharray", "4,4")- // Add threshold labelchartArea.append("text").attr("class", "threshold-label")@@ -116,7 +68,6 @@ export function renderThresholdLines(.style("fill", threshold.color).text(threshold.label)} else {- // Vertical threshold line (for histogram)chartArea.append("line").attr("class", "threshold-line")@@ -128,7 +79,6 @@ export function renderThresholdLines(.attr("stroke-width", 1.5).attr("stroke-dasharray", "4,4")- // Add threshold labelchartArea.append("text").attr("class", "threshold-label")@@ -142,71 +92,3 @@ export function renderThresholdLines(}})}--// Helper functions for zoom updates--// Update thresholds on zoom-export function updateThresholdsOnZoom(- chartArea: d3.Selection<SVGGElement, unknown, null, undefined>,- transform: d3.ZoomTransform,- xScale: any,- yScale: d3.ScaleLinear<number, number>,- isHorizontal: boolean-) {- if (isHorizontal) {- // Update horizontal threshold lines- chartArea.selectAll(".threshold-line")- .attr("y1", (d: any) => transform.applyY(yScale(d.value)))- .attr("y2", (d: any) => transform.applyY(yScale(d.value)));-- // Update labels- chartArea.selectAll(".threshold-label")- .attr("y", (d: any) => transform.applyY(yScale(d.value)) - 5);- } else {- // Update vertical threshold lines- chartArea.selectAll(".threshold-line")- .attr("x1", (d: any) => transform.applyX(xScale(d.value)))- .attr("x2", (d: any) => transform.applyX(xScale(d.value)));-- // Update labels- chartArea.selectAll(".threshold-label")- .attr("x", (d: any) => transform.applyX(xScale(d.value)));- }-}--// Update histogram bars on zoom-export function updateHistogramBarsOnZoom(- chartArea: d3.Selection<SVGGElement, unknown, null, undefined>,- selector: string,- transform: d3.ZoomTransform,- xScale: d3.ScaleLinear<number, number>,- yScale: d3.ScaleLinear<number, number>,- height: number-) {- chartArea.selectAll(selector)- .attr("x", (d: any) => transform.applyX(xScale(d.x0)))- .attr("y", (d: any) => transform.applyY(yScale(d.density)))- .attr("width", (d: any) => Math.max(0, transform.k * (xScale(d.x1) - xScale(d.x0)) - 1))- .attr("height", (d: any) => height - transform.applyY(yScale(d.density)));-}--// Update time series lines on zoom-export function updateTimeSeriesOnZoom(- chartArea: d3.Selection<SVGGElement, unknown, null, undefined>,- transform: d3.ZoomTransform,- xScale: d3.ScaleTime<number, number>,- yScale: d3.ScaleLinear<number, number>-) {- // Update line paths- chartArea.selectAll("path")- .attr("d", (data) =>- d3.line<any>()- .x(d => transform.applyX(xScale(new Date(d.timestamp))))- .y(d => transform.applyY(yScale(d.value)))- .curve(d3.curveLinear)(data as any)- );- // Update data points- chartArea.selectAll("circle")- .attr("cx", (d: any) => transform.applyX(xScale(new Date(d.timestamp))))- .attr("cy", (d: any) => transform.applyY(yScale(d.value)));-}diff --git a/freemocap-ui/src/components/mocap-control-panel/MediapipeConfigPanel.tsx b/freemocap-ui/src/components/mocap-control-panel/MediapipeConfigPanel.tsxdeleted file mode 100644index 0916d6a8..00000000--- a/freemocap-ui/src/components/mocap-control-panel/MediapipeConfigPanel.tsx+++ /dev/null@@ -1,229 +0,0 @@-import React, {useCallback} from "react";-import {- Box,- Chip,- FormControl,- FormControlLabel,- InputLabel,- MenuItem,- Select,- Slider,- Stack,- Switch,- Typography,- useTheme,-} from "@mui/material";-import {useMocap} from "@/hooks/useMocap";-import {- MEDIAPIPE_REALTIME_PRESET,- MEDIAPIPE_POSTHOC_PRESET,- MediapipeModelComplexity,-} from "@/store/slices/mocap";--const MODEL_COMPLEXITY_LABELS: Record<MediapipeModelComplexity, string> = {- 0: "Lite (fastest)",- 1: "Full (balanced)",- 2: "Heavy (most accurate)",-};--type DetectorPreset = "realtime" | "posthoc" | "custom";--function detectPreset(- config: { model_complexity: number; enable_segmentation: boolean; smooth_segmentation: boolean }-): DetectorPreset {- if (- config.model_complexity === 0 &&- !config.enable_segmentation &&- !config.smooth_segmentation- ) return "realtime";- if (- config.model_complexity === 2 &&- config.enable_segmentation &&- config.smooth_segmentation- ) return "posthoc";- return "custom";-}--/** Shared slider sx that matches the camera config panel style. */-const useSliderSx = () => {- const theme = useTheme();- return {- color: theme.palette.primary.light,- "& .MuiSlider-thumb": {- "&:hover, &.Mui-focusVisible": {- boxShadow: `0px 0px 0px 8px ${theme.palette.primary.light}33`,- },- },- } as const;-};--export const MediapipeConfigPanel: React.FC = () => {- const theme = useTheme();- const sliderSx = useSliderSx();- const {detectorConfig, updateDetectorConfig, replaceDetectorConfig, isLoading} = useMocap();-- const currentPreset = detectPreset(detectorConfig);-- const handlePresetChange = useCallback(- (preset: DetectorPreset) => {- if (preset === "realtime") replaceDetectorConfig({...MEDIAPIPE_REALTIME_PRESET});- else if (preset === "posthoc") replaceDetectorConfig({...MEDIAPIPE_POSTHOC_PRESET});- },- [replaceDetectorConfig]- );-- return (- <Stack spacing={2}>- <Typography variant="subtitle2" sx={{color: theme.palette.text.secondary, fontWeight: 600}}>- MediaPipe Detector- </Typography>-- {/* Preset selector */}- <Stack direction="row" spacing={1} alignItems="center">- <Typography variant="caption" sx={{color: theme.palette.text.secondary, minWidth: 48}}>- Preset- </Typography>- <Chip- label="Realtime"- size="small"- variant={currentPreset === "realtime" ? "filled" : "outlined"}- color={currentPreset === "realtime" ? "primary" : "default"}- onClick={() => handlePresetChange("realtime")}- disabled={isLoading}- sx={{cursor: "pointer"}}- />- <Chip- label="Posthoc"- size="small"- variant={currentPreset === "posthoc" ? "filled" : "outlined"}- color={currentPreset === "posthoc" ? "primary" : "default"}- onClick={() => handlePresetChange("posthoc")}- disabled={isLoading}- sx={{cursor: "pointer"}}- />- {currentPreset === "custom" && (- <Chip label="Custom" size="small" variant="outlined" color="warning" />- )}- </Stack>-- {/* Model complexity */}- <FormControl size="small" fullWidth>- <InputLabel id="model-complexity-label">Model Complexity</InputLabel>- <Select- labelId="model-complexity-label"- value={detectorConfig.model_complexity}- label="Model Complexity"- onChange={(e) =>- updateDetectorConfig({- model_complexity: e.target.value as MediapipeModelComplexity,- })- }- disabled={isLoading}- sx={{color: theme.palette.text.primary}}- >- <MenuItem value={0}>{MODEL_COMPLEXITY_LABELS[0]}</MenuItem>- <MenuItem value={1}>{MODEL_COMPLEXITY_LABELS[1]}</MenuItem>- <MenuItem value={2}>{MODEL_COMPLEXITY_LABELS[2]}</MenuItem>- </Select>- </FormControl>-- {/* Confidence sliders */}- <Box>- <Typography variant="caption" color="text.secondary">- Min Detection Confidence: {detectorConfig.min_detection_confidence.toFixed(2)}- </Typography>- <Slider- value={detectorConfig.min_detection_confidence}- onChange={(_ , value) =>- updateDetectorConfig({min_detection_confidence: value as number})- }- min={0} max={1} step={0.05} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>-- <Box>- <Typography variant="caption" color="text.secondary">- Min Tracking Confidence: {detectorConfig.min_tracking_confidence.toFixed(2)}- </Typography>- <Slider- value={detectorConfig.min_tracking_confidence}- onChange={(_, value) =>- updateDetectorConfig({min_tracking_confidence: value as number})- }- min={0} max={1} step={0.05} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>-- {/* Boolean toggles */}- <Stack spacing={0}>- <FormControlLabel- control={- <Switch- size="small"- checked={detectorConfig.smooth_landmarks}- onChange={(_, checked) =>- updateDetectorConfig({smooth_landmarks: checked})- }- disabled={isLoading}- />- }- label={<Typography variant="body2">Smooth Landmarks</Typography>}- />- <FormControlLabel- control={- <Switch- size="small"- checked={detectorConfig.enable_segmentation}- onChange={(_, checked) =>- updateDetectorConfig({enable_segmentation: checked})- }- disabled={isLoading}- />- }- label={<Typography variant="body2">Enable Segmentation</Typography>}- />- <FormControlLabel- control={- <Switch- size="small"- checked={detectorConfig.smooth_segmentation}- onChange={(_, checked) =>- updateDetectorConfig({smooth_segmentation: checked})- }- disabled={isLoading || !detectorConfig.enable_segmentation}- />- }- label={<Typography variant="body2">Smooth Segmentation</Typography>}- />- <FormControlLabel- control={- <Switch- size="small"- checked={detectorConfig.refine_face_landmarks}- onChange={(_, checked) =>- updateDetectorConfig({refine_face_landmarks: checked})- }- disabled={isLoading}- />- }- label={<Typography variant="body2">Refine Face Landmarks</Typography>}- />- <FormControlLabel- control={- <Switch- size="small"- checked={detectorConfig.static_image_mode}- onChange={(_, checked) =>- updateDetectorConfig({static_image_mode: checked})- }- disabled={isLoading}- />- }- label={<Typography variant="body2">Static Image Mode</Typography>}- />- </Stack>- </Stack>- );-};diff --git a/freemocap-ui/src/components/mocap-control-panel/MocapTaskTreeItem.tsx b/freemocap-ui/src/components/mocap-control-panel/MocapTaskTreeItem.tsxdeleted file mode 100644index 7fe7203b..00000000--- a/freemocap-ui/src/components/mocap-control-panel/MocapTaskTreeItem.tsx+++ /dev/null@@ -1,476 +0,0 @@-import React, {useCallback, useMemo, useState} from "react";-import {- Alert,- Box,- Button,- Chip,- IconButton,- InputAdornment,- Stack,- TextField,- Tooltip,- Typography,- useTheme,-} from "@mui/material";-import DirectionsRunIcon from "@mui/icons-material/DirectionsRun";-import PlayArrowIcon from "@mui/icons-material/PlayArrow";-import StopIcon from "@mui/icons-material/Stop";-import FolderOpenIcon from "@mui/icons-material/FolderOpen";-import ClearIcon from "@mui/icons-material/Clear";-import CheckCircleIcon from "@mui/icons-material/CheckCircle";-import InfoIcon from "@mui/icons-material/Info";-import CloseIcon from "@mui/icons-material/Close";-import FiberManualRecordIcon from "@mui/icons-material/FiberManualRecord";-import {CollapsibleSidebarSection} from "@/components/common/CollapsibleSidebarSection";-import {useMocap} from "@/hooks/useMocap";-import {useElectronIPC} from "@/services";-import {MediapipeConfigPanel} from "@/components/mocap-control-panel/MediapipeConfigPanel";-import {SkeletonFilterConfigPanel} from "@/components/mocap-control-panel/SkeletonFilterConfigPanel";--export const MocapTaskTreeItem: React.FC = () => {- const theme = useTheme();- const [localError, setLocalError] = useState<string | null>(null);- const {api, isElectron} = useElectronIPC();-- const {- error,- isLoading,- isRecording,- recordingProgress,- canStartRecording,- canProcessMocapRecording,- mocapRecordingPath,- directoryInfo,- isUsingManualPath,- dispatchStopMocapRecording,- dispatchStartMocapRecording,- setManualRecordingPath,- clearManualRecordingPath,- dispatchProcessMocapRecording,- clearError,- } = useMocap();-- const handleClearError = useCallback((): void => {- clearError();- setLocalError(null);- }, [clearError]);-- const handleSelectDirectory = async (): Promise<void> => {- if (!isElectron || !api) {- console.warn("Electron API not available");- return;- }- try {- const result: string | null = await api.fileSystem.selectDirectory.mutate();- if (result) {- await setManualRecordingPath(result);- }- } catch (err) {- console.error("Failed to select directory:", err);- setLocalError("Failed to select directory");- }- };-- const handlePathInputChange = async (- e: React.ChangeEvent<HTMLInputElement>- ): Promise<void> => {- const newPath: string = e.target.value;- if (newPath.includes("~") && isElectron && api) {- try {- const home: string = await api.fileSystem.getHomeDirectory.query();- const expanded: string = newPath.replace(- /^~([/\\])?/,- home ? `${home}$1` : ""- );- await setManualRecordingPath(expanded);- } catch (err) {- console.error("Failed to expand home directory:", err);- await setManualRecordingPath(newPath);- }- } else {- await setManualRecordingPath(newPath);- }- };-- const handleClearManualPath = useCallback((): void => {- clearManualRecordingPath();- }, [clearManualRecordingPath]);-- const displayError = error || localError || directoryInfo?.errorMessage;-- const pathHelperText = useMemo(() => {- if (isUsingManualPath) return "Using custom path";- return "Using default recording directory";- }, [isUsingManualPath]);-- // Derive status for collapsed summary- const statusLabel = isRecording- ? `Recording ${recordingProgress.toFixed(0)}%`- : isLoading- ? "Processing..."- : "Idle";-- const statusColor = isRecording- ? theme.palette.error.main- : isLoading- ? theme.palette.warning.main- : theme.palette.grey[600];-- // Primary control: compact start/stop recording toggle in the header- const headerRecordButton = isRecording ? (- <Tooltip title="Stop mocap recording">- <IconButton- size="small"- onClick={(e: React.MouseEvent) => {- e.stopPropagation();- dispatchStopMocapRecording();- }}- disabled={isLoading}- sx={{- color: theme.palette.error.light,- border: `1.5px solid ${theme.palette.error.light}`,- borderRadius: 1,- p: 0.5,- "&:hover": {backgroundColor: "rgba(244,67,54,0.15)"},- }}- >- <StopIcon fontSize="small" />- </IconButton>- </Tooltip>- ) : (- <Tooltip title={canStartRecording ? "Start mocap recording" : "Cannot record yet"}>- <span>- <IconButton- size="small"- onClick={(e: React.MouseEvent) => {- e.stopPropagation();- dispatchStartMocapRecording();- }}- disabled={!canStartRecording || isLoading}- sx={{- color: "inherit",- border: "1.5px solid rgba(255,255,255,0.25)",- borderRadius: 1,- p: 0.5,- "&:hover": {backgroundColor: "rgba(255,255,255,0.1)"},- "&.Mui-disabled": {- color: "rgba(255,255,255,0.3)",- borderColor: "rgba(255,255,255,0.1)",- },- }}- >- <FiberManualRecordIcon fontSize="small" />- </IconButton>- </span>- </Tooltip>- );-- return (- <CollapsibleSidebarSection- icon={<DirectionsRunIcon sx={{color: "inherit"}} />}- title="Motion Capture"- summaryContent={- <Chip- label={statusLabel}- size="small"- sx={{- height: 20,- fontSize: 11,- fontWeight: 600,- backgroundColor: statusColor,- color: theme.palette.getContrastText(statusColor),- }}- />- }- primaryControl={headerRecordButton}- defaultExpanded={false}- >- <Box sx={{p: 2, bgcolor: "background.paper"}}>- <Stack spacing={2}>- {/* Error Display */}- {displayError && (- <Alert severity="error" onClose={handleClearError}>- {displayError}- </Alert>- )}-- {/* Recording Controls */}- <Stack direction="row" spacing={2}>- <Button- variant="contained"- color="primary"- startIcon={<PlayArrowIcon />}- onClick={dispatchStartMocapRecording}- disabled={!canStartRecording || isLoading}- fullWidth- >- Start Mocap Recording- </Button>- {isRecording && (- <Button- variant="contained"- color="error"- startIcon={<StopIcon />}- onClick={dispatchStopMocapRecording}- disabled={isLoading}- fullWidth- >- Stop Recording- </Button>- )}- </Stack>-- {/* Recording Path Input */}- <TextField- label="Mocap Recording Path"- value={mocapRecordingPath}- onChange={handlePathInputChange}- fullWidth- size="small"- helperText={pathHelperText}- InputProps={{- endAdornment: (- <InputAdornment position="end">- {isUsingManualPath && (- <Tooltip title="Clear manual path (revert to default)">- <IconButton- onClick={handleClearManualPath}- edge="end"- size="small"- >- <ClearIcon fontSize="small" />- </IconButton>- </Tooltip>- )}- <Tooltip title="Select directory">- <IconButton- onClick={handleSelectDirectory}- edge="end"- disabled={!isElectron}- >- <FolderOpenIcon />- </IconButton>- </Tooltip>- </InputAdornment>- ),- }}- />-- {/* Directory Status Info */}- {directoryInfo && (- <Box- sx={{- p: 1.5,- borderRadius: 1,- border: `2px solid ${theme.palette.divider}`,- }}- >- <Stack spacing={1}>- <Box- sx={{- display: "flex",- alignItems: "center",- gap: 1,- }}- >- <InfoIcon fontSize="small" color="info" />- <Typography variant="caption" fontWeight="medium">- Mocap Folder Status- </Typography>- </Box>-- <Box- sx={{- display: "flex",- gap: 1,- flexWrap: "wrap",- }}- >- <Chip- label={- directoryInfo.exists- ? "Directory exists"- : "Directory will be created"- }- size="small"- color={directoryInfo.exists ? "success" : "default"}- icon={- directoryInfo.exists ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={directoryInfo.exists ? "filled" : "outlined"}- sx={- !directoryInfo.exists- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- <Chip- label="Has videos"- size="small"- color={directoryInfo.hasVideos ? "success" : "default"}- icon={- directoryInfo.hasVideos ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={directoryInfo.hasVideos ? "filled" : "outlined"}- sx={- !directoryInfo.hasVideos- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- <Chip- label="Has synchronized_videos"- size="small"- color={- directoryInfo.hasSynchronizedVideos- ? "success"- : "default"- }- icon={- directoryInfo.hasSynchronizedVideos ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={- directoryInfo.hasSynchronizedVideos- ? "filled"- : "outlined"- }- sx={- !directoryInfo.hasSynchronizedVideos- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- <Chip- label="Has calibration TOML"- size="small"- color={- directoryInfo.cameraMocapTomlPath- ? "success"- : "default"- }- icon={- directoryInfo.cameraMocapTomlPath ? (- <CheckCircleIcon />- ) : (- <CloseIcon />- )- }- variant={- directoryInfo.cameraMocapTomlPath- ? "filled"- : "outlined"- }- sx={- !directoryInfo.cameraMocapTomlPath- ? {- borderColor: theme.palette.grey[400],- "& .MuiChip-icon": {- color: theme.palette.grey[600],- },- }- : {}- }- />- </Box>-- {directoryInfo.cameraMocapTomlPath && (- <Box sx={{mt: 1}}>- <Typography variant="caption" color="text.secondary">- Found calibration file:- </Typography>- <Typography- variant="caption"- sx={{- fontFamily: "monospace",- display: "block",- color: "success.main",- wordBreak: "break-all",- }}- >- {directoryInfo.cameraMocapTomlPath}- </Typography>- </Box>- )}- </Stack>- </Box>- )}-- {/* Recording Progress */}- {isRecording && (- <Box sx={{width: "100%"}}>- <Typography- variant="caption"- color="text.secondary"- gutterBottom- >- Recording in Progress: {recordingProgress.toFixed(0)}%- </Typography>- <Box- sx={{- width: "100%",- height: 8,- bgcolor: "grey.300",- borderRadius: 1,- overflow: "hidden",- }}- >- <Box- sx={{- width: `${recordingProgress}%`,- height: "100%",- bgcolor: theme.palette.primary.main,- transition: "width 0.3s",- }}- />- </Box>- </Box>- )}-- {/* MediaPipe Detector Config */}- <MediapipeConfigPanel />-- {/* Skeleton Filter Config */}- <SkeletonFilterConfigPanel />-- {/* Process Recording Button */}- <Button- variant="contained"- color="secondary"- onClick={dispatchProcessMocapRecording}- disabled={!canProcessMocapRecording || isLoading}- fullWidth- >- Process Selected Recording- </Button>- </Stack>- </Box>- </CollapsibleSidebarSection>- );-};diff --git a/freemocap-ui/src/components/mocap-control-panel/SkeletonFilterConfigPanel.tsx b/freemocap-ui/src/components/mocap-control-panel/SkeletonFilterConfigPanel.tsxdeleted file mode 100644index 776cc1ff..00000000--- a/freemocap-ui/src/components/mocap-control-panel/SkeletonFilterConfigPanel.tsx+++ /dev/null@@ -1,215 +0,0 @@-import React, {useCallback} from "react";-import {- Box,- Button,- Divider,- Slider,- Stack,- TextField,- Tooltip,- Typography,- useTheme,-} from "@mui/material";-import {useMocap} from "@/hooks/useMocap";-import {DEFAULT_REALTIME_FILTER_CONFIG} from "@/store/slices/mocap";--/** Warm amber for section headings — visible on dark backgrounds. */-const SECTION_COLOR = "#ffb74d";--/** Shared slider sx that matches the camera config panel style. */-const useSliderSx = () => {- const theme = useTheme();- return {- color: theme.palette.primary.light,- "& .MuiSlider-thumb": {- "&:hover, &.Mui-focusVisible": {- boxShadow: `0px 0px 0px 8px ${theme.palette.primary.light}33`,- },- },- } as const;-};--export const SkeletonFilterConfigPanel: React.FC = () => {- const theme = useTheme();- const sliderSx = useSliderSx();- const {skeletonFilterConfig, updateSkeletonFilterConfig, replaceSkeletonFilterConfig, isLoading} = useMocap();-- const handleResetDefaults = useCallback(() => {- replaceSkeletonFilterConfig({...DEFAULT_REALTIME_FILTER_CONFIG});- }, [replaceSkeletonFilterConfig]);-- return (- <Stack spacing={1}>- <Stack direction="row" justifyContent="space-between" alignItems="center">- <Typography variant="subtitle2" sx={{color: theme.palette.text.secondary, fontWeight: 600}}>- Skeleton Filter- </Typography>- <Button- size="small"- variant="text"- onClick={handleResetDefaults}- disabled={isLoading}- sx={{fontSize: 11, textTransform: "none"}}- >- Reset Defaults- </Button>- </Stack>-- {/* === Point Gate === */}- <Typography variant="caption" sx={{color: SECTION_COLOR, fontWeight: 600}}>- Point Gate- </Typography>-- <Tooltip title="Reject triangulated points whose mean reprojection error exceeds this. Higher = keep more (noisier) points." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Max Reproj Error: {skeletonFilterConfig.max_reprojection_error_px.toFixed(0)} px- </Typography>- <Slider- value={skeletonFilterConfig.max_reprojection_error_px}- onChange={(_, v) => updateSkeletonFilterConfig({max_reprojection_error_px: v as number})}- min={5} max={200} step={1} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Tooltip title="Reject points moving faster than this between frames. Catches teleportation spikes. Human limbs rarely exceed ~15 m/s." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Max Velocity: {skeletonFilterConfig.max_velocity_m_per_s.toFixed(0)} m/s- </Typography>- <Slider- value={skeletonFilterConfig.max_velocity_m_per_s}- onChange={(_, v) => updateSkeletonFilterConfig({max_velocity_m_per_s: v as number})}- min={5} max={200} step={1} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Tooltip title="After this many consecutive velocity rejections, accept unconditionally to prevent permanent lockout." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Max Rejected Streak: {skeletonFilterConfig.max_rejected_streak}- </Typography>- <Slider- value={skeletonFilterConfig.max_rejected_streak}- onChange={(_, v) => updateSkeletonFilterConfig({max_rejected_streak: v as number})}- min={1} max={30} step={1} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Divider />-- {/* === One Euro Filter === */}- <Typography variant="caption" sx={{color: SECTION_COLOR, fontWeight: 600}}>- One Euro Filter- </Typography>-- <Tooltip title="Minimum cutoff frequency (Hz). Lower = heavier smoothing (less jitter, more lag). Higher = more responsive." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Min Cutoff: {skeletonFilterConfig.min_cutoff.toFixed(4)}- </Typography>- <Slider- value={skeletonFilterConfig.min_cutoff}- onChange={(_, v) => updateSkeletonFilterConfig({min_cutoff: v as number})}- min={0.0001} max={0.1} step={0.0005} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Tooltip title="Speed coefficient. Higher = less lag during fast motion but more jitter. Zero = constant smoothing regardless of speed." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Beta: {skeletonFilterConfig.beta.toFixed(2)}- </Typography>- <Slider- value={skeletonFilterConfig.beta}- onChange={(_, v) => updateSkeletonFilterConfig({beta: v as number})}- min={0} max={5} step={0.05} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Tooltip title="Cutoff frequency for the speed estimator. Controls how quickly the filter reacts to speed changes. Usually fine at 1.0." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- D Cutoff: {skeletonFilterConfig.d_cutoff.toFixed(2)}- </Typography>- <Slider- value={skeletonFilterConfig.d_cutoff}- onChange={(_, v) => updateSkeletonFilterConfig({d_cutoff: v as number})}- min={0.1} max={5} step={0.1} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Divider />-- {/* === FABRIK === */}- <Typography variant="caption" sx={{color: SECTION_COLOR, fontWeight: 600}}>- FABRIK- </Typography>-- <Tooltip title="Max solver iterations per frame for bone length constraint enforcement. 10–30 is usually plenty." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Max Iterations: {skeletonFilterConfig.fabrik_max_iterations}- </Typography>- <Slider- value={skeletonFilterConfig.fabrik_max_iterations}- onChange={(_, v) => updateSkeletonFilterConfig({fabrik_max_iterations: v as number})}- min={1} max={100} step={1} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>-- <Divider />-- {/* === Body Model === */}- <Typography variant="caption" sx={{color: SECTION_COLOR, fontWeight: 600}}>- Body Model- </Typography>-- <Tooltip title="Subject's approximate height. Scales the anthropometric bone length prior. Doesn't need to be exact." placement="right" arrow>- <TextField- label="Height (m)"- type="number"- size="small"- value={skeletonFilterConfig.height_meters}- onChange={(e) => {- const val = parseFloat(e.target.value);- if (!isNaN(val) && val > 0) {- updateSkeletonFilterConfig({height_meters: val});- }- }}- inputProps={{step: 0.01, min: 0.5, max: 3.0}}- disabled={isLoading}- fullWidth- />- </Tooltip>-- <Tooltip title="Expected measurement noise (meters). Higher = trust raw positions less, rely more on prior estimates." placement="right" arrow>- <Box>- <Typography variant="caption" color="text.secondary">- Noise Sigma: {skeletonFilterConfig.noise_sigma.toFixed(4)} m- </Typography>- <Slider- value={skeletonFilterConfig.noise_sigma}- onChange={(_, v) => updateSkeletonFilterConfig({noise_sigma: v as number})}- min={0.001} max={0.05} step={0.001} size="small" disabled={isLoading}- sx={sliderSx}- />- </Box>- </Tooltip>- </Stack>- );-};diff --git a/freemocap-ui/src/components/processing-pipeline-panel/PipelineConnectionStatus.tsx b/freemocap-ui/src/components/processing-pipeline-panel/PipelineConnectionStatus.tsxdeleted file mode 100644index 9c658847..00000000--- a/freemocap-ui/src/components/processing-pipeline-panel/PipelineConnectionStatus.tsx+++ /dev/null@@ -1,110 +0,0 @@-import {Box, CircularProgress, Typography} from "@mui/material";-import CheckIcon from '@mui/icons-material/Check';-import CloseIcon from '@mui/icons-material/Close';-import {useAppDispatch, useAppSelector} from "@/store/hooks";-import {- closePipeline,- connectRealtimePipeline,- selectCanConnectPipeline,- selectCanDisconnectPipeline,- selectIsPipelineConnected,- selectIsPipelineLoading,- selectPipelineError,- selectPipelineId,-} from "@/store/slices/pipeline";--export const PipelineConnectionStatus = () => {- const dispatch = useAppDispatch();-- const isConnected = useAppSelector(selectIsPipelineConnected);- const pipelineId = useAppSelector(selectPipelineId);- const isLoading = useAppSelector(selectIsPipelineLoading);- const error = useAppSelector(selectPipelineError);- const canConnect = useAppSelector(selectCanConnectPipeline);- const canDisconnect = useAppSelector(selectCanDisconnectPipeline);-- const handleToggleConnection = async (e: React.MouseEvent) => {- e.stopPropagation();-- if (isLoading) return;-- if (isConnected) {- console.log('Disconnecting from pipeline');- await dispatch(closePipeline());- } else {- console.log('Connecting to pipeline');- await dispatch(connectRealtimePipeline(undefined));- }- };-- const isClickable = canConnect || canDisconnect;-- return (- <Box- sx={{- display: 'flex',- justifyContent: 'flex-end',- padding: '10px',- flexDirection: 'column',- pl: 4,- cursor: isClickable ? 'pointer' : 'not-allowed',- border: '4px solid rgb(0, 125, 125)',- backgroundColor: isConnected ? '#005d94' : '#395067',- borderRadius: '8px',- opacity: isClickable ? 1 : 0.6,- ':hover': isClickable ? {- backgroundColor: 'rgba(255, 255, 255, 0.05)',- borderColor: 'rgb(0, 225, 225)',- } : {},- }}- onClick={isClickable ? handleToggleConnection : undefined}- >- <Typography- variant="body1"- component="div"- sx={{- display: 'flex',- alignItems: 'center',- gap: 1,- }}- >- <Box sx={{- border: '1px solid rgba(255, 255, 255, 0.3)',- width: '24px',- height: '24px',- marginRight: '8px',- cursor: isClickable ? 'pointer' : 'not-allowed',- borderRadius: '4px',- transition: 'background-color 0.3s, border-color 0.3s',- backgroundColor: isConnected ? 'rgba(0, 255, 255, 0.1)' : 'rgba(255, 0, 0, 0.1)',- borderColor: isConnected ? 'rgba(0, 255, 255, 0.5)' : 'rgba(255, 0, 0, 0.5)',- boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',- display: 'flex',- alignItems: 'center',- padding: '4px',- justifyContent: 'center',- '&:hover': isClickable ? {- backgroundColor: 'rgba(255, 255, 255, 0.05)',- borderColor: 'rgba(255, 255, 255, 0.2)',- } : {},- }}>- {isLoading ? (- <CircularProgress size={16} sx={{ color: 'cyan' }} />- ) : isConnected ? (- <CheckIcon sx={{ color: 'green' }} />- ) : (- <CloseIcon fontSize="small" sx={{ color: 'red' }} />- )}- </Box>- Pipeline: {isConnected ? `connected (id: ${pipelineId})` : 'disconnected'}- {error && (- <Typography variant="caption" color="error" sx={{ ml: 1 }}>- {error}- </Typography>- )}- </Typography>- </Box>- );-};--export default PipelineConnectionStatus;diff --git a/freemocap-ui/src/components/processing-pipeline-panel/PipelineConnectionToggle.tsx b/freemocap-ui/src/components/processing-pipeline-panel/PipelineConnectionToggle.tsxdeleted file mode 100644index a53a1d8c..00000000--- a/freemocap-ui/src/components/processing-pipeline-panel/PipelineConnectionToggle.tsx+++ /dev/null@@ -1,80 +0,0 @@-import React from "react";-import {CircularProgress, IconButton, Tooltip, useTheme} from "@mui/material";-import PowerSettingsNewIcon from "@mui/icons-material/PowerSettingsNew";-import {useAppDispatch, useAppSelector} from "@/store/hooks";-import {- closePipeline,- connectRealtimePipeline,- selectCanConnectPipeline,- selectCanDisconnectPipeline,- selectIsPipelineConnected,- selectIsPipelineLoading,-} from "@/store/slices/pipeline";--export const PipelineConnectionToggle: React.FC = () => {- const theme = useTheme();- const dispatch = useAppDispatch();-- const isConnected = useAppSelector(selectIsPipelineConnected);- const isLoading = useAppSelector(selectIsPipelineLoading);- const canConnect = useAppSelector(selectCanConnectPipeline);- const canDisconnect = useAppSelector(selectCanDisconnectPipeline);-- const isClickable = canConnect || canDisconnect;-- const handleToggle = async (e: React.MouseEvent): Promise<void> => {- e.stopPropagation();- if (isLoading) return;-- if (isConnected) {- await dispatch(closePipeline());- } else {- await dispatch(connectRealtimePipeline(undefined));- }- };-- const tooltipText = isConnected- ? "Disconnect pipeline"- : canConnect- ? "Connect pipeline"- : "Select cameras first";-- return (- <Tooltip title={tooltipText}>- <span>- <IconButton- size="small"- onClick={handleToggle}- disabled={!isClickable || isLoading}- sx={{- color: "inherit",- border: "1.5px solid",- borderColor: isConnected- ? theme.palette.success.light- : "rgba(255,255,255,0.25)",- borderRadius: 1,- p: 0.5,- backgroundColor: isConnected- ? "rgba(76, 175, 80, 0.2)"- : "transparent",- "&:hover": {- backgroundColor: isConnected- ? "rgba(76, 175, 80, 0.3)"- : "rgba(255,255,255,0.1)",- },- "&.Mui-disabled": {- color: "rgba(255,255,255,0.3)",- borderColor: "rgba(255,255,255,0.1)",- },- }}- >- {isLoading ? (- <CircularProgress size={18} sx={{color: "inherit"}} />- ) : (- <PowerSettingsNewIcon fontSize="small" />- )}- </IconButton>- </span>- </Tooltip>- );-};diff --git a/freemocap-ui/src/components/processing-pipeline-panel/PipelineSummary.tsx b/freemocap-ui/src/components/processing-pipeline-panel/PipelineSummary.tsxdeleted file mode 100644index 05619890..00000000--- a/freemocap-ui/src/components/processing-pipeline-panel/PipelineSummary.tsx+++ /dev/null@@ -1,56 +0,0 @@-import React from "react";-import {Chip, Typography, useTheme} from "@mui/material";-import {useAppSelector} from "@/store/hooks";-import {- selectIsPipelineConnected,- selectPipelineError,- selectPipelineId,-} from "@/store/slices/pipeline";--export const PipelineSummary: React.FC = () => {- const theme = useTheme();-- const isConnected = useAppSelector(selectIsPipelineConnected);- const pipelineId = useAppSelector(selectPipelineId);- const error = useAppSelector(selectPipelineError);-- if (error) {- return (- <Typography- variant="caption"- sx={{- color: theme.palette.error.light,- fontWeight: 500,- whiteSpace: "nowrap",- overflow: "hidden",- textOverflow: "ellipsis",- }}- >- Error- </Typography>- );- }-- const statusColor = isConnected- ? theme.palette.success.main- : theme.palette.grey[600];-- return (- <Chip- label={isConnected ? `Active (${pipelineId})` : "Inactive"}- size="small"- sx={{- height: 20,- fontSize: 11,- fontWeight: 600,- backgroundColor: statusColor,- color: theme.palette.getContrastText(statusColor),- maxWidth: 160,- "& .MuiChip-label": {- overflow: "hidden",- textOverflow: "ellipsis",- },- }}- />- );-};diff --git a/freemocap-ui/src/components/processing-pipeline-panel/ProcessingPipelinePanel.tsx b/freemocap-ui/src/components/processing-pipeline-panel/ProcessingPipelinePanel.tsxdeleted file mode 100644index 3a7ac632..00000000--- a/freemocap-ui/src/components/processing-pipeline-panel/ProcessingPipelinePanel.tsx+++ /dev/null@@ -1,114 +0,0 @@-import React from "react";-import {Box, FormControlLabel, Stack, Switch, Typography, useTheme} from "@mui/material";-import LanIcon from "@mui/icons-material/Lan";-import {CollapsibleSidebarSection} from "@/components/common/CollapsibleSidebarSection";-import {PipelineConnectionToggle} from "@/components/processing-pipeline-panel/PipelineConnectionToggle";-import {PipelineSummary} from "@/components/processing-pipeline-panel/PipelineSummary";-import {useAppSelector} from "@/store/hooks";-import {selectBackendPipeline} from "@/store/slices/settings";-import {useServer} from "@/hooks/useServer";-import {MediapipeConfigPanel} from "@/components/mocap-control-panel/MediapipeConfigPanel";-import {SkeletonFilterConfigPanel} from "@/components/mocap-control-panel/SkeletonFilterConfigPanel";--export const ProcessingPipelinePanel: React.FC = () => {- const theme = useTheme();- const {send, isConnected} = useServer();- const backendPipeline = useAppSelector(selectBackendPipeline);-- const pipelineConfig = backendPipeline?.config;- const isPipelineConnected = backendPipeline?.is_connected ?? false;- const canToggle = isConnected && isPipelineConnected;-- const handleToggleCalibrationDetection = (_: React.ChangeEvent, checked: boolean) => {- send({- message_type: "settings/patch",- patch: {- pipeline: {- config: {- calibration_detection_enabled: checked,- },- },- },- });- };-- const handleToggleMocapDetection = (_: React.ChangeEvent, checked: boolean) => {- send({- message_type: "settings/patch",- patch: {- pipeline: {- config: {- mocap_detection_enabled: checked,- },- },- },- });- };-- return (- <CollapsibleSidebarSection- icon={<LanIcon sx={{transform: "scaleY(-1.05)", color: "inherit"}} />}- title="Realtime Pipeline"- summaryContent={<PipelineSummary />}- primaryControl={<PipelineConnectionToggle />}- defaultExpanded={false}- >- <Box sx={{p: 2}}>- <Stack spacing={2}>- {/* Detection toggles — always visible, disabled when pipeline not connected */}- <Typography- variant="subtitle2"- sx={{color: theme.palette.text.secondary, fontWeight: 600}}- >- Detection Stages- </Typography>- {!isPipelineConnected && (- <Typography variant="caption" color="text.secondary" sx={{fontStyle: "italic"}}>- Connect a pipeline to enable detection toggles.- </Typography>- )}- <FormControlLabel- control={- <Switch- size="small"- checked={pipelineConfig?.calibration_detection_enabled ?? true}- onChange={handleToggleCalibrationDetection}- disabled={!canToggle}- />- }- label={- <Typography variant="body2">- Charuco Detection (Calibration)- </Typography>- }- />- <FormControlLabel- control={- <Switch- size="small"- checked={pipelineConfig?.mocap_detection_enabled ?? true}- onChange={handleToggleMocapDetection}- disabled={!canToggle}- />- }- label={- <Typography variant="body2">- MediaPipe Detection (MoCap)- </Typography>- }- />-- {/* MediaPipe config — always visible */}- <Box sx={{mt: 1, pl: 1, borderLeft: `2px solid ${theme.palette.divider}`}}>- <MediapipeConfigPanel />- </Box>-- {/* Skeleton filter config — always visible */}- <Box sx={{mt: 1, pl: 1, borderLeft: `2px solid ${theme.palette.divider}`}}>- <SkeletonFilterConfigPanel />- </Box>- </Stack>- </Box>- </CollapsibleSidebarSection>- );-};\ No newline at end of filediff --git a/freemocap-ui/src/components/recording-info-panel/RecordingControlsTreeSection.tsx b/freemocap-ui/src/components/recording-info-panel/RecordingControlsTreeSection.tsxindex b05994c8..ef38918b 100644--- a/freemocap-ui/src/components/recording-info-panel/RecordingControlsTreeSection.tsx+++ b/freemocap-ui/src/components/recording-info-panel/RecordingControlsTreeSection.tsx@@ -13,6 +13,7 @@ import {interface RecordingControlsSectionProps {recordingDirectory: string;+ recordingName: string;recordingTag: string;useDelayStart: boolean;delaySeconds: number;@@ -36,6 +37,7 @@ interface RecordingControlsSectionProps {export const RecordingControlsSection: React.FC<RecordingControlsSectionProps> = ({recordingDirectory,+ recordingName,recordingTag,useDelayStart,delaySeconds,@@ -66,10 +68,11 @@ export const RecordingControlsSection: React.FC<RecordingControlsSectionProps> =/><BaseRecordingDirectoryInput- baseRecordingFolder={recordingDirectory}+ value={recordingDirectory}/><RecordingNamePreview+ name={recordingName}tag={recordingTag}isRecording={isRecording}onTagChange={onTagChange}diff --git a/freemocap-ui/src/components/recording-info-panel/RecordingInfoPanel.tsx b/freemocap-ui/src/components/recording-info-panel/RecordingInfoPanel.tsxindex 2c26ae2a..a908ea66 100644--- a/freemocap-ui/src/components/recording-info-panel/RecordingInfoPanel.tsx+++ b/freemocap-ui/src/components/recording-info-panel/RecordingInfoPanel.tsx@@ -5,13 +5,19 @@ import {TreeItem} from "@mui/x-tree-view/TreeItem";import ExpandMoreIcon from "@mui/icons-material/ExpandMore";import ChevronRightIcon from "@mui/icons-material/ChevronRight";import VideocamIcon from "@mui/icons-material/Videocam";-import {recordingInfoUpdated, startRecording, stopRecording, useAppDispatch, useAppSelector} from "@/store";+import {useAppDispatch, useAppSelector} from "@/store";import {StartStopRecordingButton} from "@/components/recording-info-panel/recording-subcomponents/StartStopRecordingButton";-import {useElectronIPC} from "@/services";+import {+ MicrophoneSelector+} from "@/components/recording-info-panel/recording-subcomponents/MicrophoneSelector";+import {startRecording, stopRecording, recordingInfoUpdated} from "@/store";import {RecordingPathTreeItem} from "@/components/recording-info-panel/RecordingPathTreeItem";-+import {electronIpc, useElectronIPC} from "@/services/electron-ipc/electron-ipc";+import {useServer} from "@/services/server/ServerContextProvider";+import {getTimestampString} from "@/components/recording-info-panel/getTimestampString";+import {RecordingCompleteDialog} from "@/components/recording-info-panel/RecordingCompleteDialog";interface RecordingOperation {type: 'start' | 'stop';@@ -42,7 +48,10 @@ export const RecordingInfoPanel: React.FC = () => {const [baseName, setBaseName] = useState<string>("recording");const [customSubfolderName, setCustomSubfolderName] = useState<string>("");const [recordingTag, setRecordingTag] = useState<string>("");+ const [micDeviceIndex, setMicDeviceIndex] = useState<number>(-1);const {isElectron, api} = useElectronIPC();+ const {connectedCameraIds} = useServer();+ const noCamerasConnected = connectedCameraIds.length === 0;// Track when recording state changes to clear pending stateuseEffect(() => {@@ -88,7 +97,7 @@ export const RecordingInfoPanel: React.FC = () => {const updatedDirectory = recordingInfo.recordingDirectory.replace("~",homePath- );+ ).replace(/\\/g, "/");dispatch(recordingInfoUpdated({recordingDirectory: updatedDirectory}));}).catch((error: unknown) => {@@ -109,36 +118,6 @@ export const RecordingInfoPanel: React.FC = () => {}}, [countdown]);- const getTimestampString = (): string => {- const now = new Date();-- const dateOptions: Intl.DateTimeFormatOptions = {- year: "numeric",- month: "2-digit",- day: "2-digit",- hour: "2-digit",- minute: "2-digit",- second: "2-digit",- hour12: false,- timeZoneName: "shortOffset",- };-- const formatter = new Intl.DateTimeFormat("en-US", dateOptions);- const parts = formatter.formatToParts(now);-- const partMap: Record<string, string> = {};- parts.forEach((part) => {- partMap[part.type] = part.value;- });-- return `${partMap.year}-${partMap.month}-${partMap.day}_${- partMap.hour- }-${partMap.minute}-${partMap.second}_${partMap.timeZoneName.replace(- ":",- ""- )}`;- };-const handleRecordingTagChange = (tag: string): void => {setRecordingTag(tag);};@@ -185,6 +164,7 @@ export const RecordingInfoPanel: React.FC = () => {startRecording({recordingName,recordingDirectory: recordingPath,+ micDeviceIndex,})).unwrap();} catch (error) {@@ -228,7 +208,7 @@ export const RecordingInfoPanel: React.FC = () => {<Boxsx={{color: "text.primary",- backgroundColor: theme.palette.primary.main,+ backgroundColor: theme.palette.primary.dark,borderRadius: 1,mx: 1,my: 0.5,@@ -268,16 +248,29 @@ export const RecordingInfoPanel: React.FC = () => {Record</Typography>- <StartStopRecordingButton- isRecording={recordingInfo.isRecording}- isPending={pendingOperation !== null}- countdown={countdown}- recordingStartTime={recordingStartTime}- onClick={handleRecordButtonClick}- />+ <Box onClick={(e) => e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()} sx={{ flexGrow: 1, ml: 1.5 }}>+ <StartStopRecordingButton+ isRecording={recordingInfo.isRecording}+ isPending={pendingOperation !== null}+ countdown={countdown}+ recordingStartTime={recordingStartTime}+ disabled={noCamerasConnected && !recordingInfo.isRecording}+ onClick={handleRecordButtonClick}+ />+ </Box></Box>}- >+ >{/* Microphone selector */}+ <TreeItem+ itemId="recording-mic"+ label={+ <MicrophoneSelector+ selectedMicIndex={micDeviceIndex}+ onMicSelected={setMicDeviceIndex}+ disabled={recordingInfo.isRecording}+ />+ }+ /><RecordingPathTreeItemrecordingDirectory={recordingInfo.recordingDirectory}recordingName={recordingName}@@ -305,6 +298,7 @@ export const RecordingInfoPanel: React.FC = () => {/></TreeItem></SimpleTreeView>+ <RecordingCompleteDialog /></Box>);};diff --git a/freemocap-ui/src/components/recording-info-panel/RecordingPathTreeItem.tsx b/freemocap-ui/src/components/recording-info-panel/RecordingPathTreeItem.tsxindex 92eb5578..1a471b2a 100644--- a/freemocap-ui/src/components/recording-info-panel/RecordingPathTreeItem.tsx+++ b/freemocap-ui/src/components/recording-info-panel/RecordingPathTreeItem.tsx@@ -5,11 +5,13 @@ import {FullRecordingPathPreview} from "@/components/recording-info-panel/recording-subcomponents/FullRecordingPathPreview";import {RecordingControlsSection} from "@/components/recording-info-panel/RecordingControlsTreeSection";-import {useAppSelector} from '@/store';interface RecordingPathTreeItemProps {+ recordingDirectory: string;+ recordingName: string;+ subfolder?: string;countdown: number | null;- // Config props+ // Add all the control propsrecordingTag: string;useDelayStart: boolean;delaySeconds: number;@@ -32,6 +34,9 @@ interface RecordingPathTreeItemProps {}export const RecordingPathTreeItem: React.FC<RecordingPathTreeItemProps> = ({+ recordingDirectory,+ recordingName,+ subfolder,countdown,// Control propsrecordingTag,@@ -54,21 +59,23 @@ export const RecordingPathTreeItem: React.FC<RecordingPathTreeItemProps> = ({onCreateSubfolderChange,onCustomSubfolderNameChange}) => {- // Read computed values directly from store- const recordingDirectory = useAppSelector((state) => state.recording.recordingDirectory);- const computed = useAppSelector((state) => state.recording.computed);-return (<TreeItemitemId="recording-path"label={<Box sx={{display: 'flex', alignItems: 'center', gap: 1}}>- <FullRecordingPathPreview />+ <FullRecordingPathPreview+ directory={recordingDirectory}+ filename={recordingName}+ subfolder={subfolder}+ /></Box>}>- <Box sx={{pl: 2, pt: 1, display: 'flex', flexDirection: 'column', gap: 2}}>- {/* Countdown display in controls section */}+ <Box+ onKeyDown={(e) => e.stopPropagation()}+ sx={{pl: 2, pt: 1, display: 'flex', flexDirection: 'column', gap: 2}}+ >{countdown !== null && (<Typography variant="h4" align="center" color="secondary">Starting in {countdown}...@@ -77,6 +84,7 @@ export const RecordingPathTreeItem: React.FC<RecordingPathTreeItemProps> = ({<RecordingControlsSectionrecordingDirectory={recordingDirectory}+ recordingName={recordingName}recordingTag={recordingTag}useDelayStart={useDelayStart}delaySeconds={delaySeconds}diff --git a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/BaseRecordingDirectoryInput.tsx b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/BaseRecordingDirectoryInput.tsxindex 4c7ba33b..3062ce2c 100644--- a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/BaseRecordingDirectoryInput.tsx+++ b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/BaseRecordingDirectoryInput.tsx@@ -1,17 +1,19 @@import React from 'react';-import {IconButton, InputAdornment, TextField} from '@mui/material';+import { useTranslation } from 'react-i18next';+import { IconButton, InputAdornment, TextField } from '@mui/material';import FolderOpenIcon from '@mui/icons-material/FolderOpen';-import {useAppDispatch} from '@/store';-import {recordingDirectoryChanged} from '@/store/slices/recording/recording-slice';-import {useElectronIPC} from '@/services';+import { useAppDispatch } from '@/store';+import { recordingDirectoryChanged } from '@/store/slices/recording/recording-slice';+import { useElectronIPC } from '@/services';interface DirectoryInputProps {- baseRecordingFolder: string;+ value: string;}-export const BaseRecordingDirectoryInput: React.FC<DirectoryInputProps> = ({ baseRecordingFolder }) => {+export const BaseRecordingDirectoryInput: React.FC<DirectoryInputProps> = ({ value }) => {const dispatch = useAppDispatch();const { api, isElectron } = useElectronIPC();+ const { t } = useTranslation();const handleSelectDirectory = async (): Promise<void> => {// Only try to use electron API if we're in electron environment@@ -53,8 +55,8 @@ export const BaseRecordingDirectoryInput: React.FC<DirectoryInputProps> = ({ basreturn (<TextField- label="Recording Directory"- value={baseRecordingFolder}+ label={t("recordingDirectory")}+ value={value}onChange={handleInputChange}fullWidthsize="small"diff --git a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/DelayRecordingStartControl.tsx b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/DelayRecordingStartControl.tsxindex f961e2aa..4835eae1 100644--- a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/DelayRecordingStartControl.tsx+++ b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/DelayRecordingStartControl.tsx@@ -1,4 +1,5 @@import React from 'react';+import { useTranslation } from 'react-i18next';import {Box, Checkbox, FormControlLabel, TextField, useTheme} from '@mui/material';interface DelayStartControlProps {@@ -15,6 +16,7 @@ export const DelayRecordingStartControl: React.FC<DelayStartControlProps> = ({onDelayChange}) => {const theme = useTheme();+ const { t } = useTranslation();return (<Box display="flex" alignItems="center" gap={2}><FormControlLabel@@ -22,19 +24,14 @@ export const DelayRecordingStartControl: React.FC<DelayStartControlProps> = ({<Checkboxchecked={useDelay}onChange={(e) => onDelayToggle(e.target.checked)}- sx={{- color: theme.palette.text.primary,- '&.Mui-checked': {- color: theme.palette.text.primary,- },- }}+ color="primary"/>}- label="Delay Start"+ label={t("delayStart")}/>{useDelay && (<TextField- label="Seconds"+ label={t("seconds")}type="number"value={delaySeconds}onChange={(e) => onDelayChange(Math.max(1, parseInt(e.target.value) || 1))}diff --git a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/FullRecordingPathPreview.tsx b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/FullRecordingPathPreview.tsxindex 7b55e723..80ecdc38 100644--- a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/FullRecordingPathPreview.tsx+++ b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/FullRecordingPathPreview.tsx@@ -1,34 +1,43 @@+// freemocap-ui/src/components/recording-info-panel/recording-subcomponents/FullRecordingPathPreview.tsximport React from 'react';import {Box, IconButton, Paper, Tooltip, Typography, useTheme} from '@mui/material';import FolderIcon from '@mui/icons-material/Folder';import FolderSpecialIcon from '@mui/icons-material/FolderSpecial';+import { useTranslation } from "react-i18next";import ChevronRightIcon from '@mui/icons-material/ChevronRight';import FolderOpenIcon from '@mui/icons-material/FolderOpen';import {useElectronIPC} from "@/services";-import {useAppSelector} from '@/store';-export const FullRecordingPathPreview: React.FC = () => {- const theme = useTheme();- const { api } = useElectronIPC();- // Read directly from RTK store- const recordingDirectory = useAppSelector((state) => state.recording.recordingDirectory);- const computed = useAppSelector((state) => state.recording.computed);+interface FullPathPreviewProps {+ directory: string;+ subfolder?: string;+ filename: string;+}+export const FullRecordingPathPreview: React.FC<FullPathPreviewProps> = ({+ directory,+ filename,+ subfolder+ }) => {+ const theme = useTheme();+ const { t } = useTranslation();+ const { api } = useElectronIPC()const parts = [- {icon: <FolderIcon/>, text: recordingDirectory},- ...(computed.subfolderName ? [{icon: <FolderIcon/>, text: computed.subfolderName}] : []),- {icon: <FolderSpecialIcon/>, text: computed.recordingName}+ {icon: <FolderIcon/>, text: directory},+ ...(subfolder ? [{icon: <FolderIcon/>, text: subfolder}] : []),+ {icon: <FolderSpecialIcon/>, text: filename}];const fullPath: string = parts.map(p => p.text).join('/');// Get the directory path only (without the filename)- const directoryToOpen: string = computed.subfolderName- ? `${recordingDirectory}/${computed.subfolderName}`- : recordingDirectory;+ const directoryToOpen: string = subfolder+ ? `${directory}/${subfolder}`+ : directory;+- const handleOpenFolder = async (): Promise<void> => {+ const handleOpenFolder = async () => {try {await api?.fileSystem.openFolder.mutate({ path: directoryToOpen });} catch (error) {@@ -55,6 +64,8 @@ export const FullRecordingPathPreview: React.FC = () => {alignItems: 'center',mb: 1}}>++{/* Mobile/Narrow view */}<Box sx={{display: {xs: 'block', md: 'none'}}}><Tooltip title={fullPath} placement="bottom-start">@@ -86,6 +97,7 @@ export const FullRecordingPathPreview: React.FC = () => {display: 'flex',alignItems: 'center',color: 'text.secondary',+ // backgroundColor: 'background.paper',borderRadius: 1,px: 1,py: 0.5,@@ -108,7 +120,7 @@ export const FullRecordingPathPreview: React.FC = () => {))}</Box>- <Tooltip title="Open folder in file explorer">+ <Tooltip title={t("openFolder")}><IconButtonsize="small"onClick={handleOpenFolder}@@ -125,6 +137,7 @@ export const FullRecordingPathPreview: React.FC = () => {</IconButton></Tooltip></Box>+</Paper>);};diff --git a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingNamePreview.tsx b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingNamePreview.tsxindex 5dea4ee4..a28751b4 100644--- a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingNamePreview.tsx+++ b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingNamePreview.tsx@@ -1,38 +1,37 @@import React from 'react';+import { useTranslation } from 'react-i18next';import {TextField, Typography} from '@mui/material';-import {useAppSelector} from '@/store';interface RecordingNamePreviewProps {+ name: string;tag: string;isRecording: boolean;onTagChange: (tag: string) => void;}export const RecordingNamePreview: React.FC<RecordingNamePreviewProps> = ({+ name,tag,isRecording,onTagChange}) => {- // Read computed recording name from store- const recordingName = useAppSelector((state) => state.recording.computed.recordingName);-+ const { t } = useTranslation();return (<><Typography variant="body2" sx={{mb: 1}}>- Recording Name: {recordingName}+ {t('recordingName', { name })}</Typography>{!isRecording && (<TextField- label="Recording Tag"+ label={t("recordingTag")}value={tag}onChange={(e) => onTagChange(e.target.value)}onKeyDown={(e) => {// Stop the TreeView from intercepting keyboard navigation- e.stopPropagation();- }}+ e.stopPropagation();}}size="small"fullWidth- placeholder="Optional tag"+ placeholder={t("recordingTagPlaceholder")}/>)}</>diff --git a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingSettingsSection.tsx b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingSettingsSection.tsxindex bb8114bb..d10b45b3 100644--- a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingSettingsSection.tsx+++ b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/RecordingSettingsSection.tsx@@ -1,5 +1,6 @@import React from 'react';-import {Box, Checkbox, FormControlLabel, Grid, TextField, Typography, useTheme} from '@mui/material';+import { useTranslation } from 'react-i18next';+import {Box, Checkbox, FormControlLabel, TextField, Typography, useTheme} from '@mui/material';interface RecordingSettingsProps {useTimestamp: boolean;@@ -16,126 +17,139 @@ interface RecordingSettingsProps {onCustomSubfolderNameChange: (value: string) => void;}+/** A compact row: checkbox on the left, optional input filling remaining space. */+const SettingRow: React.FC<{+ checked: boolean;+ label: string;+ onCheck: (value: boolean) => void;+ children?: React.ReactNode;+}> = ({checked, label, onCheck, children}) => (+ <Box sx={{display: 'flex', alignItems: 'center', gap: 0.5, minHeight: 32}}>+ <FormControlLabel+ control={+ <Checkbox+ checked={checked}+ onChange={(e) => onCheck(e.target.checked)}+ size="small"+ sx={{p: 0.25}}+ />+ }+ label={label}+ sx={{+ mr: 0,+ flexShrink: 0,+ whiteSpace: 'nowrap',+ '& .MuiFormControlLabel-label': {fontSize: 12},+ }}+ />+ {children && (+ <Box sx={{flex: 1, minWidth: 0}}>+ {children}+ </Box>+ )}+ </Box>+);++/** Compact text field that aligns vertically with checkboxes (no floating label). */+const CompactTextField: React.FC<{+ value: string | number;+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;+ placeholder: string;+ disabled: boolean;+ type?: string;+ inputProps?: React.InputHTMLAttributes<HTMLInputElement>;+ fullWidth?: boolean;+ sx?: object;+}> = ({value, onChange, placeholder, disabled, type, inputProps, fullWidth = true, sx}) => (+ <TextField+ value={value}+ onChange={onChange}+ placeholder={placeholder}+ disabled={disabled}+ type={type}+ inputProps={inputProps}+ size="small"+ fullWidth={fullWidth}+ sx={{+ '& .MuiOutlinedInput-root': {+ height: 28,+ fontSize: 12,+ },+ '& .MuiOutlinedInput-input': {+ py: 0.5,+ px: 1,+ },+ ...sx,+ }}+ />+);+export const RecordingSettingsSection: React.FC<RecordingSettingsProps> = ({- useTimestamp,- baseName,- useIncrement,- currentIncrement,- createSubfolder,- customSubfolderName,- onUseTimestampChange,- onBaseNameChange,- onUseIncrementChange,- onIncrementChange,- onCreateSubfolderChange,- onCustomSubfolderNameChange,- }) => {+ useTimestamp,+ baseName,+ useIncrement,+ currentIncrement,+ createSubfolder,+ customSubfolderName,+ onUseTimestampChange,+ onBaseNameChange,+ onUseIncrementChange,+ onIncrementChange,+ onCreateSubfolderChange,+ onCustomSubfolderNameChange,+ }) => {const theme = useTheme();+ const { t } = useTranslation();return (<Box sx={{- mt: 2,- p: 2,+ mt: 1,+ p: 1.5,bgcolor: theme.palette.mode === 'dark'? 'rgba(255, 255, 255, 0.05)': 'rgba(0, 0, 0, 0.04)',- borderRadius: 1+ borderRadius: 1,+ display: 'flex',+ flexDirection: 'column',+ gap: 0.5,}}>- <Typography variant="subtitle1" sx={{mb: 2}}>Recording Settings</Typography>-- <Grid container spacing={2} alignItems="center">- {/* Timestamp & Base name row */}- <Grid item xs={12} sm={4}>- <FormControlLabel- control={- <Checkbox- sx={{- color: theme.palette.text.primary,- '&.Mui-checked': {- color: theme.palette.text.primary,- },- }}- checked={useTimestamp}- onChange={(e) => onUseTimestampChange(e.target.checked)}- />- }- label="Use Timestamp"- />- </Grid>- <Grid item xs={12} sm={8}>- <TextField- label="Base Recording Name"- value={baseName}- onChange={(e) => onBaseNameChange(e.target.value)}- disabled={useTimestamp}- size="small"- fullWidth- />- </Grid>-- {/* Subfolder row */}- <Grid item xs={12} sm={4}>- <FormControlLabel- control={- <Checkbox- sx={{- color: theme.palette.text.primary,- '&.Mui-checked': {- color: theme.palette.text.primary,- },- }}+ <Typography variant="subtitle2" sx={{mb: 0.5, fontSize: 13, fontWeight: 600}}>+ {t('recordingSettings')}+ </Typography>- checked={createSubfolder}- onChange={(e) => onCreateSubfolderChange(e.target.checked)}- />- }- label="Use Subfolder"- />- </Grid>- <Grid item xs={12} sm={8}>- <TextField- label="Custom Subfolder Name"- value={customSubfolderName}- onChange={(e) => onCustomSubfolderNameChange(e.target.value)}- disabled={!createSubfolder}- size="small"- fullWidth- placeholder="Leave empty to use timestamp"- />- </Grid>+ {/* Timestamp toggle + base name input */}+ <SettingRow checked={useTimestamp} label={t("timestamp")} onCheck={onUseTimestampChange}>+ <CompactTextField+ value={baseName}+ onChange={(e) => onBaseNameChange(e.target.value)}+ placeholder={t("baseName")}+ disabled={useTimestamp}+ />+ </SettingRow>- {/* Auto increment row */}- <Grid item xs={12} sm={4}>- <FormControlLabel- control={- <Checkbox- checked={useIncrement}- onChange={(e) => onUseIncrementChange(e.target.checked)}- sx={{- color: theme.palette.text.primary,- '&.Mui-checked': {- color: theme.palette.text.primary,- },- }}- />- }- label="Auto Increment"- />- </Grid>- <Grid item xs={12} sm={4}>- <TextField- label="Increment Number"- type="number"- value={currentIncrement}- onChange={(e) => onIncrementChange(parseInt(e.target.value) || 1)}- disabled={!useIncrement}- inputProps={{min: 1, step: 1}}- size="small"- fullWidth- />- </Grid>+ {/* Subfolder toggle + custom name input */}+ <SettingRow checked={createSubfolder} label={t("subfolder")} onCheck={onCreateSubfolderChange}>+ <CompactTextField+ value={customSubfolderName}+ onChange={(e) => onCustomSubfolderNameChange(e.target.value)}+ placeholder={t("subfolderPlaceholder")}+ disabled={!createSubfolder}+ />+ </SettingRow>- </Grid>+ {/* Auto-increment toggle + number input */}+ <SettingRow checked={useIncrement} label={t("increment")} onCheck={onUseIncrementChange}>+ <CompactTextField+ value={currentIncrement}+ onChange={(e) => onIncrementChange(parseInt(e.target.value) || 1)}+ placeholder="#"+ disabled={!useIncrement}+ type="number"+ inputProps={{min: 1, step: 1}}+ fullWidth={false}+ sx={{maxWidth: 64}}+ />+ </SettingRow></Box>);};diff --git a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/StartStopRecordingButton.tsx b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/StartStopRecordingButton.tsxindex 0905a9d0..2ba78a04 100644--- a/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/StartStopRecordingButton.tsx+++ b/freemocap-ui/src/components/recording-info-panel/recording-subcomponents/StartStopRecordingButton.tsx@@ -1,12 +1,14 @@-import React, {useEffect, useState} from 'react';-import {Box, Button, CircularProgress, keyframes, Typography} from '@mui/material';-import {styled} from '@mui/system';+import React, { useEffect, useState } from 'react';+import { Button, CircularProgress, keyframes, Typography, Box } from '@mui/material';+import { styled } from '@mui/system';+import { useTranslation } from 'react-i18next';interface StartStopButtonProps {isRecording: boolean;isPending: boolean;countdown: number | null;recordingStartTime: number | null;+ disabled: boolean;onClick: () => void;}@@ -67,9 +69,11 @@ export const StartStopRecordingButton: React.FC<StartStopButtonProps> = ({isPending,countdown,recordingStartTime,+ disabled,onClick}) => {const [recordingDuration, setRecordingDuration] = useState<number>(0);+ const { t } = useTranslation();// Update recording duration every seconduseEffect(() => {@@ -99,7 +103,7 @@ export const StartStopRecordingButton: React.FC<StartStopButtonProps> = ({return (<Box display="flex" alignItems="center" gap={1}><Typography variant="h6">- Starting in {countdown}...+ {t('startingIn', { countdown })}</Typography></Box>);@@ -111,7 +115,7 @@ export const StartStopRecordingButton: React.FC<StartStopButtonProps> = ({<Box display="flex" alignItems="center" gap={1}><CircularProgress size={20} color="inherit" /><Typography variant="h6">- {isRecording ? 'Stopping...' : 'Starting...'}+ {isRecording ? t('stopping') : t('starting')}</Typography></Box>);@@ -122,7 +126,7 @@ export const StartStopRecordingButton: React.FC<StartStopButtonProps> = ({return (<Box display="flex" flexDirection="column" alignItems="center"><Typography variant="h6">- 🔴 Stop Recording+ {t('stopRecordingButton')}</Typography><Typography variant="caption" sx={{ fontSize: '0.9rem', fontFamily: 'monospace' }}>{formatDuration(recordingDuration)}@@ -134,7 +138,7 @@ export const StartStopRecordingButton: React.FC<StartStopButtonProps> = ({// Default start statereturn (<Typography variant="h6">- 🔴 Start Recording+ {t('startRecordingButton')}</Typography>);};@@ -145,7 +149,7 @@ export const StartStopRecordingButton: React.FC<StartStopButtonProps> = ({variant="contained"isRecording={isRecording}isPending={isPending}- disabled={isPending || countdown !== null}+ disabled={disabled || isPending || countdown !== null}fullWidth>{getButtonContent()}diff --git a/freemocap-ui/src/components/settings-editor/SettingsEditor.tsx b/freemocap-ui/src/components/settings-editor/SettingsEditor.tsxdeleted file mode 100644index 16d67b9a..00000000--- a/freemocap-ui/src/components/settings-editor/SettingsEditor.tsx+++ /dev/null@@ -1,540 +0,0 @@-import React, { useState, useCallback, useRef, useMemo, useEffect } from 'react';-import {- Box,- Button,- ButtonGroup,- Alert,- Snackbar,- Tooltip,- Divider,- CircularProgress,-} from '@mui/material';-import { useTheme } from '@mui/material/styles';-import Editor, { OnMount } from '@monaco-editor/react';-import UploadFileIcon from '@mui/icons-material/UploadFile';-import DownloadIcon from '@mui/icons-material/Download';-import CheckIcon from '@mui/icons-material/Check';-import RestoreIcon from '@mui/icons-material/Restore';-import ContentCopyIcon from '@mui/icons-material/ContentCopy';-import {- useAppDispatch,- useAppSelector,- themeModeSet,- recordingDirectoryChanged,- configUpdated,- selectServerSettings,-} from '@/store';-import {- mocapDetectorConfigReplaced,- skeletonFilterConfigReplaced,- updateMocapConfigOnServer,-} from '@/store/slices/mocap';-import {calibrationConfigUpdated, updateCalibrationConfigOnServer } from '@/store/slices/calibration';-import { ThemeMode } from '@/store/slices/theme/theme-types';-import { useServer } from '@/hooks/useServer';-import {- serialize,- deserialize,- convertFormat,- SerializationFormat,- FORMAT_EXTENSIONS,- FORMAT_MIME_TYPES,- FORMAT_MONACO_LANGUAGES,-} from './format-converters';--// ── Aggregated settings shape (config-only, no runtime state) ──--interface AggregatedSettings {- appearance: {- mode: string;- };- recording: {- recording_directory: string;- use_delay_start: boolean;- delay_seconds: number;- use_timestamp: boolean;- use_increment: boolean;- current_increment: number;- base_name: string;- recording_tag: string;- create_subfolder: boolean;- custom_subfolder_name: string;- };- calibration: {- live_track_charuco: boolean;- charuco_board_x_squares: number;- charuco_board_y_squares: number;- charuco_square_length: number;- min_shared_views_per_camera: number;- auto_stop_on_min_view_count: boolean;- solver_method: string;- use_groundplane: boolean;- };- mocap: {- detector: Record<string, unknown>;- skeleton_filter: Record<string, unknown>;- };- // vmc: {- // enabled: boolean;- // host: string;- // port: number;- // };-}--// ── Hook: gather current settings into a flat config object ──--function useAggregatedSettings(): AggregatedSettings {- const themeMode = useAppSelector(state => state.theme.mode);- const recording = useAppSelector(state => state.recording);- const calibration = useAppSelector(state => state.calibration.config);- const mocap = useAppSelector(state => state.mocap.config);- const serverSettings = useAppSelector(selectServerSettings);-- return useMemo((): AggregatedSettings => ({- appearance: {- mode: themeMode,- },- recording: {- recording_directory: recording.recordingDirectory,- use_delay_start: recording.config.useDelayStart,- delay_seconds: recording.config.delaySeconds,- use_timestamp: recording.config.useTimestamp,- use_increment: recording.config.useIncrement,- current_increment: recording.config.currentIncrement,- base_name: recording.config.baseName,- recording_tag: recording.config.recordingTag,- create_subfolder: recording.config.createSubfolder,- custom_subfolder_name: recording.config.customSubfolderName,- },- calibration: {- live_track_charuco: calibration.liveTrackCharuco,- charuco_board_x_squares: calibration.charucoBoardXSquares,- charuco_board_y_squares: calibration.charucoBoardYSquares,- charuco_square_length: calibration.charucoSquareLength,- min_shared_views_per_camera: calibration.minSharedViewsPerCamera,- auto_stop_on_min_view_count: calibration.autoStopOnMinViewCount,- solver_method: calibration.solverMethod,- use_groundplane: calibration.useGroundplane,- },- mocap: {- detector: mocap.detector as unknown as Record<string, unknown>,- skeleton_filter: mocap.skeleton_filter as unknown as Record<string, unknown>,- },- // vmc: {- // enabled: serverSettings?.vmc?.enabled ?? false,- // host: serverSettings?.vmc?.host ?? '127.0.0.1',- // port: serverSettings?.vmc?.port ?? 39539,- // },- }), [themeMode, recording, calibration, mocap, serverSettings]);-}--// ── Apply parsed settings back to the Redux stores ──--function useApplySettings() {- const dispatch = useAppDispatch();- const { send, isConnected } = useServer();-- return useCallback((parsed: Record<string, unknown>) => {- const settings = parsed as unknown as Partial<AggregatedSettings>;-- // Appearance- if (settings.appearance && typeof settings.appearance.mode === 'string') {- const mode = settings.appearance.mode;- if (mode === 'dark' || mode === 'light') {- dispatch(themeModeSet(mode as ThemeMode));- } else {- throw new Error(`Invalid appearance.mode: "${mode}" (must be "dark" or "light")`);- }- }-- // Recording- if (settings.recording) {- const rec = settings.recording;- if (typeof rec.recording_directory === 'string') {- dispatch(recordingDirectoryChanged(rec.recording_directory));- }- dispatch(configUpdated({- useDelayStart: rec.use_delay_start,- delaySeconds: rec.delay_seconds,- useTimestamp: rec.use_timestamp,- useIncrement: rec.use_increment,- currentIncrement: rec.current_increment,- baseName: rec.base_name,- recordingTag: rec.recording_tag,- createSubfolder: rec.create_subfolder,- customSubfolderName: rec.custom_subfolder_name,- }));- }-- // Calibration- if (settings.calibration) {- const cal = settings.calibration;- dispatch(calibrationConfigUpdated({- liveTrackCharuco: cal.live_track_charuco,- charucoBoardXSquares: cal.charuco_board_x_squares,- charucoBoardYSquares: cal.charuco_board_y_squares,- charucoSquareLength: cal.charuco_square_length,- minSharedViewsPerCamera: cal.min_shared_views_per_camera,- autoStopOnMinViewCount: cal.auto_stop_on_min_view_count,- solverMethod: cal.solver_method as 'anipose' | 'pyceres',- useGroundplane: cal.use_groundplane,- }));- dispatch(updateCalibrationConfigOnServer());- }-- // Mocap- if (settings.mocap) {- if (settings.mocap.detector) {- dispatch(mocapDetectorConfigReplaced(settings.mocap.detector as any));- }- if (settings.mocap.skeleton_filter) {- dispatch(skeletonFilterConfigReplaced(settings.mocap.skeleton_filter as any));- }- dispatch(updateMocapConfigOnServer());- }-- // VMC (patched via WebSocket)- if (settings.vmc && isConnected) {- send({- message_type: 'settings/patch',- patch: {- vmc: {- enabled: settings.vmc.enabled,- host: settings.vmc.host,- port: settings.vmc.port,- },- },- });- }- }, [dispatch, send, isConnected]);-}--// ── Format toggle button ──--function FormatButton({- format,- active,- onClick,-}: {- format: SerializationFormat;- active: boolean;- onClick: () => void;-}) {- return (- <Button- size="small"- variant={active ? 'contained' : 'outlined'}- onClick={onClick}- sx={{- textTransform: 'uppercase',- fontWeight: 700,- fontSize: '0.7rem',- minWidth: 56,- letterSpacing: 0.8,- }}- >- {format}- </Button>- );-}--// ── Main editor component ──--export const SettingsEditor: React.FC = () => {- const theme = useTheme();- const aggregated = useAggregatedSettings();- const applySettings = useApplySettings();-- const [format, setFormat] = useState<SerializationFormat>('json');- const [editorContent, setEditorContent] = useState<string>('');- const [hasEdits, setHasEdits] = useState(false);- const [error, setError] = useState<string | null>(null);- const [snackbar, setSnackbar] = useState<{ message: string; severity: 'success' | 'error' } | null>(null);-- const editorRef = useRef<any>(null);- const fileInputRef = useRef<HTMLInputElement>(null);-- // Serialize current settings whenever aggregated state or format changes (only if no pending edits)- const serializedFromStore = useMemo(- () => serialize(aggregated as unknown as Record<string, unknown>, format),- [aggregated, format],- );-- // Sync editor content from store when there are no pending edits- useEffect(() => {- if (!hasEdits) {- setEditorContent(serializedFromStore);- }- }, [serializedFromStore, hasEdits]);-- // Initialize editor on first mount- useEffect(() => {- setEditorContent(serialize(aggregated as unknown as Record<string, unknown>, format));- // Only run on mount- // eslint-disable-next-line react-hooks/exhaustive-deps- }, []);-- const handleEditorMount: OnMount = useCallback((editor) => {- editorRef.current = editor;- }, []);-- const handleEditorChange = useCallback((value: string | undefined) => {- if (value === undefined) return;- setEditorContent(value);- setHasEdits(true);- setError(null);- }, []);-- // Format switching — convert current content to new format- const handleFormatChange = useCallback((newFormat: SerializationFormat) => {- if (newFormat === format) return;- try {- const converted = convertFormat(editorContent, format, newFormat);- setEditorContent(converted);- setFormat(newFormat);- setError(null);- } catch (err) {- setError(`Cannot convert to ${newFormat.toUpperCase()}: ${err instanceof Error ? err.message : String(err)}`);- }- }, [editorContent, format]);-- // Reset editor to current store state- const handleReset = useCallback(() => {- const fresh = serialize(aggregated as unknown as Record<string, unknown>, format);- setEditorContent(fresh);- setHasEdits(false);- setError(null);- }, [aggregated, format]);-- // Apply edits to store- const handleApply = useCallback(() => {- try {- const parsed = deserialize(editorContent, format);- applySettings(parsed);- setHasEdits(false);- setError(null);- setSnackbar({ message: 'Settings applied successfully', severity: 'success' });- } catch (err) {- const message = err instanceof Error ? err.message : String(err);- setError(`Failed to apply: ${message}`);- setSnackbar({ message: `Failed to apply settings: ${message}`, severity: 'error' });- }- }, [editorContent, format, applySettings]);-- // Copy to clipboard- const handleCopy = useCallback(async () => {- try {- await navigator.clipboard.writeText(editorContent);- setSnackbar({ message: 'Copied to clipboard', severity: 'success' });- } catch {- setSnackbar({ message: 'Failed to copy to clipboard', severity: 'error' });- }- }, [editorContent]);-- // Download as file- const handleDownload = useCallback(() => {- const blob = new Blob([editorContent], { type: FORMAT_MIME_TYPES[format] });- const url = URL.createObjectURL(blob);- const a = document.createElement('a');- a.href = url;- a.download = `freemocap-settings${FORMAT_EXTENSIONS[format]}`;- a.click();- URL.revokeObjectURL(url);- }, [editorContent, format]);-- // Upload from file- const handleUploadClick = useCallback(() => {- fileInputRef.current?.click();- }, []);-- const handleFileSelected = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {- const file = e.target.files?.[0];- if (!file) return;-- // Detect format from file extension- const ext = file.name.split('.').pop()?.toLowerCase();- let detectedFormat: SerializationFormat = format;- if (ext === 'json') detectedFormat = 'json';- else if (ext === 'yaml' || ext === 'yml') detectedFormat = 'yaml';- else if (ext === 'toml') detectedFormat = 'toml';-- const reader = new FileReader();- reader.onload = (event) => {- const text = event.target?.result;- if (typeof text !== 'string') {- setError('Failed to read file');- return;- }- try {- // Validate by parsing- deserialize(text, detectedFormat);- setFormat(detectedFormat);- setEditorContent(text);- setHasEdits(true);- setError(null);- setSnackbar({ message: `Loaded ${file.name} (${detectedFormat.toUpperCase()})`, severity: 'success' });- } catch (err) {- setError(`Invalid ${detectedFormat.toUpperCase()} in ${file.name}: ${err instanceof Error ? err.message : String(err)}`);- }- };- reader.onerror = () => {- setError(`Failed to read file: ${file.name}`);- };- reader.readAsText(file);-- // Reset the input so the same file can be re-selected- e.target.value = '';- }, [format]);-- const isDark = theme.palette.mode === 'dark';-- return (- <Box sx={{ display: 'flex', flexDirection: 'column', height: '100%', gap: 1.5 }}>- {/* Toolbar */}- <Box- sx={{- display: 'flex',- alignItems: 'center',- justifyContent: 'space-between',- flexWrap: 'wrap',- gap: 1,- }}- >- {/* Format selector */}- <ButtonGroup size="small" variant="outlined">- <FormatButton format="json" active={format === 'json'} onClick={() => handleFormatChange('json')} />- <FormatButton format="yaml" active={format === 'yaml'} onClick={() => handleFormatChange('yaml')} />- <FormatButton format="toml" active={format === 'toml'} onClick={() => handleFormatChange('toml')} />- </ButtonGroup>-- {/* Action buttons */}- <Box sx={{ display: 'flex', gap: 0.75 }}>- <Tooltip title="Copy to clipboard">- <Button size="small" variant="outlined" onClick={handleCopy} sx={{ minWidth: 0, px: 1 }}>- <ContentCopyIcon sx={{ fontSize: 16 }} />- </Button>- </Tooltip>- <Tooltip title="Upload settings file (.json, .yaml, .toml)">- <Button size="small" variant="outlined" onClick={handleUploadClick} startIcon={<UploadFileIcon sx={{ fontSize: 16 }} />}>- Upload- </Button>- </Tooltip>- <Tooltip title={`Download as ${format.toUpperCase()}`}>- <Button size="small" variant="outlined" onClick={handleDownload} startIcon={<DownloadIcon sx={{ fontSize: 16 }} />}>- Download- </Button>- </Tooltip>-- <Divider orientation="vertical" flexItem sx={{ mx: 0.5 }} />-- <Tooltip title="Reset to current app state">- <span>- <Button- size="small"- variant="outlined"- onClick={handleReset}- disabled={!hasEdits}- startIcon={<RestoreIcon sx={{ fontSize: 16 }} />}- >- Reset- </Button>- </span>- </Tooltip>- <Tooltip title="Apply edits to app">- <span>- <Button- size="small"- variant="contained"- color="success"- onClick={handleApply}- disabled={!hasEdits}- startIcon={<CheckIcon sx={{ fontSize: 16 }} />}- >- Apply- </Button>- </span>- </Tooltip>- </Box>- </Box>-- {/* Status bar */}- {hasEdits && (- <Alert severity="info" sx={{ py: 0, fontSize: '0.75rem' }}>- You have unsaved edits. Click <strong>Apply</strong> to push changes to the app, or <strong>Reset</strong> to discard.- </Alert>- )}- {error && (- <Alert severity="error" sx={{ py: 0, fontSize: '0.75rem' }}>- {error}- </Alert>- )}-- {/* Monaco Editor */}- <Box- sx={{- flex: 1,- minHeight: 400,- border: `1px solid ${theme.palette.divider}`,- borderRadius: 1,- overflow: 'hidden',- }}- >- <Editor- height="100%"- language={FORMAT_MONACO_LANGUAGES[format]}- value={editorContent}- theme={isDark ? 'vs-dark' : 'light'}- onChange={handleEditorChange}- onMount={handleEditorMount}- loading={- <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>- <CircularProgress size={32} />- </Box>- }- options={{- minimap: { enabled: false },- fontSize: 13,- fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace",- lineNumbers: 'on',- scrollBeyondLastLine: false,- wordWrap: 'on',- tabSize: 2,- automaticLayout: true,- renderWhitespace: 'selection',- bracketPairColorization: { enabled: true },- folding: true,- formatOnPaste: true,- }}- />- </Box>-- {/* Hidden file input for upload */}- <input- ref={fileInputRef}- type="file"- accept=".json,.yaml,.yml,.toml"- style={{ display: 'none' }}- onChange={handleFileSelected}- />-- {/* Snackbar for feedback */}- <Snackbar- open={snackbar !== null}- autoHideDuration={3000}- onClose={() => setSnackbar(null)}- anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}- >- {snackbar ? (- <Alert- onClose={() => setSnackbar(null)}- severity={snackbar.severity}- variant="filled"- sx={{ width: '100%' }}- >- {snackbar.message}- </Alert>- ) : undefined}- </Snackbar>- </Box>- );-};diff --git a/freemocap-ui/src/components/settings-editor/format-converters.ts b/freemocap-ui/src/components/settings-editor/format-converters.tsdeleted file mode 100644index dab7ab60..00000000--- a/freemocap-ui/src/components/settings-editor/format-converters.ts+++ /dev/null@@ -1,81 +0,0 @@-import yaml from 'js-yaml';-import * as TOML from 'smol-toml';--export type SerializationFormat = 'json' | 'yaml' | 'toml';--/** Recursively remove null values from an object (TOML has no null concept). */-function stripNulls(obj: Record<string, unknown>): Record<string, unknown> {- const result: Record<string, unknown> = {};- for (const [key, value] of Object.entries(obj)) {- if (value === null || value === undefined) continue;- if (typeof value === 'object' && !Array.isArray(value)) {- result[key] = stripNulls(value as Record<string, unknown>);- } else {- result[key] = value;- }- }- return result;-}--export function serialize(data: Record<string, unknown>, format: SerializationFormat): string {- switch (format) {- case 'json':- return JSON.stringify(data, null, 2);- case 'yaml':- return yaml.dump(data, {- indent: 2,- lineWidth: 120,- noRefs: true,- sortKeys: false,- });- case 'toml':- // smol-toml expects a plain record; strip null values since TOML has no null- return TOML.stringify(stripNulls(data) as any);- }-}--export function deserialize(text: string, format: SerializationFormat): Record<string, unknown> {- switch (format) {- case 'json': {- const parsed = JSON.parse(text);- if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {- throw new Error('JSON root must be an object');- }- return parsed as Record<string, unknown>;- }- case 'yaml': {- const parsed = yaml.load(text);- if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {- throw new Error('YAML root must be a mapping');- }- return parsed as Record<string, unknown>;- }- case 'toml': {- return TOML.parse(text) as Record<string, unknown>;- }- }-}--export function convertFormat(text: string, from: SerializationFormat, to: SerializationFormat): string {- if (from === to) return text;- const data = deserialize(text, from);- return serialize(data, to);-}--export const FORMAT_EXTENSIONS: Record<SerializationFormat, string> = {- json: '.json',- yaml: '.yaml',- toml: '.toml',-};--export const FORMAT_MIME_TYPES: Record<SerializationFormat, string> = {- json: 'application/json',- yaml: 'text/yaml',- toml: 'application/toml',-};--export const FORMAT_MONACO_LANGUAGES: Record<SerializationFormat, string> = {- json: 'json',- yaml: 'yaml',- toml: 'toml',-};diff --git a/freemocap-ui/src/components/setup-wizard/FirstLaunchRedirect.tsx b/freemocap-ui/src/components/setup-wizard/FirstLaunchRedirect.tsxdeleted file mode 100644index 2021bb52..00000000--- a/freemocap-ui/src/components/setup-wizard/FirstLaunchRedirect.tsx+++ /dev/null@@ -1,26 +0,0 @@-import React, { useEffect } from 'react';-import { useNavigate, useLocation } from 'react-router-dom';-import { useSetupWizardRequired } from '@/components/setup-wizard/SetupWizard';--/**- * Invisible component that redirects to /setup on first launch.- * Render this anywhere inside a HashRouter.- * Once setup is complete (persisted to ~/.freemocap/settings.json),- * this does nothing.- */-export const FirstLaunchRedirect: React.FC = () => {- const { loading, required } = useSetupWizardRequired();- const navigate = useNavigate();- const location = useLocation();-- useEffect(() => {- if (loading) return;- if (!required) return;- // Don't redirect if we're already on the settings page- if (location.pathname === '/settings') return;-- navigate('/settings', { replace: true });- }, [loading, required, location.pathname, navigate]);-- return null;-};diff --git a/freemocap-ui/src/components/setup-wizard/SetupWizard.tsx b/freemocap-ui/src/components/setup-wizard/SetupWizard.tsxdeleted file mode 100644index 61c77eae..00000000--- a/freemocap-ui/src/components/setup-wizard/SetupWizard.tsx+++ /dev/null@@ -1,758 +0,0 @@-import React, { useState, useEffect, useCallback } from 'react';-import {- Box,- Typography,- Button,- LinearProgress,- CircularProgress,- Chip,- Tooltip,- Alert,- Paper,- Stepper,- Step,- StepLabel,- IconButton,-} from '@mui/material';-import { useTheme } from '@mui/material/styles';-import CheckCircleIcon from '@mui/icons-material/CheckCircle';-import ErrorIcon from '@mui/icons-material/Error';-import WarningIcon from '@mui/icons-material/Warning';-import DownloadIcon from '@mui/icons-material/Download';-import RefreshIcon from '@mui/icons-material/Refresh';-import ComputerIcon from '@mui/icons-material/Computer';-import MemoryIcon from '@mui/icons-material/Memory';-import StorageIcon from '@mui/icons-material/Storage';-import SpeedIcon from '@mui/icons-material/Speed';-import VideocamIcon from '@mui/icons-material/Videocam';-import ArrowForwardIcon from '@mui/icons-material/ArrowForward';-import ArrowBackIcon from '@mui/icons-material/ArrowBack';-import CloseIcon from '@mui/icons-material/Close';-import { useElectronIPC } from '@/services';--// ── Types (mirrors electron-side types) ──--interface CpuInfo { model: string; cores: number; threads: number; speedMhz: number }-interface RamInfo { totalGb: number; availableGb: number }-interface GpuInfo { name: string; vendor: string; vramMb: number | null; cudaAvailable: boolean; cudaVersion: string | null }-interface DiskInfo { path: string; totalGb: number; freeGb: number }-interface OsInfo { platform: string; release: string; arch: string; hostname: string }-type PerformanceTier = 'basic' | 'standard' | 'advanced' | 'pro';-interface PerformanceRecommendation {- tier: PerformanceTier;- label: string;- description: string;- maxCameras: number;- maxResolution: string;- realtimeTracking: boolean;- warnings: string[];-}-interface SystemScanResult {- cpu: CpuInfo;- ram: RamInfo;- gpus: GpuInfo[];- disk: DiskInfo;- os: OsInfo;- recommendation: PerformanceRecommendation;- scannedAt: string;-}--type DependencyStatus = 'installed' | 'missing' | 'outdated' | 'checking' | 'installing' | 'error';-interface DependencyInfo {- id: string;- name: string;- description: string;- required: boolean;- status: DependencyStatus;- version: string | null;- installedPath: string | null;- error: string | null;-}--// ── Constants ──--const SETUP_COMPLETE_KEY = 'setupComplete';-const SYSTEM_SCAN_KEY = 'lastSystemScan';-const STEPS = ['System Scan', 'Dependencies', 'Ready'];--const TIER_COLORS: Record<PerformanceTier, string> = {- basic: '#ff9800',- standard: '#2196f3',- advanced: '#4caf50',- pro: '#00e5ff',-};--const TIER_EMOJIS: Record<PerformanceTier, string> = {- basic: '🐢',- standard: '🏃',- advanced: '🚀',- pro: '⚡',-};--// ── Status icon helper ──--function StatusIcon({ status }: { status: DependencyStatus }) {- switch (status) {- case 'installed':- return <CheckCircleIcon sx={{ color: '#4caf50', fontSize: 20 }} />;- case 'missing':- return <ErrorIcon sx={{ color: '#f44336', fontSize: 20 }} />;- case 'outdated':- return <WarningIcon sx={{ color: '#ff9800', fontSize: 20 }} />;- case 'checking':- case 'installing':- return <CircularProgress size={18} />;- case 'error':- return <ErrorIcon sx={{ color: '#f44336', fontSize: 20 }} />;- }-}--// ── Step 0: System Scan ──--function SystemScanStep({- scanResult,- scanning,- onRescan,-}: {- scanResult: SystemScanResult | null;- scanning: boolean;- onRescan: () => void;-}) {- const theme = useTheme();-- if (scanning) {- return (- <Box sx={{ textAlign: 'center', py: 6 }}>- <CircularProgress size={48} />- <Typography sx={{ mt: 2, color: theme.palette.text.secondary }}>- Scanning your system...- </Typography>- </Box>- );- }-- if (!scanResult) {- return (- <Box sx={{ textAlign: 'center', py: 6 }}>- <Typography color="error">Scan failed. Please retry.</Typography>- <Button onClick={onRescan} startIcon={<RefreshIcon />} sx={{ mt: 2 }}>- Retry Scan- </Button>- </Box>- );- }-- const { cpu, ram, gpus, disk, os: osInfo, recommendation } = scanResult;- const tierColor = TIER_COLORS[recommendation.tier];-- return (- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>- {/* Performance Tier Badge */}- <Paper- elevation={0}- sx={{- p: 2,- border: `2px solid ${tierColor}`,- borderRadius: 2,- background: `${tierColor}11`,- textAlign: 'center',- }}- >- <Typography variant="h5" sx={{ fontWeight: 700, color: tierColor }}>- {TIER_EMOJIS[recommendation.tier]} {recommendation.label} System- </Typography>- <Typography variant="body2" sx={{ mt: 0.5, color: theme.palette.text.secondary }}>- {recommendation.description}- </Typography>- <Box sx={{ display: 'flex', justifyContent: 'center', gap: 2, mt: 1.5, flexWrap: 'wrap' }}>- <Chip- icon={<VideocamIcon />}- label={`Up to ${recommendation.maxCameras} cameras`}- size="small"- sx={{ borderColor: tierColor, color: tierColor }}- variant="outlined"- />- <Chip- label={`${recommendation.maxResolution} max`}- size="small"- sx={{ borderColor: tierColor, color: tierColor }}- variant="outlined"- />- {recommendation.realtimeTracking && (- <Chip- icon={<SpeedIcon />}- label="Real-time tracking"- size="small"- sx={{ borderColor: tierColor, color: tierColor }}- variant="outlined"- />- )}- </Box>- </Paper>-- {/* Hardware Details Grid */}- <Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}>- {/* CPU */}- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <MemoryIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>- CPU- </Typography>- </Box>- <Typography variant="body2" sx={{ fontWeight: 500, fontSize: '0.8rem' }}>- {cpu.model}- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {cpu.threads} threads • {cpu.cores} cores • {cpu.speedMhz} MHz- </Typography>- </Paper>-- {/* RAM */}- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <ComputerIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>- MEMORY- </Typography>- </Box>- <Typography variant="body2" sx={{ fontWeight: 500 }}>- {ram.totalGb} GB total- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {ram.availableGb} GB available- </Typography>- </Paper>-- {/* GPU */}- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <SpeedIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>- GPU- </Typography>- </Box>- {gpus.length > 0 ? gpus.map((gpu, i) => (- <Box key={i}>- <Typography variant="body2" sx={{ fontWeight: 500, fontSize: '0.8rem' }}>- {gpu.name}- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {gpu.vramMb ? `${Math.round(gpu.vramMb / 1024)} GB VRAM` : 'VRAM unknown'}- {gpu.cudaAvailable ? ` • CUDA ${gpu.cudaVersion || '✓'}` : ''}- </Typography>- </Box>- )) : (- <Typography variant="body2" sx={{ color: theme.palette.text.disabled }}>- No dedicated GPU detected- </Typography>- )}- </Paper>-- {/* Disk */}- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <StorageIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>- DISK- </Typography>- </Box>- <Typography variant="body2" sx={{ fontWeight: 500 }}>- {disk.freeGb} GB free- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- of {disk.totalGb} GB total- </Typography>- {disk.freeGb > 0 && disk.freeGb < 20 && (- <LinearProgress- variant="determinate"- value={((disk.totalGb - disk.freeGb) / disk.totalGb) * 100}- color="warning"- sx={{ mt: 0.5, height: 4, borderRadius: 1 }}- />- )}- </Paper>- </Box>-- {/* Warnings */}- {recommendation.warnings.length > 0 && (- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>- {recommendation.warnings.map((w, i) => (- <Alert key={i} severity="warning" sx={{ py: 0, fontSize: '0.75rem' }}>- {w}- </Alert>- ))}- </Box>- )}-- {/* Rescan button */}- <Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>- <Button size="small" startIcon={<RefreshIcon />} onClick={onRescan}>- Rescan- </Button>- </Box>- </Box>- );-}--// ── Step 1: Dependencies ──--function DependenciesStep({- dependencies,- installing,- onInstall,- onRefresh,-}: {- dependencies: DependencyInfo[];- installing: string | null;- onInstall: (id: string) => void;- onRefresh: () => void;-}) {- const theme = useTheme();-- if (dependencies.length === 0) {- return (- <Box sx={{ textAlign: 'center', py: 6 }}>- <CircularProgress size={48} />- <Typography sx={{ mt: 2, color: theme.palette.text.secondary }}>- Checking dependencies...- </Typography>- </Box>- );- }-- const required = dependencies.filter(d => d.required);- const optional = dependencies.filter(d => !d.required);-- return (- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>- {/* Required */}- <Box>- <Typography variant="subtitle2" sx={{ mb: 1, color: theme.palette.text.secondary, fontWeight: 600 }}>- REQUIRED- </Typography>- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>- {required.map(dep => (- <DependencyRow- key={dep.id}- dep={dep}- installing={installing === dep.id}- onInstall={() => onInstall(dep.id)}- />- ))}- </Box>- </Box>-- {/* Optional */}- <Box>- <Typography variant="subtitle2" sx={{ mb: 1, color: theme.palette.text.secondary, fontWeight: 600 }}>- OPTIONAL- </Typography>- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>- {optional.map(dep => (- <DependencyRow- key={dep.id}- dep={dep}- installing={installing === dep.id}- onInstall={() => onInstall(dep.id)}- />- ))}- </Box>- </Box>-- <Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>- <Button size="small" startIcon={<RefreshIcon />} onClick={onRefresh}>- Recheck All- </Button>- </Box>- </Box>- );-}--function DependencyRow({- dep,- installing,- onInstall,-}: {- dep: DependencyInfo;- installing: boolean;- onInstall: () => void;-}) {- const theme = useTheme();- const canInstall = dep.status === 'missing' || dep.status === 'outdated';- const isCuda = dep.id === 'cuda';-- return (- <Paper- elevation={0}- sx={{- p: 1.5,- border: `1px solid ${theme.palette.divider}`,- borderRadius: 1,- display: 'flex',- alignItems: 'center',- gap: 1.5,- }}- >- <StatusIcon status={installing ? 'installing' : dep.status} />-- <Box sx={{ flex: 1, minWidth: 0 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>- <Typography variant="body2" sx={{ fontWeight: 600 }}>- {dep.name}- </Typography>- {dep.version && (- <Chip label={dep.version} size="small" sx={{ height: 18, fontSize: '0.65rem' }} />- )}- {dep.required && (- <Chip label="required" size="small" color="warning" variant="outlined" sx={{ height: 18, fontSize: '0.6rem' }} />- )}- </Box>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {dep.description}- </Typography>- {dep.error && (- <Typography variant="caption" sx={{ display: 'block', color: theme.palette.error.main, mt: 0.25 }}>- {dep.error}- </Typography>- )}- {dep.installedPath && dep.status === 'installed' && (- <Tooltip title={dep.installedPath}>- <Typography- variant="caption"- sx={{- display: 'block',- color: theme.palette.text.disabled,- fontSize: '0.6rem',- overflow: 'hidden',- textOverflow: 'ellipsis',- whiteSpace: 'nowrap',- maxWidth: 300,- }}- >- {dep.installedPath}- </Typography>- </Tooltip>- )}- </Box>-- {canInstall && !isCuda && (- <Button- size="small"- variant="contained"- startIcon={installing ? <CircularProgress size={14} color="inherit" /> : <DownloadIcon />}- onClick={onInstall}- disabled={installing}- sx={{ textTransform: 'none', fontSize: '0.75rem', whiteSpace: 'nowrap' }}- >- {installing ? 'Installing...' : dep.status === 'outdated' ? 'Update' : 'Install'}- </Button>- )}- {canInstall && isCuda && (- <Tooltip title="CUDA must be installed manually from the NVIDIA website">- <Typography variant="caption" sx={{ color: theme.palette.text.disabled, fontStyle: 'italic' }}>- Manual install- </Typography>- </Tooltip>- )}- </Paper>- );-}--// ── Step 2: Ready ──--function ReadyStep({ scanResult }: { scanResult: SystemScanResult | null }) {- const theme = useTheme();- const tier = scanResult?.recommendation.tier ?? 'standard';- const tierColor = TIER_COLORS[tier];-- return (- <Box sx={{ textAlign: 'center', py: 4 }}>- <CheckCircleIcon sx={{ fontSize: 64, color: '#4caf50', mb: 2 }} />- <Typography variant="h5" sx={{ fontWeight: 700, mb: 1 }}>- You're all set!- </Typography>- <Typography sx={{ color: theme.palette.text.secondary, mb: 3, maxWidth: 400, mx: 'auto' }}>- FreeMoCap is ready to go. You can always re-run this setup from the settings menu.- </Typography>-- {scanResult && (- <Box sx={{ display: 'flex', justifyContent: 'center', gap: 1, flexWrap: 'wrap' }}>- <Chip- label={`${scanResult.recommendation.label} System`}- sx={{ borderColor: tierColor, color: tierColor, fontWeight: 600 }}- variant="outlined"- />- <Chip- label={`Up to ${scanResult.recommendation.maxCameras} cameras @ ${scanResult.recommendation.maxResolution}`}- variant="outlined"- size="small"- />- </Box>- )}- </Box>- );-}--// ── Main Wizard ──--interface SetupWizardProps {- onComplete: () => void;- /** When true, always shows the wizard regardless of persisted state */- forceShow?: boolean;-}--export const SetupWizard: React.FC<SetupWizardProps> = ({ onComplete, forceShow = false }) => {- const theme = useTheme();- const { isElectron, api } = useElectronIPC();-- const [activeStep, setActiveStep] = useState(0);- const [scanning, setScanning] = useState(false);- const [scanResult, setScanResult] = useState<SystemScanResult | null>(null);- const [dependencies, setDependencies] = useState<DependencyInfo[]>([]);- const [installing, setInstalling] = useState<string | null>(null);-- // ── System scan ──-- const runScan = useCallback(async () => {- if (!isElectron || !api) return;- setScanning(true);- try {- const result = await api.system.scan.query();- const typed = result as SystemScanResult;- setScanResult(typed);- // Persist scan result to ~/.freemocap/settings.json- await api.settings.set.mutate({ key: SYSTEM_SCAN_KEY, value: typed });- } catch (err) {- console.error('System scan failed:', err);- } finally {- setScanning(false);- }- }, [isElectron, api]);-- // ── Dependency detection ──-- const detectDeps = useCallback(async () => {- if (!isElectron || !api) return;- try {- const result = await api.dependencies.detectAll.query();- setDependencies(result as DependencyInfo[]);- } catch (err) {- console.error('Dependency detection failed:', err);- }- }, [isElectron, api]);-- // ── Install a dependency ──-- const installDep = useCallback(async (depId: string) => {- if (!isElectron || !api) return;- setInstalling(depId);- try {- const updated = await api.dependencies.install.mutate({ dependencyId: depId });- setDependencies(prev =>- prev.map(d => d.id === depId ? (updated as DependencyInfo) : d),- );-- // After installing uv, re-detect python-env too (it depends on uv)- if (depId === 'uv') {- const envInfo = await api.dependencies.detect.query({ dependencyId: 'python-env' });- setDependencies(prev =>- prev.map(d => d.id === 'python-env' ? (envInfo as DependencyInfo) : d),- );- }- } catch (err) {- console.error(`Failed to install ${depId}:`, err);- setDependencies(prev =>- prev.map(d =>- d.id === depId- ? { ...d, status: 'error' as DependencyStatus, error: err instanceof Error ? err.message : String(err) }- : d,- ),- );- } finally {- setInstalling(null);- }- }, [isElectron, api]);-- // ── Load persisted scan result on mount ──-- useEffect(() => {- if (!isElectron || !api) return;- api.settings.get.query({ key: SYSTEM_SCAN_KEY }).then(result => {- if (result && typeof result === 'object' && 'cpu' in (result as object)) {- setScanResult(result as SystemScanResult);- }- }).catch(() => { /* no persisted scan — will run fresh */ });- }, [isElectron, api]);-- // ── Auto-run on step change ──-- useEffect(() => {- if (activeStep === 0 && !scanResult && !scanning) {- runScan();- }- }, [activeStep, scanResult, scanning, runScan]);-- useEffect(() => {- if (activeStep === 1 && dependencies.length === 0) {- detectDeps();- }- }, [activeStep, dependencies.length, detectDeps]);-- // ── Completion ──-- const handleFinish = useCallback(() => {- if (isElectron && api) {- api.settings.set.mutate({ key: SETUP_COMPLETE_KEY, value: true }).catch(err => {- console.error('Failed to persist setup complete state:', err);- });- }- onComplete();- }, [onComplete, isElectron, api]);-- // ── Navigation ──-- const canProceed = (): boolean => {- if (activeStep === 0) return scanResult !== null;- if (activeStep === 1) return true; // Dependencies are not blocking- return true;- };-- // If not in Electron, show a simple non-Electron message- if (!isElectron) {- return (- <Box sx={{ p: 4, textAlign: 'center' }}>- <Typography variant="h6" sx={{ mb: 2 }}>Setup Wizard</Typography>- <Typography sx={{ color: theme.palette.text.secondary, mb: 3 }}>- The setup wizard is only available in the desktop app.- Connect to a running FreeMoCap server to get started.- </Typography>- <Button variant="contained" onClick={onComplete}>Continue</Button>- </Box>- );- }-- return (- <Box- sx={{- width: '100%',- maxWidth: 640,- mx: 'auto',- p: 3,- display: 'flex',- flexDirection: 'column',- gap: 2,- }}- >- {/* Header */}- <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>- <Typography variant="h6" sx={{ fontWeight: 700 }}>- FreeMoCap Setup- </Typography>- <Tooltip title="Skip setup">- <IconButton size="small" onClick={handleFinish}>- <CloseIcon sx={{ fontSize: 18 }} />- </IconButton>- </Tooltip>- </Box>-- {/* Stepper */}- <Stepper activeStep={activeStep} alternativeLabel sx={{ mb: 1 }}>- {STEPS.map(label => (- <Step key={label}>- <StepLabel>{label}</StepLabel>- </Step>- ))}- </Stepper>-- {/* Step Content */}- <Box sx={{ minHeight: 300 }}>- {activeStep === 0 && (- <SystemScanStep- scanResult={scanResult}- scanning={scanning}- onRescan={runScan}- />- )}- {activeStep === 1 && (- <DependenciesStep- dependencies={dependencies}- installing={installing}- onInstall={installDep}- onRefresh={detectDeps}- />- )}- {activeStep === 2 && (- <ReadyStep scanResult={scanResult} />- )}- </Box>-- {/* Navigation Buttons */}- <Box sx={{ display: 'flex', justifyContent: 'space-between', mt: 1 }}>- <Button- disabled={activeStep === 0}- onClick={() => setActiveStep(prev => prev - 1)}- startIcon={<ArrowBackIcon />}- sx={{ textTransform: 'none' }}- >- Back- </Button>-- {activeStep < STEPS.length - 1 ? (- <Button- variant="contained"- disabled={!canProceed()}- onClick={() => setActiveStep(prev => prev + 1)}- endIcon={<ArrowForwardIcon />}- sx={{ textTransform: 'none' }}- >- Next- </Button>- ) : (- <Button- variant="contained"- color="success"- onClick={handleFinish}- sx={{ textTransform: 'none', fontWeight: 600 }}- >- Get Started- </Button>- )}- </Box>- </Box>- );-};--// ── Hook: should the wizard be shown? ──-// Reads from ~/.freemocap/settings.json via electron IPC.-// Returns { loading, required } — `required` is true until we've confirmed-// the file says setup is complete.--export function useSetupWizardRequired(): { loading: boolean; required: boolean } {- const { isElectron, api } = useElectronIPC();- const [loading, setLoading] = useState(true);- const [required, setRequired] = useState(true);-- useEffect(() => {- if (!isElectron || !api) {- // Not in Electron — never show the wizard- setRequired(false);- setLoading(false);- return;- }-- api.settings.get.query({ key: SETUP_COMPLETE_KEY })- .then(value => {- setRequired(value !== true);- })- .catch(() => {- // Settings file doesn't exist yet — setup is required- setRequired(true);- })- .finally(() => {- setLoading(false);- });- }, [isElectron, api]);-- return { loading, required };-}\ No newline at end of filediff --git a/freemocap-ui/src/components/ui-components/BottomPanelContent.tsx b/freemocap-ui/src/components/ui-components/BottomPanelContent.tsxindex f1359035..0ea13fc1 100644--- a/freemocap-ui/src/components/ui-components/BottomPanelContent.tsx+++ b/freemocap-ui/src/components/ui-components/BottomPanelContent.tsx@@ -11,12 +11,11 @@ export default function BottomPanelContent() {return (<Box sx={{width: '100%', height: '100%'}}>- <PanelGroup direction="horizontal">+ <PanelGroup direction="horizontal" style={{direction: "ltr"}}>{/* Framerate Viewer Panel */}<Panel defaultSize={30} minSize={20}><Box sx={{height: '100%', overflow: 'auto'}}><FramerateViewerPanel/>- Framerate Viewer</Box></Panel>diff --git a/freemocap-ui/src/components/ui-components/Footer.tsx b/freemocap-ui/src/components/ui-components/Footer.tsxindex 441c19a8..632e0557 100644--- a/freemocap-ui/src/components/ui-components/Footer.tsx+++ b/freemocap-ui/src/components/ui-components/Footer.tsx@@ -1,24 +1,28 @@-// Update Copyright.tsximport Typography from "@mui/material/Typography";import Link from "@mui/material/Link";import * as React from "react";import {useTheme} from "@mui/material";+import {useTranslation} from "react-i18next";+import {EXTERNAL_URLS} from "@/constants/external-urls";export const Footer = function () {const theme = useTheme();+ const {t} = useTranslation();return (<Typographyvariant="body2"- color={theme.palette.mode === 'dark' ? "rgba(255,255,255,0.7)" : "rgba(0,0,0,0.6)"}+ color={theme.palette.mode === 'dark' ? "rgba(255,255,255,0.5)" : "rgba(0,0,0,0.45)"}align="center">- {'w/ '}- <Link color="inherit" href="https://github.com/freemocap/">+ {t('footerWith') + ' '}+ <Link color="inherit" href={EXTERNAL_URLS.GITHUB_ORG} target="_blank" rel="noopener noreferrer"+ sx={{display: 'inline-flex', alignItems: 'center', textDecoration: 'none'}}>❤️- </Link>{' from the '}- <Link color="inherit" href="https://github.com/freemocap/">- FreeMoCap Foundation+ </Link>{' ' + t('footerFrom') + ' '}+ <Link color="inherit" href={EXTERNAL_URLS.GITHUB_ORG} target="_blank" rel="noopener noreferrer"+ sx={{display: 'inline-flex', alignItems: 'center', textDecoration: 'none', '&:hover': { textDecoration: 'underline' }}}>+ {t('footerOrgName')}</Link>{' '}{new Date().getFullYear()}</Typography>diff --git a/freemocap-ui/src/components/ui-components/Header.tsx b/freemocap-ui/src/components/ui-components/Header.tsxindex bd443e8c..364389da 100644--- a/freemocap-ui/src/components/ui-components/Header.tsx+++ b/freemocap-ui/src/components/ui-components/Header.tsx@@ -21,7 +21,7 @@ export const Header = function () {><Toolbar><Typography variant="h6" color="inherit" sx={{flexGrow: 1}}>- FreeMoCap 💀📸+ FreeMoCap 💀✨</Typography><Box sx={{display: 'flex', alignItems: 'center', gap: 1}}><ThemeToggle/>diff --git a/freemocap-ui/src/components/ui-components/LeftSidePanelContent.tsx b/freemocap-ui/src/components/ui-components/LeftSidePanelContent.tsxindex 8cb8ec8d..f5e010b2 100644--- a/freemocap-ui/src/components/ui-components/LeftSidePanelContent.tsx+++ b/freemocap-ui/src/components/ui-components/LeftSidePanelContent.tsx@@ -1,290 +1,387 @@-import React, { useCallback, useMemo, useState } from 'react';-import Box from '@mui/material/Box';-import { IconButton, List, ListItem, Tooltip, useTheme } from '@mui/material';-import {- closestCenter,- DndContext,- DragEndEvent,- KeyboardSensor,- PointerSensor,- useSensor,- useSensors,-} from '@dnd-kit/core';-import {- arrayMove,- SortableContext,- sortableKeyboardCoordinates,- verticalListSortingStrategy,-} from '@dnd-kit/sortable';-import { restrictToVerticalAxis, restrictToParentElement } from '@dnd-kit/modifiers';-import ThemeToggle from '@/components/ui-components/ThemeToggle';+// freemocap-ui/src/components/ui-components/LeftSidePanelContent.tsx+import * as React from 'react';+import Box from "@mui/material/Box";+import {Button, IconButton, List, ListItem, Tooltip, useTheme} from "@mui/material";+import {RecordingInfoPanel} from "@/components/recording-info-panel/RecordingInfoPanel";+import ThemeToggle from "@/components/ui-components/ThemeToggle";import HomeIcon from '@mui/icons-material/Home';-import { useLocation, useNavigate } from 'react-router-dom';+import MenuIcon from '@mui/icons-material/Menu';+import MenuOpenIcon from '@mui/icons-material/MenuOpen';+import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord';+import StopIcon from '@mui/icons-material/Stop';import VideocamIcon from '@mui/icons-material/Videocam';-import DirectionsRunIcon from '@mui/icons-material/DirectionsRun';-import TuneIcon from '@mui/icons-material/Tune';-import { VideoFolderPanel } from '@/components/video-folder-panel/VideoFolderPanel';-import { SortableSectionWrapper } from '@/components/common/SortableSectionWrapper';-import { ServerConnectionStatus } from '@/components/ServerConnectionStatus';-import { ProcessingPipelinePanel } from '@/components/processing-pipeline-panel/ProcessingPipelinePanel';-import { CameraConfigTreeView } from '@/components/camera-config-tree-view/CameraConfigTreeView';-import { CalibrationControlPanel } from '@/components/calibration-control-panel/CalibrationControlPanel';-import { MocapTaskTreeItem } from '@/components/mocap-control-panel/MocapTaskTreeItem';+import SlideshowIcon from '@mui/icons-material/Slideshow';+import SettingsIcon from '@mui/icons-material/Settings';+import {useLocation, useNavigate} from "react-router-dom";+import {CameraConfigTreeView} from "@/components/camera-config-tree-view/CameraConfigTreeView";+import {ServerConnectionStatus} from "@/components/ServerConnectionStatus";+import {useAppDispatch, useAppSelector} from "@/store";+import {startRecording, stopRecording} from "@/store";+import {useTranslation} from "react-i18next";+import {useServer} from "@/services/server/ServerContextProvider";+import {TreeItem} from "@mui/x-tree-view/TreeItem";+import {MicrophoneSelector} from "@/components/recording-info-panel/recording-subcomponents/MicrophoneSelector";+import {useElectronIPC} from "@/services";+import {useState} from "react";+import {getTimestampString} from "@/components/recording-info-panel/getTimestampString";-const STORAGE_KEY = 'freemocap-sidebar-section-order';--const DEFAULT_SECTION_ORDER = [- 'connection',- 'pipeline',- 'cameras',- 'calibration',- 'mocap',-] as const;--type SectionId = (typeof DEFAULT_SECTION_ORDER)[number];--const SECTION_COMPONENTS: Record<SectionId, React.FC> = {- connection: ServerConnectionStatus,- pipeline: ProcessingPipelinePanel,- cameras: CameraConfigTreeView,- calibration: CalibrationControlPanel,- mocap: MocapTaskTreeItem,-};--function loadSectionOrder(): SectionId[] {- try {- const stored = localStorage.getItem(STORAGE_KEY);- if (!stored) return [...DEFAULT_SECTION_ORDER];- const parsed = JSON.parse(stored) as string[];- const defaultSet = new Set<string>(DEFAULT_SECTION_ORDER);- const parsedSet = new Set(parsed);- if (- parsed.length !== DEFAULT_SECTION_ORDER.length ||- !parsed.every((id) => defaultSet.has(id)) ||- !DEFAULT_SECTION_ORDER.every((id) => parsedSet.has(id))- ) {- return [...DEFAULT_SECTION_ORDER];- }- return parsed as SectionId[];- } catch {- return [...DEFAULT_SECTION_ORDER];- }-}--function saveSectionOrder(order: SectionId[]): void {- try {- localStorage.setItem(STORAGE_KEY, JSON.stringify(order));- } catch {- // Storage full or unavailable — silently ignore- }+interface LeftSidePanelContentProps {+ isCollapsed: boolean;+ onToggleCollapse: () => void;}+// Scrollbar stylesconst scrollbarStyles = {'&::-webkit-scrollbar': {width: '6px',backgroundColor: 'transparent',},'&::-webkit-scrollbar-thumb': {- backgroundColor: (theme: { palette: { mode: string } }) =>- theme.palette.mode === 'dark'- ? 'rgba(255, 255, 255, 0.2)'- : 'rgba(0, 0, 0, 0.2)',+ backgroundColor: (theme: { palette: { mode: string; }; }) => theme.palette.mode === 'dark'+ ? 'rgba(255, 255, 255, 0.2)'+ : 'rgba(0, 0, 0, 0.2)',borderRadius: '3px','&:hover': {- backgroundColor: (theme: { palette: { mode: string } }) =>- theme.palette.mode === 'dark'- ? 'rgba(255, 255, 255, 0.3)'- : 'rgba(0, 0, 0, 0.3)',+ backgroundColor: (theme: { palette: { mode: string; }; }) => theme.palette.mode === 'dark'+ ? 'rgba(255, 255, 255, 0.3)'+ : 'rgba(0, 0, 0, 0.3)',},},'&::-webkit-scrollbar-track': {backgroundColor: 'transparent',},scrollbarWidth: 'thin',- scrollbarColor: (theme: { palette: { mode: string } }) =>- theme.palette.mode === 'dark'- ? 'rgba(255, 255, 255, 0.2) transparent'- : 'rgba(0, 0, 0, 0.2) transparent',+ scrollbarColor: (theme: { palette: { mode: string; }; }) => theme.palette.mode === 'dark'+ ? 'rgba(255, 255, 255, 0.2) transparent'+ : 'rgba(0, 0, 0, 0.2) transparent',};-export const LeftSidePanelContent = () => {+/** Collapsed sidebar: vertical icon toolbar with hamburger, record, and cameras. */+const CollapsedToolbar: React.FC<{+ onToggleCollapse: () => void;+ isRecording: boolean;+ noCameras: boolean;+ onRecordClick: () => void;+}> = ({onToggleCollapse, isRecording, noCameras, onRecordClick}) => {const theme = useTheme();const navigate = useNavigate();const location = useLocation();- const [sectionOrder, setSectionOrder] = useState<SectionId[]>(loadSectionOrder);+ const {t} = useTranslation();- const sensors = useSensors(- useSensor(PointerSensor, {- activationConstraint: {- distance: 5,- },- }),- useSensor(KeyboardSensor, {- coordinateGetter: sortableKeyboardCoordinates,- }),- );+ return (+ <Box sx={{+ width: '100%',+ height: '100%',+ backgroundColor: theme.palette.mode === 'dark'+ ? theme.palette.background.paper+ : theme.palette.grey[50],+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ pt: 0.5,+ gap: 0.5,+ }}>+ {/* Hamburger to expand */}+ <Tooltip title={t('expandSidebar')} placement="right">+ <IconButton size="small" onClick={onToggleCollapse} sx={{color: theme.palette.text.primary}}>+ <MenuIcon fontSize="small"/>+ </IconButton>+ </Tooltip>- const handleDragEnd = useCallback((event: DragEndEvent) => {- const { active, over } = event;- if (!over || active.id === over.id) return;+ {/* Record button */}+ <Tooltip title={isRecording ? t('stopRecording') : t('startRecording')} placement="right">+ <span>+ <IconButton+ size="small"+ onClick={onRecordClick}+ disabled={noCameras && !isRecording}+ sx={{+ color: isRecording ? '#fb1402' : theme.palette.text.secondary,+ animation: isRecording ? 'pulse-record 2s infinite' : 'none',+ '@keyframes pulse-record': {+ '0%, 100%': {color: '#fb1402'},+ '50%': {color: '#711c1c'},+ },+ }}+ >+ {isRecording ? <StopIcon fontSize="small"/> : <FiberManualRecordIcon fontSize="small"/>}+ </IconButton>+ </span>+ </Tooltip>- setSectionOrder((prev) => {- const oldIndex = prev.indexOf(active.id as SectionId);- const newIndex = prev.indexOf(over.id as SectionId);- const newOrder = arrayMove(prev, oldIndex, newIndex);- saveSectionOrder(newOrder);- return newOrder;- });- }, []);+ {/* Cameras page */}+ <Tooltip title={t('cameras')} placement="right">+ <IconButton+ size="small"+ onClick={() => navigate('/cameras')}+ sx={{+ color: location.pathname === '/cameras'+ ? theme.palette.success.main+ : theme.palette.text.secondary,+ }}+ >+ <VideocamIcon fontSize="small"/>+ </IconButton>+ </Tooltip>- const modifiers = useMemo(- () => [restrictToVerticalAxis, restrictToParentElement],- [],+ {/* Videos page */}+ <Tooltip title={t('videos')} placement="right">+ <IconButton+ size="small"+ onClick={() => navigate('/playback')}+ sx={{+ color: location.pathname === '/playback'+ ? theme.palette.success.main+ : theme.palette.text.secondary,+ }}+ >+ <SlideshowIcon fontSize="small"/>+ </IconButton>+ </Tooltip>++ {/* Spacer */}+ <Box sx={{flex: 1}}/>++ {/* Settings page */}+ <Tooltip title={t('settings')} placement="right">+ <IconButton+ size="small"+ onClick={() => navigate('/settings')}+ sx={{+ color: location.pathname === '/settings'+ ? theme.palette.success.main+ : theme.palette.text.secondary,+ mb: 0.5,+ }}+ >+ <SettingsIcon fontSize="small"/>+ </IconButton>+ </Tooltip>+ </Box>);+};++export const LeftSidePanelContent: React.FC<LeftSidePanelContentProps> = ({+ isCollapsed,+ onToggleCollapse,+ }) => {+ const theme = useTheme();+ const navigate = useNavigate();+ const location = useLocation();+ const dispatch = useAppDispatch();+ const {t} = useTranslation();++ const recordingInfo = useAppSelector((state) => state.recording);+ const isRecording = recordingInfo.isRecording;+ const {connectedCameraIds} = useServer();+ const noCameras = connectedCameraIds.length === 0;+ const [micDeviceIndex, setMicDeviceIndex] = useState<number>(-1);++ const handleCollapsedRecordClick = async (): Promise<void> => {+ if (isRecording) {+ await dispatch(stopRecording()).unwrap();+ } else {+ // Quick-start recording with timestamp-based defaults+ const recordingName = getTimestampString();+ await dispatch(startRecording({+ recordingName,+ recordingDirectory: recordingInfo.recordingDirectory,+ micDeviceIndex,+ })).unwrap();+ }+ };+ const navButtonSx = (isActive: boolean) => ({+ padding: '4px',+ color: isActive ? theme.palette.success.main : theme.palette.text.secondary,+ '&:hover': {+ color: theme.palette.success.main,+ backgroundColor: theme.palette.action.hover,+ },+ });++ // Collapsed: show vertical icon toolbar+ if (isCollapsed) {+ return (+ <CollapsedToolbar+ onToggleCollapse={onToggleCollapse}+ isRecording={isRecording}+ noCameras={noCameras}+ onRecordClick={handleCollapsedRecordClick}+ />+ );+ }++ // Expanded: full sidebar contentreturn (- <Box- sx={{- width: '100%',- height: '100%',- backgroundColor:- theme.palette.mode === 'dark'- ? theme.palette.background.paper- : theme.palette.grey[50],- color: theme.palette.text.primary,- display: 'flex',- flexDirection: 'column',- overflowY: 'auto',- overflowX: 'hidden',- ...scrollbarStyles,- }}- >- {/* Header */}+ <Box sx={{+ width: '100%',+ height: '100%',+ backgroundColor: theme.palette.mode === 'dark'+ ? theme.palette.background.paper+ : theme.palette.grey[50],+ color: theme.palette.text.primary,+ display: 'flex',+ flexDirection: 'column',+ overflowY: 'auto',+ overflowX: 'hidden',+ ...scrollbarStyles+ }}>+ {/* Header — single row with hamburger, title, nav icons */}<List disablePadding><ListItemsx={{- borderBottom:- theme.palette.mode === 'dark'- ? '1px solid rgba(255,255,255,0.08)'- : '1px solid rgba(0,0,0,0.08)',- py: 0.75,- px: 1.5,+ borderBottom: theme.palette.mode === 'dark'+ ? '1px solid rgba(255,255,255,0.08)'+ : '1px solid rgba(0,0,0,0.08)',+ py: 0.5,+ px: 0.5,minHeight: 40,display: 'flex',justifyContent: 'space-between',alignItems: 'center',+ gap: 0.25,+ overflow: 'hidden',}}>+ {/* Hamburger to collapse */}+ <Tooltip title={t('collapseSidebar')}>+ <IconButton size="small" onClick={onToggleCollapse}+ sx={{color: theme.palette.text.primary, flexShrink: 0}}>+ <MenuOpenIcon fontSize="small"/>+ </IconButton>+ </Tooltip>++ {/* Title — truncates when narrow */}<Boxcomponent="span"sx={{- fontSize: 16,+ fontSize: 14,fontWeight: 600,color: theme.palette.text.primary,+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ whiteSpace: 'nowrap',+ minWidth: 0,+ flexShrink: 1,+ flexGrow: 1,}}>- FreeMoCap 💀📸+ FreeMoCap 💀✨</Box>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.25 }}>- <IconButton- size="small"- onClick={() => navigate('/')}- sx={{- padding: '4px',- color:- location.pathname === '/'- ? theme.palette.success.main- : theme.palette.text.secondary,- }}- >- <HomeIcon sx={{ fontSize: 18 }} />- </IconButton>- <IconButton- color="inherit"- onClick={() => navigate('/viewport3d')}- >- <DirectionsRunIcon />- </IconButton>-- <IconButton- size="small"- onClick={() => navigate('/cameras')}- sx={{- padding: '4px',- color:- location.pathname === '/cameras'- ? theme.palette.success.main- : theme.palette.text.secondary,- }}- >- <VideocamIcon sx={{ fontSize: 18 }} />- </IconButton>+ {/* Nav icons — fixed row, never wraps */}+ <Box sx={{display: 'flex', alignItems: 'center', gap: 0.25, flexShrink: 0}}>+ <Tooltip title={t('home')}>+ <IconButton+ size="small"+ onClick={() => navigate('/')}+ sx={navButtonSx(location.pathname === '/')}+ >+ <HomeIcon sx={{fontSize: 18}}/>+ </IconButton>+ </Tooltip>- <Tooltip title="Settings">+ <Tooltip title={t('settings')}><IconButtonsize="small"onClick={() => navigate('/settings')}- sx={{- padding: '4px',- color:- location.pathname === '/settings'- ? theme.palette.success.main- : theme.palette.text.secondary,- }}+ sx={navButtonSx(location.pathname === '/settings')}>- <TuneIcon sx={{ fontSize: 18 }} />+ <SettingsIcon sx={{fontSize: 18}}/></IconButton></Tooltip>- <ThemeToggle />+ <ThemeToggle/></Box></ListItem></List>-- {/* Video Panel for Videos Page */}- {location.pathname === '/videos' && (- <Box+ {/* Server Settings */}+ <ServerConnectionStatus/>+ {/* Prominent Cameras / Playback page toggle */}+ <Box sx={{+ display: 'flex',+ gap: 0.5,+ px: 0.75,+ py: 0.75,+ borderBottom: theme.palette.mode === 'dark'+ ? '1px solid rgba(255,255,255,0.08)'+ : '1px solid rgba(0,0,0,0.08)',+ }}>+ <Button+ variant={location.pathname === '/cameras' ? 'contained' : 'outlined'}+ size="small"+ startIcon={<VideocamIcon sx={{fontSize: 16}}/>}+ onClick={() => navigate('/cameras')}+ fullWidthsx={{- borderTop: '1px solid',- borderColor: theme.palette.divider,+ textTransform: 'none',+ fontWeight: 600,+ fontSize: '0.8rem',+ py: 0.75,+ ...(location.pathname === '/cameras' ? {+ backgroundColor: theme.palette.success.main,+ color: '#fff',+ '&:hover': {backgroundColor: theme.palette.success.dark},+ } : {+ borderColor: theme.palette.divider,+ color: theme.palette.text.secondary,+ '&:hover': {+ borderColor: theme.palette.success.main,+ color: theme.palette.success.main,+ backgroundColor: theme.palette.mode === 'dark'+ ? 'rgba(76,175,80,0.08)'+ : 'rgba(76,175,80,0.04)',+ },+ }),}}>- <VideoFolderPanel />- </Box>- )}-- {/* Sidebar Sections — drag-reorderable */}- <DndContext- sensors={sensors}- collisionDetection={closestCenter}- modifiers={modifiers}- onDragEnd={handleDragEnd}- >- <SortableContext- items={sectionOrder}- strategy={verticalListSortingStrategy}+ {t('cameras')}+ </Button>+ <Button+ variant={location.pathname === '/playback' ? 'contained' : 'outlined'}+ size="small"+ startIcon={<SlideshowIcon sx={{fontSize: 16}}/>}+ onClick={() => navigate('/playback')}+ fullWidth+ sx={{+ textTransform: 'none',+ fontWeight: 600,+ fontSize: '0.8rem',+ py: 0.75,+ ...(location.pathname === '/playback' ? {+ backgroundColor: theme.palette.info.main,+ color: '#fff',+ '&:hover': {backgroundColor: theme.palette.info.dark},+ } : {+ borderColor: theme.palette.divider,+ color: theme.palette.text.secondary,+ '&:hover': {+ borderColor: theme.palette.info.main,+ color: theme.palette.info.main,+ backgroundColor: theme.palette.mode === 'dark'+ ? 'rgba(41,182,246,0.08)'+ : 'rgba(41,182,246,0.04)',+ },+ }),+ }}>- <Box- sx={{- display: 'flex',- flexDirection: 'column',- gap: 0.75,- p: 0.75,- pb: 2,- }}- >- {sectionOrder.map((sectionId) => {- const Component = SECTION_COMPONENTS[sectionId];- return (- <SortableSectionWrapper key={sectionId} id={sectionId}>- <Component />- </SortableSectionWrapper>- );- })}- </Box>- </SortableContext>- </DndContext>+ {t('videoPlayback')}+ </Button>+ </Box>+++ {/* Main Content Area */}+ <Box sx={{+ display: 'flex',+ flexDirection: 'column',+ gap: 0.5,+ pt: 0.5,+ pb: 2,+ }}>+ <RecordingInfoPanel/>+ <CameraConfigTreeView/>+ </Box></Box>);};diff --git a/freemocap-ui/src/components/ui-components/ThemeToggle.tsx b/freemocap-ui/src/components/ui-components/ThemeToggle.tsxindex 9e8d4a40..e0b1f752 100644--- a/freemocap-ui/src/components/ui-components/ThemeToggle.tsx+++ b/freemocap-ui/src/components/ui-components/ThemeToggle.tsx@@ -1,22 +1,24 @@import React from 'react';-import {IconButton, Tooltip, useTheme} from '@mui/material';+import { IconButton, Tooltip, useTheme } from '@mui/material';import Brightness4Icon from '@mui/icons-material/Brightness4'; // Dark mode iconimport Brightness7Icon from '@mui/icons-material/Brightness7'; // Light mode icon-import {useAppDispatch, useAppSelector} from '@/store';-import {themeModeToggled} from '@/store/slices/theme';+import { useAppDispatch, useAppSelector } from '@/store';+import { themeModeToggled } from '@/store/slices/theme';+import { useTranslation } from 'react-i18next';export const ThemeToggle: React.FC = () => {const dispatch = useAppDispatch();const theme = useTheme();+ const { t } = useTranslation();const themeMode = useAppSelector(state => state.theme.mode);const isDarkMode = themeMode === 'dark';return (- <Tooltip title={isDarkMode ? "Switch to light mode" : "Switch to dark mode"}>+ <Tooltip title={isDarkMode ? t("switchToLight") : t("switchToDark")}><IconButtononClick={() => dispatch(themeModeToggled())}color="inherit"- aria-label="toggle theme"+ aria-label={t("toggleTheme")}edge="end"sx={{'&:hover': {diff --git a/freemocap-ui/src/components/update/Modal/index.tsx b/freemocap-ui/src/components/update/Modal/index.tsxdeleted file mode 100644index 45799665..00000000--- a/freemocap-ui/src/components/update/Modal/index.tsx+++ /dev/null@@ -1,69 +0,0 @@-import React, {ReactNode} from 'react'-import {createPortal} from 'react-dom'-import './modal.css'--const ModalTemplate: React.FC<React.PropsWithChildren<{- title?: ReactNode- footer?: ReactNode- cancelText?: string- okText?: string- onCancel?: () => void- onOk?: () => void- width?: number-}>> = props => {- const {- title,- children,- footer,- cancelText = 'Cancel',- okText = 'OK',- onCancel,- onOk,- width = 530,- } = props-- return (- <div className='update-modal'>- <div className='update-modal__mask'/>- <div className='update-modal__warp'>- <div className='update-modal__content' style={{width}}>- <div className='content__header'>- <div className='content__header-text'>{title}</div>- <span- className='update-modal--close'- onClick={onCancel}- >- <svg- viewBox="0 0 1024 1024"- version="1.1" xmlns="http://www.w3.org/2000/svg"- >- <path- d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128l-265.344 263.936-263.04-263.84C236.64 191.584 216.384 191.52 203.84 204 191.328 216.48 191.296 236.736 203.776 249.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248 6.24 6.272 14.464 9.44 22.688 9.44 8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408 8.192 0 16.352-3.136 22.592-9.344 12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z"- p-id="2764" fill="currentColor">- </path>- </svg>- </span>- </div>- <div className='content__body'>{children}</div>- {typeof footer !== 'undefined' ? (- <div className='content__footer'>- <button onClick={onCancel}>{cancelText}</button>- <button onClick={onOk}>{okText}</button>- </div>- ) : footer}- </div>- </div>- </div>- )-}--const Modal = (props: Parameters<typeof ModalTemplate>[0] & { open: boolean }) => {- const {open, ...omit} = props-- return createPortal(- open ? ModalTemplate(omit) : null,- document.body,- )-}--export default Modaldiff --git a/freemocap-ui/src/components/update/Modal/modal.css b/freemocap-ui/src/components/update/Modal/modal.cssdeleted file mode 100644index 77e2e17b..00000000--- a/freemocap-ui/src/components/update/Modal/modal.css+++ /dev/null@@ -1,87 +0,0 @@-.update-modal {- --primary-color: rgb(224, 30, 90);-- .update-modal__mask {- width: 100vw;- height: 100vh;- position: fixed;- left: 0;- top: 0;- z-index: 9;- background: rgba(0, 0, 0, 0.45);- }-- .update-modal__warp {- position: fixed;- top: 50%;- left: 50%;- transform: translate(-50%, -50%);- z-index: 19;- }-- .update-modal__content {- box-shadow: 0 0 10px -4px rgb(130, 86, 208);- overflow: hidden;- border-radius: 4px;-- .content__header {- display: flex;- line-height: 38px;- background-color: var(--primary-color);-- .content__header-text {- font-weight: bold;- width: 0;- flex-grow: 1;- }- }-- .update-modal--close {- width: 30px;- height: 30px;- margin: 4px;- line-height: 34px;- text-align: center;- cursor: pointer;-- svg {- width: 17px;- height: 17px;- }- }-- .content__body {- padding: 10px;- background-color: #fff;- color: #333;- }-- .content__footer {- padding: 10px;- background-color: #fff;- display: flex;- justify-content: flex-end;-- button {- padding: 7px 11px;- background-color: var(--primary-color);- font-size: 14px;- margin-left: 10px;-- &:first-child {- margin-left: 0;- }- }- }- }-- .icon {- padding: 0 15px;- width: 20px;- fill: currentColor;-- &:hover {- color: rgba(0, 0, 0, 0.4);- }- }-}diff --git a/freemocap-ui/src/components/update/Progress/index.tsx b/freemocap-ui/src/components/update/Progress/index.tsxdeleted file mode 100644index 8e393f40..00000000--- a/freemocap-ui/src/components/update/Progress/index.tsx+++ /dev/null@@ -1,22 +0,0 @@-import React from 'react'-import './progress.css'--const Progress: React.FC<React.PropsWithChildren<{- percent?: number-}>> = props => {- const {percent = 0} = props-- return (- <div className='update-progress'>- <div className='update-progress-pr'>- <div- className='update-progress-rate'- style={{width: `${3 * percent}px`}}- />- </div>- <span className='update-progress-num'>{(percent ?? 0).toString().substring(0, 4)}%</span>- </div>- )-}--export default Progressdiff --git a/freemocap-ui/src/components/update/Progress/progress.css b/freemocap-ui/src/components/update/Progress/progress.cssdeleted file mode 100644index 6abc00cc..00000000--- a/freemocap-ui/src/components/update/Progress/progress.css+++ /dev/null@@ -1,21 +0,0 @@-.update-progress {- display: flex;- align-items: center;-- .update-progress-pr {- border: 1px solid #000;- border-radius: 3px;- height: 6px;- width: 300px;- }-- .update-progress-rate {- height: 6px;- border-radius: 3px;- background-image: linear-gradient(to right, rgb(130, 86, 208) 0%, var(--primary-color) 100%)- }-- .update-progress-num {- margin: 0 10px;- }-}diff --git a/freemocap-ui/src/components/update/README.md b/freemocap-ui/src/components/update/README.mddeleted file mode 100644index ca7f9eb0..00000000--- a/freemocap-ui/src/components/update/README.md+++ /dev/null@@ -1,56 +0,0 @@-# electron-updater--English | [简体中文](README.zh-CN.md)--> Use `electron-updater` to realize the update detection, download and installation of the electric program.--```sh-npm i electron-updater-```--### Main logic--1. ##### Configuration of the update the service address and update information script:-- Add a `publish` field to `electron-builder.json5` for configuring the update address and which strategy to use as the- update service.-- ``` json5- {- "publish": {- "provider": "generic",- "channel": "latest",- "url": "https://foo.com/"- }- }- ```-- For more information, please refer- to : [electron-builder.json5...](https://github.com/electron-vite/electron-vite-react/blob/2f2880a9f19de50ff14a0785b32a4d5427477e55/electron-builder.json5#L38)--2. ##### The update logic of Electron:-- - Checking if an update is available;- - Checking the version of the software on the server;- - Checking if an update is available;- - Downloading the new version of the software from the server (when an update is available);- - Installation method;-- For more information, please refer- to : [update...](https://github.com/electron-vite/electron-vite-react/blob/main/electron/main/update.ts)--3. ##### Updating UI pages in Electron:-- The main function is to provide a UI page for users to trigger the update logic mentioned in (2.) above. Users can- click on the page to trigger different update functions in Electron.-- For more information, please refer- to : [components/update...](https://github.com/electron-vite/electron-vite-react/blob/main/src/components/update/index.tsx)-------Here it is recommended to trigger updates through user actions (in this project, Electron update function is triggered-after the user clicks on the "Check for updates" button).--For more information on using `electron-updater` for Electron updates, please refer to the-documentation : [auto-update](https://www.electron.build/.html)diff --git a/freemocap-ui/src/components/update/README.zh-CN.md b/freemocap-ui/src/components/update/README.zh-CN.mddeleted file mode 100644index 8270f747..00000000--- a/freemocap-ui/src/components/update/README.zh-CN.md+++ /dev/null@@ -1,51 +0,0 @@-# electron-auto-update--[English](README.md) | 简体中文--使用`electron-updater`实现electron程序的更新检测、下载和安装等功能。--```sh-npm i electron-updater-```--### 主要逻辑--1. ##### 更新地址、更新信息脚本的配置-- 在`electron-builder.json5`添加`publish`字段,用来配置更新地址和使用哪种策略作为更新服务-- ``` json5- {- "publish": {- "provider": "generic", // 提供者、提供商- "channel": "latest", // 生成yml文件的名称- "url": "https://foo.com/" //更新地址- }- }- ```--更多见 : [electron-builder.json5...](xxx)--2. ##### Electron更新逻辑-- - 检测更新是否可用;-- - 检测服务端的软件版本;-- - 检测更新是否可用;-- - 下载服务端新版软件(当更新可用);- - 安装方式;--更多见 : [update...](https://github.com/electron-vite/electron-vite-react/blob/main/electron/main/update.ts)--3. ##### Electron更新UI页面-- 主要功能是:用户触发上述(2.)更新逻辑的UI页面。用户可以通过点击页面触发electron更新的不同功能。- 更多见 : [components/update.ts...](https://github.com/electron-vite/electron-vite-react/tree/main/src/components/update/index.tsx)-------这里建议更新触发以用户操作触发(本项目的以用户点击 **更新检测** 后触发electron更新功能)--关于更多使用`electron-updater`进行electron更新,见文档:[auto-update](https://www.electron.build/.html)diff --git a/freemocap-ui/src/components/update/index.tsx b/freemocap-ui/src/components/update/index.tsxdeleted file mode 100644index fef88a9f..00000000--- a/freemocap-ui/src/components/update/index.tsx+++ /dev/null@@ -1,133 +0,0 @@-import type {ProgressInfo} from 'electron-updater'-import {useCallback, useEffect, useState} from 'react'-import Modal from '@/components/update/Modal'-import Progress from '@/components/update/Progress'-import './update.css'--const Update = () => {- const [checking, setChecking] = useState(false)- const [updateAvailable, setUpdateAvailable] = useState(false)- const [versionInfo, setVersionInfo] = useState<VersionInfo>()- const [updateError, setUpdateError] = useState<ErrorType>()- const [progressInfo, setProgressInfo] = useState<Partial<ProgressInfo>>()- const [modalOpen, setModalOpen] = useState<boolean>(false)- const [modalBtn, setModalBtn] = useState<{- cancelText?: string- okText?: string- onCancel?: () => void- onOk?: () => void- }>({- onCancel: () => setModalOpen(false),- onOk: () => window.ipcRenderer.invoke('start-download'),- })-- const checkUpdate = async () => {- setChecking(true)- /**- * @type {import('electron-updater').UpdateCheckResult | null | { message: string, error: Error }}- */- const result = await window.ipcRenderer.invoke('check-update')- setProgressInfo({percent: 0})- setChecking(false)- setModalOpen(true)- if (result?.error) {- setUpdateAvailable(false)- setUpdateError(result?.error)- }- }-- const onUpdateCanAvailable = useCallback((_event: Electron.IpcRendererEvent, arg1: VersionInfo) => {- setVersionInfo(arg1)- setUpdateError(undefined)- // Can be update- if (arg1.update) {- setModalBtn(state => ({- ...state,- cancelText: 'Cancel',- okText: 'Update',- onOk: () => window.ipcRenderer.invoke('start-download'),- }))- setUpdateAvailable(true)- } else {- setUpdateAvailable(false)- }- }, [])-- const onUpdateError = useCallback((_event: Electron.IpcRendererEvent, arg1: ErrorType) => {- setUpdateAvailable(false)- setUpdateError(arg1)- }, [])-- const onDownloadProgress = useCallback((_event: Electron.IpcRendererEvent, arg1: ProgressInfo) => {- setProgressInfo(arg1)- }, [])-- const onUpdateDownloaded = useCallback((_event: Electron.IpcRendererEvent, ...args: any[]) => {- setProgressInfo({percent: 100})- setModalBtn(state => ({- ...state,- cancelText: 'Later',- okText: 'Install now',- onOk: () => window.ipcRenderer.invoke('quit-and-install'),- }))- }, [])-- useEffect(() => {- // Get version information and whether to update- window.ipcRenderer.on('update-can-available', onUpdateCanAvailable)- window.ipcRenderer.on('update-error', onUpdateError)- window.ipcRenderer.on('download-progress', onDownloadProgress)- window.ipcRenderer.on('update-downloaded', onUpdateDownloaded)-- return () => {- window.ipcRenderer.off('update-can-available', onUpdateCanAvailable)- window.ipcRenderer.off('update-error', onUpdateError)- window.ipcRenderer.off('download-progress', onDownloadProgress)- window.ipcRenderer.off('update-downloaded', onUpdateDownloaded)- }- }, [])-- return (- <>- <Modal- open={modalOpen}- cancelText={modalBtn?.cancelText}- okText={modalBtn?.okText}- onCancel={modalBtn?.onCancel}- onOk={modalBtn?.onOk}- footer={updateAvailable ? /* hide footer */null : undefined}- >- <div className='modal-slot'>- {updateError- ? (- <div>- <p>Error downloading the latest version.</p>- <p>{updateError.message}</p>- </div>- ) : updateAvailable- ? (- <div>- <div>The last version is: v{versionInfo?.newVersion}</div>- <div- className='new-version__target'>v{versionInfo?.version} -> v{versionInfo?.newVersion}</div>- <div className='update__progress'>- <div className='progress__title'>Update progress:</div>- <div className='progress__bar'>- <Progress percent={progressInfo?.percent}></Progress>- </div>- </div>- </div>- )- : (- <div className='can-not-available'>{JSON.stringify(versionInfo ?? {}, null, 2)}</div>- )}- </div>- </Modal>- <button disabled={checking} onClick={checkUpdate}>- {checking ? 'Checking...' : 'Check update'}- </button>- </>- )-}--export default Updatediff --git a/freemocap-ui/src/components/update/update.css b/freemocap-ui/src/components/update/update.cssdeleted file mode 100644index 44bbb48b..00000000--- a/freemocap-ui/src/components/update/update.css+++ /dev/null@@ -1,24 +0,0 @@-.modal-slot {- .update-progress {- display: flex;- }-- .new-version__target,- .update__progress {- margin-left: 40px;- }-- .progress__title {- margin-right: 10px;- }-- .progress__bar {- width: 0;- flex-grow: 1;- }-- .can-not-available {- padding: 20px;- text-align: center;- }-}diff --git a/freemocap-ui/src/components/video-folder-panel/VideoFolderPanel.tsx b/freemocap-ui/src/components/video-folder-panel/VideoFolderPanel.tsxindex 3fb9f3da..7159f008 100644--- a/freemocap-ui/src/components/video-folder-panel/VideoFolderPanel.tsx+++ b/freemocap-ui/src/components/video-folder-panel/VideoFolderPanel.tsx@@ -28,11 +28,14 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';import FolderOpenIcon from '@mui/icons-material/FolderOpen';import PlayArrowIcon from '@mui/icons-material/PlayArrow';import VideoFileIcon from '@mui/icons-material/VideoFile';+import {useAppDispatch, useAppSelector} from "@/store";// Updated imports - using the videos thunks and selectors from the store barrel export-import {loadVideos, openVideoFile, selectVideoLoadFolder, useAppDispatch, useAppSelector} from "@/store";+import {loadVideos, openVideoFile, selectVideoLoadFolder} from "@/store";+import { useTranslation } from 'react-i18next';export const VideoFolderPanel: React.FC = () => {const theme = useTheme();+ const { t } = useTranslation();const dispatch = useAppDispatch();// Updated selectors to match the store structure@@ -87,7 +90,7 @@ export const VideoFolderPanel: React.FC = () => {<Box sx={{display: 'flex',alignItems: 'center',- backgroundColor: theme.palette.primary.main,+ backgroundColor: theme.palette.primary.dark,borderTopLeftRadius: 8,borderTopRightRadius: 8,}}>@@ -150,7 +153,7 @@ export const VideoFolderPanel: React.FC = () => {<Box sx={{display: 'flex', alignItems: 'center', gap: 1}}><TextFieldfullWidth- label="Video Folder Path"+ label={t("videoFolderPath")}variant="outlined"value={videoFolder}InputProps={{@@ -190,7 +193,7 @@ export const VideoFolderPanel: React.FC = () => {<Box sx={{display: 'flex', alignItems: 'center', gap: 1}}><TextFieldsize="small"- placeholder="Filter videos..."+ placeholder={t("filterVideos")}value={filterText}onChange={(e) => setFilterText(e.target.value)}sx={{width: '200px'}}@@ -204,7 +207,7 @@ export const VideoFolderPanel: React.FC = () => {disabled={filteredVideos.length === 0}/>}- label="Select All"+ label={t("selectAll")}/></Box></Box>@@ -223,7 +226,7 @@ export const VideoFolderPanel: React.FC = () => {key={file.path}disablePaddingsecondaryAction={- <Tooltip title="Open video">+ <Tooltip title={t("openVideo")}><IconButtonedge="end"size="small"@@ -280,15 +283,15 @@ export const VideoFolderPanel: React.FC = () => {<Stack spacing={1} sx={{mt: 1}}><FormControlLabelcontrol={<Checkbox defaultChecked/>}- label="Automatically synchronize videos"+ label={t("automaticallySynchronizeVideos")}/><FormControlLabelcontrol={<Checkbox/>}- label="Extract frames on load"+ label={t("extractFramesOnLoad")}/><FormControlLabelcontrol={<Checkbox/>}- label="Generate thumbnails"+ label={t("generateThumbnails")}/></Stack></Paper>diff --git a/freemocap-ui/src/components/viewport3d/ImageMesh.tsx b/freemocap-ui/src/components/viewport3d/ImageMesh.tsxdeleted file mode 100644index 3442bd69..00000000--- a/freemocap-ui/src/components/viewport3d/ImageMesh.tsx+++ /dev/null@@ -1,77 +0,0 @@-import { useEffect, useMemo, useRef } from 'react';-import { useFrame } from '@react-three/fiber';-import * as THREE from 'three';-import { useServer } from '@/services';--interface ImageMeshProps {- cameraId: string;- position: [number, number, number];-}--export function ImageMesh({ cameraId, position }: ImageMeshProps) {- const { subscribeToFrames } = useServer();-- const currentBitmapRef = useRef<ImageBitmap | null>(null);- const textureRef = useRef<THREE.Texture | null>(null);- const hasNewFrameRef = useRef<boolean>(false);-- // Base texture — updated each frame with the latest ImageBitmap- const texture = useMemo(() => {- const tex = new THREE.Texture();- tex.minFilter = THREE.LinearFilter;- tex.magFilter = THREE.LinearFilter;- tex.format = THREE.RGBAFormat;- tex.generateMipmaps = false;- textureRef.current = tex;- return tex;- }, []);-- const material = useMemo(() => {- return new THREE.MeshBasicMaterial({- map: texture,- side: THREE.DoubleSide,- });- }, [texture]);-- // Stream camera frames as ImageBitmaps- useEffect(() => {- const unsubscribe = subscribeToFrames(cameraId, (bitmap) => {- if (currentBitmapRef.current) {- currentBitmapRef.current.close();- }- currentBitmapRef.current = bitmap;- hasNewFrameRef.current = true;- });-- return () => {- unsubscribe();- if (currentBitmapRef.current) {- currentBitmapRef.current.close();- currentBitmapRef.current = null;- }- };- }, [cameraId, subscribeToFrames]);-- // Push the latest bitmap to the GPU texture each frame- useFrame(() => {- if (hasNewFrameRef.current && currentBitmapRef.current && textureRef.current) {- textureRef.current.image = currentBitmapRef.current;- textureRef.current.needsUpdate = true;- hasNewFrameRef.current = false;- }- });-- const meshGeometry = useMemo(() => {- const height = 2.0;- const width = height * (16 / 9);- return new THREE.PlaneGeometry(width, height);- }, []);-- return (- <mesh- position={position}- geometry={meshGeometry}- material={material}- />- );-}diff --git a/freemocap-ui/src/components/viewport3d/RigidBodyRenderer.tsx b/freemocap-ui/src/components/viewport3d/RigidBodyRenderer.tsxdeleted file mode 100644index 4623d64f..00000000--- a/freemocap-ui/src/components/viewport3d/RigidBodyRenderer.tsx+++ /dev/null@@ -1,171 +0,0 @@-import { useEffect, useMemo, useRef } from "react";-import {- InstancedMesh,- MeshStandardMaterial,- CylinderGeometry,- Object3D,- Vector3,-} from "three";-import { useFrame } from "@react-three/fiber";-import { useServer } from "@/services";-import { RigidBodyPose } from "@/components/viewport3d/viewport3d-types";-import { Z_OFFSET } from "@/components/viewport3d/skeleton-config";-import { SKELETON_COLORS } from "@/components/viewport3d/skeleton-colors";--/** Maximum bone segments the instanced mesh can hold. */-const MAX_RIGID_BODIES = 64;--/** Cylinder cross-section radius in meters. */-const BODY_RADIUS = 0.025;-const HAND_RADIUS = 0.008;--const DUMMY = new Object3D();-const FAR_AWAY = new Vector3(10000, 10000, 10000);--function getRigidBodyColor(boneKey: string): Color {- if (boneKey.includes("left_hand")) return SKELETON_COLORS.leftHand;- if (boneKey.includes("right_hand")) return SKELETON_COLORS.rightHand;- if (boneKey.includes("left")) return SKELETON_COLORS.left;- if (boneKey.includes("right")) return SKELETON_COLORS.right;- return SKELETON_COLORS.center;-}--function getRigidBodyRadius(boneKey: string): number {- if (boneKey.includes("hand")) return HAND_RADIUS;- return BODY_RADIUS;-}--/**- * Renders rigid body bone segments as instanced cylinders.- *- * Subscribes directly to the server's rigid-body stream and updates- * only dirty instances each frame to minimize GPU uploads. Follows the- * same mutable-ref + useFrame pattern as SkeletonRenderer.- */-export function RigidBodyRenderer() {- const { subscribeToRigidBodies } = useServer();- const instancedMeshRef = useRef<InstancedMesh>(null);-- // Mutable refs for frame-loop access without React re-renders- const rigidBodiesRef = useRef<Map<string, RigidBodyPose>>(new Map());- const boneKeyToIndexRef = useRef<Map<string, number>>(new Map());- const indexToBoneKeyRef = useRef<Map<number, string>>(new Map());- const nextIndexRef = useRef<number>(0);- const dirtyRef = useRef<boolean>(false);-- // Unit cylinder centered at origin along +Y, then:- // - rotated so axis is +Z- // - translated so bottom face is at origin (extends 0 → +1 along Z)- // This way scale.z = bone length places the cylinder from parent → child.- const cylinderGeometry = useMemo(() => {- const geo = new CylinderGeometry(1, 1, 1, 8, 1);- geo.rotateX(Math.PI / 2); // +Y axis → +Z axis- geo.translate(0, 0, 0.5); // origin at bottom face (parent joint)- return geo;- }, []);-- // Semi-transparent material — per-instance color tints it- const cylinderMaterial = useMemo(() => new MeshStandardMaterial({- color: '#ffffff',- roughness: 0.45,- metalness: 0.3,- transparent: true,- opacity: 0.6,- }), []);-- // Assign stable instance index for a bone key- const assignIndex = (boneKey: string): number => {- if (nextIndexRef.current >= MAX_RIGID_BODIES) {- throw new Error(`Maximum rigid bodies (${MAX_RIGID_BODIES}) exceeded for bone "${boneKey}"`);- }- const index = nextIndexRef.current++;- boneKeyToIndexRef.current.set(boneKey, index);- indexToBoneKeyRef.current.set(index, boneKey);- return index;- };-- // Subscribe to rigid body stream- useEffect(() => {- const unsubscribe = subscribeToRigidBodies((newPoses: Map<string, RigidBodyPose>) => {- rigidBodiesRef.current = newPoses;- dirtyRef.current = true;-- // Assign indices for any new bones- for (const boneKey of newPoses.keys()) {- if (!boneKeyToIndexRef.current.has(boneKey)) {- assignIndex(boneKey);- }- }- });-- return unsubscribe;- }, [subscribeToRigidBodies]);-- // Initialize all instances as hidden- useEffect(() => {- if (!instancedMeshRef.current) return;- const mesh = instancedMeshRef.current;-- for (let i = 0; i < MAX_RIGID_BODIES; i++) {- DUMMY.position.copy(FAR_AWAY);- DUMMY.scale.set(0, 0, 0);- DUMMY.updateMatrix();- mesh.setMatrixAt(i, DUMMY.matrix);- mesh.setColorAt(i, SKELETON_COLORS.hidden);- }- mesh.instanceMatrix.needsUpdate = true;- if (mesh.instanceColor) mesh.instanceColor.needsUpdate = true;- mesh.count = MAX_RIGID_BODIES;- }, []);-- // Per-frame update: apply transforms for all assigned bones- useFrame(() => {- if (!instancedMeshRef.current || !dirtyRef.current) return;- const mesh = instancedMeshRef.current;- const poses = rigidBodiesRef.current;-- for (let i = 0; i < nextIndexRef.current; i++) {- const boneKey = indexToBoneKeyRef.current.get(i);- if (!boneKey) continue;-- const pose = poses.get(boneKey);- if (pose) {- const [px, py, pz] = pose.position;- const [qw, qx, qy, qz] = pose.orientation;- const radius = getRigidBodyRadius(boneKey);-- DUMMY.position.set(px, py, pz + Z_OFFSET);-- // Bone quaternion (local +Z = bone direction).- // Three.js Quaternion constructor: (x, y, z, w).- // The geometry is already pre-rotated so its axis is +Z,- // so we apply the bone quaternion directly.- DUMMY.quaternion.set(qx, qy, qz, qw);-- // Scale: x/y = radius, z = bone length- DUMMY.scale.set(radius, radius, pose.length);-- mesh.setColorAt(i, getRigidBodyColor(boneKey));- } else {- DUMMY.position.copy(FAR_AWAY);- DUMMY.scale.set(0, 0, 0);- mesh.setColorAt(i, SKELETON_COLORS.hidden);- }-- DUMMY.updateMatrix();- mesh.setMatrixAt(i, DUMMY.matrix);- }-- mesh.instanceMatrix.needsUpdate = true;- if (mesh.instanceColor) mesh.instanceColor.needsUpdate = true;- dirtyRef.current = false;- });-- return (- <instancedMesh- ref={instancedMeshRef}- args={[cylinderGeometry, cylinderMaterial, MAX_RIGID_BODIES]}- frustumCulled={false}- />- );-}diff --git a/freemocap-ui/src/components/viewport3d/SceneEnvironment.tsx b/freemocap-ui/src/components/viewport3d/SceneEnvironment.tsxdeleted file mode 100644index 7a234179..00000000--- a/freemocap-ui/src/components/viewport3d/SceneEnvironment.tsx+++ /dev/null@@ -1,36 +0,0 @@-import { Grid } from "@react-three/drei";--/** Static scene environment: lighting, ground grid, and axes indicator. */-export function SceneEnvironment() {- return (- <>- <ambientLight intensity={0.6} />- <directionalLight- castShadow- position={[5, 5, 5]}- intensity={0.5}- shadow-mapSize={1024}- />- {/* Fill light from below to prevent pure-black undersides */}- <directionalLight- position={[-3, -2, -3]}- intensity={0.15}- />-- <Grid- renderOrder={-1}- position={[0, -0.01, 0]}- infiniteGrid- cellSize={1}- cellThickness={0.5}- sectionSize={3}- sectionThickness={1}- //@ts-ignore — drei Grid typing doesn't expose sectionColor as tuple- sectionColor={[0.25, 0, 0.25]}- fadeDistance={100}- />-- <axesHelper />- </>- );-}diff --git a/freemocap-ui/src/components/viewport3d/SkeletonRenderer.tsx b/freemocap-ui/src/components/viewport3d/SkeletonRenderer.tsxdeleted file mode 100644index f5b0f899..00000000--- a/freemocap-ui/src/components/viewport3d/SkeletonRenderer.tsx+++ /dev/null@@ -1,250 +0,0 @@-import { useEffect, useMemo, useRef } from "react";-import {- InstancedMesh,- MeshStandardMaterial,- SphereGeometry,- Object3D,- Vector3,- BufferGeometry,- BufferAttribute,- LineBasicMaterial,- LineSegments,-} from "three";-import { useFrame } from "@react-three/fiber";-import { useServer } from "@/services";-import { Point3d, PointStyle } from "@/components/viewport3d/viewport3d-types";-import {- MAX_POINTS,- MAX_SEGMENTS,- Z_OFFSET,- SEGMENT_DEFINITIONS,- SEGMENT_COLORS,- getPointStyle,-} from "@/components/viewport3d/skeleton-config";-import { resolvePoint } from "@/components/viewport3d/virtual-points";-import {SKELETON_COLORS} from "@/components/viewport3d/skeleton-colors";--const DUMMY = new Object3D();-const FAR_AWAY = new Vector3(10000, 10000, 10000);--/**- * Renders the 3D skeleton using an InstancedMesh for landmark points- * and LineSegments for bone connections. Subscribes directly to the- * server's tracked-points stream and updates only dirty instances- * each frame to minimize GPU uploads.- */-export function SkeletonRenderer() {- const { subscribeToTrackedPoints } = useServer();- const instancedMeshRef = useRef<InstancedMesh>(null);- const lineSegmentsRef = useRef<LineSegments>(null);-- // Mutable refs for frame-loop access without triggering React re-renders- const trackedPointsRef = useRef<Map<string, Point3d>>(new Map());- const pointNameToIndexRef = useRef<Map<string, number>>(new Map());- const indexToPointNameRef = useRef<Map<number, string>>(new Map());- const cachedStylesRef = useRef<Map<string, PointStyle>>(new Map());- const nextAvailableIndexRef = useRef<number>(0);- const dirtyIndicesRef = useRef<Set<number>>(new Set());- const needsLineUpdateRef = useRef<boolean>(false);-- // Shared geometry: unit sphere scaled per-instance- const sphereGeometry = useMemo(() => new SphereGeometry(1, 10, 8), []);-- // White base material — per-instance color tints it- const sphereMaterial = useMemo(() => new MeshStandardMaterial({- color: '#ffffff',- roughness: 0.35,- metalness: 0.5,- }), []);-- // Vertex-colored line material for skeleton segments- const lineMaterial = useMemo(() => new LineBasicMaterial({- vertexColors: true,- transparent: true,- opacity: 0.85,- }), []);-- // Pre-allocated line geometry with position + color buffers- const lineGeometry = useMemo(() => {- const geometry = new BufferGeometry();- const numVerts = MAX_SEGMENTS * 2;- const positions = new Float32Array(numVerts * 3);- const colors = new Float32Array(numVerts * 3);-- for (let i = 0; i < MAX_SEGMENTS; i++) {- const segColor = SEGMENT_COLORS[i];- for (let v = 0; v < 2; v++) {- const vi = (i * 2 + v) * 3;- positions[vi] = 10000;- positions[vi + 1] = 10000;- positions[vi + 2] = 10000;- colors[vi] = segColor.r;- colors[vi + 1] = segColor.g;- colors[vi + 2] = segColor.b;- }- }-- geometry.setAttribute('position', new BufferAttribute(positions, 3));- geometry.setAttribute('color', new BufferAttribute(colors, 3));- return geometry;- }, []);-- // Assign a stable instance index and cache the point style for a new point name- const assignIndex = (pointName: string): number => {- if (nextAvailableIndexRef.current >= MAX_POINTS) {- throw new Error(`Maximum tracked points (${MAX_POINTS}) exceeded for point "${pointName}"`);- }- const index = nextAvailableIndexRef.current++;- pointNameToIndexRef.current.set(pointName, index);- indexToPointNameRef.current.set(index, pointName);- cachedStylesRef.current.set(pointName, getPointStyle(pointName));- return index;- };-- // Subscribe to tracked-points stream, mark dirty indices for changed/new/removed points- useEffect(() => {- const unsubscribe = subscribeToTrackedPoints((newPoints: Map<string, Point3d>) => {- const prevPoints = trackedPointsRef.current;- trackedPointsRef.current = newPoints;- needsLineUpdateRef.current = true;-- for (const [pointName, point] of newPoints) {- if (!pointNameToIndexRef.current.has(pointName)) {- const newIndex = assignIndex(pointName);- dirtyIndicesRef.current.add(newIndex);- } else {- const prevPoint = prevPoints.get(pointName);- if (!prevPoint ||- prevPoint.x !== point.x ||- prevPoint.y !== point.y ||- prevPoint.z !== point.z) {- dirtyIndicesRef.current.add(pointNameToIndexRef.current.get(pointName)!);- }- }- }-- // Mark removed points as dirty so they get hidden- for (const [pointName] of prevPoints) {- if (!newPoints.has(pointName)) {- const index = pointNameToIndexRef.current.get(pointName);- if (index !== undefined) {- dirtyIndicesRef.current.add(index);- }- }- }- });-- return unsubscribe;- }, [subscribeToTrackedPoints]);-- // Initialize all instances as hidden on mount- useEffect(() => {- if (!instancedMeshRef.current) return;- const mesh = instancedMeshRef.current;-- for (let i = 0; i < MAX_POINTS; i++) {- DUMMY.position.copy(FAR_AWAY);- DUMMY.scale.set(0, 0, 0);- DUMMY.updateMatrix();- mesh.setMatrixAt(i, DUMMY.matrix);- mesh.setColorAt(i, SKELETON_COLORS.hidden);- }- mesh.instanceMatrix.needsUpdate = true;- if (mesh.instanceColor) mesh.instanceColor.needsUpdate = true;- mesh.count = MAX_POINTS;- }, []);-- // Per-frame update: apply dirty point transforms and refresh line segment positions- useFrame(() => {- // Update dirty point instances- if (instancedMeshRef.current && dirtyIndicesRef.current.size > 0) {- const mesh = instancedMeshRef.current;- const points = trackedPointsRef.current;-- for (const index of dirtyIndicesRef.current) {- const pointName = indexToPointNameRef.current.get(index);-- if (pointName && points.has(pointName)) {- const point = points.get(pointName)!;- const style = cachedStylesRef.current.get(pointName)!;-- DUMMY.position.set(point.x, point.y, point.z + Z_OFFSET);- DUMMY.scale.set(style.scale, style.scale, style.scale);- mesh.setColorAt(index, style.color);- } else {- DUMMY.position.copy(FAR_AWAY);- DUMMY.scale.set(0, 0, 0);- mesh.setColorAt(index, SKELETON_COLORS.hidden);- }-- DUMMY.updateMatrix();- mesh.setMatrixAt(index, DUMMY.matrix);- }-- mesh.instanceMatrix.needsUpdate = true;- if (mesh.instanceColor) mesh.instanceColor.needsUpdate = true;- dirtyIndicesRef.current.clear();- }-- // Update line segment vertex positions- if (lineSegmentsRef.current && needsLineUpdateRef.current) {- const points = trackedPointsRef.current;- const positions = lineGeometry.attributes.position.array as Float32Array;- const colors = lineGeometry.attributes.color.array as Float32Array;- let segmentIndex = 0;-- for (const segment of Object.values(SEGMENT_DEFINITIONS)) {- const proximal = resolvePoint(points, segment.proximal);- const distal = resolvePoint(points, segment.distal);- const segColor = SEGMENT_COLORS[segmentIndex];- const baseIdx = segmentIndex * 6;-- if (proximal && distal) {- positions[baseIdx] = proximal.x;- positions[baseIdx + 1] = proximal.y;- positions[baseIdx + 2] = proximal.z + Z_OFFSET;-- positions[baseIdx + 3] = distal.x;- positions[baseIdx + 4] = distal.y;- positions[baseIdx + 5] = distal.z + Z_OFFSET;-- colors[baseIdx] = segColor.r;- colors[baseIdx + 1] = segColor.g;- colors[baseIdx + 2] = segColor.b;- colors[baseIdx + 3] = segColor.r;- colors[baseIdx + 4] = segColor.g;- colors[baseIdx + 5] = segColor.b;- } else {- for (let i = 0; i < 6; i++) {- positions[baseIdx + i] = 10000;- }- }-- segmentIndex++;- }-- lineGeometry.attributes.position.needsUpdate = true;- lineGeometry.attributes.color.needsUpdate = true;- needsLineUpdateRef.current = false;- }- });-- return (- <>- {/* Per-instance colored landmark points */}- <instancedMesh- ref={instancedMeshRef}- args={[sphereGeometry, sphereMaterial, MAX_POINTS]}- frustumCulled={false}- />-- {/* Vertex-colored skeleton segments */}- <lineSegments- ref={lineSegmentsRef}- geometry={lineGeometry}- material={lineMaterial}- frustumCulled={false}- />- </>- );-}diff --git a/freemocap-ui/src/components/viewport3d/ThreeJsCanvas.tsx b/freemocap-ui/src/components/viewport3d/ThreeJsCanvas.tsxdeleted file mode 100644index 90f5ebae..00000000--- a/freemocap-ui/src/components/viewport3d/ThreeJsCanvas.tsx+++ /dev/null@@ -1,71 +0,0 @@-import { useCallback, useEffect, useRef } from "react";-import { Canvas } from "@react-three/fiber";-import { Box, IconButton, Tooltip } from "@mui/material";-import CenterFocusStrongIcon from "@mui/icons-material/CenterFocusStrong";-import type CameraControlsImpl from "camera-controls";-import { ThreeJsScene } from "@/components/viewport3d/ThreeJsScene";-import { fitCameraToSkeleton } from "@/components/viewport3d/fit-camera";-import { useServer } from "@/services";--export function ThreeJsCanvas() {- const cameraControlsRef = useRef<CameraControlsImpl>(null!);- const containerRef = useRef<HTMLDivElement>(null);- const { getLatestTrackedPoints } = useServer();-- const handleFitToSkeleton = useCallback(() => {- fitCameraToSkeleton(cameraControlsRef.current, getLatestTrackedPoints());- }, [getLatestTrackedPoints]);-- // Press "F" while the viewport container is focused to fit camera to skeleton- useEffect(() => {- const container = containerRef.current;- if (!container) return;-- const handleKeyDown = (e: KeyboardEvent) => {- if (e.key === "f" || e.key === "F") {- e.preventDefault();- handleFitToSkeleton();- }- };-- container.addEventListener("keydown", handleKeyDown);- return () => container.removeEventListener("keydown", handleKeyDown);- }, [handleFitToSkeleton]);-- return (- <Box- ref={containerRef}- tabIndex={0}- sx={{- width: '100%',- height: '100%',- position: 'relative',- outline: 'none',- }}- >- <Canvas- shadows- camera={{ position: [5, 5, 5], fov: 75 }}- >- <ThreeJsScene cameraControlsRef={cameraControlsRef} />- </Canvas>-- <Tooltip title="Fit camera to skeleton (F)" placement="left">- <IconButton- onClick={handleFitToSkeleton}- size="small"- sx={{- position: 'absolute',- bottom: 16,- right: 16,- bgcolor: 'background.paper',- boxShadow: 2,- '&:hover': { bgcolor: 'action.hover' },- }}- >- <CenterFocusStrongIcon fontSize="small" />- </IconButton>- </Tooltip>- </Box>- );-}\ No newline at end of filediff --git a/freemocap-ui/src/components/viewport3d/ThreeJsScene.tsx b/freemocap-ui/src/components/viewport3d/ThreeJsScene.tsxdeleted file mode 100644index 3f9f79d6..00000000--- a/freemocap-ui/src/components/viewport3d/ThreeJsScene.tsx+++ /dev/null@@ -1,22 +0,0 @@-import { RefObject } from "react";-import { CameraControls } from "@react-three/drei";-import type CameraControlsImpl from "camera-controls";-import { SceneEnvironment } from "@/components/viewport3d/SceneEnvironment";-import { SkeletonRenderer } from "@/components/viewport3d/SkeletonRenderer";-import { RigidBodyRenderer } from "@/components/viewport3d/RigidBodyRenderer";--interface ThreeJsSceneProps {- cameraControlsRef: RefObject<CameraControlsImpl>;-}--/** Top-level scene graph: camera controls, environment, and skeleton visualization. */-export function ThreeJsScene({ cameraControlsRef }: ThreeJsSceneProps) {- return (- <>- <CameraControls ref={cameraControlsRef} makeDefault />- <SceneEnvironment />- <SkeletonRenderer />- <RigidBodyRenderer />- </>- );-}diff --git a/freemocap-ui/src/components/viewport3d/VMCPanel.tsx b/freemocap-ui/src/components/viewport3d/VMCPanel.tsxdeleted file mode 100644index 7c1c07fb..00000000--- a/freemocap-ui/src/components/viewport3d/VMCPanel.tsx+++ /dev/null@@ -1,129 +0,0 @@-import React, { useCallback } from "react";-import {- Box,- IconButton,- Stack,- Switch,- TextField,- Tooltip,- Typography,- useTheme,-} from "@mui/material";-import CastConnectedIcon from "@mui/icons-material/CastConnected";-import { useAppSelector } from "@/store/hooks";-import { selectServerSettings } from "@/store/slices/settings/settings-selectors";-import { useServer } from "@/services";--/**- * Compact VMC output controls. Shows a toggle to enable/disable VMC- * broadcasting and a port field. Patches are sent directly via the- * WebSocket settings/patch protocol.- */-export const VMCPanel: React.FC = () => {- const theme = useTheme();- const { send, isConnected } = useServer();- const settings = useAppSelector(selectServerSettings);-- const vmcEnabled = settings?.vmc?.enabled ?? false;- const vmcHost = settings?.vmc?.host ?? "127.0.0.1";- const vmcPort = settings?.vmc?.port ?? 39539;-- const patchVMC = useCallback(- (patch: Record<string, unknown>) => {- send({ message_type: "settings/patch", patch: { vmc: patch } });- },- [send],- );-- const handleToggle = useCallback(() => {- patchVMC({ enabled: !vmcEnabled });- }, [patchVMC, vmcEnabled]);-- const handlePortChange = useCallback(- (e: React.ChangeEvent<HTMLInputElement>) => {- const val = parseInt(e.target.value, 10);- if (!isNaN(val) && val > 0 && val <= 65535) {- patchVMC({ port: val });- }- },- [patchVMC],- );-- const handleHostChange = useCallback(- (e: React.ChangeEvent<HTMLInputElement>) => {- const val = e.target.value.trim();- if (val.length > 0) {- patchVMC({ host: val });- }- },- [patchVMC],- );-- return (- <Box- sx={{- position: "absolute",- bottom: 16,- right: 16,- zIndex: 10,- backgroundColor: theme.palette.background.paper,- borderRadius: 2,- px: 2,- py: 1.5,- boxShadow: 3,- minWidth: 220,- opacity: 0.92,- }}- >- <Stack spacing={1}>- <Stack direction="row" alignItems="center" spacing={1}>- <CastConnectedIcon- fontSize="small"- sx={{ color: vmcEnabled ? theme.palette.success.main : theme.palette.text.disabled }}- />- <Typography variant="subtitle2" sx={{ flexGrow: 1, fontWeight: 600 }}>- VMC Output- </Typography>- <Tooltip title={vmcEnabled ? "Disable VMC streaming" : "Enable VMC streaming"} arrow>- <Switch- size="small"- checked={vmcEnabled}- onChange={handleToggle}- disabled={!isConnected}- />- </Tooltip>- </Stack>-- {vmcEnabled && (- <Stack direction="row" spacing={1}>- <Tooltip title="Target host (IP address)" arrow placement="bottom">- <TextField- label="Host"- size="small"- value={vmcHost}- onChange={handleHostChange}- disabled={!isConnected}- sx={{ flex: 2 }}- inputProps={{ style: { fontSize: 12 } }}- InputLabelProps={{ style: { fontSize: 12 } }}- />- </Tooltip>- <Tooltip title="UDP port (default 39539)" arrow placement="bottom">- <TextField- label="Port"- size="small"- type="number"- value={vmcPort}- onChange={handlePortChange}- disabled={!isConnected}- sx={{ flex: 1 }}- inputProps={{ min: 1, max: 65535, style: { fontSize: 12 } }}- InputLabelProps={{ style: { fontSize: 12 } }}- />- </Tooltip>- </Stack>- )}- </Stack>- </Box>- );-};diff --git a/freemocap-ui/src/components/viewport3d/Viewport3dPage.tsx b/freemocap-ui/src/components/viewport3d/Viewport3dPage.tsxdeleted file mode 100644index b5964d1e..00000000--- a/freemocap-ui/src/components/viewport3d/Viewport3dPage.tsx+++ /dev/null@@ -1,13 +0,0 @@-import {Box} from "@mui/material";-import React from "react";-import {ThreeJsCanvas} from "@/components/viewport3d/ThreeJsCanvas";-import {VMCPanel} from "@/components/viewport3d/VMCPanel";--export const Viewport3dPage = () => {- return (- <Box sx={{width: '100%', height: '100%', position: 'relative'}}>- <ThreeJsCanvas/>- <VMCPanel/>- </Box>- );-}diff --git a/freemocap-ui/src/components/viewport3d/face-contours.ts b/freemocap-ui/src/components/viewport3d/face-contours.tsdeleted file mode 100644index abb43873..00000000--- a/freemocap-ui/src/components/viewport3d/face-contours.ts+++ /dev/null@@ -1,139 +0,0 @@-import { Color } from "three";-import {SKELETON_COLORS} from "@/components/viewport3d/skeleton-colors";--/**- * MediaPipe face mesh contour connections, matching the Python tracker's- * naming convention: `face.{group}_{raw_mediapipe_index}`.- *- * Connection pairs come from mediapipe.python.solutions.face_mesh_connections:- * FACEMESH_LIPS, FACEMESH_LEFT_EYE, FACEMESH_RIGHT_EYE,- * FACEMESH_LEFT_EYEBROW, FACEMESH_RIGHT_EYEBROW, FACEMESH_FACE_OVAL,- * FACEMESH_LEFT_IRIS, FACEMESH_RIGHT_IRIS- */--interface FaceContourGroup {- prefix: string;- connections: [number, number][];- color: Color;-}--const FACE_CONTOUR_GROUPS: FaceContourGroup[] = [- {- prefix: "face.lips",- color: SKELETON_COLORS.face,- connections: [- // Outer lip upper- [61, 146], [146, 91], [91, 181], [181, 84], [84, 17],- [17, 314], [314, 405], [405, 321], [321, 375], [375, 291],- // Outer lip lower- [61, 185], [185, 40], [40, 39], [39, 37], [37, 0],- [0, 267], [267, 269], [269, 270], [270, 409], [409, 291],- // Inner lip upper- [78, 95], [95, 88], [88, 178], [178, 87], [87, 14],- [14, 317], [317, 402], [402, 318], [318, 324], [324, 308],- // Inner lip lower- [78, 191], [191, 80], [80, 81], [81, 82], [82, 13],- [13, 312], [312, 311], [311, 310], [310, 415], [415, 308],- ],- },- {- prefix: "face.left_eye",- color: SKELETON_COLORS.face,- connections: [- [263, 249], [249, 390], [390, 373], [373, 374], [374, 380],- [380, 381], [381, 382], [382, 362],- [263, 466], [466, 388], [388, 387], [387, 386], [386, 385],- [385, 384], [384, 398], [398, 362],- ],- },- {- prefix: "face.right_eye",- color: SKELETON_COLORS.face,- connections: [- [33, 7], [7, 163], [163, 144], [144, 145], [145, 153],- [153, 154], [154, 155], [155, 133],- [33, 246], [246, 161], [161, 160], [160, 159], [159, 158],- [158, 157], [157, 173], [173, 133],- ],- },- {- prefix: "face.left_eyebrow",- color: SKELETON_COLORS.face,- connections: [- [276, 283], [283, 282], [282, 295], [295, 285],- [300, 293], [293, 334], [334, 296], [296, 336],- ],- },- {- prefix: "face.right_eyebrow",- color: SKELETON_COLORS.face,- connections: [- [46, 53], [53, 52], [52, 65], [65, 55],- [70, 63], [63, 105], [105, 66], [66, 107],- ],- },- {- prefix: "face.face_oval",- color: SKELETON_COLORS.face,- connections: [- [10, 338], [338, 297], [297, 332], [332, 284], [284, 251],- [251, 389], [389, 356], [356, 454], [454, 323], [323, 361],- [361, 288], [288, 397], [397, 365], [365, 379], [379, 378],- [378, 400], [400, 377], [377, 152], [152, 148], [148, 176],- [176, 149], [149, 150], [150, 136], [136, 172], [172, 58],- [58, 132], [132, 93], [93, 234], [234, 127], [127, 162],- [162, 21], [21, 54], [54, 103], [103, 67], [67, 109],- [109, 10],- ],- },- {- prefix: "face.left_iris",- color: SKELETON_COLORS.face,- connections: [- [474, 475], [475, 476], [476, 477], [477, 474],- ],- },- {- prefix: "face.right_iris",- color: SKELETON_COLORS.face,- connections: [- [469, 470], [470, 471], [471, 472], [472, 469],- ],- },-];--/**- * Build segment definitions for all face contour groups.- * Each connection (a, b) becomes a segment from `{prefix}_{a}` to `{prefix}_{b}`.- */-export function buildFaceContourSegments(): Record<string, { proximal: string; distal: string }> {- const segments: Record<string, { proximal: string; distal: string }> = {};-- for (const group of FACE_CONTOUR_GROUPS) {- for (let i = 0; i < group.connections.length; i++) {- const [a, b] = group.connections[i];- segments[`${group.prefix}_seg_${i}`] = {- proximal: `${group.prefix}_${a}`,- distal: `${group.prefix}_${b}`,- };- }- }-- return segments;-}--/**- * Build the color array for all face contour segments, in the same- * order as buildFaceContourSegments produces entries.- */-export function buildFaceContourColors(): Color[] {- const colors: Color[] = [];-- for (const group of FACE_CONTOUR_GROUPS) {- for (let _i = 0; _i < group.connections.length; _i++) {- colors.push(group.color);- }- }-- return colors;-}diff --git a/freemocap-ui/src/components/viewport3d/fit-camera.ts b/freemocap-ui/src/components/viewport3d/fit-camera.tsdeleted file mode 100644index 8bea125a..00000000--- a/freemocap-ui/src/components/viewport3d/fit-camera.ts+++ /dev/null@@ -1,26 +0,0 @@-import { Box3, Vector3 } from "three";-import type CameraControlsImpl from "camera-controls";-import { Z_OFFSET } from "@/components/viewport3d/skeleton-config";-import {Point3d} from "@/services";--const PADDING = 0.5;--/**- * Compute a bounding box around all tracked points and smoothly- * transition the camera to frame it. No-ops if there are no points- * or CameraControls isn't ready.- */-export function fitCameraToSkeleton(- controls: CameraControlsImpl | null,- points: Map<string, Point3d>,-): void {- if (!controls || points.size === 0) return;-- const box = new Box3();- for (const point of points.values()) {- box.expandByPoint(new Vector3(point.x, point.y, point.z + Z_OFFSET));- }- box.expandByScalar(PADDING);-- controls.fitToBox(box, true);-}diff --git a/freemocap-ui/src/components/viewport3d/skeleton-colors.ts b/freemocap-ui/src/components/viewport3d/skeleton-colors.tsdeleted file mode 100644index 06c29589..00000000--- a/freemocap-ui/src/components/viewport3d/skeleton-colors.ts+++ /dev/null@@ -1,11 +0,0 @@-import { Color } from "three";--export const SKELETON_COLORS = {- left: new Color('#4488FF'),- right: new Color('#FF4444'),- center: new Color('#00AA00'),- leftHand: new Color('#00FFFF'),- rightHand: new Color('#FF00FF'),- face: new Color('#FFD700'),- hidden: new Color('#000000'),-} as const;diff --git a/freemocap-ui/src/components/viewport3d/skeleton-config.ts b/freemocap-ui/src/components/viewport3d/skeleton-config.tsdeleted file mode 100644index d69fb3f3..00000000--- a/freemocap-ui/src/components/viewport3d/skeleton-config.ts+++ /dev/null@@ -1,168 +0,0 @@-import { Color } from "three";-import { PointStyle } from "@/components/viewport3d/viewport3d-types";-import { buildFaceContourSegments, buildFaceContourColors } from "@/components/viewport3d/face-contours";-import {SKELETON_COLORS} from "@/components/viewport3d/skeleton-colors";--// Maximum tracked points the instanced mesh can hold-export const MAX_POINTS = 1000;--// Z-axis offset applied to all tracked points to center the skeleton in view-export const Z_OFFSET = -15;--// --- Color palette (matches 2D overlay) -------// --- Point styling: color + sphere scale per body part -----export function getPointStyle(name: string): PointStyle {- // Face landmarks — near-invisible dots, contour lines carry the visual- if (name.startsWith('face.')) {- return { color: SKELETON_COLORS.face, scale: 0.02 };- }-- if (name.startsWith('left_hand.')) {- return { color: SKELETON_COLORS.leftHand, scale: 0.075 };- }- if (name.startsWith('right_hand.')) {- return { color: SKELETON_COLORS.rightHand, scale: 0.075 };- }-- // Body — eyes, ears, mouth are small- if (name.includes('eye') || name.includes('ear') || name.includes('mouth')) {- const side = name.includes('left') ? SKELETON_COLORS.left- : name.includes('right') ? SKELETON_COLORS.right- : SKELETON_COLORS.center;- return { color: side, scale: 0.125 };- }-- // Body — fingers at wrist level- if (name.includes('pinky') || name.includes('index') || name.includes('thumb')) {- const side = name.includes('left') ? SKELETON_COLORS.left : SKELETON_COLORS.right;- return { color: side, scale: 0.05 };- }-- // Body — feet- if (name.includes('heel') || name.includes('foot_index') || name.includes('ankle')) {- const side = name.includes('left') ? SKELETON_COLORS.left : SKELETON_COLORS.right;- return { color: side, scale: 0.3 };- }-- // Body — major joints (shoulder, elbow, wrist, hip, knee)- if (name.includes('left')) {- return { color: SKELETON_COLORS.left, scale: 0.2 };- }- if (name.includes('right')) {- return { color: SKELETON_COLORS.right, scale: 0.2 };- }-- // Center (nose, etc.)- return { color: SKELETON_COLORS.center, scale: 0.15 };-}--// --- Segment color determined by segment name -----function getSegmentColor(segmentName: string): Color {- if (segmentName.startsWith('left_hand_')) return SKELETON_COLORS.leftHand;- if (segmentName.startsWith('right_hand_')) return SKELETON_COLORS.rightHand;- if (segmentName.startsWith('left')) return SKELETON_COLORS.left;- if (segmentName.startsWith('right')) return SKELETON_COLORS.right;- return SKELETON_COLORS.center;-}--// --- Hand connection template (MediaPipe hand landmark topology) -----const HAND_CONNECTIONS: [string, string][] = [- // Thumb- ['wrist', 'thumb_cmc'],- ['thumb_cmc', 'thumb_mcp'],- ['thumb_mcp', 'thumb_ip'],- ['thumb_ip', 'thumb_tip'],- // Index finger- ['wrist', 'index_finger_mcp'],- ['index_finger_mcp', 'index_finger_pip'],- ['index_finger_pip', 'index_finger_dip'],- ['index_finger_dip', 'index_finger_tip'],- // Middle finger- ['wrist', 'middle_finger_mcp'],- ['middle_finger_mcp', 'middle_finger_pip'],- ['middle_finger_pip', 'middle_finger_dip'],- ['middle_finger_dip', 'middle_finger_tip'],- // Ring finger- ['wrist', 'ring_finger_mcp'],- ['ring_finger_mcp', 'ring_finger_pip'],- ['ring_finger_pip', 'ring_finger_dip'],- ['ring_finger_dip', 'ring_finger_tip'],- // Pinky- ['wrist', 'pinky_mcp'],- ['pinky_mcp', 'pinky_pip'],- ['pinky_pip', 'pinky_dip'],- ['pinky_dip', 'pinky_tip'],- // Palm- ['index_finger_mcp', 'middle_finger_mcp'],- ['middle_finger_mcp', 'ring_finger_mcp'],- ['ring_finger_mcp', 'pinky_mcp'],-];--function buildHandSegments(handPrefix: string): Record<string, { proximal: string; distal: string }> {- const segments: Record<string, { proximal: string; distal: string }> = {};- HAND_CONNECTIONS.forEach(([proximal, distal], i) => {- segments[`${handPrefix}_seg_${i}`] = {- proximal: `${handPrefix}.${proximal}`,- distal: `${handPrefix}.${distal}`,- };- });- return segments;-}--// --- Body + hand segment definitions -----const BODY_HAND_SEGMENTS: Record<string, { proximal: string; distal: string }> = {- // Body- head: { proximal: "body.left_ear", distal: "body.right_ear" },- neck: { proximal: "head_center", distal: "neck_center" },- spine: { proximal: "neck_center", distal: "hips_center" },- right_shoulder: { proximal: "neck_center", distal: "body.right_shoulder" },- left_shoulder: { proximal: "neck_center", distal: "body.left_shoulder" },- right_upper_arm: { proximal: "body.right_shoulder", distal: "body.right_elbow" },- left_upper_arm: { proximal: "body.left_shoulder", distal: "body.left_elbow" },- right_forearm: { proximal: "body.right_elbow", distal: "body.right_wrist" },- left_forearm: { proximal: "body.left_elbow", distal: "body.left_wrist" },- right_hand_body: { proximal: "body.right_wrist", distal: "body.right_index" },- left_hand_body: { proximal: "body.left_wrist", distal: "body.left_index" },- right_pelvis: { proximal: "hips_center", distal: "body.right_hip" },- left_pelvis: { proximal: "hips_center", distal: "body.left_hip" },- right_thigh: { proximal: "body.right_hip", distal: "body.right_knee" },- left_thigh: { proximal: "body.left_hip", distal: "body.left_knee" },- right_shank: { proximal: "body.right_knee", distal: "body.right_ankle" },- left_shank: { proximal: "body.left_knee", distal: "body.left_ankle" },- right_foot: { proximal: "body.right_ankle", distal: "body.right_foot_index" },- left_foot: { proximal: "body.left_ankle", distal: "body.left_foot_index" },- right_heel: { proximal: "body.right_ankle", distal: "body.right_heel" },- left_heel: { proximal: "body.left_ankle", distal: "body.left_heel" },- right_foot_bottom: { proximal: "body.right_heel", distal: "body.right_foot_index" },- left_foot_bottom: { proximal: "body.left_heel", distal: "body.left_foot_index" },- // Hands- ...buildHandSegments('right_hand'),- ...buildHandSegments('left_hand'),-};--// Pre-compute body+hand segment colors-const BODY_HAND_COLORS: Color[] = Object.keys(BODY_HAND_SEGMENTS).map(getSegmentColor);--// --- Face contour segments -----const FACE_SEGMENTS = buildFaceContourSegments();-const FACE_COLORS = buildFaceContourColors();--// --- Combined: body + hands + face contours -----export const SEGMENT_DEFINITIONS: Record<string, { proximal: string; distal: string }> = {- ...BODY_HAND_SEGMENTS,- ...FACE_SEGMENTS,-};--export const MAX_SEGMENTS = Object.keys(SEGMENT_DEFINITIONS).length;--// Colors in matching order: body+hand first, then face contours-export const SEGMENT_COLORS: Color[] = [...BODY_HAND_COLORS, ...FACE_COLORS];\ No newline at end of filediff --git a/freemocap-ui/src/components/viewport3d/viewport3d-types.ts b/freemocap-ui/src/components/viewport3d/viewport3d-types.tsdeleted file mode 100644index 7474ed3a..00000000--- a/freemocap-ui/src/components/viewport3d/viewport3d-types.ts+++ /dev/null@@ -1,16 +0,0 @@-import { Color } from "three";--export type { Point3d } from "@/services/server/ServerContextProvider";--export interface PointStyle {- color: Color;- scale: number;-}--/** Rigid body pose for a single bone segment, received from Python backend. */-export interface RigidBodyPose {- bone_key: string;- position: [number, number, number]; // (x, y, z) origin at parent joint- orientation: [number, number, number, number]; // (w, x, y, z) quaternion- length: number; // meters-}diff --git a/freemocap-ui/src/components/viewport3d/virtual-points.ts b/freemocap-ui/src/components/viewport3d/virtual-points.tsdeleted file mode 100644index 424cfb40..00000000--- a/freemocap-ui/src/components/viewport3d/virtual-points.ts+++ /dev/null@@ -1,31 +0,0 @@-import { Point3d } from "@/components/viewport3d/viewport3d-types";--/**- * Resolve a point name to a 3D position. Handles both raw landmark names- * (looked up directly in the points map) and virtual midpoint names- * (head_center, neck_center, hips_center) computed from paired landmarks.- */-export function resolvePoint(points: Map<string, Point3d>, name: string): Point3d | null {- switch (name) {- case "head_center": {- const l = points.get("body.left_ear");- const r = points.get("body.right_ear");- if (!l || !r) return null;- return { x: (l.x + r.x) / 2, y: (l.y + r.y) / 2, z: (l.z + r.z) / 2 };- }- case "neck_center": {- const l = points.get("body.left_shoulder");- const r = points.get("body.right_shoulder");- if (!l || !r) return null;- return { x: (l.x + r.x) / 2, y: (l.y + r.y) / 2, z: (l.z + r.z) / 2 };- }- case "hips_center": {- const l = points.get("body.left_hip");- const r = points.get("body.right_hip");- if (!l || !r) return null;- return { x: (l.x + r.x) / 2, y: (l.y + r.y) / 2, z: (l.z + r.z) / 2 };- }- default:- return points.get(name) ?? null;- }-}diff --git a/freemocap-ui/src/hooks/server-urls.ts b/freemocap-ui/src/hooks/server-urls.tsdeleted file mode 100644index 183aefbd..00000000--- a/freemocap-ui/src/hooks/server-urls.ts+++ /dev/null@@ -1,91 +0,0 @@-const DEFAULT_HOST = 'localhost';-const DEFAULT_PORT = 53117;--type PortChangeCallback = (port: number) => void;--class ServerUrls {- private readonly host = DEFAULT_HOST;- private port = DEFAULT_PORT;- private portChangeListeners = new Set<PortChangeCallback>();-- /**- * Update the port at runtime. Notifies all subscribers so components- * can recreate connections with the correct URL.- */- setPort(port: number): void {- if (port === this.port) return;- console.log(`[ServerUrls] Port updated: ${this.port} → ${port}`);- this.port = port;- for (const listener of this.portChangeListeners) {- listener(port);- }- }-- getPort(): number {- return this.port;- }-- /**- * Subscribe to port changes. Returns an unsubscribe function.- */- onPortChange(callback: PortChangeCallback): () => void {- this.portChangeListeners.add(callback);- return () => {- this.portChangeListeners.delete(callback);- };- }-- getHttpUrl(): string {- return `http://${this.host}:${this.port}`;- }-- getWebSocketUrl(): string {- return `ws://${this.host}:${this.port}/websocket/connect`;- }-- get endpoints() {- const baseUrl = this.getHttpUrl();-- return {- // Server management- health: `${baseUrl}/health`,- shutdown: `${baseUrl}/shutdown`,- settings: `${baseUrl}/settings`,-- // Camera endpoints- detectCameras: `${baseUrl}/skellycam/camera/detect`,- camerasConnectOrUpdate: `${baseUrl}/skellycam/camera/group/apply`,- closeAll: `${baseUrl}/skellycam/camera/group/close/all`,- updateConfigs: `${baseUrl}/skellycam/camera/update`,- pauseUnpauseCameras: `${baseUrl}/skellycam/camera/group/all/pause_unpause`,-- // Recording endpoints- startRecording: `${baseUrl}/skellycam/camera/group/all/record/start`,- stopRecording: `${baseUrl}/skellycam/camera/group/all/record/stop`,-- // Pipeline endpoints- pipelineConnectOrUpdate: `${baseUrl}/freemocap/pipeline/connect`,- pipelineClose: `${baseUrl}/freemocap/pipeline/all/close`,- pipelinePauseUnpause: `${baseUrl}/freemocap/pipeline/all/pause_unpause`,- pipelineRecordStart: `${baseUrl}/freemocap/pipeline/all/record/start`,- pipelineRecordStop: `${baseUrl}/freemocap/pipeline/all/record/stop`,-- // Calibration endpoints- calibrationStartRecording: `${baseUrl}/freemocap/calibration/recording/start`,- calibrationStopRecording: `${baseUrl}/freemocap/calibration/recording/stop`,- calibrateRecording: `${baseUrl}/freemocap/calibration/recording/calibrate`,- updateCalibrationConfig: `${baseUrl}/freemocap/calibration/config/update/all`,-- // Mocap endpoints- mocapStartRecording: `${baseUrl}/freemocap/mocap/recording/start`,- mocapStopRecording: `${baseUrl}/freemocap/mocap/recording/stop`,- processMocapRecording: `${baseUrl}/freemocap/mocap/recording/process`,- updateMocapConfig: `${baseUrl}/freemocap/mocap/config/update/all`,-- // WebSocket- websocket: this.getWebSocketUrl(),- };- }-}--export const serverUrls = new ServerUrls();\ No newline at end of filediff --git a/freemocap-ui/src/hooks/useCalibration.ts b/freemocap-ui/src/hooks/useCalibration.tsdeleted file mode 100644index 8888a26a..00000000--- a/freemocap-ui/src/hooks/useCalibration.ts+++ /dev/null@@ -1,114 +0,0 @@-// hooks/useCalibration.ts-import {useCallback} from 'react';-import {useAppDispatch, useAppSelector} from '@/store/hooks';--import {useElectronIPC} from '@/services';-import {- calibrateRecording,- CalibrationConfig,- calibrationConfigUpdated,- calibrationDirectoryInfoUpdated,- calibrationErrorCleared,- manualCalibrationRecordingPathChanged,- manualCalibrationRecordingPathCleared,- selectCalibration,- selectCalibrationDirectoryInfo,- selectCalibrationRecordingPath,- selectCanCalibrate,- selectCanStartCalibrationRecording,- selectIsUsingManualCalibrationPath,- startCalibrationRecording,- stopCalibrationRecording,- updateCalibrationConfigOnServer-} from "@/store/slices/calibration";--export function useCalibration() {- const dispatch = useAppDispatch();- const { api, isElectron } = useElectronIPC();- const calibrationState = useAppSelector(selectCalibration);- const canStartRecording = useAppSelector(selectCanStartCalibrationRecording);- const canCalibrate = useAppSelector(selectCanCalibrate);- const calibrationRecordingPath = useAppSelector(selectCalibrationRecordingPath);- const directoryInfo = useAppSelector(selectCalibrationDirectoryInfo);- const isUsingManualPath = useAppSelector(selectIsUsingManualCalibrationPath);-- const updateCalibrationConfig = useCallback(- (updates: Partial<CalibrationConfig>) => {- // Update local state first- dispatch(calibrationConfigUpdated(updates));- // Then sync to server - this reads from the updated state- dispatch(updateCalibrationConfigOnServer());- },- [dispatch]- );-- const validateDirectory = useCallback(- async (directoryPath: string) => {- if (!isElectron || !api) {- console.warn('Electron API not available - skipping directory validation');- return;- }-- try {- const info = await api.fileSystem.validateCalibrationDirectory.query({ directoryPath });- dispatch(calibrationDirectoryInfoUpdated(info));- } catch (error) {- console.error('Failed to validate calibration directory:', error);- // Don't throw - just log the error- }- },- [dispatch, isElectron, api]- );-- const setManualRecordingPath = useCallback(- async (path: string) => {- dispatch(manualCalibrationRecordingPathChanged(path));- // Validate the new path- await validateDirectory(path);- },- [dispatch, validateDirectory]- );-- const clearManualRecordingPath = useCallback(() => {- dispatch(manualCalibrationRecordingPathCleared());- }, [dispatch]);-- const dispatchStartCalibrationRecording = useCallback(() => {- dispatch(startCalibrationRecording());- }, [dispatch]);-- const dispatchStopCalibrationRecording = useCallback(() => {- dispatch(stopCalibrationRecording());- }, [dispatch]);-- const calibrate = useCallback(() => {- dispatch(calibrateRecording());- }, [dispatch]);-- const clearError = useCallback(() => {- dispatch(calibrationErrorCleared());- }, [dispatch]);-- return {- // State- config: calibrationState.config,- error: calibrationState.error,- isLoading: calibrationState.isLoading,- isRecording: calibrationState.isRecording,- recordingProgress: calibrationState.recordingProgress,- calibrationRecordingPath,- directoryInfo,- isUsingManualPath,- canStartRecording,- canCalibrate,- // Actions- updateCalibrationConfig,- setManualRecordingPath,- clearManualRecordingPath,- validateDirectory,- dispatchStartCalibrationRecording,- dispatchStopCalibrationRecording,- calibrateSelectedRecording: calibrate,- clearError,- };-}diff --git a/freemocap-ui/src/hooks/useElectronApi.ts b/freemocap-ui/src/hooks/useElectronApi.tsdeleted file mode 100644index 97456743..00000000--- a/freemocap-ui/src/hooks/useElectronApi.ts+++ /dev/null@@ -1,125 +0,0 @@-// src/hooks/useElectronAPI.ts-import {useEffect, useMemo, useState} from 'react';-import {electronIpcClient, isElectron} from "@/services";-import {serverUrls} from "@/hooks/server-urls";--interface UseElectronAPIReturn {- isElectron: boolean;- isLoading: boolean;- api: typeof electronIpcClient | null;- pythonServer: {- start: (exePath?: string | null) => Promise<number>;- stop: () => Promise<void>;- isRunning: () => Promise<boolean>;- getPort: () => Promise<number>;- getStatus: () => Promise<{- running: boolean;- path: string | null;- processInfo: any;- }>;- } | null;- fileSystem: {- openSelectDirectoryDialog: () => Promise<string | null>;- selectExecutable: () => Promise<string | null>;- openFolder: (path: string) => Promise<boolean>;- getHomeDirectory: () => Promise<string>;- } | null;-}--export function useElectronAPI(): UseElectronAPIReturn {- const [isElectronEnv, setIsElectronEnv] = useState<boolean>(false);- const [isLoading, setIsLoading] = useState<boolean>(true);-- useEffect(() => {- const electronAvailable = isElectron();- setIsElectronEnv(electronAvailable);- setIsLoading(false);-- console.log('Electron environment detected:', electronAvailable);- }, []);-- const pythonServer = useMemo(() => {- if (!isElectronEnv) return null;-- return {- /**- * Start the Python server. Returns the port the server bound to.- * Also updates the global serverUrls singleton so all HTTP/WS- * connections automatically use the correct port.- */- start: async (exePath: string | null = null): Promise<number> => {- const port: number = await electronIpcClient.pythonServer.start.mutate({ exePath });- serverUrls.setPort(port);- return port;- },- stop: async () => {- await electronIpcClient.pythonServer.stop.mutate();- },- isRunning: async () => {- return await electronIpcClient.pythonServer.isRunning.query();- },- getPort: async (): Promise<number> => {- const port: number = await electronIpcClient.pythonServer.getPort.query();- serverUrls.setPort(port);- return port;- },- getStatus: async () => {- const [running, path, processInfo] = await Promise.all([- electronIpcClient.pythonServer.isRunning.query(),- electronIpcClient.pythonServer.getExecutablePath.query(),- electronIpcClient.pythonServer.getProcessInfo.query(),- ]);- return { running, path, processInfo };- },- };- }, [isElectronEnv]);-- const fileSystem = useMemo(() => {- if (!isElectronEnv) return null;-- return {- openSelectDirectoryDialog: async () => {- try {- return await electronIpcClient.fileSystem.selectDirectory.mutate();- } catch (error) {- console.error('Failed to select directory:', error);- return null;- }- },- selectExecutable: async () => {- try {- return await electronIpcClient.fileSystem.selectExecutableFile.mutate();- } catch (error) {- console.error('Failed to select executable:', error);- return null;- }- },- openFolder: async (path: string) => {- try {- return await electronIpcClient.fileSystem.openFolder.mutate({ path });- } catch (error) {- console.error('Failed to open folder:', error);- return false;- }- },- getHomeDirectory: async () => {- try {- return await electronIpcClient.fileSystem.getHomeDirectory.query();- } catch (error) {- console.error('Failed to get home directory:', error);- return '';- }- },- };- }, [isElectronEnv]);-- return {- isElectron: isElectronEnv,- isLoading,- api: isElectronEnv ? electronIpcClient : null,- pythonServer,- fileSystem,- };-}--export const electronAPI = isElectron() ? electronIpcClient : null;\ No newline at end of filediff --git a/freemocap-ui/src/hooks/useMocap.ts b/freemocap-ui/src/hooks/useMocap.tsdeleted file mode 100644index 0233834a..00000000--- a/freemocap-ui/src/hooks/useMocap.ts+++ /dev/null@@ -1,144 +0,0 @@-import {useCallback} from 'react';-import {useAppDispatch, useAppSelector} from '@/store/hooks';-import {useElectronIPC} from '@/services';-import {- MediapipeDetectorConfig,- RealtimeFilterConfig,- mocapDetectorConfigReplaced,- mocapDetectorConfigUpdated,- skeletonFilterConfigReplaced,- skeletonFilterConfigUpdated,- mocapDirectoryInfoUpdated,- mocapErrorCleared,- manualMocapRecordingPathChanged,- manualMocapRecordingPathCleared,- selectMocap,- selectMocapDetectorConfig,- selectSkeletonFilterConfig,- selectMocapDirectoryInfo,- selectMocapRecordingPath,- selectCanProcessMocapRecording,- selectCanStartMocapRecording,- selectIsUsingManualMocapPath,- startMocapRecording,- stopMocapRecording,- processMocapRecording,- updateMocapConfigOnServer,-} from "@/store/slices/mocap";--export function useMocap() {- const dispatch = useAppDispatch();- const {api, isElectron} = useElectronIPC();- const mocapState = useAppSelector(selectMocap);- const detectorConfig = useAppSelector(selectMocapDetectorConfig);- const skeletonFilterConfig = useAppSelector(selectSkeletonFilterConfig);- const canStartRecording = useAppSelector(selectCanStartMocapRecording);- const canProcessMocapRecording = useAppSelector(selectCanProcessMocapRecording);- const mocapRecordingPath = useAppSelector(selectMocapRecordingPath);- const directoryInfo = useAppSelector(selectMocapDirectoryInfo);- const isUsingManualPath = useAppSelector(selectIsUsingManualMocapPath);-- const updateDetectorConfig = useCallback(- (updates: Partial<MediapipeDetectorConfig>) => {- dispatch(mocapDetectorConfigUpdated(updates));- dispatch(updateMocapConfigOnServer());- },- [dispatch]- );-- const replaceDetectorConfig = useCallback(- (config: MediapipeDetectorConfig) => {- dispatch(mocapDetectorConfigReplaced(config));- dispatch(updateMocapConfigOnServer());- },- [dispatch]- );-- const updateSkeletonFilterConfig = useCallback(- (updates: Partial<RealtimeFilterConfig>) => {- dispatch(skeletonFilterConfigUpdated(updates));- dispatch(updateMocapConfigOnServer());- },- [dispatch]- );-- const replaceSkeletonFilterConfig = useCallback(- (config: RealtimeFilterConfig) => {- dispatch(skeletonFilterConfigReplaced(config));- dispatch(updateMocapConfigOnServer());- },- [dispatch]- );-- const validateDirectory = useCallback(- async (directoryPath: string) => {- if (!isElectron || !api) {- console.warn('Electron API not available - skipping directory validation');- return;- }-- try {- const info = await api.fileSystem.validateMocapDirectory.query({directoryPath});- dispatch(mocapDirectoryInfoUpdated(info));- } catch (error) {- console.error('Failed to validate mocap directory:', error);- }- },- [dispatch, isElectron, api]- );-- const setManualRecordingPath = useCallback(- async (path: string) => {- dispatch(manualMocapRecordingPathChanged(path));- await validateDirectory(path);- },- [dispatch, validateDirectory]- );-- const clearManualRecordingPath = useCallback(() => {- dispatch(manualMocapRecordingPathCleared());- }, [dispatch]);-- const dispatchStartMocapRecording = useCallback(() => {- dispatch(startMocapRecording());- }, [dispatch]);-- const dispatchStopMocapRecording = useCallback(() => {- dispatch(stopMocapRecording());- }, [dispatch]);-- const dispatchProcessMocapRecording = useCallback(() => {- dispatch(processMocapRecording());- }, [dispatch]);-- const clearError = useCallback(() => {- dispatch(mocapErrorCleared());- }, [dispatch]);-- return {- // State- config: mocapState.config,- detectorConfig,- skeletonFilterConfig,- error: mocapState.error,- isLoading: mocapState.isLoading,- isRecording: mocapState.isRecording,- recordingProgress: mocapState.recordingProgress,- mocapRecordingPath,- directoryInfo,- isUsingManualPath,- canStartRecording,- canProcessMocapRecording,- // Actions- updateDetectorConfig,- replaceDetectorConfig,- updateSkeletonFilterConfig,- replaceSkeletonFilterConfig,- setManualRecordingPath,- clearManualRecordingPath,- dispatchStartMocapRecording,- dispatchStopMocapRecording,- dispatchProcessMocapRecording,- clearError,- };-}diff --git a/freemocap-ui/src/hooks/useServer.ts b/freemocap-ui/src/hooks/useServer.tsdeleted file mode 100644index e09bb2a6..00000000--- a/freemocap-ui/src/hooks/useServer.ts+++ /dev/null@@ -1,10 +0,0 @@-import {useContext} from "react";-import {ServerContext, ServerContextValue} from "@/services";--export const useServer = (): ServerContextValue => {- const context = useContext(ServerContext);- if (!context) {- throw new Error('useServer must be used within ServerContextProvider');- }- return context;-};diff --git a/freemocap-ui/src/i18n/locales/am-amharic.json b/freemocap-ui/src/i18n/locales/am-amharic.jsonindex 3d0cc3a0..8612de5a 100644--- a/freemocap-ui/src/i18n/locales/am-amharic.json+++ b/freemocap-ui/src/i18n/locales/am-amharic.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "እንኳን ወደ SkellyCam በደህና መጡ",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "እንኳን ወደ FreeMoCap በደህና መጡ","welcomeSubtitle": "የተመሳሰሉ ቪዲዮዎችን ይቅረጹ እና ይመልከቱ","sendAnonymousPings": "ስም-አልባ የአጠቃቀም ፒንጎችን ላክ","footerWith": "ከ",@@ -196,7 +196,7 @@"rendersReceivedFrames": "የተቀበሉ ፍሬሞችን በማያ ገጽ ላይ ያሳያል።","displayTooltipLong": "ማሳያ የUI ማሳያ አፈጻጸምን ይወክላል። ማሳያዎ ፍሬሞችን ምን ያህል በፍጥነት እንደሚቀበል እና እንደሚያሳይ ያሳያል። እዚህ ያሉ የአፈጻጸም ችግሮች የቀረጻ ጥራትን አይጎዱም ነገር ግን ካሜራዎችን በቀጥታ የመከታተል ችሎታዎን ሊጎዱ ይችላሉ።","statsSourceShort": "ማሳያ ፍሬሞችን ያሳያል፣ አገልጋይ ፍሬሞችን ይይዛል።",- "statsSourceLong": "አገልጋይ ፍሬሞች ከካሜራ የሚጎተቱበት/የሚቀረጹበት ትክክለኛ ፍጥነት ነው፣ ማሳያ ደግሞ የሚቀበሉበት እና የሚሳዩበት ፍጥነት ነው። Skellycam ለቀረጻ ጥራት የአገልጋይ ወገን አፈጻጸምን ቅድሚያ ይሰጣል፣ ስለዚህ ያ ቁጥር የበለጠ የተረጋጋ መሆን አለበት። የማሳያ ፍሬም ፍጥነት ከአገልጋይ ከራቀ፣ የስርዓት ሀብቶችዎ እንደተጫኑ ያሳያል። ያነሱ ካሜራዎችን መጠቀም ወይም ፍሬም ፍጥነት/ጥራት መቀነስ ያስቡ።",+ "statsSourceLong": "አገልጋይ ፍሬሞች ከካሜራ የሚጎተቱበት/የሚቀረጹበት ትክክለኛ ፍጥነት ነው፣ ማሳያ ደግሞ የሚቀበሉበት እና የሚሳዩበት ፍጥነት ነው። FreeMoCap ለቀረጻ ጥራት የአገልጋይ ወገን አፈጻጸምን ቅድሚያ ይሰጣል፣ ስለዚህ ያ ቁጥር የበለጠ የተረጋጋ መሆን አለበት። የማሳያ ፍሬም ፍጥነት ከአገልጋይ ከራቀ፣ የስርዓት ሀብቶችዎ እንደተጫኑ ያሳያል። ያነሱ ካሜራዎችን መጠቀም ወይም ፍሬም ፍጥነት/ጥራት መቀነስ ያስቡ።","statsCurrentShort": "በጣም የቅርብ የፍሬም ጊዜ እና ተዛማጅ FPS።","statsCurrentLong": "ይህ አንድ ፍሬም ለማስኬድ ምን ያህል ጊዜ እንደሚወስድ (በሚሊሰከንዶች) እና ተመጣጣኝ ፍሬሞች በሰከንድ (FPS) በጣም የቅርብ ልኬትን ያሳያል። ዝቅተኛ የፍሬም ጊዜዎች እና ከፍ ያለ FPS የተሻለ አፈጻጸምን ያሳያሉ።","statsMinShort": "ፈጣኑ የፍሬም ጊዜ (ዝቅተኛ መዘግየት) እና ከፍተኛ FPS የተገኘ።",@@ -211,7 +211,7 @@"statsStdDevLong": "ስታንዳርድ ዲቪየሽን በፍሬም ጊዜዎች ውስጥ ያለውን የለውጥ መጠን ይለካል። ዝቅተኛ ዋጋዎች የበለጠ ወጥ የሆነ አፈጻጸምን ያመለክታሉ። የለውጥ ኮኤፊሸንት (CV%) ይህንን ተለዋዋጭነት ከአማካዩ በመቶኛ ይገልጻል፣ ይህም በተለያዩ የፍሬም ፍጥነቶች ላይ ያለውን ጥንካሬ ማወዳደር ቀላል ያደርገዋል። ዝቅተኛ CV% የበለጠ ጠንካራ አፈጻጸምን ያመለክታል።","aiTranslatedTooltip": "ይህ ትርጉም በ AI ተፈጥሯል እና ስህተቶች ሊኖሩት ይችላሉ። ይህን ቋንቋ ከተናገሩ፣ በ GitHub ላይ pull request በመክፈት ለማሻሻል ሊረዱ ይችላሉ!","humanValidatedTooltip": "ይህ ትርጉም በሰው ተርጓሚ ተገምግሞ ተረጋግጧል።",- "helpTranslate": "SkellyCam ን ለመተርጎም ይረዱ",+ "helpTranslate": "FreeMoCap ን ለመተርጎም ይረዱ","failedToFetch": "ማምጣት አልተሳካም","recordings": "ቀረጻዎች","noRecordingsFound": "ምንም ቀረጻዎች አልተገኙም። በእጅ ለመጫን ከላይ ዱካ ያስገቡ።",@@ -239,7 +239,7 @@"menuDocumentation": "ሰነድ","menuGitHubRepository": "የGitHub ማከማቻ","menuReportIssue": "ችግር ሪፖርት አድርግ…",- "menuAbout": "ስለ SkellyCam",+ "menuAbout": "ስለ FreeMoCap","menuPlayback": "ማጫወት","videoPlayback": "ማጫወት","copyLogsToClipboard": "ሎግ ወደ ቅንጥብ ሰሌዳ ቅዳ",diff --git a/freemocap-ui/src/i18n/locales/ar-arabic.json b/freemocap-ui/src/i18n/locales/ar-arabic.jsonindex 4bf6c5f0..208c399d 100644--- a/freemocap-ui/src/i18n/locales/ar-arabic.json+++ b/freemocap-ui/src/i18n/locales/ar-arabic.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-22"},- "appName": "SkellyCam",- "appNameDecorated": "📸💀 SkellyCam",- "welcomeTitle": "SkellyCam أهلاً بك في",+ "appName": "FreeMoCap",+ "appNameDecorated": "📸💀 FreeMoCap",+ "welcomeTitle": "FreeMoCap أهلاً بك في","welcomeSubtitle": "سجّل وشاهد مقاطع فيديو متزامنة","sendAnonymousPings": "إرسال بيانات استخدام مجهولة","footerWith": "بـ",@@ -196,7 +196,7 @@"rendersReceivedFrames": "يعرض الإطارات المستلمة على الشاشة.","displayTooltipLong": "يمثل العرض أداء تصيير واجهة المستخدم. يوضح مدى سرعة استقبال شاشتك وتصيير الإطارات. مشاكل الأداء هنا لن تؤثر على جودة التسجيل لكنها قد تؤثر على قدرتك على مراقبة الكاميرات في الوقت الفعلي.","statsSourceShort": "العرض يقدم الإطارات، الخادم يلتقط الإطارات.",- "statsSourceLong": "الخادم هو المعدل الحقيقي الذي يتم فيه سحب/تسجيل الإطارات من الكاميرا، بينما العرض هو معدل استقبالها وتصييرها. يعطي SkellyCam الأولوية لأداء جانب الخادم لضمان جودة التسجيل، لذا يجب أن يبقى هذا الرقم أكثر استقرارًا. إذا انحرف معدل إطارات العرض عن الخادم، فهذا يشير إلى أن موارد نظامك مُجهدة. فكر في استخدام عدد أقل من الكاميرات أو تقليل معدل الإطارات/الدقة.",+ "statsSourceLong": "الخادم هو المعدل الحقيقي الذي يتم فيه سحب/تسجيل الإطارات من الكاميرا، بينما العرض هو معدل استقبالها وتصييرها. يعطي FreeMoCap الأولوية لأداء جانب الخادم لضمان جودة التسجيل، لذا يجب أن يبقى هذا الرقم أكثر استقرارًا. إذا انحرف معدل إطارات العرض عن الخادم، فهذا يشير إلى أن موارد نظامك مُجهدة. فكر في استخدام عدد أقل من الكاميرات أو تقليل معدل الإطارات/الدقة.","statsCurrentShort": "أحدث وقت إطار و FPS المقابل.","statsCurrentLong": "يعرض هذا أحدث قياس لمدة معالجة إطار واحد (بالمللي ثانية) وما يعادله من إطارات في الثانية (FPS). أوقات إطارات أقل ومعدل FPS أعلى يشيران إلى أداء أفضل.","statsMinShort": "أسرع وقت إطار (أقل تأخير) وأعلى FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "يقيس الانحراف المعياري مقدار التباين في أوقات الإطارات. القيم الأقل تشير إلى أداء أكثر اتساقًا. يعبر معامل التباين (CV%) عن هذا التباين كنسبة مئوية من المتوسط، مما يسهل مقارنة الاستقرار عبر معدلات إطارات مختلفة. نسبة CV% أقل تشير إلى أداء أكثر استقرارًا.","aiTranslatedTooltip": "هذه الترجمة تم إنشاؤها بواسطة الذكاء الاصطناعي وقد تحتوي على أخطاء. إذا كنت تتحدث هذه اللغة، يمكنك المساعدة في تحسينها عبر فتح pull request على GitHub!","humanValidatedTooltip": "تمت مراجعة هذه الترجمة والتحقق منها بواسطة مترجم بشري.",- "helpTranslate": "ساعد في ترجمة SkellyCam",+ "helpTranslate": "ساعد في ترجمة FreeMoCap","failedToFetch": "فشل في الجلب","recordings": "التسجيلات","noRecordingsFound": "لم يتم العثور على تسجيلات. أدخل مسارًا أعلاه للتحميل يدويًا.",@@ -239,7 +239,7 @@"menuDocumentation": "التوثيق","menuGitHubRepository": "مستودع GitHub","menuReportIssue": "الإبلاغ عن مشكلة…",- "menuAbout": "حول SkellyCam",+ "menuAbout": "حول FreeMoCap","menuPlayback": "تشغيل","videoPlayback": "التشغيل","copyLogsToClipboard": "نسخ السجلات إلى الحافظة",diff --git a/freemocap-ui/src/i18n/locales/bn-bangla.json b/freemocap-ui/src/i18n/locales/bn-bangla.jsonindex 9619a33e..43519830 100644--- a/freemocap-ui/src/i18n/locales/bn-bangla.json+++ b/freemocap-ui/src/i18n/locales/bn-bangla.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam-এ স্বাগতম",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap-এ স্বাগতম","welcomeSubtitle": "সিঙ্ক্রোনাইজড ভিডিও রেকর্ড ও দেখুন","sendAnonymousPings": "বেনামী ব্যবহার ডেটা পাঠান","footerWith": "সাথে",@@ -196,7 +196,7 @@"rendersReceivedFrames": "স্ক্রিনে প্রাপ্ত ফ্রেম রেন্ডার করে।","displayTooltipLong": "ডিসপ্লে UI রেন্ডারিং কর্মক্ষমতা প্রতিনিধিত্ব করে। এটি দেখায় আপনার ডিসপ্লে কত দ্রুত ফ্রেম গ্রহণ করে এবং রেন্ডার করে। এখানে কর্মক্ষমতা সমস্যা রেকর্ডিং মানকে প্রভাবিত করবে না তবে রিয়েল-টাইমে ক্যামেরা পর্যবেক্ষণ করার আপনার ক্ষমতাকে প্রভাবিত করতে পারে।","statsSourceShort": "ডিসপ্লে ফ্রেম রেন্ডার করে, সার্ভার ফ্রেম ক্যাপচার করে।",- "statsSourceLong": "সার্ভার হল ক্যামেরা থেকে ফ্রেম টানা/রেকর্ড করার প্রকৃত হার, যেখানে ডিসপ্লে হল সেগুলি গ্রহণ ও রেন্ডার করার হার। SkellyCam রেকর্ডিং মানের জন্য সার্ভার-সাইড কর্মক্ষমতাকে অগ্রাধিকার দেয়, তাই সেই সংখ্যাটি আরও স্থিতিশীল থাকা উচিত। যদি ডিসপ্লে ফ্রেমরেট সার্ভার থেকে বিচ্যুত হয়, তাহলে এটি নির্দেশ করে যে আপনার সিস্টেম রিসোর্স চাপে আছে। কম ক্যামেরা ব্যবহার করুন বা ফ্রেমরেট/রেজোলিউশন কমানোর কথা বিবেচনা করুন।",+ "statsSourceLong": "সার্ভার হল ক্যামেরা থেকে ফ্রেম টানা/রেকর্ড করার প্রকৃত হার, যেখানে ডিসপ্লে হল সেগুলি গ্রহণ ও রেন্ডার করার হার। FreeMoCap রেকর্ডিং মানের জন্য সার্ভার-সাইড কর্মক্ষমতাকে অগ্রাধিকার দেয়, তাই সেই সংখ্যাটি আরও স্থিতিশীল থাকা উচিত। যদি ডিসপ্লে ফ্রেমরেট সার্ভার থেকে বিচ্যুত হয়, তাহলে এটি নির্দেশ করে যে আপনার সিস্টেম রিসোর্স চাপে আছে। কম ক্যামেরা ব্যবহার করুন বা ফ্রেমরেট/রেজোলিউশন কমানোর কথা বিবেচনা করুন।","statsCurrentShort": "সাম্প্রতিক ফ্রেম সময় এবং FPS।","statsCurrentLong": "এটি একটি একক ফ্রেম প্রক্রিয়াকরণে কত সময় লাগে (মিলিসেকেন্ডে) এবং সমতুল্য প্রতি সেকেন্ডে ফ্রেম (FPS) এর সাম্প্রতিকতম পরিমাপ দেখায়। কম ফ্রেম সময় এবং উচ্চ FPS ভাল কর্মক্ষমতা নির্দেশ করে।","statsMinShort": "দ্রুততম ফ্রেম সময় এবং সর্বোচ্চ FPS।",@@ -211,7 +211,7 @@"statsStdDevLong": "স্ট্যান্ডার্ড ডেভিয়েশন ফ্রেম সময়ের প্রকরণের পরিমাণ পরিমাপ করে। কম মান আরও সামঞ্জস্যপূর্ণ কর্মক্ষমতা নির্দেশ করে। ভেরিয়েশনের সহগ (CV%) এই পরিবর্তনশীলতাকে গড়ের শতাংশ হিসাবে প্রকাশ করে, বিভিন্ন ফ্রেম রেট জুড়ে স্থিতিশীলতা তুলনা করা সহজ করে। কম CV% আরও স্থিতিশীল কর্মক্ষমতা নির্দেশ করে।","aiTranslatedTooltip": "এই অনুবাদটি AI দ্বারা তৈরি এবং ত্রুটি থাকতে পারে। আপনি এই ভাষায় কথা বললে উন্নতিতে সাহায্য করুন!","humanValidatedTooltip": "এই অনুবাদটি একজন মানব অনুবাদক দ্বারা পর্যালোচনা করা হয়েছে।",- "helpTranslate": "SkellyCam অনুবাদে সাহায্য করুন",+ "helpTranslate": "FreeMoCap অনুবাদে সাহায্য করুন","failedToFetch": "ডেটা আনতে ব্যর্থ","recordings": "রেকর্ডিং","noRecordingsFound": "কোনো রেকর্ডিং পাওয়া যায়নি। ম্যানুয়ালি লোড করতে উপরে একটি পাথ লিখুন।",@@ -239,7 +239,7 @@"menuDocumentation": "ডকুমেন্টেশন","menuGitHubRepository": "GitHub রিপোজিটরি","menuReportIssue": "সমস্যা রিপোর্ট করুন…",- "menuAbout": "SkellyCam সম্পর্কে",+ "menuAbout": "FreeMoCap সম্পর্কে","menuPlayback": "প্লেব্যাক","videoPlayback": "প্লেব্যাক","copyLogsToClipboard": "লগ ক্লিপবোর্ডে কপি করুন",diff --git a/freemocap-ui/src/i18n/locales/ca-catala.json b/freemocap-ui/src/i18n/locales/ca-catala.jsonindex 8d78684a..ae305f35 100644--- a/freemocap-ui/src/i18n/locales/ca-catala.json+++ b/freemocap-ui/src/i18n/locales/ca-catala.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Benvingut a SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Benvingut a FreeMoCap","welcomeSubtitle": "Enregistra i visualitza vídeos sincronitzats","sendAnonymousPings": "Envia pings d'ús anònims","footerWith": "amb",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Renderitza els fotogrames rebuts a la pantalla.","displayTooltipLong": "La Pantalla representa el rendiment de renderització de la interfície d'usuari. Mostra com de ràpid la vostra pantalla rep i renderitza fotogrames. Els problemes de rendiment aquí no afectaran la qualitat de l'enregistrament, però poden afectar la vostra capacitat de supervisar les càmeres en temps real.","statsSourceShort": "La Pantalla renderitza fotogrames, el Servidor captura fotogrames.",- "statsSourceLong": "El servidor és la taxa real a la qual els fotogrames es capturen/enregistren de la càmera, mentre que la pantalla és la taxa a la qual es reben i es renderitzen. Skellycam prioritza el rendiment del servidor per a la qualitat de l'enregistrament, de manera que aquest número hauria de romandre més estable. Si la taxa de fotogrames de la pantalla divergeix del servidor, indica que els recursos del vostre sistema estan sobrecarregats. Considereu utilitzar menys càmeres o disminuir la taxa de fotogrames/resolució.",+ "statsSourceLong": "El servidor és la taxa real a la qual els fotogrames es capturen/enregistren de la càmera, mentre que la pantalla és la taxa a la qual es reben i es renderitzen. FreeMoCap prioritza el rendiment del servidor per a la qualitat de l'enregistrament, de manera que aquest número hauria de romandre més estable. Si la taxa de fotogrames de la pantalla divergeix del servidor, indica que els recursos del vostre sistema estan sobrecarregats. Considereu utilitzar menys càmeres o disminuir la taxa de fotogrames/resolució.","statsCurrentShort": "Temps de fotograma més recent i FPS corresponent.","statsCurrentLong": "Això mostra la mesura més recent de quant temps triga a processar un sol fotograma (en mil·lisegons) i els fotogrames per segon (FPS) equivalents. Temps de fotograma més baixos i FPS més alts indiquen un millor rendiment.","statsMinShort": "Temps de fotograma més ràpid (latència més baixa) i FPS més alt aconseguit.",@@ -211,7 +211,7 @@"statsStdDevLong": "La desviació estàndard mesura la quantitat de variació en els temps de fotograma. Valors més baixos indiquen un rendiment més consistent. El coeficient de variació (CV%) expressa aquesta variabilitat com a percentatge de la mitjana, facilitant la comparació de l'estabilitat entre diferents taxes de fotogrames. Un CV% més baix indica un rendiment més estable.","aiTranslatedTooltip": "Aquesta traducció ha estat generada per IA i pot contenir errors. Si parleu aquest idioma, podeu ajudar a millorar-la obrint una pull request a GitHub!","humanValidatedTooltip": "Aquesta traducció ha estat revisada i validada per un traductor humà.",- "helpTranslate": "Ajudeu a traduir SkellyCam",+ "helpTranslate": "Ajudeu a traduir FreeMoCap","failedToFetch": "No s'ha pogut obtenir","recordings": "Enregistraments","noRecordingsFound": "No s'han trobat enregistraments. Introduïu un camí a dalt per carregar manualment.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentació","menuGitHubRepository": "Repositori GitHub","menuReportIssue": "Informar d'un problema…",- "menuAbout": "Sobre SkellyCam",+ "menuAbout": "Sobre FreeMoCap","menuPlayback": "Reproducció","videoPlayback": "Reproducció","copyLogsToClipboard": "Copiar registres al porta-retalls",diff --git a/freemocap-ui/src/i18n/locales/chr-tsalagi.json b/freemocap-ui/src/i18n/locales/chr-tsalagi.jsonindex e797b13a..1fe92304 100644--- a/freemocap-ui/src/i18n/locales/chr-tsalagi.json+++ b/freemocap-ui/src/i18n/locales/chr-tsalagi.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-24"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "ᏙᎯᏱ SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "ᏙᎯᏱ FreeMoCap","welcomeSubtitle": "ᏗᏓᎴᏂᏍᎬ ᎠᎴ ᎠᎦᏎᏍᏗ ᎤᎾᎵᎪᏒ ᏗᏓᏴᎳᏛᏍᎩ","sendAnonymousPings": "ᎠᏓᏅᏖᏗ ᎦᎸᎳᏗ ᎪᏪᎵᏍᎩ ᏗᎧᏃᎩᏍᏗ","footerWith": "ᎬᏗ",@@ -196,7 +196,7 @@"rendersReceivedFrames": "ᏗᏓᏟᎶᏍᏔᏅ ᎠᎦᏎᏍᏗ.","displayTooltipLong": "ᎠᎦᏎᏍᏗ ᎤᏙᏢᏒ UI ᏗᏙᏪᎵᏍᎩ ᎠᎦᏎᏍᏗ. ᏓᏍᎪᎸᏓ ᎾᏍᎩ ᏚᏳᎪᏛ ᎢᎦᏛ ᏗᏓᏟᎶᏍᏔᏅ ᎤᏂᎷᏤ ᎠᎦᏎᏍᏗ. ᎠᏍᏓᏩᏛᏍᏗ ᎠᎴ ᏗᏓᏟᎶᏍᏔᏅ ᏄᎵᏍᏔᏅ ᎥᏝ ᏱᏓᏟᎶᏍᏔᏅ ᏗᎪᏪᎵ ᎤᏩᏒ ᏧᎵᎬᏩᏗᏒᎢ ᎠᏎᏃ ᎤᎵᏍᏕᎸᏗ ᎨᏒᎢ ᎤᏍᏗ ᏗᏓᏴᎳᏛᏍᎩ ᎠᎦᏎᏍᏗ ᏂᎦᏛ ᎢᎦᏛ.","statsSourceShort": "ᎠᎦᏎᏍᏗ ᏗᏓᏟᎶᏍᏔᏅ ᎠᎦᏎᏍᏗ, ᎠᏍᏆᎵᏍᎩ ᏗᏓᏟᎶᏍᏔᏅ ᎦᏂᏱᏍᎩ.",- "statsSourceLong": "ᎠᏍᏆᎵᏍᎩ ᎨᏒᎢ ᏗᏓᏴᎳᏛᏍᎩ ᎤᏙᏢᏒ ᏗᏓᏟᎶᏍᏔᏅ ᎤᏂᎸᏉᏗ, ᎠᎦᏎᏍᏗ ᎨᏒᎢ ᎾᏍᎩ ᎤᏂᎷᏤ ᎠᎦᏎᏍᏗ ᎤᏂᎸᏉᏗ. SkellyCam ᏗᏓᎴᏂᏍᎬ ᎤᏙᏢᏒ ᎠᏍᏆᎵᏍᎩ ᎤᏙᏢᏒ ᏧᎵᎬᏩᏗᏒᎢ, ᎾᏍᎩ ᏗᏎᏍᏗ ᎤᏟ ᎤᏩᏒ ᎤᎵᏍᏕᎸᏗ. ᎠᎦᏎᏍᏗ FPS ᏓᏍᏓᏅᏅ ᎠᏍᏆᎵᏍᎩ, ᏄᎵᏍᏔᏅ ᎨᏒᎢ ᎢᏤ ᏗᏙᏪᎵᏍᎩ ᏚᎸᏫᏍᏓᏁᎲᎢ. ᎤᏍᏗ ᏗᏓᏴᎳᏛᏍᎩ ᏚᎸᏫᏍᏓᏁᎯ ᎠᎴ ᎤᏍᏗ FPS/ᏗᏙᏪᎵᏍᎩ ᎠᏍᏓᏅᏅᎢ.",+ "statsSourceLong": "ᎠᏍᏆᎵᏍᎩ ᎨᏒᎢ ᏗᏓᏴᎳᏛᏍᎩ ᎤᏙᏢᏒ ᏗᏓᏟᎶᏍᏔᏅ ᎤᏂᎸᏉᏗ, ᎠᎦᏎᏍᏗ ᎨᏒᎢ ᎾᏍᎩ ᎤᏂᎷᏤ ᎠᎦᏎᏍᏗ ᎤᏂᎸᏉᏗ. FreeMoCap ᏗᏓᎴᏂᏍᎬ ᎤᏙᏢᏒ ᎠᏍᏆᎵᏍᎩ ᎤᏙᏢᏒ ᏧᎵᎬᏩᏗᏒᎢ, ᎾᏍᎩ ᏗᏎᏍᏗ ᎤᏟ ᎤᏩᏒ ᎤᎵᏍᏕᎸᏗ. ᎠᎦᏎᏍᏗ FPS ᏓᏍᏓᏅᏅ ᎠᏍᏆᎵᏍᎩ, ᏄᎵᏍᏔᏅ ᎨᏒᎢ ᎢᏤ ᏗᏙᏪᎵᏍᎩ ᏚᎸᏫᏍᏓᏁᎲᎢ. ᎤᏍᏗ ᏗᏓᏴᎳᏛᏍᎩ ᏚᎸᏫᏍᏓᏁᎯ ᎠᎴ ᎤᏍᏗ FPS/ᏗᏙᏪᎵᏍᎩ ᎠᏍᏓᏅᏅᎢ.","statsCurrentShort": "ᎪᎯ ᏗᏓᏟᎶᏍᏔᏅ ᎢᎦᏛ ᎠᎴ FPS.","statsCurrentLong": "ᎯᎠ ᏓᏍᎪᎸᏓ ᏗᏓᏟᎶᏍᏔᏅ ᎢᎦᏛ ᏗᏙᏪᎵᏍᎩ ᏌᏊ ᏓᏟᎶᏍᏔᏅ (ᏗᎳᏏᏔᏛ) ᎠᎴ FPS. ᎤᏍᏗ ᏗᏓᏟᎶᏍᏔᏅ ᎢᎦᏛ ᎠᎴ ᎤᏔᎾ FPS ᎤᏙᏢᏒ ᎣᏍᏛ ᏗᏙᏪᎵᏍᎩ ᎠᎦᏎᏍᏗ.","statsMinShort": "ᎤᏓᏂᎳᏅ ᏗᏓᏟᎶᏍᏔᏅ ᎢᎦᏛ ᎠᎴ ᎤᏔᎾ FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "ᎤᏓᎴᎾ ᏗᏙᏪᎵᏍᎩ ᏗᏓᏟᎶᏍᏔᏅ ᎢᎦᏛ ᎤᏓᎴᎾ ᏗᏍᏓᏩᏛᏍᏗ. ᎤᏍᏗ ᏗᏙᏪᎵᏍᎩ ᎤᏟ ᎤᏩᏒ ᎤᎵᏍᏕᎸᏗ ᎠᎦᏎᏍᏗ. CV% ᏄᎵᏍᏔᏅ ᎠᏰᎵ ᏗᏓᎴᎾ ᏗᏙᏪᎵᏍᎩ ᏚᎸᏫᏍᏓᏁᎲᎢ, ᎤᏍᏗ CV% ᎤᏟ ᎤᏩᏒ ᏗᏙᏪᎵᏍᎩ ᎠᎦᏎᏍᏗ.","aiTranslatedTooltip": "ᎯᎠ ᎠᏁᏢᏔᏅ AI ᎬᏗ ᎢᎬᏁᏗ ᎠᎴ ᏗᏍᎪᎵᏴᏓ ᎪᎱᏍᏗ. ᎯᎠ ᎦᏬᏂᎯᏍᏗ ᎨᏒ, ᎢᏍᏓᏍᏗ ᎢᎩᏍᏗᏱ GitHub!","humanValidatedTooltip": "ᎯᎠ ᎠᏁᏢᏔᏅ ᏴᏫ ᎠᏁᏢᏔᏅᎩ ᎤᏙᏪᎸᎢ.",- "helpTranslate": "ᎢᏍᏓᏍᏗ SkellyCam ᎠᏁᏢᏔᏅ",+ "helpTranslate": "ᎢᏍᏓᏍᏗ FreeMoCap ᎠᏁᏢᏔᏅ","failedToFetch": "ᎥᏝ ᎬᏩᎵᏓ ᎠᏫᏒᏗ","recordings": "ᏗᏓᎴᏂᏍᎬ","noRecordingsFound": "ᎥᏝ ᏗᏓᎴᏂᏍᎬ ᎤᏩᏌᏊ. ᏅᏃᎯ ᏂᏓᏳᎵᏍᏔᏂ ᎠᏫᏒᏗ.",@@ -239,7 +239,7 @@"menuDocumentation": "ᏗᎪᏪᎵ","menuGitHubRepository": "GitHub ᏗᎫᏓᎸᏗ","menuReportIssue": "ᏗᏍᎪᎵᏴᏓ ᎧᏃᎮᏛ…",- "menuAbout": "ᏂᏛᏰᏍᎬ SkellyCam",+ "menuAbout": "ᏂᏛᏰᏍᎬ FreeMoCap","menuPlayback": "ᎠᏔᎷᎩᏍᏗ","videoPlayback": "ᎠᏔᎷᎩᏍᏗ","copyLogsToClipboard": "ᏗᎧᏃᎩᏍᏗ ᎠᏂᎩᏍᏗ",diff --git a/freemocap-ui/src/i18n/locales/cs-cestina.json b/freemocap-ui/src/i18n/locales/cs-cestina.jsonindex bba63684..39e617cb 100644--- a/freemocap-ui/src/i18n/locales/cs-cestina.json+++ b/freemocap-ui/src/i18n/locales/cs-cestina.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Vítejte v SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Vítejte v FreeMoCap","welcomeSubtitle": "Nahrávejte a prohlížejte synchronizovaná videa","sendAnonymousPings": "Odesílat anonymní data o využití","footerWith": "s",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Vykresluje přijaté snímky na obrazovce.","displayTooltipLong": "Zobrazení představuje výkon vykreslování uživatelského rozhraní. Ukazuje, jak rychle váš displej přijímá a vykresluje snímky. Problémy s výkonem zde neovlivní kvalitu záznamu, ale mohou ovlivnit vaši schopnost sledovat kamery v reálném čase.","statsSourceShort": "Displej vykresluje snímky, server je snímá.",- "statsSourceLong": "Server je skutečná rychlost, kterou jsou snímky stahovány/zaznamenávány z kamery, zatímco zobrazení je rychlost, kterou jsou přijímány a vykreslovány. SkellyCam upřednostňuje výkon na straně serveru pro kvalitu záznamu, takže toto číslo by mělo zůstat stabilnější. Pokud se snímková frekvence zobrazení liší od serveru, znamená to, že systémové zdroje jsou přetíženy. Zvažte použití méně kamer nebo snížení snímkové frekvence/rozlišení.",+ "statsSourceLong": "Server je skutečná rychlost, kterou jsou snímky stahovány/zaznamenávány z kamery, zatímco zobrazení je rychlost, kterou jsou přijímány a vykreslovány. FreeMoCap upřednostňuje výkon na straně serveru pro kvalitu záznamu, takže toto číslo by mělo zůstat stabilnější. Pokud se snímková frekvence zobrazení liší od serveru, znamená to, že systémové zdroje jsou přetíženy. Zvažte použití méně kamer nebo snížení snímkové frekvence/rozlišení.","statsCurrentShort": "Nejnovější čas snímku a FPS.","statsCurrentLong": "Zobrazuje nejnovější měření doby zpracování jednoho snímku (v milisekundách) a odpovídající počet snímků za sekundu (FPS). Nižší časy snímků a vyšší FPS značí lepší výkon.","statsMinShort": "Nejrychlejší čas snímku a nejvyšší FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Směrodatná odchylka měří míru rozptylu v časech snímků. Nižší hodnoty značí konzistentnější výkon. Koeficient variace (CV%) vyjadřuje tuto proměnlivost jako procento průměru, což usnadňuje porovnání stability napříč různými snímkovými frekvencemi. Nižší CV% značí stabilnější výkon.","aiTranslatedTooltip": "Tento překlad byl vytvořen umělou inteligencí a může obsahovat chyby. Pokud mluvíte tímto jazykem, pomozte nám jej vylepšit!","humanValidatedTooltip": "Tento překlad byl ověřen lidským překladatelem.",- "helpTranslate": "Pomozte přeložit SkellyCam",+ "helpTranslate": "Pomozte přeložit FreeMoCap","failedToFetch": "Nepodařilo se načíst","recordings": "Nahrávky","noRecordingsFound": "Nebyly nalezeny žádné nahrávky. Zadejte cestu výše pro ruční načtení.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentace","menuGitHubRepository": "GitHub repozitář","menuReportIssue": "Nahlásit problém…",- "menuAbout": "O aplikaci SkellyCam",+ "menuAbout": "O aplikaci FreeMoCap","menuPlayback": "Přehrávání","videoPlayback": "Přehrávání","copyLogsToClipboard": "Kopírovat logy do schránky",diff --git a/freemocap-ui/src/i18n/locales/de-deutsch.json b/freemocap-ui/src/i18n/locales/de-deutsch.jsonindex bbe0b195..919a5c3a 100644--- a/freemocap-ui/src/i18n/locales/de-deutsch.json+++ b/freemocap-ui/src/i18n/locales/de-deutsch.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Willkommen bei SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Willkommen bei FreeMoCap","welcomeSubtitle": "Synchronisierte Videos aufnehmen und ansehen","sendAnonymousPings": "Anonyme Nutzungsdaten senden","footerWith": "mit",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Zeigt empfangene Bilder auf dem Bildschirm an.","displayTooltipLong": "Die Anzeige stellt die UI-Rendering-Leistung dar. Sie zeigt, wie schnell Ihr Display Frames empfängt und rendert. Leistungsprobleme hier beeinträchtigen nicht die Aufnahmequalität, können aber Ihre Fähigkeit beeinflussen, Kameras in Echtzeit zu überwachen.","statsSourceShort": "Anzeige rendert Bilder, Server erfasst Bilder.",- "statsSourceLong": "Der Server ist die tatsächliche Rate, mit der Frames von der Kamera gezogen/aufgezeichnet werden, während die Anzeige die Rate ist, mit der sie empfangen und gerendert werden. SkellyCam priorisiert die serverseitige Leistung für die Aufnahmequalität, daher sollte diese Zahl stabiler bleiben. Wenn die Anzeige-Framerate vom Server abweicht, deutet das darauf hin, dass Ihre Systemressourcen ausgelastet sind. Erwägen Sie, weniger Kameras zu verwenden oder Framerate/Auflösung zu verringern.",+ "statsSourceLong": "Der Server ist die tatsächliche Rate, mit der Frames von der Kamera gezogen/aufgezeichnet werden, während die Anzeige die Rate ist, mit der sie empfangen und gerendert werden. FreeMoCap priorisiert die serverseitige Leistung für die Aufnahmequalität, daher sollte diese Zahl stabiler bleiben. Wenn die Anzeige-Framerate vom Server abweicht, deutet das darauf hin, dass Ihre Systemressourcen ausgelastet sind. Erwägen Sie, weniger Kameras zu verwenden oder Framerate/Auflösung zu verringern.","statsCurrentShort": "Aktuellste Bildzeit und FPS.","statsCurrentLong": "Zeigt die neueste Messung der Verarbeitungszeit eines Einzelbilds (in Millisekunden) und die entsprechenden Frames pro Sekunde (FPS). Niedrigere Frame-Zeiten und höhere FPS weisen auf bessere Leistung hin.","statsMinShort": "Schnellste Bildzeit und höchste FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Die Standardabweichung misst die Streuung der Bildzeiten. Niedrigere Werte weisen auf konsistentere Leistung hin. Der Variationskoeffizient (CV%) drückt diese Variabilität als Prozentsatz des Mittelwerts aus, was den Vergleich der Stabilität über verschiedene Bildraten hinweg erleichtert. Niedrigerer CV% zeigt stabilere Leistung an.","aiTranslatedTooltip": "Diese Übersetzung wurde von KI erstellt und kann Fehler enthalten. Helfen Sie uns, sie zu verbessern!","humanValidatedTooltip": "Diese Übersetzung wurde von einem menschlichen Übersetzer überprüft.",- "helpTranslate": "Helfen Sie SkellyCam zu übersetzen",+ "helpTranslate": "Helfen Sie FreeMoCap zu übersetzen","failedToFetch": "Abruf fehlgeschlagen","recordings": "Aufnahmen","noRecordingsFound": "Keine Aufnahmen gefunden. Geben Sie oben einen Pfad ein, um manuell zu laden.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentation","menuGitHubRepository": "GitHub-Repository","menuReportIssue": "Problem melden…",- "menuAbout": "Über SkellyCam",+ "menuAbout": "Über FreeMoCap","menuPlayback": "Wiedergabe","videoPlayback": "Wiedergabe","copyLogsToClipboard": "Protokolle in Zwischenablage kopieren",diff --git a/freemocap-ui/src/i18n/locales/el-ellinika.json b/freemocap-ui/src/i18n/locales/el-ellinika.jsonindex 08bbb5f7..58364908 100644--- a/freemocap-ui/src/i18n/locales/el-ellinika.json+++ b/freemocap-ui/src/i18n/locales/el-ellinika.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Καλώς ήρθατε στο SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Καλώς ήρθατε στο FreeMoCap","welcomeSubtitle": "Εγγραφή και Προβολή Συγχρονισμένων Βίντεο","sendAnonymousPings": "Αποστολή ανώνυμων ping χρήσης","footerWith": "με",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Αποδίδει τα ληφθέντα καρέ στην οθόνη.","displayTooltipLong": "Η Οθόνη αντιπροσωπεύει την απόδοση rendering του UI. Δείχνει πόσο γρήγορα η οθόνη σας λαμβάνει και αποδίδει καρέ. Τα προβλήματα απόδοσης εδώ δεν θα επηρεάσουν την ποιότητα εγγραφής αλλά μπορεί να επηρεάσουν τη δυνατότητα παρακολούθησης καμερών σε πραγματικό χρόνο.","statsSourceShort": "Η Οθόνη αποδίδει καρέ, ο Διακομιστής λαμβάνει καρέ.",- "statsSourceLong": "Ο διακομιστής είναι ο πραγματικός ρυθμός με τον οποίο τα καρέ τραβιούνται/εγγράφονται από την κάμερα, ενώ η οθόνη είναι ο ρυθμός με τον οποίο λαμβάνονται και αποδίδονται. Το Skellycam δίνει προτεραιότητα στην απόδοση στο διακομιστή για ποιότητα εγγραφής, επομένως αυτός ο αριθμός θα πρέπει να παραμένει πιο σταθερός. Αν ο ρυθμός καρέ της οθόνης αποκλίνει από τον διακομιστή, δείχνει ότι οι πόροι του συστήματός σας είναι υπερφορτωμένοι. Σκεφτείτε να χρησιμοποιήσετε λιγότερες κάμερες ή να μειώσετε τον ρυθμό καρέ/ανάλυση.",+ "statsSourceLong": "Ο διακομιστής είναι ο πραγματικός ρυθμός με τον οποίο τα καρέ τραβιούνται/εγγράφονται από την κάμερα, ενώ η οθόνη είναι ο ρυθμός με τον οποίο λαμβάνονται και αποδίδονται. Το FreeMoCap δίνει προτεραιότητα στην απόδοση στο διακομιστή για ποιότητα εγγραφής, επομένως αυτός ο αριθμός θα πρέπει να παραμένει πιο σταθερός. Αν ο ρυθμός καρέ της οθόνης αποκλίνει από τον διακομιστή, δείχνει ότι οι πόροι του συστήματός σας είναι υπερφορτωμένοι. Σκεφτείτε να χρησιμοποιήσετε λιγότερες κάμερες ή να μειώσετε τον ρυθμό καρέ/ανάλυση.","statsCurrentShort": "Πιο πρόσφατος χρόνος καρέ και αντίστοιχο FPS.","statsCurrentLong": "Αυτό δείχνει την πιο πρόσφατη μέτρηση του χρόνου που χρειάζεται για την επεξεργασία ενός καρέ (σε χιλιοστά του δευτερολέπτου) και τα αντίστοιχα καρέ ανά δευτερόλεπτο (FPS). Χαμηλότεροι χρόνοι καρέ και υψηλότερο FPS υποδεικνύουν καλύτερη απόδοση.","statsMinShort": "Ταχύτερος χρόνος καρέ (χαμηλότερη καθυστέρηση) και υψηλότερο FPS που επιτεύχθηκε.",@@ -211,7 +211,7 @@"statsStdDevLong": "Η τυπική απόκλιση μετρά το ποσό της διακύμανσης στους χρόνους καρέ. Χαμηλότερες τιμές υποδεικνύουν πιο συνεπή απόδοση. Ο Συντελεστής Διακύμανσης (CV%) εκφράζει αυτή τη μεταβλητότητα ως ποσοστό του μέσου, διευκολύνοντας τη σύγκριση σταθερότητας μεταξύ διαφορετικών ρυθμών καρέ. Χαμηλότερο CV% υποδεικνύει πιο σταθερή απόδοση.","aiTranslatedTooltip": "Αυτή η μετάφραση δημιουργήθηκε από AI και μπορεί να περιέχει σφάλματα. Αν μιλάτε αυτή τη γλώσσα, μπορείτε να βοηθήσετε στη βελτίωσή της ανοίγοντας ένα pull request στο GitHub!","humanValidatedTooltip": "Αυτή η μετάφραση έχει ελεγχθεί και επικυρωθεί από ανθρώπινο μεταφραστή.",- "helpTranslate": "Βοηθήστε στη μετάφραση του SkellyCam",+ "helpTranslate": "Βοηθήστε στη μετάφραση του FreeMoCap","failedToFetch": "Αποτυχία ανάκτησης","recordings": "Εγγραφές","noRecordingsFound": "Δεν βρέθηκαν εγγραφές. Εισάγετε μια διαδρομή παραπάνω για χειροκίνητη φόρτωση.",@@ -239,7 +239,7 @@"menuDocumentation": "Τεκμηρίωση","menuGitHubRepository": "Αποθετήριο GitHub","menuReportIssue": "Αναφορά προβλήματος…",- "menuAbout": "Σχετικά με το SkellyCam",+ "menuAbout": "Σχετικά με το FreeMoCap","menuPlayback": "Αναπαραγωγή","videoPlayback": "Αναπαραγωγή","copyLogsToClipboard": "Αντιγραφή αρχείων καταγραφής στο πρόχειρο",diff --git a/freemocap-ui/src/i18n/locales/en-english.json b/freemocap-ui/src/i18n/locales/en-english.jsonindex 44777bd8..3d02b55a 100644--- a/freemocap-ui/src/i18n/locales/en-english.json+++ b/freemocap-ui/src/i18n/locales/en-english.json@@ -4,9 +4,9 @@"translationSource": "human-authored","lastUpdated": "2026-02-22"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Welcome to SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Welcome to FreeMoCap","welcomeSubtitle": "Record and View Synchronized Videos","sendAnonymousPings": "Send anonymous usage pings","footerWith": "w/",@@ -199,7 +199,7 @@"rendersReceivedFrames": "Renders received frames on screen.","displayTooltipLong": "Display represents the UI rendering performance. It shows how quickly your display receives and renders frames. Performance issues here won't affect recording quality but may impact your ability to monitor cameras in real-time.","statsSourceShort": "Display renders frames, Server captures frames.",- "statsSourceLong": "The server is the true rate at which frames are pulled/recorded from the camera, while display is the rate at which they are received and rendered. Skellycam prioritizes server-side performance for recording quality, so that number should stay more stable. If the display framerate diverges from the server, it indicates your system resources are taxed. Consider using fewer cameras or decreasing framerate/resolution.",+ "statsSourceLong": "The server is the true rate at which frames are pulled/recorded from the camera, while display is the rate at which they are received and rendered. FreeMoCap prioritizes server-side performance for recording quality, so that number should stay more stable. If the display framerate diverges from the server, it indicates your system resources are taxed. Consider using fewer cameras or decreasing framerate/resolution.","statsCurrentShort": "Most recent frame time and corresponding FPS.","statsCurrentLong": "This shows the most recent measurement of how long it takes to process a single frame (in milliseconds) and the equivalent frames per second (FPS). Lower frame times and higher FPS indicate better performance.","statsMinShort": "Fastest frame time (lowest latency) and highest FPS achieved.",@@ -214,7 +214,7 @@"statsStdDevLong": "Standard deviation measures the amount of variation in frame times. Lower values indicate more consistent performance. The Coefficient of Variation (CV%) expresses this variability as a percentage of the mean, making it easier to compare stability across different frame rates. Lower CV% indicates more stable performance.","aiTranslatedTooltip": "This translation was generated by AI and may contain errors. If you speak this language, you can help improve it by opening a pull request on GitHub!","humanValidatedTooltip": "This translation has been reviewed and validated by a human translator.",- "helpTranslate": "Help translate SkellyCam",+ "helpTranslate": "Help translate FreeMoCap","failedToFetch": "Failed to fetch","recordings": "Recordings","noRecordingsFound": "No recordings found. Enter a path above to load manually.",@@ -242,7 +242,7 @@"menuDocumentation": "Documentation","menuGitHubRepository": "GitHub Repository","menuReportIssue": "Report an Issue…",- "menuAbout": "About SkellyCam",+ "menuAbout": "About FreeMoCap","menuCheckForUpdates": "Check for Updates…","menuPlayback": "Playback","videoPlayback": "Playback",diff --git a/freemocap-ui/src/i18n/locales/es-espanol.json b/freemocap-ui/src/i18n/locales/es-espanol.jsonindex 9703f3c6..3b477f2e 100644--- a/freemocap-ui/src/i18n/locales/es-espanol.json+++ b/freemocap-ui/src/i18n/locales/es-espanol.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-22"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Bienvenido a SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Bienvenido a FreeMoCap","welcomeSubtitle": "Graba y visualiza videos sincronizados","sendAnonymousPings": "Enviar pings de uso anónimos","footerWith": "con",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Renderiza los cuadros recibidos en pantalla.","displayTooltipLong": "La pantalla representa el rendimiento de renderizado de la interfaz. Muestra la velocidad a la que tu pantalla recibe y renderiza los cuadros. Los problemas de rendimiento aquí no afectarán la calidad de la grabación, pero pueden afectar tu capacidad de monitorear las cámaras en tiempo real.","statsSourceShort": "Pantalla renderiza cuadros, Servidor captura cuadros.",- "statsSourceLong": "El servidor es la tasa real a la que se extraen/graban los cuadros de la cámara, mientras que la pantalla es la tasa a la que se reciben y renderizan. Skellycam prioriza el rendimiento del lado del servidor para la calidad de grabación, así que ese número debería mantenerse más estable. Si la velocidad de cuadros de la pantalla diverge del servidor, indica que los recursos del sistema están sobrecargados.",+ "statsSourceLong": "El servidor es la tasa real a la que se extraen/graban los cuadros de la cámara, mientras que la pantalla es la tasa a la que se reciben y renderizan. FreeMoCap prioriza el rendimiento del lado del servidor para la calidad de grabación, así que ese número debería mantenerse más estable. Si la velocidad de cuadros de la pantalla diverge del servidor, indica que los recursos del sistema están sobrecargados.","statsCurrentShort": "Tiempo de cuadro más reciente y FPS correspondiente.","statsCurrentLong": "Muestra la medición más reciente de cuánto tarda en procesar un solo cuadro (en milisegundos) y los cuadros por segundo (FPS) equivalentes. Tiempos de cuadro más bajos y FPS más altos indican mejor rendimiento.","statsMinShort": "Tiempo de cuadro más rápido (menor latencia) y FPS más alto alcanzado.",@@ -211,7 +211,7 @@"statsStdDevLong": "La desviación estándar mide la variación en los tiempos de cuadro. Valores más bajos indican un rendimiento más consistente. El Coeficiente de Variación (CV%) expresa esta variabilidad como porcentaje de la media, facilitando la comparación de estabilidad entre diferentes velocidades de cuadro.","aiTranslatedTooltip": "Esta traducción fue generada por IA y puede contener errores. Si hablas este idioma, ¡puedes ayudar a mejorarla abriendo un pull request en GitHub!","humanValidatedTooltip": "Esta traducción ha sido revisada y validada por un traductor humano.",- "helpTranslate": "Ayuda a traducir SkellyCam",+ "helpTranslate": "Ayuda a traducir FreeMoCap","failedToFetch": "Error al obtener datos","recordings": "Grabaciones","noRecordingsFound": "No se encontraron grabaciones. Ingrese una ruta arriba para cargar manualmente.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentación","menuGitHubRepository": "Repositorio de GitHub","menuReportIssue": "Reportar un problema…",- "menuAbout": "Acerca de SkellyCam",+ "menuAbout": "Acerca de FreeMoCap","menuPlayback": "Reproducción","videoPlayback": "Reproducción","copyLogsToClipboard": "Copiar registros al portapapeles",diff --git a/freemocap-ui/src/i18n/locales/fa-farsi.json b/freemocap-ui/src/i18n/locales/fa-farsi.jsonindex 3aa03467..6830b939 100644--- a/freemocap-ui/src/i18n/locales/fa-farsi.json+++ b/freemocap-ui/src/i18n/locales/fa-farsi.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "به SkellyCam خوش آمدید",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "به FreeMoCap خوش آمدید","welcomeSubtitle": "ضبط و مشاهده ویدیوهای همگامسازی شده","sendAnonymousPings": "ارسال دادههای استفاده ناشناس","footerWith": "با",@@ -196,7 +196,7 @@"rendersReceivedFrames": "فریمهای دریافتی را روی صفحه رندر میکند.","displayTooltipLong": "نمایش عملکرد رندر رابط کاربری را نشان میدهد. نشان میدهد نمایشگر شما چقدر سریع فریمها را دریافت و رندر میکند. مشکلات عملکردی در اینجا کیفیت ضبط را تحت تأثیر قرار نمیدهد اما ممکن است بر توانایی شما در نظارت بر دوربینها در زمان واقعی تأثیر بگذارد.","statsSourceShort": "نمایشگر فریمها را رندر میکند، سرور فریمها را ضبط میکند.",- "statsSourceLong": "سرور نرخ واقعی است که فریمها از دوربین کشیده/ضبط میشوند، در حالی که نمایش نرخ دریافت و رندر آنهاست. SkellyCam عملکرد سمت سرور را برای کیفیت ضبط اولویت میدهد، بنابراین این عدد باید پایدارتر بماند. اگر نرخ فریم نمایش از سرور منحرف شود، نشاندهنده فشار بر منابع سیستم شماست. استفاده از دوربینهای کمتر یا کاهش نرخ فریم/وضوح را در نظر بگیرید.",+ "statsSourceLong": "سرور نرخ واقعی است که فریمها از دوربین کشیده/ضبط میشوند، در حالی که نمایش نرخ دریافت و رندر آنهاست. FreeMoCap عملکرد سمت سرور را برای کیفیت ضبط اولویت میدهد، بنابراین این عدد باید پایدارتر بماند. اگر نرخ فریم نمایش از سرور منحرف شود، نشاندهنده فشار بر منابع سیستم شماست. استفاده از دوربینهای کمتر یا کاهش نرخ فریم/وضوح را در نظر بگیرید.","statsCurrentShort": "آخرین زمان فریم و FPS.","statsCurrentLong": "این آخرین اندازهگیری مدت زمان پردازش یک فریم (به میلیثانیه) و معادل فریم در ثانیه (FPS) را نشان میدهد. زمان فریم کمتر و FPS بالاتر نشاندهنده عملکرد بهتر است.","statsMinShort": "سریعترین زمان فریم و بالاترین FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "انحراف معیار میزان تغییرات در زمانهای فریم را اندازهگیری میکند. مقادیر کمتر نشاندهنده عملکرد سازگارتر است. ضریب تغییرات (CV%) این تغییرپذیری را به صورت درصدی از میانگین بیان میکند، که مقایسه پایداری در نرخهای فریم مختلف را آسانتر میکند. CV% کمتر نشاندهنده عملکرد پایدارتر است.","aiTranslatedTooltip": "این ترجمه توسط هوش مصنوعی تولید شده و ممکن است خطاهایی داشته باشد. اگر این زبان را صحبت میکنید، به بهبود آن کمک کنید!","humanValidatedTooltip": "این ترجمه توسط مترجم انسانی بررسی شده است.",- "helpTranslate": "به ترجمه SkellyCam کمک کنید",+ "helpTranslate": "به ترجمه FreeMoCap کمک کنید","failedToFetch": "دریافت ناموفق","recordings": "ضبطها","noRecordingsFound": "هیچ ضبطی یافت نشد. برای بارگذاری دستی، مسیری در بالا وارد کنید.",@@ -239,7 +239,7 @@"menuDocumentation": "مستندات","menuGitHubRepository": "مخزن GitHub","menuReportIssue": "گزارش مشکل…",- "menuAbout": "درباره SkellyCam",+ "menuAbout": "درباره FreeMoCap","menuPlayback": "پخش","videoPlayback": "پخش","copyLogsToClipboard": "کپی گزارشها در کلیپبورد",diff --git a/freemocap-ui/src/i18n/locales/fr-francais.json b/freemocap-ui/src/i18n/locales/fr-francais.jsonindex 90765405..b265778e 100644--- a/freemocap-ui/src/i18n/locales/fr-francais.json+++ b/freemocap-ui/src/i18n/locales/fr-francais.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Bienvenue sur SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Bienvenue sur FreeMoCap","welcomeSubtitle": "Enregistrez et visionnez des vidéos synchronisées","sendAnonymousPings": "Envoyer des données d'utilisation anonymes","footerWith": "avec",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Affiche les images reçues à l'écran.","displayTooltipLong": "L'affichage représente les performances de rendu de l'interface utilisateur. Il montre la rapidité avec laquelle votre écran reçoit et affiche les images. Les problèmes de performances ici n'affecteront pas la qualité d'enregistrement mais peuvent impacter votre capacité à surveiller les caméras en temps réel.","statsSourceShort": "L'affichage rend les images, le serveur les capture.",- "statsSourceLong": "Le serveur est le taux réel auquel les images sont extraites/enregistrées depuis la caméra, tandis que l'affichage est le taux auquel elles sont reçues et rendues. SkellyCam priorise les performances côté serveur pour la qualité d'enregistrement, donc ce nombre devrait rester plus stable. Si la fréquence d'images de l'affichage diverge du serveur, cela indique que les ressources de votre système sont sollicitées. Envisagez d'utiliser moins de caméras ou de réduire la fréquence d'images/résolution.",+ "statsSourceLong": "Le serveur est le taux réel auquel les images sont extraites/enregistrées depuis la caméra, tandis que l'affichage est le taux auquel elles sont reçues et rendues. FreeMoCap priorise les performances côté serveur pour la qualité d'enregistrement, donc ce nombre devrait rester plus stable. Si la fréquence d'images de l'affichage diverge du serveur, cela indique que les ressources de votre système sont sollicitées. Envisagez d'utiliser moins de caméras ou de réduire la fréquence d'images/résolution.","statsCurrentShort": "Temps d'image et FPS les plus récents.","statsCurrentLong": "Affiche la mesure la plus récente du temps de traitement d'une image (en millisecondes) et les images par seconde (FPS) correspondantes. Des temps d'image plus bas et des FPS plus élevés indiquent de meilleures performances.","statsMinShort": "Temps d'image le plus rapide et FPS le plus élevé.",@@ -211,7 +211,7 @@"statsStdDevLong": "L'écart-type mesure la variation des temps d'image. Des valeurs plus basses indiquent des performances plus régulières. Le coefficient de variation (CV%) exprime cette variabilité en pourcentage de la moyenne, facilitant la comparaison de la stabilité entre différentes fréquences d'images. Un CV% plus bas indique des performances plus stables.","aiTranslatedTooltip": "Cette traduction a été générée par IA et peut contenir des erreurs. Si vous parlez cette langue, aidez-nous à l'améliorer !","humanValidatedTooltip": "Cette traduction a été vérifiée par un traducteur humain.",- "helpTranslate": "Aider à traduire SkellyCam",+ "helpTranslate": "Aider à traduire FreeMoCap","failedToFetch": "Échec de la récupération","recordings": "Enregistrements","noRecordingsFound": "Aucun enregistrement trouvé. Entrez un chemin ci-dessus pour charger manuellement.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentation","menuGitHubRepository": "Dépôt GitHub","menuReportIssue": "Signaler un problème…",- "menuAbout": "À propos de SkellyCam",+ "menuAbout": "À propos de FreeMoCap","menuPlayback": "Lecture","videoPlayback": "Lecture","copyLogsToClipboard": "Copier les journaux dans le presse-papiers",diff --git a/freemocap-ui/src/i18n/locales/hi-hindi.json b/freemocap-ui/src/i18n/locales/hi-hindi.jsonindex 93a03c2c..43862d79 100644--- a/freemocap-ui/src/i18n/locales/hi-hindi.json+++ b/freemocap-ui/src/i18n/locales/hi-hindi.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam में आपका स्वागत है",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap में आपका स्वागत है","welcomeSubtitle": "सिंक्रनाइज़्ड वीडियो रिकॉर्ड और देखें","sendAnonymousPings": "गुमनाम उपयोग डेटा भेजें","footerWith": "साथ",@@ -196,7 +196,7 @@"rendersReceivedFrames": "प्राप्त फ्रेम स्क्रीन पर रेंडर करता है।","displayTooltipLong": "डिस्प्ले UI रेंडरिंग प्रदर्शन दर्शाता है। यह दिखाता है कि आपका डिस्प्ले कितनी तेज़ी से फ्रेम प्राप्त करता और रेंडर करता है। यहाँ प्रदर्शन समस्याएँ रिकॉर्डिंग गुणवत्ता को प्रभावित नहीं करेंगी लेकिन रियल-टाइम में कैमरों की निगरानी करने की आपकी क्षमता को प्रभावित कर सकती हैं।","statsSourceShort": "डिस्प्ले फ्रेम रेंडर करता है, सर्वर फ्रेम कैप्चर करता है।",- "statsSourceLong": "सर्वर वह वास्तविक दर है जिस पर कैमरे से फ्रेम खींचे/रिकॉर्ड किए जाते हैं, जबकि डिस्प्ले वह दर है जिस पर उन्हें प्राप्त और रेंडर किया जाता है। SkellyCam रिकॉर्डिंग गुणवत्ता के लिए सर्वर-साइड प्रदर्शन को प्राथमिकता देता है, इसलिए वह संख्या अधिक स्थिर रहनी चाहिए। यदि डिस्प्ले फ्रेमरेट सर्वर से भिन्न होता है, तो यह इंगित करता है कि आपके सिस्टम संसाधन तनाव में हैं। कम कैमरे उपयोग करने या फ्रेमरेट/रेज़ोल्यूशन कम करने पर विचार करें।",+ "statsSourceLong": "सर्वर वह वास्तविक दर है जिस पर कैमरे से फ्रेम खींचे/रिकॉर्ड किए जाते हैं, जबकि डिस्प्ले वह दर है जिस पर उन्हें प्राप्त और रेंडर किया जाता है। FreeMoCap रिकॉर्डिंग गुणवत्ता के लिए सर्वर-साइड प्रदर्शन को प्राथमिकता देता है, इसलिए वह संख्या अधिक स्थिर रहनी चाहिए। यदि डिस्प्ले फ्रेमरेट सर्वर से भिन्न होता है, तो यह इंगित करता है कि आपके सिस्टम संसाधन तनाव में हैं। कम कैमरे उपयोग करने या फ्रेमरेट/रेज़ोल्यूशन कम करने पर विचार करें।","statsCurrentShort": "सबसे हालिया फ्रेम समय और FPS।","statsCurrentLong": "यह एक एकल फ्रेम को संसाधित करने में लगने वाले समय (मिलीसेकंड में) और समकक्ष प्रति सेकंड फ्रेम (FPS) का सबसे हालिया माप दिखाता है। कम फ्रेम समय और अधिक FPS बेहतर प्रदर्शन इंगित करता है।","statsMinShort": "सबसे तेज़ फ्रेम समय और उच्चतम FPS।",@@ -211,7 +211,7 @@"statsStdDevLong": "मानक विचलन फ्रेम समय में भिन्नता की मात्रा मापता है। कम मान अधिक सुसंगत प्रदर्शन इंगित करते हैं। परिवर्तन गुणांक (CV%) इस परिवर्तनशीलता को माध्य के प्रतिशत के रूप में व्यक्त करता है, जो विभिन्न फ्रेम दरों में स्थिरता की तुलना को आसान बनाता है। कम CV% अधिक स्थिर प्रदर्शन इंगित करता है।","aiTranslatedTooltip": "यह अनुवाद AI द्वारा बनाया गया है और इसमें त्रुटियां हो सकती हैं। यदि आप यह भाषा बोलते हैं, तो कृपया इसे सुधारने में मदद करें!","humanValidatedTooltip": "इस अनुवाद की मानव अनुवादक द्वारा समीक्षा की गई है।",- "helpTranslate": "SkellyCam का अनुवाद करने में मदद करें",+ "helpTranslate": "FreeMoCap का अनुवाद करने में मदद करें","failedToFetch": "डेटा प्राप्त करने में विफल","recordings": "रिकॉर्डिंग","noRecordingsFound": "कोई रिकॉर्डिंग नहीं मिली। मैन्युअल रूप से लोड करने के लिए ऊपर पथ दर्ज करें।",@@ -239,7 +239,7 @@"menuDocumentation": "दस्तावेज़ीकरण","menuGitHubRepository": "GitHub रिपॉजिटरी","menuReportIssue": "समस्या रिपोर्ट करें…",- "menuAbout": "SkellyCam के बारे में",+ "menuAbout": "FreeMoCap के बारे में","menuPlayback": "प्लेबैक","videoPlayback": "प्लेबैक","copyLogsToClipboard": "लॉग क्लिपबोर्ड पर कॉपी करें",diff --git a/freemocap-ui/src/i18n/locales/hr-hrvatski.json b/freemocap-ui/src/i18n/locales/hr-hrvatski.jsonindex 19045423..17a221bc 100644--- a/freemocap-ui/src/i18n/locales/hr-hrvatski.json+++ b/freemocap-ui/src/i18n/locales/hr-hrvatski.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Dobrodošli u SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Dobrodošli u FreeMoCap","welcomeSubtitle": "Snimajte i gledajte sinkronizirane videozapise","sendAnonymousPings": "Šalji anonimne pingove korištenja","footerWith": "s",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Prikazuje primljene kadrove na zaslonu.","displayTooltipLong": "Zaslon predstavlja performanse renderiranja korisničkog sučelja. Pokazuje koliko brzo vaš zaslon prima i prikazuje kadrove. Problemi s performansama ovdje neće utjecati na kvalitetu snimanja, ali mogu utjecati na vašu sposobnost praćenja kamera u stvarnom vremenu.","statsSourceShort": "Zaslon prikazuje kadrove, Poslužitelj snima kadrove.",- "statsSourceLong": "Poslužitelj je stvarna brzina kojom se kadrovi povlače/snimaju s kamere, dok je zaslon brzina kojom se primaju i prikazuju. Skellycam daje prioritet performansama na strani poslužitelja za kvalitetu snimanja, tako da bi taj broj trebao ostati stabilniji. Ako se brzina kadrova zaslona razlikuje od poslužitelja, to ukazuje da su resursi vašeg sustava preopterećeni. Razmislite o korištenju manje kamera ili smanjenju brzine kadrova/rezolucije.",+ "statsSourceLong": "Poslužitelj je stvarna brzina kojom se kadrovi povlače/snimaju s kamere, dok je zaslon brzina kojom se primaju i prikazuju. FreeMoCap daje prioritet performansama na strani poslužitelja za kvalitetu snimanja, tako da bi taj broj trebao ostati stabilniji. Ako se brzina kadrova zaslona razlikuje od poslužitelja, to ukazuje da su resursi vašeg sustava preopterećeni. Razmislite o korištenju manje kamera ili smanjenju brzine kadrova/rezolucije.","statsCurrentShort": "Najnovije vrijeme kadra i odgovarajući FPS.","statsCurrentLong": "Ovo prikazuje najnovije mjerenje koliko vremena treba za obradu jednog kadra (u milisekundama) i ekvivalentne kadrove u sekundi (FPS). Manje vrijeme kadra i veći FPS ukazuju na bolje performanse.","statsMinShort": "Najbrže vrijeme kadra (najmanje kašnjenje) i najveći postignuti FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Standardna devijacija mjeri količinu varijacije u vremenima kadrova. Niže vrijednosti ukazuju na konzistentnije performanse. Koeficijent varijacije (CV%) izražava ovu varijabilnost kao postotak srednje vrijednosti, olakšavajući usporedbu stabilnosti na različitim brzinama kadrova. Niži CV% ukazuje na stabilnije performanse.","aiTranslatedTooltip": "Ovaj prijevod je generiran pomoću umjetne inteligencije i može sadržavati pogreške. Ako govorite ovaj jezik, možete pomoći u poboljšanju otvaranjem pull requesta na GitHubu!","humanValidatedTooltip": "Ovaj prijevod je pregledao i potvrdio ljudski prevoditelj.",- "helpTranslate": "Pomozite prevesti SkellyCam",+ "helpTranslate": "Pomozite prevesti FreeMoCap","failedToFetch": "Preuzimanje neuspješno","recordings": "Snimke","noRecordingsFound": "Nema pronađenih snimaka. Unesite putanju iznad za ručno učitavanje.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentacija","menuGitHubRepository": "GitHub repozitorij","menuReportIssue": "Prijavi problem…",- "menuAbout": "O SkellyCam-u",+ "menuAbout": "O FreeMoCap-u","menuPlayback": "Reprodukcija","videoPlayback": "Reprodukcija","copyLogsToClipboard": "Kopiraj zapise u međuspremnik",diff --git a/freemocap-ui/src/i18n/locales/hu-magyar.json b/freemocap-ui/src/i18n/locales/hu-magyar.jsonindex 87ce7375..db07ca5b 100644--- a/freemocap-ui/src/i18n/locales/hu-magyar.json+++ b/freemocap-ui/src/i18n/locales/hu-magyar.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Üdvözöljük a SkellyCam-ben",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Üdvözöljük a FreeMoCap-ben","welcomeSubtitle": "Szinkronizált Videók Rögzítése és Megtekintése","sendAnonymousPings": "Anonim használati pingek küldése","footerWith": "a",@@ -196,7 +196,7 @@"rendersReceivedFrames": "A fogadott képkockákat jeleníti meg a képernyőn.","displayTooltipLong": "A Kijelző a UI renderelési teljesítményt képviseli. Megmutatja, milyen gyorsan fogadja és jeleníti meg a kijelző a képkockákat. Az itt felmerülő teljesítményproblémák nem befolyásolják a felvétel minőségét, de hatással lehetnek a kamerák valós idejű megfigyelésére.","statsSourceShort": "A Kijelző megjeleníti a képkockákat, a Szerver rögzíti a képkockákat.",- "statsSourceLong": "A szerver az a valós sebesség, amellyel a képkockák húzódnak/rögzítődnek a kamerából, míg a kijelző az a sebesség, amellyel fogadja és megjeleníti őket. A Skellycam a szerver oldali teljesítményt helyezi előtérbe a felvétel minősége érdekében, ezért annak a számnak stabilabbnak kell maradnia. Ha a kijelző képkockasebessége eltér a szerverétől, az a rendszer erőforrásainak túlterheltségét jelzi. Fontolja meg kevesebb kamera használatát vagy a képkockasebesség/felbontás csökkentését.",+ "statsSourceLong": "A szerver az a valós sebesség, amellyel a képkockák húzódnak/rögzítődnek a kamerából, míg a kijelző az a sebesség, amellyel fogadja és megjeleníti őket. A FreeMoCap a szerver oldali teljesítményt helyezi előtérbe a felvétel minősége érdekében, ezért annak a számnak stabilabbnak kell maradnia. Ha a kijelző képkockasebessége eltér a szerverétől, az a rendszer erőforrásainak túlterheltségét jelzi. Fontolja meg kevesebb kamera használatát vagy a képkockasebesség/felbontás csökkentését.","statsCurrentShort": "Legutóbbi képkocka idő és megfelelő FPS.","statsCurrentLong": "Ez a legutóbbi mérést mutatja arról, mennyi ideig tart egy képkocka feldolgozása (ezredmásodpercben) és az egyenértékű képkocka/másodperc (FPS). Alacsonyabb képkocka idő és magasabb FPS jobb teljesítményt jelent.","statsMinShort": "Leggyorsabb képkocka idő (legalacsonyabb késleltetés) és legmagasabb elért FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "A szórás a képkocka időkben lévő variáció mértékét méri. Az alacsonyabb értékek konzisztensebb teljesítményt jeleznek. A Variációs Együttható (CV%) ezt a változékonyságot az átlag százalékában fejezi ki, megkönnyítve a stabilitás összehasonlítását különböző képkockasebességek között. Az alacsonyabb CV% stabilabb teljesítményt jelez.","aiTranslatedTooltip": "Ezt a fordítást AI generálta és hibákat tartalmazhat. Ha beszéli ezt a nyelvet, segíthet a javításában egy pull request megnyitásával a GitHubon!","humanValidatedTooltip": "Ezt a fordítást ember fordító ellenőrizte és jóváhagyta.",- "helpTranslate": "Segítsen a SkellyCam fordításában",+ "helpTranslate": "Segítsen a FreeMoCap fordításában","failedToFetch": "Lekérés sikertelen","recordings": "Felvételek","noRecordingsFound": "Nem találhatók felvételek. Adjon meg egy elérési utat fent a kézi betöltéshez.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentáció","menuGitHubRepository": "GitHub tárház","menuReportIssue": "Hiba bejelentése…",- "menuAbout": "A SkellyCam-ról",+ "menuAbout": "A FreeMoCap-ról","menuPlayback": "Lejátszás","videoPlayback": "Lejátszás","copyLogsToClipboard": "Naplók másolása a vágólapra",diff --git a/freemocap-ui/src/i18n/locales/id-bahasa-indonesia.json b/freemocap-ui/src/i18n/locales/id-bahasa-indonesia.jsonindex 4a881e93..41c9d102 100644--- a/freemocap-ui/src/i18n/locales/id-bahasa-indonesia.json+++ b/freemocap-ui/src/i18n/locales/id-bahasa-indonesia.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Selamat datang di SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Selamat datang di FreeMoCap","welcomeSubtitle": "Rekam dan lihat video tersinkronisasi","sendAnonymousPings": "Kirim data penggunaan anonim","footerWith": "dengan",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Merender frame yang diterima di layar.","displayTooltipLong": "Tampilan merepresentasikan kinerja rendering antarmuka pengguna. Ini menunjukkan seberapa cepat layar Anda menerima dan merender frame. Masalah kinerja di sini tidak akan memengaruhi kualitas rekaman tetapi dapat memengaruhi kemampuan Anda untuk memantau kamera secara real-time.","statsSourceShort": "Display merender frame, server menangkap frame.",- "statsSourceLong": "Server adalah kecepatan nyata frame ditarik/direkam dari kamera, sedangkan tampilan adalah kecepatan penerimaan dan rendering. SkellyCam memprioritaskan kinerja sisi server untuk kualitas rekaman, sehingga angka tersebut seharusnya lebih stabil. Jika framerate tampilan menyimpang dari server, ini menunjukkan sumber daya sistem Anda sedang terbebani. Pertimbangkan untuk menggunakan lebih sedikit kamera atau menurunkan framerate/resolusi.",+ "statsSourceLong": "Server adalah kecepatan nyata frame ditarik/direkam dari kamera, sedangkan tampilan adalah kecepatan penerimaan dan rendering. FreeMoCap memprioritaskan kinerja sisi server untuk kualitas rekaman, sehingga angka tersebut seharusnya lebih stabil. Jika framerate tampilan menyimpang dari server, ini menunjukkan sumber daya sistem Anda sedang terbebani. Pertimbangkan untuk menggunakan lebih sedikit kamera atau menurunkan framerate/resolusi.","statsCurrentShort": "Waktu frame dan FPS terbaru.","statsCurrentLong": "Ini menunjukkan pengukuran terbaru berapa lama waktu yang dibutuhkan untuk memproses satu frame (dalam milidetik) dan frame per detik (FPS) yang setara. Waktu frame lebih rendah dan FPS lebih tinggi menunjukkan kinerja yang lebih baik.","statsMinShort": "Waktu frame tercepat dan FPS tertinggi.",@@ -211,7 +211,7 @@"statsStdDevLong": "Deviasi standar mengukur jumlah variasi dalam waktu frame. Nilai lebih rendah menunjukkan kinerja yang lebih konsisten. Koefisien Variasi (CV%) menyatakan variabilitas ini sebagai persentase dari rata-rata, memudahkan perbandingan stabilitas di berbagai frame rate. CV% lebih rendah menunjukkan kinerja yang lebih stabil.","aiTranslatedTooltip": "Terjemahan ini dibuat oleh AI dan mungkin mengandung kesalahan. Jika Anda berbicara bahasa ini, bantu perbaiki!","humanValidatedTooltip": "Terjemahan ini telah diverifikasi oleh penerjemah manusia.",- "helpTranslate": "Bantu terjemahkan SkellyCam",+ "helpTranslate": "Bantu terjemahkan FreeMoCap","failedToFetch": "Gagal mengambil data","recordings": "Rekaman","noRecordingsFound": "Tidak ada rekaman ditemukan. Masukkan jalur di atas untuk memuat secara manual.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentasi","menuGitHubRepository": "Repositori GitHub","menuReportIssue": "Laporkan masalah…",- "menuAbout": "Tentang SkellyCam",+ "menuAbout": "Tentang FreeMoCap","menuPlayback": "Pemutaran","videoPlayback": "Pemutaran","copyLogsToClipboard": "Salin log ke papan klip",diff --git a/freemocap-ui/src/i18n/locales/it-italiano.json b/freemocap-ui/src/i18n/locales/it-italiano.jsonindex cb3a92b1..85ff757c 100644--- a/freemocap-ui/src/i18n/locales/it-italiano.json+++ b/freemocap-ui/src/i18n/locales/it-italiano.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Benvenuto in SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Benvenuto in FreeMoCap","welcomeSubtitle": "Registra e visualizza video sincronizzati","sendAnonymousPings": "Invia dati di utilizzo anonimi","footerWith": "con",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Renderizza i fotogrammi ricevuti sullo schermo.","displayTooltipLong": "Il display rappresenta le prestazioni di rendering dell'interfaccia utente. Mostra quanto velocemente il display riceve e renderizza i fotogrammi. Problemi di prestazioni qui non influenzeranno la qualità della registrazione ma possono influire sulla capacità di monitorare le telecamere in tempo reale.","statsSourceShort": "Il display renderizza, il server cattura i fotogrammi.",- "statsSourceLong": "Il server è la velocità reale con cui i fotogrammi vengono estratti/registrati dalla telecamera, mentre il display è la velocità con cui vengono ricevuti e renderizzati. SkellyCam dà priorità alle prestazioni lato server per la qualità della registrazione, quindi quel numero dovrebbe rimanere più stabile. Se il framerate del display diverge dal server, indica che le risorse del sistema sono sovraccaricate. Considera l'uso di meno telecamere o la riduzione di framerate/risoluzione.",+ "statsSourceLong": "Il server è la velocità reale con cui i fotogrammi vengono estratti/registrati dalla telecamera, mentre il display è la velocità con cui vengono ricevuti e renderizzati. FreeMoCap dà priorità alle prestazioni lato server per la qualità della registrazione, quindi quel numero dovrebbe rimanere più stabile. Se il framerate del display diverge dal server, indica che le risorse del sistema sono sovraccaricate. Considera l'uso di meno telecamere o la riduzione di framerate/risoluzione.","statsCurrentShort": "Tempo fotogramma e FPS più recenti.","statsCurrentLong": "Mostra la misurazione più recente del tempo di elaborazione di un singolo fotogramma (in millisecondi) e i fotogrammi al secondo (FPS) equivalenti. Tempi fotogramma più bassi e FPS più alti indicano prestazioni migliori.","statsMinShort": "Tempo fotogramma più veloce e FPS più alto.",@@ -211,7 +211,7 @@"statsStdDevLong": "La deviazione standard misura la variazione nei tempi fotogramma. Valori più bassi indicano prestazioni più consistenti. Il Coefficiente di Variazione (CV%) esprime questa variabilità come percentuale della media, facilitando il confronto della stabilità tra diversi frame rate. Un CV% più basso indica prestazioni più stabili.","aiTranslatedTooltip": "Questa traduzione è stata generata dall'IA e potrebbe contenere errori. Se parli questa lingua, aiutaci a migliorarla!","humanValidatedTooltip": "Questa traduzione è stata verificata da un traduttore umano.",- "helpTranslate": "Aiuta a tradurre SkellyCam",+ "helpTranslate": "Aiuta a tradurre FreeMoCap","failedToFetch": "Recupero non riuscito","recordings": "Registrazioni","noRecordingsFound": "Nessuna registrazione trovata. Inserisci un percorso sopra per caricare manualmente.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentazione","menuGitHubRepository": "Repository GitHub","menuReportIssue": "Segnala un problema…",- "menuAbout": "Informazioni su SkellyCam",+ "menuAbout": "Informazioni su FreeMoCap","menuPlayback": "Riproduzione","videoPlayback": "Riproduzione","copyLogsToClipboard": "Copia i log negli appunti",diff --git a/freemocap-ui/src/i18n/locales/ja-nihongo.json b/freemocap-ui/src/i18n/locales/ja-nihongo.jsonindex 446f7570..b83fba56 100644--- a/freemocap-ui/src/i18n/locales/ja-nihongo.json+++ b/freemocap-ui/src/i18n/locales/ja-nihongo.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCamへようこそ",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCapへようこそ","welcomeSubtitle": "同期ビデオの録画と再生","sendAnonymousPings": "匿名使用データを送信","footerWith": "で",@@ -196,7 +196,7 @@"rendersReceivedFrames": "受信フレームを画面にレンダリング。","displayTooltipLong": "ディスプレイはUIレンダリング性能を表します。ディスプレイがフレームを受信しレンダリングする速度を示します。ここでのパフォーマンス問題は録画品質に影響しませんが、リアルタイムでカメラを監視する能力に影響する可能性があります。","statsSourceShort": "ディスプレイはフレームをレンダリング、サーバーはフレームをキャプチャ。",- "statsSourceLong": "サーバーはカメラからフレームが取得/録画される実際のレートであり、ディスプレイはフレームが受信・レンダリングされるレートです。SkellyCamは録画品質のためにサーバー側のパフォーマンスを優先するため、その数値はより安定しているはずです。ディスプレイのフレームレートがサーバーと乖離する場合、システムリソースが逼迫していることを示します。カメラの数を減らすか、フレームレート/解像度を下げることを検討してください。",+ "statsSourceLong": "サーバーはカメラからフレームが取得/録画される実際のレートであり、ディスプレイはフレームが受信・レンダリングされるレートです。FreeMoCapは録画品質のためにサーバー側のパフォーマンスを優先するため、その数値はより安定しているはずです。ディスプレイのフレームレートがサーバーと乖離する場合、システムリソースが逼迫していることを示します。カメラの数を減らすか、フレームレート/解像度を下げることを検討してください。","statsCurrentShort": "最新のフレーム時間とFPS。","statsCurrentLong": "単一フレームの処理にかかる時間(ミリ秒)と、それに相当する毎秒フレーム数(FPS)の最新の測定値を表示します。フレーム時間が短く、FPSが高いほど、パフォーマンスが良いことを示します。","statsMinShort": "最速フレーム時間と最高FPS。",@@ -211,7 +211,7 @@"statsStdDevLong": "標準偏差はフレーム時間のばらつきの量を測定します。低い値はより一貫したパフォーマンスを示します。変動係数(CV%)はこのばらつきを平均の割合として表し、異なるフレームレート間での安定性の比較を容易にします。低いCV%はより安定したパフォーマンスを示します。","aiTranslatedTooltip": "この翻訳はAIによって生成されたもので、誤りを含む可能性があります。この言語を話す方は改善にご協力ください!","humanValidatedTooltip": "この翻訳は人間の翻訳者によって確認されています。",- "helpTranslate": "SkellyCamの翻訳を手伝う",+ "helpTranslate": "FreeMoCapの翻訳を手伝う","failedToFetch": "取得に失敗","recordings": "録画","noRecordingsFound": "録画が見つかりません。上にパスを入力して手動で読み込んでください。",@@ -239,7 +239,7 @@"menuDocumentation": "ドキュメント","menuGitHubRepository": "GitHubリポジトリ","menuReportIssue": "問題を報告…",- "menuAbout": "SkellyCamについて",+ "menuAbout": "FreeMoCapについて","menuPlayback": "再生","videoPlayback": "再生","copyLogsToClipboard": "ログをクリップボードにコピー",diff --git a/freemocap-ui/src/i18n/locales/ka-kartuli.json b/freemocap-ui/src/i18n/locales/ka-kartuli.jsonindex 3bdb2210..e558c6f8 100644--- a/freemocap-ui/src/i18n/locales/ka-kartuli.json+++ b/freemocap-ui/src/i18n/locales/ka-kartuli.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "კეთილი იყოს თქვენი მობრძანება SkellyCam-ში",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "კეთილი იყოს თქვენი მობრძანება FreeMoCap-ში","welcomeSubtitle": "ჩაწერეთ და ნახეთ სინქრონიზებული ვიდეოები","sendAnonymousPings": "ანონიმური გამოყენების პინგების გაგზავნა","footerWith": "თან",@@ -196,7 +196,7 @@"rendersReceivedFrames": "მიღებულ კადრებს ეკრანზე აჩვენებს.","displayTooltipLong": "ეკრანი წარმოადგენს UI-ს რენდერინგის წარმადობას. აჩვენებს რამდენად სწრაფად იღებს და აჩვენებს თქვენი ეკრანი კადრებს. წარმადობის პრობლემები აქ არ იმოქმედებს ჩაწერის ხარისხზე, მაგრამ შეიძლება გავლენა იქონიოს კამერების რეალურ დროში მონიტორინგზე.","statsSourceShort": "ეკრანი კადრებს აჩვენებს, სერვერი კადრებს იღებს.",- "statsSourceLong": "სერვერი არის რეალური სიჩქარე, რომლითაც კადრები მიიღება/იწერება კამერიდან, ხოლო ეკრანი არის სიჩქარე, რომლითაც ისინი მიიღება და ნაჩვენებია. Skellycam პრიორიტეტს ანიჭებს სერვერის მხარის წარმადობას ჩაწერის ხარისხისთვის, ამიტომ ეს რიცხვი უფრო სტაბილური უნდა იყოს. თუ ეკრანის კადრთა სიხშირე სერვერისგან განსხვავდება, ეს მიუთითებს რომ თქვენი სისტემის რესურსები გადატვირთულია. განიხილეთ ნაკლები კამერის გამოყენება ან კადრთა სიხშირის/გარჩევადობის შემცირება.",+ "statsSourceLong": "სერვერი არის რეალური სიჩქარე, რომლითაც კადრები მიიღება/იწერება კამერიდან, ხოლო ეკრანი არის სიჩქარე, რომლითაც ისინი მიიღება და ნაჩვენებია. FreeMoCap პრიორიტეტს ანიჭებს სერვერის მხარის წარმადობას ჩაწერის ხარისხისთვის, ამიტომ ეს რიცხვი უფრო სტაბილური უნდა იყოს. თუ ეკრანის კადრთა სიხშირე სერვერისგან განსხვავდება, ეს მიუთითებს რომ თქვენი სისტემის რესურსები გადატვირთულია. განიხილეთ ნაკლები კამერის გამოყენება ან კადრთა სიხშირის/გარჩევადობის შემცირება.","statsCurrentShort": "უახლესი კადრის დრო და შესაბამისი FPS.","statsCurrentLong": "აჩვენებს უახლეს გაზომვას თუ რამდენი დრო სჭირდება ერთი კადრის დამუშავებას (მილიწამებში) და ექვივალენტურ FPS-ს. უფრო დაბალი კადრის დრო და უფრო მაღალი FPS უკეთეს წარმადობას მიუთითებს.","statsMinShort": "ყველაზე სწრაფი კადრის დრო (ყველაზე დაბალი შეფერხება) და მიღწეული უმაღლესი FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "სტანდარტული გადახრა ზომავს კადრის დროებში ვარიაციის ოდენობას. უფრო დაბალი მნიშვნელობები უფრო თანმიმდევრულ წარმადობას მიუთითებს. ვარიაციის კოეფიციენტი (CV%) ამ ცვალებადობას საშუალოს პროცენტულად გამოხატავს, რაც ადვილებს სტაბილურობის შედარებას სხვადასხვა კადრთა სიხშირეებს შორის. უფრო დაბალი CV% უფრო სტაბილურ წარმადობას მიუთითებს.","aiTranslatedTooltip": "ეს თარგმანი AI-ით არის გენერირებული და შეიძლება შეცდომები შეიცავდეს. თუ ამ ენაზე ლაპარაკობთ, შეგიძლიათ დაეხმაროთ გაუმჯობესებაში GitHub-ზე pull request-ის გახსნით!","humanValidatedTooltip": "ეს თარგმანი ადამიანი მთარგმნელის მიერ არის განხილული და შემოწმებული.",- "helpTranslate": "დაეხმარეთ SkellyCam-ის თარგმნას",+ "helpTranslate": "დაეხმარეთ FreeMoCap-ის თარგმნას","failedToFetch": "მიღება ვერ მოხერხდა","recordings": "ჩაწერები","noRecordingsFound": "ჩაწერები ვერ მოიძებნა. ხელით ჩასატვირთად ზემოთ შეიყვანეთ ბილიკი.",@@ -239,7 +239,7 @@"menuDocumentation": "დოკუმენტაცია","menuGitHubRepository": "GitHub რეპოზიტორია","menuReportIssue": "პრობლემის შეტყობინება…",- "menuAbout": "SkellyCam-ის შესახებ",+ "menuAbout": "FreeMoCap-ის შესახებ","menuPlayback": "დაკვრა","videoPlayback": "დაკვრა","copyLogsToClipboard": "ჟურნალის კოპირება ბუფერში",diff --git a/freemocap-ui/src/i18n/locales/ko-hangugeo.json b/freemocap-ui/src/i18n/locales/ko-hangugeo.jsonindex 9f66a428..93015daa 100644--- a/freemocap-ui/src/i18n/locales/ko-hangugeo.json+++ b/freemocap-ui/src/i18n/locales/ko-hangugeo.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam에 오신 것을 환영합니다",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap에 오신 것을 환영합니다","welcomeSubtitle": "동기화된 비디오 녹화 및 보기","sendAnonymousPings": "익명 사용 데이터 보내기","footerWith": "와",@@ -196,7 +196,7 @@"rendersReceivedFrames": "받은 프레임을 화면에 렌더링.","displayTooltipLong": "디스플레이는 UI 렌더링 성능을 나타냅니다. 디스플레이가 프레임을 수신하고 렌더링하는 속도를 보여줍니다. 여기서의 성능 문제는 녹화 품질에 영향을 미치지 않지만 실시간으로 카메라를 모니터링하는 능력에 영향을 줄 수 있습니다.","statsSourceShort": "디스플레이는 프레임을 렌더링, 서버는 프레임을 캡처.",- "statsSourceLong": "서버는 카메라에서 프레임을 가져오거나 녹화하는 실제 속도이며, 디스플레이는 프레임을 수신하고 렌더링하는 속도입니다. SkellyCam은 녹화 품질을 위해 서버 측 성능을 우선시하므로 해당 수치가 더 안정적이어야 합니다. 디스플레이 프레임레이트가 서버와 다르면 시스템 리소스가 부족함을 나타냅니다. 카메라 수를 줄이거나 프레임레이트/해상도를 낮추는 것을 고려하세요.",+ "statsSourceLong": "서버는 카메라에서 프레임을 가져오거나 녹화하는 실제 속도이며, 디스플레이는 프레임을 수신하고 렌더링하는 속도입니다. FreeMoCap은 녹화 품질을 위해 서버 측 성능을 우선시하므로 해당 수치가 더 안정적이어야 합니다. 디스플레이 프레임레이트가 서버와 다르면 시스템 리소스가 부족함을 나타냅니다. 카메라 수를 줄이거나 프레임레이트/해상도를 낮추는 것을 고려하세요.","statsCurrentShort": "최근 프레임 시간 및 FPS.","statsCurrentLong": "단일 프레임을 처리하는 데 걸리는 시간(밀리초)과 이에 해당하는 초당 프레임 수(FPS)의 최신 측정값을 보여줍니다. 낮은 프레임 시간과 높은 FPS는 더 나은 성능을 나타냅니다.","statsMinShort": "가장 빠른 프레임 시간 및 최고 FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "표준편차는 프레임 시간의 변동량을 측정합니다. 낮은 값은 더 일관된 성능을 나타냅니다. 변동계수(CV%)는 이 변동성을 평균의 백분율로 표현하여 서로 다른 프레임레이트 간의 안정성 비교를 용이하게 합니다. 낮은 CV%는 더 안정적인 성능을 나타냅니다.","aiTranslatedTooltip": "이 번역은 AI가 생성했으며 오류가 있을 수 있습니다. 이 언어를 구사하신다면 개선에 도움을 주세요!","humanValidatedTooltip": "이 번역은 사람 번역가가 검토했습니다.",- "helpTranslate": "SkellyCam 번역 도움",+ "helpTranslate": "FreeMoCap 번역 도움","failedToFetch": "가져오기 실패","recordings": "녹화","noRecordingsFound": "녹화를 찾을 수 없습니다. 위에 경로를 입력하여 수동으로 로드하세요.",@@ -239,7 +239,7 @@"menuDocumentation": "문서","menuGitHubRepository": "GitHub 저장소","menuReportIssue": "문제 신고…",- "menuAbout": "SkellyCam 정보",+ "menuAbout": "FreeMoCap 정보","menuPlayback": "재생","videoPlayback": "재생","copyLogsToClipboard": "로그를 클립보드에 복사",diff --git a/freemocap-ui/src/i18n/locales/ms-melayu.json b/freemocap-ui/src/i18n/locales/ms-melayu.jsonindex 7c505d5a..1c8744cf 100644--- a/freemocap-ui/src/i18n/locales/ms-melayu.json+++ b/freemocap-ui/src/i18n/locales/ms-melayu.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Selamat Datang ke SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Selamat Datang ke FreeMoCap","welcomeSubtitle": "Rakam dan Tonton Video Tersegerak","sendAnonymousPings": "Hantar ping penggunaan tanpa nama","footerWith": "dgn",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Merender bingkai diterima pada skrin.","displayTooltipLong": "Paparan mewakili prestasi rendering UI. Ia menunjukkan seberapa pantas paparan anda menerima dan merender bingkai. Isu prestasi di sini tidak akan menjejaskan kualiti rakaman tetapi mungkin menjejaskan keupayaan anda memantau kamera secara masa nyata.","statsSourceShort": "Paparan merender bingkai, Pelayan menangkap bingkai.",- "statsSourceLong": "Pelayan adalah kadar sebenar bingkai ditarik/dirakam dari kamera, manakala paparan adalah kadar ia diterima dan dirender. Skellycam mengutamakan prestasi sisi pelayan untuk kualiti rakaman, jadi nombor itu sepatutnya kekal lebih stabil. Jika kadar bingkai paparan menyimpang dari pelayan, ia menunjukkan sumber sistem anda terbeban. Pertimbangkan menggunakan kurang kamera atau menurunkan kadar bingkai/resolusi.",+ "statsSourceLong": "Pelayan adalah kadar sebenar bingkai ditarik/dirakam dari kamera, manakala paparan adalah kadar ia diterima dan dirender. FreeMoCap mengutamakan prestasi sisi pelayan untuk kualiti rakaman, jadi nombor itu sepatutnya kekal lebih stabil. Jika kadar bingkai paparan menyimpang dari pelayan, ia menunjukkan sumber sistem anda terbeban. Pertimbangkan menggunakan kurang kamera atau menurunkan kadar bingkai/resolusi.","statsCurrentShort": "Masa bingkai terbaru dan FPS sepadan.","statsCurrentLong": "Ini menunjukkan ukuran terbaru berapa lama untuk memproses satu bingkai (dalam milisaat) dan bingkai sesaat (FPS) setara. Masa bingkai lebih rendah dan FPS lebih tinggi menunjukkan prestasi lebih baik.","statsMinShort": "Masa bingkai terpantas (latensi terendah) dan FPS tertinggi dicapai.",@@ -211,7 +211,7 @@"statsStdDevLong": "Sisihan piawai mengukur jumlah variasi dalam masa bingkai. Nilai lebih rendah menunjukkan prestasi lebih konsisten. Pekali Variasi (CV%) menyatakan kebolehubahan ini sebagai peratusan min, memudahkan perbandingan kestabilan merentasi kadar bingkai berbeza. CV% lebih rendah menunjukkan prestasi lebih stabil.","aiTranslatedTooltip": "Terjemahan ini dijana oleh AI dan mungkin mengandungi ralat. Jika anda bertutur bahasa ini, anda boleh membantu memperbaikinya dengan membuka pull request di GitHub!","humanValidatedTooltip": "Terjemahan ini telah disemak dan disahkan oleh penterjemah manusia.",- "helpTranslate": "Bantu terjemah SkellyCam",+ "helpTranslate": "Bantu terjemah FreeMoCap","failedToFetch": "Gagal mendapatkan","recordings": "Rakaman","noRecordingsFound": "Tiada rakaman ditemui. Masukkan laluan di atas untuk memuat secara manual.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentasi","menuGitHubRepository": "Repositori GitHub","menuReportIssue": "Laporkan masalah…",- "menuAbout": "Tentang SkellyCam",+ "menuAbout": "Tentang FreeMoCap","menuPlayback": "Main balik","videoPlayback": "Main Balik","copyLogsToClipboard": "Salin log ke papan klip",diff --git a/freemocap-ui/src/i18n/locales/my-myanmar.json b/freemocap-ui/src/i18n/locales/my-myanmar.jsonindex 59bbfab6..f2568066 100644--- a/freemocap-ui/src/i18n/locales/my-myanmar.json+++ b/freemocap-ui/src/i18n/locales/my-myanmar.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam မှ ကြိုဆိုပါသည်",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap မှ ကြိုဆိုပါသည်","welcomeSubtitle": "ချိန်ကိုက်ထားသော ဗီဒီယိုများကို ရိုက်ကူးပြီး ကြည့်ရှုပါ","sendAnonymousPings": "အမည်မသိ အသုံးပြုမှု ping များ ပို့ပါ","footerWith": "နှင့်",@@ -196,7 +196,7 @@"rendersReceivedFrames": "လက်ခံရရှိသော ဖရိမ်များကို မျက်နှာပြင်ပေါ်တွင် ပြသသည်။","displayTooltipLong": "မျက်နှာပြင်သည် UI ပုံဖော်ခြင်း စွမ်းဆောင်ရည်ကို ကိုယ်စားပြုသည်။ သင့်မျက်နှာပြင်သည် ဖရိမ်များကို မည်မျှ မြန်ဆန်စွာ လက်ခံပြီး ပုံဖော်သည်ကို ပြသည်။ ဤနေရာရှိ စွမ်းဆောင်ရည် ပြဿနာများသည် ရိုက်ကူးမှု အရည်အသွေးကို မထိခိုက်စေသော်လည်း ကင်မရာများကို အချိန်နှင့်တစ်ပြေးညီ စောင့်ကြည့်နိုင်စွမ်းကို ထိခိုက်နိုင်သည်။","statsSourceShort": "မျက်နှာပြင်သည် ဖရိမ်များကို ပုံဖော်သည်၊ ဆာဗာသည် ဖရိမ်များကို ဖမ်းယူသည်။",- "statsSourceLong": "ဆာဗာသည် ကင်မရာမှ ဖရိမ်များကို ဆွဲယူ/ရိုက်ကူးသည့် အမှန်တကယ် နှုန်းဖြစ်ပြီး၊ မျက်နှာပြင်သည် ၎င်းတို့ကို လက်ခံပြီး ပုံဖော်သည့် နှုန်းဖြစ်သည်။ Skellycam သည် ရိုက်ကူးမှု အရည်အသွေးအတွက် ဆာဗာဘက် စွမ်းဆောင်ရည်ကို ဦးစားပေးသောကြောင့် ထိုနံပါတ်သည် ပိုမိုတည်ငြိမ်သင့်သည်။ မျက်နှာပြင် ဖရိမ်နှုန်းသည် ဆာဗာမှ ကွဲလွဲပါက သင့်စနစ် အရင်းအမြစ်များ ဝန်ပိနေကြောင်း ညွှန်ပြသည်။ ကင်မရာ နည်းနည်း အသုံးပြုခြင်း သို့မဟုတ် ဖရိမ်နှုန်း/ကြည်လင်ပြတ်သားမှု လျှော့ချခြင်းကို စဉ်းစားပါ။",+ "statsSourceLong": "ဆာဗာသည် ကင်မရာမှ ဖရိမ်များကို ဆွဲယူ/ရိုက်ကူးသည့် အမှန်တကယ် နှုန်းဖြစ်ပြီး၊ မျက်နှာပြင်သည် ၎င်းတို့ကို လက်ခံပြီး ပုံဖော်သည့် နှုန်းဖြစ်သည်။ FreeMoCap သည် ရိုက်ကူးမှု အရည်အသွေးအတွက် ဆာဗာဘက် စွမ်းဆောင်ရည်ကို ဦးစားပေးသောကြောင့် ထိုနံပါတ်သည် ပိုမိုတည်ငြိမ်သင့်သည်။ မျက်နှာပြင် ဖရိမ်နှုန်းသည် ဆာဗာမှ ကွဲလွဲပါက သင့်စနစ် အရင်းအမြစ်များ ဝန်ပိနေကြောင်း ညွှန်ပြသည်။ ကင်မရာ နည်းနည်း အသုံးပြုခြင်း သို့မဟုတ် ဖရိမ်နှုန်း/ကြည်လင်ပြတ်သားမှု လျှော့ချခြင်းကို စဉ်းစားပါ။","statsCurrentShort": "အနောက်ဆုံး ဖရိမ် အချိန် နှင့် သက်ဆိုင်ရာ FPS။","statsCurrentLong": "ဖရိမ်တစ်ခုကို စီမံဆောင်ရွက်ရန် မည်မျှ ကြာသည် (မီလီစက္ကန့်ဖြင့်) နှင့် ညီမျှသော FPS ၏ အနောက်ဆုံး တိုင်းတာချက်ကို ပြသည်။ ဖရိမ် အချိန် နိမ့်လေ FPS မြင့်လေ စွမ်းဆောင်ရည် ကောင်းလေ ဖြစ်သည်။","statsMinShort": "အမြန်ဆုံး ဖရိမ် အချိန် (အနိမ့်ဆုံး နှောင့်နှေးမှု) နှင့် ရရှိသော အမြင့်ဆုံး FPS။",@@ -211,7 +211,7 @@"statsStdDevLong": "စံသွေဖည်မှုသည် ဖရိမ် အချိန်များတွင် ကွဲပြားမှု ပမာဏကို တိုင်းတာသည်။ တန်ဖိုး နိမ့်လေ စွမ်းဆောင်ရည် တသမတ်တည်း ကောင်းလေ ဖြစ်သည်။ ကွဲပြားမှု ကိန်းရှင် (CV%) သည် ဤကွဲပြားမှုကို ပျမ်းမျှ၏ ရာခိုင်နှုန်းအဖြစ် ဖော်ပြပြီး မတူညီသော ဖရိမ်နှုန်းများတွင် တည်ငြိမ်မှုကို နှိုင်းယှဉ်ရန် လွယ်ကူစေသည်။ CV% နိမ့်လေ စွမ်းဆောင်ရည် တည်ငြိမ်လေ ဖြစ်သည်။","aiTranslatedTooltip": "ဤဘာသာပြန်ကို AI ဖြင့် ဖန်တီးထားပြီး အမှားများ ပါဝင်နိုင်သည်။ ဤဘာသာစကားကို ပြောတတ်ပါက GitHub တွင် pull request ဖွင့်၍ ပိုမိုကောင်းမွန်အောင် ကူညီနိုင်ပါသည်!","humanValidatedTooltip": "ဤဘာသာပြန်ကို လူ ဘာသာပြန်သူက စစ်ဆေးပြီး အတည်ပြုထားပါသည်။",- "helpTranslate": "SkellyCam ဘာသာပြန်ရာတွင် ကူညီပါ",+ "helpTranslate": "FreeMoCap ဘာသာပြန်ရာတွင် ကူညီပါ","failedToFetch": "ရယူရန် မအောင်မြင်ပါ","recordings": "ရိုက်ကူးမှုများ","noRecordingsFound": "ရိုက်ကူးမှု မတွေ့ပါ။ လက်ဖြင့် တင်ရန် အထက်တွင် လမ်းကြောင်း ထည့်ပါ။",@@ -239,7 +239,7 @@"menuDocumentation": "စာရွက်စာတမ်း","menuGitHubRepository": "GitHub Repository","menuReportIssue": "ပြဿနာတင်ပြ…",- "menuAbout": "SkellyCam အကြောင်း",+ "menuAbout": "FreeMoCap အကြောင်း","menuPlayback": "ပြန်ဖွင့်","videoPlayback": "ပြန်ဖွင့်","copyLogsToClipboard": "မှတ်တမ်းများကို ကလစ်ဘုတ်သို့ ကူးယူ",diff --git a/freemocap-ui/src/i18n/locales/ne-nepali.json b/freemocap-ui/src/i18n/locales/ne-nepali.jsonindex e5482a60..a55923fd 100644--- a/freemocap-ui/src/i18n/locales/ne-nepali.json+++ b/freemocap-ui/src/i18n/locales/ne-nepali.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam मा स्वागत छ",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap मा स्वागत छ","welcomeSubtitle": "सिङ्क्रोनाइज गरिएका भिडियोहरू रेकर्ड गर्नुहोस् र हेर्नुहोस्","sendAnonymousPings": "अज्ञात प्रयोग पिङहरू पठाउनुहोस्","footerWith": "सँग",@@ -196,7 +196,7 @@"rendersReceivedFrames": "प्राप्त फ्रेमहरू स्क्रिनमा रेन्डर गर्छ।","displayTooltipLong": "प्रदर्शनले UI रेन्डरिङ कार्यसम्पादन प्रतिनिधित्व गर्छ। तपाईंको प्रदर्शनले कत्तिको छिटो फ्रेमहरू प्राप्त र रेन्डर गर्छ भनेर देखाउँछ। यहाँ कार्यसम्पादन समस्याहरूले रेकर्डिङ गुणस्तरलाई असर गर्दैन तर वास्तविक समयमा क्यामेरा निगरानी गर्ने तपाईंको क्षमतालाई असर गर्न सक्छ।","statsSourceShort": "प्रदर्शनले फ्रेमहरू रेन्डर गर्छ, सर्भरले फ्रेमहरू क्याप्चर गर्छ।",- "statsSourceLong": "सर्भर भनेको क्यामेराबाट फ्रेमहरू तानिने/रेकर्ड गरिने वास्तविक दर हो, जबकि प्रदर्शन भनेको तिनीहरू प्राप्त र रेन्डर गरिने दर हो। Skellycam ले रेकर्डिङ गुणस्तरको लागि सर्भर-साइड कार्यसम्पादनलाई प्राथमिकता दिन्छ, त्यसैले त्यो संख्या बढी स्थिर हुनुपर्छ। यदि प्रदर्शन फ्रेमरेट सर्भरबाट भिन्न हुन्छ भने, तपाईंको प्रणाली स्रोतहरू तनावमा छन् भन्ने संकेत गर्छ। कम क्यामेरा प्रयोग गर्ने वा फ्रेमरेट/रिजोल्युसन घटाउने विचार गर्नुहोस्।",+ "statsSourceLong": "सर्भर भनेको क्यामेराबाट फ्रेमहरू तानिने/रेकर्ड गरिने वास्तविक दर हो, जबकि प्रदर्शन भनेको तिनीहरू प्राप्त र रेन्डर गरिने दर हो। FreeMoCap ले रेकर्डिङ गुणस्तरको लागि सर्भर-साइड कार्यसम्पादनलाई प्राथमिकता दिन्छ, त्यसैले त्यो संख्या बढी स्थिर हुनुपर्छ। यदि प्रदर्शन फ्रेमरेट सर्भरबाट भिन्न हुन्छ भने, तपाईंको प्रणाली स्रोतहरू तनावमा छन् भन्ने संकेत गर्छ। कम क्यामेरा प्रयोग गर्ने वा फ्रेमरेट/रिजोल्युसन घटाउने विचार गर्नुहोस्।","statsCurrentShort": "सबैभन्दा भर्खरको फ्रेम समय र सम्बन्धित FPS।","statsCurrentLong": "एउटा फ्रेम प्रशोधन गर्न कति समय लाग्छ (मिलिसेकेन्डमा) र बराबर FPS को सबैभन्दा भर्खरको मापन देखाउँछ। कम फ्रेम समय र उच्च FPS ले राम्रो कार्यसम्पादन संकेत गर्छ।","statsMinShort": "सबैभन्दा छिटो फ्रेम समय (सबैभन्दा कम विलम्बता) र प्राप्त उच्चतम FPS।",@@ -211,7 +211,7 @@"statsStdDevLong": "मानक विचलनले फ्रेम समयहरूमा भिन्नताको मात्रा मापन गर्छ। कम मानहरूले बढी एकरूप कार्यसम्पादन संकेत गर्छ। भिन्नता गुणांक (CV%) ले यो परिवर्तनशीलतालाई औसतको प्रतिशतको रूपमा व्यक्त गर्छ, विभिन्न फ्रेमरेटहरूमा स्थिरता तुलना गर्न सजिलो बनाउँछ। कम CV% ले बढी स्थिर कार्यसम्पादन संकेत गर्छ।","aiTranslatedTooltip": "यो अनुवाद AI द्वारा उत्पन्न गरिएको हो र त्रुटिहरू हुन सक्छ। यदि तपाईं यो भाषा बोल्नुहुन्छ भने, GitHub मा pull request खोलेर सुधार गर्न मद्दत गर्न सक्नुहुन्छ!","humanValidatedTooltip": "यो अनुवाद मानव अनुवादकद्वारा समीक्षा र प्रमाणित गरिएको छ।",- "helpTranslate": "SkellyCam अनुवाद गर्न मद्दत गर्नुहोस्",+ "helpTranslate": "FreeMoCap अनुवाद गर्न मद्दत गर्नुहोस्","failedToFetch": "प्राप्त गर्न असफल","recordings": "रेकर्डिङहरू","noRecordingsFound": "कुनै रेकर्डिङ भेटिएन। म्यानुअल रूपमा लोड गर्न माथि पथ प्रविष्ट गर्नुहोस्।",@@ -239,7 +239,7 @@"menuDocumentation": "कागजात","menuGitHubRepository": "GitHub भण्डार","menuReportIssue": "समस्या रिपोर्ट गर्नुहोस्…",- "menuAbout": "SkellyCam बारेमा",+ "menuAbout": "FreeMoCap बारेमा","menuPlayback": "प्लेब्याक","videoPlayback": "प्लेब्याक","copyLogsToClipboard": "लगहरू क्लिपबोर्डमा कपी गर्नुहोस्",diff --git a/freemocap-ui/src/i18n/locales/nl-nederlands.json b/freemocap-ui/src/i18n/locales/nl-nederlands.jsonindex 7690289b..1f25c80d 100644--- a/freemocap-ui/src/i18n/locales/nl-nederlands.json+++ b/freemocap-ui/src/i18n/locales/nl-nederlands.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Welkom bij SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Welkom bij FreeMoCap","welcomeSubtitle": "Neem gesynchroniseerde video's op en bekijk ze","sendAnonymousPings": "Anonieme gebruiksgegevens verzenden","footerWith": "met",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Rendert ontvangen frames op het scherm.","displayTooltipLong": "Weergave toont de UI-renderingprestaties. Het laat zien hoe snel uw scherm frames ontvangt en rendert. Prestatieproblemen hier hebben geen invloed op de opnamekwaliteit maar kunnen uw vermogen om camera's in realtime te monitoren beïnvloeden.","statsSourceShort": "Display rendert frames, server vangt frames.",- "statsSourceLong": "De server is de werkelijke snelheid waarmee frames van de camera worden opgehaald/opgenomen, terwijl weergave de snelheid is waarmee ze worden ontvangen en gerenderd. SkellyCam geeft prioriteit aan serverzijde prestaties voor opnamekwaliteit, dus dat getal zou stabieler moeten blijven. Als de weergave-framerate afwijkt van de server, geeft dit aan dat uw systeembronnen belast zijn. Overweeg minder camera's te gebruiken of framerate/resolutie te verlagen.",+ "statsSourceLong": "De server is de werkelijke snelheid waarmee frames van de camera worden opgehaald/opgenomen, terwijl weergave de snelheid is waarmee ze worden ontvangen en gerenderd. FreeMoCap geeft prioriteit aan serverzijde prestaties voor opnamekwaliteit, dus dat getal zou stabieler moeten blijven. Als de weergave-framerate afwijkt van de server, geeft dit aan dat uw systeembronnen belast zijn. Overweeg minder camera's te gebruiken of framerate/resolutie te verlagen.","statsCurrentShort": "Meest recente frametijd en FPS.","statsCurrentLong": "Toont de meest recente meting van hoe lang het duurt om een enkel frame te verwerken (in milliseconden) en de equivalente frames per seconde (FPS). Lagere frametijden en hogere FPS wijzen op betere prestaties.","statsMinShort": "Snelste frametijd en hoogste FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Standaarddeviatie meet de spreiding in frametijden. Lagere waarden duiden op consistentere prestaties. De variatiecoëfficiënt (CV%) drukt deze variabiliteit uit als percentage van het gemiddelde, wat het vergelijken van stabiliteit over verschillende framerates vergemakkelijkt. Lagere CV% duidt op stabielere prestaties.","aiTranslatedTooltip": "Deze vertaling is gegenereerd door AI en kan fouten bevatten. Als u deze taal spreekt, help ons verbeteren!","humanValidatedTooltip": "Deze vertaling is gecontroleerd door een menselijke vertaler.",- "helpTranslate": "Help SkellyCam vertalen",+ "helpTranslate": "Help FreeMoCap vertalen","failedToFetch": "Ophalen mislukt","recordings": "Opnames","noRecordingsFound": "Geen opnames gevonden. Voer hierboven een pad in om handmatig te laden.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentatie","menuGitHubRepository": "GitHub-repository","menuReportIssue": "Probleem melden…",- "menuAbout": "Over SkellyCam",+ "menuAbout": "Over FreeMoCap","menuPlayback": "Afspelen","videoPlayback": "Afspelen","copyLogsToClipboard": "Logboeken naar klembord kopiëren",diff --git a/freemocap-ui/src/i18n/locales/pl-polski.json b/freemocap-ui/src/i18n/locales/pl-polski.jsonindex c03a9e84..152e38d9 100644--- a/freemocap-ui/src/i18n/locales/pl-polski.json+++ b/freemocap-ui/src/i18n/locales/pl-polski.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Witamy w SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Witamy w FreeMoCap","welcomeSubtitle": "Nagrywaj i przeglądaj zsynchronizowane wideo","sendAnonymousPings": "Wysyłaj anonimowe dane użycia","footerWith": "z",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Renderuje otrzymane klatki na ekranie.","displayTooltipLong": "Wyświetlanie reprezentuje wydajność renderowania interfejsu użytkownika. Pokazuje, jak szybko ekran odbiera i renderuje klatki. Problemy z wydajnością tutaj nie wpłyną na jakość nagrania, ale mogą wpłynąć na zdolność monitorowania kamer w czasie rzeczywistym.","statsSourceShort": "Wyświetlacz renderuje klatki, serwer je przechwytuje.",- "statsSourceLong": "Serwer to rzeczywista szybkość, z jaką klatki są pobierane/nagrywane z kamery, podczas gdy wyświetlanie to szybkość ich odbierania i renderowania. SkellyCam priorytetowo traktuje wydajność po stronie serwera dla jakości nagrywania, więc ta liczba powinna być bardziej stabilna. Jeśli częstotliwość klatek wyświetlania odbiega od serwera, oznacza to, że zasoby systemu są obciążone. Rozważ użycie mniejszej liczby kamer lub zmniejszenie częstotliwości klatek/rozdzielczości.",+ "statsSourceLong": "Serwer to rzeczywista szybkość, z jaką klatki są pobierane/nagrywane z kamery, podczas gdy wyświetlanie to szybkość ich odbierania i renderowania. FreeMoCap priorytetowo traktuje wydajność po stronie serwera dla jakości nagrywania, więc ta liczba powinna być bardziej stabilna. Jeśli częstotliwość klatek wyświetlania odbiega od serwera, oznacza to, że zasoby systemu są obciążone. Rozważ użycie mniejszej liczby kamer lub zmniejszenie częstotliwości klatek/rozdzielczości.","statsCurrentShort": "Najnowszy czas klatki i FPS.","statsCurrentLong": "Pokazuje najnowszy pomiar czasu przetwarzania jednej klatki (w milisekundach) i odpowiadającą liczbę klatek na sekundę (FPS). Niższe czasy klatek i wyższe FPS wskazują na lepszą wydajność.","statsMinShort": "Najkrótszy czas klatki i najwyższe FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Odchylenie standardowe mierzy rozrzut czasów klatek. Niższe wartości wskazują na bardziej spójną wydajność. Współczynnik zmienności (CV%) wyraża tę zmienność jako procent średniej, ułatwiając porównanie stabilności przy różnych częstotliwościach klatek. Niższe CV% oznacza bardziej stabilną wydajność.","aiTranslatedTooltip": "To tłumaczenie zostało wygenerowane przez AI i może zawierać błędy. Jeśli mówisz w tym języku, pomóż je ulepszyć!","humanValidatedTooltip": "To tłumaczenie zostało zweryfikowane przez tłumacza.",- "helpTranslate": "Pomóż przetłumaczyć SkellyCam",+ "helpTranslate": "Pomóż przetłumaczyć FreeMoCap","failedToFetch": "Nie udało się pobrać","recordings": "Nagrania","noRecordingsFound": "Nie znaleziono nagrań. Wprowadź ścieżkę powyżej, aby załadować ręcznie.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentacja","menuGitHubRepository": "Repozytorium GitHub","menuReportIssue": "Zgłoś problem…",- "menuAbout": "O SkellyCam",+ "menuAbout": "O FreeMoCap","menuPlayback": "Odtwarzanie","videoPlayback": "Odtwarzanie","copyLogsToClipboard": "Kopiuj logi do schowka",diff --git a/freemocap-ui/src/i18n/locales/pt-BR-portugues-brasil.json b/freemocap-ui/src/i18n/locales/pt-BR-portugues-brasil.jsonindex 5c2fb160..f6fe9603 100644--- a/freemocap-ui/src/i18n/locales/pt-BR-portugues-brasil.json+++ b/freemocap-ui/src/i18n/locales/pt-BR-portugues-brasil.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Bem-vindo ao SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Bem-vindo ao FreeMoCap","welcomeSubtitle": "Grave e visualize vídeos sincronizados","sendAnonymousPings": "Enviar dados de uso anônimos","footerWith": "com",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Renderiza quadros recebidos na tela.","displayTooltipLong": "A exibição representa o desempenho de renderização da interface do usuário. Mostra a rapidez com que seu display recebe e renderiza quadros. Problemas de desempenho aqui não afetarão a qualidade da gravação, mas podem impactar sua capacidade de monitorar câmeras em tempo real.","statsSourceShort": "Exibição renderiza quadros, servidor captura quadros.",- "statsSourceLong": "O servidor é a taxa real em que os quadros são puxados/gravados da câmera, enquanto a exibição é a taxa em que são recebidos e renderizados. O SkellyCam prioriza o desempenho do lado do servidor para qualidade de gravação, então esse número deve permanecer mais estável. Se o framerate de exibição divergir do servidor, isso indica que os recursos do sistema estão sobrecarregados. Considere usar menos câmeras ou diminuir o framerate/resolução.",+ "statsSourceLong": "O servidor é a taxa real em que os quadros são puxados/gravados da câmera, enquanto a exibição é a taxa em que são recebidos e renderizados. O FreeMoCap prioriza o desempenho do lado do servidor para qualidade de gravação, então esse número deve permanecer mais estável. Se o framerate de exibição divergir do servidor, isso indica que os recursos do sistema estão sobrecarregados. Considere usar menos câmeras ou diminuir o framerate/resolução.","statsCurrentShort": "Tempo de quadro e FPS mais recentes.","statsCurrentLong": "Mostra a medição mais recente de quanto tempo leva para processar um único quadro (em milissegundos) e os quadros por segundo (FPS) equivalentes. Tempos de quadro menores e FPS maiores indicam melhor desempenho.","statsMinShort": "Tempo de quadro mais rápido e FPS mais alto.",@@ -211,7 +211,7 @@"statsStdDevLong": "O desvio padrão mede a variação nos tempos de quadro. Valores menores indicam desempenho mais consistente. O Coeficiente de Variação (CV%) expressa essa variabilidade como porcentagem da média, facilitando a comparação de estabilidade entre diferentes taxas de quadro. CV% menor indica desempenho mais estável.","aiTranslatedTooltip": "Esta tradução foi gerada por IA e pode conter erros. Se você fala este idioma, ajude a melhorá-la!","humanValidatedTooltip": "Esta tradução foi verificada por um tradutor humano.",- "helpTranslate": "Ajude a traduzir o SkellyCam",+ "helpTranslate": "Ajude a traduzir o FreeMoCap","failedToFetch": "Falha ao buscar","recordings": "Gravações","noRecordingsFound": "Nenhuma gravação encontrada. Insira um caminho acima para carregar manualmente.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentação","menuGitHubRepository": "Repositório GitHub","menuReportIssue": "Reportar um problema…",- "menuAbout": "Sobre o SkellyCam",+ "menuAbout": "Sobre o FreeMoCap","menuPlayback": "Reprodução","videoPlayback": "Reprodução","copyLogsToClipboard": "Copiar logs para a área de transferência",diff --git a/freemocap-ui/src/i18n/locales/ro-romana.json b/freemocap-ui/src/i18n/locales/ro-romana.jsonindex 56433878..7b98c994 100644--- a/freemocap-ui/src/i18n/locales/ro-romana.json+++ b/freemocap-ui/src/i18n/locales/ro-romana.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Bun venit la SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Bun venit la FreeMoCap","welcomeSubtitle": "Înregistrează și Vizualizează Videoclipuri Sincronizate","sendAnonymousPings": "Trimite ping-uri anonime de utilizare","footerWith": "cu",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Redă cadrele primite pe ecran.","displayTooltipLong": "Afișajul reprezintă performanța de randare a UI. Arată cât de repede afișajul tău primește și redă cadre. Problemele de performanță aici nu vor afecta calitatea înregistrării, dar pot afecta capacitatea de a monitoriza camerele în timp real.","statsSourceShort": "Afișajul redă cadre, Serverul capturează cadre.",- "statsSourceLong": "Serverul este rata reală la care cadrele sunt trase/înregistrate de la cameră, în timp ce afișajul este rata la care sunt primite și redate. Skellycam prioritizează performanța pe partea de server pentru calitatea înregistrării, deci acel număr ar trebui să rămână mai stabil. Dacă rata de cadre a afișajului diverge de cea a serverului, indică faptul că resursele sistemului sunt suprasolicitate. Luați în considerare utilizarea mai puțin camere sau reducerea ratei de cadre/rezoluție.",+ "statsSourceLong": "Serverul este rata reală la care cadrele sunt trase/înregistrate de la cameră, în timp ce afișajul este rata la care sunt primite și redate. FreeMoCap prioritizează performanța pe partea de server pentru calitatea înregistrării, deci acel număr ar trebui să rămână mai stabil. Dacă rata de cadre a afișajului diverge de cea a serverului, indică faptul că resursele sistemului sunt suprasolicitate. Luați în considerare utilizarea mai puțin camere sau reducerea ratei de cadre/rezoluție.","statsCurrentShort": "Cel mai recent timp de cadru și FPS corespunzător.","statsCurrentLong": "Aceasta arată cea mai recentă măsurătoare a timpului necesar pentru procesarea unui singur cadru (în milisecunde) și cadrele pe secundă (FPS) echivalente. Timpi de cadru mai mici și FPS mai mare indică performanță mai bună.","statsMinShort": "Cel mai rapid timp de cadru (latență minimă) și FPS maxim atins.",@@ -211,7 +211,7 @@"statsStdDevLong": "Deviația standard măsoară cantitatea de variație în timpii de cadru. Valorile mai mici indică performanță mai consistentă. Coeficientul de Variație (CV%) exprimă această variabilitate ca procent din medie, facilitând compararea stabilității între rate de cadre diferite. CV% mai mic indică performanță mai stabilă.","aiTranslatedTooltip": "Această traducere a fost generată de AI și poate conține erori. Dacă vorbiți această limbă, puteți ajuta la îmbunătățirea ei deschizând un pull request pe GitHub!","humanValidatedTooltip": "Această traducere a fost revizuită și validată de un traducător uman.",- "helpTranslate": "Ajută la traducerea SkellyCam",+ "helpTranslate": "Ajută la traducerea FreeMoCap","failedToFetch": "Obținere eșuată","recordings": "Înregistrări","noRecordingsFound": "Nicio înregistrare găsită. Introduceți o cale mai sus pentru încărcare manuală.",@@ -239,7 +239,7 @@"menuDocumentation": "Documentație","menuGitHubRepository": "Depozit GitHub","menuReportIssue": "Raportează o problemă…",- "menuAbout": "Despre SkellyCam",+ "menuAbout": "Despre FreeMoCap","menuPlayback": "Redare","videoPlayback": "Redare","copyLogsToClipboard": "Copiază jurnalele în clipboard",diff --git a/freemocap-ui/src/i18n/locales/ru-russkiy.json b/freemocap-ui/src/i18n/locales/ru-russkiy.jsonindex 6275b984..14aaaaaa 100644--- a/freemocap-ui/src/i18n/locales/ru-russkiy.json+++ b/freemocap-ui/src/i18n/locales/ru-russkiy.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Добро пожаловать в SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Добро пожаловать в FreeMoCap","welcomeSubtitle": "Записывайте и просматривайте синхронизированные видео","sendAnonymousPings": "Отправлять анонимные данные об использовании","footerWith": "с",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Отображает полученные кадры на экране.","displayTooltipLong": "Дисплей отображает производительность рендеринга пользовательского интерфейса. Показывает, насколько быстро ваш дисплей получает и отрисовывает кадры. Проблемы с производительностью здесь не повлияют на качество записи, но могут повлиять на возможность мониторинга камер в реальном времени.","statsSourceShort": "Дисплей рендерит кадры, сервер захватывает кадры.",- "statsSourceLong": "Сервер — это реальная скорость, с которой кадры извлекаются/записываются с камеры, а дисплей — скорость их приёма и отрисовки. SkellyCam отдаёт приоритет серверной производительности для качества записи, поэтому это значение должно оставаться более стабильным. Если частота кадров дисплея расходится с сервером, это указывает на нехватку системных ресурсов. Рассмотрите возможность использования меньшего количества камер или снижения частоты кадров/разрешения.",+ "statsSourceLong": "Сервер — это реальная скорость, с которой кадры извлекаются/записываются с камеры, а дисплей — скорость их приёма и отрисовки. FreeMoCap отдаёт приоритет серверной производительности для качества записи, поэтому это значение должно оставаться более стабильным. Если частота кадров дисплея расходится с сервером, это указывает на нехватку системных ресурсов. Рассмотрите возможность использования меньшего количества камер или снижения частоты кадров/разрешения.","statsCurrentShort": "Последнее время кадра и FPS.","statsCurrentLong": "Показывает последнее измерение времени обработки одного кадра (в миллисекундах) и соответствующее количество кадров в секунду (FPS). Более низкое время кадра и более высокий FPS указывают на лучшую производительность.","statsMinShort": "Минимальное время кадра и максимальный FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Стандартное отклонение измеряет разброс времён кадров. Более низкие значения указывают на более стабильную производительность. Коэффициент вариации (CV%) выражает эту изменчивость как процент от среднего, что упрощает сравнение стабильности при разных частотах кадров. Более низкий CV% указывает на более стабильную производительность.","aiTranslatedTooltip": "Этот перевод создан ИИ и может содержать ошибки. Если вы говорите на этом языке, помогите улучшить его!","humanValidatedTooltip": "Этот перевод проверен переводчиком-человеком.",- "helpTranslate": "Помогите перевести SkellyCam",+ "helpTranslate": "Помогите перевести FreeMoCap","failedToFetch": "Не удалось загрузить","recordings": "Записи","noRecordingsFound": "Записей не найдено. Введите путь выше для загрузки вручную.",@@ -239,7 +239,7 @@"menuDocumentation": "Документация","menuGitHubRepository": "Репозиторий GitHub","menuReportIssue": "Сообщить о проблеме…",- "menuAbout": "О SkellyCam",+ "menuAbout": "О FreeMoCap","menuPlayback": "Воспроизведение","videoPlayback": "Воспроизведение","copyLogsToClipboard": "Копировать логи в буфер обмена",diff --git a/freemocap-ui/src/i18n/locales/si-sinhala.json b/freemocap-ui/src/i18n/locales/si-sinhala.jsonindex 4e4e1b38..c9b667ef 100644--- a/freemocap-ui/src/i18n/locales/si-sinhala.json+++ b/freemocap-ui/src/i18n/locales/si-sinhala.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam වෙත සාදරයෙන් පිළිගනිමු",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap වෙත සාදරයෙන් පිළිගනිමු","welcomeSubtitle": "සමමුහුර්ත වීඩියෝ පටිගත කර බලන්න","sendAnonymousPings": "නිර්නාමික භාවිත ping යවන්න","footerWith": "සමඟ",@@ -196,7 +196,7 @@"rendersReceivedFrames": "ලැබුණු රාමු තිරය මත ප්රතිදානය කරයි.","displayTooltipLong": "සංදර්ශකය UI ප්රතිදාන කාර්යසාධනය නියෝජනය කරයි. ඔබේ සංදර්ශකය කෙතරම් වේගයෙන් රාමු ලබාගෙන ප්රතිදානය කරන්නේද යන්න පෙන්වයි. මෙහි කාර්යසාධන ගැටළු පටිගත කිරීමේ ගුණත්වයට බලපාන්නේ නැත, නමුත් තත්ය කාලීනව කැමරා නිරීක්ෂණය කිරීමේ ඔබේ හැකියාවට බලපෑ හැක.","statsSourceShort": "සංදර්ශකය රාමු ප්රතිදානය කරයි, සේවාදායකය රාමු ග්රහණය කරයි.",- "statsSourceLong": "සේවාදායකය යනු කැමරාවෙන් රාමු අදින/පටිගත කරන සැබෑ අනුපාතයයි, සංදර්ශකය යනු ඒවා ලැබී ප්රතිදානය කරන අනුපාතයයි. Skellycam පටිගත කිරීමේ ගුණත්වය සඳහා සේවාදායක පාර්ශ්ව කාර්යසාධනයට ප්රමුඛතාවය දෙයි, එබැවින් එම අංකය වඩාත් ස්ථායී විය යුතුය. සංදර්ශක රාමු අනුපාතය සේවාදායකයෙන් වෙනස් වුවහොත්, ඔබේ පද්ධති සම්පත් අධික ලෙස භාවිත වෙමින් ඇති බව දක්වයි. අඩු කැමරා භාවිතය හෝ රාමු අනුපාතය/විභේදනය අඩු කිරීම සලකා බලන්න.",+ "statsSourceLong": "සේවාදායකය යනු කැමරාවෙන් රාමු අදින/පටිගත කරන සැබෑ අනුපාතයයි, සංදර්ශකය යනු ඒවා ලැබී ප්රතිදානය කරන අනුපාතයයි. FreeMoCap පටිගත කිරීමේ ගුණත්වය සඳහා සේවාදායක පාර්ශ්ව කාර්යසාධනයට ප්රමුඛතාවය දෙයි, එබැවින් එම අංකය වඩාත් ස්ථායී විය යුතුය. සංදර්ශක රාමු අනුපාතය සේවාදායකයෙන් වෙනස් වුවහොත්, ඔබේ පද්ධති සම්පත් අධික ලෙස භාවිත වෙමින් ඇති බව දක්වයි. අඩු කැමරා භාවිතය හෝ රාමු අනුපාතය/විභේදනය අඩු කිරීම සලකා බලන්න.","statsCurrentShort": "වඩාත්ම මෑත රාමු කාලය සහ අනුරූප FPS.","statsCurrentLong": "තනි රාමුවක් සැකසීමට කොපමණ කාලයක් ගතවේද (මිලිතත්පරවලින්) සහ සමාන FPS හි වඩාත්ම මෑත මිනුම පෙන්වයි. අඩු රාමු කාල සහ ඉහළ FPS වඩා හොඳ කාර්යසාධනය දක්වයි.","statsMinShort": "වේගවත්ම රාමු කාලය (අඩුම ප්රමාදය) සහ ලබාගත් ඉහළම FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "සම්මත අපගමනය රාමු කාලවල විචලන ප්රමාණය මනිනවා. අඩු අගයන් වඩාත් ස්ථාවර කාර්යසාධනය දක්වයි. විචලන සංගුණකය (CV%) මෙම විචලනය මධ්යන්යයේ ප්රතිශතයක් ලෙස ප්රකාශ කරයි, විවිධ රාමු අනුපාතවල ස්ථායිතාව සංසන්දනය කිරීම පහසු කරයි. අඩු CV% වඩාත් ස්ථායී කාර්යසාධනය දක්වයි.","aiTranslatedTooltip": "මෙම පරිවර්තනය AI මඟින් ජනනය කරන ලද අතර දෝෂ අඩංගු විය හැක. ඔබ මෙම භාෂාව කතා කරන්නේ නම්, GitHub හි pull request එකක් විවෘත කිරීමෙන් වැඩිදියුණු කිරීමට උපකාර කළ හැක!","humanValidatedTooltip": "මෙම පරිවර්තනය මිනිස් පරිවර්තකයෙකු විසින් සමාලෝචනය කර තහවුරු කර ඇත.",- "helpTranslate": "SkellyCam පරිවර්තනය කිරීමට උපකාර කරන්න",+ "helpTranslate": "FreeMoCap පරිවර්තනය කිරීමට උපකාර කරන්න","failedToFetch": "ලබා ගැනීමට අසමත් විය","recordings": "පටිගත කිරීම්","noRecordingsFound": "පටිගත කිරීම් හමු නොවීය. අතින් පූරණය කිරීමට ඉහත මාර්ගයක් ඇතුළත් කරන්න.",@@ -239,7 +239,7 @@"menuDocumentation": "ලේඛනකරණය","menuGitHubRepository": "GitHub ගබඩාව","menuReportIssue": "ගැටලුවක් වාර්තා කරන්න…",- "menuAbout": "SkellyCam ගැන",+ "menuAbout": "FreeMoCap ගැන","menuPlayback": "නැවත ධාවනය","videoPlayback": "නැවත ධාවනය","copyLogsToClipboard": "ලොග් පසුරු පුවරුවට පිටපත් කරන්න",diff --git a/freemocap-ui/src/i18n/locales/sr-srpski.json b/freemocap-ui/src/i18n/locales/sr-srpski.jsonindex 669be30b..7203a3ef 100644--- a/freemocap-ui/src/i18n/locales/sr-srpski.json+++ b/freemocap-ui/src/i18n/locales/sr-srpski.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Добро дошли у SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Добро дошли у FreeMoCap","welcomeSubtitle": "Снимајте и гледајте синхронизоване видео записе","sendAnonymousPings": "Шаљи анонимне пингове коришћења","footerWith": "са",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Приказује примљене кадрове на екрану.","displayTooltipLong": "Екран представља перформансе рендеровања корисничког интерфејса. Показује колико брзо ваш екран прима и приказује кадрове. Проблеми са перформансама овде неће утицати на квалитет снимања, али могу утицати на вашу способност да пратите камере у реалном времену.","statsSourceShort": "Екран приказује кадрове, Сервер снима кадрове.",- "statsSourceLong": "Сервер је стварна брзина којом се кадрови преузимају/снимају са камере, док је екран брзина којом се примају и приказују. Skellycam даје приоритет перформансама на страни сервера за квалитет снимања, тако да би тај број требало да остане стабилнији. Ако се брзина кадрова екрана разликује од сервера, то указује да су ресурси вашег система преоптерећени. Размислите о коришћењу мање камера или смањењу брзине кадрова/резолуције.",+ "statsSourceLong": "Сервер је стварна брзина којом се кадрови преузимају/снимају са камере, док је екран брзина којом се примају и приказују. FreeMoCap даје приоритет перформансама на страни сервера за квалитет снимања, тако да би тај број требало да остане стабилнији. Ако се брзина кадрова екрана разликује од сервера, то указује да су ресурси вашег система преоптерећени. Размислите о коришћењу мање камера или смањењу брзине кадрова/резолуције.","statsCurrentShort": "Најновије време кадра и одговарајући FPS.","statsCurrentLong": "Ово приказује најновије мерење колико времена треба за обраду једног кадра (у милисекундама) и еквивалентне кадрове у секунди (FPS). Мање време кадра и већи FPS указују на боље перформансе.","statsMinShort": "Најбрже време кадра (најмање кашњење) и највећи постигнути FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Стандардна девијација мери количину варијације у временима кадрова. Ниже вредности указују на конзистентније перформансе. Коефицијент варијације (CV%) изражава ову варијабилност као проценат средње вредности, олакшавајући поређење стабилности на различитим брзинама кадрова. Нижи CV% указује на стабилније перформансе.","aiTranslatedTooltip": "Овај превод је генерисан помоћу вештачке интелигенције и може садржати грешке. Ако говорите овај језик, можете помоћи да га побољшате отварањем pull request-а на GitHub-у!","humanValidatedTooltip": "Овај превод је прегледан и валидиран од стране људског преводиоца.",- "helpTranslate": "Помозите у превођењу SkellyCam-а",+ "helpTranslate": "Помозите у превођењу FreeMoCap-а","failedToFetch": "Преузимање неуспешно","recordings": "Снимци","noRecordingsFound": "Нема пронађених снимака. Унесите путању изнад за ручно учитавање.",@@ -239,7 +239,7 @@"menuDocumentation": "Документација","menuGitHubRepository": "GitHub складиште","menuReportIssue": "Пријавите проблем…",- "menuAbout": "О SkellyCam-у",+ "menuAbout": "О FreeMoCap-у","menuPlayback": "Репродукција","videoPlayback": "Репродукција","copyLogsToClipboard": "Копирај логове у клипборд",diff --git a/freemocap-ui/src/i18n/locales/sv-svenska.json b/freemocap-ui/src/i18n/locales/sv-svenska.jsonindex 2c9e5ab1..23fc4c87 100644--- a/freemocap-ui/src/i18n/locales/sv-svenska.json+++ b/freemocap-ui/src/i18n/locales/sv-svenska.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Välkommen till SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Välkommen till FreeMoCap","welcomeSubtitle": "Spela in och visa synkroniserade videor","sendAnonymousPings": "Skicka anonym användningsdata","footerWith": "med",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Renderar mottagna bildrutor på skärmen.","displayTooltipLong": "Visningen representerar UI-renderingsprestanda. Den visar hur snabbt din skärm tar emot och renderar bildrutor. Prestandaproblem här påverkar inte inspelningskvaliteten men kan påverka din förmåga att övervaka kameror i realtid.","statsSourceShort": "Display renderar bilder, servern fångar bilder.",- "statsSourceLong": "Servern är den faktiska hastigheten som bildrutor hämtas/spelas in från kameran, medan visningen är hastigheten de tas emot och renderas. SkellyCam prioriterar serversidans prestanda för inspelningskvalitet, så det numret bör förbli mer stabilt. Om visningens bildfrekvens avviker från servern indikerar det att dina systemresurser är belastade. Överväg att använda färre kameror eller minska bildfrekvens/upplösning.",+ "statsSourceLong": "Servern är den faktiska hastigheten som bildrutor hämtas/spelas in från kameran, medan visningen är hastigheten de tas emot och renderas. FreeMoCap prioriterar serversidans prestanda för inspelningskvalitet, så det numret bör förbli mer stabilt. Om visningens bildfrekvens avviker från servern indikerar det att dina systemresurser är belastade. Överväg att använda färre kameror eller minska bildfrekvens/upplösning.","statsCurrentShort": "Senaste bildtid och FPS.","statsCurrentLong": "Visar den senaste mätningen av hur lång tid det tar att behandla en enskild bildruta (i millisekunder) och motsvarande bildrutor per sekund (FPS). Lägre bildrutetider och högre FPS indikerar bättre prestanda.","statsMinShort": "Snabbaste bildtid och högsta FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Standardavvikelsen mäter variationen i bildrutetider. Lägre värden indikerar mer konsekvent prestanda. Variationskoefficienten (CV%) uttrycker denna variabilitet som en procent av medelvärdet, vilket underlättar jämförelse av stabilitet över olika bildhastigheter. Lägre CV% indikerar mer stabil prestanda.","aiTranslatedTooltip": "Denna översättning genererades av AI och kan innehålla fel. Om du talar detta språk, hjälp oss förbättra den!","humanValidatedTooltip": "Denna översättning har granskats av en mänsklig översättare.",- "helpTranslate": "Hjälp till att översätta SkellyCam",+ "helpTranslate": "Hjälp till att översätta FreeMoCap","failedToFetch": "Hämtning misslyckades","recordings": "Inspelningar","noRecordingsFound": "Inga inspelningar hittades. Ange en sökväg ovan för att ladda manuellt.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentation","menuGitHubRepository": "GitHub-förråd","menuReportIssue": "Rapportera ett problem…",- "menuAbout": "Om SkellyCam",+ "menuAbout": "Om FreeMoCap","menuPlayback": "Uppspelning","videoPlayback": "Uppspelning","copyLogsToClipboard": "Kopiera loggar till urklipp",diff --git a/freemocap-ui/src/i18n/locales/sw-kiswahili.json b/freemocap-ui/src/i18n/locales/sw-kiswahili.jsonindex 8ae10bca..ffb3aa6e 100644--- a/freemocap-ui/src/i18n/locales/sw-kiswahili.json+++ b/freemocap-ui/src/i18n/locales/sw-kiswahili.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Karibu SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Karibu FreeMoCap","welcomeSubtitle": "Rekodi na Utazame Video Zilizosawazishwa","sendAnonymousPings": "Tuma pings za matumizi bila kutambulishwa","footerWith": "na",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Inaonyesha fremu zilizopokelewa kwenye skrini.","displayTooltipLong": "Onyesho linawakilisha utendaji wa uonyeshaji wa UI. Linaonyesha jinsi onyesho lako linavyopokea na kuonyesha fremu haraka. Matatizo ya utendaji hapa hayataathiri ubora wa kurekodi lakini yanaweza kuathiri uwezo wako wa kufuatilia kamera kwa wakati halisi.","statsSourceShort": "Onyesho linaonyesha fremu, Seva inakamata fremu.",- "statsSourceLong": "Seva ni kasi halisi ambayo fremu zinachukuliwa/kurekodiwa kutoka kwa kamera, wakati onyesho ni kasi ambayo zinapokelewa na kuonyeshwa. Skellycam inatanguliza utendaji wa upande wa seva kwa ubora wa kurekodi, kwa hivyo nambari hiyo inapaswa kubaki thabiti zaidi. Ikiwa kasi ya fremu ya onyesho inatofautiana na seva, inaonyesha rasilimali za mfumo wako zimezidiwa. Fikiria kutumia kamera chache au kupunguza kasi ya fremu/ubora.",+ "statsSourceLong": "Seva ni kasi halisi ambayo fremu zinachukuliwa/kurekodiwa kutoka kwa kamera, wakati onyesho ni kasi ambayo zinapokelewa na kuonyeshwa. FreeMoCap inatanguliza utendaji wa upande wa seva kwa ubora wa kurekodi, kwa hivyo nambari hiyo inapaswa kubaki thabiti zaidi. Ikiwa kasi ya fremu ya onyesho inatofautiana na seva, inaonyesha rasilimali za mfumo wako zimezidiwa. Fikiria kutumia kamera chache au kupunguza kasi ya fremu/ubora.","statsCurrentShort": "Muda wa fremu wa hivi karibuni na FPS inayolingana.","statsCurrentLong": "Hii inaonyesha kipimo cha hivi karibuni cha muda unaochukua kuchakata fremu moja (kwa milisekunde) na fremu sawa kwa sekunde (FPS). Muda mfupi wa fremu na FPS ya juu inaonyesha utendaji bora.","statsMinShort": "Muda wa fremu wa haraka zaidi (ucheleweshaji wa chini) na FPS ya juu zaidi iliyofikiwa.",@@ -211,7 +211,7 @@"statsStdDevLong": "Kupotoka kwa kawaida kunapima kiasi cha tofauti katika nyakati za fremu. Thamani za chini zinaonyesha utendaji thabiti zaidi. Mgawo wa Tofauti (CV%) unaeleza utofauti huu kama asilimia ya wastani, na kurahisisha kulinganisha uthabiti kati ya viwango tofauti vya fremu. CV% ya chini inaonyesha utendaji thabiti zaidi.","aiTranslatedTooltip": "Tafsiri hii imezalishwa na AI na inaweza kuwa na makosa. Ikiwa unazungumza lugha hii, unaweza kusaidia kuiboresha kwa kufungua pull request kwenye GitHub!","humanValidatedTooltip": "Tafsiri hii imekaguliwa na kuthibitishwa na mtafsiri binadamu.",- "helpTranslate": "Saidia kutafsiri SkellyCam",+ "helpTranslate": "Saidia kutafsiri FreeMoCap","failedToFetch": "Imeshindwa kupata","recordings": "Rekodi","noRecordingsFound": "Hakuna rekodi zilizopatikana. Ingiza njia hapo juu kupakia kwa mikono.",@@ -239,7 +239,7 @@"menuDocumentation": "Nyaraka","menuGitHubRepository": "Hifadhi ya GitHub","menuReportIssue": "Ripoti tatizo…",- "menuAbout": "Kuhusu SkellyCam",+ "menuAbout": "Kuhusu FreeMoCap","menuPlayback": "Cheza upya","videoPlayback": "Uchezaji","copyLogsToClipboard": "Nakili kumbukumbu kwenye ubao wa kunakili",diff --git a/freemocap-ui/src/i18n/locales/ta-tamil.json b/freemocap-ui/src/i18n/locales/ta-tamil.jsonindex 66714458..f698428c 100644--- a/freemocap-ui/src/i18n/locales/ta-tamil.json+++ b/freemocap-ui/src/i18n/locales/ta-tamil.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam-க்கு வரவேற்கிறோம்",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap-க்கு வரவேற்கிறோம்","welcomeSubtitle": "ஒத்திசைக்கப்பட்ட வீடியோக்களைப் பதிவுசெய்து பாருங்கள்","sendAnonymousPings": "அநாமதேய பயன்பாட்டு பிங்குகளை அனுப்பு","footerWith": "உடன்",@@ -196,7 +196,7 @@"rendersReceivedFrames": "பெறப்பட்ட பிரேம்களைத் திரையில் காட்டுகிறது.","displayTooltipLong": "காட்சி UI வழங்கல் செயல்திறனைக் குறிக்கிறது. உங்கள் காட்சி எவ்வளவு விரைவாக பிரேம்களைப் பெறுகிறது மற்றும் காட்டுகிறது என்பதைக் காட்டுகிறது. இங்கு செயல்திறன் சிக்கல்கள் பதிவு தரத்தை பாதிக்காது ஆனால் நிகழ்நேர கேமரா கண்காணிப்பைப் பாதிக்கலாம்.","statsSourceShort": "காட்சி பிரேம்களை வழங்குகிறது, சர்வர் பிரேம்களைப் பிடிக்கிறது.",- "statsSourceLong": "சர்வர் கேமராவிலிருந்து பிரேம்கள் இழுக்கப்படும்/பதிவு செய்யப்படும் உண்மையான வேகம், காட்சி அவை பெறப்பட்டு வழங்கப்படும் வேகம். Skellycam பதிவு தரத்திற்காக சர்வர் பக்க செயல்திறனுக்கு முன்னுரிமை அளிக்கிறது, எனவே அந்த எண் நிலையாக இருக்க வேண்டும். காட்சி பிரேம் வேகம் சர்வரிலிருந்து வேறுபட்டால், உங்கள் கணினி வளங்கள் அதிக சுமையில் உள்ளன என்பதைக் குறிக்கிறது. குறைவான கேமராக்களைப் பயன்படுத்துவதை அல்லது பிரேம் வேகம்/தெளிவுத்திறனைக் குறைப்பதைக் கருதுங்கள்.",+ "statsSourceLong": "சர்வர் கேமராவிலிருந்து பிரேம்கள் இழுக்கப்படும்/பதிவு செய்யப்படும் உண்மையான வேகம், காட்சி அவை பெறப்பட்டு வழங்கப்படும் வேகம். FreeMoCap பதிவு தரத்திற்காக சர்வர் பக்க செயல்திறனுக்கு முன்னுரிமை அளிக்கிறது, எனவே அந்த எண் நிலையாக இருக்க வேண்டும். காட்சி பிரேம் வேகம் சர்வரிலிருந்து வேறுபட்டால், உங்கள் கணினி வளங்கள் அதிக சுமையில் உள்ளன என்பதைக் குறிக்கிறது. குறைவான கேமராக்களைப் பயன்படுத்துவதை அல்லது பிரேம் வேகம்/தெளிவுத்திறனைக் குறைப்பதைக் கருதுங்கள்.","statsCurrentShort": "மிக சமீபத்திய பிரேம் நேரம் மற்றும் தொடர்புடைய FPS.","statsCurrentLong": "ஒரு பிரேமை செயலாக்க எவ்வளவு நேரம் ஆகிறது (மில்லிசெகண்டுகளில்) மற்றும் சமமான FPS இன் மிக சமீபத்திய அளவீட்டைக் காட்டுகிறது. குறைந்த பிரேம் நேரங்கள் மற்றும் அதிக FPS சிறந்த செயல்திறனைக் குறிக்கிறது.","statsMinShort": "வேகமான பிரேம் நேரம் (குறைந்த தாமதம்) மற்றும் அடையப்பட்ட அதிகபட்ச FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "நிலையான விலகல் பிரேம் நேரங்களில் உள்ள மாறுபாட்டின் அளவை அளவிடுகிறது. குறைந்த மதிப்புகள் நிலையான செயல்திறனைக் குறிக்கிறது. மாறுபாட்டுக் குணகம் (CV%) இந்த மாறுபாட்டை சராசரியின் சதவிகிதமாக வெளிப்படுத்துகிறது, வெவ்வேறு பிரேம் வேகங்களில் நிலைத்தன்மையை ஒப்பிடுவதை எளிதாக்குகிறது. குறைந்த CV% நிலையான செயல்திறனைக் குறிக்கிறது.","aiTranslatedTooltip": "இந்த மொழிபெயர்ப்பு AI ஆல் உருவாக்கப்பட்டது மற்றும் பிழைகள் இருக்கலாம். நீங்கள் இந்த மொழி பேசினால், GitHub இல் pull request திறந்து மேம்படுத்த உதவலாம்!","humanValidatedTooltip": "இந்த மொழிபெயர்ப்பு மனித மொழிபெயர்ப்பாளரால் மதிப்பாய்வு செய்யப்பட்டு சரிபார்க்கப்பட்டது.",- "helpTranslate": "SkellyCam மொழிபெயர்க்க உதவுங்கள்",+ "helpTranslate": "FreeMoCap மொழிபெயர்க்க உதவுங்கள்","failedToFetch": "பெற இயலவில்லை","recordings": "பதிவுகள்","noRecordingsFound": "பதிவுகள் எதுவும் கிடைக்கவில்லை. கைமுறையாக ஏற்ற மேலே ஒரு பாதையை உள்ளிடுக.",@@ -239,7 +239,7 @@"menuDocumentation": "ஆவணமாக்கல்","menuGitHubRepository": "GitHub களஞ்சியம்","menuReportIssue": "சிக்கலைப் புகாரளி…",- "menuAbout": "SkellyCam பற்றி",+ "menuAbout": "FreeMoCap பற்றி","menuPlayback": "பின்னோக்கி இயக்கு","videoPlayback": "மீளியக்கம்","copyLogsToClipboard": "பதிவுகளை கிளிப்போர்டுக்கு நகலெடு",diff --git a/freemocap-ui/src/i18n/locales/th-thai.json b/freemocap-ui/src/i18n/locales/th-thai.jsonindex 7d9dfc1d..056516a4 100644--- a/freemocap-ui/src/i18n/locales/th-thai.json+++ b/freemocap-ui/src/i18n/locales/th-thai.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "ยินดีต้อนรับสู่ SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "ยินดีต้อนรับสู่ FreeMoCap","welcomeSubtitle": "บันทึกและดูวิดีโอที่ซิงค์","sendAnonymousPings": "ส่งข้อมูลการใช้งานแบบไม่ระบุตัวตน","footerWith": "ด้วย",@@ -196,7 +196,7 @@"rendersReceivedFrames": "เรนเดอร์เฟรมที่ได้รับบนหน้าจอ","displayTooltipLong": "จอแสดงผลแสดงประสิทธิภาพการเรนเดอร์ UI แสดงให้เห็นว่าจอแสดงผลของคุณรับและเรนเดอร์เฟรมได้เร็วแค่ไหน ปัญหาประสิทธิภาพที่นี่จะไม่ส่งผลต่อคุณภาพการบันทึก แต่อาจส่งผลต่อความสามารถในการตรวจสอบกล้องแบบเรียลไทม์","statsSourceShort": "จอแสดงผลเรนเดอร์เฟรม เซิร์ฟเวอร์จับเฟรม",- "statsSourceLong": "เซิร์ฟเวอร์คืออัตราจริงที่เฟรมถูกดึง/บันทึกจากกล้อง ในขณะที่จอแสดงผลคืออัตราที่ได้รับและเรนเดอร์ SkellyCam ให้ความสำคัญกับประสิทธิภาพฝั่งเซิร์ฟเวอร์เพื่อคุณภาพการบันทึก ดังนั้นตัวเลขนั้นควรจะเสถียรกว่า หากเฟรมเรทการแสดงผลแตกต่างจากเซิร์ฟเวอร์ แสดงว่าทรัพยากรระบบของคุณถูกใช้งานหนัก ลองใช้กล้องน้อยลงหรือลดเฟรมเรท/ความละเอียด",+ "statsSourceLong": "เซิร์ฟเวอร์คืออัตราจริงที่เฟรมถูกดึง/บันทึกจากกล้อง ในขณะที่จอแสดงผลคืออัตราที่ได้รับและเรนเดอร์ FreeMoCap ให้ความสำคัญกับประสิทธิภาพฝั่งเซิร์ฟเวอร์เพื่อคุณภาพการบันทึก ดังนั้นตัวเลขนั้นควรจะเสถียรกว่า หากเฟรมเรทการแสดงผลแตกต่างจากเซิร์ฟเวอร์ แสดงว่าทรัพยากรระบบของคุณถูกใช้งานหนัก ลองใช้กล้องน้อยลงหรือลดเฟรมเรท/ความละเอียด","statsCurrentShort": "เวลาเฟรมและ FPS ล่าสุด","statsCurrentLong": "แสดงการวัดล่าสุดของเวลาที่ใช้ในการประมวลผลเฟรมเดียว (เป็นมิลลิวินาที) และเฟรมต่อวินาที (FPS) ที่เทียบเท่า เวลาเฟรมต่ำกว่าและ FPS สูงกว่าบ่งบอกถึงประสิทธิภาพที่ดีกว่า","statsMinShort": "เวลาเฟรมเร็วที่สุดและ FPS สูงสุด",@@ -211,7 +211,7 @@"statsStdDevLong": "ส่วนเบี่ยงเบนมาตรฐานวัดปริมาณการเปลี่ยนแปลงในเวลาเฟรม ค่าต่ำกว่าบ่งบอกถึงประสิทธิภาพที่สม่ำเสมอมากขึ้น สัมประสิทธิ์การแปรผัน (CV%) แสดงความแปรปรวนนี้เป็นเปอร์เซ็นต์ของค่าเฉลี่ย ทำให้ง่ายต่อการเปรียบเทียบความเสถียรข้ามเฟรมเรทต่างๆ CV% ต่ำกว่าบ่งบอกถึงประสิทธิภาพที่เสถียรกว่า","aiTranslatedTooltip": "การแปลนี้สร้างโดย AI และอาจมีข้อผิดพลาด หากคุณพูดภาษานี้ ช่วยปรับปรุงได้!","humanValidatedTooltip": "การแปลนี้ได้รับการตรวจสอบโดยนักแปล",- "helpTranslate": "ช่วยแปล SkellyCam",+ "helpTranslate": "ช่วยแปล FreeMoCap","failedToFetch": "ดึงข้อมูลล้มเหลว","recordings": "การบันทึก","noRecordingsFound": "ไม่พบการบันทึก กรุณาป้อนเส้นทางด้านบนเพื่อโหลดด้วยตนเอง",@@ -239,7 +239,7 @@"menuDocumentation": "เอกสาร","menuGitHubRepository": "GitHub Repository","menuReportIssue": "รายงานปัญหา…",- "menuAbout": "เกี่ยวกับ SkellyCam",+ "menuAbout": "เกี่ยวกับ FreeMoCap","menuPlayback": "เล่นย้อน","videoPlayback": "เล่นย้อนหลัง","copyLogsToClipboard": "คัดลอกบันทึกไปยังคลิปบอร์ด",diff --git a/freemocap-ui/src/i18n/locales/tl-tagalog.json b/freemocap-ui/src/i18n/locales/tl-tagalog.jsonindex e9a521e5..6578bbf3 100644--- a/freemocap-ui/src/i18n/locales/tl-tagalog.json+++ b/freemocap-ui/src/i18n/locales/tl-tagalog.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Maligayang pagdating sa SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Maligayang pagdating sa FreeMoCap","welcomeSubtitle": "Mag-record at Manood ng Naka-sync na mga Video","sendAnonymousPings": "Magpadala ng anonymous na usage pings","footerWith": "kasama ang",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Nire-render ang mga natanggap na frame sa screen.","displayTooltipLong": "Ang Display ay kumakatawan sa UI rendering performance. Ipinapakita nito kung gaano kabilis ang iyong display sa pagtanggap at pag-render ng mga frame. Ang mga isyu sa performance dito ay hindi makakaapekto sa recording quality ngunit maaaring maapektuhan ang kakayahan mong mag-monitor ng mga camera sa real-time.","statsSourceShort": "Ang Display ay nagre-render ng mga frame, ang Server ay kumukuha ng mga frame.",- "statsSourceLong": "Ang server ang tunay na bilis kung saan kinukuha/nire-record ang mga frame mula sa camera, habang ang display ay ang bilis kung saan natatanggap at nire-render ang mga ito. Prayoridad ng Skellycam ang server-side performance para sa recording quality, kaya mas stable dapat ang numerong iyon. Kung nag-diverge ang display framerate mula sa server, ibig sabihin sobra na ang load sa system resources mo. Isaalang-alang ang paggamit ng mas kaunting camera o pagbaba ng framerate/resolution.",+ "statsSourceLong": "Ang server ang tunay na bilis kung saan kinukuha/nire-record ang mga frame mula sa camera, habang ang display ay ang bilis kung saan natatanggap at nire-render ang mga ito. Prayoridad ng FreeMoCap ang server-side performance para sa recording quality, kaya mas stable dapat ang numerong iyon. Kung nag-diverge ang display framerate mula sa server, ibig sabihin sobra na ang load sa system resources mo. Isaalang-alang ang paggamit ng mas kaunting camera o pagbaba ng framerate/resolution.","statsCurrentShort": "Pinakabagong frame time at katumbas na FPS.","statsCurrentLong": "Ipinapakita nito ang pinakabagong sukat kung gaano katagal mag-process ng isang frame (sa milliseconds) at ang katumbas na frames per second (FPS). Ang mas mababang frame time at mas mataas na FPS ay nagpapahiwatig ng mas magandang performance.","statsMinShort": "Pinakamabilis na frame time (pinakamababang latency) at pinakamataas na FPS na nakamit.",@@ -211,7 +211,7 @@"statsStdDevLong": "Sinusukat ng standard deviation ang dami ng variation sa mga frame time. Ang mas mababang halaga ay nagpapahiwatig ng mas consistent na performance. Ang Coefficient of Variation (CV%) ay nagpapahayag ng variability na ito bilang porsyento ng mean, na nagpapadali ng paghahambing ng stability sa iba't ibang frame rate. Ang mas mababang CV% ay nagpapahiwatig ng mas stable na performance.","aiTranslatedTooltip": "Ang pagsasaling ito ay nabuo ng AI at maaaring may mga pagkakamali. Kung nagsasalita ka ng wikang ito, makakatulong ka sa pagpapabuti nito sa pamamagitan ng pagbukas ng pull request sa GitHub!","humanValidatedTooltip": "Ang pagsasaling ito ay nasuri at na-validate ng isang taong tagapagsalin.",- "helpTranslate": "Tumulong magsalin ng SkellyCam",+ "helpTranslate": "Tumulong magsalin ng FreeMoCap","failedToFetch": "Hindi nakuha","recordings": "Mga Recording","noRecordingsFound": "Walang nakitang recording. Mag-enter ng path sa itaas para manual na mag-load.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokumentasyon","menuGitHubRepository": "GitHub Repository","menuReportIssue": "Mag-ulat ng isyu…",- "menuAbout": "Tungkol sa SkellyCam",+ "menuAbout": "Tungkol sa FreeMoCap","menuPlayback": "Playback","videoPlayback": "Pag-playback","copyLogsToClipboard": "Kopyahin ang mga log sa clipboard",diff --git a/freemocap-ui/src/i18n/locales/tr-turkce.json b/freemocap-ui/src/i18n/locales/tr-turkce.jsonindex ad292e98..daf5acb7 100644--- a/freemocap-ui/src/i18n/locales/tr-turkce.json+++ b/freemocap-ui/src/i18n/locales/tr-turkce.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam'e Hoş Geldiniz",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap'e Hoş Geldiniz","welcomeSubtitle": "Senkronize videoları kaydedin ve izleyin","sendAnonymousPings": "Anonim kullanım verileri gönder","footerWith": "ile",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Alınan kareleri ekranda işler.","displayTooltipLong": "Ekran, kullanıcı arayüzü işleme performansını temsil eder. Ekranınızın kareleri ne kadar hızlı aldığını ve işlediğini gösterir. Buradaki performans sorunları kayıt kalitesini etkilemez ancak kameraları gerçek zamanlı izleme yeteneğinizi etkileyebilir.","statsSourceShort": "Ekran kareleri işler, sunucu kareleri yakalar.",- "statsSourceLong": "Sunucu, kameradan karelerin çekildiği/kaydedildiği gerçek hızdır; ekran ise alınma ve işlenme hızıdır. SkellyCam kayıt kalitesi için sunucu tarafı performansına öncelik verir, bu nedenle bu sayı daha kararlı kalmalıdır. Ekran kare hızı sunucudan saparsa, sistem kaynaklarınızın zorlandığını gösterir. Daha az kamera kullanmayı veya kare hızı/çözünürlüğü düşürmeyi düşünün.",+ "statsSourceLong": "Sunucu, kameradan karelerin çekildiği/kaydedildiği gerçek hızdır; ekran ise alınma ve işlenme hızıdır. FreeMoCap kayıt kalitesi için sunucu tarafı performansına öncelik verir, bu nedenle bu sayı daha kararlı kalmalıdır. Ekran kare hızı sunucudan saparsa, sistem kaynaklarınızın zorlandığını gösterir. Daha az kamera kullanmayı veya kare hızı/çözünürlüğü düşürmeyi düşünün.","statsCurrentShort": "En son kare süresi ve FPS.","statsCurrentLong": "Tek bir karenin işlenmesi için gereken sürenin (milisaniye cinsinden) ve karşılık gelen saniyedeki kare sayısının (FPS) en son ölçümünü gösterir. Daha düşük kare süreleri ve daha yüksek FPS daha iyi performans gösterir.","statsMinShort": "En hızlı kare süresi ve en yüksek FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Standart sapma, kare sürelerindeki değişim miktarını ölçer. Daha düşük değerler daha tutarlı performans gösterir. Değişim Katsayısı (CV%) bu değişkenliği ortalamanın yüzdesi olarak ifade eder, farklı kare hızları arasında kararlılık karşılaştırmasını kolaylaştırır. Daha düşük CV% daha kararlı performans gösterir.","aiTranslatedTooltip": "Bu çeviri yapay zeka tarafından oluşturuldu ve hatalar içerebilir. Bu dili konuşuyorsanız iyileştirmeye yardım edin!","humanValidatedTooltip": "Bu çeviri bir insan çevirmen tarafından doğrulanmıştır.",- "helpTranslate": "SkellyCam çevirisine yardım edin",+ "helpTranslate": "FreeMoCap çevirisine yardım edin","failedToFetch": "Veri alınamadı","recordings": "Kayıtlar","noRecordingsFound": "Kayıt bulunamadı. Manuel olarak yüklemek için yukarıya bir yol girin.",@@ -239,7 +239,7 @@"menuDocumentation": "Dokümantasyon","menuGitHubRepository": "GitHub deposu","menuReportIssue": "Sorun bildir…",- "menuAbout": "SkellyCam hakkında",+ "menuAbout": "FreeMoCap hakkında","menuPlayback": "Oynatma","videoPlayback": "Oynatma","copyLogsToClipboard": "Günlükleri panoya kopyala",diff --git a/freemocap-ui/src/i18n/locales/uk-ukrainska.json b/freemocap-ui/src/i18n/locales/uk-ukrainska.jsonindex 247b6ff9..e3ca3edf 100644--- a/freemocap-ui/src/i18n/locales/uk-ukrainska.json+++ b/freemocap-ui/src/i18n/locales/uk-ukrainska.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Ласкаво просимо до SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Ласкаво просимо до FreeMoCap","welcomeSubtitle": "Записуйте та переглядайте синхронізовані відео","sendAnonymousPings": "Надсилати анонімні дані використання","footerWith": "з",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Відображає отримані кадри на екрані.","displayTooltipLong": "Дисплей відображає продуктивність рендерингу інтерфейсу користувача. Показує, наскільки швидко ваш дисплей отримує та відтворює кадри. Проблеми з продуктивністю тут не вплинуть на якість запису, але можуть вплинути на можливість моніторингу камер у реальному часі.","statsSourceShort": "Дисплей рендерить кадри, сервер захоплює кадри.",- "statsSourceLong": "Сервер — це реальна швидкість, з якою кадри отримуються/записуються з камери, а дисплей — швидкість їх отримання та відтворення. SkellyCam пріоритизує серверну продуктивність для якості запису, тому це значення повинно залишатися стабільнішим. Якщо частота кадрів дисплея відхиляється від сервера, це вказує на навантаження системних ресурсів. Розгляньте використання меншої кількості камер або зниження частоти кадрів/роздільної здатності.",+ "statsSourceLong": "Сервер — це реальна швидкість, з якою кадри отримуються/записуються з камери, а дисплей — швидкість їх отримання та відтворення. FreeMoCap пріоритизує серверну продуктивність для якості запису, тому це значення повинно залишатися стабільнішим. Якщо частота кадрів дисплея відхиляється від сервера, це вказує на навантаження системних ресурсів. Розгляньте використання меншої кількості камер або зниження частоти кадрів/роздільної здатності.","statsCurrentShort": "Останній час кадру та FPS.","statsCurrentLong": "Показує останнє вимірювання часу обробки одного кадру (у мілісекундах) та відповідну кількість кадрів на секунду (FPS). Нижчий час кадру та вищий FPS вказують на кращу продуктивність.","statsMinShort": "Найшвидший час кадру та найвищий FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "Стандартне відхилення вимірює розкид часів кадрів. Нижчі значення вказують на стабільнішу продуктивність. Коефіцієнт варіації (CV%) виражає цю мінливість як відсоток від середнього, що спрощує порівняння стабільності при різних частотах кадрів. Нижчий CV% вказує на стабільнішу продуктивність.","aiTranslatedTooltip": "Цей переклад створений ШІ і може містити помилки. Якщо ви володієте цією мовою, допоможіть покращити його!","humanValidatedTooltip": "Цей переклад перевірено перекладачем.",- "helpTranslate": "Допоможіть перекласти SkellyCam",+ "helpTranslate": "Допоможіть перекласти FreeMoCap","failedToFetch": "Не вдалося отримати","recordings": "Записи","noRecordingsFound": "Записів не знайдено. Введіть шлях вище для завантаження вручну.",@@ -239,7 +239,7 @@"menuDocumentation": "Документація","menuGitHubRepository": "Репозиторій GitHub","menuReportIssue": "Повідомити про помилку…",- "menuAbout": "Про SkellyCam",+ "menuAbout": "Про FreeMoCap","menuPlayback": "Відтворення","videoPlayback": "Відтворення","copyLogsToClipboard": "Копіювати журнали в буфер обміну",diff --git a/freemocap-ui/src/i18n/locales/ur-urdu.json b/freemocap-ui/src/i18n/locales/ur-urdu.jsonindex 8625e662..42cb6671 100644--- a/freemocap-ui/src/i18n/locales/ur-urdu.json+++ b/freemocap-ui/src/i18n/locales/ur-urdu.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "SkellyCam میں خوش آمدید",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "FreeMoCap میں خوش آمدید","welcomeSubtitle": "ہم آہنگ ویڈیوز ریکارڈ اور دیکھیں","sendAnonymousPings": "گمنام استعمال کے پنگ بھیجیں","footerWith": "کے ساتھ",@@ -196,7 +196,7 @@"rendersReceivedFrames": "موصول شدہ فریمز کو اسکرین پر دکھاتا ہے۔","displayTooltipLong": "ڈسپلے UI رینڈرنگ کارکردگی کی نمائندگی کرتا ہے۔ یہ دکھاتا ہے کہ آپ کا ڈسپلے کتنی تیزی سے فریمز وصول کرتا اور دکھاتا ہے۔ یہاں کارکردگی کے مسائل ریکارڈنگ کے معیار کو متاثر نہیں کریں گے لیکن ریئل ٹائم میں کیمروں کی نگرانی کرنے کی آپ کی صلاحیت کو متاثر کر سکتے ہیں۔","statsSourceShort": "ڈسپلے فریمز دکھاتا ہے، سرور فریمز پکڑتا ہے۔",- "statsSourceLong": "سرور وہ اصل رفتار ہے جس پر فریمز کیمرے سے کھینچے/ریکارڈ کیے جاتے ہیں، جبکہ ڈسپلے وہ رفتار ہے جس پر وہ موصول اور دکھائے جاتے ہیں۔ Skellycam ریکارڈنگ کے معیار کے لیے سرور سائیڈ کارکردگی کو ترجیح دیتا ہے، اس لیے وہ نمبر زیادہ مستحکم رہنا چاہیے۔ اگر ڈسپلے فریم ریٹ سرور سے ہٹ جائے تو اس کا مطلب ہے کہ آپ کے سسٹم کے وسائل پر بوجھ ہے۔ کم کیمرے استعمال کرنے یا فریم ریٹ/ریزولیوشن کم کرنے پر غور کریں۔",+ "statsSourceLong": "سرور وہ اصل رفتار ہے جس پر فریمز کیمرے سے کھینچے/ریکارڈ کیے جاتے ہیں، جبکہ ڈسپلے وہ رفتار ہے جس پر وہ موصول اور دکھائے جاتے ہیں۔ FreeMoCap ریکارڈنگ کے معیار کے لیے سرور سائیڈ کارکردگی کو ترجیح دیتا ہے، اس لیے وہ نمبر زیادہ مستحکم رہنا چاہیے۔ اگر ڈسپلے فریم ریٹ سرور سے ہٹ جائے تو اس کا مطلب ہے کہ آپ کے سسٹم کے وسائل پر بوجھ ہے۔ کم کیمرے استعمال کرنے یا فریم ریٹ/ریزولیوشن کم کرنے پر غور کریں۔","statsCurrentShort": "تازہ ترین فریم ٹائم اور متعلقہ FPS۔","statsCurrentLong": "یہ ایک فریم پراسیس کرنے میں لگنے والے وقت (ملی سیکنڈ میں) اور مساوی FPS کی تازہ ترین پیمائش دکھاتا ہے۔ کم فریم ٹائم اور زیادہ FPS بہتر کارکردگی کی نشاندہی کرتی ہے۔","statsMinShort": "تیز ترین فریم ٹائم (کم ترین تاخیر) اور حاصل کردہ زیادہ سے زیادہ FPS۔",@@ -211,7 +211,7 @@"statsStdDevLong": "معیاری انحراف فریم ٹائمز میں تغیر کی مقدار ناپتا ہے۔ کم قدریں زیادہ مستقل کارکردگی کی نشاندہی کرتی ہیں۔ تغیر کا گتانک (CV%) اس تغیر پذیری کو اوسط کے فیصد کے طور پر ظاہر کرتا ہے، مختلف فریم ریٹس میں استحکام کا موازنہ آسان بناتا ہے۔ کم CV% زیادہ مستحکم کارکردگی کی نشاندہی کرتا ہے۔","aiTranslatedTooltip": "یہ ترجمہ AI کے ذریعے تیار کیا گیا ہے اور اس میں غلطیاں ہو سکتی ہیں۔ اگر آپ یہ زبان بولتے ہیں تو GitHub پر pull request کھول کر اسے بہتر بنانے میں مدد کر سکتے ہیں!","humanValidatedTooltip": "اس ترجمے کا انسانی مترجم نے جائزہ لیا اور تصدیق کی ہے۔",- "helpTranslate": "SkellyCam کا ترجمہ کرنے میں مدد کریں",+ "helpTranslate": "FreeMoCap کا ترجمہ کرنے میں مدد کریں","failedToFetch": "حاصل کرنے میں ناکام","recordings": "ریکارڈنگز","noRecordingsFound": "کوئی ریکارڈنگ نہیں ملی۔ دستی طور پر لوڈ کرنے کے لیے اوپر راستہ درج کریں۔",@@ -239,7 +239,7 @@"menuDocumentation": "دستاویزات","menuGitHubRepository": "GitHub ریپوزٹری","menuReportIssue": "مسئلے کی اطلاع دیں…",- "menuAbout": "SkellyCam کے بارے میں",+ "menuAbout": "FreeMoCap کے بارے میں","menuPlayback": "پلے بیک","videoPlayback": "پلے بیک","copyLogsToClipboard": "لاگز کلپ بورڈ پر کاپی کریں",diff --git a/freemocap-ui/src/i18n/locales/vi-tieng-viet.json b/freemocap-ui/src/i18n/locales/vi-tieng-viet.jsonindex 94872f30..8506a12e 100644--- a/freemocap-ui/src/i18n/locales/vi-tieng-viet.json+++ b/freemocap-ui/src/i18n/locales/vi-tieng-viet.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-23"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "Chào mừng đến với SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "Chào mừng đến với FreeMoCap","welcomeSubtitle": "Ghi và xem video đồng bộ","sendAnonymousPings": "Gửi dữ liệu sử dụng ẩn danh","footerWith": "với",@@ -196,7 +196,7 @@"rendersReceivedFrames": "Render các khung nhận được lên màn hình.","displayTooltipLong": "Hiển thị thể hiện hiệu suất render giao diện người dùng. Cho thấy màn hình của bạn nhận và render khung hình nhanh đến mức nào. Vấn đề hiệu suất ở đây sẽ không ảnh hưởng đến chất lượng ghi hình nhưng có thể ảnh hưởng đến khả năng giám sát camera theo thời gian thực.","statsSourceShort": "Hiển thị render khung, máy chủ chụp khung.",- "statsSourceLong": "Máy chủ là tốc độ thực tế mà khung hình được kéo/ghi từ camera, trong khi hiển thị là tốc độ nhận và render chúng. SkellyCam ưu tiên hiệu suất phía máy chủ cho chất lượng ghi hình, vì vậy con số đó sẽ ổn định hơn. Nếu tốc độ khung hình hiển thị lệch so với máy chủ, điều này cho thấy tài nguyên hệ thống đang bị quá tải. Hãy cân nhắc sử dụng ít camera hơn hoặc giảm tốc độ khung hình/độ phân giải.",+ "statsSourceLong": "Máy chủ là tốc độ thực tế mà khung hình được kéo/ghi từ camera, trong khi hiển thị là tốc độ nhận và render chúng. FreeMoCap ưu tiên hiệu suất phía máy chủ cho chất lượng ghi hình, vì vậy con số đó sẽ ổn định hơn. Nếu tốc độ khung hình hiển thị lệch so với máy chủ, điều này cho thấy tài nguyên hệ thống đang bị quá tải. Hãy cân nhắc sử dụng ít camera hơn hoặc giảm tốc độ khung hình/độ phân giải.","statsCurrentShort": "Thời gian khung và FPS mới nhất.","statsCurrentLong": "Hiển thị phép đo gần nhất về thời gian xử lý một khung hình đơn lẻ (tính bằng mili giây) và số khung hình mỗi giây (FPS) tương đương. Thời gian khung hình thấp hơn và FPS cao hơn cho thấy hiệu suất tốt hơn.","statsMinShort": "Thời gian khung nhanh nhất và FPS cao nhất.",@@ -211,7 +211,7 @@"statsStdDevLong": "Độ lệch chuẩn đo lường sự biến thiên trong thời gian khung hình. Giá trị thấp hơn cho thấy hiệu suất nhất quán hơn. Hệ số biến thiên (CV%) biểu thị sự biến động này dưới dạng phần trăm của trung bình, giúp so sánh tính ổn định giữa các tốc độ khung hình khác nhau dễ dàng hơn. CV% thấp hơn cho thấy hiệu suất ổn định hơn.","aiTranslatedTooltip": "Bản dịch này được tạo bởi AI và có thể chứa lỗi. Nếu bạn nói ngôn ngữ này, hãy giúp cải thiện!","humanValidatedTooltip": "Bản dịch này đã được người dịch xác nhận.",- "helpTranslate": "Giúp dịch SkellyCam",+ "helpTranslate": "Giúp dịch FreeMoCap","failedToFetch": "Lấy dữ liệu thất bại","recordings": "Bản ghi","noRecordingsFound": "Không tìm thấy bản ghi. Nhập đường dẫn phía trên để tải thủ công.",@@ -239,7 +239,7 @@"menuDocumentation": "Tài liệu","menuGitHubRepository": "Kho lưu trữ GitHub","menuReportIssue": "Báo cáo sự cố…",- "menuAbout": "Về SkellyCam",+ "menuAbout": "Về FreeMoCap","menuPlayback": "Phát lại","videoPlayback": "Phát lại","copyLogsToClipboard": "Sao chép nhật ký vào bộ nhớ tạm",diff --git a/freemocap-ui/src/i18n/locales/yi-yidish.json b/freemocap-ui/src/i18n/locales/yi-yidish.jsonindex 69e459ca..f9691f1b 100644--- a/freemocap-ui/src/i18n/locales/yi-yidish.json+++ b/freemocap-ui/src/i18n/locales/yi-yidish.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-24"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "ברוכים הבאים צו SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "ברוכים הבאים צו FreeMoCap","welcomeSubtitle": "אויפֿנעמען און באַקוקן סינכראָניזירטע ווידעאָס","sendAnonymousPings": "שיקן אַנאָנימע באַניצונג פּינגס","footerWith": "מיט",@@ -196,7 +196,7 @@"rendersReceivedFrames": "רענדערט באַקומענע בילדער אויפֿן עקראַן.","displayTooltipLong": "אַנווייַז פֿאָרשטעלט די UI רענדערינג פֿאַרמעגן. עס ווייַזט ווי שנעל אייַער אַנווייַז באַקומט און רענדערט בילדער. פּראָבלעמען דאָ וועלן נישט באַווירקן אויפֿנאַמע קוואַליטעט אָבער קענען באַווירקן אייַער פֿעיִקייט צו מאָניטאָרן קאַמערעס אין עכט-צייַט.","statsSourceShort": "אַנווייַז רענדערט בילדער, סערווער כאַפּט בילדער.",- "statsSourceLong": "דער סערווער איז דער אמתער ראַטע אין וועלכע בילדער ווערן געצויגן/אויפֿגענומען פֿון דער קאַמערע, בעת אַנווייַז איז דער ראַטע אין וועלכע זיי ווערן באַקומען און רענדערט. SkellyCam פּריאָריטיזירט סערווער-זייַט פֿאַרמעגן פֿאַר אויפֿנאַמע קוואַליטעט, אַזוי דער נומער זאָל בלייַבן מער סטאַביל. אויב דער אַנווייַז פרעימרייט אַוועקגייט פֿונעם סערווער, ווייַזט עס אַז אייַערע סיסטעם רעסורסן זענען באַלאַסט. טראַכט וועגן ניצן ווייניקער קאַמערעס אָדער פֿאַרמינערן פרעימרייט/רעזאָלוציע.",+ "statsSourceLong": "דער סערווער איז דער אמתער ראַטע אין וועלכע בילדער ווערן געצויגן/אויפֿגענומען פֿון דער קאַמערע, בעת אַנווייַז איז דער ראַטע אין וועלכע זיי ווערן באַקומען און רענדערט. FreeMoCap פּריאָריטיזירט סערווער-זייַט פֿאַרמעגן פֿאַר אויפֿנאַמע קוואַליטעט, אַזוי דער נומער זאָל בלייַבן מער סטאַביל. אויב דער אַנווייַז פרעימרייט אַוועקגייט פֿונעם סערווער, ווייַזט עס אַז אייַערע סיסטעם רעסורסן זענען באַלאַסט. טראַכט וועגן ניצן ווייניקער קאַמערעס אָדער פֿאַרמינערן פרעימרייט/רעזאָלוציע.","statsCurrentShort": "לעצטער בילד צייַט און FPS.","statsCurrentLong": "ווייַזט דאָס לעצטע מעסטונג ווי לאַנג עס נעמט צו פּראָצעסירן אַ איינצל בילד (אין מיליסעקונדעס) און דער עקוויוואַלענט פרעימז פּער סעקונדע (FPS). נידעריקערע בילד צייַטן און העכערע FPS ווייַזן בעסערע פֿאַרמעגן.","statsMinShort": "שנעלסטער בילד צייַט און העכסטער FPS.",@@ -211,7 +211,7 @@"statsStdDevLong": "סטאַנדאַרד אָפּוואייכונג מעסט די פֿאַריאַציע אין בילד צייַטן. נידעריקערע ווערטן ווייַזן מער קאָנסיסטענטע פֿאַרמעגן. דער קאָעפֿיציענט פֿון וואַריאַציע (CV%) דריקט אויס די פֿאַריאַבילקייט אַלס אַ פּראָצענט פֿונעם דורכשניט, וואָס מאַכט גרינגער צו פֿאַרגלייַכן סטאַבילקייט צווישן פֿאַרשידענע פרעימרייטן. נידעריקערער CV% ווייַזט מער סטאַבילע פֿאַרמעגן.","aiTranslatedTooltip": "די איבערזעצונג איז געשאַפֿן דורך AI און קען אַנטהאַלטן טעותן. אויב איר רעדט די שפּראַך, העלפֿט אונדז פֿאַרבעסערן אויף GitHub!","humanValidatedTooltip": "די איבערזעצונג איז איבערגעקוקט און באַשטעטיקט דורך אַ מענטשלעכן איבערזעצער.",- "helpTranslate": "העלפֿט איבערזעצן SkellyCam",+ "helpTranslate": "העלפֿט איבערזעצן FreeMoCap","failedToFetch": "נישט געלונגען צו לאָדן","recordings": "אויפֿנאַמעס","noRecordingsFound": "קיין אויפֿנאַמעס נישט געפֿונען. גיט אײַן אַ וועג אויבן צום לאָדן.",@@ -239,7 +239,7 @@"menuDocumentation": "דאָקומענטאַציע","menuGitHubRepository": "GitHub רעפּאָזיטאָריע","menuReportIssue": "מעלדן אַ פּראָבלעם…",- "menuAbout": "וועגן SkellyCam",+ "menuAbout": "וועגן FreeMoCap","menuPlayback": "שפּילן","videoPlayback": "שפּילן","copyLogsToClipboard": "קאָפּירן לאָגס צום קליפּבאָרד",diff --git a/freemocap-ui/src/i18n/locales/zh-CN-zhongwen.json b/freemocap-ui/src/i18n/locales/zh-CN-zhongwen.jsonindex 16909ec9..170cebca 100644--- a/freemocap-ui/src/i18n/locales/zh-CN-zhongwen.json+++ b/freemocap-ui/src/i18n/locales/zh-CN-zhongwen.json@@ -4,9 +4,9 @@"translationSource": "ai-generated","lastUpdated": "2026-02-22"},- "appName": "SkellyCam",- "appNameDecorated": "SkellyCam 💀📸",- "welcomeTitle": "欢迎使用 SkellyCam",+ "appName": "FreeMoCap",+ "appNameDecorated": "FreeMoCap 💀✨",+ "welcomeTitle": "欢迎使用 FreeMoCap","welcomeSubtitle": "录制和查看同步视频","sendAnonymousPings": "发送匿名使用数据","footerWith": "以",@@ -196,7 +196,7 @@"rendersReceivedFrames": "在屏幕上渲染接收到的帧。","displayTooltipLong": "显示代表UI渲染性能。它显示显示器接收和渲染帧的速度。此处的性能问题不会影响录制质量,但可能影响您实时监控摄像头的能力。","statsSourceShort": "显示渲染帧,服务器捕获帧。",- "statsSourceLong": "服务器是从摄像头拉取/录制帧的真实速率,而显示是接收和渲染帧的速率。SkellyCam优先考虑服务器端性能以保证录制质量,因此该数字应保持更稳定。如果显示帧率与服务器偏差较大,表明系统资源紧张。",+ "statsSourceLong": "服务器是从摄像头拉取/录制帧的真实速率,而显示是接收和渲染帧的速率。FreeMoCap优先考虑服务器端性能以保证录制质量,因此该数字应保持更稳定。如果显示帧率与服务器偏差较大,表明系统资源紧张。","statsCurrentShort": "最近的帧时间和对应的FPS。","statsCurrentLong": "显示处理单帧所需时间(毫秒)的最新测量值及等效的每秒帧数(FPS)。更低的帧时间和更高的FPS表示更好的性能。","statsMinShort": "最快帧时间(最低延迟)和达到的最高FPS。",@@ -211,7 +211,7 @@"statsStdDevLong": "标准差衡量帧时间的变化量。较低的值表示更一致的性能。变异系数(CV%)将此可变性表示为平均值的百分比,便于比较不同帧率下的稳定性。","aiTranslatedTooltip": "此翻译由AI生成,可能包含错误。如果您使用此语言,可以在GitHub上提交pull request来帮助改进翻译!","humanValidatedTooltip": "此翻译已经过人工译者审核和验证。",- "helpTranslate": "帮助翻译 SkellyCam",+ "helpTranslate": "帮助翻译 FreeMoCap","failedToFetch": "获取失败","recordings": "录制","noRecordingsFound": "未找到录制。请在上方输入路径手动加载。",@@ -239,7 +239,7 @@"menuDocumentation": "文档","menuGitHubRepository": "GitHub 仓库","menuReportIssue": "报告问题…",- "menuAbout": "关于 SkellyCam",+ "menuAbout": "关于 FreeMoCap","menuPlayback": "回放","videoPlayback": "回放","copyLogsToClipboard": "复制日志到剪贴板",diff --git a/freemocap-ui/src/layout/AppContent.tsx b/freemocap-ui/src/layout/AppContent.tsxindex 535275c4..55ea56f1 100644--- a/freemocap-ui/src/layout/AppContent.tsx+++ b/freemocap-ui/src/layout/AppContent.tsx@@ -1,32 +1,43 @@import * as React from 'react';-import { ThemeProvider } from '@mui/material/styles';-import { HashRouter } from 'react-router-dom';-import { CssBaseline } from '@mui/material';-import { BasePanelLayout } from '@/layout/BasePanelLayout';-import { createExtendedTheme } from '@/layout/paperbase-theme';-import { useAppSelector } from '@/store';-import { BaseContentRouter } from '@/layout/BaseContentRouter';-import { FirstLaunchRedirect } from '@/components/setup-wizard/FirstLaunchRedirect';-import { MenuNavigationListener } from '@/components/MenuNavigationListener';+import {ThemeProvider} from '@mui/material/styles';+import {HashRouter} from 'react-router-dom';+import {CssBaseline} from "@mui/material";+import {BasePanelLayout} from "@/layout/BasePanelLayout";+import {createExtendedTheme} from "@/layout/paperbase-theme";+import {useAppSelector} from "@/store";+import {BaseContentRouter} from "@/layout/BaseContentRouter";+import {UpdateBanner} from "@/components/ui-components/UpdateBanner";+import {AutoUpdateProvider} from "@/hooks/AutoUpdateContext";+import {useTranslation} from "react-i18next";+import {getLocaleDirection} from "@/i18n";export const AppContent = function () {+ const {i18n} = useTranslation();const themeMode = useAppSelector(state => state.theme.mode);+ const direction = getLocaleDirection(i18n.language);- const theme = React.useMemo(() =>- createExtendedTheme(themeMode),- [themeMode],- );+ // Sync document-level direction and lang attributes with current locale+ React.useEffect(() => {+ document.documentElement.dir = direction;+ document.documentElement.lang = i18n.language;+ }, [direction, i18n.language]);++ const theme = React.useMemo(() => {+ const base = createExtendedTheme(themeMode);+ return {...base, direction};+ }, [themeMode, direction]);return (<ThemeProvider theme={theme}>- <CssBaseline />+ <CssBaseline/><HashRouter>- <FirstLaunchRedirect />- <MenuNavigationListener />- <BasePanelLayout>- <BaseContentRouter />- </BasePanelLayout>+ <AutoUpdateProvider>+ <BasePanelLayout>+ <BaseContentRouter/>+ </BasePanelLayout>+ <UpdateBanner/>+ </AutoUpdateProvider></HashRouter></ThemeProvider>);-};+}diff --git a/freemocap-ui/src/layout/BaseContentRouter.tsx b/freemocap-ui/src/layout/BaseContentRouter.tsxindex 34818701..534856f6 100644--- a/freemocap-ui/src/layout/BaseContentRouter.tsx+++ b/freemocap-ui/src/layout/BaseContentRouter.tsx@@ -1,22 +1,18 @@import React from 'react';-import { Navigate, Route, Routes } from 'react-router-dom';-import { CamerasPage } from '@/pages/CamerasPage';-import VideosPage from '@/pages/VideosPage';-import WelcomePage from '@/pages/WelcomePage';-import { Viewport3dPage } from '@/pages/Viewport3dPage';-import { SettingsPage } from '@/pages/SettingsPage';+import {Navigate, Route, Routes} from 'react-router-dom';+import {CamerasPage} from "@/pages/CamerasPage";+import PlaybackPage from "@/pages/PlaybackPage";+import WelcomePage from "@/pages/WelcomePage";+import SettingsPage from "@/pages/SettingsPage";export const BaseContentRouter: React.FC = () => {return (<Routes><Route path="/" element={<WelcomePage />} />- <Route path="/cameras" element={<CamerasPage />} />- <Route path="/videos" element={<VideosPage />} />- <Route path="/viewport3d" element={<Viewport3dPage />} />- <Route path="/settings" element={<SettingsPage />} />- {/* Legacy route redirect */}- <Route path="/setup" element={<Navigate to="/settings" replace />} />- <Route path="*" element={<Navigate to="/" replace />} />+ <Route path="/cameras" element={<CamerasPage/>}/>+ <Route path="/playback" element={<PlaybackPage/>}/>+ <Route path="/settings" element={<SettingsPage/>}/>+ <Route path="*" element={<Navigate to="/" replace/>}/></Routes>);};diff --git a/freemocap-ui/src/layout/BasePanelLayout.tsx b/freemocap-ui/src/layout/BasePanelLayout.tsxindex cd5f4ae7..a3400a5a 100644--- a/freemocap-ui/src/layout/BasePanelLayout.tsx+++ b/freemocap-ui/src/layout/BasePanelLayout.tsx@@ -1,15 +1,42 @@// freemocap-ui/src/layout/BasePanelLayout.tsx-import React from "react";-import {Panel, PanelGroup, PanelResizeHandle} from "react-resizable-panels";+import React, {useCallback, useRef, useState} from "react";+import {ImperativePanelHandle, Panel, PanelGroup, PanelResizeHandle} from "react-resizable-panels";import {LeftSidePanelContent} from "@/components/ui-components/LeftSidePanelContent";import BottomPanelContent from "@/components/ui-components/BottomPanelContent";import {useTheme} from "@mui/material/styles";import {Box} from "@mui/material";-import {useLocation} from "react-router-dom";+import {useMenuActions} from "@/hooks/useMenuActions";+import {useKeyboardShortcuts} from "@/hooks/useKeyboardShortcuts";export const BasePanelLayout = ({children}: { children: React.ReactNode }) => {const theme = useTheme();- const location = useLocation();+ const leftPanelRef = useRef<ImperativePanelHandle>(null);+ const [isCollapsed, setIsCollapsed] = useState(false);++ const handleToggleCollapse = useCallback(() => {+ const panel = leftPanelRef.current;+ if (!panel) return;++ if (panel.isCollapsed()) {+ panel.expand();+ } else {+ panel.collapse();+ }+ }, []);++ const handlePanelCollapse = useCallback(() => {+ setIsCollapsed(true);+ }, []);++ const handlePanelExpand = useCallback(() => {+ setIsCollapsed(false);+ }, []);++ // Connect native menu actions to the app+ useMenuActions({ onToggleSidebar: handleToggleCollapse });++ // Register global keyboard shortcuts (Ctrl+Shift+L, Shift+Space, etc.)+ useKeyboardShortcuts();return (<Box sx={{display: 'flex', flexDirection: 'column', height: '100vh'}}>@@ -17,11 +44,22 @@ export const BasePanelLayout = ({children}: { children: React.ReactNode }) => {direction="vertical"style={{flex: 1}}>- {/* Top section (horizontal panels) - 80% height */}+ {/* Top section (horizontal panels) */}<Panel defaultSize={87} minSize={20}>- <PanelGroup direction="horizontal">- <Panel collapsible defaultSize={24} minSize={10} collapsedSize={4}>- <LeftSidePanelContent/>+ <PanelGroup direction="horizontal" style={{direction: "ltr"}}>+ <Panel+ ref={leftPanelRef}+ collapsible+ defaultSize={24}+ minSize={10}+ collapsedSize={3}+ onCollapse={handlePanelCollapse}+ onExpand={handlePanelExpand}+ >+ <LeftSidePanelContent+ isCollapsed={isCollapsed}+ onToggleCollapse={handleToggleCollapse}+ /></Panel>{/* Horizontal Resize Handle */}<PanelResizeHandle@@ -32,7 +70,7 @@ export const BasePanelLayout = ({children}: { children: React.ReactNode }) => {}}/>- {/*Main/Central Content Panel*/}+ {/* Main/Central Content Panel */}<Panel defaultSize={76} minSize={10}>{children}</Panel>diff --git a/freemocap-ui/src/layout/paperbase-theme.ts b/freemocap-ui/src/layout/paperbase-theme.tsindex e54b7202..5f537bc4 100644--- a/freemocap-ui/src/layout/paperbase-theme.ts+++ b/freemocap-ui/src/layout/paperbase-theme.ts@@ -45,9 +45,9 @@ const getBaseTheme = (mode: PaletteMode) => ({const darkPalette = {mode: 'dark' as PaletteMode,primary: {- light: '#5e92f3',- main: '#104172',- dark: '#002a60',+ light: '#90b4f8',+ main: '#5e92f3',+ dark: '#163a6d',contrastText: '#ffffff',},secondary: {@@ -220,7 +220,7 @@ export const createExtendedTheme = (mode: PaletteMode) => {root: {color: mode === 'dark' ? baseTheme.palette.grey[400] : baseTheme.palette.grey[600],'&.Mui-checked': {- color: baseTheme.palette.primary.main,+ color: mode === 'dark' ? baseTheme.palette.info.main : baseTheme.palette.primary.main,},'&.Mui-disabled': {color: mode === 'dark' ? baseTheme.palette.grey[700] : baseTheme.palette.grey[400],@@ -233,7 +233,7 @@ export const createExtendedTheme = (mode: PaletteMode) => {root: {color: mode === 'dark' ? baseTheme.palette.grey[400] : baseTheme.palette.grey[600],'&.Mui-checked': {- color: baseTheme.palette.primary.main,+ color: mode === 'dark' ? baseTheme.palette.info.main : baseTheme.palette.primary.main,},},},diff --git a/freemocap-ui/src/layout/paperbase_theme/PaperbaseContent.tsx b/freemocap-ui/src/layout/paperbase_theme/PaperbaseContent.tsxdeleted file mode 100644index f4535106..00000000--- a/freemocap-ui/src/layout/paperbase_theme/PaperbaseContent.tsx+++ /dev/null@@ -1,29 +0,0 @@-import * as React from 'react';-import {ThemeProvider} from '@mui/material/styles';-import {HashRouter} from 'react-router-dom';-import {CssBaseline} from "@mui/material";-import {BasePanelLayout} from "@/layout/BasePanelLayout";-import {createExtendedTheme} from "@/layout/paperbase_theme/paperbase-theme";-import {useAppSelector} from "@/store/AppStateStore";-import {BaseContentRouter} from "@/layout/BaseContentRouter";--export const PaperbaseContent = function () {-- const themeMode = useAppSelector(state => state.theme.mode);- // Create theme dynamically based on current mode-- const theme = React.useMemo(() =>- createExtendedTheme(themeMode),- [themeMode]- );- return (- <ThemeProvider theme={theme}>- <CssBaseline/>- <HashRouter>- <BasePanelLayout>- <BaseContentRouter/>- </BasePanelLayout>- </HashRouter>- </ThemeProvider>- );-}diff --git a/freemocap-ui/src/layout/paperbase_theme/paperbase-theme.ts b/freemocap-ui/src/layout/paperbase_theme/paperbase-theme.tsdeleted file mode 100644index 9718e96d..00000000--- a/freemocap-ui/src/layout/paperbase_theme/paperbase-theme.ts+++ /dev/null@@ -1,255 +0,0 @@-// freemocap-ui/src/layout/paperbase_theme/paperbase-theme.ts-import {createTheme, PaletteMode} from '@mui/material/styles';--// Define common theme settings-const getBaseTheme = (mode: PaletteMode) => ({- typography: {- h5: {- fontWeight: 500,- fontSize: 26,- letterSpacing: 0.5,- },- },- shape: {- borderRadius: 8,- },- mixins: {- toolbar: {- minHeight: 48,- },- },- components: {- MuiTab: {- defaultProps: {- disableRipple: true,- },- },- },-});--// Define the dark theme palette-const darkPalette = {- mode: 'dark' as PaletteMode,- primary: {- light: '#00597f',- main: '#002d46',- dark: '#000b10',- },- background: {- default: '#121212',- paper: '#1e1e1e',- },- text: {- primary: '#ffffff',- secondary: '#b0b0b0',- },- divider: 'rgba(255, 255, 255, 0.12)',-};--// Define the light theme palette-const lightPalette = {- mode: 'light' as PaletteMode,- primary: {- light: '#4299e1',- main: '#0067a3',- dark: '#003e73',- },- background: {- default: '#f5f5f5',- paper: '#ffffff',- },- text: {- primary: '#333333',- secondary: '#555555',- },- divider: 'rgba(0, 0, 0, 0.12)',-};--// Create theme based on the palette mode-export const createAppTheme = (mode: PaletteMode) => {- const baseTheme = getBaseTheme(mode);- const palette = mode === 'dark' ? darkPalette : lightPalette;-- return createTheme({- ...baseTheme,- palette,- });-};--// Export base themes for reference-export const paperbaseThemeLight = createAppTheme('light');-export const paperbaseThemeDark = createAppTheme('dark');--// Create the extended theme components that apply to both light/dark modes-export const createExtendedTheme = (mode: PaletteMode) => {- const baseTheme = createAppTheme(mode);-- return {- ...baseTheme,- components: {- ...baseTheme.components,- MuiDrawer: {- styleOverrides: {- paper: {- backgroundColor: mode === 'dark' ? '#081627' : '#f0f8ff',- },- },- },- MuiButton: {- styleOverrides: {- root: {- textTransform: 'none',- },- contained: {- boxShadow: 'none',- '&:active': {- boxShadow: 'none',- },- },- },- },- MuiTabs: {- styleOverrides: {- root: {- marginLeft: baseTheme.spacing(1),- },- indicator: {- height: 3,- borderTopLeftRadius: 3,- borderTopRightRadius: 3,- backgroundColor: mode === 'dark' ? baseTheme.palette.common.white : baseTheme.palette.primary.main,- },- },- },- MuiTab: {- styleOverrides: {- root: {- textTransform: 'none',- margin: '0 16px',- minWidth: 0,- padding: 0,- [baseTheme.breakpoints.up('md')]: {- padding: 0,- minWidth: 0,- },- },- },- },- MuiIconButton: {- styleOverrides: {- root: {- padding: baseTheme.spacing(1),- },- },- },- MuiTooltip: {- styleOverrides: {- tooltip: {- borderRadius: 4,- },- },- },- MuiDivider: {- styleOverrides: {- root: {- backgroundColor: mode === 'dark' ? 'rgba(255,255,255,0.15)' : 'rgba(0,0,0,0.12)',- },- },- },- MuiListItemButton: {- styleOverrides: {- root: {- '&.Mui-selected': {- color: mode === 'dark' ? '#4fc3f7' : '#0067a3',- },- },- },- },- MuiListItemText: {- styleOverrides: {- primary: {- fontSize: 14,- fontWeight: baseTheme.typography.fontWeightMedium,- },- },- },- MuiListItemIcon: {- styleOverrides: {- root: {- color: 'inherit',- minWidth: 'auto',- marginRight: baseTheme.spacing(2),- '& svg': {- fontSize: 20,- },- },- },- },- MuiAvatar: {- styleOverrides: {- root: {- width: 32,- height: 32,- },- },- },- MuiPanelResizeHandle: {- styleOverrides: {- root: {- backgroundColor: mode === 'dark' ? baseTheme.palette.primary.light : baseTheme.palette.primary.main,- width: 4,- '&[data-panel-group-direction="horizontal"]': {- cursor: 'col-resize',- },- '&[data-panel-group-direction="vertical"]': {- height: 4,- cursor: 'row-resize',- },- '&:hover': {- backgroundColor: baseTheme.palette.secondary.main,- },- transition: 'background-color 0.2s ease',- },- },- },- MuiTextField: {- styleOverrides: {- root: {- '& .MuiOutlinedInput-root': {- color: mode === 'dark' ? 'white' : 'rgba(0, 0, 0, 0.87)',- '& fieldset': {- borderColor: mode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.23)',- },- '&:hover fieldset': {- borderColor: mode === 'dark' ? 'rgba(255, 255, 255, 0.7)' : 'rgba(0, 0, 0, 0.87)',- },- '&.Mui-focused fieldset': {- borderColor: mode === 'dark' ? 'white' : baseTheme.palette.primary.main,- },- },- '& .MuiInputLabel-root': {- color: mode === 'dark' ? 'rgba(255, 255, 255, 0.7)' : 'rgba(0, 0, 0, 0.6)',- },- '& .MuiInputBase-input': {- color: mode === 'dark' ? 'white' : 'rgba(0, 0, 0, 0.87)',- },- '& .MuiIconButton-root': {- color: mode === 'dark' ? 'rgba(255, 255, 255, 0.7)' : 'rgba(0, 0, 0, 0.54)',- },- },- },- },- MuiTypography: {- styleOverrides: {- root: {- color: mode === 'dark' ? 'white' : 'rgba(0, 0, 0, 0.87)',- },- },- },- },- };-};--// Re-export the default theme for backward compatibility-export const paperbaseTheme = paperbaseThemeDark;-export default createExtendedTheme('dark');diff --git a/freemocap-ui/src/main.tsx b/freemocap-ui/src/main.tsxindex 12cd2472..b690b6c4 100644--- a/freemocap-ui/src/main.tsx+++ b/freemocap-ui/src/main.tsx@@ -1,9 +1,9 @@import React from 'react'import ReactDOM from 'react-dom/client'import App from './App'-import './i18n/i18n'import './index.css'+import './i18n/i18n'ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(diff --git a/freemocap-ui/src/pages/CamerasPage.tsx b/freemocap-ui/src/pages/CamerasPage.tsxindex ab3a34a7..45fa3cce 100644--- a/freemocap-ui/src/pages/CamerasPage.tsx+++ b/freemocap-ui/src/pages/CamerasPage.tsx@@ -1,41 +1,23 @@-import React, {useState} from 'react';+import React, { useState, useCallback } from 'react';import Box from "@mui/material/Box";import ErrorBoundary from "@/components/common/ErrorBoundary";-import {Footer} from "@/components/ui-components/Footer";-import {useTheme} from "@mui/material/styles";-import {Panel, PanelGroup, PanelResizeHandle} from "react-resizable-panels";-import {CameraViewsGrid} from "@/components/camera-views/CameraViewsGrid";-import {- CamerasViewSettingsOverlay-} from "@/components/camera-views/camera-view-settings-overlay/CamerasViewSettingsOverlay";-import {ThreeJsCanvas} from "@/components/viewport3d/ThreeJsCanvas";--export type LayoutDirection = 'vertical' | 'horizontal';--export interface CameraSettings {- columns: number | null;- show3dView: boolean;- layoutDirection: LayoutDirection;-}+import { Footer } from "@/components/ui-components/Footer";+import { useTheme } from "@mui/material/styles";+import { CameraViewsGrid } from "@/components/camera-views/CameraViewsGrid";+import { CamerasViewSettingsOverlay } from "@/components/camera-view-settings-overlay/CamerasViewSettingsOverlay";export const CamerasPage = () => {const theme = useTheme();- const [settings, setSettings] = useState<CameraSettings>({- columns: null,- show3dView: true,- layoutDirection: 'horizontal',- });+ const [manualColumns, setManualColumns] = useState<number | null>(null);const [resetKey, setResetKey] = useState<number>(0);- const handleSettingsChange = (newSettings: CameraSettings) => {- setSettings(newSettings);- };-- const handleResetViews = () => {- setResetKey(prev => prev + 1);- };+ const handleSettingsChange = useCallback((settings: { columns: number | null }) => {+ setManualColumns(settings.columns);+ }, []);- const isHorizontal = settings.layoutDirection === 'horizontal';+ const handleResetLayout = useCallback(() => {+ setResetKey((v) => v + 1);+ }, []);return (<React.Fragment>@@ -55,54 +37,21 @@ export const CamerasPage = () => {}}><CamerasViewSettingsOverlayonSettingsChange={handleSettingsChange}- onResetViews={handleResetViews}+ onResetLayout={handleResetLayout}/>- <Box sx={{flex: 1, overflow: 'hidden'}}>- {settings.show3dView ? (- <PanelGroup- key={`main-panels-${resetKey}-${settings.layoutDirection}`}- direction={settings.layoutDirection}- >- {/* Camera Grid View Panel */}- <Panel defaultSize={isHorizontal ? 60 : 80} minSize={20}>- <Box sx={{height: '100%', overflow: 'auto'}}>- <ErrorBoundary>- <CameraViewsGrid settings={settings} resetKey={resetKey}/>- </ErrorBoundary>- </Box>- </Panel>-- {/* Resize Handle — adapts to layout direction */}- <PanelResizeHandle- style={{- ...(isHorizontal- ? {width: "4px", cursor: "col-resize"}- : {height: "2px", cursor: "row-resize"}),- backgroundColor: theme.palette.primary.dark,- }}- />-- {/* 3D View Panel */}- <Panel defaultSize={isHorizontal ? 40 : 20} minSize={10}>- <Box sx={{height: '100%'}}>- <ThreeJsCanvas/>- </Box>- </Panel>- </PanelGroup>- ) : (- <Box sx={{height: '100%', overflow: 'auto'}}>- <ErrorBoundary>- <CameraViewsGrid settings={settings} resetKey={resetKey}/>- </ErrorBoundary>- </Box>- )}+ <Box sx={{ flex: 1, position: 'relative', overflow: 'hidden' }}>+ <ErrorBoundary>+ <CameraViewsGrid+ manualColumns={manualColumns}+ resetKey={resetKey}+ />+ </ErrorBoundary></Box>-- <Box component="footer" sx={{p: 1}}>- <Footer/>+ <Box component="footer" sx={{ p: 1, flexShrink: 0 }}>+ <Footer /></Box></Box></React.Fragment>);-};\ No newline at end of file+};diff --git a/freemocap-ui/src/pages/SettingsPage.tsx b/freemocap-ui/src/pages/SettingsPage.tsxindex ffe2731b..662d3f10 100644--- a/freemocap-ui/src/pages/SettingsPage.tsx+++ b/freemocap-ui/src/pages/SettingsPage.tsx@@ -1,1510 +1,382 @@-import React, { useState, useCallback, useEffect } from 'react';+import React, { useCallback } from "react";import {- Box,- Typography,- Switch,- FormControlLabel,- TextField,- Slider,- Select,- MenuItem,- FormControl,- InputLabel,- Paper,- List,- ListItemButton,- ListItemIcon,- ListItemText,- Divider,- Chip,- Button,- CircularProgress,- Alert,- Tooltip,- LinearProgress,- IconButton,-} from '@mui/material';-import { useTheme } from '@mui/material/styles';-import PaletteIcon from '@mui/icons-material/Palette';-import DnsIcon from '@mui/icons-material/Dns';-import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord';-import SquareFootIcon from '@mui/icons-material/SquareFoot';-import DirectionsRunIcon from '@mui/icons-material/DirectionsRun';-import CastConnectedIcon from '@mui/icons-material/CastConnected';-import ComputerIcon from '@mui/icons-material/Computer';-import MemoryIcon from '@mui/icons-material/Memory';-import SpeedIcon from '@mui/icons-material/Speed';-import StorageIcon from '@mui/icons-material/Storage';-import VideocamIcon from '@mui/icons-material/Videocam';-import CheckCircleIcon from '@mui/icons-material/CheckCircle';-import ErrorIcon from '@mui/icons-material/Error';-import WarningIcon from '@mui/icons-material/Warning';-import DownloadIcon from '@mui/icons-material/Download';-import RefreshIcon from '@mui/icons-material/Refresh';-import ArrowBackIcon from '@mui/icons-material/ArrowBack';-import CodeIcon from '@mui/icons-material/Code';-import { useNavigate } from 'react-router-dom';+ Box,+ Chip,+ Container,+ Divider,+ FormControl,+ FormControlLabel,+ InputLabel,+ MenuItem,+ Paper,+ Select,+ Switch,+ ToggleButton,+ ToggleButtonGroup,+ Tooltip,+ Typography,+} from "@mui/material";+import { useTheme } from "@mui/material/styles";+import type { SelectChangeEvent } from "@mui/material/Select";+import SmartToyIcon from "@mui/icons-material/SmartToy";+import VerifiedIcon from "@mui/icons-material/Verified";+import TranslateIcon from "@mui/icons-material/Translate";+import PaletteIcon from "@mui/icons-material/Palette";+import InfoIcon from "@mui/icons-material/Info";+import OpenInNewIcon from "@mui/icons-material/OpenInNew";+import {EXTERNAL_URLS} from "@/constants/external-urls";+import { useTranslation } from "react-i18next";+import { Footer } from "@/components/ui-components/Footer";+import { useAppDispatch, useAppSelector } from "@/store";+import { themeModeSet } from "@/store/slices/theme";import {- useAppDispatch,- useAppSelector,- themeModeSet,- themeModeToggled,- recordingDirectoryChanged,- useDelayStartToggled,- delaySecondsChanged,- useTimestampToggled,- useIncrementToggled,- baseNameChanged,- recordingTagChanged,- createSubfolderToggled,- customSubfolderNameChanged,- selectServerSettings,-} from '@/store';-import { ThemeMode } from '@/store/slices/theme/theme-types';-import { useCalibration } from '@/hooks/useCalibration';-import { useMocap } from '@/hooks/useMocap';-import { useServer } from '@/hooks/useServer';-import { useElectronIPC } from '@/services';+ localeChanged,+ showTranslationIndicatorToggled,+ selectLocale,+ selectShowTranslationIndicator,+} from "@/store/slices/settings";import {- MediapipeModelComplexity,- MEDIAPIPE_REALTIME_PRESET,- MEDIAPIPE_POSTHOC_PRESET,- DEFAULT_REALTIME_FILTER_CONFIG,-} from '@/store/slices/mocap';-import { SettingsEditor } from '@/components/settings-editor/SettingsEditor';--// ── Section IDs ──--type SectionId =- | 'appearance'- | 'connection'- | 'recording'- | 'calibration'- | 'mocap'- | 'vmc'- | 'system'- | 'editor';--interface SectionDef {- id: SectionId;- label: string;- icon: React.ReactNode;-}--const SECTIONS: SectionDef[] = [- { id: 'appearance', label: 'Appearance', icon: <PaletteIcon /> },- { id: 'connection', label: 'Server Connection', icon: <DnsIcon /> },- { id: 'recording', label: 'Recording', icon: <FiberManualRecordIcon /> },- { id: 'calibration', label: 'Calibration', icon: <SquareFootIcon /> },- { id: 'mocap', label: 'Motion Capture', icon: <DirectionsRunIcon /> },- { id: 'vmc', label: 'VMC Output', icon: <CastConnectedIcon /> },- { id: 'system', label: 'System Info', icon: <ComputerIcon /> },- { id: 'editor', label: 'Raw Editor', icon: <CodeIcon /> },-];--// ── Setup wizard types (mirrors electron-side types) ──--interface CpuInfo { model: string; cores: number; threads: number; speedMhz: number }-interface RamInfo { totalGb: number; availableGb: number }-interface GpuInfo { name: string; vendor: string; vramMb: number | null; cudaAvailable: boolean; cudaVersion: string | null }-interface DiskInfo { path: string; totalGb: number; freeGb: number }-interface OsInfo { platform: string; release: string; arch: string; hostname: string }-type PerformanceTier = 'basic' | 'standard' | 'advanced' | 'pro';-interface PerformanceRecommendation {- tier: PerformanceTier;- label: string;- description: string;- maxCameras: number;- maxResolution: string;- realtimeTracking: boolean;- warnings: string[];-}-interface SystemScanResult {- cpu: CpuInfo;- ram: RamInfo;- gpus: GpuInfo[];- disk: DiskInfo;- os: OsInfo;- recommendation: PerformanceRecommendation;- scannedAt: string;-}--type DependencyStatus = 'installed' | 'missing' | 'outdated' | 'checking' | 'installing' | 'error';-interface DependencyInfo {- id: string;- name: string;- description: string;- required: boolean;- status: DependencyStatus;- version: string | null;- installedPath: string | null;- error: string | null;-}--const SYSTEM_SCAN_KEY = 'lastSystemScan';--const TIER_COLORS: Record<PerformanceTier, string> = {- basic: '#ff9800',- standard: '#2196f3',- advanced: '#4caf50',- pro: '#00e5ff',+ SUPPORTED_LOCALES,+ getTranslationSource,+} from "@/i18n";+import type { SupportedLocale } from "@/i18n";+import type { ThemeMode } from "@/store/slices/theme";+import * as Flags from "country-flag-icons/react/3x2";+import {CherokeeFlag} from "@/components/languages/custom-flag-icons/CherokeeFlag";+import { VersionChip } from "@/components/ui-components/VersionChip";++const FlagIcon: React.FC<{ countryCode: string }> = ({ countryCode }) => {+ if (countryCode === "CHEROKEE") return <CherokeeFlag />;+ const Flag = Flags[countryCode as keyof typeof Flags];+ if (!Flag) return null;+ return <Flag style={{ width: 20, height: 14, borderRadius: 2, flexShrink: 0 }} />;};-const TIER_EMOJIS: Record<PerformanceTier, string> = {- basic: '🐢',- standard: '🏃',- advanced: '🚀',- pro: '⚡',+const SectionHeader: React.FC<{+ icon: React.ReactNode;+ title: string;+}> = ({ icon, title }) => {+ const theme = useTheme();+ return (+ <Box+ sx={{+ display: "flex",+ alignItems: "center",+ gap: 1,+ mb: 2,+ mt: 1,+ }}+ >+ <Box sx={{ color: theme.palette.primary.main, display: "flex" }}>+ {icon}+ </Box>+ <Typography variant="h6" sx={{ fontSize: 15, fontWeight: 600 }}>+ {title}+ </Typography>+ </Box>+ );};-// ── Shared layout components ──--function SectionHeader({ title, description }: { title: string; description?: string }) {- const theme = useTheme();- return (- <Box sx={{ mb: 3 }}>- <Typography variant="h5" sx={{ fontWeight: 700, mb: 0.5 }}>- {title}- </Typography>- {description && (- <Typography variant="body2" sx={{ color: theme.palette.text.secondary }}>- {description}- </Typography>- )}- </Box>+const SettingsPage: React.FC = () => {+ const { t } = useTranslation();+ const theme = useTheme();+ const dispatch = useAppDispatch();+ const isDark = theme.palette.mode === "dark";++ const currentLocale = useAppSelector(selectLocale);+ const showTranslationIndicator = useAppSelector(+ selectShowTranslationIndicator+ );+ const themeMode = useAppSelector((state) => state.theme.mode);+ const translationSource = getTranslationSource(currentLocale);++ const handleLocaleChange = useCallback(+ (event: SelectChangeEvent<string>) => {+ dispatch(localeChanged(event.target.value as SupportedLocale));+ },+ [dispatch]+ );++ const handleThemeChange = useCallback(+ (+ _event: React.MouseEvent<HTMLElement>,+ newMode: string | null+ ) => {+ if (newMode !== null) {+ dispatch(themeModeSet(newMode as ThemeMode));+ }+ },+ [dispatch]+ );++ const handleTranslationIndicatorToggle = useCallback(() => {+ dispatch(showTranslationIndicatorToggled());+ }, [dispatch]);++ const sourceLabel =+ translationSource === "human-authored"+ ? t("humanTranslated")+ : translationSource === "human-validated"+ ? t("humanValidated")+ : t("aiTranslated");++ const sourceIcon =+ translationSource === "ai-generated" ? (+ <SmartToyIcon sx={{ fontSize: 14 }} />+ ) : (+ <VerifiedIcon sx={{ fontSize: 14 }} />);-}-function SettingRow({ label, description, children }: { label: string; description?: string; children: React.ReactNode }) {- const theme = useTheme();- return (- <Box- sx={{- display: 'flex',- alignItems: 'flex-start',- justifyContent: 'space-between',- py: 1.5,- gap: 3,- }}+ const sourceColor =+ translationSource === "ai-generated"+ ? "warning"+ : translationSource === "human-validated"+ ? "success"+ : ("info" as const);++ return (+ <Box+ sx={{+ flex: 1,+ display: "flex",+ flexDirection: "column",+ height: "100%",+ backgroundColor: isDark+ ? theme.palette.background.default+ : theme.palette.background.paper,+ overflow: "auto",+ }}+ >+ <Container maxWidth="sm" sx={{ py: 3, flex: 1 }}>+ <Typography+ variant="h5"+ sx={{ fontWeight: 700, mb: 3 }}>- <Box sx={{ flex: 1, minWidth: 0 }}>- <Typography variant="body1" sx={{ fontWeight: 500 }}>- {label}- </Typography>- {description && (- <Typography variant="body2" sx={{ color: theme.palette.text.secondary, mt: 0.25 }}>- {description}- </Typography>- )}- </Box>- <Box sx={{ flexShrink: 0, display: 'flex', alignItems: 'center' }}>- {children}- </Box>- </Box>- );-}+ {t("settings")}+ </Typography>-function SettingGroup({ title, children }: { title: string; children: React.ReactNode }) {- const theme = useTheme();- return (+ {/* Language & Localization */}<Paper- elevation={0}- sx={{- border: `1px solid ${theme.palette.divider}`,- borderRadius: 2,- p: 2.5,- mb: 2,- }}+ elevation={isDark ? 2 : 1}+ sx={{+ p: 2.5,+ mb: 2,+ backgroundColor: isDark+ ? theme.palette.background.paper+ : "#fff",+ }}>- <Typography- variant="overline"- sx={{- fontWeight: 700,- color: theme.palette.text.secondary,- letterSpacing: 1.2,- mb: 1,- display: 'block',- }}- >- {title}- </Typography>- <Divider sx={{ mb: 1 }} />- {children}- </Paper>- );-}--// ── Section: Appearance ──--function AppearanceSection() {- const dispatch = useAppDispatch();- const themeMode = useAppSelector(state => state.theme.mode);-- return (- <>- <SectionHeader- title="Appearance"- description="Customize how FreeMoCap looks."- />- <SettingGroup title="Theme">- <SettingRow- label="Dark Mode"- description="Toggle between light and dark color schemes."- >- <Switch- checked={themeMode === 'dark'}- onChange={() => dispatch(themeModeToggled())}- />- </SettingRow>- <SettingRow- label="Color Scheme"- description="Choose your preferred theme."- >- <FormControl size="small" sx={{ minWidth: 140 }}>- <Select- value={themeMode}- onChange={(e) => dispatch(themeModeSet(e.target.value as ThemeMode))}- >- <MenuItem value="dark">Dark</MenuItem>- <MenuItem value="light">Light</MenuItem>- </Select>- </FormControl>- </SettingRow>- </SettingGroup>- </>- );-}--// ── Section: Server Connection ──--function ConnectionSection() {- const { isConnected, connectionState, connect, disconnect } = useServer();- const theme = useTheme();-- return (- <>- <SectionHeader- title="Server Connection"- description="Connection to the FreeMoCap backend server."- />- <SettingGroup title="Status">- <SettingRow- label="Connection Status"- description={`Current state: ${connectionState}`}- >- <Chip- label={isConnected ? 'Connected' : 'Disconnected'}- color={isConnected ? 'success' : 'error'}- size="small"- variant="outlined"- />- </SettingRow>- <SettingRow- label="Server Address"- description="Backend server URL (configured at build time)."- >- <Typography variant="body2" sx={{ fontFamily: 'monospace', color: theme.palette.text.secondary }}>- localhost:53117- </Typography>- </SettingRow>- <SettingRow label="Actions">- <Box sx={{ display: 'flex', gap: 1 }}>- <Button- size="small"- variant="outlined"- onClick={connect}- disabled={isConnected}- >- Connect- </Button>- <Button- size="small"- variant="outlined"- color="error"- onClick={disconnect}- disabled={!isConnected}- >- Disconnect- </Button>- </Box>- </SettingRow>- </SettingGroup>- </>- );-}--// ── Section: Recording ──--function RecordingSection() {- const dispatch = useAppDispatch();- const recording = useAppSelector(state => state.recording);- const { isElectron, api } = useElectronIPC();-- const handleBrowseDirectory = useCallback(async () => {- if (!isElectron || !api) return;- const result = await api.fileSystem.selectDirectory.query();- if (result) {- dispatch(recordingDirectoryChanged(result as string));- }- }, [dispatch, isElectron, api]);-- return (- <>- <SectionHeader- title="Recording"- description="Configure how recordings are saved and named."- />- <SettingGroup title="Storage">- <SettingRow- label="Recording Directory"- description="Base folder for saving recordings."- >- <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>- <TextField- size="small"- value={recording.recordingDirectory}- onChange={(e) => dispatch(recordingDirectoryChanged(e.target.value))}- sx={{ minWidth: 260 }}- inputProps={{ style: { fontFamily: 'monospace', fontSize: 13 } }}- />- {isElectron && (- <Button size="small" variant="outlined" onClick={handleBrowseDirectory}>- Browse- </Button>- )}- </Box>- </SettingRow>- <SettingRow- label="Create Subfolder"- description="Put each recording session in its own subfolder."- >- <Switch- checked={recording.config.createSubfolder}- onChange={(_, v) => dispatch(createSubfolderToggled(v))}- />- </SettingRow>- {recording.config.createSubfolder && (- <SettingRow- label="Custom Subfolder Name"- description="Leave blank for auto-generated timestamp name."- >- <TextField- size="small"- value={recording.config.customSubfolderName}- onChange={(e) => dispatch(customSubfolderNameChanged(e.target.value))}- placeholder="(auto)"- sx={{ minWidth: 200 }}- />- </SettingRow>- )}- </SettingGroup>+ <SectionHeader+ icon={<TranslateIcon fontSize="small" />}+ title={t("languageSettings")}+ />- <SettingGroup title="Naming">- <SettingRow- label="Use Timestamp"- description="Include timestamp in recording name."- >- <Switch- checked={recording.config.useTimestamp}- onChange={(_, v) => dispatch(useTimestampToggled(v))}- />- </SettingRow>- <SettingRow- label="Use Increment"- description="Append an auto-incrementing number."- >- <Switch- checked={recording.config.useIncrement}- onChange={(_, v) => dispatch(useIncrementToggled(v))}- />- </SettingRow>- {!recording.config.useTimestamp && (- <SettingRow- label="Base Name"- description="Base name for recordings when not using timestamp."- >- <TextField- size="small"- value={recording.config.baseName}- onChange={(e) => dispatch(baseNameChanged(e.target.value))}- sx={{ minWidth: 200 }}- />- </SettingRow>- )}- <SettingRow- label="Recording Tag"- description="Optional tag appended to the recording name."- >- <TextField- size="small"- value={recording.config.recordingTag}- onChange={(e) => dispatch(recordingTagChanged(e.target.value))}- placeholder="(none)"- sx={{ minWidth: 200 }}- />- </SettingRow>- </SettingGroup>-- <SettingGroup title="Delay Start">- <SettingRow- label="Delay Before Recording"- description="Add a countdown before recording starts."- >- <Switch- checked={recording.config.useDelayStart}- onChange={(_, v) => dispatch(useDelayStartToggled(v))}- />- </SettingRow>- {recording.config.useDelayStart && (- <SettingRow- label="Delay Duration"- description="Seconds to wait before recording begins."- >- <TextField- size="small"- type="number"- value={recording.config.delaySeconds}- onChange={(e) => dispatch(delaySecondsChanged(Number(e.target.value)))}- inputProps={{ min: 1, max: 30 }}- sx={{ width: 100 }}- />- </SettingRow>- )}- </SettingGroup>-- <SettingGroup title="Preview">- <Box sx={{ fontFamily: 'monospace', fontSize: 13, opacity: 0.7, p: 1 }}>- <Typography variant="caption" sx={{ display: 'block' }}>- Recording name: <strong>{recording.computed.recordingName || '(empty)'}</strong>- </Typography>- <Typography variant="caption" sx={{ display: 'block' }}>- Full path: <strong>{recording.computed.fullRecordingPath}</strong>- </Typography>- </Box>- </SettingGroup>- </>- );-}--// ── Section: Calibration ──--function CalibrationSection() {- const { config, updateCalibrationConfig, isLoading } = useCalibration();-- return (- <>- <SectionHeader- title="Calibration"- description="Camera calibration settings for multi-camera setups."- />- <SettingGroup title="ChArUco Board">- <SettingRow- label="X Squares"- description="Number of squares along the X axis."- >- <TextField- size="small"- type="number"- value={config.charucoBoardXSquares}- onChange={(e) => updateCalibrationConfig({ charucoBoardXSquares: Number(e.target.value) })}- inputProps={{ min: 2, max: 20 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- <SettingRow- label="Y Squares"- description="Number of squares along the Y axis."- >- <TextField- size="small"- type="number"- value={config.charucoBoardYSquares}- onChange={(e) => updateCalibrationConfig({ charucoBoardYSquares: Number(e.target.value) })}- inputProps={{ min: 2, max: 20 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- <SettingRow- label="Square Length (mm)"- description="Physical size of each square on the board."- >- <TextField- size="small"- type="number"- value={config.charucoSquareLength}- onChange={(e) => updateCalibrationConfig({ charucoSquareLength: Number(e.target.value) })}- inputProps={{ min: 1, step: 0.5 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- </SettingGroup>-- <SettingGroup title="Solver">- <SettingRow- label="Solver Method"- description="Algorithm used to solve camera calibration."- >- <FormControl size="small" sx={{ minWidth: 140 }}>- <Select- value={config.solverMethod}- onChange={(e) => updateCalibrationConfig({ solverMethod: e.target.value as 'anipose' | 'pyceres' })}- disabled={isLoading}- >- <MenuItem value="anipose">Anipose</MenuItem>- <MenuItem value="pyceres">PyCeres</MenuItem>- </Select>- </FormControl>- </SettingRow>- <SettingRow- label="Use Ground Plane"- description="Apply ground plane constraint to calibration."- >- <Switch- checked={config.useGroundplane}- onChange={(_, v) => updateCalibrationConfig({ useGroundplane: v })}- disabled={isLoading}- />- </SettingRow>- </SettingGroup>-- <SettingGroup title="Recording">- <SettingRow- label="Live Track ChArUco"- description="Show ChArUco detection overlay while recording."- >- <Switch- checked={config.liveTrackCharuco}- onChange={(_, v) => updateCalibrationConfig({ liveTrackCharuco: v })}- disabled={isLoading}- />- </SettingRow>- <SettingRow- label="Min Shared Views Per Camera"- description="Minimum board observations shared between camera pairs."- >- <TextField- size="small"- type="number"- value={config.minSharedViewsPerCamera}- onChange={(e) => updateCalibrationConfig({ minSharedViewsPerCamera: Number(e.target.value) })}- inputProps={{ min: 1, max: 200 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- <SettingRow- label="Auto-Stop on Min View Count"- description="Automatically stop recording when minimum views are reached."- >- <Switch- checked={config.autoStopOnMinViewCount}- onChange={(_, v) => updateCalibrationConfig({ autoStopOnMinViewCount: v })}- disabled={isLoading}- />- </SettingRow>- </SettingGroup>- </>- );-}--// ── Section: Motion Capture ──--const MODEL_COMPLEXITY_LABELS: Record<MediapipeModelComplexity, string> = {- 0: 'Lite (fastest)',- 1: 'Full (balanced)',- 2: 'Heavy (most accurate)',-};--function MocapSection() {- const {- detectorConfig,- skeletonFilterConfig,- updateDetectorConfig,- replaceDetectorConfig,- updateSkeletonFilterConfig,- replaceSkeletonFilterConfig,- isLoading,- } = useMocap();-- const detectPreset = useCallback(() => {- if (- detectorConfig.model_complexity === 0 &&- !detectorConfig.enable_segmentation &&- !detectorConfig.smooth_segmentation- ) return 'realtime';- if (- detectorConfig.model_complexity === 2 &&- detectorConfig.enable_segmentation &&- detectorConfig.smooth_segmentation- ) return 'posthoc';- return 'custom';- }, [detectorConfig]);-- const currentPreset = detectPreset();-- return (- <>- <SectionHeader- title="Motion Capture"- description="MediaPipe detector and skeleton filter configuration."- />-- {/* Detector */}- <SettingGroup title="MediaPipe Detector">- <SettingRow- label="Preset"- description="Quick-select a tuned detector configuration."- >- <Box sx={{ display: 'flex', gap: 1 }}>- <Chip- label="Realtime"- size="small"- variant={currentPreset === 'realtime' ? 'filled' : 'outlined'}- color={currentPreset === 'realtime' ? 'primary' : 'default'}- onClick={() => replaceDetectorConfig({ ...MEDIAPIPE_REALTIME_PRESET })}- disabled={isLoading}- sx={{ cursor: 'pointer' }}- />- <Chip- label="Posthoc"- size="small"- variant={currentPreset === 'posthoc' ? 'filled' : 'outlined'}- color={currentPreset === 'posthoc' ? 'primary' : 'default'}- onClick={() => replaceDetectorConfig({ ...MEDIAPIPE_POSTHOC_PRESET })}- disabled={isLoading}- sx={{ cursor: 'pointer' }}- />- {currentPreset === 'custom' && (- <Chip label="Custom" size="small" variant="outlined" color="warning" />- )}- </Box>- </SettingRow>- <SettingRow- label="Model Complexity"- description="Controls accuracy vs. speed tradeoff."- >- <FormControl size="small" sx={{ minWidth: 180 }}>- <Select- value={detectorConfig.model_complexity}- onChange={(e) => updateDetectorConfig({ model_complexity: e.target.value as MediapipeModelComplexity })}- disabled={isLoading}- >- <MenuItem value={0}>{MODEL_COMPLEXITY_LABELS[0]}</MenuItem>- <MenuItem value={1}>{MODEL_COMPLEXITY_LABELS[1]}</MenuItem>- <MenuItem value={2}>{MODEL_COMPLEXITY_LABELS[2]}</MenuItem>- </Select>- </FormControl>- </SettingRow>- <SettingRow- label={`Min Detection Confidence: ${detectorConfig.min_detection_confidence.toFixed(2)}`}- description="Minimum score for initial pose detection."+ <Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>+ <Box+ sx={{+ display: "flex",+ alignItems: "center",+ gap: 2,+ flexWrap: "wrap",+ }}+ >+ <FormControl size="small" sx={{ minWidth: 180 }}>+ <InputLabel id="settings-language-label">+ {t("language")}+ </InputLabel>+ <Select+ labelId="settings-language-label"+ value={currentLocale}+ label={t("language")}+ onChange={handleLocaleChange}+ sx={{ fontSize: 13 }}>- <Slider- value={detectorConfig.min_detection_confidence}- onChange={(_, v) => updateDetectorConfig({ min_detection_confidence: v as number })}- min={0} max={1} step={0.05} size="small"- disabled={isLoading}- sx={{ width: 180 }}- />- </SettingRow>- <SettingRow- label={`Min Tracking Confidence: ${detectorConfig.min_tracking_confidence.toFixed(2)}`}- description="Minimum score for frame-to-frame tracking."+ {Object.entries(SUPPORTED_LOCALES).map(+ ([code, { label, dir, flag }]) => (+ <MenuItem key={code} value={code}>+ <Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>+ <FlagIcon countryCode={flag} />+ <Typography+ component="span"+ sx={{ fontSize: 13, direction: dir }}+ >+ {label}+ </Typography>+ <Typography+ component="span"+ sx={{ fontSize: 11, color: "text.disabled", fontFamily: "monospace" }}+ >+ {code}+ </Typography>+ </Box>+ </MenuItem>+ )+ )}+ </Select>+ </FormControl>++ {translationSource !== "human-authored" && (+ <Tooltip+ title={+ translationSource === "ai-generated"+ ? t("aiTranslatedTooltip")+ : t("humanValidatedTooltip")+ }+ arrow>- <Slider- value={detectorConfig.min_tracking_confidence}- onChange={(_, v) => updateDetectorConfig({ min_tracking_confidence: v as number })}- min={0} max={1} step={0.05} size="small"- disabled={isLoading}- sx={{ width: 180 }}- />- </SettingRow>- <SettingRow label="Smooth Landmarks">- <Switch- size="small"- checked={detectorConfig.smooth_landmarks}- onChange={(_, v) => updateDetectorConfig({ smooth_landmarks: v })}- disabled={isLoading}- />- </SettingRow>- <SettingRow label="Enable Segmentation">- <Switch- size="small"- checked={detectorConfig.enable_segmentation}- onChange={(_, v) => updateDetectorConfig({ enable_segmentation: v })}- disabled={isLoading}- />- </SettingRow>- <SettingRow label="Smooth Segmentation">- <Switch- size="small"- checked={detectorConfig.smooth_segmentation}- onChange={(_, v) => updateDetectorConfig({ smooth_segmentation: v })}- disabled={isLoading || !detectorConfig.enable_segmentation}- />- </SettingRow>- <SettingRow label="Refine Face Landmarks">- <Switch- size="small"- checked={detectorConfig.refine_face_landmarks}- onChange={(_, v) => updateDetectorConfig({ refine_face_landmarks: v })}- disabled={isLoading}- />- </SettingRow>- <SettingRow label="Static Image Mode">- <Switch- size="small"- checked={detectorConfig.static_image_mode}- onChange={(_, v) => updateDetectorConfig({ static_image_mode: v })}- disabled={isLoading}- />- </SettingRow>- </SettingGroup>-- {/* Skeleton Filter */}- <SettingGroup title="Skeleton Filter">- <Box sx={{ display: 'flex', justifyContent: 'flex-end', mb: 1 }}>- <Button- size="small"- variant="text"- onClick={() => replaceSkeletonFilterConfig({ ...DEFAULT_REALTIME_FILTER_CONFIG })}- disabled={isLoading}- >- Reset Defaults- </Button>- </Box>+ <Chip+ icon={sourceIcon}+ label={sourceLabel}+ size="small"+ color={sourceColor}+ variant="outlined"+ clickable+ component="a"+ href={EXTERNAL_URLS.TRANSLATION_LOCALES}+ target="_blank"+ rel="noopener noreferrer"+ sx={{+ height: 24,+ fontSize: 11,+ cursor: "pointer",+ "& .MuiChip-icon": { fontSize: 14 },+ }}+ />+ </Tooltip>+ )}+ </Box>- <SettingRow- label="Height (meters)"- description="Subject height for bone length estimation."+ {translationSource === "ai-generated" && (+ <Typography+ variant="caption"+ color="text.secondary"+ sx={{ fontSize: 11 }}+ >+ {t("aiTranslatedTooltip")}{" "}+ <Typography+ component="a"+ href={EXTERNAL_URLS.TRANSLATING_GUIDE}+ target="_blank"+ rel="noopener noreferrer"+ variant="caption"+ sx={{+ fontSize: 11,+ color: "primary.main",+ textDecoration: "underline",+ cursor: "pointer",+ display: 'inline-flex',+ alignItems: 'center',+ gap: 0.3,+ }}>- <TextField- size="small"- type="number"- value={skeletonFilterConfig.height_meters}- onChange={(e) => updateSkeletonFilterConfig({ height_meters: Number(e.target.value) })}- inputProps={{ min: 0.5, max: 2.5, step: 0.01 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>-- <Typography variant="caption" sx={{ display: 'block', mt: 1, mb: 0.5, fontWeight: 600, opacity: 0.6 }}>- ONE EURO FILTER- </Typography>- <SettingRow label={`Min Cutoff: ${skeletonFilterConfig.min_cutoff.toFixed(2)}`}>- <Slider- value={skeletonFilterConfig.min_cutoff}- onChange={(_, v) => updateSkeletonFilterConfig({ min_cutoff: v as number })}- min={0.01} max={10} step={0.01} size="small"- disabled={isLoading} sx={{ width: 180 }}- />- </SettingRow>- <SettingRow label={`Beta: ${skeletonFilterConfig.beta.toFixed(3)}`}>- <Slider- value={skeletonFilterConfig.beta}- onChange={(_, v) => updateSkeletonFilterConfig({ beta: v as number })}- min={0} max={1} step={0.001} size="small"- disabled={isLoading} sx={{ width: 180 }}- />- </SettingRow>- <SettingRow label={`D Cutoff: ${skeletonFilterConfig.d_cutoff.toFixed(2)}`}>- <Slider- value={skeletonFilterConfig.d_cutoff}- onChange={(_, v) => updateSkeletonFilterConfig({ d_cutoff: v as number })}- min={0.01} max={10} step={0.01} size="small"- disabled={isLoading} sx={{ width: 180 }}- />- </SettingRow>-- <Typography variant="caption" sx={{ display: 'block', mt: 1, mb: 0.5, fontWeight: 600, opacity: 0.6 }}>- FABRIK IK- </Typography>- <SettingRow label={`Tolerance: ${skeletonFilterConfig.fabrik_tolerance.toFixed(4)}`}>- <Slider- value={skeletonFilterConfig.fabrik_tolerance}- onChange={(_, v) => updateSkeletonFilterConfig({ fabrik_tolerance: v as number })}- min={0.0001} max={0.1} step={0.0001} size="small"- disabled={isLoading} sx={{ width: 180 }}- />- </SettingRow>- <SettingRow label="Max Iterations">- <TextField- size="small"- type="number"- value={skeletonFilterConfig.fabrik_max_iterations}- onChange={(e) => updateSkeletonFilterConfig({ fabrik_max_iterations: Number(e.target.value) })}- inputProps={{ min: 1, max: 100 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>-- <Typography variant="caption" sx={{ display: 'block', mt: 1, mb: 0.5, fontWeight: 600, opacity: 0.6 }}>- POINT GATING+ {t("helpTranslate")} <OpenInNewIcon sx={{fontSize: 11}} /></Typography>- <SettingRow label="Max Reprojection Error (px)">- <TextField- size="small"- type="number"- value={skeletonFilterConfig.max_reprojection_error_px}- onChange={(e) => updateSkeletonFilterConfig({ max_reprojection_error_px: Number(e.target.value) })}- inputProps={{ min: 0, step: 1 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- <SettingRow label="Max Velocity (m/s)">- <TextField- size="small"- type="number"- value={skeletonFilterConfig.max_velocity_m_per_s}- onChange={(e) => updateSkeletonFilterConfig({ max_velocity_m_per_s: Number(e.target.value) })}- inputProps={{ min: 0, step: 0.5 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- <SettingRow label="Max Rejected Streak">- <TextField- size="small"- type="number"- value={skeletonFilterConfig.max_rejected_streak}- onChange={(e) => updateSkeletonFilterConfig({ max_rejected_streak: Number(e.target.value) })}- inputProps={{ min: 0 }}- disabled={isLoading}- sx={{ width: 100 }}- />- </SettingRow>- </SettingGroup>- </>- );-}--// ── Section: VMC Output ──--function VMCSection() {- const { send, isConnected } = useServer();- const settings = useAppSelector(selectServerSettings);-- const vmcEnabled = settings?.vmc?.enabled ?? false;- const vmcHost = settings?.vmc?.host ?? '127.0.0.1';- const vmcPort = settings?.vmc?.port ?? 39539;-- const patchVMC = useCallback(- (patch: Record<string, unknown>) => {- send({ message_type: 'settings/patch', patch: { vmc: patch } });- },- [send],- );-- return (- <>- <SectionHeader- title="VMC Output"- description="Virtual Motion Capture protocol streaming settings."- />- <SettingGroup title="VMC Streaming">- <SettingRow- label="Enable VMC Output"- description="Stream skeleton data via VMC protocol over UDP."- >- <Switch- checked={vmcEnabled}- onChange={() => patchVMC({ enabled: !vmcEnabled })}- disabled={!isConnected}- />- </SettingRow>- <SettingRow- label="Host"- description="Target IP address for VMC packets."- >- <TextField- size="small"- value={vmcHost}- onChange={(e) => {- const val = e.target.value.trim();- if (val.length > 0) patchVMC({ host: val });- }}- disabled={!isConnected || !vmcEnabled}- sx={{ width: 160 }}- inputProps={{ style: { fontFamily: 'monospace', fontSize: 13 } }}- />- </SettingRow>- <SettingRow- label="Port"- description="UDP port for VMC packets (default 39539)."- >- <TextField- size="small"- type="number"- value={vmcPort}- onChange={(e) => {- const val = parseInt(e.target.value, 10);- if (!isNaN(val) && val > 0 && val <= 65535) patchVMC({ port: val });- }}- disabled={!isConnected || !vmcEnabled}- inputProps={{ min: 1, max: 65535 }}- sx={{ width: 120 }}- />- </SettingRow>- {!isConnected && (- <Alert severity="info" sx={{ mt: 1 }}>- Connect to the backend server to configure VMC settings.- </Alert>- )}- </SettingGroup>- </>- );-}--// ── Section: System Info ──--function DependencyStatusIcon({ status }: { status: DependencyStatus }) {- switch (status) {- case 'installed':- return <CheckCircleIcon sx={{ color: '#4caf50', fontSize: 20 }} />;- case 'missing':- return <ErrorIcon sx={{ color: '#f44336', fontSize: 20 }} />;- case 'outdated':- return <WarningIcon sx={{ color: '#ff9800', fontSize: 20 }} />;- case 'checking':- case 'installing':- return <CircularProgress size={18} />;- case 'error':- return <ErrorIcon sx={{ color: '#f44336', fontSize: 20 }} />;- }-}--function SystemSection() {- const theme = useTheme();- const { isElectron, api } = useElectronIPC();-- const [scanning, setScanning] = useState(false);- const [scanResult, setScanResult] = useState<SystemScanResult | null>(null);- const [dependencies, setDependencies] = useState<DependencyInfo[]>([]);- const [installing, setInstalling] = useState<string | null>(null);-- const runScan = useCallback(async () => {- if (!isElectron || !api) return;- setScanning(true);- try {- const result = await api.system.scan.query();- const typed = result as SystemScanResult;- setScanResult(typed);- await api.settings.set.mutate({ key: SYSTEM_SCAN_KEY, value: typed });- } catch (err) {- console.error('System scan failed:', err);- } finally {- setScanning(false);- }- }, [isElectron, api]);-- const detectDeps = useCallback(async () => {- if (!isElectron || !api) return;- try {- const result = await api.dependencies.detectAll.query();- setDependencies(result as DependencyInfo[]);- } catch (err) {- console.error('Dependency detection failed:', err);- }- }, [isElectron, api]);-- const installDep = useCallback(async (depId: string) => {- if (!isElectron || !api) return;- setInstalling(depId);- try {- const updated = await api.dependencies.install.mutate({ dependencyId: depId });- setDependencies(prev =>- prev.map(d => d.id === depId ? (updated as DependencyInfo) : d),- );- if (depId === 'uv') {- const envInfo = await api.dependencies.detect.query({ dependencyId: 'python-env' });- setDependencies(prev =>- prev.map(d => d.id === 'python-env' ? (envInfo as DependencyInfo) : d),- );- }- } catch (err) {- console.error(`Failed to install ${depId}:`, err);- setDependencies(prev =>- prev.map(d =>- d.id === depId- ? { ...d, status: 'error' as DependencyStatus, error: err instanceof Error ? err.message : String(err) }- : d,- ),- );- } finally {- setInstalling(null);- }- }, [isElectron, api]);-- // Load persisted scan on mount- useEffect(() => {- if (!isElectron || !api) return;- api.settings.get.query({ key: SYSTEM_SCAN_KEY }).then(result => {- if (result && typeof result === 'object' && 'cpu' in (result as object)) {- setScanResult(result as SystemScanResult);- }- }).catch(() => { /* no persisted scan */ });- }, [isElectron, api]);+ </Typography>+ )}- if (!isElectron) {- return (- <>- <SectionHeader- title="System Info"- description="System scanning is only available in the desktop app."+ <FormControlLabel+ control={+ <Switch+ checked={showTranslationIndicator}+ onChange={handleTranslationIndicatorToggle}+ size="small"/>- <Alert severity="info">- Connect to a running FreeMoCap server via the desktop app to view system information and manage dependencies.- </Alert>- </>- );- }-- const rec = scanResult?.recommendation;- const tierColor = rec ? TIER_COLORS[rec.tier] : undefined;-- return (- <>- <SectionHeader- title="System Info"- description="Hardware information, performance tier, and dependency status."- />-- {/* Performance Tier */}- <SettingGroup title="Performance Tier">- {scanning ? (- <Box sx={{ textAlign: 'center', py: 4 }}>- <CircularProgress size={40} />- <Typography sx={{ mt: 1.5, color: theme.palette.text.secondary }}>- Scanning your system...- </Typography>- </Box>- ) : scanResult && rec ? (- <>- <Paper- elevation={0}- sx={{- p: 2, mb: 2,- border: `2px solid ${tierColor}`,- borderRadius: 2,- background: `${tierColor}11`,- textAlign: 'center',- }}- >- <Typography variant="h5" sx={{ fontWeight: 700, color: tierColor }}>- {TIER_EMOJIS[rec.tier]} {rec.label} System- </Typography>- <Typography variant="body2" sx={{ mt: 0.5, color: theme.palette.text.secondary }}>- {rec.description}- </Typography>- <Box sx={{ display: 'flex', justifyContent: 'center', gap: 1.5, mt: 1.5, flexWrap: 'wrap' }}>- <Chip- icon={<VideocamIcon />}- label={`Up to ${rec.maxCameras} cameras`}- size="small"- sx={{ borderColor: tierColor, color: tierColor }}- variant="outlined"- />- <Chip- label={`${rec.maxResolution} max`}- size="small"- sx={{ borderColor: tierColor, color: tierColor }}- variant="outlined"- />- {rec.realtimeTracking && (- <Chip- icon={<SpeedIcon />}- label="Real-time tracking"- size="small"- sx={{ borderColor: tierColor, color: tierColor }}- variant="outlined"- />- )}- </Box>- </Paper>-- {/* Hardware grid */}- <Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5, mb: 2 }}>- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <MemoryIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>CPU</Typography>- </Box>- <Typography variant="body2" sx={{ fontWeight: 500, fontSize: '0.8rem' }}>- {scanResult.cpu.model}- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {scanResult.cpu.threads} threads · {scanResult.cpu.cores} cores · {scanResult.cpu.speedMhz} MHz- </Typography>- </Paper>-- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <ComputerIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>MEMORY</Typography>- </Box>- <Typography variant="body2" sx={{ fontWeight: 500 }}>- {scanResult.ram.totalGb} GB total- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {scanResult.ram.availableGb} GB available- </Typography>- </Paper>-- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <SpeedIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>GPU</Typography>- </Box>- {scanResult.gpus.length > 0 ? scanResult.gpus.map((gpu, i) => (- <Box key={i}>- <Typography variant="body2" sx={{ fontWeight: 500, fontSize: '0.8rem' }}>- {gpu.name}- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {gpu.vramMb ? `${Math.round(gpu.vramMb / 1024)} GB VRAM` : 'VRAM unknown'}- {gpu.cudaAvailable ? ` · CUDA ${gpu.cudaVersion || '✓'}` : ''}- </Typography>- </Box>- )) : (- <Typography variant="body2" sx={{ color: theme.palette.text.disabled }}>- No dedicated GPU detected- </Typography>- )}- </Paper>-- <Paper elevation={0} sx={{ p: 1.5, border: `1px solid ${theme.palette.divider}`, borderRadius: 1 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>- <StorageIcon sx={{ fontSize: 18, color: theme.palette.text.secondary }} />- <Typography variant="caption" sx={{ fontWeight: 600, color: theme.palette.text.secondary }}>DISK</Typography>- </Box>- <Typography variant="body2" sx={{ fontWeight: 500 }}>- {scanResult.disk.freeGb} GB free- </Typography>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- of {scanResult.disk.totalGb} GB total- </Typography>- {scanResult.disk.freeGb > 0 && scanResult.disk.freeGb < 20 && (- <LinearProgress- variant="determinate"- value={((scanResult.disk.totalGb - scanResult.disk.freeGb) / scanResult.disk.totalGb) * 100}- color="warning"- sx={{ mt: 0.5, height: 4, borderRadius: 1 }}- />- )}- </Paper>- </Box>-- {rec.warnings.length > 0 && (- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5, mb: 2 }}>- {rec.warnings.map((w, i) => (- <Alert key={i} severity="warning" sx={{ py: 0, fontSize: '0.75rem' }}>- {w}- </Alert>- ))}- </Box>- )}- </>- ) : (- <Box sx={{ textAlign: 'center', py: 3 }}>- <Typography sx={{ color: theme.palette.text.secondary, mb: 1 }}>- No system scan data available.- </Typography>- </Box>- )}-- <Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>- <Button- size="small"- startIcon={scanning ? <CircularProgress size={14} /> : <RefreshIcon />}- onClick={runScan}- disabled={scanning}- >- {scanResult ? 'Rescan' : 'Scan System'}- </Button>+ }+ label={+ <Box>+ <Typography variant="body2" sx={{ fontSize: 13 }}>+ {t("showTranslationIndicator")}+ </Typography>+ <Typography+ variant="caption"+ color="text.secondary"+ sx={{ fontSize: 11 }}+ >+ {t("showTranslationIndicatorDescription")}+ </Typography></Box>- </SettingGroup>-- {/* Dependencies */}- <SettingGroup title="Dependencies">- {dependencies.length === 0 ? (- <Box sx={{ textAlign: 'center', py: 3 }}>- <Typography sx={{ color: theme.palette.text.secondary, mb: 1 }}>- No dependency data loaded.- </Typography>- <Button size="small" startIcon={<RefreshIcon />} onClick={detectDeps}>- Check Dependencies- </Button>- </Box>- ) : (- <>- {dependencies.filter(d => d.required).length > 0 && (- <Box sx={{ mb: 2 }}>- <Typography variant="caption" sx={{ fontWeight: 700, color: theme.palette.text.secondary, mb: 0.5, display: 'block' }}>- REQUIRED- </Typography>- {dependencies.filter(d => d.required).map(dep => (- <DependencyRow- key={dep.id}- dep={dep}- isInstalling={installing === dep.id}- onInstall={() => installDep(dep.id)}- />- ))}- </Box>- )}- {dependencies.filter(d => !d.required).length > 0 && (- <Box>- <Typography variant="caption" sx={{ fontWeight: 700, color: theme.palette.text.secondary, mb: 0.5, display: 'block' }}>- OPTIONAL- </Typography>- {dependencies.filter(d => !d.required).map(dep => (- <DependencyRow- key={dep.id}- dep={dep}- isInstalling={installing === dep.id}- onInstall={() => installDep(dep.id)}- />- ))}- </Box>- )}- <Box sx={{ display: 'flex', justifyContent: 'flex-end', mt: 1 }}>- <Button size="small" startIcon={<RefreshIcon />} onClick={detectDeps}>- Recheck All- </Button>- </Box>- </>- )}- </SettingGroup>- </>- );-}--function DependencyRow({ dep, isInstalling, onInstall }: { dep: DependencyInfo; isInstalling: boolean; onInstall: () => void }) {- const theme = useTheme();- const canInstall = dep.status === 'missing' || dep.status === 'outdated';- const isCuda = dep.id === 'cuda';+ }+ />+ </Box>+ </Paper>- return (+ {/* Appearance */}<Paper- elevation={0}- sx={{- p: 1.5, mb: 0.5,- border: `1px solid ${theme.palette.divider}`,- borderRadius: 1,- display: 'flex',- alignItems: 'center',- gap: 1.5,- }}+ elevation={isDark ? 2 : 1}+ sx={{+ p: 2.5,+ mb: 2,+ backgroundColor: isDark+ ? theme.palette.background.paper+ : "#fff",+ }}>- <DependencyStatusIcon status={isInstalling ? 'installing' : dep.status} />- <Box sx={{ flex: 1, minWidth: 0 }}>- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>- <Typography variant="body2" sx={{ fontWeight: 600 }}>- {dep.name}- </Typography>- {dep.version && (- <Chip label={dep.version} size="small" sx={{ height: 18, fontSize: '0.65rem' }} />- )}- {dep.required && (- <Chip label="required" size="small" color="warning" variant="outlined" sx={{ height: 18, fontSize: '0.6rem' }} />- )}- </Box>- <Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>- {dep.description}- </Typography>- {dep.error && (- <Typography variant="caption" sx={{ display: 'block', color: theme.palette.error.main, mt: 0.25 }}>- {dep.error}- </Typography>- )}- {dep.installedPath && dep.status === 'installed' && (- <Tooltip title={dep.installedPath}>- <Typography- variant="caption"- sx={{- display: 'block',- color: theme.palette.text.disabled,- fontSize: '0.6rem',- overflow: 'hidden',- textOverflow: 'ellipsis',- whiteSpace: 'nowrap',- maxWidth: 300,- }}- >- {dep.installedPath}- </Typography>- </Tooltip>- )}- </Box>- {canInstall && !isCuda && (- <Button- size="small"- variant="contained"- startIcon={isInstalling ? <CircularProgress size={14} color="inherit" /> : <DownloadIcon />}- onClick={onInstall}- disabled={isInstalling}- sx={{ textTransform: 'none', fontSize: '0.75rem', whiteSpace: 'nowrap' }}- >- {isInstalling ? 'Installing...' : dep.status === 'outdated' ? 'Update' : 'Install'}- </Button>- )}- {canInstall && isCuda && (- <Typography variant="caption" sx={{ color: theme.palette.text.disabled, fontStyle: 'italic' }}>- Manual install- </Typography>- )}+ <SectionHeader+ icon={<PaletteIcon fontSize="small" />}+ title={t("appearance")}+ />++ <Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>+ <Typography variant="body2" sx={{ fontSize: 13 }}>+ {t("themeMode")}+ </Typography>+ <ToggleButtonGroup+ value={themeMode}+ exclusive+ onChange={handleThemeChange}+ size="small"+ sx={{+ "& .MuiToggleButton-root": {+ py: 0.5,+ px: 2,+ fontSize: 12,+ },+ "& .MuiToggleButton-root.Mui-selected": {+ backgroundColor: theme.palette.primary.dark,+ color: theme.palette.primary.contrastText,+ "&:hover": {+ backgroundColor: theme.palette.primary.light,+ },+ },+ }}+ >+ <ToggleButton value="light">{t("lightMode")}</ToggleButton>+ <ToggleButton value="dark">{t("darkMode")}</ToggleButton>+ </ToggleButtonGroup>+ </Box></Paper>- );-}--// ── Section: Raw Editor ──--function EditorSection() {- return (- <Box sx={{ display: 'flex', flexDirection: 'column', height: '100%' }}>- <SectionHeader- title="Raw Editor"- description="View and edit all settings as JSON, YAML, or TOML. Upload a file or edit directly, then apply."- />- <Box sx={{ flex: 1, minHeight: 0 }}>- <SettingsEditor />- </Box>- </Box>- );-}--// ── Section Map ──--const SECTION_RENDERERS: Record<SectionId, React.FC> = {- appearance: AppearanceSection,- connection: ConnectionSection,- recording: RecordingSection,- calibration: CalibrationSection,- mocap: MocapSection,- vmc: VMCSection,- system: SystemSection,- editor: EditorSection,-};-// ── Main Settings Page ──--export const SettingsPage: React.FC = () => {- const theme = useTheme();- const navigate = useNavigate();- const [activeSection, setActiveSection] = useState<SectionId>('appearance');-- const SectionContent = SECTION_RENDERERS[activeSection];-- return (- <Box- sx={{- width: '100%',- height: '100%',- display: 'flex',- backgroundColor: theme.palette.mode === 'dark'- ? theme.palette.background.default- : theme.palette.grey[50],- overflow: 'hidden',- }}+ {/* About */}+ <Paper+ elevation={isDark ? 2 : 1}+ sx={{+ p: 2.5,+ mb: 2,+ backgroundColor: isDark+ ? theme.palette.background.paper+ : "#fff",+ }}>- {/* Left navigation panel */}- <Paper- elevation={0}- sx={{- width: 240,- minWidth: 240,- height: '100%',- borderRight: `1px solid ${theme.palette.divider}`,- borderRadius: 0,- display: 'flex',- flexDirection: 'column',- overflow: 'hidden',- }}- >- {/* Settings header with back button */}- <Box- sx={{- px: 2,- py: 1.5,- borderBottom: `1px solid ${theme.palette.divider}`,- display: 'flex',- alignItems: 'center',- gap: 1,- }}- >- <IconButton size="small" onClick={() => navigate('/')}>- <ArrowBackIcon sx={{ fontSize: 18 }} />- </IconButton>- <Typography variant="h6" sx={{ fontWeight: 700, fontSize: '1.1rem' }}>- Settings- </Typography>- </Box>-- {/* Section list */}- <List- sx={{- flex: 1,- overflowY: 'auto',- py: 1,- }}- >- {SECTIONS.map((section) => (- <ListItemButton- key={section.id}- selected={activeSection === section.id}- onClick={() => setActiveSection(section.id)}- sx={{- mx: 1,- borderRadius: 1.5,- mb: 0.25,- py: 1,- '&.Mui-selected': {- backgroundColor: theme.palette.mode === 'dark'- ? 'rgba(255, 255, 255, 0.08)'- : 'rgba(0, 0, 0, 0.06)',- '&:hover': {- backgroundColor: theme.palette.mode === 'dark'- ? 'rgba(255, 255, 255, 0.12)'- : 'rgba(0, 0, 0, 0.09)',- },- },- }}- >- <ListItemIcon sx={{ minWidth: 36, color: activeSection === section.id ? theme.palette.primary.main : theme.palette.text.secondary }}>- {section.icon}- </ListItemIcon>- <ListItemText- primary={section.label}- primaryTypographyProps={{- fontSize: '0.875rem',- fontWeight: activeSection === section.id ? 600 : 400,- }}- />- </ListItemButton>- ))}- </List>- </Paper>-- {/* Right content area */}- <Box- sx={{- flex: 1,- height: '100%',- overflowY: activeSection === 'editor' ? 'hidden' : 'auto',- p: activeSection === 'editor' ? 2 : 4,- maxWidth: activeSection === 'editor' ? undefined : 800,- display: 'flex',- flexDirection: 'column',- }}- >- <SectionContent />- </Box>- </Box>- );+ <SectionHeader+ icon={<InfoIcon fontSize="small" />}+ title={t("about")}+ />++ <Box sx={{ display: "flex", flexDirection: "column", gap: 1 }}>+ <Typography variant="body2" sx={{ fontSize: 13 }}>+ {t("appName")} — {t("welcomeSubtitle")}+ </Typography>+ <VersionChip variant="full" />+ </Box>+ </Paper>+ </Container>++ <Divider />+ <Box component="footer" sx={{ p: 1 }}>+ <Footer />+ </Box>+ </Box>+ );};++export default SettingsPage;diff --git a/freemocap-ui/src/pages/VideosPage.tsx b/freemocap-ui/src/pages/VideosPage.tsxindex f144b3b7..cb12f8b4 100644--- a/freemocap-ui/src/pages/VideosPage.tsx+++ b/freemocap-ui/src/pages/VideosPage.tsx@@ -4,9 +4,11 @@ import ErrorBoundary from "@/components/common/ErrorBoundary";import {Footer} from "@/components/ui-components/Footer";import {useTheme} from "@mui/material/styles";import {Typography} from '@mui/material';+import {useTranslation} from "react-i18next";const VideosPage: React.FC = () => {const theme = useTheme();+ const {t} = useTranslation();return (<React.Fragment>@@ -34,12 +36,11 @@ const VideosPage: React.FC = () => {}}><ErrorBoundary><Typography variant="h4" gutterBottom>- Load Synchronized Videos+ {t('loadSynchronizedVideos')}</Typography><Typography variant="body1">- This page will allow you to load and synchronize pre-recorded videos.+ {t('loadSynchronizedVideosDescription')}</Typography>- {/* Add your video loading components here */}</ErrorBoundary></Box><Box component="footer" sx={{p: 1}}>diff --git a/freemocap-ui/src/pages/Viewport3dPage.tsx b/freemocap-ui/src/pages/Viewport3dPage.tsxdeleted file mode 100644index 860dd0a0..00000000--- a/freemocap-ui/src/pages/Viewport3dPage.tsx+++ /dev/null@@ -1,13 +0,0 @@-import {Box} from "@mui/material";-import React from "react";-import {ThreeJsCanvas} from "@/components/viewport3d/ThreeJsCanvas";--export const Viewport3dPage = () => {- return (- <Box sx={{width: '100%',- height: '100%',- }}>- <ThreeJsCanvas/>- </Box>- );-}diff --git a/freemocap-ui/src/pages/WelcomePage.tsx b/freemocap-ui/src/pages/WelcomePage.tsxindex d4dec084..b546042b 100644--- a/freemocap-ui/src/pages/WelcomePage.tsx+++ b/freemocap-ui/src/pages/WelcomePage.tsx@@ -1,32 +1,33 @@-import React, {useEffect, useRef, useState} from 'react';+import React, {useEffect, useState, useRef, useCallback} from 'react';import {- Box,- Button,- CircularProgress,- Container,- darken,- Fade,- Grow,- Link as MuiLink,- Paper,- Typography+ Box, Button, Checkbox, CircularProgress, Container,+ darken, Divider, Fade, FormControlLabel, Grow, Paper, Stack, Typography} from '@mui/material';import {useNavigate} from 'react-router-dom';import {useTheme} from '@mui/material/styles';import VideocamIcon from '@mui/icons-material/Videocam';+import OpenInNewIcon from '@mui/icons-material/OpenInNew';import {Footer} from '@/components/ui-components/Footer';import {useElectronIPC} from "@/services";-import {connectRealtimePipeline, useAppDispatch} from "@/store";-import {useServer} from "@/hooks/useServer";+import {useServer} from "@/services/server/ServerContextProvider";+import {useTranslation} from "react-i18next";+import {LanguageSwitcher} from "@/components/languages/LanguageSwitcher";+import {VersionChip} from "@/components/ui-components/VersionChip";+import {useAppDispatch} from "@/store";+import {camerasConnectOrUpdate} from "@/store/slices/cameras/cameras-thunks";+import {EXTERNAL_URLS} from "@/constants/external-urls";const WelcomePage: React.FC = () => {+ const {t} = useTranslation();const theme = useTheme();const navigate = useNavigate();- const dispatch = useAppDispatch();const [logoDataUrl, setLogoDataUrl] = useState<string | null>(null);- const [isConnecting, setIsConnecting] = useState<boolean>(false);- const { isElectron, api } = useElectronIPC();- const { connectedCameraIds } = useServer();+ const [telemetryEnabled, setTelemetryEnabled] = useState<boolean>(true);+ const [telemetryLoaded, setTelemetryLoaded] = useState<boolean>(false);+ const {isElectron, api} = useElectronIPC();+ const {connectedCameraIds} = useServer();+ const dispatch = useAppDispatch();+ const [isConnecting, setIsConnecting] = useState(false);// Track previous camera count to detect 0 -> >0 transitionconst prevCountRef = useRef(connectedCameraIds.length);@@ -35,7 +36,7 @@ const WelcomePage: React.FC = () => {const prevCount = prevCountRef.current;const currentCount = connectedCameraIds.length;- // Auto-navigate to cameras page only when first camera connects (0 -> >0 transition)+ // Auto-navigate to cameras page when first camera connects (0 -> >0 transition)if (prevCount === 0 && currentCount > 0) {navigate('/cameras');}@@ -47,7 +48,6 @@ const WelcomePage: React.FC = () => {const fetchLogo = async (): Promise<void> => {try {if (isElectron && api) {- // Use the new base64 method that returns a data URLconst dataUrl = await api.assets.getLogoBase64.query();if (dataUrl) {setLogoDataUrl(dataUrl);@@ -63,69 +63,95 @@ const WelcomePage: React.FC = () => {fetchLogo();}, [isElectron, api]);- const handleConnectCameras = async (): Promise<void> => {+ // Load telemetry preference on mount+ useEffect(() => {+ const loadTelemetryPref = async (): Promise<void> => {+ try {+ if (isElectron && api) {+ const enabled = await api.telemetry.getEnabled.query();+ setTelemetryEnabled(enabled);+ }+ } catch (error) {+ console.error('Failed to load telemetry preference:', error);+ } finally {+ setTelemetryLoaded(true);+ }+ };++ loadTelemetryPref();+ }, [isElectron, api]);++ const handleTelemetryToggle = useCallback(async (_event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => {+ setTelemetryEnabled(checked);+ try {+ if (isElectron && api) {+ await api.telemetry.setEnabled.mutate({enabled: checked});+ }+ } catch (error) {+ console.error('Failed to save telemetry preference:', error);+ }+ }, [isElectron, api]);++ const handleConnectCameras = useCallback(async () => {setIsConnecting(true);try {- await dispatch(connectRealtimePipeline()).unwrap();- // Navigation will happen automatically via the useEffect above+ await dispatch(camerasConnectOrUpdate()).unwrap();} catch (error) {- console.error('Error connecting to cameras:', error);+ console.error('Error connecting cameras:', error);+ } finally {setIsConnecting(false);}- };+ }, [dispatch]);return (- <Box sx={{+ <Container maxWidth="md" sx={{height: '100%',width: '100%',- overflow: 'auto',bgcolor: theme.palette.background.default,+ display: 'flex',+ flexDirection: 'column',+ justifyContent: 'center',+ alignItems: 'center',+ py: 4}}>- <Container maxWidth="md" sx={{- minHeight: '100%',- width: '100%',- display: 'flex',- flexDirection: 'column',- justifyContent: 'center',- alignItems: 'center',- py: 1,- gap: 3- }}>- <Fade in={true} timeout={800}>- <Paper- elevation={6}- sx={{- p: { xs: 3, sm: 5 },- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- width: '100%',- backgroundColor: theme.palette.background.paper,- mx: 'auto',- borderRadius: 3,- boxShadow: theme.palette.mode === 'dark'- ? '0 8px 32px rgba(0, 0, 0, 0.5)'- : '0 8px 32px rgba(0, 0, 0, 0.1)',- overflow: 'hidden',- position: 'relative',- }}- >- {/* Background accent */}- <Box sx={{- position: 'absolute',- top: 0,- left: 0,- width: '100%',- height: '8px',- background: `linear-gradient(90deg, ${theme.palette.primary.main}, ${theme.palette.secondary.main})`,- }} />+ <Fade in={true} timeout={800}>+ <Paper+ elevation={6}+ sx={{+ p: {xs: 3, sm: 5},+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ width: '100%',+ backgroundColor: theme.palette.background.paper,+ mx: 'auto',+ borderRadius: 3,+ boxShadow: theme.palette.mode === 'dark'+ ? '0 8px 32px rgba(0, 0, 0, 0.5)'+ : '0 8px 32px rgba(0, 0, 0, 0.1)',+ overflow: 'hidden',+ position: 'relative'+ }}+ >+ {/* Gradient accent bar */}+ <Box sx={{+ position: 'absolute',+ top: 0,+ left: 0,+ width: '100%',+ height: '8px',+ background: `linear-gradient(90deg, ${theme.palette.primary.light}, ${theme.palette.info.main})`,+ }}/>+ {/* ── HERO SECTION ── */}+ <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', mb: 2 }}><Grow in={true} timeout={1000}><Boxsx={{- width: 240,- height: 240,- mb: 1,+ width: 180,+ height: 180,+ mb: 2,+ mt: 2,display: 'flex',justifyContent: 'center',alignItems: 'center',@@ -163,140 +189,133 @@ const WelcomePage: React.FC = () => {WebkitBackgroundClip: 'text',WebkitTextFillColor: 'transparent',backgroundClip: 'text',+ textFillColor: 'transparent',mb: 1}}>- Welcome to FreeMoCap+ {t('welcomeTitle')}</Typography><Typographyvariant="subtitle1"color="text.secondary"sx={{- mb:2,+ mb: 1,textAlign: 'center',maxWidth: '80%',fontSize: '1.1rem'}}>- Free and open source markerless motion capture for everyone.+ {t('welcomeSubtitle')}</Typography>+ </Box>+ {/* ── PRIMARY CTA ── */}+ <Box sx={{ width: '100%', display: 'flex', justifyContent: 'center', mb: 2 }}><Buttonvariant="contained"size="large"+ startIcon={isConnecting+ ? <CircularProgress size={24} color="inherit" />+ : <VideocamIcon sx={{ fontSize: 28 }} />+ }onClick={handleConnectCameras}disabled={isConnecting}- startIcon={isConnecting ? <CircularProgress size={20} color="inherit" /> : <VideocamIcon />}sx={{- py: 2,- px: 6,- fontSize: '1.2rem',- fontWeight: 'bold',+ '&&': {+ px: 6,+ py: 2,+ fontSize: '1.25rem',+ fontWeight: 600,+ minHeight: 56,+ padding: '16px 48px',+ },+ width: '100%',+ maxWidth: 400,borderRadius: 3,textTransform: 'none',- boxShadow: theme.palette.mode === 'dark'- ? '0 4px 20px rgba(0, 0, 0, 0.5)'- : '0 4px 20px rgba(0, 0, 0, 0.15)',- // background: `linear-gradient(135deg, ${theme.palette.primary.main}, ${darken(theme.palette.secondary.main, 0.25)})`,- background: darken(theme.palette.secondary.main, 0.25),- transition: 'all 0.3s ease-in-out',+ background: darken(theme.palette.info.dark, .4),+ color: theme.palette.text.primary,+ border: `4px solid ${theme.palette.secondary.main}`,+ boxShadow: `0 4px 20px rgba(245, 0, 87, 0.25)`,'&:hover': {- transform: 'translateY(-2px)',- boxShadow: theme.palette.mode === 'dark'- ? '0 6px 24px rgba(0, 0, 0, 0.6)'- : '0 6px 24px rgba(0, 0, 0, 0.2)',+ background: theme.palette.info.dark,+ boxShadow: `0 6px 28px rgba(245, 0, 87, 0.4)`,+ transform: 'translateY(-1px)',+ border: `4px solid ${theme.palette.secondary.light}`,+ color: theme.palette.text.primary,},- '&:disabled': {- background: theme.palette.action.disabledBackground,- }+ transition: 'all 0.2s ease-in-out',}}>- {isConnecting ? 'Connecting...' : 'Connect Cameras'}+ {t('connectToCameras')}</Button>+ </Box>- <Box component="footer" sx={{ p: 3 }}>- <Footer />- </Box>- </Paper>- </Fade>-- {/* Research Tool Disclaimer - Outside main clickable area */}- <Paper- elevation={1}- sx={{- p: 2.5,- width: '100%',- backgroundColor: theme.palette.mode === 'dark'- ? 'rgba(255, 255, 255, 0.03)'- : 'rgba(0, 0, 0, 0.02)',- borderRadius: 2,- }}- >- <Typography- variant="body2"- color="text.secondary"- sx={{- fontSize: '0.85rem',- lineHeight: 1.8,- '& a': {- color: theme.palette.mode === 'dark'- ? theme.palette.primary.light- : theme.palette.primary.main,- textDecoration: 'none',- fontWeight: 500,- transition: 'all 0.2s',- '&:hover': {- textDecoration: 'underline',- color: theme.palette.mode === 'dark'- ? theme.palette.primary.main- : theme.palette.primary.dark- }- }- }}- >- FreeMoCap is currently a research and educational tool, not cleared by the FDA for clinical use. Motion capture devices are regulated under{' '}- <MuiLink- href="https://www.ecfr.gov/current/title-21/chapter-I/subchapter-H/part-890"- target="_blank"- rel="noopener noreferrer"- onClick={(e: React.MouseEvent) => e.stopPropagation()}- >- 21 CFR Part 890 (Physical Medicine Devices)- </MuiLink>- {' '}and require{' '}- <MuiLink- href="https://www.fda.gov/medical-devices/premarket-submissions-selecting-and-preparing-correct-submission/premarket-notification-510k"- target="_blank"- rel="noopener noreferrer"- onClick={(e: React.MouseEvent) => e.stopPropagation()}- >- 510(k) clearance- </MuiLink>- {' '}for clinical applications.- <br />- <br />- <MuiLink- href="https://aaroncherian.github.io/freemocap_validation/"- target="_blank"- rel="noopener noreferrer"- onClick={(e: React.MouseEvent) => e.stopPropagation()}+ {/* ── SECONDARY LINKS ── */}+ <Stack direction="row" spacing={2} sx={{ mb: 2 }}>+ <Button+ variant="text"+ size="small"+ color="inherit"+ endIcon={<OpenInNewIcon sx={{fontSize: 14}} />}+ onClick={() => window.open(EXTERNAL_URLS.DOCS, '_blank')}+ sx={{+ textTransform: 'none',+ color: theme.palette.info.light,+ '&:hover': { color: theme.palette.info.main },+ }}>- - View our validation studies- </MuiLink>- <br />- <MuiLink- href="https://github.com/freemocap/freemocap_foundation/issues/32"- target="_blank"- rel="noopener noreferrer"- onClick={(e: React.MouseEvent) => e.stopPropagation()}+ {t('documentation')}+ </Button>+ <Button+ variant="text"+ size="small"+ color="inherit"+ endIcon={<OpenInNewIcon sx={{fontSize: 14}} />}+ onClick={() => window.open(EXTERNAL_URLS.ROADMAP, '_blank')}+ sx={{+ textTransform: 'none',+ color: theme.palette.info.light,+ '&:hover': { color: theme.palette.info.main },+ }}>- - Join our journey towards FDA certification- </MuiLink>- </Typography>+ {t('roadmap')}+ </Button>+ </Stack>++ {/* ── SETTINGS AREA ── */}+ <Divider sx={{ width: '60%', my: 1.5 }} />+ <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 1, mb: 2 }}>+ <LanguageSwitcher/>+ {telemetryLoaded && (+ <Fade in={true} timeout={600}>+ <FormControlLabel+ control={+ <Checkbox+ checked={telemetryEnabled}+ onChange={handleTelemetryToggle}+ size="small"+ />+ }+ label={+ <Typography variant="body2" color="text.secondary">+ {t('sendAnonymousPings')}+ </Typography>+ }+ />+ </Fade>+ )}+ <VersionChip variant="compact" />+ </Box>++ {/* ── FOOTER ── */}+ <Box sx={{ textAlign: 'center' }}>+ <Footer/>+ </Box></Paper>- </Container>- </Box>+ </Fade>+ </Container>);};diff --git a/freemocap-ui/src/services/electron-ipc/electron-ipc-client.ts b/freemocap-ui/src/services/electron-ipc/electron-ipc-client.tsindex 087b27fc..3db9eb23 100644--- a/freemocap-ui/src/services/electron-ipc/electron-ipc-client.ts+++ b/freemocap-ui/src/services/electron-ipc/electron-ipc-client.ts@@ -1,11 +1,18 @@// src/hooks/electron-service/electron-ipc-client.ts-import {createTRPCProxyClient} from '@trpc/client';+import { createTRPCProxyClient } from '@trpc/client';import superjson from 'superjson';-import type {AppAPI} from '../../../electron/main/api';+import type { AppAPI } from '../../../electron/main/api';// Type for the electron API exposed via preloadinterface ElectronAPI {invoke: (path: string, input?: any) => Promise<any>;+ onMenuAction: (callback: (action: string) => void) => () => void;+ sendMenuLabels: (params: Record<string, unknown>) => void;+ // Auto-update event listeners+ onUpdateAvailable: (callback: (info: { version: string; currentVersion: string }) => void) => () => void;+ onDownloadProgress: (callback: (progress: { percent: number; bytesPerSecond: number; transferred: number; total: number }) => void) => () => void;+ onUpdateDownloaded: (callback: (info: { version: string }) => void) => () => void;+ onUpdateError: (callback: (error: { message: string }) => void) => () => void;}declare global {diff --git a/freemocap-ui/src/services/electron-ipc/electron-ipc.ts b/freemocap-ui/src/services/electron-ipc/electron-ipc.tsindex 002d0a4a..fe9f74b8 100644--- a/freemocap-ui/src/services/electron-ipc/electron-ipc.ts+++ b/freemocap-ui/src/services/electron-ipc/electron-ipc.ts@@ -1,7 +1,6 @@+// Check if running in Electronimport {electronIpcClient} from "@/services/electron-ipc/electron-ipc-client";-// Type-safe wrapper hook for React components-import {useMemo} from 'react';export const isElectron = (): boolean => {return typeof window !== 'undefined' && !!window.electronAPI;@@ -10,6 +9,9 @@ export const isElectron = (): boolean => {// Export the API client or null if not in Electronexport const electronIpc = isElectron() ? electronIpcClient : null;+// Type-safe wrapper hook for React components+import { useMemo } from 'react';+export function useElectronIPC() {const api = useMemo(() => {if (!isElectron()) return null;diff --git a/freemocap-ui/src/services/server/ServerContextProvider.tsx b/freemocap-ui/src/services/server/ServerContextProvider.tsxindex 1a557181..3618a033 100644--- a/freemocap-ui/src/services/server/ServerContextProvider.tsx+++ b/freemocap-ui/src/services/server/ServerContextProvider.tsx@@ -1,107 +1,111 @@-import React, {createContext, ReactNode, useCallback, useEffect, useRef, useState} from 'react';-import {useDispatch} from 'react-redux';-import {AppDispatch} from '@/store/types';--import {ConnectionState, WebSocketConnection} from "@/services/server/server-helpers/websocket-connection";-import {FrameProcessor} from "@/services/server/server-helpers/frame-processor/frame-processor";-import {CanvasManager} from "@/services/server/server-helpers/canvas-manager";-import {- backendFramerateUpdated,- frontendFramerateUpdated,- logAdded,- serverSettingsCleared,- serverSettingsUpdated,-} from '@/store';--import {serverUrls} from "@/hooks/server-urls";-import {CharucoObservation} from "@/services/server/server-helpers/image-overlay/charuco-types";-import {OverlayManager} from "@/services/server/server-helpers/image-overlay/overlay-renderer-factory";-import {MediapipeObservation} from "@/services/server/server-helpers/image-overlay/mediapipe-overlay-renderer";-import {- arraysEqual, handleModelInfoUpdate,- isCharucoOverlayDataMessage, isFramerateUpdate, isLogRecord, isMediapipeOverlayDataMessage,- isSettingsStateMessage-} from "@/services/server/server-helpers/websocket-message-types";-import {RigidBodyPose} from "@/components/viewport3d/viewport3d-types";--type FrameSubscriber = (bitmap: ImageBitmap) => void;-type TrackedPointsSubscriber = (points: Map<string, Point3d>) => void;-type RigidBodiesSubscriber = (poses: Map<string, RigidBodyPose>) => void;--export interface Point3d {- x: number;- y: number;- z: number;-}+// ServerContextProvider.tsx+import React, { createContext, ReactNode, useContext, useEffect, useRef, useState, useCallback, useMemo } from 'react';++import { ConnectionState, WebSocketConnection } from "@/services/server/server-helpers/websocket-connection";+import { FrameProcessor } from "@/services/server/server-helpers/frame-processor/frame-processor";+import { CanvasManager } from "@/services/server/server-helpers/canvas-manager";+import { serverUrls } from "@/services";+import {DetailedFramerate, FramerateStore} from "@/services/server/server-helpers/framerate-store";+import {LogStore, LogRecord} from "@/services/server/server-helpers/log-store";-export interface ServerContextValue {+interface ServerContextValue {isConnected: boolean;- connectionState: ConnectionState;connect: () => void;disconnect: () => void;send: (data: string | object) => void;setCanvasForCamera: (cameraId: string, canvas: HTMLCanvasElement) => void;getFps: (cameraId: string) => number | null;+ getServerFps: () => number | null;+ getFramerateStore: () => FramerateStore;+ getLogStore: () => LogStore;connectedCameraIds: string[];- subscribeToFrames: (cameraId: string, callback: FrameSubscriber) => () => void;- subscribeToTrackedPoints: (callback: TrackedPointsSubscriber) => () => void;- getLatestTrackedPoints: () => Map<string, Point3d>;- subscribeToRigidBodies: (callback: RigidBodiesSubscriber) => () => void;+ updateServerConnection: (host: string, port: number) => void;}-export const ServerContext = createContext<ServerContextValue | null>(null);+const ServerContext = createContext<ServerContextValue | null>(null);-export const ServerContextProvider: React.FC<{ children: ReactNode }> = ({children}) => {- const dispatch = useDispatch<AppDispatch>();+// Compare two already-sorted string arrays without allocating+function sortedArraysEqual(a: string[], b: string[]): boolean {+ if (a.length !== b.length) return false;+ for (let i = 0; i < a.length; i++) {+ if (a[i] !== b[i]) return false;+ }+ return true;+}++// Type guard to check if a message is a log record+function isLogRecord(data: any): data is LogRecord {+ return (+ data &&+ typeof data === 'object' &&+ data.message_type === 'log_record' &&+ typeof data.levelname === 'string' &&+ typeof data.message === 'string'+ );+}++// Type for framerate update message from backend+interface FramerateUpdateMessage {+ message_type: 'framerate_update';+ camera_group_id: string;+ backend_framerate: DetailedFramerate;+ frontend_framerate: DetailedFramerate;+}+// Type guard to check if a message is a framerate update+function isFramerateUpdate(data: any): data is FramerateUpdateMessage {+ return (+ data &&+ typeof data === 'object' &&+ data.message_type === 'framerate_update' &&+ typeof data.camera_group_id === 'string' &&+ data.backend_framerate &&+ typeof data.backend_framerate === 'object' &&+ data.frontend_framerate &&+ typeof data.frontend_framerate === 'object'+ );+}++export const ServerContextProvider: React.FC<{ children: ReactNode }> = ({ children }) => {+ // Reactive state - only updates when camera list actually changesconst [isConnected, setIsConnected] = useState<boolean>(false);- const [connectionState, setConnectionState] = useState<ConnectionState>(ConnectionState.DISCONNECTED);const [connectedCameraIds, setConnectedCameraIds] = useState<string[]>([]);- // Tracks the port so the WebSocket connection is recreated when it changes.- // Updated via serverUrls.onPortChange() subscription.- const [serverPort, setServerPort] = useState<number>(serverUrls.getPort());+ // Service instancesconst wsConnectionRef = useRef<WebSocketConnection | null>(null);const frameProcessorRef = useRef<FrameProcessor | null>(null);const canvasManagerRef = useRef<CanvasManager | null>(null);- const overlayManagerRef = useRef<OverlayManager | null>(null);- const frameSubscribersRef = useRef<Map<string, Set<FrameSubscriber>>>(new Map());- const latestCharucoRef = useRef<Map<string, CharucoObservation>>(new Map());- const latestMediapipeRef = useRef<Map<string, MediapipeObservation>>(new Map());- const latestTrackedPoints = useRef<Map<string, Point3d>>(new Map());- const trackedPointsSubscribersRef = useRef<Set<TrackedPointsSubscriber>>(new Set());- const latestRigidBodies = useRef<Map<string, RigidBodyPose>>(new Map());- const rigidBodiesSubscribersRef = useRef<Set<RigidBodiesSubscriber>>(new Set());-- // Subscribe to port changes from the serverUrls singleton.- // When useElectronAPI().pythonServer.start() resolves, it calls serverUrls.setPort(),- // which triggers this callback and causes the WebSocket to reconnect on the correct port.- useEffect(() => {- return serverUrls.onPortChange((port: number) => {- console.log(`[ServerContext] Port changed to ${port}, will recreate WebSocket connection`);- setServerPort(port);- });- }, []);-- // Create / recreate the WebSocket connection whenever the port changes.+ const framerateStoreRef = useRef<FramerateStore>(new FramerateStore());+ const logStoreRef = useRef<LogStore>(new LogStore());++ // Latest server-side (backend) FPS stored in a ref for non-reactive access+ const serverFpsRef = useRef<number | null>(null);++ // Holds the latest binary payload received from the WebSocket.+ // The WebSocket onmessage handler writes here synchronously;+ // a separate rAF-driven processing loop reads and clears it.+ // This decouples decoding from the WebSocket message storm,+ // preventing promise starvation where createImageBitmap microtasks+ // can never resolve because the browser dispatches onmessage events+ // back-to-back in a single macrotask without yielding.+ const pendingPayloadRef = useRef<ArrayBuffer | null>(null);+ const processingFrameRef = useRef<boolean>(false);+ const frameLoopRef = useRef<number | null>(null);++ // Cached sorted camera IDs from the last frame — compared by value to avoid+ // per-frame Array.from().sort() allocations when the camera list hasn't changed.+ const lastCameraIdsRef = useRef<string[]>([]);++ // Initialize services onceuseEffect(() => {- if (wsConnectionRef.current) {- wsConnectionRef.current.disconnect();- }- canvasManagerRef.current?.terminateAllWorkers();- frameProcessorRef.current?.reset();-wsConnectionRef.current = new WebSocketConnection({url: serverUrls.getWebSocketUrl(),reconnectDelay: 1000,maxReconnectAttempts: 5,- heartbeatInterval: 30000,- autoConnect: true,- autoConnectInterval: 3000,+ heartbeatInterval: 30000});frameProcessorRef.current = new FrameProcessor();canvasManagerRef.current = new CanvasManager();- overlayManagerRef.current = new OverlayManager();return () => {if (wsConnectionRef.current) {@@ -113,153 +117,132 @@ export const ServerContextProvider: React.FC<{ children: ReactNode }> = ({childrif (frameProcessorRef.current) {frameProcessorRef.current.reset();}- latestCharucoRef.current.clear();- latestMediapipeRef.current.clear();- latestTrackedPoints.current.clear();- trackedPointsSubscribersRef.current.clear();- latestRigidBodies.current.clear();- rigidBodiesSubscribersRef.current.clear();};- }, [serverPort]);+ }, []);+ // Set up WebSocket connection and handlersuseEffect(() => {const ws = wsConnectionRef.current;if (!ws) return;- const handleStateChange = (newState: ConnectionState, previousState: ConnectionState): void => {+ const handleStateChange = (newState: ConnectionState): void => {const connected = newState === ConnectionState.CONNECTED;- console.log(`[WS] State transition: ${previousState} → ${newState} (connected=${connected})`);setIsConnected(connected);- setConnectionState(newState);- if (previousState === ConnectionState.CONNECTED && !connected) {- console.log('[WS] Lost connection — clearing state');+ if (newState === ConnectionState.DISCONNECTED || newState === ConnectionState.FAILED) {canvasManagerRef.current?.terminateAllWorkers();frameProcessorRef.current?.reset();- overlayManagerRef.current?.clearAll();- latestCharucoRef.current.clear();- latestMediapipeRef.current.clear();- latestTrackedPoints.current.clear();+ serverFpsRef.current = null;+ processingFrameRef.current = false;+ pendingPayloadRef.current = null;+ lastCameraIdsRef.current = [];+ framerateStoreRef.current.clear();setConnectedCameraIds([]);- dispatch(serverSettingsCleared());- latestRigidBodies.current.clear();}};- const handleMessage = async (event: MessageEvent): Promise<void> => {- if (event.data instanceof ArrayBuffer) {- try {- const result = await frameProcessorRef.current!.processFramePayload(event.data);- if (!result) return;-- const {frames, cameraIds, frameNumbers} = result;-- const currentCameraIds = Array.from(cameraIds).sort();- setConnectedCameraIds(prevIds => {- if (!arraysEqual(prevIds, currentCameraIds)) {- console.log(`Camera list updated: ${currentCameraIds.join(', ')}`);+ // Process a decoded frame result: update camera list, dispatch to workers, send ack.+ const dispatchFrames = (+ result: Awaited<ReturnType<FrameProcessor['processFramePayload']>>+ ): void => {+ if (!result) return;++ const { frames, cameraIds, frameNumbers } = result;++ // Only allocate a new sorted array if the camera set actually changed.+ // Compare against the cached ref to avoid Array.from().sort() on every frame.+ const lastIds = lastCameraIdsRef.current;+ let cameraListChanged = lastIds.length !== cameraIds.size;+ if (!cameraListChanged) {+ for (const id of lastIds) {+ if (!cameraIds.has(id)) {+ cameraListChanged = true;+ break;+ }+ }+ }- const removedCameras = prevIds.filter(id => !cameraIds.has(id));- for (const cameraId of removedCameras) {- console.log(`Removing camera ${cameraId} - not in latest payload`);- canvasManagerRef.current?.terminateWorker(cameraId);- latestCharucoRef.current.delete(cameraId);- latestMediapipeRef.current.delete(cameraId);- }+ if (cameraListChanged) {+ const newIds = Array.from(cameraIds).sort();+ lastCameraIdsRef.current = newIds;- return currentCameraIds;+ setConnectedCameraIds(prevIds => {+ if (!sortedArraysEqual(prevIds, newIds)) {+ const removedCameras = prevIds.filter(id => !cameraIds.has(id));+ for (const cameraId of removedCameras) {+ canvasManagerRef.current?.terminateWorker(cameraId);}- return prevIds;- });-- // Acknowledge receipt immediately so the backend can prepare- // the next frame without waiting for rendering to complete.- if (frameNumbers.size > 0) {- const maxFrameNumber = Math.max(...Array.from(frameNumbers));- ws.send({type: 'frameAcknowledgment', frameNumber: maxFrameNumber});+ return newIds;}+ return prevIds;+ });+ }- const overlayManager = overlayManagerRef.current!;- for (const frameData of frames) {- const charucoObservation = latestCharucoRef.current.get(frameData.cameraId) ?? null;- const mediapipeObservation = latestMediapipeRef.current.get(frameData.cameraId) ?? null;-- let compositeBitmap: ImageBitmap;- if (charucoObservation || mediapipeObservation) {- compositeBitmap = await overlayManager.processFrame(- frameData.cameraId,- frameData.bitmap,- charucoObservation,- mediapipeObservation,- );- } else {- compositeBitmap = frameData.bitmap;- }+ for (const frameData of frames) {+ canvasManagerRef.current!.sendFrameToWorker(+ frameData.cameraId,+ frameData.bitmap+ );+ }- {- const subscribers = frameSubscribersRef.current.get(frameData.cameraId);- if (subscribers && subscribers.size > 0) {- for (const callback of subscribers) {- const clonedBitmap = await createImageBitmap(compositeBitmap);- callback(clonedBitmap);- }- }- }+ if (frameNumbers.size > 0) {+ const maxFrameNumber = Math.max(...Array.from(frameNumbers));+ ws.send({ type: 'frameAcknowledgment', frameNumber: maxFrameNumber });+ }+ };- canvasManagerRef.current!.sendFrameToWorker(- frameData.cameraId,- compositeBitmap,- );- }+ // rAF-driven processing loop. Runs on its own macrotask boundary,+ // so createImageBitmap promises can resolve without being starved+ // by the WebSocket onmessage dispatch loop.+ const processFrameLoop = async (): Promise<void> => {+ if (!processingFrameRef.current && pendingPayloadRef.current !== null) {+ const payload = pendingPayloadRef.current;+ pendingPayloadRef.current = null;+ processingFrameRef.current = true;+ try {+ const result = await frameProcessorRef.current!.processFramePayload(payload);+ dispatchFrames(result);} catch (error) {console.error('Error processing frame:', error);- throw error;+ } finally {+ processingFrameRef.current = false;}- } else if (typeof event.data === 'string') {- const text = event.data;+ }+ frameLoopRef.current = requestAnimationFrame(processFrameLoop);+ };- if (text === 'pong') {- return;- }- if (text.startsWith('ping')) {- ws.send('pong');- return;- }+ frameLoopRef.current = requestAnimationFrame(processFrameLoop);++ const handleMessage = (event: MessageEvent): void => {+ // Handle binary frame data: just buffer the latest payload.+ // Older unprocessed payloads are overwritten (frame dropping).+ if (event.data instanceof ArrayBuffer) {+ pendingPayloadRef.current = event.data;+ }+ // Handle text/JSON messages (logs, framerate updates, etc.)+ else if (typeof event.data === 'string') {+ // Skip heartbeat pong responses — they're plain text, not JSON+ if (event.data === 'pong') return;- const jsonData = JSON.parse(text);+ try {+ const jsonData = JSON.parse(event.data);- if (isSettingsStateMessage(jsonData)) {- console.log(`[WS] Received settings/state v${jsonData.version}`, jsonData.settings);- dispatch(serverSettingsUpdated(jsonData));- } else if (isCharucoOverlayDataMessage(jsonData)) {- for (const [cameraId, observation] of Object.entries(jsonData)) {- latestCharucoRef.current.set(cameraId, observation as CharucoObservation);- }- } else if (isMediapipeOverlayDataMessage(jsonData)) {- for (const [cameraId, observation] of Object.entries(jsonData)) {- latestMediapipeRef.current.set(cameraId, observation as MediapipeObservation);- }- } else if ('model_info' in jsonData && jsonData.model_info) {- handleModelInfoUpdate(jsonData.model_info);- } else if ('tracked_points3d' in jsonData) {- latestTrackedPoints.current = new Map(Object.entries(jsonData.tracked_points3d));- for (const subscriber of trackedPointsSubscribersRef.current) {- subscriber(latestTrackedPoints.current);+ // Handle log records+ if (isLogRecord(jsonData)) {+ logStoreRef.current.add(jsonData);}- } else if ('rigid_body_poses' in jsonData) {- latestRigidBodies.current = new Map(- Object.entries(jsonData.rigid_body_poses as Record<string, RigidBodyPose>)- );- for (const subscriber of rigidBodiesSubscribersRef.current) {- subscriber(latestRigidBodies.current);+ // Handle framerate updates+ else if (isFramerateUpdate(jsonData)) {+ // Store backend FPS in ref for fast non-reactive access+ serverFpsRef.current = jsonData.backend_framerate.mean_frames_per_second;+ // Update mutable framerate store (no Redux, no re-renders)+ framerateStoreRef.current.updateBackend(jsonData.backend_framerate);+ framerateStoreRef.current.updateFrontend(jsonData.frontend_framerate);}- } else if (isLogRecord(jsonData)) {- dispatch(logAdded(jsonData));- } else if (isFramerateUpdate(jsonData)) {- dispatch(backendFramerateUpdated(jsonData.backend_framerate));- dispatch(frontendFramerateUpdated(jsonData.frontend_framerate));- } else {- console.warn('[WS] Unhandled JSON message:', Object.keys(jsonData));+ // Handle other message types (silently ignored to avoid+ // retaining object references in the DevTools console)+ } catch (error) {+ console.error('Error parsing JSON message:', error);}}};@@ -267,15 +250,19 @@ export const ServerContextProvider: React.FC<{ children: ReactNode }> = ({childrws.on('state-change', handleStateChange);ws.on('message', handleMessage);- // Start in auto-discovery mode — silently poll until the server appears- ws.startDiscovery();+ // Connection is driven by ServerConnectionStatus via the connect() callback.+ // No auto-connect here — the component's autoConnectWs loop handles it.return () => {ws.off('state-change', handleStateChange);ws.off('message', handleMessage);ws.disconnect();+ if (frameLoopRef.current !== null) {+ cancelAnimationFrame(frameLoopRef.current);+ frameLoopRef.current = null;+ }};- }, [dispatch, serverPort]);+ }, []);const connect = useCallback((): void => {wsConnectionRef.current?.connect();@@ -297,65 +284,55 @@ export const ServerContextProvider: React.FC<{ children: ReactNode }> = ({childrreturn frameProcessorRef.current?.getFps(cameraId) ?? null;}, []);- const subscribeToFrames = useCallback((cameraId: string, callback: FrameSubscriber): (() => void) => {- if (!frameSubscribersRef.current.has(cameraId)) {- frameSubscribersRef.current.set(cameraId, new Set());- }- frameSubscribersRef.current.get(cameraId)!.add(callback);-- return () => {- const subscribers = frameSubscribersRef.current.get(cameraId);- subscribers?.delete(callback);- if (subscribers?.size === 0) {- frameSubscribersRef.current.delete(cameraId);- }- };+ const getServerFps = useCallback((): number | null => {+ return serverFpsRef.current;}, []);- const subscribeToTrackedPoints = useCallback((callback: TrackedPointsSubscriber): (() => void) => {- trackedPointsSubscribersRef.current.add(callback);-- if (latestTrackedPoints.current.size > 0) {- callback(latestTrackedPoints.current);- }-- return () => {- trackedPointsSubscribersRef.current.delete(callback);- };+ const getFramerateStore = useCallback((): FramerateStore => {+ return framerateStoreRef.current;}, []);- const getLatestTrackedPoints = useCallback((): Map<string, Point3d> => {- return latestTrackedPoints.current;+ const getLogStore = useCallback((): LogStore => {+ return logStoreRef.current;}, []);- const subscribeToRigidBodies = useCallback((callback: RigidBodiesSubscriber): (() => void) => {- rigidBodiesSubscribersRef.current.add(callback);+ const updateServerConnection = useCallback((host: string, port: number): void => {+ // Update the singleton so HTTP endpoints also update+ serverUrls.setHost(host);+ serverUrls.setPort(port);- if (latestRigidBodies.current.size > 0) {- callback(latestRigidBodies.current);+ // Update the WebSocket URL and reconnect+ const ws = wsConnectionRef.current;+ if (ws) {+ ws.disconnect();+ ws.updateUrl(serverUrls.getWebSocketUrl());+ // The auto-reconnect loop in ServerConnectionStatus will re-trigger connect()}-- return () => {- rigidBodiesSubscribersRef.current.delete(callback);- };}, []);+ const contextValue = useMemo(() => ({+ isConnected,+ connect,+ disconnect,+ send,+ setCanvasForCamera,+ getFps,+ getServerFps,+ getFramerateStore,+ getLogStore,+ connectedCameraIds,+ updateServerConnection,+ }), [isConnected, connectedCameraIds, connect, disconnect, send, setCanvasForCamera, getFps, getServerFps, getFramerateStore, getLogStore, updateServerConnection]);+return (- <ServerContext.Provider value={{- isConnected,- connectionState,- connect,- disconnect,- send,- setCanvasForCamera,- getFps,- connectedCameraIds,- subscribeToFrames,- subscribeToTrackedPoints,- getLatestTrackedPoints,- subscribeToRigidBodies,- }}>+ <ServerContext.Provider value={contextValue}>{children}</ServerContext.Provider>);-};\ No newline at end of file+};++export const useServer = (): ServerContextValue => {+ const context = useContext(ServerContext);+ if (!context) throw new Error('useServer must be used within ServerContextProvider');+ return context;+};diff --git a/freemocap-ui/src/services/server/index.ts b/freemocap-ui/src/services/server/index.tsindex 8f1b48fe..1fef927c 100644--- a/freemocap-ui/src/services/server/index.ts+++ b/freemocap-ui/src/services/server/index.ts@@ -3,6 +3,5 @@ export * from '@/services/server/server-helpers/frame-processor/binary-frame-parexport * from './server-helpers/canvas-manager'export * from '@/services/server/server-helpers/frame-processor/frame-processor'export * from './server-helpers/offscreen-renderer.worker'-export * from '../../hooks/server-urls'+export * from './server-helpers/server-urls'export * from './server-helpers/websocket-connection'-export {useServer} from "@/hooks/useServer";diff --git a/freemocap-ui/src/services/server/server-helpers/canvas-manager.ts b/freemocap-ui/src/services/server/server-helpers/canvas-manager.tsindex 921963b5..a3da72c9 100644--- a/freemocap-ui/src/services/server/server-helpers/canvas-manager.ts+++ b/freemocap-ui/src/services/server/server-helpers/canvas-manager.ts@@ -1,10 +1,4 @@-import {workerCode} from "@/services/server/server-helpers/offscreen-renderer.worker";--export interface FrameData {- cameraId: string;- frameNumber: number;- bitmap: ImageBitmap;-}+import { workerCode } from "@/services/server/server-helpers/offscreen-renderer.worker";export interface CanvasWorker {worker: Worker;@@ -16,20 +10,26 @@ export class CanvasManager {private workers: Map<string, CanvasWorker> = new Map();private workerErrors: Map<string, number> = new Map();private pendingCanvases: Map<string, HTMLCanvasElement> = new Map();- private renderCallbacks: Map<string, () => void> = new Map(); // cameraId -> callbackprivate readonly maxWorkerErrors: number = 3;+ /**+ * Set or update the canvas for a camera.+ * Only creates a new worker if one doesn't exist or if the canvas has changed.+ */public setCanvasForCamera(cameraId: string, canvas: HTMLCanvasElement): boolean {+ // Check if this exact canvas is already set upconst existing = this.workers.get(cameraId);if (existing?.canvas === canvas && existing.initialized) {return true;}+ // Check if this is a different canvas for the same cameraif (existing && existing.canvas !== canvas) {console.log(`Canvas changed for camera ${cameraId}, recreating worker`);this.terminateWorker(cameraId);}+ // Store pending canvas in case we need to retrythis.pendingCanvases.set(cameraId, canvas);try {@@ -47,6 +47,7 @@ export class CanvasManager {initialized: true});+ // Reset error count on successful creationthis.workerErrors.delete(cameraId);this.pendingCanvases.delete(cameraId);@@ -60,34 +61,29 @@ export class CanvasManager {}}- public sendFrameToWorker(- cameraId: string,- bitmap: ImageBitmap,- onRendered?: () => void- ): boolean {+ /**+ * Send a frame to a worker. Creates the worker if it doesn't exist yet.+ */+ public sendFrameToWorker(cameraId: string, bitmap: ImageBitmap): boolean {const workerInfo = this.workers.get(cameraId);if (!workerInfo?.initialized) {+ // Check if we have a pending canvas we can useconst pendingCanvas = this.pendingCanvases.get(cameraId);if (pendingCanvas) {console.log(`Worker not ready for ${cameraId}, attempting to create from pending canvas`);if (this.setCanvasForCamera(cameraId, pendingCanvas)) {- return this.sendFrameToWorker(cameraId, bitmap, onRendered);+ // Try sending again after creation+ return this.sendFrameToWorker(cameraId, bitmap);}}console.warn(`No initialized worker for camera ${cameraId}, dropping frame`);bitmap.close();- onRendered?.();return false;}try {- // Store callback for this camera- if (onRendered) {- this.renderCallbacks.set(cameraId, onRendered);- }-workerInfo.worker.postMessage({ type: 'frame', bitmap },[bitmap]@@ -96,12 +92,14 @@ export class CanvasManager {} catch (error) {console.error(`Failed to send frame to worker ${cameraId}:`, error);bitmap.close();- onRendered?.();this.recordWorkerError(cameraId);return false;}}+ /**+ * Terminate a worker for a specific camera+ */public terminateWorker(cameraId: string): void {const workerInfo = this.workers.get(cameraId);if (workerInfo) {@@ -114,11 +112,13 @@ export class CanvasManager {this.workers.delete(cameraId);}- // Clean up callback- this.renderCallbacks.delete(cameraId);+ // Also clean up any pending canvasthis.pendingCanvases.delete(cameraId);}+ /**+ * Terminate all workers+ */public terminateAllWorkers(): void {console.log(`Terminating all workers (${this.workers.size} active)`);for (const [cameraId] of this.workers) {@@ -126,13 +126,18 @@ export class CanvasManager {}this.workerErrors.clear();this.pendingCanvases.clear();- this.renderCallbacks.clear();}+ /**+ * Get list of active camera IDs+ */public getActiveCameraIds(): string[] {return Array.from(this.workers.keys());}+ /**+ * Check if a worker exists and is initialized for a camera+ */public hasWorker(cameraId: string): boolean {const worker = this.workers.get(cameraId);return worker?.initialized ?? false;@@ -145,6 +150,7 @@ export class CanvasManager {try {const worker = new Worker(workerUrl);+ // Set up error handlingworker.onerror = (error) => {console.error(`Worker error for camera ${cameraId}:`, error);this.recordWorkerError(cameraId);@@ -154,16 +160,6 @@ export class CanvasManager {console.error(`Worker message error for camera ${cameraId}:`, error);};- worker.onmessage = (e) => {- if (e.data.type === 'frameRendered') {- const callback = this.renderCallbacks.get(cameraId);- if (callback) {- callback();- this.renderCallbacks.delete(cameraId);- }- }- };-return worker;} finally {URL.revokeObjectURL(workerUrl);diff --git a/freemocap-ui/src/services/server/server-helpers/frame-processor/binary-frame-parser.ts b/freemocap-ui/src/services/server/server-helpers/frame-processor/binary-frame-parser.tsindex e75eeeb3..3f8c6a6c 100644--- a/freemocap-ui/src/services/server/server-helpers/frame-processor/binary-frame-parser.ts+++ b/freemocap-ui/src/services/server/server-helpers/frame-processor/binary-frame-parser.ts@@ -1,12 +1,12 @@// binary-frame-parser.tsimport {+ MESSAGE_TYPE,+ PAYLOAD_HEADER_FIELDS,+ PAYLOAD_HEADER_SIZE,FRAME_HEADER_FIELDS,FRAME_HEADER_SIZE,- MESSAGE_TYPE,PAYLOAD_FOOTER_FIELDS,PAYLOAD_FOOTER_SIZE,- PAYLOAD_HEADER_FIELDS,- PAYLOAD_HEADER_SIZE,} from './binary-protocol';export interface ParsedFrame {@@ -19,7 +19,7 @@ export interface ParsedFrame {bitmap: ImageBitmap;}-// Single reusable TextDecoder+// Single reusable TextDecoder - created once, used foreverconst sharedTextDecoder = new TextDecoder();// Optimized ImageBitmap options for camera feedsdiff --git a/freemocap-ui/src/services/server/server-helpers/frame-processor/frame-processor.ts b/freemocap-ui/src/services/server/server-helpers/frame-processor/frame-processor.tsindex 089a2526..36cabe97 100644--- a/freemocap-ui/src/services/server/server-helpers/frame-processor/frame-processor.ts+++ b/freemocap-ui/src/services/server/server-helpers/frame-processor/frame-processor.ts@@ -1,8 +1,10 @@// frame-processor.ts-import {- ParsedFrame,- parseMultiFramePayload-} from "@/services/server/server-helpers/frame-processor/binary-frame-parser";+//+// Delegates binary payload parsing and JPEG→ImageBitmap decoding to a+// dedicated Web Worker so that all Blob allocations and createImageBitmap+// async work happen off the main thread.++import { frameDecodeWorkerCode } from "@/services/server/server-helpers/frame-processor/frame-decode.worker";export interface FrameData {cameraId: string;@@ -20,51 +22,128 @@ export interface ProcessedFrameResult {frameNumbers: Set<number>;}+/** Message sent from main thread → decode worker. */+interface DecodeRequest {+ type: 'decode';+ payload: ArrayBuffer;+ requestId: number;+}++/** Successful response from decode worker → main thread. */+interface DecodeResultMessage {+ type: 'result';+ requestId: number;+ frameData: Array<{+ cameraId: string;+ cameraIndex: number;+ frameNumber: number;+ width: number;+ height: number;+ colorChannels: number;+ }>;+ bitmaps: ImageBitmap[];+}++/** Error response from decode worker → main thread. */+interface DecodeErrorMessage {+ type: 'error';+ requestId: number;+ message: string;+}++type DecodeWorkerMessage = DecodeResultMessage | DecodeErrorMessage;+export class FrameProcessor {private lastFrameTime: Map<string, number> = new Map();private currentFps: Map<string, number> = new Map();- public async processFramePayload(data: ArrayBuffer): Promise<ProcessedFrameResult | null> {- try {- const parsedFrames = await parseMultiFramePayload(data);- if (!parsedFrames) {- console.warn('Failed to parse frame payload');- return null;+ private worker: Worker;+ private nextRequestId: number = 0;+ private pendingRequests: Map<number, {+ resolve: (result: ProcessedFrameResult | null) => void;+ reject: (error: Error) => void;+ }> = new Map();++ constructor() {+ const blob = new Blob([frameDecodeWorkerCode], { type: 'application/javascript' });+ const url = URL.createObjectURL(blob);+ this.worker = new Worker(url);+ URL.revokeObjectURL(url);++ this.worker.onmessage = (e: MessageEvent<DecodeWorkerMessage>) => {+ this.handleWorkerMessage(e.data);+ };++ this.worker.onerror = (e: ErrorEvent) => {+ const error = new Error(`Frame decode worker error: ${e.message}`);+ // Reject all pending requests so callers don't hang+ for (const [, pending] of this.pendingRequests) {+ pending.reject(error);}+ this.pendingRequests.clear();+ throw error;+ };+ }- const cameraIds = new Set<string>();- const frameNumbers = new Set<number>();-- // Convert ParsedFrame to FrameData (they have the same structure now)- const frames: FrameData[] = parsedFrames.map((frame: ParsedFrame) => ({- cameraId: frame.cameraId,- cameraIndex: frame.cameraIndex,- frameNumber: frame.frameNumber,- width: frame.width,- height: frame.height,- colorChannels: frame.colorChannels,- bitmap: frame.bitmap- }));-- for (const frame of frames) {- cameraIds.add(frame.cameraId);- frameNumbers.add(frame.frameNumber);-- // Track frame timing and calculate FPS- const now = performance.now();- const lastTime = this.lastFrameTime.get(frame.cameraId);- if (lastTime) {- const fps = 1000 / (now - lastTime);- this.currentFps.set(frame.cameraId, fps);+ private handleWorkerMessage(msg: DecodeWorkerMessage): void {+ const pending = this.pendingRequests.get(msg.requestId);+ if (!pending) {+ // Clean up any bitmaps in orphaned result messages+ if (msg.type === 'result') {+ for (const bitmap of msg.bitmaps) {+ bitmap.close();}- this.lastFrameTime.set(frame.cameraId, now);}+ throw new Error(`Received response for unknown request ${msg.requestId}`);+ }+ this.pendingRequests.delete(msg.requestId);++ if (msg.type === 'error') {+ pending.reject(new Error(msg.message));+ return;+ }- return { frames, cameraIds, frameNumbers };- } catch (error) {- console.error('Error processing frame payload:', error);- throw new Error(`Frame processing failed: ${error}`);+ // Reassemble FrameData by zipping metadata + bitmaps+ const frames: FrameData[] = msg.frameData.map((meta, i) => ({+ cameraId: meta.cameraId,+ cameraIndex: meta.cameraIndex,+ frameNumber: meta.frameNumber,+ width: meta.width,+ height: meta.height,+ colorChannels: meta.colorChannels,+ bitmap: msg.bitmaps[i],+ }));++ const cameraIds = new Set<string>();+ const frameNumbers = new Set<number>();++ for (const frame of frames) {+ cameraIds.add(frame.cameraId);+ frameNumbers.add(frame.frameNumber);++ // Track frame timing and calculate FPS on the main thread+ const now = performance.now();+ const lastTime = this.lastFrameTime.get(frame.cameraId);+ if (lastTime) {+ const fps = 1000 / (now - lastTime);+ this.currentFps.set(frame.cameraId, fps);+ }+ this.lastFrameTime.set(frame.cameraId, now);}++ pending.resolve({ frames, cameraIds, frameNumbers });+ }++ public processFramePayload(data: ArrayBuffer): Promise<ProcessedFrameResult | null> {+ return new Promise((resolve, reject) => {+ const requestId = this.nextRequestId++;+ this.pendingRequests.set(requestId, { resolve, reject });++ const msg: DecodeRequest = { type: 'decode', payload: data, requestId };+ // Transfer the ArrayBuffer to the worker (zero-copy).+ // After this, `data` is detached on the main thread.+ this.worker.postMessage(msg, [data]);+ });}public getFps(cameraId: string): number | null {@@ -74,5 +153,32 @@ export class FrameProcessor {public reset(): void {this.lastFrameTime.clear();this.currentFps.clear();++ // Reject any pending requests+ for (const [, pending] of this.pendingRequests) {+ pending.reject(new Error('FrameProcessor reset'));+ }+ this.pendingRequests.clear();++ // Terminate and recreate the worker+ this.worker.terminate();++ const blob = new Blob([frameDecodeWorkerCode], { type: 'application/javascript' });+ const url = URL.createObjectURL(blob);+ this.worker = new Worker(url);+ URL.revokeObjectURL(url);++ this.worker.onmessage = (e: MessageEvent<DecodeWorkerMessage>) => {+ this.handleWorkerMessage(e.data);+ };++ this.worker.onerror = (e: ErrorEvent) => {+ const error = new Error(`Frame decode worker error: ${e.message}`);+ for (const [, pending] of this.pendingRequests) {+ pending.reject(error);+ }+ this.pendingRequests.clear();+ throw error;+ };}}diff --git a/freemocap-ui/src/services/server/server-helpers/frame_compositor.ts b/freemocap-ui/src/services/server/server-helpers/frame_compositor.tsdeleted file mode 100644index 50486d2c..00000000--- a/freemocap-ui/src/services/server/server-helpers/frame_compositor.ts+++ /dev/null@@ -1,216 +0,0 @@-import {ArucoMarker, CharucoObservation, CharucoPoint} from "@/services/server/server-helpers/charuco_types";--/**- * Composites overlay graphics directly onto an ImageBitmap.- * Returns a new ImageBitmap with the overlay drawn on top.- */-export class FrameCompositor {- private offscreenCanvas: OffscreenCanvas;- private ctx: OffscreenCanvasRenderingContext2D;-- // Style constants- private readonly CHARUCO_COLOR = '#00FF00';- private readonly CHARUCO_STROKE = '#009600';- private readonly ARUCO_COLOR = '#FF6400';- private readonly ARUCO_STROKE = '#C85000';- private readonly TEXT_COLOR = '#ccc';- private readonly TEXT_STROKE = '#111';- private readonly INFO_BG = 'rgba(0, 0, 0, 0.7)';- private readonly SCALE: number = 1.0;-- constructor() {- // Create a reusable offscreen canvas for compositing- this.offscreenCanvas = new OffscreenCanvas(1, 1);- const ctx = this.offscreenCanvas.getContext('2d', {- alpha: true,- desynchronized: true,- });-- if (!ctx) {- throw new Error('Failed to get 2D context for compositor');- }-- this.ctx = ctx;- }-- /**- * Composite overlay onto an ImageBitmap and return a new ImageBitmap- */- public async compositeFrame(- sourceBitmap: ImageBitmap,- observation: CharucoObservation | null,- ): Promise<ImageBitmap> {- const { width, height } = sourceBitmap;-- // Resize canvas if needed- if (this.offscreenCanvas.width !== width || this.offscreenCanvas.height !== height) {- this.offscreenCanvas.width = width;- this.offscreenCanvas.height = height;- }-- // Draw source image- this.ctx.clearRect(0, 0, width, height);- this.ctx.drawImage(sourceBitmap, 0, 0);-- // Draw overlay if we have observation data- if (observation) {- this.drawOverlay(observation);- }-- // Create new bitmap from composited result- const compositeBitmap = await createImageBitmap(this.offscreenCanvas);-- // Close the source bitmap since we're done with it- sourceBitmap.close();-- return compositeBitmap;- }-- private drawOverlay(observation: CharucoObservation): void {- this.ctx.save();- this.ctx.scale(this.SCALE, this.SCALE);-- // Draw ArUco markers (behind Charuco corners)- this.drawArucoMarkers(observation.aruco_markers);-- // Draw Charuco corners- this.drawCharucoCorners(observation.charuco_corners);-- // Draw info overlay- this.drawInfoOverlay(observation);-- this.ctx.restore();- }-- private drawCharucoCorners(corners: CharucoPoint[]): void {- if (corners.length === 0) return;-- for (const corner of corners) {- // Draw filled circle- this.ctx.fillStyle = this.CHARUCO_COLOR;- this.ctx.beginPath();- this.ctx.arc(corner.x, corner.y, 5, 0, Math.PI * 2);- this.ctx.fill();-- // Draw stroke- this.ctx.strokeStyle = this.CHARUCO_STROKE;- this.ctx.lineWidth = 2;- this.ctx.stroke();-- // Draw ID label- this.drawText(- corner.id.toString(),- corner.x + 8,- corner.y - 8,- 10,- this.CHARUCO_COLOR,- this.TEXT_STROKE,- 2- );- }- }-- private drawArucoMarkers(markers: ArucoMarker[]): void {- if (markers.length === 0) return;-- for (const marker of markers) {- // Draw marker outline- this.ctx.strokeStyle = this.ARUCO_COLOR;- this.ctx.lineWidth = 3;- this.ctx.beginPath();-- // Draw square connecting the 4 corners- this.ctx.moveTo(marker.corners[0][0], marker.corners[0][1]);- for (let i = 1; i < 4; i++) {- this.ctx.lineTo(marker.corners[i][0], marker.corners[i][1]);- }- this.ctx.closePath();- this.ctx.stroke();-- // Draw corner points- this.ctx.fillStyle = this.ARUCO_COLOR;- for (const corner of marker.corners) {- this.ctx.beginPath();- this.ctx.arc(corner[0], corner[1], 4, 0, Math.PI * 2);- this.ctx.fill();- }-- // Draw marker ID at center- const centerX = marker.corners.reduce((sum, c) => sum + c[0], 0) / marker.corners.length;- const centerY = marker.corners.reduce((sum, c) => sum + c[1], 0) / marker.corners.length;-- this.drawText(- marker.id.toString(),- centerX,- centerY,- 14,- this.TEXT_COLOR,- this.ARUCO_COLOR,- 3,- 'bold'- );- }- }-- private drawInfoOverlay(observation: CharucoObservation): void {- const { metadata, frame_number } = observation;-- // Info text- const infoText =- `Frame: ${frame_number} | ` +- `Charuco: ${metadata.n_charuco_detected}/${metadata.n_charuco_total} | ` +- `ArUco: ${metadata.n_aruco_detected}/${metadata.n_aruco_total}` +- (metadata.has_pose ? ' | POSE ✓' : '');-- // Status text- let statusText = '';- let statusColor = '';- if (metadata.n_charuco_detected === 0 && metadata.n_aruco_detected === 0) {- statusText = '⚠ NO BOARD DETECTED';- statusColor = '#FF4444';- } else if (metadata.n_charuco_detected < 4) {- statusText = '⚠ INSUFFICIENT CORNERS';- statusColor = '#FFAA00';- } else {- statusText = '✓ BOARD DETECTED';- statusColor = '#00FF00';- }-- // Draw info background- this.ctx.fillStyle = this.INFO_BG;- this.ctx.fillRect(5, 5, 500, 60);-- // Draw info text- this.drawText(infoText, 10, 25, 14, this.TEXT_COLOR, this.TEXT_STROKE, 2);-- // Draw status text- this.drawText(statusText, 10, 50, 16, statusColor, this.TEXT_STROKE, 2);- }-- private drawText(- text: string,- x: number,- y: number,- fontSize: number,- fillColor: string,- strokeColor: string,- strokeWidth: number,- fontWeight: string = 'normal'- ): void {- this.ctx.font = `${fontWeight} ${fontSize}px Arial, sans-serif`;- this.ctx.textBaseline = 'middle';-- // Draw stroke (outline)- this.ctx.strokeStyle = strokeColor;- this.ctx.lineWidth = strokeWidth + 2;- this.ctx.strokeText(text, x, y);-- // Draw fill- this.ctx.fillStyle = fillColor;- this.ctx.fillText(text, x, y);- }-- public destroy(): void {- // Cleanup if needed- }-}diff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/charuco-overlay-renderer.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/charuco-overlay-renderer.tsdeleted file mode 100644index 6416d25f..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/charuco-overlay-renderer.ts+++ /dev/null@@ -1,184 +0,0 @@-// charuco-overlay-renderer.ts--import {- BaseOverlayRenderer,- DrawStyle,- Point2D-} from "@/services/server/server-helpers/image-overlay/image-overlay-system";-import {- ArucoMarker,- CharucoObservation,- CharucoPoint-} from "@/services/server/server-helpers/image-overlay/charuco-types";--export class CharucoOverlayRenderer extends BaseOverlayRenderer {- // Charuco-specific styles- private readonly charucoStyle: DrawStyle = {- pointColor: '#00FF00',- pointStroke: '#009600',- pointRadius: 5,- lineColor: '#00FF00',- lineWidth: 2,- labelColor: '#00FF00',- labelStroke: this.TEXT_STROKE,- labelFontSize: 10,- showLabels: true,- };-- private readonly arucoStyle: DrawStyle = {- pointColor: '#FF6400',- pointStroke: '#C85000',- pointRadius: 4,- lineColor: '#FF6400',- lineWidth: 3,- labelColor: this.TEXT_COLOR,- labelStroke: '#FF6400',- labelFontSize: 14,- showLabels: true,- };-- /**- * Composite charuco overlay onto frame- */- public async compositeFrame(- sourceBitmap: ImageBitmap,- observation: CharucoObservation | null,- ): Promise<ImageBitmap> {- this.prepareCanvas(sourceBitmap);-- if (observation) {- this.drawCharucoOverlay(observation);- }-- return this.createBitmap(sourceBitmap);- }-- private drawCharucoOverlay(observation: CharucoObservation): void {- this.ctx.save();-- // Draw ArUco markers first (behind Charuco corners)- this.drawArucoMarkers(observation.aruco_markers);-- // Draw Charuco corners- this.drawCharucoCorners(observation.charuco_corners);-- // Draw segments if model info is available- if (this.modelInfo) {- this.drawCharucoSegments(observation.charuco_corners);- }-- // Draw info overlay- this.drawCharucoInfo(observation);-- this.ctx.restore();- }-- private drawCharucoCorners(corners: CharucoPoint[]): void {- if (corners.length === 0) return;-- // Convert CharucoPoint[] to Point2D[]- const points: Point2D[] = corners.map(corner => ({- x: corner.x,- y: corner.y,- id: corner.id,- }));-- this.drawPoints(points, this.charucoStyle);- }-- private drawCharucoSegments(corners: CharucoPoint[]): void {- if (!this.modelInfo || corners.length === 0) return;-- // Create a map of corner ID to Point2D- const pointMap = new Map<string | number, Point2D>();- for (const corner of corners) {- pointMap.set(corner.id.toString(), {- x: corner.x,- y: corner.y,- id: corner.id,- });- }-- // Get segments from model info- const bodyAspect = this.modelInfo.aspects['body'];- if (bodyAspect?.segment_connections) {- this.drawSegments(pointMap, bodyAspect.segment_connections, {- ...this.charucoStyle,- lineColor: 'rgba(0, 255, 0, 0.5)', // Semi-transparent green- lineWidth: 1,- });- }- }-- private drawArucoMarkers(markers: ArucoMarker[]): void {- if (markers.length === 0) return;-- for (const marker of markers) {- this.drawPolygon(- marker.corners,- this.arucoStyle,- true,- marker.id.toString()- );- }- }-- private drawCharucoInfo(observation: CharucoObservation): void {- const { metadata, frame_number } = observation;-- // Build status info- let statusText = '';- let statusColor = '';- if (metadata.n_charuco_detected === 0 && metadata.n_aruco_detected === 0) {- statusText = '⚠ NO BOARD DETECTED';- statusColor = '#FF4444';- } else if (metadata.n_charuco_detected < 4) {- statusText = '⚠ INSUFFICIENT CORNERS';- statusColor = '#FFAA00';- } else {- statusText = '✔ BOARD DETECTED';- statusColor = '#00FF00';- }-- const additionalInfo = [- `Charuco: ${metadata.n_charuco_detected}/${metadata.n_charuco_total} | ` +- `ArUco: ${metadata.n_aruco_detected}/${metadata.n_aruco_total}` +- (metadata.has_pose ? ' | POSE ✔' : ''),- statusText,- ];-- // Draw background and info- this.ctx.fillStyle = this.INFO_BG;- this.ctx.fillRect(5, 5, 500, 85);-- this.drawText(- `Frame: ${frame_number}`,- 10,- 25,- 14,- this.TEXT_COLOR,- this.TEXT_STROKE,- 2- );-- this.drawText(- additionalInfo[0],- 10,- 50,- 14,- this.TEXT_COLOR,- this.TEXT_STROKE,- 2- );-- this.drawText(- additionalInfo[1],- 10,- 75,- 16,- statusColor,- this.TEXT_STROKE,- 2- );- }-}diff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/charuco-types.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/charuco-types.tsdeleted file mode 100644index 74fa788a..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/charuco-types.ts+++ /dev/null@@ -1,43 +0,0 @@-import {z} from 'zod';--// Zod schemas for CharucoObservation data-export const CharucoPointSchema = z.object({- id: z.number(),- x: z.number(),- y: z.number(),-});--export const ArucoMarkerSchema = z.object({- id: z.number(),- corners: z.array(z.tuple([z.number(), z.number()])).length(4),-});--export const CharucoMetadataSchema = z.object({- n_charuco_detected: z.number(),- n_charuco_total: z.number(),- n_aruco_detected: z.number(),- n_aruco_total: z.number(),- has_pose: z.boolean(),- image_width: z.number(),- image_height: z.number(),-});--// Schema for a single camera's charuco observation-export const CharucoOverlaySchema = z.object({- message_type: z.literal("charuco_overlay"),- camera_id: z.string(),- frame_number: z.number(),- charuco_corners: z.array(CharucoPointSchema),- aruco_markers: z.array(ArucoMarkerSchema),- metadata: CharucoMetadataSchema,-});--// Schema for the websocket message containing multiple camera observations-// Structure: { "camera_1": {...}, "camera_2": {...}, ... }-export const CharucoOverlayDataMessageSchema = z.record(z.string(), CharucoOverlaySchema);--// Type exports-export type CharucoPoint = z.infer<typeof CharucoPointSchema>;-export type ArucoMarker = z.infer<typeof ArucoMarkerSchema>;-export type CharucoObservation = z.infer<typeof CharucoOverlaySchema>;-export type CharucoOverlayDataMessage = z.infer<typeof CharucoOverlayDataMessageSchema>;diff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/image-overlay-system.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/image-overlay-system.tsdeleted file mode 100644index f0fe2b21..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/image-overlay-system.ts+++ /dev/null@@ -1,303 +0,0 @@-// base-overlay-renderer.ts-import { z } from 'zod';--// Generic types for any observation-export interface Point2D {- x: number;- y: number;- id?: string | number;- visibility?: number; // 0-1, for confidence/visibility-}--export interface Segment {- proximal: string | number;- distal: string | number;-}--export interface ModelInfo {- name: string;- tracker_name: string;- aspects: Record<string, AspectInfo>;- order: string[];-}--export interface AspectInfo {- tracked_points: {- type: 'list' | 'generated';- names?: string[];- convention?: string;- count?: number;- };- segment_connections?: Record<string, Segment>;- joint_hierarchy?: Record<string, string[]>;-}--export interface DrawStyle {- pointColor: string;- pointStroke: string;- pointRadius: number;- lineColor: string;- lineWidth: number;- labelColor: string;- labelStroke: string;- labelFontSize: number;- showLabels: boolean;-}--export interface ObservationMetadata {- frame_number: number;- [key: string]: any; // Allow additional metadata-}--export abstract class BaseOverlayRenderer {- protected offscreenCanvas: OffscreenCanvas;- protected ctx: OffscreenCanvasRenderingContext2D;- protected modelInfo: ModelInfo | null = null;-- // Common style constants- protected readonly INFO_BG = 'rgba(0, 0, 0, 0.7)';- protected readonly TEXT_COLOR = '#ccc';- protected readonly TEXT_STROKE = '#111';-- constructor() {- this.offscreenCanvas = new OffscreenCanvas(1, 1);- const ctx = this.offscreenCanvas.getContext('2d', {- alpha: true,- desynchronized: true,- });-- if (!ctx) {- throw new Error('Failed to get 2D context for overlay renderer');- }-- this.ctx = ctx;- }-- /**- * Set the model info for this renderer- */- public setModelInfo(modelInfo: ModelInfo): void {- this.modelInfo = modelInfo;- }-- /**- * Main composite method - to be implemented by specific renderers- */- public abstract compositeFrame(- sourceBitmap: ImageBitmap,- observation: any | null,- ): Promise<ImageBitmap>;-- /**- * Resize canvas if needed and draw source image- */- protected prepareCanvas(sourceBitmap: ImageBitmap): void {- const { width, height } = sourceBitmap;-- if (this.offscreenCanvas.width !== width || this.offscreenCanvas.height !== height) {- this.offscreenCanvas.width = width;- this.offscreenCanvas.height = height;- }-- this.ctx.clearRect(0, 0, width, height);- this.ctx.drawImage(sourceBitmap, 0, 0);- }-- /**- * Generic method to draw points- */- protected drawPoints(- points: Point2D[],- style: DrawStyle- ): void {- for (const point of points) {- // Skip invalid points- if (!this.isValidPoint(point)) continue;-- // Optional visibility threshold- if (point.visibility !== undefined && point.visibility < 0.5) continue;-- // Draw filled circle- this.ctx.fillStyle = style.pointColor;- this.ctx.beginPath();- this.ctx.arc(point.x, point.y, style.pointRadius, 0, Math.PI * 2);- this.ctx.fill();-- // Draw stroke- this.ctx.strokeStyle = style.pointStroke;- this.ctx.lineWidth = 2;- this.ctx.stroke();-- // Draw label if enabled- if (style.showLabels && point.id !== undefined) {- this.drawText(- point.id.toString(),- point.x + style.pointRadius + 3,- point.y - style.pointRadius - 3,- style.labelFontSize,- style.labelColor,- style.labelStroke,- 2- );- }- }- }-- /**- * Generic method to draw segments/connections between points- */- protected drawSegments(- points: Map<string | number, Point2D>,- segments: Record<string, Segment>,- style: DrawStyle- ): void {- for (const [_, segment] of Object.entries(segments)) {- const proximalPoint = points.get(segment.proximal);- const distalPoint = points.get(segment.distal);-- if (!proximalPoint || !distalPoint) continue;- if (!this.isValidPoint(proximalPoint) || !this.isValidPoint(distalPoint)) continue;-- // Draw line- this.ctx.strokeStyle = style.lineColor;- this.ctx.lineWidth = style.lineWidth;- this.ctx.beginPath();- this.ctx.moveTo(proximalPoint.x, proximalPoint.y);- this.ctx.lineTo(distalPoint.x, distalPoint.y);- this.ctx.stroke();- }- }-- /**- * Generic method to draw a polygon (like ArUco markers)- */- protected drawPolygon(- corners: [number, number][],- style: DrawStyle,- fillPoints: boolean = true,- label?: string- ): void {- if (corners.length < 3) return;-- // Draw outline- this.ctx.strokeStyle = style.lineColor;- this.ctx.lineWidth = style.lineWidth;- this.ctx.beginPath();- this.ctx.moveTo(corners[0][0], corners[0][1]);- for (let i = 1; i < corners.length; i++) {- this.ctx.lineTo(corners[i][0], corners[i][1]);- }- this.ctx.closePath();- this.ctx.stroke();-- // Draw corner points if requested- if (fillPoints) {- this.ctx.fillStyle = style.pointColor;- for (const corner of corners) {- this.ctx.beginPath();- this.ctx.arc(corner[0], corner[1], style.pointRadius, 0, Math.PI * 2);- this.ctx.fill();- }- }-- // Draw label at center if provided- if (label) {- const centerX = corners.reduce((sum, c) => sum + c[0], 0) / corners.length;- const centerY = corners.reduce((sum, c) => sum + c[1], 0) / corners.length;-- this.drawText(- label,- centerX,- centerY,- style.labelFontSize * 1.2,- this.TEXT_COLOR,- style.pointColor,- 3,- 'bold'- );- }- }-- /**- * Draw text with stroke (outline)- */- protected drawText(- text: string,- x: number,- y: number,- fontSize: number,- fillColor: string,- strokeColor: string,- strokeWidth: number,- fontWeight: string = 'normal'- ): void {- this.ctx.font = `${fontWeight} ${fontSize}px Arial, sans-serif`;- this.ctx.textBaseline = 'middle';-- // Draw stroke (outline)- this.ctx.strokeStyle = strokeColor;- this.ctx.lineWidth = strokeWidth + 2;- this.ctx.strokeText(text, x, y);-- // Draw fill- this.ctx.fillStyle = fillColor;- this.ctx.fillText(text, x, y);- }-- /**- * Draw info overlay with metadata- */- protected drawInfoOverlay(- metadata: ObservationMetadata,- additionalInfo?: string[]- ): void {- const lines: string[] = [- `Frame: ${metadata.frame_number}`,- ...(additionalInfo || [])- ];-- // Calculate background size- const lineHeight = 25;- const bgHeight = lines.length * lineHeight + 10;- const bgWidth = 500;-- // Draw background- this.ctx.fillStyle = this.INFO_BG;- this.ctx.fillRect(5, 5, bgWidth, bgHeight);-- // Draw lines- let y = 25;- for (const line of lines) {- this.drawText(line, 10, y, 14, this.TEXT_COLOR, this.TEXT_STROKE, 2);- y += lineHeight;- }- }-- /**- * Check if a point is valid (not NaN or undefined)- */- protected isValidPoint(point: Point2D): boolean {- return (- point &&- typeof point.x === 'number' &&- typeof point.y === 'number' &&- !isNaN(point.x) &&- !isNaN(point.y) &&- isFinite(point.x) &&- isFinite(point.y)- );- }-- /**- * Create final bitmap from canvas- */- protected async createBitmap(sourceBitmap: ImageBitmap): Promise<ImageBitmap> {- const compositeBitmap = await createImageBitmap(this.offscreenCanvas);- sourceBitmap.close();- return compositeBitmap;- }-- public destroy(): void {- // Cleanup if needed- }-}\ No newline at end of filediff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/mediapipe-overlay-renderer.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/mediapipe-overlay-renderer.tsdeleted file mode 100644index 59d6ddbc..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/mediapipe-overlay-renderer.ts+++ /dev/null@@ -1,471 +0,0 @@-// mediapipe-overlay-renderer.ts--import {- BaseOverlayRenderer,- DrawStyle,- Point2D-} from "@/services/server/server-helpers/image-overlay/image-overlay-system";--export interface MediapipePoint {- name: string;- x: number;- y: number;- z?: number;- visibility?: number;-}--export interface MediapipeObservation {- message_type: 'mediapipe_overlay';- camera_id: string;- frame_number: number;- body_points?: MediapipePoint[];- right_hand_points?: MediapipePoint[];- left_hand_points?: MediapipePoint[];- face_points?: MediapipePoint[];- metadata: {- image_width: number;- image_height: number;- n_body_detected: number;- n_right_hand_detected: number;- n_left_hand_detected: number;- n_face_detected: number;- };-}--export class MediapipeOverlayRenderer extends BaseOverlayRenderer {- // Body styles split by side- private readonly bodyStyleCenter: DrawStyle = {- pointColor: '#00AA00',- pointStroke: '#008800',- pointRadius: 4,- lineColor: 'rgba(20, 255, 20, 0.6)',- lineWidth: 2,- labelColor: '#00AA00',- labelStroke: this.TEXT_STROKE,- labelFontSize: 8,- showLabels: false,- };-- private readonly bodyStyleRight: DrawStyle = {- pointColor: '#FF4444',- pointStroke: '#AA0000',- pointRadius: 4,- lineColor: 'rgba(255, 68, 68, 0.6)',- lineWidth: 2,- labelColor: '#FF4444',- labelStroke: this.TEXT_STROKE,- labelFontSize: 8,- showLabels: false,- };-- private readonly bodyStyleLeft: DrawStyle = {- pointColor: '#4488FF',- pointStroke: '#0044AA',- pointRadius: 4,- lineColor: 'rgba(68, 136, 255, 0.6)',- lineWidth: 2,- labelColor: '#4488FF',- labelStroke: this.TEXT_STROKE,- labelFontSize: 8,- showLabels: false,- };-- private readonly rightHandStyle: DrawStyle = {- pointColor: '#FF6400',- pointStroke: '#AA4400',- pointRadius: 3,- lineColor: '#FF6400',- lineWidth: 1.5,- labelColor: '#FF6400',- labelStroke: this.TEXT_STROKE,- labelFontSize: 8,- showLabels: false,- };-- private readonly leftHandStyle: DrawStyle = {- pointColor: '#00AAFF',- pointStroke: '#0066AA',- pointRadius: 3,- lineColor: '#00AAFF',- lineWidth: 1.5,- labelColor: '#00AAFF',- labelStroke: this.TEXT_STROKE,- labelFontSize: 8,- showLabels: false,- };-- private readonly faceStyle: DrawStyle = {- pointColor: '#FFD700',- pointStroke: '#AA9900',- pointRadius: 1,- lineColor: '#FFD700',- lineWidth: 1,- labelColor: '#FFD700',- labelStroke: this.TEXT_STROKE,- labelFontSize: 6,- showLabels: false,- };-- /**- * Composite mediapipe overlay onto frame- */- public async compositeFrame(- sourceBitmap: ImageBitmap,- observation: MediapipeObservation | null,- ): Promise<ImageBitmap> {- this.prepareCanvas(sourceBitmap);-- if (observation) {- this.drawMediapipeOverlay(observation);- }-- return this.createBitmap(sourceBitmap);- }-- private drawMediapipeOverlay(observation: MediapipeObservation): void {- this.ctx.save();-- // Draw each aspect in order (face behind, body in middle, hands on top)- if (observation.face_points) {- this.drawFaceAspect(observation.face_points);- }-- if (observation.body_points) {- this.drawBodyAspect(observation.body_points);- }-- if (observation.right_hand_points) {- this.drawHandAspect(observation.right_hand_points, 'right_hand', this.rightHandStyle);- }-- if (observation.left_hand_points) {- this.drawHandAspect(observation.left_hand_points, 'left_hand', this.leftHandStyle);- }-- // Draw info overlay- this.drawMediapipeInfo(observation);-- this.ctx.restore();- }-- private getBodySide(name: string): 'left' | 'right' | 'center' {- if (name.includes('left')) return 'left';- if (name.includes('right')) return 'right';- return 'center';- }-- private getBodyStyleForSide(side: 'left' | 'right' | 'center'): DrawStyle {- switch (side) {- case 'left': return this.bodyStyleLeft;- case 'right': return this.bodyStyleRight;- case 'center': return this.bodyStyleCenter;- }- }-- private drawBodyAspect(points: MediapipePoint[]): void {- if (points.length === 0) return;-- // Create point map for segment drawing- const pointMap = new Map<string | number, Point2D>();- const leftPoints: Point2D[] = [];- const rightPoints: Point2D[] = [];- const centerPoints: Point2D[] = [];-- for (const point of points) {- const point2D: Point2D = {- x: point.x,- y: point.y,- id: point.name,- visibility: point.visibility,- };- pointMap.set(point.name, point2D);-- const side = this.getBodySide(point.name);- if (side === 'left') leftPoints.push(point2D);- else if (side === 'right') rightPoints.push(point2D);- else centerPoints.push(point2D);- }-- // Draw body skeleton connections (behind points)- this.drawBodyConnections(pointMap);-- // Draw points on top, color-coded by side- this.drawPoints(leftPoints, this.bodyStyleLeft);- this.drawPoints(rightPoints, this.bodyStyleRight);- this.drawPoints(centerPoints, this.bodyStyleCenter);-- // Highlight key points with labels- this.drawKeyBodyPoints(pointMap);- }-- private drawKeyBodyPoints(pointMap: Map<string | number, Point2D>): void {- // Label only important landmarks for clarity- const keyPoints = ['body.nose', 'body.left_shoulder', 'body.right_shoulder', 'body.left_hip', 'body.right_hip'];-- for (const key of keyPoints) {- const point = pointMap.get(key);- if (point && this.isValidPoint(point)) {- const style = this.getBodyStyleForSide(this.getBodySide(key));- this.drawText(- key.replace('body.', '').replace('_', ' '),- point.x + 5,- point.y - 5,- 8,- style.labelColor,- style.labelStroke,- 1- );- }- }- }-- private drawBodyConnections(- pointMap: Map<string | number, Point2D>,- ): void {- // Connections grouped by side for color coding- const centerConnections = [- ['body.nose', 'body.left_eye_inner'],- ['body.nose', 'body.right_eye_inner'],- ['body.mouth_left', 'body.mouth_right'],- ['body.left_shoulder', 'body.right_shoulder'],- ['body.left_hip', 'body.right_hip'],- ];-- const leftConnections = [- ['body.left_eye_inner', 'body.left_eye'],- ['body.left_eye', 'body.left_eye_outer'],- ['body.left_eye_outer', 'body.left_ear'],- ['body.left_shoulder', 'body.left_hip'],- ['body.left_shoulder', 'body.left_elbow'],- ['body.left_elbow', 'body.left_wrist'],- ['body.left_wrist', 'body.left_pinky'],- ['body.left_wrist', 'body.left_index'],- ['body.left_wrist', 'body.left_thumb'],- ['body.left_index', 'body.left_pinky'],- ['body.left_hip', 'body.left_knee'],- ['body.left_knee', 'body.left_ankle'],- ['body.left_ankle', 'body.left_heel'],- ['body.left_heel', 'body.left_foot_index'],- ['body.left_ankle', 'body.left_foot_index'],- ];-- const rightConnections = [- ['body.right_eye_inner', 'body.right_eye'],- ['body.right_eye', 'body.right_eye_outer'],- ['body.right_eye_outer', 'body.right_ear'],- ['body.right_shoulder', 'body.right_hip'],- ['body.right_shoulder', 'body.right_elbow'],- ['body.right_elbow', 'body.right_wrist'],- ['body.right_wrist', 'body.right_pinky'],- ['body.right_wrist', 'body.right_index'],- ['body.right_wrist', 'body.right_thumb'],- ['body.right_index', 'body.right_pinky'],- ['body.right_hip', 'body.right_knee'],- ['body.right_knee', 'body.right_ankle'],- ['body.right_ankle', 'body.right_heel'],- ['body.right_heel', 'body.right_foot_index'],- ['body.right_ankle', 'body.right_foot_index'],- ];-- const groups: [string[][], DrawStyle][] = [- [centerConnections, this.bodyStyleCenter],- [leftConnections, this.bodyStyleLeft],- [rightConnections, this.bodyStyleRight],- ];-- for (const [connections, style] of groups) {- for (const [start, end] of connections) {- const startPoint = pointMap.get(start);- const endPoint = pointMap.get(end);-- if (startPoint && endPoint && this.isValidPoint(startPoint) && this.isValidPoint(endPoint)) {- this.ctx.strokeStyle = style.lineColor;- this.ctx.lineWidth = style.lineWidth;- this.ctx.beginPath();- this.ctx.moveTo(startPoint.x, startPoint.y);- this.ctx.lineTo(endPoint.x, endPoint.y);- this.ctx.stroke();- }- }- }- }-- private drawHandAspect(- points: MediapipePoint[],- aspectName: string,- style: DrawStyle- ): void {- if (points.length === 0) return;-- const pointMap = new Map<string | number, Point2D>();- const point2DArray: Point2D[] = [];-- for (const point of points) {- const point2D: Point2D = {- x: point.x,- y: point.y,- id: point.name,- visibility: point.visibility,- };- pointMap.set(point.name, point2D);- point2DArray.push(point2D);- }-- // Draw hand skeleton connections- this.drawHandConnections(pointMap, style);-- // Draw points- this.drawPoints(point2DArray, style);- }-- private drawHandConnections(- pointMap: Map<string | number, Point2D>,- style: DrawStyle- ): void {- // Define hand connections (MediaPipe hand landmark connections)- const handConnections = [- // Thumb- ['wrist', 'thumb_cmc'],- ['thumb_cmc', 'thumb_mcp'],- ['thumb_mcp', 'thumb_ip'],- ['thumb_ip', 'thumb_tip'],- // Index finger- ['wrist', 'index_finger_mcp'],- ['index_finger_mcp', 'index_finger_pip'],- ['index_finger_pip', 'index_finger_dip'],- ['index_finger_dip', 'index_finger_tip'],- // Middle finger- ['wrist', 'middle_finger_mcp'],- ['middle_finger_mcp', 'middle_finger_pip'],- ['middle_finger_pip', 'middle_finger_dip'],- ['middle_finger_dip', 'middle_finger_tip'],- // Ring finger- ['wrist', 'ring_finger_mcp'],- ['ring_finger_mcp', 'ring_finger_pip'],- ['ring_finger_pip', 'ring_finger_dip'],- ['ring_finger_dip', 'ring_finger_tip'],- // Pinky- ['wrist', 'pinky_mcp'],- ['pinky_mcp', 'pinky_pip'],- ['pinky_pip', 'pinky_dip'],- ['pinky_dip', 'pinky_tip'],- // Palm connections- ['index_finger_mcp', 'middle_finger_mcp'],- ['middle_finger_mcp', 'ring_finger_mcp'],- ['ring_finger_mcp', 'pinky_mcp'],- ];-- for (const [start, end] of handConnections) {- const startPoint = pointMap.get(start);- const endPoint = pointMap.get(end);-- if (startPoint && endPoint && this.isValidPoint(startPoint) && this.isValidPoint(endPoint)) {- this.ctx.strokeStyle = style.lineColor;- this.ctx.lineWidth = style.lineWidth;- this.ctx.beginPath();- this.ctx.moveTo(startPoint.x, startPoint.y);- this.ctx.lineTo(endPoint.x, endPoint.y);- this.ctx.stroke();- }- }- }-- private drawFaceAspect(points: MediapipePoint[]): void {- if (points.length === 0) return;-- // For face, we just draw the points as a mesh without connections- // (too many points to draw connections clearly)- const point2DArray: Point2D[] = points.map(point => ({- x: point.x,- y: point.y,- id: point.name,- visibility: point.visibility,- }));-- this.drawPoints(point2DArray, this.faceStyle);-- // Draw face contour highlights for key features- this.drawFaceContour(points);- }-- private drawFaceContour(points: MediapipePoint[]): void {- // Draw simplified face contour for better visibility- // This would use the face contour indices from the model info- // For now, just highlight key face points- const keyFacePoints = points.filter(p =>- p.name.includes('eye') ||- p.name.includes('mouth') ||- p.name.includes('nose')- );-- const highlightStyle = {- ...this.faceStyle,- pointRadius: 2,- pointColor: '#FFFF00',- };-- this.drawPoints(- keyFacePoints.map(p => ({- x: p.x,- y: p.y,- id: p.name,- visibility: p.visibility,- })),- highlightStyle- );- }-- private drawMediapipeInfo(observation: MediapipeObservation): void {- const { metadata, frame_number } = observation;-- // Build detection status- const detections: string[] = [];- if (metadata.n_body_detected > 0) detections.push('Body');- if (metadata.n_right_hand_detected > 0) detections.push('R-Hand');- if (metadata.n_left_hand_detected > 0) detections.push('L-Hand');- if (metadata.n_face_detected > 0) detections.push('Face');-- const statusText = detections.length > 0- ? `✔ Detected: ${detections.join(', ')}`- : '⚠ No detection';-- const statusColor = detections.length > 0 ? '#00FF00' : '#FF4444';-- // Draw info background- this.ctx.fillStyle = this.INFO_BG;- this.ctx.fillRect(5, 5, 500, 85);-- // Draw frame info- this.drawText(- `Frame: ${frame_number}`,- 10,- 25,- 14,- this.TEXT_COLOR,- this.TEXT_STROKE,- 2- );-- // Draw detection counts- this.drawText(- `Body: ${metadata.n_body_detected} | Hands: ${metadata.n_right_hand_detected + metadata.n_left_hand_detected} | Face: ${metadata.n_face_detected > 0 ? '✔' : '✗'}`,- 10,- 50,- 14,- this.TEXT_COLOR,- this.TEXT_STROKE,- 2- );-- // Draw status- this.drawText(- statusText,- 10,- 75,- 16,- statusColor,- this.TEXT_STROKE,- 2- );- }-}\ No newline at end of filediff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/mediapipe-types.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/mediapipe-types.tsdeleted file mode 100644index 2bf9d74e..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/mediapipe-types.ts+++ /dev/null@@ -1,41 +0,0 @@-import z from "zod";--// Individual point schema-export const MediapipePointSchema = z.object({- name: z.string(),- x: z.number(),- y: z.number(),- z: z.number(),- visibility: z.number(),-});--// Metadata schema-export const MediapipeMetadataSchema = z.object({- n_body_detected: z.number(),- n_right_hand_detected: z.number(),- n_left_hand_detected: z.number(),- n_face_detected: z.number(),- image_width: z.number(),- image_height: z.number(),-});--// Single camera observation schema-export const MediapipeOverlaySchema = z.object({- message_type: z.literal("mediapipe_overlay"),- camera_id: z.string(),- frame_number: z.number(),- body_points: z.array(MediapipePointSchema),- right_hand_points: z.array(MediapipePointSchema),- left_hand_points: z.array(MediapipePointSchema),- face_points: z.array(MediapipePointSchema),- metadata: MediapipeMetadataSchema,-});--// Multi-camera message schema (matches CharucoOverlayDataMessage structure)-export const MediapipeOverlayDataMessageSchema = z.record(z.string(), MediapipeOverlaySchema);--// Type exports-export type MediapipePoint = z.infer<typeof MediapipePointSchema>;-export type MediapipeMetadata = z.infer<typeof MediapipeMetadataSchema>;-export type MediapipeObservation = z.infer<typeof MediapipeOverlaySchema>;-export type MediapipeOverlayDataMessage = z.infer<typeof MediapipeOverlayDataMessageSchema>;diff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/overlay-renderer-factory.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/overlay-renderer-factory.tsdeleted file mode 100644index 060463b3..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/overlay-renderer-factory.ts+++ /dev/null@@ -1,145 +0,0 @@-// overlay-renderer-factory.ts-import { CharucoOverlayRenderer } from './charuco-overlay-renderer';-import { MediapipeOverlayRenderer, MediapipeObservation } from './mediapipe-overlay-renderer';-import {BaseOverlayRenderer, ModelInfo} from "@/services/server/server-helpers/image-overlay/image-overlay-system";-import {CharucoObservation} from "@/services/server/server-helpers/image-overlay/charuco-types";--export type ObservationType = 'charuco_overlay' | 'mediapipe_overlay' | 'rtmpose_overlay';---/**- * Factory for creating appropriate overlay renderers based on observation type- */-export class OverlayRendererFactory {- private static rendererCache: Map<ObservationType, BaseOverlayRenderer> = new Map();- private static modelInfoCache: Map<string, ModelInfo> = new Map();-- /**- * Get or create a renderer for the specified observation type- */- public static getRenderer(type: ObservationType): BaseOverlayRenderer {- // Check cache first- let renderer = this.rendererCache.get(type);- if (renderer) {- return renderer;- }-- // Create new renderer based on type- switch (type) {- case 'charuco_overlay':- renderer = new CharucoOverlayRenderer();- break;- case 'mediapipe_overlay':- renderer = new MediapipeOverlayRenderer();- break;- case 'rtmpose_overlay':- // Future: implement RTMPoseOverlayRenderer- throw new Error('RTMPose overlay not yet implemented');- default:- throw new Error(`Unknown observation type: ${type}`);- }-- this.rendererCache.set(type, renderer);- return renderer;- }-- /**- * Set model info for a specific tracker type- */- public static setModelInfo(trackerName: string, modelInfo: ModelInfo): void {- this.modelInfoCache.set(trackerName, modelInfo);-- // Update all renderers that might use this model info- for (const [type, renderer] of this.rendererCache) {- if (this.shouldUseModelInfo(type, trackerName)) {- renderer.setModelInfo(modelInfo);- }- }- }-- /**- * Clear all cached renderers- */- public static clearCache(): void {- for (const renderer of this.rendererCache.values()) {- renderer.destroy();- }- this.rendererCache.clear();- this.modelInfoCache.clear();- }-- /**- * Determine if a renderer type should use a specific model info- */- private static shouldUseModelInfo(- rendererType: ObservationType,- trackerName: string- ): boolean {- const mapping: Record<ObservationType, string[]> = {- 'charuco_overlay': ['CharucoTracker'],- 'mediapipe_overlay': ['MediapipeHolisticTracker', 'MediapipeTracker'],- 'rtmpose_overlay': ['RTMPoseTracker'],- };-- return mapping[rendererType]?.includes(trackerName) || false;- }-}--/**- * Manager for handling overlay rendering across multiple cameras.- *- * Composites both charuco and mediapipe overlays sequentially onto each- * frame: source → charuco → mediapipe. Each renderer draws on top of- * the previous result rather than clearing and redrawing from scratch.- */-export class OverlayManager {- private charucoRenderer: CharucoOverlayRenderer = new CharucoOverlayRenderer();- private mediapipeRenderer: MediapipeOverlayRenderer = new MediapipeOverlayRenderer();-- /**- * Composite both overlay types onto a single frame, chained sequentially.- * The charuco overlay is drawn first, then mediapipe on top of the result.- */- public async processFrame(- cameraId: string,- sourceBitmap: ImageBitmap,- charucoObservation: CharucoObservation | null,- mediapipeObservation: MediapipeObservation | null,- ): Promise<ImageBitmap> {- let currentBitmap = sourceBitmap;-- if (charucoObservation) {- currentBitmap = await this.charucoRenderer.compositeFrame(- currentBitmap,- charucoObservation,- );- }-- if (mediapipeObservation) {- currentBitmap = await this.mediapipeRenderer.compositeFrame(- currentBitmap,- mediapipeObservation,- );- }-- return currentBitmap;- }-- /**- * Set model info on both renderers- */- public setModelInfo(modelInfo: ModelInfo): void {- this.charucoRenderer.setModelInfo(modelInfo);- this.mediapipeRenderer.setModelInfo(modelInfo);- }-- /**- * Clear all renderers- */- public clearAll(): void {- this.charucoRenderer.destroy();- this.mediapipeRenderer.destroy();- this.charucoRenderer = new CharucoOverlayRenderer();- this.mediapipeRenderer = new MediapipeOverlayRenderer();- }-}\ No newline at end of filediff --git a/freemocap-ui/src/services/server/server-helpers/image-overlay/overlay-types.ts b/freemocap-ui/src/services/server/server-helpers/image-overlay/overlay-types.tsdeleted file mode 100644index ea043a32..00000000--- a/freemocap-ui/src/services/server/server-helpers/image-overlay/overlay-types.ts+++ /dev/null@@ -1,17 +0,0 @@-import {CharucoObservation, CharucoOverlayDataMessage} from "@/services/server/server-helpers/image-overlay/charuco-types";-import {MediapipeObservation, MediapipeOverlayDataMessage} from "@/services/server/server-helpers/image-overlay/mediapipe-types";--// Union type for all observation data messages-export type ObservationDataMessage = CharucoOverlayDataMessage | MediapipeOverlayDataMessage;--// Union type for individual observations-export type Observation = CharucoObservation | MediapipeObservation;--// Type guard functions-export function isCharucoObservation(obs: Observation): obs is CharucoObservation {- return obs.message_type === 'charuco_overlay';-}--export function isMediapipeObservation(obs: Observation): obs is MediapipeObservation {- return obs.message_type === 'mediapipe_overlay';-}diff --git a/freemocap-ui/src/services/server/server-helpers/offscreen-renderer.worker.ts b/freemocap-ui/src/services/server/server-helpers/offscreen-renderer.worker.tsindex 6b982fd4..78e55f3a 100644--- a/freemocap-ui/src/services/server/server-helpers/offscreen-renderer.worker.ts+++ b/freemocap-ui/src/services/server/server-helpers/offscreen-renderer.worker.ts@@ -3,6 +3,7 @@ let offscreenCanvas;let ctx;let pendingFrame = null;let isRendering = false;+let lastRenderTime = 0;let stats = {framesRendered: 0,framesDropped: 0,@@ -29,32 +30,39 @@ self.onmessage = (e) => {function initCanvas(data) {offscreenCanvas = data.canvas;++ // Use ImageBitmapRenderingContext - fastest for bitmap streamingctx = offscreenCanvas.getContext('bitmaprenderer');++ // Start render looprenderLoop();+self.postMessage({ type: 'initialized' });}function handleFrame(data) {const bitmap = data.bitmap;+ // Validate bitmap dimensionsif (!bitmap || bitmap.width <= 0 || bitmap.height <= 0) {console.error('Invalid bitmap dimensions:', bitmap?.width, bitmap?.height);if (bitmap) bitmap.close();return;}- // Resize canvas if needed+ // Resize canvas to match bitmap dimensions if they differ+ // This handles rotation changes and different camera resolutionsif (offscreenCanvas.width !== bitmap.width || offscreenCanvas.height !== bitmap.height) {offscreenCanvas.width = bitmap.width;offscreenCanvas.height = bitmap.height;+ // Resizing automatically clears the canvas, preventing old frame artifacts}- // Drop old frame if still pending+ // Frame dropping strategy: keep only latest frameif (pendingFrame) {- pendingFrame.close();+ pendingFrame.close(); // Clean up skipped framestats.framesDropped++;}-pendingFrame = bitmap;}@@ -64,26 +72,29 @@ function renderLoop() {if (pendingFrame && !isRendering) {isRendering = true;- // Render the frame- ctx.transferFromImageBitmap(pendingFrame);- pendingFrame.close();+ const frame = pendingFrame;pendingFrame = null;+ // transferFromImageBitmap detaches the bitmap (ownership transferred to canvas).+ // Explicit close() afterwards as a safety net for browser edge cases.+ ctx.transferFromImageBitmap(frame);+ frame.close();+// Update statsstats.framesRendered++;const renderTime = performance.now() - startTime;stats.totalRenderTime += renderTime;+ // Warn if frame took too longif (renderTime > 16.67) {console.warn(\`Slow frame: \${renderTime.toFixed(2)}ms\`);}isRendering = false;-- // Notify that frame is rendered- self.postMessage({ type: 'frameRendered' });+ lastRenderTime = performance.now();}+ // Use requestAnimationFrame in worker for smooth renderingrequestAnimationFrame(renderLoop);}`;diff --git a/freemocap-ui/src/services/server/server-helpers/websocket-connection.ts b/freemocap-ui/src/services/server/server-helpers/websocket-connection.tsindex 45a99752..2fcbed7d 100644--- a/freemocap-ui/src/services/server/server-helpers/websocket-connection.ts+++ b/freemocap-ui/src/services/server/server-helpers/websocket-connection.ts@@ -3,38 +3,17 @@ export interface WebSocketConfig {reconnectDelay?: number;maxReconnectAttempts?: number;heartbeatInterval?: number;- /** When true, silently poll for the server and auto-connect when it appears. */- autoConnect?: boolean;- /** Polling interval (ms) when in auto-connect discovery mode. */- autoConnectInterval?: number;}export enum ConnectionState {- /** Idle — not trying to connect. */DISCONNECTED = 'DISCONNECTED',- /** Actively opening a WebSocket connection. */CONNECTING = 'CONNECTING',- /** WebSocket is open. */CONNECTED = 'CONNECTED',- /** Lost connection, attempting to re-establish. */RECONNECTING = 'RECONNECTING',- /** Silently polling for the server to become available. */- DISCOVERING = 'DISCOVERING',+ FAILED = 'FAILED'}-/** Typed event map — each key declares its callback signature. */-interface WebSocketEventMap {- 'state-change': (newState: ConnectionState, previousState: ConnectionState) => void;- 'message': (event: MessageEvent) => void;- 'open': () => void;- 'close': (event: CloseEvent) => void;- 'error': (event: Event) => void;- 'send-failed': (data: string | object) => void;- 'send-error': (error: unknown) => void;- 'max-reconnect-attempts': () => void;-}--type EventName = keyof WebSocketEventMap;+type EventCallback = (...args: any[]) => void;export class WebSocketConnection {private ws: WebSocket | null = null;@@ -42,59 +21,47 @@ export class WebSocketConnection {private reconnectAttempts: number = 0;private reconnectTimer: number | null = null;private heartbeatTimer: number | null = null;- private discoveryTimer: number | null = null;private state: ConnectionState = ConnectionState.DISCONNECTED;- private listeners: { [K in EventName]?: Set<WebSocketEventMap[K]> } = {};+ // Simple event emitter implementation for browser+ private listeners: Map<string, Set<EventCallback>> = new Map();constructor(config: WebSocketConfig) {this.config = {reconnectDelay: config.reconnectDelay ?? 1000,maxReconnectAttempts: config.maxReconnectAttempts ?? 5,heartbeatInterval: config.heartbeatInterval ?? 30000,- autoConnect: config.autoConnect ?? false,- autoConnectInterval: config.autoConnectInterval ?? 3000,- url: config.url,+ url: config.url};}- public on<K extends EventName>(event: K, callback: WebSocketEventMap[K]): void {- if (!this.listeners[event]) {- // eslint-disable-next-line @typescript-eslint/no-explicit-any- this.listeners[event] = new Set() as any;+ // Simple event emitter methods+ public on(event: string, callback: EventCallback): void {+ if (!this.listeners.has(event)) {+ this.listeners.set(event, new Set());}- // eslint-disable-next-line @typescript-eslint/no-explicit-any- (this.listeners[event] as any).add(callback);+ this.listeners.get(event)!.add(callback);}- public off<K extends EventName>(event: K, callback: WebSocketEventMap[K]): void {- // eslint-disable-next-line @typescript-eslint/no-explicit-any- (this.listeners[event] as any)?.delete(callback);+ public off(event: string, callback: EventCallback): void {+ this.listeners.get(event)?.delete(callback);}- private emit<K extends EventName>(event: K, ...args: Parameters<WebSocketEventMap[K]>): void {- const set = this.listeners[event];- if (!set) return;- for (const callback of set) {+ private emit(event: string, ...args: any[]): void {+ this.listeners.get(event)?.forEach(callback => {try {- // eslint-disable-next-line @typescript-eslint/no-explicit-any- (callback as any)(...args);+ callback(...args);} catch (error) {console.error(`Error in event listener for ${event}:`, error);}- }+ });}- /**- * Begin actively trying to open the WebSocket connection.- * If autoConnect is enabled and the attempt fails, falls back to discovery mode.- */public connect(): void {if (this.state === ConnectionState.CONNECTING || this.state === ConnectionState.CONNECTED) {return;}- this.stopDiscovery();this.setState(ConnectionState.CONNECTING);try {@@ -110,15 +77,12 @@ export class WebSocketConnection {}}- /**- * Cleanly close the connection and stop all reconnection/discovery.- */public disconnect(): void {this.clearTimers();- this.stopDiscovery();this.reconnectAttempts = 0;if (this.ws) {+ // Remove handlers to avoid reconnection on closethis.ws.onclose = null;this.ws.close();this.ws = null;@@ -127,22 +91,9 @@ export class WebSocketConnection {this.setState(ConnectionState.DISCONNECTED);}- /**- * Enter discovery mode: silently poll for the server at a fixed interval.- * Does not surface errors — just keeps trying until the server appears.- */- public startDiscovery(): void {- if (this.state === ConnectionState.CONNECTED || this.state === ConnectionState.CONNECTING) {- return;- }-- console.log(`[WS] Entering discovery mode (polling every ${this.config.autoConnectInterval}ms)`);- this.setState(ConnectionState.DISCOVERING);- this.scheduleDiscoveryAttempt();- }-public send(data: string | object): boolean {if (!this.isConnected()) {+ console.warn('WebSocket not connected, queuing message');this.emit('send-failed', data);return false;}@@ -162,14 +113,18 @@ export class WebSocketConnection {return this.ws?.readyState === WebSocket.OPEN;}+ public getUrl(): string {+ return this.config.url;+ }++ public updateUrl(url: string): void {+ this.config.url = url;+ }+public getState(): ConnectionState {return this.state;}- // ------------------------------------------------------------ // Private- // ------------------------------------------------------------private setState(state: ConnectionState): void {const previousState = this.state;this.state = state;@@ -179,7 +134,6 @@ export class WebSocketConnection {private handleOpen(): void {console.log('WebSocket connected');this.reconnectAttempts = 0;- this.stopDiscovery();this.setState(ConnectionState.CONNECTED);this.startHeartbeat();this.emit('open');@@ -188,32 +142,24 @@ export class WebSocketConnection {private handleClose(event: CloseEvent): void {console.log(`WebSocket closed: code=${event.code}, reason=${event.reason}`);this.clearTimers();- this.ws = null;- // Always transition to DISCONNECTED first — this triggers cleanup- // in listeners (e.g. ServerContextProvider dispatches serverSettingsCleared)- this.setState(ConnectionState.DISCONNECTED);- this.emit('close', event);+ const wasConnected = this.state === ConnectionState.CONNECTED;- // If autoConnect is on, immediately start polling for the server again- if (this.config.autoConnect) {- this.startDiscovery();- return;- }-- if (this.reconnectAttempts < this.config.maxReconnectAttempts) {+ if (wasConnected && this.reconnectAttempts < this.config.maxReconnectAttempts) {this.scheduleReconnect();- } else {+ } else if (this.reconnectAttempts >= this.config.maxReconnectAttempts) {+ this.setState(ConnectionState.FAILED);this.emit('max-reconnect-attempts');+ } else {+ this.setState(ConnectionState.DISCONNECTED);}++ this.emit('close', event);}- private handleError(_error: Event): void {- // In discovery mode, errors are expected and silenced- if (this.state === ConnectionState.DISCOVERING) {- return;- }- this.emit('error', _error);+ private handleError(error: Event): void {+ console.error('WebSocket error:', error);+ this.emit('error', error);}private handleMessage(event: MessageEvent): void {@@ -226,7 +172,7 @@ export class WebSocketConnection {this.setState(ConnectionState.RECONNECTING);const delay = Math.min(this.config.reconnectDelay * Math.pow(2, this.reconnectAttempts),- 10000,+ 10000 // Max 10 seconds);console.log(`Reconnecting in ${delay}ms (attempt ${this.reconnectAttempts + 1}/${this.config.maxReconnectAttempts})`);@@ -238,71 +184,31 @@ export class WebSocketConnection {}, delay);}- /**- * Schedule one discovery probe. On failure, schedule the next one.- * On success, handleOpen() takes over.- */- private scheduleDiscoveryAttempt(): void {- if (this.discoveryTimer !== null) return;-- this.discoveryTimer = window.setTimeout(() => {- this.discoveryTimer = null;-- if (this.state !== ConnectionState.DISCOVERING) return;-- try {- const probe = new WebSocket(this.config.url);- probe.binaryType = 'arraybuffer';-- probe.onopen = () => {- console.log('[WS] Discovery probe succeeded — promoting to main connection');- // Discovery succeeded — promote this socket to the main connection- this.ws = probe;- probe.onclose = this.handleClose.bind(this);- probe.onerror = this.handleError.bind(this);- probe.onmessage = this.handleMessage.bind(this);- this.handleOpen();- };-- probe.onerror = () => {- // Silently swallow — try again on the next interval- try { probe.close(); } catch { /* ignore */ }- if (this.state === ConnectionState.DISCOVERING) {- this.scheduleDiscoveryAttempt();- }- };-- probe.onclose = () => {- // If we get a close without ever opening, try again- if (this.state === ConnectionState.DISCOVERING) {- this.scheduleDiscoveryAttempt();- }- };- } catch {- // WebSocket constructor threw — try again- if (this.state === ConnectionState.DISCOVERING) {- this.scheduleDiscoveryAttempt();- }- }- }, this.config.autoConnectInterval);- }-- private stopDiscovery(): void {- if (this.discoveryTimer !== null) {- clearTimeout(this.discoveryTimer);- this.discoveryTimer = null;- }- }-private startHeartbeat(): void {this.heartbeatTimer = window.setInterval(() => {if (this.isConnected()) {- // Send plain text "ping" — the backend expects this format- this.ws!.send('ping');+ this.sendRaw('ping');}}, this.config.heartbeatInterval);}+ /**+ * Send a raw text string over the WebSocket without JSON serialization.+ * Used for protocol-level messages like ping/pong.+ */+ public sendRaw(text: string): boolean {+ if (!this.isConnected()) {+ return false;+ }+ try {+ this.ws!.send(text);+ return true;+ } catch (error) {+ console.error('Failed to send raw WebSocket message:', error);+ return false;+ }+ }+private clearTimers(): void {if (this.reconnectTimer) {clearTimeout(this.reconnectTimer);diff --git a/freemocap-ui/src/services/server/server-helpers/websocket-message-types.ts b/freemocap-ui/src/services/server/server-helpers/websocket-message-types.tsdeleted file mode 100644index eb1e424d..00000000--- a/freemocap-ui/src/services/server/server-helpers/websocket-message-types.ts+++ /dev/null@@ -1,76 +0,0 @@-import {DetailedFramerate, LogRecord} from '@/store';-import {SettingsStateMessage} from '@/store/slices/settings/settings-types';-import {- CharucoOverlayDataMessage,- CharucoOverlayDataMessageSchema,-} from "@/services/server/server-helpers/image-overlay/charuco-types";-import {- MediapipeOverlayDataMessage,- MediapipeOverlayDataMessageSchema,-} from "@/services/server/server-helpers/image-overlay/mediapipe-types";-import {ModelInfo} from "@/services/server/server-helpers/image-overlay/image-overlay-system";-import {OverlayRendererFactory} from "@/services/server/server-helpers/image-overlay/overlay-renderer-factory";--export interface FramerateUpdateMessage {- message_type: 'framerate_update';- camera_group_id: string;- backend_framerate: DetailedFramerate;- frontend_framerate: DetailedFramerate;-}--export function arraysEqual(a: string[], b: string[]): boolean {- if (a.length !== b.length) return false;- const sortedA = [...a].sort();- const sortedB = [...b].sort();- return sortedA.every((val, idx) => val === sortedB[idx]);-}--export function isLogRecord(data: unknown): data is LogRecord {- return (- typeof data === 'object' &&- data !== null &&- (data as Record<string, unknown>).message_type === 'log_record' &&- typeof (data as Record<string, unknown>).levelname === 'string' &&- typeof (data as Record<string, unknown>).message === 'string'- );-}--export function isSettingsStateMessage(data: unknown): data is SettingsStateMessage {- return (- typeof data === 'object' &&- data !== null &&- (data as Record<string, unknown>).message_type === 'settings/state' &&- typeof (data as Record<string, unknown>).settings === 'object' &&- (data as Record<string, unknown>).settings !== null &&- typeof (data as Record<string, unknown>).version === 'number'- );-}--export function isFramerateUpdate(data: unknown): data is FramerateUpdateMessage {- const d = data as Record<string, unknown>;- return (- typeof data === 'object' &&- data !== null &&- d.message_type === 'framerate_update' &&- typeof d.camera_group_id === 'string' &&- typeof d.backend_framerate === 'object' &&- d.backend_framerate !== null &&- typeof d.frontend_framerate === 'object' &&- d.frontend_framerate !== null- );-}--export function isCharucoOverlayDataMessage(data: unknown): data is CharucoOverlayDataMessage {- const result = CharucoOverlayDataMessageSchema.safeParse(data);- return result.success;-}--export function isMediapipeOverlayDataMessage(data: unknown): data is MediapipeOverlayDataMessage {- const result = MediapipeOverlayDataMessageSchema.safeParse(data);- return result.success;-}--export function handleModelInfoUpdate(modelInfo: ModelInfo): void {- console.log(`Received model info for tracker: ${modelInfo.tracker_name}`);- OverlayRendererFactory.setModelInfo(modelInfo.tracker_name, modelInfo);-}\ No newline at end of filediff --git a/freemocap-ui/src/store/hooks.ts b/freemocap-ui/src/store/hooks.tsindex fd5b5512..7fb32806 100644--- a/freemocap-ui/src/store/hooks.ts+++ b/freemocap-ui/src/store/hooks.ts@@ -1,5 +1,5 @@-import {TypedUseSelectorHook, useDispatch, useSelector} from 'react-redux';-import type {AppDispatch, RootState} from './types';+import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';+import type { RootState, AppDispatch } from './types';export const useAppDispatch = (): AppDispatch => useDispatch<AppDispatch>();export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;diff --git a/freemocap-ui/src/store/index.ts b/freemocap-ui/src/store/index.tsindex c57b7807..cdd75c82 100644--- a/freemocap-ui/src/store/index.ts+++ b/freemocap-ui/src/store/index.ts@@ -6,10 +6,6 @@ export { useAppDispatch, useAppSelector } from './hooks';// Re-export all slice actions and selectors for a nice 'barrel' design pattern, which makes imports cleanerexport * from './slices/cameras';export * from './slices/recording';-export * from './slices/framerate';-export * from './slices/log-records';export * from './slices/theme';export * from './slices/videos';-export * from './slices/pipeline';-export * from './slices/mocap';export * from './slices/settings';diff --git a/freemocap-ui/src/store/slices/calibration/calibration-slice.ts b/freemocap-ui/src/store/slices/calibration/calibration-slice.tsdeleted file mode 100644index 65124964..00000000--- a/freemocap-ui/src/store/slices/calibration/calibration-slice.ts+++ /dev/null@@ -1,221 +0,0 @@-import {createSelector, createSlice, PayloadAction} from '@reduxjs/toolkit';-import {RootState} from '../../types';-import {- calibrateRecording,- startCalibrationRecording,- stopCalibrationRecording,- updateCalibrationConfigOnServer,-} from "@/store/slices/calibration/calibration-thunks";--// ==================== Types ====================--export type CalibrationSolverMethod = 'anipose' | 'pyceres';--export interface CalibrationConfig {- liveTrackCharuco: boolean;- charucoBoardXSquares: number;- charucoBoardYSquares: number;- charucoSquareLength: number;- minSharedViewsPerCamera: number;- autoStopOnMinViewCount: boolean;- solverMethod: CalibrationSolverMethod;- useGroundplane: boolean;-}--export interface CalibrationDirectoryInfo {- exists: boolean;- canRecord: boolean;- canCalibrate: boolean;- cameraCalibrationTomlPath: string | null;- hasSynchronizedVideos: boolean;- hasVideos: boolean;- errorMessage: string | null;-}--export interface CalibrationState {- config: CalibrationConfig;- isRecording: boolean;- recordingProgress: number;- isLoading: boolean;- error: string | null;- lastCalibrationRecordingPath: string | null;- manualCalibrationRecordingPath: string | null;- directoryInfo: CalibrationDirectoryInfo | null;-}--// ==================== Initial State ====================--const initialState: CalibrationState = {- config: {- liveTrackCharuco: true,- charucoBoardXSquares: 5,- charucoBoardYSquares: 3,- charucoSquareLength: 1,- minSharedViewsPerCamera: 200,- autoStopOnMinViewCount: true,- solverMethod: 'anipose',- useGroundplane: false,- },- isRecording: false,- recordingProgress: 0,- isLoading: false,- error: null,- lastCalibrationRecordingPath: null,- manualCalibrationRecordingPath: null,- directoryInfo: null,-};--// ==================== Slice ====================--export const calibrationSlice = createSlice({- name: 'calibration',- initialState,- reducers: {- calibrationConfigUpdated: (state, action: PayloadAction<Partial<CalibrationConfig>>) => {- state.config = { ...state.config, ...action.payload };- },-- calibrationProgressUpdated: (state, action: PayloadAction<number>) => {- state.recordingProgress = action.payload;- },-- calibrationErrorCleared: (state) => {- state.error = null;- },-- manualCalibrationRecordingPathChanged: (state, action: PayloadAction<string>) => {- state.manualCalibrationRecordingPath = action.payload;- },-- manualCalibrationRecordingPathCleared: (state) => {- state.manualCalibrationRecordingPath = null;- },-- calibrationDirectoryInfoUpdated: (state, action: PayloadAction<CalibrationDirectoryInfo>) => {- state.directoryInfo = action.payload;- },-- resetCalibrationState: () => initialState,- },-- extraReducers: (builder) => {- builder- .addCase(startCalibrationRecording.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(startCalibrationRecording.fulfilled, (state, action) => {- state.isLoading = false;- state.isRecording = true;- state.recordingProgress = 0;- if (action.payload.calibrationRecordingPath) {- state.lastCalibrationRecordingPath = action.payload.calibrationRecordingPath;- }- })- .addCase(startCalibrationRecording.rejected, (state, action) => {- state.isLoading = false;- state.error = action.payload || 'Failed to start recording';- });-- builder- .addCase(stopCalibrationRecording.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(stopCalibrationRecording.fulfilled, (state) => {- state.isLoading = false;- state.isRecording = false;- state.recordingProgress = 0;- })- .addCase(stopCalibrationRecording.rejected, (state, action) => {- state.isLoading = false;- state.error = action.payload || 'Failed to stop recording';- });-- builder- .addCase(calibrateRecording.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(calibrateRecording.fulfilled, (state) => {- state.isLoading = false;- })- .addCase(calibrateRecording.rejected, (state, action) => {- state.isLoading = false;- state.error = action.payload || 'Failed to calibrate recording';- });-- builder- .addCase(updateCalibrationConfigOnServer.rejected, (state, action) => {- state.error = action.payload || 'Failed to sync config to server';- });- },-});--// ==================== Selectors ====================--export const selectCalibration = (state: RootState) => state.calibration;-export const selectCalibrationConfig = (state: RootState) => state.calibration.config;-export const selectCalibrationIsLoading = (state: RootState) => state.calibration.isLoading;-export const selectCalibrationIsRecording = (state: RootState) => state.calibration.isRecording;-export const selectCalibrationProgress = (state: RootState) => state.calibration.recordingProgress;-export const selectCalibrationError = (state: RootState) => state.calibration.error;-export const selectCalibrationDirectoryInfo = (state: RootState) => state.calibration.directoryInfo;--export const selectCalibrationRecordingPath = createSelector(- [- (state: RootState) => state.calibration.manualCalibrationRecordingPath,- (state: RootState) => state.calibration.lastCalibrationRecordingPath,- (state: RootState) => state.recording.computed,- ],- (manualPath, lastPath, recordingComputed) => {- if (manualPath) return manualPath;- if (lastPath) return lastPath;-- const calibrationFolderName = `${recordingComputed.recordingName}_calibration`;- return `${recordingComputed.fullRecordingPath}/${calibrationFolderName}`;- }-);--export const selectIsUsingManualCalibrationPath = createSelector(- [(state: RootState) => state.calibration.manualCalibrationRecordingPath],- (manualPath) => manualPath !== null-);--export const selectCanStartCalibrationRecording = createSelector(- [- selectCalibrationIsRecording,- selectCalibrationIsLoading,- selectCalibrationRecordingPath,- selectCalibrationDirectoryInfo- ],- (isRecording, isLoading, recordingPath, directoryInfo) => {- return !isRecording && !isLoading && !!recordingPath && (directoryInfo?.canRecord ?? true);- }-);--export const selectCanCalibrate = createSelector(- [- selectCalibrationRecordingPath,- selectCalibrationIsLoading,- selectCalibrationIsRecording,- selectCalibrationDirectoryInfo- ],- (calibrationPath, isLoading, isRecording, directoryInfo) => {- return !!calibrationPath && !isLoading && !isRecording && (directoryInfo?.canCalibrate ?? false);- }-);--// ==================== Actions Export ====================--export const {- calibrationConfigUpdated,- calibrationProgressUpdated,- calibrationErrorCleared,- manualCalibrationRecordingPathChanged,- manualCalibrationRecordingPathCleared,- calibrationDirectoryInfoUpdated,- resetCalibrationState-} = calibrationSlice.actions;--export default calibrationSlice.reducer;diff --git a/freemocap-ui/src/store/slices/calibration/calibration-thunks.ts b/freemocap-ui/src/store/slices/calibration/calibration-thunks.tsdeleted file mode 100644index eaddc923..00000000--- a/freemocap-ui/src/store/slices/calibration/calibration-thunks.ts+++ /dev/null@@ -1,169 +0,0 @@-import {createAsyncThunk} from "@reduxjs/toolkit";-import {RootState} from "@/store";-import {serverUrls} from "@/hooks/server-urls";-import {selectCalibrationRecordingPath} from "./calibration-slice";-import {getDetailedErrorMessage} from "@/store/slices/thunk-helpers";--export const startCalibrationRecording = createAsyncThunk<- { success: boolean; message?: string; calibrationRecordingPath?: string },- void,- { state: RootState; rejectValue: string }->(- 'calibration/startRecording',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const calibrationTaskConfig = state.calibration.config;- const calibrationRecordingDirectory = selectCalibrationRecordingPath(state);-- if (!calibrationRecordingDirectory) {- return rejectWithValue('Recording directory is not set');- }-- console.log('🎬 Starting calibration recording with:', {- calibrationRecordingDirectory,- calibrationTaskConfig,- });-- const response = await fetch(serverUrls.endpoints.calibrationStartRecording, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- calibrationRecordingDirectory,- calibrationTaskConfig,- }),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Started calibration recording:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to start calibration recording:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);--export const stopCalibrationRecording = createAsyncThunk<- { success: boolean },- void,- { state: RootState; rejectValue: string }->(- 'calibration/stopRecording',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const calibrationTaskConfig = state.calibration.config;--- console.log(`🎬 Stoping calibration recording and starting calibration with: ${JSON.stringify(calibrationTaskConfig, null, 2)}`);--- const response = await fetch(serverUrls.endpoints.calibrationStopRecording, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({calibrationTaskConfig}),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Stopped calibration recording:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to stop calibration recording:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);--export const calibrateRecording = createAsyncThunk<- { success: boolean; message?: string; results?: unknown },- void,- { state: RootState; rejectValue: string }->(- 'calibration/calibrateRecording',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const calibrationTaskConfig = state.calibration.config;- const calibrationRecordingDirectory = selectCalibrationRecordingPath(state);-- if (!calibrationRecordingDirectory) {- return rejectWithValue('No calibration recording path available. Please set a recording directory or record a calibration first.');- }-- console.log('🔧 Calibrating recording:', {- calibrationRecordingDirectory,- calibrationTaskConfig,- });-- const response = await fetch(serverUrls.endpoints.calibrateRecording, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- calibrationRecordingDirectory,- calibrationTaskConfig,- }),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Calibration completed:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to calibrate recording:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);--export const updateCalibrationConfigOnServer = createAsyncThunk<- { success: boolean; message?: string },- void,- { state: RootState; rejectValue: string }->(- 'calibration/updateConfig',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const config = state.calibration.config;-- console.log('⚙️ Updating calibration config on server:', config);-- const response = await fetch(serverUrls.endpoints.updateCalibrationConfig, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ config }),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Config updated on server:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to update config on server:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);diff --git a/freemocap-ui/src/store/slices/calibration/index.ts b/freemocap-ui/src/store/slices/calibration/index.tsdeleted file mode 100644index b50cd008..00000000--- a/freemocap-ui/src/store/slices/calibration/index.ts+++ /dev/null@@ -1,3 +0,0 @@--export * from './calibration-slice';-export * from './calibration-thunks';diff --git a/freemocap-ui/src/store/slices/cameras/cameras-selectors.ts b/freemocap-ui/src/store/slices/cameras/cameras-selectors.tsindex bab7b94c..72be5043 100644--- a/freemocap-ui/src/store/slices/cameras/cameras-selectors.ts+++ b/freemocap-ui/src/store/slices/cameras/cameras-selectors.ts@@ -5,6 +5,7 @@ import {CameraConfig} from './cameras-types';// ========== Basic Selectors ==========export const selectCameras = (state: RootState) => state.cameras.cameras;+export const selectIsPaused = (state: RootState) => state.cameras.isPaused;export const selectIsLoading = (state: RootState) => state.cameras.isLoading;export const selectError = (state: RootState) => state.cameras.error;@@ -38,7 +39,19 @@ export const selectSelectedCameraConfigs = createSelector(});-+// Get actual configs for all cameras+export const selectActualCameraConfigs = createSelector(+ [selectCameras],+ (cameras): Record<string, CameraConfig> => {+ return cameras.reduce(+ (configs, camera) => ({+ ...configs,+ [camera.id]: camera.actualConfig,+ }),+ {} as Record<string, CameraConfig>+ );+ }+);// ========== Mismatch Selectors ==========export const selectCamerasWithConfigMismatch = createSelector(diff --git a/freemocap-ui/src/store/slices/cameras/cameras-slice.ts b/freemocap-ui/src/store/slices/cameras/cameras-slice.tsindex b0691567..e656fa51 100644--- a/freemocap-ui/src/store/slices/cameras/cameras-slice.ts+++ b/freemocap-ui/src/store/slices/cameras/cameras-slice.ts@@ -1,12 +1,34 @@-import {createSlice, PayloadAction} from '@reduxjs/toolkit';-import {areConfigsEqual, CameraConfig, CamerasState, extractConfigSettings,} from './cameras-types';-import {detectCameras,} from './cameras-thunks';-import {closePipeline, connectRealtimePipeline} from '../pipeline/pipeline-thunks';-import {serverSettingsCleared, serverSettingsUpdated} from '../settings/settings-slice';+// cameras-slice.ts+import { createSlice, PayloadAction } from '@reduxjs/toolkit';+import {+ CamerasState,+ CameraConfig, extractConfigSettings, areConfigsEqual, createDefaultCameraConfig,+} from './cameras-types';+import {+ detectCameras,+ camerasConnectOrUpdate,+ closeCameras,+ pauseUnpauseCameras,+} from './cameras-thunks';+import {+ savePersistedCameraSettings,+ clearPersistedCameraSettings,+ buildPersistedEntry,+ PersistedCameraSettingsMap,+} from './camera-settings-storage';+// Persist all current camera desired configs + selection to localStorage+function persistAllCameraSettings(state: CamerasState): void {+ const settingsMap: PersistedCameraSettingsMap = {};+ for (const camera of state.cameras) {+ settingsMap[camera.id] = buildPersistedEntry(camera.desiredConfig, camera.selected);+ }+ savePersistedCameraSettings(settingsMap);+}const initialState: CamerasState = {cameras: [],+ isPaused: false,isLoading: false,error: null,};@@ -22,9 +44,11 @@ export const cameraSlice = createSlice({camera.selected = !camera.selected;camera.desiredConfig.use_this_camera = camera.selected;}+ persistAllCameraSettings(state);},// ========== Configuration ==========+ // User updates desired configcameraDesiredConfigUpdated: (state,action: PayloadAction<{@@ -36,15 +60,19 @@ export const cameraSlice = createSlice({cam => cam.id === action.payload.cameraId);if (camera) {- camera.desiredConfig = {...camera.desiredConfig, ...action.payload.config};+ camera.desiredConfig = { ...camera.desiredConfig, ...action.payload.config };+ // Check if there's now a mismatchcamera.hasConfigMismatch = !areConfigsEqual(camera.actualConfig, camera.desiredConfig);}+ persistAllCameraSettings(state);},+configCopiedToAll: (state, action: PayloadAction<string>) => {const sourceCamera = state.cameras.find(cam => cam.id === action.payload);if (!sourceCamera) return;+ // Extract copyable settings (exclude identity fields)const settings = extractConfigSettings(sourceCamera.desiredConfig);state.cameras.forEach(camera => {@@ -56,7 +84,24 @@ export const cameraSlice = createSlice({camera.hasConfigMismatch = !areConfigsEqual(camera.actualConfig, camera.desiredConfig);}});+ persistAllCameraSettings(state);+ },++ savedSettingsCleared: (state) => {+ clearPersistedCameraSettings();+ for (const camera of state.cameras) {+ const defaultConfig = createDefaultCameraConfig(+ camera.id,+ camera.index,+ camera.name,+ );+ camera.desiredConfig = defaultConfig;+ camera.selected = true;+ camera.hasConfigMismatch = !areConfigsEqual(camera.actualConfig, defaultConfig);+ }},++},extraReducers: (builder) => {@@ -69,71 +114,53 @@ export const cameraSlice = createSlice({.addCase(detectCameras.fulfilled, (state, action) => {state.isLoading = false;state.cameras = action.payload;+ persistAllCameraSettings(state);}).addCase(detectCameras.rejected, (state, action) => {state.isLoading = false;state.error = action.error.message || 'Failed to detect cameras';})- // ========== Connect Pipeline (HTTP) ==========- .addCase(connectRealtimePipeline.pending, (state) => {+ // ========== Connect Cameras ==========+ .addCase(camerasConnectOrUpdate.pending, (state) => {state.isLoading = true;state.error = null;})- .addCase(connectRealtimePipeline.fulfilled, (state, action) => {+ .addCase(camerasConnectOrUpdate.fulfilled, (state, action) => {state.isLoading = false;+ // Update both actual and desired configs from server responseObject.entries(action.payload.camera_configs).forEach(([cameraId, config]) => {const camera = state.cameras.find(cam => cam.id === cameraId);if (camera) {camera.actualConfig = config as CameraConfig;- camera.hasConfigMismatch = !areConfigsEqual(camera.actualConfig, camera.desiredConfig);+ camera.desiredConfig = { ...config as CameraConfig };+ camera.hasConfigMismatch = false;camera.connectionStatus = 'connected';}});+ persistAllCameraSettings(state);})- .addCase(connectRealtimePipeline.rejected, (state, action) => {+ .addCase(camerasConnectOrUpdate.rejected, (state, action) => {state.isLoading = false;state.error = action.error.message || 'Failed to connect to cameras';})- // ========== Close Pipeline (HTTP) ==========- .addCase(closePipeline.fulfilled, (state) => {++ // ========== Close Cameras ==========+ .addCase(closeCameras.fulfilled, (state) => {state.cameras.forEach(camera => {camera.connectionStatus = 'available';camera.metrics = undefined;camera.hasConfigMismatch = false;});+ state.isPaused = false;})- // ========== WebSocket settings/state — sync camera connection status ==========- .addCase(serverSettingsUpdated, (state, action) => {- const backendCameras = action.payload.settings.cameras;- for (const camera of state.cameras) {- const backendCam = backendCameras[camera.id];- if (backendCam) {- // Sync connection status from authoritative backend state- if (backendCam.status === 'connected') {- camera.connectionStatus = 'connected';- } else if (backendCam.status === 'error') {- camera.connectionStatus = 'error';- } else {- camera.connectionStatus = 'available';- }- } else {- // Backend doesn't know about this camera — it's not connected- camera.connectionStatus = 'available';- }- }- })-- // ========== WebSocket disconnected — clear all connected state ==========- .addCase(serverSettingsCleared, (state) => {- state.cameras.forEach(camera => {- camera.connectionStatus = 'available';- camera.metrics = undefined;- });+ // ========== Pause / Unpause Cameras ==========+ .addCase(pauseUnpauseCameras.fulfilled, (state) => {+ state.isPaused = !state.isPaused;});},});@@ -142,4 +169,5 @@ export const {cameraSelectionToggled,cameraDesiredConfigUpdated,configCopiedToAll,+ savedSettingsCleared,} = cameraSlice.actions;diff --git a/freemocap-ui/src/store/slices/cameras/cameras-thunks.ts b/freemocap-ui/src/store/slices/cameras/cameras-thunks.tsindex 775fbcc3..ecdedd5d 100644--- a/freemocap-ui/src/store/slices/cameras/cameras-thunks.ts+++ b/freemocap-ui/src/store/slices/cameras/cameras-thunks.ts@@ -1,16 +1,22 @@// cameras-thunks.ts-import {createAsyncThunk} from '@reduxjs/toolkit';-import {RootState} from '../../types';-import {serverUrls} from '@/services';+import { createAsyncThunk } from '@reduxjs/toolkit';+import { RootState } from '../../types';+import { serverUrls } from '@/services';import {Camera,+ CameraConfig,+ DetectCamerasRequest,+ DetectCamerasResponse,CamerasConnectOrUpdateRequest,ConnectCamerasResponse,createDefaultCameraConfig,- DetectCamerasRequest,- DetectCamerasResponse,} from './cameras-types';-import {selectSelectedCameraConfigs} from "@/store";+import { selectSelectedCameraConfigs } from './cameras-selectors';+import {+ loadPersistedCameraSettings,+ savePersistedCameraSettings,+ PersistedCameraSettingsMap,+} from './camera-settings-storage';export const detectCameras = createAsyncThunk<Camera[],@@ -34,9 +40,29 @@ export const detectCameras = createAsyncThunk<const data: DetectCamerasResponse = await response.json();+ // Load persisted settings from localStorage+ let persisted: PersistedCameraSettingsMap = {};+ try {+ persisted = loadPersistedCameraSettings();+ } catch {+ // Storage was corrupted and has been cleared — proceed with defaults+ }++ const detectedIds = new Set(data.cameras.map(c => c.index.toString()));++ // Prune persisted entries for cameras that are no longer detected+ const prunedPersisted: PersistedCameraSettingsMap = {};+ for (const [id, settings] of Object.entries(persisted)) {+ if (detectedIds.has(id)) {+ prunedPersisted[id] = settings;+ }+ }+ savePersistedCameraSettings(prunedPersisted);+return data.cameras.map((serverCamera): Camera => {const cameraId = serverCamera.index.toString();const existing = existingCameras.find(cam => cam.id === cameraId);+ const saved = prunedPersisted[cameraId];const defaultConfig = createDefaultCameraConfig(cameraId,@@ -44,16 +70,23 @@ export const detectCameras = createAsyncThunk<serverCamera.name,);+ // Priority: existing in-memory state > persisted localStorage > defaults+ const desiredConfig: CameraConfig = existing?.desiredConfig+ ?? (saved ? { ...defaultConfig, ...saved.desiredConfig } : { ...defaultConfig });++ const selected: boolean = existing?.selected+ ?? saved?.selected+ ?? true;+return {id: cameraId,name: serverCamera.name,index: serverCamera.index,- // If camera exists, preserve its configs, otherwise use defaultsactualConfig: existing?.actualConfig || defaultConfig,- desiredConfig: existing?.desiredConfig || { ...defaultConfig },+ desiredConfig,hasConfigMismatch: existing?.hasConfigMismatch ?? false,connectionStatus: 'available',- selected: existing?.selected ?? true,+ selected,deviceInfo: {vendorId: serverCamera.vendor_id,productId: serverCamera.product_id,@@ -91,7 +124,7 @@ export const camerasConnectOrUpdate = createAsyncThunk<throw new Error(error.detail || 'Failed to connect to cameras');}- return await response.json() as Promise<ConnectCamerasResponse>;+ return response.json() as Promise<ConnectCamerasResponse>;});diff --git a/freemocap-ui/src/store/slices/cameras/cameras-types.ts b/freemocap-ui/src/store/slices/cameras/cameras-types.tsindex a7455fec..158caddd 100644--- a/freemocap-ui/src/store/slices/cameras/cameras-types.ts+++ b/freemocap-ui/src/store/slices/cameras/cameras-types.ts@@ -1,5 +1,5 @@-// cameras-viewport3d-types.ts-import {z} from 'zod';+// cameras-types.ts+import { z } from 'zod';// ==================== Constants ====================export const PIXEL_FORMATS = ['RGB', 'BGR', 'GRAY'] as const;@@ -32,7 +32,7 @@ export const ROTATION_LABELS: Record<RotationValue, string> = {};// ==================== Camera Configuration ====================-const CameraConfigSchema = z.object({+export const CameraConfigSchema = z.object({// Identitycamera_id: z.string(),camera_index: z.number(),@@ -44,7 +44,7 @@ const CameraConfigSchema = z.object({width: z.number().int(),height: z.number().int()}),- framerate: z.number().min(1).max(1000),+ framerate: z.number().min(-1).max(1000), // -1 for auto// Image settingscolor_channels: z.number().int().min(1).max(4),@@ -91,6 +91,7 @@ export interface Camera {// ==================== Store State ====================export interface CamerasState {cameras: Camera[];+ isPaused: boolean;isLoading: boolean;error: string | null;}@@ -129,7 +130,7 @@ export function createDefaultCameraConfig(camera_name: name,use_this_camera: true,resolution: { width: 1280, height: 720 },- framerate: 30,+ framerate: -1,color_channels: 3,pixel_format: 'RGB',rotation: -1,diff --git a/freemocap-ui/src/store/slices/cameras/index.ts b/freemocap-ui/src/store/slices/cameras/index.tsindex 3fe15df1..46aea7d6 100644--- a/freemocap-ui/src/store/slices/cameras/index.ts+++ b/freemocap-ui/src/store/slices/cameras/index.ts@@ -2,3 +2,4 @@ export * from './cameras-slice';export * from './cameras-types';export * from './cameras-selectors';export * from './cameras-thunks';+export * from './camera-settings-storage';diff --git a/freemocap-ui/src/store/slices/framerate/framerate-selectors.ts b/freemocap-ui/src/store/slices/framerate/framerate-selectors.tsdeleted file mode 100644index 81ca51b8..00000000--- a/freemocap-ui/src/store/slices/framerate/framerate-selectors.ts+++ /dev/null@@ -1,98 +0,0 @@-// framerate-selectors.ts-import {createSelector} from '@reduxjs/toolkit';-import {RootState} from '../../types';-import {DetailedFramerate} from './framerate-types';--// Basic selectors for current framerates-export const selectCurrentFrontendFramerate = (state: RootState): DetailedFramerate | null =>- state.framerate.currentFrontendFramerate;--export const selectCurrentBackendFramerate = (state: RootState): DetailedFramerate | null =>- state.framerate.currentBackendFramerate;--// Quick FPS value selectors-export const selectFrontendFps = (state: RootState): number =>- state.framerate.currentFrontendFramerate?.mean_frames_per_second ?? 0;--export const selectBackendFps = (state: RootState): number =>- state.framerate.currentBackendFramerate?.mean_frames_per_second ?? 0;--// Historical data selectors-export const selectRecentFrontendFrameDurations = (state: RootState): number[] =>- state.framerate.recentFrontendFrameDurations;--export const selectRecentBackendFrameDurations = (state: RootState): number[] =>- state.framerate.recentBackendFrameDurations;--// Calculated average framerates from historical data-export const selectAverageFramerates = createSelector(- [selectRecentFrontendFrameDurations, selectRecentBackendFrameDurations],- (frontendDurations, backendDurations) => {- const calcAverage = (durations: number[]): number => {- if (durations.length === 0) return 0;- const sum = durations.reduce((a, b) => a + b, 0);- return 1000 / (sum / durations.length); // Convert ms to FPS- };-- return {- frontend: calcAverage(frontendDurations),- backend: calcAverage(backendDurations),- };- }-);--// Statistics selectors-export const selectFramerateStatistics = createSelector(- [selectCurrentFrontendFramerate, selectCurrentBackendFramerate],- (frontend, backend) => ({- frontend: {- mean: frontend?.mean_frames_per_second ?? 0,- std: frontend?.frame_duration_stddev ?? 0,- current: frontend?.mean_frames_per_second ?? 0,- },- backend: {- mean: backend?.mean_frames_per_second ?? 0,- std: backend?.frame_duration_stddev ?? 0,- current: backend?.mean_frames_per_second ?? 0,- },- })-);--// Combined selector for UI components that need all framerate info-export const selectFramerateInfo = createSelector(- [- selectCurrentFrontendFramerate,- selectCurrentBackendFramerate,- selectAverageFramerates,- ],- (frontend, backend, averages) => ({- frontend: {- current: frontend?.mean_frames_per_second ?? 0,- mean: frontend?.mean_frames_per_second ?? 0,- std: frontend?.frame_duration_stddev ?? 0,- average: averages.frontend,- },- backend: {- current: backend?.mean_frames_per_second ?? 0,- mean: backend?.mean_frames_per_second ?? 0,- std: backend?.frame_duration_stddev ?? 0,- average: averages.backend,- },- })-);--// Selector for all framerate data needed by the viewer components-export const selectFramerateViewerData = createSelector(- [- selectCurrentFrontendFramerate,- selectCurrentBackendFramerate,- selectRecentFrontendFrameDurations,- selectRecentBackendFrameDurations,- ],- (currentFrontendFramerate, currentBackendFramerate, recentFrontendFrameDurations, recentBackendFrameDurations) => ({- currentFrontendFramerate,- currentBackendFramerate,- recentFrontendFrameDurations,- recentBackendFrameDurations,- })-);diff --git a/freemocap-ui/src/store/slices/framerate/framerate-slice.ts b/freemocap-ui/src/store/slices/framerate/framerate-slice.tsdeleted file mode 100644index 2eb2ac5f..00000000--- a/freemocap-ui/src/store/slices/framerate/framerate-slice.ts+++ /dev/null@@ -1,60 +0,0 @@-// framerate-slice.ts-import {createSlice, PayloadAction} from '@reduxjs/toolkit';-import {DetailedFramerate} from './framerate-types';--// Export DetailedFramerate as CurrentFramerate for component compatibility-export type CurrentFramerate = DetailedFramerate;--interface FramerateState {- currentBackendFramerate: DetailedFramerate | null;- currentFrontendFramerate: DetailedFramerate | null;- // Arrays for historical data to calculate averages and render charts- recentFrontendFrameDurations: number[];- recentBackendFrameDurations: number[];-}--const initialState: FramerateState = {- currentBackendFramerate: null,- currentFrontendFramerate: null,- recentFrontendFrameDurations: [],- recentBackendFrameDurations: [],-};--const MAX_DURATION_HISTORY = 100; // Keep last 100 frame durations--export const framerateSlice = createSlice({- name: 'framerate',- initialState,- reducers: {- backendFramerateUpdated: (state, action: PayloadAction<DetailedFramerate>) => {- state.currentBackendFramerate = action.payload;- // Add mean frame duration to history- if (action.payload.mean_frame_duration_ms > 0) {- state.recentBackendFrameDurations = [- ...state.recentBackendFrameDurations.slice(-(MAX_DURATION_HISTORY - 1)),- action.payload.mean_frame_duration_ms- ];- }- },- frontendFramerateUpdated: (state, action: PayloadAction<DetailedFramerate>) => {- state.currentFrontendFramerate = action.payload;- // Add mean frame duration to history- if (action.payload.mean_frame_duration_ms > 0) {- state.recentFrontendFrameDurations = [- ...state.recentFrontendFrameDurations.slice(-(MAX_DURATION_HISTORY - 1)),- action.payload.mean_frame_duration_ms- ];- }- },- clearFramerateHistory: (state) => {- state.recentFrontendFrameDurations = [];- state.recentBackendFrameDurations = [];- },- },-});--export const {- backendFramerateUpdated,- frontendFramerateUpdated,- clearFramerateHistory-} = framerateSlice.actions;diff --git a/freemocap-ui/src/store/slices/framerate/framerate-types.ts b/freemocap-ui/src/store/slices/framerate/framerate-types.tsdeleted file mode 100644index 48819b03..00000000--- a/freemocap-ui/src/store/slices/framerate/framerate-types.ts+++ /dev/null@@ -1,37 +0,0 @@-// framerate-viewport3d-types.ts-import {z} from 'zod';--// The actual framerate data structure used in the Redux store-export const FramerateDataSchema = z.object({- mean: z.number(),- std: z.number(),- current: z.number(),-});--export type FramerateData = z.infer<typeof FramerateDataSchema>;--// If you have a different schema from the backend with more detailed stats,-// you can keep it separate for parsing/validation but transform it to FramerateData-export const DetailedFramerateSchema = z.object({- mean_frame_duration_ms: z.number(),- mean_frames_per_second: z.number(),- frame_duration_max: z.number(),- frame_duration_min: z.number(),- frame_duration_mean: z.number(),- frame_duration_stddev: z.number(),- frame_duration_median: z.number(),- frame_duration_coefficient_of_variation: z.number(),- calculation_window_size: z.number(),- framerate_source: z.string(),-});--export type DetailedFramerate = z.infer<typeof DetailedFramerateSchema>;--// Helper function to convert detailed framerate to simple framerate data-export function detailedToSimpleFramerate(detailed: DetailedFramerate): FramerateData {- return {- mean: detailed.mean_frames_per_second,- std: detailed.frame_duration_stddev,- current: detailed.mean_frames_per_second, // or calculate from mean_frame_duration_ms- };-}diff --git a/freemocap-ui/src/store/slices/framerate/index.ts b/freemocap-ui/src/store/slices/framerate/index.tsdeleted file mode 100644index cbf3bf84..00000000--- a/freemocap-ui/src/store/slices/framerate/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './framerate-slice';-export * from './framerate-types';-export * from './framerate-selectors';diff --git a/freemocap-ui/src/store/slices/log-records/index.ts b/freemocap-ui/src/store/slices/log-records/index.tsdeleted file mode 100644index e48b73b3..00000000--- a/freemocap-ui/src/store/slices/log-records/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './log-records-slice';-export * from './logs-types';-export * from './logs-selectors';diff --git a/freemocap-ui/src/store/slices/log-records/log-records-slice.ts b/freemocap-ui/src/store/slices/log-records/log-records-slice.tsdeleted file mode 100644index 8924cc42..00000000--- a/freemocap-ui/src/store/slices/log-records/log-records-slice.ts+++ /dev/null@@ -1,86 +0,0 @@-// log-records-slice.ts-import {createSlice, PayloadAction} from '@reduxjs/toolkit';-import {LogRecord} from './logs-types';--interface LogRecordsState {- entries: LogRecord[];- maxEntries: number;- isPaused: boolean;- filter: {- levels: string[];- searchText: string;- };-}--const initialState: LogRecordsState = {- entries: [],- maxEntries: 1000,- isPaused: false,- filter: {- levels: [],- searchText: '',- },-};--export const logRecordsSlice = createSlice({- name: 'logs',- initialState,- reducers: {- logAdded: (state, action: PayloadAction<LogRecord>) => {- if (state.isPaused) return;-- state.entries.push(action.payload);-- // Keep only the last maxEntries- if (state.entries.length > state.maxEntries) {- state.entries = state.entries.slice(-state.maxEntries);- }- },-- logsAdded: (state, action: PayloadAction<LogRecord[]>) => {- if (state.isPaused) return;-- state.entries.push(...action.payload);-- // Keep only the last maxEntries- if (state.entries.length > state.maxEntries) {- state.entries = state.entries.slice(-state.maxEntries);- }- },-- logsCleared: (state) => {- state.entries = [];- },-- logsPaused: (state, action: PayloadAction<boolean>) => {- state.isPaused = action.payload;- },-- logsFiltered: (state, action: PayloadAction<{ levels?: string[]; searchText?: string }>) => {- if (action.payload.levels !== undefined) {- state.filter.levels = action.payload.levels;- }- if (action.payload.searchText !== undefined) {- state.filter.searchText = action.payload.searchText;- }- },-- maxEntriesUpdated: (state, action: PayloadAction<number>) => {- state.maxEntries = action.payload;-- // Trim entries if new max is smaller- if (state.entries.length > action.payload) {- state.entries = state.entries.slice(-action.payload);- }- },- },-});--export const {- logAdded,- logsAdded,- logsCleared,- logsPaused,- logsFiltered,- maxEntriesUpdated-} = logRecordsSlice.actions;diff --git a/freemocap-ui/src/store/slices/log-records/logs-selectors.ts b/freemocap-ui/src/store/slices/log-records/logs-selectors.tsdeleted file mode 100644index 3f1905ed..00000000--- a/freemocap-ui/src/store/slices/log-records/logs-selectors.ts+++ /dev/null@@ -1,96 +0,0 @@-// logs-selectors.ts-import {createSelector} from '@reduxjs/toolkit';-import {RootState} from '../../types';-import {LogRecord} from './logs-types';--// Basic selectors-export const selectAllLogs = (state: RootState): LogRecord[] =>- state.logs.entries;--export const selectLogsPaused = (state: RootState): boolean =>- state.logs.isPaused;--export const selectLogsFilter = (state: RootState) =>- state.logs.filter;--export const selectMaxLogEntries = (state: RootState): number =>- state.logs.maxEntries;--// Filtered logs based on current filter settings-export const selectFilteredLogs = createSelector(- [selectAllLogs, selectLogsFilter],- (logs, filter) => {- let filtered = logs;-- // Filter by levels if any are selected- if (filter.levels.length > 0) {- filtered = filtered.filter(log =>- filter.levels.includes(log.levelname.toLowerCase())- );- }-- // Filter by search text if provided- if (filter.searchText) {- const searchLower = filter.searchText.toLowerCase();- filtered = filtered.filter(log =>- log.message.toLowerCase().includes(searchLower) ||- log.module.toLowerCase().includes(searchLower) ||- log.funcName.toLowerCase().includes(searchLower) ||- log.formatted_message?.toLowerCase().includes(searchLower)- );- }-- return filtered;- }-);--// Get logs by specific level-export const selectLogsByLevel = createSelector(- [selectAllLogs, (_: RootState, level: string) => level],- (logs, level) => logs.filter(log => log.levelname === level)-);--// Get recent logs (last N entries)-export const selectRecentLogs = createSelector(- [selectAllLogs, (_: RootState, count: number = 10) => count],- (logs, count) => logs.slice(-count)-);--// Get filtered recent logs-export const selectRecentFilteredLogs = createSelector(- [selectFilteredLogs, (_: RootState, count: number = 10) => count],- (logs, count) => logs.slice(-count)-);--// Count logs by level-export const selectLogCountsByLevel = createSelector(- [selectAllLogs],- (logs) => {- const counts: Record<string, number> = {};- logs.forEach(log => {- const level = log.levelname;- counts[level] = (counts[level] || 0) + 1;- });- return counts;- }-);--// Get error and critical logs-export const selectErrorLogs = createSelector(- [selectAllLogs],- (logs) => logs.filter(log =>- log.levelname === 'ERROR' || log.levelname === 'CRITICAL'- )-);--// Check if there are any errors-export const selectHasErrors = createSelector(- [selectErrorLogs],- (errorLogs) => errorLogs.length > 0-);--// Get the most recent error-export const selectMostRecentError = createSelector(- [selectErrorLogs],- (errorLogs) => errorLogs[errorLogs.length - 1] || null-);diff --git a/freemocap-ui/src/store/slices/log-records/logs-types.ts b/freemocap-ui/src/store/slices/log-records/logs-types.tsdeleted file mode 100644index d899112c..00000000--- a/freemocap-ui/src/store/slices/log-records/logs-types.ts+++ /dev/null@@ -1,31 +0,0 @@-import {z} from 'zod';--export const LogRecordSchema = z.object({- name: z.string(),- msg: z.string().nullable().default(""),- args: z.array(z.any()),- levelname: z.string(),- levelno: z.number(),- pathname: z.string(),- filename: z.string(),- module: z.string(),- exc_info: z.string().nullable(),- exc_text: z.string().nullable(),- stack_info: z.string().nullable(),- lineno: z.number(),- funcName: z.string(),- created: z.number(),- msecs: z.number(),- relativeCreated: z.number(),- thread: z.number(),- threadName: z.string(),- processName: z.string(),- process: z.number(),- delta_t: z.string(),- message: z.string(),- asctime: z.string(),- formatted_message: z.string(),- type: z.string(),-});--export type LogRecord = z.infer<typeof LogRecordSchema>;diff --git a/freemocap-ui/src/store/slices/mocap/index.ts b/freemocap-ui/src/store/slices/mocap/index.tsdeleted file mode 100644index f3a3b8e3..00000000--- a/freemocap-ui/src/store/slices/mocap/index.ts+++ /dev/null@@ -1,3 +0,0 @@--export * from './mocap-slice';-export * from './mocap-thunks';diff --git a/freemocap-ui/src/store/slices/mocap/mocap-slice.ts b/freemocap-ui/src/store/slices/mocap/mocap-slice.tsdeleted file mode 100644index 3309db49..00000000--- a/freemocap-ui/src/store/slices/mocap/mocap-slice.ts+++ /dev/null@@ -1,337 +0,0 @@-import {createSelector, createSlice, PayloadAction} from '@reduxjs/toolkit';-import {RootState} from '../../types';-import {- processMocapRecording,- startMocapRecording,- stopMocapRecording,- updateMocapConfigOnServer,-} from "@/store/slices/mocap/mocap-thunks";--// ==================== Types ====================--/**- * Mirrors skellytracker MediapipeModelComplexity enum.- * 0 = LITE (fastest), 1 = FULL (balanced), 2 = HEAVY (most accurate)- */-export type MediapipeModelComplexity = 0 | 1 | 2;--/**- * Mirrors skellytracker MediapipeDetectorConfig.- * Field names use snake_case to match the backend JSON.- */-export interface MediapipeDetectorConfig {- model_complexity: MediapipeModelComplexity;- min_detection_confidence: number;- min_tracking_confidence: number;- confidence_threshold: number;- static_image_mode: boolean;- smooth_landmarks: boolean;- enable_segmentation: boolean;- smooth_segmentation: boolean;- refine_face_landmarks: boolean;-}--/**- * Mirrors backend EstimatorConfig (bone length estimation tuning).- */-export interface EstimatorConfig {- max_samples: number;- min_samples_for_full_confidence: number;- iqr_confidence_sensitivity: number;-}--/**- * Mirrors backend RealtimeFilterConfig (skeleton smoothing + gating).- * Field names use snake_case to match the backend JSON.- */-export interface RealtimeFilterConfig {- // One Euro Filter params- min_cutoff: number;- beta: number;- d_cutoff: number;- // FABRIK params- fabrik_tolerance: number;- fabrik_max_iterations: number;- // Bone length estimation params- height_meters: number;- noise_sigma: number;- estimator_config: EstimatorConfig;- // Point gate params- max_reprojection_error_px: number;- max_velocity_m_per_s: number;- max_rejected_streak: number;- // Prediction params- max_prediction_frames: number;- prediction_velocity_decay: number;-}--/**- * Mirrors backend MocapPipelineConfig.- */-export interface MocapConfig {- detector: MediapipeDetectorConfig;- skeleton_filter: RealtimeFilterConfig;-}--/** Realtime preset matching MEDIAPIPE_TRACKER_REALTIME_PRESET on the backend. */-export const MEDIAPIPE_REALTIME_PRESET: MediapipeDetectorConfig = {- model_complexity: 0,- min_detection_confidence: 0.5,- min_tracking_confidence: 0.5,- confidence_threshold: 0.5,- static_image_mode: false,- smooth_landmarks: true,- enable_segmentation: false,- smooth_segmentation: false,- refine_face_landmarks: true,-};--/** Posthoc preset matching MEDIAPIPE_TRACKER_POSTHOC_PRESET on the backend. */-export const MEDIAPIPE_POSTHOC_PRESET: MediapipeDetectorConfig = {- model_complexity: 2,- min_detection_confidence: 0.5,- min_tracking_confidence: 0.5,- confidence_threshold: 0.5,- static_image_mode: false,- smooth_landmarks: true,- enable_segmentation: true,- smooth_segmentation: true,- refine_face_landmarks: true,-};--/** Default EstimatorConfig matching backend defaults. */-export const DEFAULT_ESTIMATOR_CONFIG: EstimatorConfig = {- max_samples: 500,- min_samples_for_full_confidence: 100,- iqr_confidence_sensitivity: 10.0,-};--/** Default RealtimeFilterConfig matching backend defaults. */-export const DEFAULT_REALTIME_FILTER_CONFIG: RealtimeFilterConfig = {- min_cutoff: 0.005,- beta: 0.3,- d_cutoff: 1.0,- fabrik_tolerance: 1e-4,- fabrik_max_iterations: 20,- height_meters: 1.75,- noise_sigma: 0.015,- estimator_config: { ...DEFAULT_ESTIMATOR_CONFIG },- max_reprojection_error_px: 60.0,- max_velocity_m_per_s: 50.0,- max_rejected_streak: 5,- max_prediction_frames: 15,- prediction_velocity_decay: 0.75,-};--export interface MocapDirectoryInfo {- exists: boolean;- canRecord: boolean;- canCalibrate: boolean;- cameraMocapTomlPath: string | null;- hasSynchronizedVideos: boolean;- hasVideos: boolean;- errorMessage: string | null;-}--export interface MocapState {- config: MocapConfig;- isRecording: boolean;- recordingProgress: number;- isLoading: boolean;- error: string | null;- lastMocapRecordingPath: string | null;- manualMocapRecordingPath: string | null;- directoryInfo: MocapDirectoryInfo | null;-}--// ==================== Initial State ====================--const initialState: MocapState = {- config: {- detector: { ...MEDIAPIPE_REALTIME_PRESET },- skeleton_filter: { ...DEFAULT_REALTIME_FILTER_CONFIG },- },- isRecording: false,- recordingProgress: 0,- isLoading: false,- error: null,- lastMocapRecordingPath: null,- manualMocapRecordingPath: null,- directoryInfo: null,-};--// ==================== Slice ====================--export const mocapSlice = createSlice({- name: 'mocap',- initialState,- reducers: {- /** Replace the entire detector config (e.g. applying a preset). */- mocapDetectorConfigReplaced: (state, action: PayloadAction<MediapipeDetectorConfig>) => {- state.config.detector = action.payload;- },-- /** Partially update individual detector fields. */- mocapDetectorConfigUpdated: (state, action: PayloadAction<Partial<MediapipeDetectorConfig>>) => {- state.config.detector = { ...state.config.detector, ...action.payload };- },-- /** Replace the entire skeleton filter config. */- skeletonFilterConfigReplaced: (state, action: PayloadAction<RealtimeFilterConfig>) => {- state.config.skeleton_filter = action.payload;- },-- /** Partially update individual skeleton filter fields. */- skeletonFilterConfigUpdated: (state, action: PayloadAction<Partial<RealtimeFilterConfig>>) => {- state.config.skeleton_filter = { ...state.config.skeleton_filter, ...action.payload };- },-- mocapProgressUpdated: (state, action: PayloadAction<number>) => {- state.recordingProgress = action.payload;- },-- mocapErrorCleared: (state) => {- state.error = null;- },-- manualMocapRecordingPathChanged: (state, action: PayloadAction<string>) => {- state.manualMocapRecordingPath = action.payload;- },-- manualMocapRecordingPathCleared: (state) => {- state.manualMocapRecordingPath = null;- },-- mocapDirectoryInfoUpdated: (state, action: PayloadAction<MocapDirectoryInfo>) => {- state.directoryInfo = action.payload;- },-- resetMocapState: () => initialState,- },-- extraReducers: (builder) => {- builder- .addCase(startMocapRecording.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(startMocapRecording.fulfilled, (state, action) => {- state.isLoading = false;- state.isRecording = true;- state.recordingProgress = 0;- if (action.payload.mocapRecordingPath) {- state.lastMocapRecordingPath = action.payload.mocapRecordingPath;- }- })- .addCase(startMocapRecording.rejected, (state, action) => {- state.isLoading = false;- state.error = action.payload || 'Failed to start recording';- });-- builder- .addCase(stopMocapRecording.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(stopMocapRecording.fulfilled, (state) => {- state.isLoading = false;- state.isRecording = false;- state.recordingProgress = 0;- })- .addCase(stopMocapRecording.rejected, (state, action) => {- state.isLoading = false;- state.error = action.payload || 'Failed to stop recording';- });-- builder- .addCase(processMocapRecording.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(processMocapRecording.fulfilled, (state) => {- state.isLoading = false;- })- .addCase(processMocapRecording.rejected, (state, action) => {- state.isLoading = false;- state.error = action.payload || 'Failed to process recording';- });-- builder- .addCase(updateMocapConfigOnServer.rejected, (state, action) => {- state.error = action.payload || 'Failed to sync config to server';- });- },-});--// ==================== Selectors ====================--export const selectMocap = (state: RootState) => state.mocap;-export const selectMocapConfig = (state: RootState) => state.mocap.config;-export const selectMocapDetectorConfig = (state: RootState) => state.mocap.config.detector;-export const selectSkeletonFilterConfig = (state: RootState) => state.mocap.config.skeleton_filter;-export const selectMocapIsLoading = (state: RootState) => state.mocap.isLoading;-export const selectMocapIsRecording = (state: RootState) => state.mocap.isRecording;-export const selectMocapProgress = (state: RootState) => state.mocap.recordingProgress;-export const selectMocapError = (state: RootState) => state.mocap.error;-export const selectMocapDirectoryInfo = (state: RootState) => state.mocap.directoryInfo;--export const selectMocapRecordingPath = createSelector(- [- (state: RootState) => state.mocap.manualMocapRecordingPath,- (state: RootState) => state.mocap.lastMocapRecordingPath,- (state: RootState) => state.recording.computed,- ],- (manualPath, lastPath, recordingComputed) => {- if (manualPath) return manualPath;- if (lastPath) return lastPath;-- const mocapFolderName = `${recordingComputed.recordingName}_mocap`;- return `${recordingComputed.fullRecordingPath}/${mocapFolderName}`;- }-);--export const selectIsUsingManualMocapPath = createSelector(- [(state: RootState) => state.mocap.manualMocapRecordingPath],- (manualPath) => manualPath !== null-);--export const selectCanStartMocapRecording = createSelector(- [- selectMocapIsRecording,- selectMocapIsLoading,- selectMocapRecordingPath,- selectMocapDirectoryInfo- ],- (isRecording, isLoading, recordingPath, directoryInfo) => {- return !isRecording && !isLoading && !!recordingPath && (directoryInfo?.canRecord ?? true);- }-);--export const selectCanProcessMocapRecording = createSelector(- [- selectMocapRecordingPath,- selectMocapIsLoading,- selectMocapIsRecording,- selectMocapDirectoryInfo- ],- (mocapPath, isLoading, isRecording, directoryInfo) => {- return !!mocapPath && !isLoading && !isRecording && (directoryInfo?.canCalibrate ?? false);- }-);--// ==================== Actions Export ====================--export const {- mocapDetectorConfigReplaced,- mocapDetectorConfigUpdated,- skeletonFilterConfigReplaced,- skeletonFilterConfigUpdated,- mocapProgressUpdated,- mocapErrorCleared,- manualMocapRecordingPathChanged,- manualMocapRecordingPathCleared,- mocapDirectoryInfoUpdated,- resetMocapState-} = mocapSlice.actions;--export default mocapSlice.reducer;diff --git a/freemocap-ui/src/store/slices/mocap/mocap-thunks.ts b/freemocap-ui/src/store/slices/mocap/mocap-thunks.tsdeleted file mode 100644index 9785476c..00000000--- a/freemocap-ui/src/store/slices/mocap/mocap-thunks.ts+++ /dev/null@@ -1,169 +0,0 @@-import {createAsyncThunk} from "@reduxjs/toolkit";-import {RootState} from "@/store";-import {serverUrls} from "@/hooks/server-urls";-import {selectMocapRecordingPath} from "./mocap-slice";-import {getDetailedErrorMessage} from "@/store/slices/thunk-helpers";--export const startMocapRecording = createAsyncThunk<- { success: boolean; message?: string; mocapRecordingPath?: string },- void,- { state: RootState; rejectValue: string }->(- 'mocap/startRecording',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const mocapTaskConfig = state.mocap.config;- const mocapRecordingDirectory = selectMocapRecordingPath(state);-- if (!mocapRecordingDirectory) {- return rejectWithValue('Recording directory is not set');- }-- console.log('🎬 Starting mocap recording with:', {- mocapRecordingDirectory,- mocapTaskConfig,- });-- const response = await fetch(serverUrls.endpoints.mocapStartRecording, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- mocapRecordingDirectory,- mocapTaskConfig,- }),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Started mocap recording:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to start mocap recording:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);--export const stopMocapRecording = createAsyncThunk<- { success: boolean },- void,- { state: RootState; rejectValue: string }->(- 'mocap/stopRecording',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const mocapTaskConfig = state.mocap.config;--- console.log(`🎬 Stoping mocap recording and starting mocap with: ${JSON.stringify(mocapTaskConfig, null, 2)}`);--- const response = await fetch(serverUrls.endpoints.mocapStopRecording, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({mocapTaskConfig}),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Stopped mocap recording:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to stop mocap recording:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);--export const processMocapRecording = createAsyncThunk<- { success: boolean; message?: string; results?: unknown },- void,- { state: RootState; rejectValue: string }->(- 'mocap/processMocapRecording',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const mocapTaskConfig = state.mocap.config;- const mocapRecordingDirectory = selectMocapRecordingPath(state);-- if (!mocapRecordingDirectory) {- return rejectWithValue('No mocap recording path available. Please set a recording directory or record a mocap first.');- }-- console.log('🔧 Calibrating recording:', {- mocapRecordingDirectory,- mocapTaskConfig,- });-- const response = await fetch(serverUrls.endpoints.processMocapRecording, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- mocapRecordingDirectory,- mocapTaskConfig,- }),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Mocap completed:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to process recording:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);--export const updateMocapConfigOnServer = createAsyncThunk<- { success: boolean; message?: string },- void,- { state: RootState; rejectValue: string }->(- 'mocap/updateConfig',- async (_, { getState, rejectWithValue }) => {- try {- const state = getState();- const config = state.mocap.config;-- console.log('⚙️ Updating mocap config on server:', config);-- const response = await fetch(serverUrls.endpoints.updateMocapConfig, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ config }),- });-- if (!response.ok) {- const errorMessage = await getDetailedErrorMessage(response);- return rejectWithValue(errorMessage);- }-- const result = await response.json();- console.log('✅ Config updated on server:', result);- return result;- } catch (error) {- const errorMessage = error instanceof Error ? error.message : 'Unknown error';- console.error('❌ Failed to update config on server:', errorMessage);- return rejectWithValue(errorMessage);- }- }-);diff --git a/freemocap-ui/src/store/slices/pipeline/index.ts b/freemocap-ui/src/store/slices/pipeline/index.tsdeleted file mode 100644index 09453243..00000000--- a/freemocap-ui/src/store/slices/pipeline/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export * from './pipeline-slice';-export * from './pipeline-selectors';-export * from './pipeline-thunks';-export * from './pipeline-types';diff --git a/freemocap-ui/src/store/slices/pipeline/pipeline-selectors.ts b/freemocap-ui/src/store/slices/pipeline/pipeline-selectors.tsdeleted file mode 100644index 74365541..00000000--- a/freemocap-ui/src/store/slices/pipeline/pipeline-selectors.ts+++ /dev/null@@ -1,34 +0,0 @@-// basic selectors-import {RootState} from "@/store";-import {createSelector} from "@reduxjs/toolkit";--export const selectPipelineState = (state: RootState) => state.pipeline;-export const selectIsPipelineConnected = (state: RootState) => state.pipeline.isConnected;-export const selectPipelineId = (state: RootState) => state.pipeline.pipelineId;-export const selectCameraGroupId = (state: RootState) => state.pipeline.cameraGroupId;-export const selectIsPipelineLoading = (state: RootState) => state.pipeline.isLoading;-export const selectPipelineError = (state: RootState) => state.pipeline.error;--// derived selectors-export const selectPipelineInfo = createSelector(- [selectIsPipelineConnected, selectPipelineId, selectCameraGroupId],- (isConnected, pipelineId, cameraGroupId) => ({- isConnected,- pipelineId,- cameraGroupId,- })-);--export const selectCanConnectPipeline = createSelector(- [selectIsPipelineConnected, selectIsPipelineLoading, (state: RootState) => state.cameras.cameras],- (isConnected, isLoading, cameras) => {- const anyCameraSelected = cameras.some(cam => cam.selected);- return !isConnected && !isLoading && anyCameraSelected;- }-);--export const selectCanDisconnectPipeline = createSelector(- [selectIsPipelineConnected, selectIsPipelineLoading],- (isConnected, isLoading) => isConnected && !isLoading-);-diff --git a/freemocap-ui/src/store/slices/pipeline/pipeline-slice.ts b/freemocap-ui/src/store/slices/pipeline/pipeline-slice.tsdeleted file mode 100644index c8ab05c8..00000000--- a/freemocap-ui/src/store/slices/pipeline/pipeline-slice.ts+++ /dev/null@@ -1,82 +0,0 @@-import {createSlice} from "@reduxjs/toolkit";-import {PipelineState} from "@/store/slices/pipeline/pipeline-types";-import {closePipeline, connectRealtimePipeline} from "@/store/slices/pipeline/pipeline-thunks";-import {serverSettingsCleared, serverSettingsUpdated} from "@/store/slices/settings/settings-slice";--const initialState: PipelineState = {- cameraGroupId: null,- pipelineId: null,- isConnected: false,- isLoading: false,- error: null,-}--export const pipelineSlice = createSlice({- name: 'pipeline',- initialState,- reducers: {- pipelineStateReset: (state) => {- state.cameraGroupId = null;- state.pipelineId = null;- state.isConnected = false;- state.isLoading = false;- state.error = null;- }- },- extraReducers: (builder) => {- builder- // ========== Connect Pipeline (HTTP) ==========- .addCase(connectRealtimePipeline.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(connectRealtimePipeline.fulfilled, (state, action) => {- state.cameraGroupId = action.payload.camera_group_id;- state.pipelineId = action.payload.pipeline_id;- state.isConnected = true;- state.isLoading = false;- })- .addCase(connectRealtimePipeline.rejected, (state, action) => {- state.isLoading = false;- state.error = action.error.message || 'Failed to connect pipeline';- })-- // ========== Close Pipeline (HTTP) ==========- .addCase(closePipeline.pending, (state) => {- state.isLoading = true;- state.error = null;- })- .addCase(closePipeline.fulfilled, (state) => {- state.cameraGroupId = null;- state.pipelineId = null;- state.isConnected = false;- state.isLoading = false;- })- .addCase(closePipeline.rejected, (state, action) => {- state.isLoading = false;- state.error = action.error.message || 'Failed to disconnect pipeline';- })-- // ========== WebSocket settings/state — sync pipeline status ==========- .addCase(serverSettingsUpdated, (state, action) => {- const backendPipeline = action.payload.settings.pipeline;- // Only overwrite if not mid-HTTP-request (isLoading guards against races)- if (!state.isLoading) {- state.isConnected = backendPipeline.is_connected;- state.pipelineId = backendPipeline.pipeline_id;- state.cameraGroupId = backendPipeline.camera_group_id;- }- })-- // ========== WebSocket disconnected — clear pipeline state ==========- .addCase(serverSettingsCleared, (state) => {- state.cameraGroupId = null;- state.pipelineId = null;- state.isConnected = false;- state.isLoading = false;- state.error = null;- });- },-});--export const {pipelineStateReset} = pipelineSlice.actions;diff --git a/freemocap-ui/src/store/slices/pipeline/pipeline-thunks.ts b/freemocap-ui/src/store/slices/pipeline/pipeline-thunks.tsdeleted file mode 100644index 1815b84c..00000000--- a/freemocap-ui/src/store/slices/pipeline/pipeline-thunks.ts+++ /dev/null@@ -1,56 +0,0 @@-import {createAsyncThunk} from "@reduxjs/toolkit";-import {RootState, selectSelectedCameraConfigs} from "@/store";-import {serverUrls} from "@/services";-import {PipelineConnectRequest, PipelineConnectResponse,} from "@/store/slices/pipeline/pipeline-types";--export const connectRealtimePipeline = createAsyncThunk<- PipelineConnectResponse,- PipelineConnectRequest | undefined,- { state: RootState }>(- 'pipeline/connect',- async (request={}, {getState}) => {- const state = getState();-- const cameraConfigs = selectSelectedCameraConfigs(state);- const response = await fetch(serverUrls.endpoints.pipelineConnectOrUpdate, {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ camera_configs: cameraConfigs, ...request }),- });-- if (!response.ok) {- const error = await response.json()- throw new Error(`Failed to connect pipeline: ${error.message || response.statusText}`);- }- return await response.json() as Promise<PipelineConnectResponse>;- })---export const closePipeline = createAsyncThunk<void, void, { state: RootState }>(- 'pipeline/close',- async () => {- const response = await fetch(serverUrls.endpoints.pipelineClose, {- method: 'DELETE',- });-- if (!response.ok) {- console.error(`Failed to close pipeline: ${response.statusText}`);- }- }-);-----export const pauseUnpausePipeline = createAsyncThunk<void, void, { state: RootState }>(- 'cameras/pause',- async () => {- const response = await fetch(serverUrls.endpoints.pipelinePauseUnpause, {- method: 'GET',- });-- if (!response.ok) {- throw new Error(`Failed to pause/unpause cameras: ${response.statusText}`);- }- }-);diff --git a/freemocap-ui/src/store/slices/pipeline/pipeline-types.ts b/freemocap-ui/src/store/slices/pipeline/pipeline-types.tsdeleted file mode 100644index 1444992c..00000000--- a/freemocap-ui/src/store/slices/pipeline/pipeline-types.ts+++ /dev/null@@ -1,45 +0,0 @@-import {z} from 'zod';-import {CameraConfig} from "@/store";--// ==================== API Request/Response Types ====================-export interface PipelineConnectRequest {- camera_configs?: string[];-}--export interface PipelineConnectResponse {- camera_group_id: string;- pipeline_id: string;- camera_configs: Record<string, CameraConfig>;-}--// ==================== Pipeline State ====================-export interface PipelineState {- cameraGroupId: string | null;- pipelineId: string | null;- isConnected: boolean;- isLoading: boolean;- error: string | null;-}---const ProcessingPipelineConfigSchema = z.object({- pipeline_id: z.string(),- parameters: z.record(z.string(), z.any()),-})---export type ProcessingPipelineConfig = z.infer<typeof ProcessingPipelineConfigSchema>;-export interface ProcessingPipeline {- id: string;- name: string;- isActive: boolean;- config: ProcessingPipelineConfig-}--export interface ProcessingPipelineState {- pipelines: ProcessingPipeline[];- isLoading: boolean;- isActive: boolean;- error: string | null;-}-diff --git a/freemocap-ui/src/store/slices/recording/recording-slice.ts b/freemocap-ui/src/store/slices/recording/recording-slice.tsindex 255dd726..d50c1ed3 100644--- a/freemocap-ui/src/store/slices/recording/recording-slice.ts+++ b/freemocap-ui/src/store/slices/recording/recording-slice.ts@@ -1,68 +1,6 @@-import {createSlice, PayloadAction} from '@reduxjs/toolkit';-import {ComputedRecordingPath, RecordingConfig, RecordingInfo} from './recording-types';-import {startRecording, stopRecording} from './recording-thunks';--const getTimestampString = (): string => {- const now = new Date();-- const dateOptions: Intl.DateTimeFormatOptions = {- year: "numeric",- month: "2-digit",- day: "2-digit",- hour: "2-digit",- minute: "2-digit",- second: "2-digit",- hour12: false,- timeZoneName: "shortOffset",- };-- const formatter = new Intl.DateTimeFormat("en-US", dateOptions);- const parts = formatter.formatToParts(now);-- const partMap: Record<string, string> = {};- parts.forEach((part) => {- partMap[part.type] = part.value;- });-- return `${partMap.year}-${partMap.month}-${partMap.day}_${partMap.hour}-${partMap.minute}-${partMap.second}_${partMap.timeZoneName.replace(":", "")}`;-};--const computeRecordingPath = (- recordingDirectory: string,- config: RecordingConfig-): ComputedRecordingPath => {- const parts: string[] = [];-- if (config.useTimestamp) {- parts.push(getTimestampString());- } else {- parts.push(config.baseName);- }-- if (config.useIncrement) {- parts.push(String(config.currentIncrement).padStart(3, '0'));- }-- if (config.recordingTag) {- parts.push(config.recordingTag);- }-- const recordingName = parts.join("_");-- const subfolderName = config.createSubfolder- ? config.customSubfolderName || getTimestampString()- : "";-- const fullRecordingPath = config.createSubfolder- ? `${recordingDirectory}/${subfolderName}`- : recordingDirectory;-- return {- recordingName,- subfolderName,- fullRecordingPath,- };-};+import { createSlice, PayloadAction } from '@reduxjs/toolkit';+import { RecordingInfo } from './recording-types';+import { startRecording, stopRecording } from './recording-thunks';const initialState: RecordingInfo = {isRecording: false,@@ -70,94 +8,24 @@ const initialState: RecordingInfo = {recordingName: null,startedAt: null,duration: 0,- config: {- useDelayStart: false,- delaySeconds: 3,- useTimestamp: true,- useIncrement: false,- currentIncrement: 1,- baseName: 'recording',- recordingTag: '',- createSubfolder: false,- customSubfolderName: '',- },- computed: {- recordingName: '',- subfolderName: '',- fullRecordingPath: '~/freemocap_data/recordings',- },+ completionData: null,};-// Initialize computed values-initialState.computed = computeRecordingPath(- initialState.recordingDirectory,- initialState.config-);-export const recordingSlice = createSlice({name: 'recording',initialState,reducers: {recordingInfoUpdated: (state, action: PayloadAction<Partial<RecordingInfo>>) => {- Object.assign(state, action.payload);- state.computed = computeRecordingPath(state.recordingDirectory, state.config);+ return { ...state, ...action.payload };},recordingDirectoryChanged: (state, action: PayloadAction<string>) => {state.recordingDirectory = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);},recordingDurationUpdated: (state, action: PayloadAction<number>) => {state.duration = action.payload;},-- // Config updates- configUpdated: (state, action: PayloadAction<Partial<RecordingConfig>>) => {- Object.assign(state.config, action.payload);- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- useDelayStartToggled: (state, action: PayloadAction<boolean>) => {- state.config.useDelayStart = action.payload;- // No need to recompute path for delay settings- },- delaySecondsChanged: (state, action: PayloadAction<number>) => {- state.config.delaySeconds = action.payload;- // No need to recompute path for delay settings- },- useTimestampToggled: (state, action: PayloadAction<boolean>) => {- state.config.useTimestamp = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- useIncrementToggled: (state, action: PayloadAction<boolean>) => {- state.config.useIncrement = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- currentIncrementChanged: (state, action: PayloadAction<number>) => {- state.config.currentIncrement = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- currentIncrementIncremented: (state) => {- state.config.currentIncrement += 1;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- baseNameChanged: (state, action: PayloadAction<string>) => {- state.config.baseName = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- recordingTagChanged: (state, action: PayloadAction<string>) => {- state.config.recordingTag = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- createSubfolderToggled: (state, action: PayloadAction<boolean>) => {- state.config.createSubfolder = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- customSubfolderNameChanged: (state, action: PayloadAction<string>) => {- state.config.customSubfolderName = action.payload;- state.computed = computeRecordingPath(state.recordingDirectory, state.config);- },- // Force recomputation of path (useful for timestamp updates)- pathRecomputed: (state) => {- state.computed = computeRecordingPath(state.recordingDirectory, state.config);+ recordingCompletionDismissed: (state) => {+ state.completionData = null;},},extraReducers: (builder) => {@@ -168,12 +36,14 @@ export const recordingSlice = createSlice({state.recordingDirectory = action.meta.arg.recordingDirectory;state.startedAt = new Date().toISOString();state.duration = 0;+ state.completionData = null;})- .addCase(stopRecording.fulfilled, (state) => {+ .addCase(stopRecording.fulfilled, (state, action) => {state.isRecording = false;state.recordingName = null;state.startedAt = null;state.duration = 0;+ state.completionData = action.payload ?? null;});},});@@ -182,16 +52,5 @@ export const {recordingInfoUpdated,recordingDirectoryChanged,recordingDurationUpdated,- configUpdated,- useDelayStartToggled,- delaySecondsChanged,- useTimestampToggled,- useIncrementToggled,- currentIncrementChanged,- currentIncrementIncremented,- baseNameChanged,- recordingTagChanged,- createSubfolderToggled,- customSubfolderNameChanged,- pathRecomputed,+ recordingCompletionDismissed,} = recordingSlice.actions;diff --git a/freemocap-ui/src/store/slices/recording/recording-thunks.ts b/freemocap-ui/src/store/slices/recording/recording-thunks.tsindex 06730f18..6e8b7c95 100644--- a/freemocap-ui/src/store/slices/recording/recording-thunks.ts+++ b/freemocap-ui/src/store/slices/recording/recording-thunks.ts@@ -1,7 +1,8 @@-import {createAsyncThunk} from '@reduxjs/toolkit';-import {z} from 'zod';-import {RootState} from '@/store/types';+import { createAsyncThunk } from '@reduxjs/toolkit';+import { z } from 'zod';+import { RootState } from '@/store/types';import {serverUrls} from "@/services";+import { RecordingCompletionData, StopRecordingResponseSchema } from './recording-types';const RecordStartRequestSchema = z.object({recording_name: z.string(),@@ -30,7 +31,7 @@ export const startRecording = createAsyncThunk<mic_device_index: micDeviceIndex,});- const response = await fetch(serverUrls.endpoints.pipelineRecordStart, {+ const response = await fetch(serverUrls.endpoints.startRecording, {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify(payload),@@ -43,20 +44,23 @@ export const startRecording = createAsyncThunk<);export const stopRecording = createAsyncThunk<- void,+ RecordingCompletionData | null,void,{ state: RootState }>('recording/stop',- async (_, { getState }) => {- const state = getState();-- const response = await fetch(serverUrls.endpoints.pipelineRecordStop, {+ async () => {+ const response = await fetch(serverUrls.endpoints.stopRecording, {method: 'GET',});if (!response.ok) {throw new Error(`Failed to stop recording: ${response.statusText}`);}++ const data = await response.json();+ // Backend returns a list (one per camera group); take the first+ const results = z.array(StopRecordingResponseSchema).parse(data);+ return results.length > 0 ? results[0] : null;});diff --git a/freemocap-ui/src/store/slices/recording/recording-types.ts b/freemocap-ui/src/store/slices/recording/recording-types.tsindex 353973cb..1d3f0d19 100644--- a/freemocap-ui/src/store/slices/recording/recording-types.ts+++ b/freemocap-ui/src/store/slices/recording/recording-types.ts@@ -1,27 +1,29 @@-import {z} from 'zod';+import { z } from 'zod';-export const RecordingConfigSchema = z.object({- // Recording behavior settings- useDelayStart: z.boolean(),- delaySeconds: z.number(),+const StatsSummarySchema = z.object({+ median: z.number(),+ mean: z.number(),+ std: z.number(),+ min: z.number(),+ max: z.number(),+});- // Naming settings- useTimestamp: z.boolean(),- useIncrement: z.boolean(),- currentIncrement: z.number(),- baseName: z.string(),- recordingTag: z.string(),+export type StatsSummary = z.infer<typeof StatsSummarySchema>;- // Folder settings- createSubfolder: z.boolean(),- customSubfolderName: z.string(),+export const StopRecordingResponseSchema = z.object({+ recording_name: z.string(),+ recording_path: z.string(),+ number_of_cameras: z.number(),+ number_of_frames: z.number(),+ total_duration_sec: z.number(),+ mean_framerate: z.number(),+ mean_inter_camera_sync_ms: z.number(),+ framerate_stats: StatsSummarySchema,+ frame_duration_stats: StatsSummarySchema,+ inter_camera_grab_range_ms_stats: StatsSummarySchema,});-export const ComputedRecordingPathSchema = z.object({- recordingName: z.string(),- subfolderName: z.string(),- fullRecordingPath: z.string(),-});+export type RecordingCompletionData = z.infer<typeof StopRecordingResponseSchema>;export const RecordingInfoSchema = z.object({isRecording: z.boolean(),@@ -29,10 +31,7 @@ export const RecordingInfoSchema = z.object({recordingName: z.string().nullable(),startedAt: z.string().nullable(),duration: z.number().nullable(),- config: RecordingConfigSchema,- computed: ComputedRecordingPathSchema,+ completionData: StopRecordingResponseSchema.nullable(),});-export type RecordingConfig = z.infer<typeof RecordingConfigSchema>;-export type ComputedRecordingPath = z.infer<typeof ComputedRecordingPathSchema>;export type RecordingInfo = z.infer<typeof RecordingInfoSchema>;diff --git a/freemocap-ui/src/store/slices/settings/index.ts b/freemocap-ui/src/store/slices/settings/index.tsindex 1d68c6f4..51a99d07 100644--- a/freemocap-ui/src/store/slices/settings/index.ts+++ b/freemocap-ui/src/store/slices/settings/index.ts@@ -1,3 +1,3 @@export * from "./settings-slice";-export * from "./settings-selectors";export * from "./settings-types";+export * from "./settings-selectors";diff --git a/freemocap-ui/src/store/slices/settings/settings-selectors.ts b/freemocap-ui/src/store/slices/settings/settings-selectors.tsindex e22616d6..4d254c7b 100644--- a/freemocap-ui/src/store/slices/settings/settings-selectors.ts+++ b/freemocap-ui/src/store/slices/settings/settings-selectors.ts@@ -1,116 +1,7 @@-import {createSelector} from "@reduxjs/toolkit";-import {RootState} from "@/store/types";-import {- BackendCalibrationConfig,- BackendCalibrationSettings,- BackendCameraState,- BackendMocapConfig,- BackendMocapSettings,- BackendPipelineSettings,- FreeMoCapSettings,-} from "./settings-types";+import { RootState } from "../../types";-// ----------------------------------------------------------------------------// Root selectors-// -----------------------------------------------------------------------------export const selectServerSettings = (state: RootState): FreeMoCapSettings | null =>- state.settings.settings;--export const selectServerSettingsVersion = (state: RootState): number =>- state.settings.version;--export const selectServerSettingsInitialized = (state: RootState): boolean =>- state.settings.isInitialized;--// ----------------------------------------------------------------------------// Camera selectors-// -----------------------------------------------------------------------------export const selectBackendCameras = createSelector(- [selectServerSettings],- (settings): Record<string, BackendCameraState> => settings?.cameras ?? {},-);--export const selectBackendCameraIds = createSelector(- [selectBackendCameras],- (cameras): string[] => Object.keys(cameras),-);--export const selectBackendConnectedCameraCount = createSelector(- [selectBackendCameras],- (cameras): number =>- Object.values(cameras).filter((c) => c.status === "connected").length,-);--// ----------------------------------------------------------------------------// Pipeline selectors-// -----------------------------------------------------------------------------export const selectBackendPipeline = createSelector(- [selectServerSettings],- (settings): BackendPipelineSettings | null => settings?.pipeline ?? null,-);--export const selectBackendPipelineIsConnected = createSelector(- [selectBackendPipeline],- (pipeline): boolean => pipeline?.is_connected ?? false,-);--export const selectBackendPipelineId = createSelector(- [selectBackendPipeline],- (pipeline): string | null => pipeline?.pipeline_id ?? null,-);--// ----------------------------------------------------------------------------// Calibration selectors-// -----------------------------------------------------------------------------export const selectBackendCalibration = createSelector(- [selectServerSettings],- (settings): BackendCalibrationSettings | null => settings?.calibration ?? null,-);--export const selectBackendCalibrationConfig = createSelector(- [selectBackendCalibration],- (cal): BackendCalibrationConfig | null => cal?.config ?? null,-);--export const selectBackendCalibrationIsRecording = createSelector(- [selectBackendCalibration],- (cal): boolean => cal?.is_recording ?? false,-);--export const selectBackendCalibrationProgress = createSelector(- [selectBackendCalibration],- (cal): number => cal?.recording_progress ?? 0,-);--export const selectBackendHasCalibrationToml = createSelector(- [selectBackendCalibration],- (cal): boolean => cal?.has_calibration_toml ?? false,-);--// ----------------------------------------------------------------------------// MoCap selectors-// -----------------------------------------------------------------------------export const selectBackendMocap = createSelector(- [selectServerSettings],- (settings): BackendMocapSettings | null => settings?.mocap ?? null,-);--export const selectBackendMocapConfig = createSelector(- [selectBackendMocap],- (moc): BackendMocapConfig | null => moc?.config ?? null,-);--export const selectBackendMocapIsRecording = createSelector(- [selectBackendMocap],- (moc): boolean => moc?.is_recording ?? false,-);--export const selectBackendMocapProgress = createSelector(- [selectBackendMocap],- (moc): number => moc?.recording_progress ?? 0,-);+export const selectLocale = (state: RootState) => state.settings.locale;+export const selectPreviousLocale = (state: RootState) =>+ state.settings.previousLocale;+export const selectShowTranslationIndicator = (state: RootState) =>+ state.settings.showTranslationIndicator;diff --git a/freemocap-ui/src/store/slices/settings/settings-slice.ts b/freemocap-ui/src/store/slices/settings/settings-slice.tsindex ba661a4c..a30b3f1e 100644--- a/freemocap-ui/src/store/slices/settings/settings-slice.ts+++ b/freemocap-ui/src/store/slices/settings/settings-slice.ts@@ -1,52 +1,87 @@-import {createSlice, PayloadAction} from "@reduxjs/toolkit";-import {FreeMoCapSettings, SettingsStateMessage} from "./settings-types";--export interface ServerSettingsState {- settings: FreeMoCapSettings | null;- version: number;- lastUpdated: string | null;- isInitialized: boolean;+import { createSlice, PayloadAction } from "@reduxjs/toolkit";+import type { SettingsState } from "./settings-types";+import type { SupportedLocale } from "@/i18n";+import { FALLBACK_LOCALE, getLocaleDirection } from "@/i18n";+import i18n from "@/i18n/i18n";++const STORAGE_KEYS = {+ LOCALE: "freemocap:locale",+ PREVIOUS_LOCALE: "freemocap:previousLocale",+ SHOW_TRANSLATION_INDICATOR: "freemocap:showTranslationIndicator",+} as const;++function loadLocale(): SupportedLocale {+ if (typeof window === "undefined") return FALLBACK_LOCALE;+ const saved = localStorage.getItem(STORAGE_KEYS.LOCALE);+ if (saved) return saved as SupportedLocale;+ return (i18n.language as SupportedLocale) || FALLBACK_LOCALE;+}++function loadPreviousLocale(): SupportedLocale | null {+ if (typeof window === "undefined") return null;+ const saved = localStorage.getItem(STORAGE_KEYS.PREVIOUS_LOCALE);+ return saved as SupportedLocale | null;+}++function loadShowTranslationIndicator(): boolean {+ if (typeof window === "undefined") return true;+ const saved = localStorage.getItem(STORAGE_KEYS.SHOW_TRANSLATION_INDICATOR);+ if (saved !== null) return JSON.parse(saved) as boolean;+ return true;+}++/** Applies locale side-effects: syncs i18next, document dir, and localStorage. */+function applyLocale(locale: SupportedLocale): void {+ localStorage.setItem(STORAGE_KEYS.LOCALE, locale);+ i18n.changeLanguage(locale);+ const dir = getLocaleDirection(locale);+ document.documentElement.dir = dir;+ document.documentElement.lang = locale;}-const initialState: ServerSettingsState = {- settings: null,- version: -1,- lastUpdated: null,- isInitialized: false,+const initialState: SettingsState = {+ locale: loadLocale(),+ previousLocale: loadPreviousLocale(),+ showTranslationIndicator: loadShowTranslationIndicator(),};export const settingsSlice = createSlice({- name: "serverSettings",- initialState,- reducers: {- /**- * Replace the entire settings blob from a backend settings/state message.- * Only applies if the incoming version is newer than what we have.- */- serverSettingsUpdated: (state, action: PayloadAction<SettingsStateMessage>) => {- const {settings, version} = action.payload;- if (version <= state.version) {- return; // Stale message — ignore- }- state.settings = settings;- state.version = version;- state.lastUpdated = new Date().toISOString();- state.isInitialized = true;- },-- /**- * Reset to initial state (e.g., on WebSocket disconnect).- */- serverSettingsCleared: (state) => {- state.settings = null;- state.version = -1;- state.lastUpdated = null;- state.isInitialized = false;- },+ name: "settings",+ initialState,+ reducers: {+ localeChanged: (state, action: PayloadAction<SupportedLocale>) => {+ const next = action.payload;+ if (next === state.locale) return;++ // Remember the outgoing locale so we can toggle back to it+ state.previousLocale = state.locale;+ localStorage.setItem(STORAGE_KEYS.PREVIOUS_LOCALE, state.locale);++ state.locale = next;+ applyLocale(next);+ },++ /** Toggle between the current locale and the previous one (Ctrl+Shift+L). */+ localeToggled: (state) => {+ const target = state.previousLocale;+ if (!target || target === state.locale) return;++ const outgoing = state.locale;+ state.locale = target;+ state.previousLocale = outgoing;+ localStorage.setItem(STORAGE_KEYS.PREVIOUS_LOCALE, outgoing);+ applyLocale(target);+ },++ showTranslationIndicatorToggled: (state) => {+ state.showTranslationIndicator = !state.showTranslationIndicator;+ localStorage.setItem(+ STORAGE_KEYS.SHOW_TRANSLATION_INDICATOR,+ JSON.stringify(state.showTranslationIndicator)+ );},+ },});-export const {- serverSettingsUpdated,- serverSettingsCleared,-} = settingsSlice.actions;+export const { localeChanged, localeToggled, showTranslationIndicatorToggled } =+ settingsSlice.actions;diff --git a/freemocap-ui/src/store/slices/settings/settings-types.ts b/freemocap-ui/src/store/slices/settings/settings-types.tsindex f81ef937..b528ffdb 100644--- a/freemocap-ui/src/store/slices/settings/settings-types.ts+++ b/freemocap-ui/src/store/slices/settings/settings-types.ts@@ -1,174 +1,7 @@-/**- * TypeScript types mirroring the backend FreeMoCapSettings Pydantic models.- *- * These represent the authoritative backend state pushed over WebSocket.- * Field names use snake_case to match the JSON the backend sends.- */+import type { SupportedLocale } from "@/i18n";-// ----------------------------------------------------------------------------// Camera layer (mirrors skellycam CameraConfig + runtime status)-// -----------------------------------------------------------------------------export interface BackendImageResolution {- height: number;- width: number;-}--export interface BackendCameraConfig {- camera_id: string;- camera_index: number;- camera_name: string;- use_this_camera: boolean;- resolution: BackendImageResolution;- color_channels: number;- pixel_format: string;- exposure_mode: string;- exposure: number;- framerate: number;- rotation: number;- capture_fourcc: string;- writer_fourcc: string;-}--export type BackendCameraStatus = "disconnected" | "connected" | "error";--export interface BackendCameraState {- config: BackendCameraConfig;- status: BackendCameraStatus;-}--// ----------------------------------------------------------------------------// Calibration config (mirrors CalibrationPipelineConfig)-// -----------------------------------------------------------------------------export type CalibrationSolverMethod = "anipose" | "pyceres";--export interface BackendCalibrationConfig {- calibration_recording_folder: string | null;- charuco_board_x_squares: number;- charuco_board_y_squares: number;- charuco_square_length: number;- solver_method: CalibrationSolverMethod;- use_groundplane: boolean;- pyceres_solver_config: Record<string, unknown>;-}--export interface BackendCalibrationSettings {- config: BackendCalibrationConfig;- is_recording: boolean;- recording_progress: number;- last_recording_path: string | null;- has_calibration_toml: boolean;-}--// ----------------------------------------------------------------------------// MoCap config (mirrors MocapPipelineConfig)-// -----------------------------------------------------------------------------export interface BackendEstimatorConfig {- max_samples: number;- min_samples_for_full_confidence: number;- iqr_confidence_sensitivity: number;-}--export interface BackendRealtimeFilterConfig {- min_cutoff: number;- beta: number;- d_cutoff: number;- fabrik_tolerance: number;- fabrik_max_iterations: number;- height_meters: number;- noise_sigma: number;- estimator_config: BackendEstimatorConfig;- max_reprojection_error_px: number;- max_velocity_m_per_s: number;- max_rejected_streak: number;- max_prediction_frames: number;- prediction_velocity_decay: number;-}--export interface BackendMocapConfig {- detector: Record<string, unknown>;- skeleton_filter: BackendRealtimeFilterConfig;-}--export interface BackendMocapSettings {- config: BackendMocapConfig;- is_recording: boolean;- recording_progress: number;- last_recording_path: string | null;+export interface SettingsState {+ locale: SupportedLocale;+ previousLocale: SupportedLocale | null;+ showTranslationIndicator: boolean;}--// ----------------------------------------------------------------------------// Pipeline config (mirrors RealtimePipelineConfig + runtime status)-// -----------------------------------------------------------------------------export interface BackendRealtimePipelineConfig {- camera_configs: Record<string, BackendCameraConfig>;- calibration_config: BackendCalibrationConfig;- mocap_config: BackendMocapConfig;- calibration_detection_enabled: boolean;- mocap_detection_enabled: boolean;-}--export interface BackendPipelineSettings {- config: BackendRealtimePipelineConfig | null;- is_connected: boolean;- pipeline_id: string | null;- camera_group_id: string | null;- is_paused: boolean;-}--// ----------------------------------------------------------------------------// VMC settings (mirrors VMCSettings)-// -----------------------------------------------------------------------------export interface BackendVMCSettings {- enabled: boolean;- host: string;- port: number;-}--// ----------------------------------------------------------------------------// Top-level settings blob-// -----------------------------------------------------------------------------export interface FreeMoCapSettings {- cameras: Record<string, BackendCameraState>;- pipeline: BackendPipelineSettings;- calibration: BackendCalibrationSettings;- mocap: BackendMocapSettings;- vmc: BackendVMCSettings;-}--// ----------------------------------------------------------------------------// WebSocket message types-// -----------------------------------------------------------------------------export interface SettingsStateMessage {- message_type: "settings/state";- settings: FreeMoCapSettings;- version: number;-}--export interface SettingsPatchMessage {- message_type: "settings/patch";- patch: DeepPartial<FreeMoCapSettings>;-}--export interface SettingsRequestMessage {- message_type: "settings/request";-}--export type SettingsMessage =- | SettingsStateMessage- | SettingsPatchMessage- | SettingsRequestMessage;--// ----------------------------------------------------------------------------// Utility: deep partial for patch payloads-// -----------------------------------------------------------------------------export type DeepPartial<T> = {- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];-};diff --git a/freemocap-ui/src/store/slices/theme/theme-selectors.ts b/freemocap-ui/src/store/slices/theme/theme-selectors.tsindex f9d12576..b7ed9db9 100644--- a/freemocap-ui/src/store/slices/theme/theme-selectors.ts+++ b/freemocap-ui/src/store/slices/theme/theme-selectors.ts@@ -1,4 +1,4 @@-import {RootState} from '../../types';+import { RootState } from '../../types';export const selectThemeMode = (state: RootState) => state.theme.mode;export const selectSystemThemePreference = (state: RootState) =>diff --git a/freemocap-ui/src/store/slices/theme/theme-slice.ts b/freemocap-ui/src/store/slices/theme/theme-slice.tsindex 3cf18110..8f6ab6e8 100644--- a/freemocap-ui/src/store/slices/theme/theme-slice.ts+++ b/freemocap-ui/src/store/slices/theme/theme-slice.ts@@ -1,5 +1,5 @@-import {createSlice, PayloadAction} from '@reduxjs/toolkit';-import {ThemeMode} from './theme-types';+import { createSlice, PayloadAction } from '@reduxjs/toolkit';+import { ThemeMode } from './theme-types';const getInitialTheme = (): ThemeMode => {if (typeof window !== 'undefined') {diff --git a/freemocap-ui/src/store/slices/thunk-helpers.ts b/freemocap-ui/src/store/slices/thunk-helpers.tsdeleted file mode 100644index f6b9fc8a..00000000--- a/freemocap-ui/src/store/slices/thunk-helpers.ts+++ /dev/null@@ -1,35 +0,0 @@-/**- * Shared utilities for async thunks that call the backend HTTP API.- */--/**- * Extract a detailed error message from a failed HTTP response.- * Attempts to parse JSON first, falls back to text, builds a- * comprehensive error string including status code and body.- */-export async function getDetailedErrorMessage(response: Response): Promise<string> {- let errorDetails: unknown;-- try {- errorDetails = await response.json();- console.error('❌ Server returned validation/error details:', errorDetails);- } catch {- try {- errorDetails = await response.text();- console.error('❌ Server returned error text:', errorDetails);- } catch {- console.error('❌ Could not read error response body');- }- }-- const baseError = `HTTP ${response.status}: ${response.statusText}`;-- if (errorDetails) {- const detailsStr = typeof errorDetails === 'string'- ? errorDetails- : JSON.stringify(errorDetails, null, 2);- return `${baseError}\n\nValidation/Error Details:\n${detailsStr}`;- }-- return baseError;-}diff --git a/freemocap-ui/src/store/slices/videos/videos-selectors.ts b/freemocap-ui/src/store/slices/videos/videos-selectors.tsindex 558c7fda..21bca41f 100644--- a/freemocap-ui/src/store/slices/videos/videos-selectors.ts+++ b/freemocap-ui/src/store/slices/videos/videos-selectors.ts@@ -1,5 +1,5 @@-import {createSelector} from '@reduxjs/toolkit';-import {RootState} from '../../types';+import { createSelector } from '@reduxjs/toolkit';+import { RootState } from '../../types';export const selectVideoFolder = (state: RootState) => state.videos.folder;export const selectVideoFiles = (state: RootState) => state.videos.files;diff --git a/freemocap-ui/src/store/slices/videos/videos-slice.ts b/freemocap-ui/src/store/slices/videos/videos-slice.tsindex d5c74b44..e24dd8d1 100644--- a/freemocap-ui/src/store/slices/videos/videos-slice.ts+++ b/freemocap-ui/src/store/slices/videos/videos-slice.ts@@ -1,6 +1,10 @@-import {createSlice, PayloadAction} from '@reduxjs/toolkit';-import {VideoFile, VideosState} from './videos-types';-import {loadVideos, openVideoFile, selectVideoLoadFolder,} from './videos-thunks';+import { createSlice, PayloadAction } from '@reduxjs/toolkit';+import { VideoFile, VideosState } from './videos-types';+import {+ loadVideos,+ openVideoFile,+ selectVideoLoadFolder,+} from './videos-thunks';const initialState: VideosState = {diff --git a/freemocap-ui/src/store/slices/videos/videos-thunks.ts b/freemocap-ui/src/store/slices/videos/videos-thunks.tsindex 26e93e23..5bd73156 100644--- a/freemocap-ui/src/store/slices/videos/videos-thunks.ts+++ b/freemocap-ui/src/store/slices/videos/videos-thunks.ts@@ -1,4 +1,4 @@-import {createAsyncThunk} from '@reduxjs/toolkit';+import { createAsyncThunk } from '@reduxjs/toolkit';import {electronIpc} from "@/services/electron-ipc/electron-ipc";import {VideoFile} from "@/store";diff --git a/freemocap-ui/src/store/store.ts b/freemocap-ui/src/store/store.tsindex c5dd136d..5b29b0a9 100644--- a/freemocap-ui/src/store/store.ts+++ b/freemocap-ui/src/store/store.ts@@ -1,26 +1,16 @@import {configureStore} from "@reduxjs/toolkit";-import {framerateSlice} from "./slices/framerate/framerate-slice";import {cameraSlice} from "./slices/cameras/cameras-slice";import {recordingSlice} from "./slices/recording/recording-slice";import {themeSlice} from "./slices/theme/theme-slice";import {videosSlice} from "./slices/videos/videos-slice";-import {logRecordsSlice} from "./slices/log-records/log-records-slice";-import {pipelineSlice} from "./slices/pipeline/pipeline-slice";-import {calibrationSlice} from "@/store/slices/calibration/calibration-slice";-import {mocapSlice} from "@/store/slices/mocap/mocap-slice";-import {settingsSlice} from "@/store/slices/settings/settings-slice";+import {settingsSlice} from "./slices/settings/settings-slice";export const store = configureStore({reducer: {cameras: cameraSlice.reducer,recording: recordingSlice.reducer,- framerate: framerateSlice.reducer,- logs: logRecordsSlice.reducer,theme: themeSlice.reducer,videos: videosSlice.reducer,- pipeline: pipelineSlice.reducer,- calibration: calibrationSlice.reducer,- mocap: mocapSlice.reducer,settings: settingsSlice.reducer,- },+ }});diff --git a/freemocap-ui/src/store/types.ts b/freemocap-ui/src/store/types.tsindex be6112cd..3931b2ce 100644--- a/freemocap-ui/src/store/types.ts+++ b/freemocap-ui/src/store/types.ts@@ -1,5 +1,5 @@-import {store} from './store';-import {Action, ThunkAction} from '@reduxjs/toolkit';+import { store } from './store';+import { ThunkAction, Action } from '@reduxjs/toolkit';export type RootState = ReturnType<typeof store.getState>;export type AppDispatch = typeof store.dispatch;diff --git a/freemocap-ui/vite.config.ts b/freemocap-ui/vite.config.tsindex 5ec6d289..eb8644f2 100644--- a/freemocap-ui/vite.config.ts+++ b/freemocap-ui/vite.config.ts@@ -5,8 +5,6 @@ import react from '@vitejs/plugin-react'import electron from 'vite-plugin-electron/simple'import pkg from './package.json'-const __dirname = import.meta.dirname-// https://vitejs.dev/config/export default defineConfig(({command}) => {rmSync('dist-electron', {recursive: true, force: true})@@ -25,6 +23,7 @@ export default defineConfig(({command}) => {react(),electron({main: {+ // Shortcut of `build.lib.entry`entry: 'electron/main/index.ts',onstart(args) {if (process.env.VSCODE_DEBUG) {@@ -45,10 +44,12 @@ export default defineConfig(({command}) => {},},preload: {+ // Shortcut of `build.rollupOptions.input`.+ // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.input: 'electron/preload/index.ts',vite: {build: {- sourcemap: sourcemap ? 'inline' : undefined,+ sourcemap: sourcemap ? 'inline' : undefined, // #332minify: isBuild,outDir: 'dist-electron/preload',rollupOptions: {@@ -57,20 +58,24 @@ export default defineConfig(({command}) => {},},},+ // Ployfill the Electron and Node.js API for Renderer process.+ // If you want use Node.js in Renderer process, the `nodeIntegration` needs to be enabled in the Main process.+ // See 👉 https://github.com/electron-vite/vite-plugin-electron-rendererrenderer: {},}),],- optimizeDeps: {- exclude: ["@ffmpeg/ffmpeg", "@ffmpeg/util"],- },- server: {- host: '127.0.0.1',- port: 7877,- headers: {- "Cross-Origin-Opener-Policy": "same-origin",- "Cross-Origin-Embedder-Policy": "require-corp",- },- },+ optimizeDeps: {},+ server: process.env.VSCODE_DEBUG && (() => {+ const url = new URL(pkg.debug.env.VITE_DEV_SERVER_URL)+ return {+ host: url.hostname,+ port: +url.port,+ headers: {+ "Cross-Origin-Opener-Policy": "same-origin",+ "Cross-Origin-Embedder-Policy": "require-corp",+ },+ }+ })(),clearScreen: false,}})diff --git a/freemocap-ui/vitest.config.ts b/freemocap-ui/vitest.config.tsdeleted file mode 100644index 24dce78d..00000000--- a/freemocap-ui/vitest.config.ts+++ /dev/null@@ -1,16 +0,0 @@-/// <reference types="vitest" />-import { defineConfig } from 'vite';-import path from 'path';--export default defineConfig({- test: {- globals: true,- environment: 'node',- include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],- },- resolve: {- alias: {- '@': path.resolve(__dirname, './src'),- },- },-});diff --git a/freemocap/app/freemocap_application.py b/freemocap/app/freemocap_application.pyindex e2cab3ae..311dae29 100644--- a/freemocap/app/freemocap_application.py+++ b/freemocap/app/freemocap_application.py@@ -198,8 +198,6 @@ class FreemocapApplication:self.realtime_pipeline_manager.shutdown()self.posthoc_pipeline_manager.shutdown()- def to_app_state(self) -> AppState:- return AppState.from_app(self)FREEMOCAP_APP: FreemocapApplication | None = None@@ -217,4 +215,4 @@ def get_freemocap_app() -> FreemocapApplication:global FREEMOCAP_APPif FREEMOCAP_APP is None:raise RuntimeError("FreemocapApplication does not exist!")- return FREEMOCAP_APP\ No newline at end of file+ return FREEMOCAP_APPdiff --git a/shared/logo/freemocap-logo.ico b/shared/freemocap-logo/freemocap-logo.icosimilarity index 100%rename from shared/logo/freemocap-logo.icorename to shared/freemocap-logo/freemocap-logo.icodiff --git a/freemocap-ui/public/freemocap-logo.png b/shared/freemocap-logo/freemocap-logo.pngsimilarity index 100%rename from freemocap-ui/public/freemocap-logo.pngrename to shared/freemocap-logo/freemocap-logo.pngdiff --git a/shared/logo/freemocap-logo.svg b/shared/freemocap-logo/freemocap-logo.svgsimilarity index 100%rename from shared/logo/freemocap-logo.svgrename to shared/freemocap-logo/freemocap-logo.svgdiff --git a/shared/logo/freemocap-logo.png b/shared/logo/freemocap-logo.pngdeleted file mode 100644index 965d70bd..00000000Binary files a/shared/logo/freemocap-logo.png and /dev/null differ