-
Notifications
You must be signed in to change notification settings - Fork 0
feat(studio): add first-wave React operator console #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
YashasVM
wants to merge
2
commits into
main
Choose a base branch
from
codex/v4-react-operator-ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| node_modules/ | ||
| coverage/ | ||
| .pnpm-store/ | ||
| pnpm-lock.yaml | ||
| package-lock.json | ||
| pnpm-lock.yaml | ||
| yarn.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "endOfLine": "lf", | ||
| "semi": false, | ||
| "singleQuote": false, | ||
| "tabWidth": 2, | ||
| "trailingComma": "es5", | ||
| "printWidth": 80, | ||
| "plugins": ["prettier-plugin-tailwindcss"], | ||
| "tailwindStylesheet": "src/index.css", | ||
| "tailwindFunctions": ["cn", "cva"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # React + TypeScript + Vite + shadcn/ui | ||
|
|
||
| This is a template for a new Vite project with React, TypeScript, and shadcn/ui. | ||
|
|
||
| ## b0 compatibility adaptation | ||
|
|
||
| The requested shadcn `b0` preset was translated into this existing Vite/Tauri | ||
| desktop app instead of converting it to Next.js or a monorepo. Compact b0 | ||
| tokens (neutral dark surfaces, tight radii, thin borders, restrained elevation), | ||
| Base UI primitives, pointer-sized controls, and RTL-safe layout rules live in | ||
| `src/index.css` and the generated `src/components/ui/*` primitives. | ||
| `components.json` keeps the supported `base-nova` style name so future shadcn | ||
| CLI updates remain compatible, while `rtl: true` keeps generated components | ||
| RTL-ready. No new routes or media ownership are introduced by this adaptation. | ||
|
|
||
| ## Adding components | ||
|
|
||
| To add components to your app, run the following command: | ||
|
|
||
| ```bash | ||
| npx shadcn@latest add button | ||
| ``` | ||
|
|
||
| This will place the ui components in the `src/components` directory. | ||
|
|
||
| ## Using components | ||
|
|
||
| To use the components in your app, import them as follows: | ||
|
|
||
| ```tsx | ||
| import { Button } from "@/components/ui/button" | ||
| ``` | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "base-nova", | ||
| "rsc": false, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "src/index.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "iconLibrary": "lucide", | ||
| "rtl": true, | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib", | ||
| "hooks": "@/hooks" | ||
| }, | ||
| "menuColor": "default", | ||
| "menuAccent": "subtle", | ||
| "registries": {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import js from '@eslint/js' | ||
| import globals from 'globals' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import tseslint from 'typescript-eslint' | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| reactHooks.configs.flat.recommended, | ||
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| globals: globals.browser, | ||
| }, | ||
| }, | ||
| { | ||
| files: ['src/components/ui/**/*.{ts,tsx}'], | ||
| rules: { 'react-refresh/only-export-components': 'off' }, | ||
| }, | ||
| { | ||
| files: ['src/hooks/use-mobile.ts'], | ||
| rules: { 'react-hooks/set-state-in-effect': 'off' }, | ||
| }, | ||
| ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>vite-app</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| { | ||
| "name": "desktop", | ||
| "private": true, | ||
| "version": "0.0.1", | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "tsc -b && vite build", | ||
| "lint": "eslint .", | ||
| "format": "prettier --write \"**/*.{ts,tsx}\"", | ||
| "test": "vitest run", | ||
| "typecheck": "tsc --noEmit", | ||
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
| "@base-ui/react": "^1.6.0", | ||
| "@fontsource-variable/geist": "^5.3.0", | ||
| "@tailwindcss/vite": "^4", | ||
| "class-variance-authority": "^0.7.1", | ||
| "clsx": "^2.1.1", | ||
| "lucide-react": "^1.28.0", | ||
| "next-themes": "^0.4.6", | ||
| "react": "^19.2.6", | ||
| "react-dom": "^19.2.6", | ||
| "recharts": "3.8.0", | ||
| "shadcn": "^4.16.1", | ||
| "sonner": "^2.0.7", | ||
| "tailwind-merge": "^3.6.0", | ||
| "tailwindcss": "^4", | ||
| "tw-animate-css": "^1.4.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint/js": "^10", | ||
| "@testing-library/jest-dom": "^6.9.1", | ||
| "@testing-library/react": "^16.3.0", | ||
| "@types/node": "^24", | ||
| "@types/react": "^19", | ||
| "@types/react-dom": "^19", | ||
| "@vitejs/plugin-react": "^6", | ||
| "eslint": "^10", | ||
| "eslint-plugin-react-hooks": "^7.1.1", | ||
| "eslint-plugin-react-refresh": "^0.5.2", | ||
| "globals": "^17", | ||
| "jsdom": "^30.0.1", | ||
| "prettier": "^3.8.3", | ||
| "prettier-plugin-tailwindcss": "^0.8.0", | ||
| "typescript": "~6", | ||
| "typescript-eslint": "^8", | ||
| "vite": "^8", | ||
| "vitest": "^4.1.10" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { fireEvent, render, screen } from "@testing-library/react" | ||
| import { beforeEach, describe, expect, it } from "vitest" | ||
| import { App } from "./App" | ||
| import { DeterministicStudioAdapter } from "./studio-adapter" | ||
|
|
||
| describe("operator routes",()=>{ | ||
| beforeEach(()=>{location.hash=""}) | ||
| it("navigates to each of the four destinations",()=>{render(<App/>);for(const name of ["Cameras","Audio","Studio","Dashboard"]){fireEvent.click(screen.getByRole("button",{name:new RegExp(name)}));expect(screen.getByRole("heading",{name,level:1})).toBeInTheDocument()}}) | ||
| it("renders capability and command authority states",()=>{location.hash="#/cameras";render(<App/>);fireEvent.click(screen.getByRole("button",{name:/Camera 4, idle/}));expect(screen.getByText("Unsupported")).toBeInTheDocument();expect(screen.getByText("No torch on active lens")).toBeInTheDocument()}) | ||
| it("requires explicit audio routing",()=>{const adapter=new DeterministicStudioAdapter();location.hash="#/audio";render(<App adapter={adapter}/>);const routes=screen.getAllByRole("switch",{name:/Route to Program/});expect(routes.filter(r=>r.getAttribute("aria-checked")==="true")).toHaveLength(1);fireEvent.click(routes[1]);expect(adapter.getSnapshot().audio[1].routed).toBe(true)}) | ||
| it("exposes non-colour-only failure feedback and keyboard cut",()=>{const adapter=new DeterministicStudioAdapter();location.hash="#/studio";render(<App adapter={adapter}/>);fireEvent.click(screen.getByRole("button",{name:/Simulate live failure/}));expect(screen.getAllByText(/LAST FRAME HELD/).length).toBeGreaterThan(0);const before=adapter.getSnapshot().programId;fireEvent.keyDown(window,{key:" "});expect(adapter.getSnapshot().programId).not.toBe(before)}) | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Replace the remaining Vite scaffold identity.
The documentation and browser metadata still present this project as a generic Vite application. Update both locations so the operator console has one product name and one setup description.
desktop/README.md#L1-L3: Document the desktop operator console, supported commands, and current destinations.desktop/index.html#L5-L7: Replacevite.svgandvite-appwith the shipped product favicon and title.📍 Affects 2 files
desktop/README.md#L1-L3(this comment)desktop/index.html#L5-L7🤖 Prompt for AI Agents