Feature/react viewer#14972
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new React-based “react-viewer” tool (with unit/integration + E2E testing and Tauri desktop packaging) and updates the REST API backend to support additional viewer capabilities (firmware endpoints, per-sensor streaming, depth helpers, improved streaming/timing responses).
Changes:
- Introduces a full Vite/React frontend (UI components, Zustand store integration, Tailwind styling) plus Vitest + MSW unit tests and Playwright E2E tests.
- Adds Tauri desktop packaging scaffolding and Windows build/diagnostics scripts for bundling the frontend + a PyInstaller-built FastAPI executable.
- Extends the FastAPI backend with
/api/v1routing, health + firmware endpoints, per-sensor streaming endpoints/models, and enhanced stream start responses (timings, cache reuse, depth helpers).
Reviewed changes
Copilot reviewed 86 out of 99 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| wrappers/rest-api/tools/react-viewer/vitest.config.ts | Adds Vitest configuration (globals/jsdom/setup/coverage). |
| wrappers/rest-api/tools/react-viewer/vite.config.ts | Adds Vite dev/build configuration (aliases, proxy, chunking). |
| wrappers/rest-api/tools/react-viewer/tests/utils/test-utils.tsx | Adds RTL helpers + Zustand store reset + mock factories. |
| wrappers/rest-api/tools/react-viewer/tests/unit/components/Toast.test.tsx | Adds unit tests for Toast + ToastContainer. |
| wrappers/rest-api/tools/react-viewer/tests/unit/components/StreamViewer.test.tsx | Adds StreamViewer rendering/empty-state tests. |
| wrappers/rest-api/tools/react-viewer/tests/unit/components/Header.test.tsx | Adds Header tests (logo, view toggle, tooltip). |
| wrappers/rest-api/tools/react-viewer/tests/unit/components/DevicePanel.test.tsx | Adds DevicePanel tests (empty/loading/list/error/refresh). |
| wrappers/rest-api/tools/react-viewer/tests/unit/api/client.test.ts | Adds API client tests using MSW fixtures/handlers. |
| wrappers/rest-api/tools/react-viewer/tests/setup/test-setup.ts | Adds global test setup (jest-dom, MSW, WebRTC + Socket mocks). |
| wrappers/rest-api/tools/react-viewer/tests/mocks/server.ts | Adds MSW node server with Vitest lifecycle hooks. |
| wrappers/rest-api/tools/react-viewer/tests/mocks/fixtures/sensors.ts | Adds sensor/option fixtures (including PP options). |
| wrappers/rest-api/tools/react-viewer/tests/mocks/fixtures/index.ts | Re-exports fixtures for convenience. |
| wrappers/rest-api/tools/react-viewer/tests/mocks/fixtures/devices.ts | Adds device/device-state fixtures for tests. |
| wrappers/rest-api/tools/react-viewer/tests/mocks/api-handlers.ts | Adds MSW request handlers for the viewer API surface. |
| wrappers/rest-api/tools/react-viewer/tests/e2e/smoke.spec.ts | Adds Playwright smoke tests for basic app load/visibility. |
| wrappers/rest-api/tools/react-viewer/tests/e2e/real-device.spec.ts | Adds Playwright real-hardware tests gated by REAL_DEVICE. |
| wrappers/rest-api/tools/react-viewer/tests/e2e/fixtures.ts | Adds Playwright fixtures/helpers for mock vs real device mode. |
| wrappers/rest-api/tools/react-viewer/tests/README.md | Documents test structure, running commands, and troubleshooting. |
| wrappers/rest-api/tools/react-viewer/tests/LATEST_FIX.md | Documents a specific historical test fix and rationale. |
| wrappers/rest-api/tools/react-viewer/tests/INSTALLATION.md | Documents how to install and verify the testing stack. |
| wrappers/rest-api/tools/react-viewer/tests/FIXES.md | Summarizes fixes made to get tests passing. |
| wrappers/rest-api/tools/react-viewer/tailwind.config.js | Adds Tailwind theme/content configuration. |
| wrappers/rest-api/tools/react-viewer/src/vite-env.d.ts | Adds Vite client type references. |
| wrappers/rest-api/tools/react-viewer/src/main.tsx | Adds React entry point. |
| wrappers/rest-api/tools/react-viewer/src/index.css | Adds Tailwind directives + global styles. |
| wrappers/rest-api/tools/react-viewer/src/components/index.ts | Adds barrel exports for components. |
| wrappers/rest-api/tools/react-viewer/src/components/WhatsNew.tsx | Adds “What’s New” modal + version tracking. |
| wrappers/rest-api/tools/react-viewer/src/components/Toast.tsx | Adds Toast UI components. |
| wrappers/rest-api/tools/react-viewer/src/components/PointCloudViewer.tsx | Adds Three.js point cloud rendering + PLY export. |
| wrappers/rest-api/tools/react-viewer/src/components/LoadingSplash.tsx | Adds loading overlay UI. |
| wrappers/rest-api/tools/react-viewer/src/components/IMUViewer.tsx | Adds IMU charts + CSV export. |
| wrappers/rest-api/tools/react-viewer/src/components/Header.tsx | Adds app header with view toggle + About modal. |
| wrappers/rest-api/tools/react-viewer/src/components/FirmwareProgressModal.tsx | Adds firmware update progress modal wiring to client events. |
| wrappers/rest-api/tools/react-viewer/src/components/DepthLegend.tsx | Adds interactive depth legend widget. |
| wrappers/rest-api/tools/react-viewer/src/components/ChatBot/index.ts | Adds ChatBot barrel exports. |
| wrappers/rest-api/tools/react-viewer/src/components/ChatBot/SettingsPreview.tsx | Adds settings proposal preview/apply UI. |
| wrappers/rest-api/tools/react-viewer/src/components/ChatBot/CodeExport.tsx | Adds code snippet export UI (Python/C++). |
| wrappers/rest-api/tools/react-viewer/src/components/ChatBot/ChatPanel.tsx | Adds chat panel UI + input + message list. |
| wrappers/rest-api/tools/react-viewer/src/components/ChatBot/ChatMessage.tsx | Adds message bubble rendering + inline formatting + code export. |
| wrappers/rest-api/tools/react-viewer/src/components/ChatBot/ChatButton.tsx | Adds floating chat toggle + availability handling. |
| wrappers/rest-api/tools/react-viewer/src/components/ApiDiagnostics.tsx | Adds desktop-only backend diagnostics panel via Tauri invoke. |
| wrappers/rest-api/tools/react-viewer/src/api/webrtc.ts | Adds WebRTC handler logic for viewer streams. |
| wrappers/rest-api/tools/react-viewer/src/api/types.ts | Adds frontend TypeScript types for API + UI state. |
| wrappers/rest-api/tools/react-viewer/src/api/socket.ts | Adds Socket.IO client wrapper for metadata updates. |
| wrappers/rest-api/tools/react-viewer/src/api/index.ts | Adds API barrel exports. |
| wrappers/rest-api/tools/react-viewer/src/api/chat.ts | Adds client-side LLM chat API integration (Groq/OpenAI/custom). |
| wrappers/rest-api/tools/react-viewer/src/App.tsx | Adds overall app layout + Socket connect + overlays + chat. |
| wrappers/rest-api/tools/react-viewer/src-tauri/resources/.gitkeep | Adds placeholder for bundled backend resources. |
| wrappers/rest-api/tools/react-viewer/src-tauri/icons/icon.png | Adds Tauri icon asset. |
| wrappers/rest-api/tools/react-viewer/src-tauri/icons/icon.icns | Adds macOS icon asset. |
| wrappers/rest-api/tools/react-viewer/src-tauri/icons/512x512.png | Adds icon size asset. |
| wrappers/rest-api/tools/react-viewer/src-tauri/icons/32x32.png | Adds icon size asset. |
| wrappers/rest-api/tools/react-viewer/src-tauri/icons/256x256.png | Adds icon size asset. |
| wrappers/rest-api/tools/react-viewer/src-tauri/icons/128x128.png | Adds icon size asset. |
| wrappers/rest-api/tools/react-viewer/src-tauri/build.rs | Adds Tauri build script. |
| wrappers/rest-api/tools/react-viewer/src-tauri/Cargo.toml | Adds Tauri Rust crate manifest. |
| wrappers/rest-api/tools/react-viewer/src-tauri/.cargo/config.toml | Customizes Cargo target dir for repo build output. |
| wrappers/rest-api/tools/react-viewer/scripts/bundle-for-prod.js | Adds script to copy Vite dist into FastAPI static folder. |
| wrappers/rest-api/tools/react-viewer/public/realsense.svg | Adds SVG asset. |
| wrappers/rest-api/tools/react-viewer/public/favicon.png | Adds favicon asset. |
| wrappers/rest-api/tools/react-viewer/postcss.config.js | Adds PostCSS plugins config for Tailwind. |
| wrappers/rest-api/tools/react-viewer/playwright.config.ts | Adds Playwright configuration (mock/real device modes). |
| wrappers/rest-api/tools/react-viewer/index.html | Adds Vite HTML entrypoint. |
| wrappers/rest-api/tools/react-viewer/diagnose-backend.ps1 | Adds Windows backend diagnostic script. |
| wrappers/rest-api/tools/react-viewer/build-all.ps1 | Adds Windows build pipeline script (backend + UI + Tauri). |
| wrappers/rest-api/tools/react-viewer/README.md | Adds top-level viewer documentation + scripts overview. |
| wrappers/rest-api/tools/react-viewer/QUICK_START.md | Adds Windows-oriented build/install quick start instructions. |
| wrappers/rest-api/tools/react-viewer/LICENSE-THIRD-PARTY.md | Adds third-party license summary for packaged app. |
| wrappers/rest-api/tools/react-viewer/DESKTOP_BUILD.md | Adds Tauri architecture/build documentation. |
| wrappers/rest-api/tools/react-viewer/.gitignore | Adds tool-local ignore rules. |
| wrappers/rest-api/tools/react-viewer/.eslintrc.cjs | Adds ESLint configuration. |
| wrappers/rest-api/tools/react-viewer/.env.example | Adds example environment variables for chat providers. |
| wrappers/rest-api/realsense_api.spec | Adds PyInstaller spec for building backend executable. |
| wrappers/rest-api/main.py | Updates backend startup behavior (event loop capture, PyInstaller mode, reload). |
| wrappers/rest-api/config.py | Changes API base prefix to /api/v1. |
| wrappers/rest-api/app/services/webrtc_manager.py | Improves frame normalization/conversion + error logging in WebRTC track. |
| wrappers/rest-api/app/models/stream.py | Extends stream models (reuse_cache, stopping, timing response model). |
| wrappers/rest-api/app/models/sensor_streaming.py | Adds models for per-sensor streaming control. |
| wrappers/rest-api/app/models/option.py | Extends option info (category/filter/value descriptions). |
| wrappers/rest-api/app/models/device.py | Extends device models with firmware-related fields. |
| wrappers/rest-api/app/api/router.py | Adds health endpoint + firmware + per-sensor streaming routing. |
| wrappers/rest-api/app/api/endpoints/streams.py | Returns timing info on start + adds depth helpers endpoints. |
| wrappers/rest-api/app/api/endpoints/sensor_streaming.py | Adds per-sensor + batch streaming endpoints. |
| wrappers/rest-api/app/api/endpoints/options.py | Preserves RealSenseError status codes + upgrades unexpected errors to 500. |
| wrappers/rest-api/app/api/endpoints/firmware.py | Adds firmware status/update endpoints (threadpool for blocking update). |
| wrappers/rest-api/app/api/endpoints/devices.py | Adds force_refresh and a refresh endpoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Response to Automated Review CommentsAddressing all Aikido and Copilot bot findings from this PR. Below is the status of each category. ✅ Security Fixes (implemented)SSRF — Added a strict regex guard Weak hash (SHA-1 → SHA-256) — Replaced
All three ✅ Correctness / Reliability Fixes (implemented)Timer leak in Added
Both
Missing Added ✅ Code Quality Refactors (implemented)
Extracted
Extracted
Extracted
Extracted
Extracted:
|
| Finding | Reason |
|---|---|
Path traversal in bundle-for-prod.js |
__dirname + static string array — no user input reaches path.join |
Command injection in main.rs |
Tauri sidecar with hardcoded args array — no shell interpolation |
reload_enabled flag inversion |
Fixed in a prior commit (simplified to not is_bundled) |
8d24b45 to
160ad90
Compare
db39076 to
53ba625
Compare
…reamStatus, broke result['timings'] subscript in endpoint)
| export const APP_VERSION = '0.5.0' | ||
|
|
||
| // What's New content for each version | ||
| const WHATS_NEW: Record<string, { title: string; features: string[] }> = { |
There was a problem hiding this comment.
Let's either drop or use the SDK version with a first time welcome message
Let's try to get to a generic text that we don't need to maintaine
There was a problem hiding this comment.
Done- designed to be similar at the popup in realsense-viewer when running new SDK version
| @@ -0,0 +1,248 @@ | |||
| # RealSense React Viewer | |||
|
|
|||
| A modern React-based web UI for Intel RealSense cameras, leveraging the REST API backend. | |||
| {/* Footer */} | ||
| <div className="px-6 py-4 bg-gray-800/50 flex justify-between items-center"> | ||
| <a | ||
| href="https://github.com/IntelRealSense/librealsense" |
There was a problem hiding this comment.
IntelRealsense --> realsenseai
|
@remibettan how do we update FW from file? |
|
Lets verify the added files license and add to notice.md |
Done - file wrappers/rest-api/tools/react-viewer/LICENSE-THIRD-PARTY.md updated |
Tracked by: RSDEV-6224