chore: remove dead UI dirs (frontend-react + shadcn ui) — only Helix UI at src/web/ui-dist

This commit is contained in:
2026-06-14 00:18:34 -04:00
parent e2f81fd309
commit f41ea6a9a0
48 changed files with 0 additions and 11455 deletions
-24
View File
@@ -1,24 +0,0 @@
# 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?
-16
View File
@@ -1,16 +0,0 @@
# React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
## React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
## Expanding the ESLint configuration
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
-21
View File
@@ -1,21 +0,0 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
globals: globals.browser,
parserOptions: { ecmaFeatures: { jsx: true } },
},
},
])
-13
View File
@@ -1,13 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pi Multi-FX Pedal</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
-2427
View File
File diff suppressed because it is too large Load Diff
-27
View File
@@ -1,27 +0,0 @@
{
"name": "frontend-react",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.2.6",
"react-dom": "^19.2.6"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^10.3.0",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.6.0",
"vite": "^8.0.12"
}
}
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.3 KiB

-24
View File
@@ -1,24 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="bluesky-icon" viewBox="0 0 16 17">
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
</symbol>
<symbol id="discord-icon" viewBox="0 0 20 19">
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
</symbol>
<symbol id="documentation-icon" viewBox="0 0 21 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
</symbol>
<symbol id="github-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
</symbol>
<symbol id="social-icon" viewBox="0 0 20 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
</symbol>
<symbol id="x-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

File diff suppressed because it is too large Load Diff
-2
View File
@@ -1,2 +0,0 @@
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0A0A0C; color: #F0EDE6; }
-10
View File
@@ -1,10 +0,0 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>,
)
-12
View File
@@ -1,12 +0,0 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: '/ui/',
build: {
outDir: '../src/web/ui-dist',
emptyOutDir: true,
},
})
-24
View File
@@ -1,24 +0,0 @@
# 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?
-73
View File
@@ -1,73 +0,0 @@
# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
## React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
```js
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
-20
View File
@@ -1,20 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
-22
View File
@@ -1,22 +0,0 @@
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,
},
},
])
-13
View File
@@ -1,13 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ui</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
-3869
View File
File diff suppressed because it is too large Load Diff
-40
View File
@@ -1,40 +0,0 @@
{
"name": "ui",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@radix-ui/react-select": "^2.3.0",
"@radix-ui/react-slider": "^1.4.0",
"@radix-ui/react-slot": "^1.2.5",
"@radix-ui/react-switch": "^1.3.0",
"@radix-ui/react-tabs": "^1.1.14",
"@tailwindcss/vite": "^4.3.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^1.18.0",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"tailwind-merge": "^3.6.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^24.12.3",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^10.3.0",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.6.0",
"typescript": "~6.0.2",
"typescript-eslint": "^8.59.2",
"vite": "^8.0.12"
}
}
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.3 KiB

-24
View File
@@ -1,24 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="bluesky-icon" viewBox="0 0 16 17">
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
</symbol>
<symbol id="discord-icon" viewBox="0 0 20 19">
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
</symbol>
<symbol id="documentation-icon" viewBox="0 0 21 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
</symbol>
<symbol id="github-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
</symbol>
<symbol id="social-icon" viewBox="0 0 20 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
</symbol>
<symbol id="x-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

-707
View File
@@ -1,707 +0,0 @@
/**
* Pi Multi-FX Pedal — App Shell
*
* Main application with:
* - Status bar (mode selector, connection status, CPU, sample rate)
* - Screen area (tab content: Rig, FX Chain, Models, IRs, Presets, Settings)
* - Footswitch bar (8 footswitches with dynamic scribble strips per mode)
* - Tab bar (bottom navigation)
*/
import { useState, useEffect, useCallback } from 'react';
import { usePedalState, fetchPresets, apiPost, apiPut, apiGet, apiUpload } from './pedal/hooks/usePedalState';
import { FootswitchModeProvider } from './pedal/FootswitchModeContext';
import { FootswitchBar } from './pedal/footswitch/FootswitchBar';
import { ModeSelector } from './pedal/footswitch/ModeSelector';
import type { PedalState, PedalBlock, BankData } from './pedal/types';
import './pedal/pedal.css';
const T = {
bg: '#0A0A0C', panel: '#141418', surface: '#1C1C22',
border: '#2A2A32', amber: '#E8A030', blue: '#3A7BA8',
blueDim: '#1E4060', amberDim: '#7A5218',
green: '#3AB87A', red: '#C84040', text: '#F0EDE6',
textSec: '#8888A0', textDim: '#444458',
};
// ── VU Meter ─────────────────────────────────────────────────
function VUMeter({ level = 0, height = 60 }: { level?: number; height?: number }) {
const segs = 12;
const active = Math.round((level / 100) * segs);
const segColor = (i: number) => {
if (i >= 10) return T.red;
if (i >= 8) return '#E8C030';
return T.green;
};
return (
<div style={{ display: 'flex', flexDirection: 'column-reverse', gap: 2, height, alignItems: 'center' }}>
{Array.from({ length: segs }).map((_, i) => (
<div key={i} style={{
width: 6, height: (height - segs * 2) / segs,
borderRadius: 1, background: i < active ? segColor(i) : T.border,
boxShadow: i < active ? `0 0 4px ${segColor(i)}` : 'none',
transition: 'background 0.05s, box-shadow 0.05s',
}} />
))}
</div>
);
}
// ── FX Type Labels ───────────────────────────────────────────
const FX_TYPE_LABELS: Record<string, string> = {
noise_gate: 'Noise Gate', compressor: 'Compressor', boost: 'Boost',
overdrive: 'Overdrive', distortion: 'Distortion', fuzz: 'Fuzz',
eq: 'EQ', chorus: 'Chorus', flanger: 'Flanger', phaser: 'Phaser',
tremolo: 'Tremolo', vibrato: 'Vibrato', delay: 'Delay', reverb: 'Reverb',
volume: 'Volume', nam_amp: 'NAM Amp', ir_cab: 'IR Cab',
octaver: 'Octaver', pitch_shifter: 'Pitch Shifter', harmonizer: 'Harmonizer',
whammy: 'Whammy', detune: 'Detune', ring_modulator: 'Ring Mod',
auto_wah: 'Auto Wah', envelope_filter: 'Env Filter', rotary_speaker: 'Rotary',
uni_vibe: 'Uni-Vibe', auto_pan: 'Auto Pan', stereo_widener: 'Stereo Widener',
bitcrusher: 'Bitcrusher', wavefolder: 'Wavefolder', rectifier: 'Rectifier',
expander: 'Expander', de_esser: 'De-esser', transient_shaper: 'Transient Shaper',
parametric_eq: 'Parametric EQ', high_pass_filter: 'High Pass',
low_pass_filter: 'Low Pass', band_pass_filter: 'Band Pass',
notch_filter: 'Notch Filter', formant_filter: 'Formant Filter',
ping_pong_delay: 'Ping Pong Delay', multi_tap_delay: 'Multi Tap',
reverse_delay: 'Reverse Delay', tape_echo: 'Tape Echo',
shimmer_reverb: 'Shimmer Reverb', early_reflections: 'Early Reflections',
sidechain_compressor: 'Sidechain Comp', looper: 'Looper',
};
// ══════════════════════════════════════════════════════════════
// RIG SCREEN
// ══════════════════════════════════════════════════════════════
function RigScreen({ state, connected }: { state: PedalState | null; connected: boolean; refresh?: () => void }) {
const [volume, setVolume] = useState<number>(
state?.master_volume != null ? Math.round(state.master_volume * 100) : 80
);
const [localBypass, setLocalBypass] = useState<boolean | null>(null);
const [localTuner, setLocalTuner] = useState<boolean | null>(null);
const bypass = localBypass ?? state?.bypass ?? false;
const tuner = localTuner ?? state?.tuner_enabled ?? false;
useEffect(() => {
if (state?.master_volume != null) setVolume(Math.round(state.master_volume * 100));
}, [state?.master_volume]);
useEffect(() => {
if (state?.bypass !== undefined) setLocalBypass(null);
if (state?.tuner_enabled !== undefined) setLocalTuner(null);
}, [state?.bypass, state?.tuner_enabled]);
const handleVolume = async (val: number) => {
setVolume(val);
try { await apiPut('/api/volume', { volume: val / 100 }); } catch {}
};
const handleBypass = async () => {
const next = !bypass;
setLocalBypass(next);
try { await apiPost('/api/bypass', { bypass: next }); } catch { setLocalBypass(null); }
};
const handleTuner = async () => {
const next = !tuner;
setLocalTuner(next);
try { await apiPost('/api/tuner', { enabled: next }); } catch { setLocalTuner(null); }
};
const inputLevel = state?.input_level ?? 0;
const outputLevel = state?.output_level ?? 0;
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div className="screen-header">
<div>
<div style={{ fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase', color: T.textSec }}>Active Rig</div>
<div style={{ display: 'flex', gap: 6, marginTop: 4, flexWrap: 'wrap', alignItems: 'center' }}>
{state?.current_preset ? (
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.amber, border: `1px solid ${T.amber}55`, background: `${T.amber}15`, padding: '3px 8px', borderRadius: 5 }}>
{state.current_preset.name}
</span>
) : (
<span style={{ fontSize: 11, color: T.textDim }}>No preset loaded</span>
)}
{connected ? (
<span className="pedal-badge pedal-badge-green">Connected</span>
) : (
<span className="pedal-badge pedal-badge-red">Offline</span>
)}
</div>
</div>
<div style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
<VUMeter level={inputLevel} height={44} />
<VUMeter level={outputLevel} height={44} />
</div>
</div>
<div style={{ flex: 1, overflowY: 'auto', padding: 12, display: 'flex', flexDirection: 'column', gap: 12 }}>
{/* Status row */}
<div style={{ background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: 12, display: 'flex', gap: 10, justifyContent: 'space-around' }}>
<div style={{ textAlign: 'center' }}>
<div className="section-label">Bypass</div>
<div className={`switch ${bypass ? 'on' : ''}`} onClick={handleBypass} style={{ margin: '0 auto' }} />
</div>
<div style={{ textAlign: 'center' }}>
<div className="section-label">Tuner</div>
<div className={`switch ${tuner ? 'on' : ''}`} onClick={handleTuner} style={{ margin: '0 auto' }} />
</div>
<div style={{ textAlign: 'center' }}>
<div className="section-label">Routing</div>
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 12, color: T.amber }}>{state?.routing_mode || 'mono'}</span>
</div>
</div>
{/* Tuner */}
{tuner && (
<div style={{ background: `${T.amber}15`, border: `1px solid ${T.amber}`, borderRadius: 8, textAlign: 'center', padding: '20px 16px' }}>
<div style={{ fontSize: 32, marginBottom: 8 }}>🎵</div>
<div className="section-label" style={{ color: T.amber, marginBottom: 4, fontSize: 14 }}>TUNER ACTIVE</div>
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 24, color: T.amber, letterSpacing: 4 }}></div>
<div style={{ fontSize: 11, color: T.textDim, marginTop: 8 }}>Tap switch again to exit tuner mode</div>
</div>
)}
{/* Volume */}
<div style={{ background: T.panel, border: `1px solid ${T.border}`, borderRadius: 10, padding: 16, display: 'flex', gap: 20, alignItems: 'center' }}>
<div style={{ flex: 1 }}>
<div className="section-label">Master Volume</div>
<input type="range" min={0} max={100} value={volume}
onChange={e => handleVolume(+e.target.value)}
style={{ width: '100%', accentColor: T.amber }} />
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.amber, marginTop: 4 }}>{volume}%</div>
</div>
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.textSec, textAlign: 'right' }}>
{state?.nam_loaded ? 'NAM: Active' : 'NAM: —'}<br />
{state?.ir_loaded ? 'IR: Active' : 'IR: —'}
</div>
</div>
{/* Signal chain */}
<div style={{ background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: 12 }}>
<div className="section-label">Signal Chain</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 4, overflowX: 'auto', padding: '4px 0' }}>
{['IN', state?.bypass ? 'BYP' : (state?.nam_loaded ? 'NAM' : 'AMP'), state?.ir_loaded ? 'IR' : 'CAB', 'OUT'].map((s, i, arr) => (
<div key={i} style={{ display: 'flex', alignItems: 'center', gap: 4, flexShrink: 0 }}>
<div style={{ padding: '3px 8px', borderRadius: 4, fontSize: 10, fontWeight: 700,
background: i === 0 || i === arr.length - 1 ? T.blueDim : T.amberDim,
color: i === 0 || i === arr.length - 1 ? T.blue : T.amber,
border: `1px solid ${(i === 0 || i === arr.length - 1 ? T.blue : T.amber)}60` }}>{s}</div>
{i < arr.length - 1 && <div style={{ width: 16, height: 2, background: T.border, borderRadius: 1 }} />}
</div>
))}
</div>
</div>
</div>
</div>
);
}
// ══════════════════════════════════════════════════════════════
// FX CHAIN SCREEN
// ══════════════════════════════════════════════════════════════
function FXBlock({ title, type, active = true, bypassed = false }: {
title: string; type: string; active?: boolean; bypassed?: boolean;
}) {
const [open, setOpen] = useState(true);
return (
<div style={{ background: T.panel, border: `1px solid ${active ? T.amber : T.border}`, borderRadius: 10, overflow: 'hidden', opacity: bypassed ? 0.45 : 1 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '10px 12px', borderBottom: `1px solid ${T.border}`, background: T.surface, cursor: 'pointer' }}
onClick={() => setOpen(o => !o)}>
<div style={{ width: 8, height: 8, borderRadius: '50%', background: !bypassed ? T.green : T.textDim, boxShadow: !bypassed ? `0 0 8px ${T.green}` : 'none' }} />
<span style={{ flex: 1, fontSize: 13, fontWeight: 600 }}>{title}</span>
<span className="pedal-badge pedal-badge-blue" style={{ fontSize: 10, padding: '2px 7px' }}>{type}</span>
<span style={{ color: T.textDim, fontSize: 18, marginLeft: 6 }}>{open ? '▾' : '▸'}</span>
</div>
</div>
);
}
function FXScreen({ state, connected }: { state: PedalState | null; connected: boolean }) {
const [fxList, setFxList] = useState<{ id: number; title: string; type: string; bypassed: boolean }[]>([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
if (!connected || !state?.current_preset) { setFxList([]); setLoading(false); return; }
fetchPresets().then(data => {
const banks = data.banks || [];
const cp = state.current_preset;
const preset = cp ? banks[cp.bank]?.presets?.[cp.program] : null;
if (preset?.chain) {
setFxList(preset.chain.map((b, i) => ({
id: i + 1,
title: FX_TYPE_LABELS[b.fx_type] || b.fx_type,
type: b.fx_type,
bypassed: b.bypassed ?? false,
})));
}
setLoading(false);
}).catch(() => { setFxList([]); setLoading(false); });
}, [connected, state]);
if (loading) return <div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}><div className="loader" /></div>;
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div className="screen-header">
<div style={{ fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase', color: T.textSec }}>FX Chain {fxList.length > 0 ? `(${fxList.length})` : ''}</div>
</div>
<div style={{ flex: 1, overflowY: 'auto', padding: 12, display: 'flex', flexDirection: 'column', gap: 12 }}>
{fxList.length === 0 ? (
<div style={{ textAlign: 'center', padding: 30, color: T.textDim, fontSize: 14 }}>No FX blocks in the chain.</div>
) : (
fxList.map(f => <FXBlock key={f.id} {...f} active={!f.bypassed} />)
)}
</div>
</div>
);
}
// ══════════════════════════════════════════════════════════════
// MODELS SCREEN
// ══════════════════════════════════════════════════════════════
function ModelsScreen({ connected, refresh }: { state?: PedalState | null; connected: boolean; refresh: () => void }) {
const [models, setModels] = useState<{ name: string; path?: string; architecture?: string; size_mb?: string; loaded?: boolean }[]>([]);
const [current, setCurrent] = useState<string | null>(null);
const [loading, setLoading] = useState(true);
const [fileRef, setFileRef] = useState<HTMLInputElement | null>(null);
const loadModels = useCallback(async () => {
if (!connected) { setLoading(false); return; }
try {
const data = await apiGet<{ models?: any[]; current?: string }>('/api/models');
setModels(data.models || []);
setCurrent(data.current ?? null);
} catch {}
setLoading(false);
}, [connected]);
useEffect(() => { loadModels(); }, [loadModels]);
const handleLoad = async (path?: string) => {
if (!path) return;
try { await apiPost('/api/models/load', { path }); await loadModels(); refresh(); } catch { alert('Failed to load model'); }
};
const handleUnload = async () => {
try { await apiPost('/api/models/unload'); setCurrent(null); await loadModels(); refresh(); } catch { alert('Failed to unload'); }
};
const handleUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
try { await apiUpload('/api/models/upload', file); await loadModels(); } catch { alert('Upload failed'); }
};
if (loading) return <div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}><div className="loader" /></div>;
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div className="screen-header">
<div style={{ fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase', color: T.textSec }}>NAM Models ({models.length})</div>
<button className="btn btn-primary btn-sm" onClick={() => fileRef?.click()}>+ Upload</button>
<input ref={el => setFileRef(el)} type="file" accept=".nam" style={{ display: 'none' }} onChange={handleUpload} />
</div>
<div style={{ flex: 1, overflowY: 'auto', padding: 12, display: 'flex', flexDirection: 'column', gap: 8 }}>
{current && (
<div style={{ background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: 12 }}>
<div className="section-label">Loaded Model</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.blue, border: `1px solid ${T.blue}55`, background: `${T.blue}15`, padding: '3px 8px', borderRadius: 5 }}>{current}</span>
<button className="btn btn-danger btn-sm" onClick={handleUnload}>Unload</button>
</div>
</div>
)}
{models.length === 0 ? (
<div style={{ textAlign: 'center', padding: 30, color: T.textDim, fontSize: 14 }}>No NAM models found.</div>
) : (
models.map(m => (
<div key={m.name} className="preset-row"
style={{ border: m.loaded ? `1px solid ${T.amber}40` : '1px solid transparent', background: m.loaded ? `${T.amber}08` : 'transparent' }}
onClick={() => !m.loaded && handleLoad(m.path)}>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 13, fontWeight: 500 }}>{m.name}</div>
<div style={{ fontSize: 10, color: T.textDim }}>{m.architecture} · {m.size_mb} MB</div>
</div>
{m.loaded ? <span className="pedal-badge pedal-badge-green">Loaded</span> : <button className="btn btn-ghost btn-sm">Load</button>}
</div>
))
)}
</div>
</div>
);
}
// ══════════════════════════════════════════════════════════════
// IRS SCREEN
// ══════════════════════════════════════════════════════════════
function IRsScreen({ connected, refresh }: { state?: PedalState | null; connected: boolean; refresh: () => void }) {
const [irs, setIrs] = useState<{ name: string; path?: string; sample_rate?: number; length_ms?: number; loaded?: boolean }[]>([]);
const [current, setCurrent] = useState<string | null>(null);
const [loading, setLoading] = useState(true);
const [fileRef, setFileRef] = useState<HTMLInputElement | null>(null);
const loadIrs = useCallback(async () => {
if (!connected) { setLoading(false); return; }
try {
const data = await apiGet<{ irs?: any[]; current?: string }>('/api/irs');
setIrs(data.irs || []);
setCurrent(data.current ?? null);
} catch {}
setLoading(false);
}, [connected]);
useEffect(() => { loadIrs(); }, [loadIrs]);
const handleLoad = async (path?: string) => {
if (!path) return;
try { await apiPost('/api/irs/load', { path }); await loadIrs(); refresh(); } catch { alert('Failed to load IR'); }
};
const handleUnload = async () => {
try { await apiPost('/api/irs/unload'); setCurrent(null); await loadIrs(); refresh(); } catch { alert('Failed to unload'); }
};
const handleUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
try { await apiUpload('/api/irs/upload', file); await loadIrs(); } catch { alert('Upload failed'); }
};
if (loading) return <div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}><div className="loader" /></div>;
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div className="screen-header">
<div style={{ fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase', color: T.textSec }}>IR Files ({irs.length})</div>
<button className="btn btn-primary btn-sm" onClick={() => fileRef?.click()}>+ Upload</button>
<input ref={el => setFileRef(el)} type="file" accept=".wav" style={{ display: 'none' }} onChange={handleUpload} />
</div>
<div style={{ flex: 1, overflowY: 'auto', padding: 12, display: 'flex', flexDirection: 'column', gap: 8 }}>
{current && (
<div style={{ background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: 12 }}>
<div className="section-label">Loaded IR</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.green, border: `1px solid ${T.green}55`, background: `${T.green}15`, padding: '3px 8px', borderRadius: 5 }}>{current}</span>
<button className="btn btn-danger btn-sm" onClick={handleUnload}>Unload</button>
</div>
</div>
)}
{irs.length === 0 ? (
<div style={{ textAlign: 'center', padding: 30, color: T.textDim, fontSize: 14 }}>No IR files found.</div>
) : (
irs.map(ir => (
<div key={ir.name} className="preset-row"
style={{ border: ir.loaded ? `1px solid ${T.amber}40` : '1px solid transparent', background: ir.loaded ? `${T.amber}08` : 'transparent' }}
onClick={() => !ir.loaded && handleLoad(ir.path)}>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 13, fontWeight: 500 }}>{ir.name}</div>
<div style={{ fontSize: 10, color: T.textDim }}>{ir.sample_rate} Hz · {ir.length_ms} ms</div>
</div>
{ir.loaded ? <span className="pedal-badge pedal-badge-green">Loaded</span> : <button className="btn btn-ghost btn-sm">Load</button>}
</div>
))
)}
</div>
</div>
);
}
// ══════════════════════════════════════════════════════════════
// PRESETS SCREEN
// ══════════════════════════════════════════════════════════════
function PresetsScreen({ state, connected, refresh }: { state: PedalState | null; connected: boolean; refresh: () => void }) {
const [banks, setBanks] = useState<BankData[]>([]);
const [selectedBank, setSelectedBank] = useState(0);
const [loading, setLoading] = useState(true);
const loadPresets = useCallback(async () => {
if (!connected) {
setBanks([{ name: 'Default', number: 0, presets: [{ name: 'Edge of Breakup', bank: 0, program: 0 }, { name: 'Modern High Gain', bank: 0, program: 1 }, null, null] }]);
setLoading(false);
return;
}
try {
const data = await fetchPresets();
setBanks(data.banks || []);
} catch {}
setLoading(false);
}, [connected]);
useEffect(() => { loadPresets(); }, [loadPresets]);
const handleActivate = async (bank: number, program: number) => {
try { await apiPost(`/api/presets/${bank}/${program}/activate`); await loadPresets(); refresh(); } catch { alert('Failed to load preset'); }
};
if (loading) return <div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}><div className="loader" /></div>;
const currentPreset = state?.current_preset;
const bankData = banks[selectedBank];
const presets = bankData?.presets || [];
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div className="screen-header">
<div style={{ fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase', color: T.textSec }}>Presets</div>
</div>
<div style={{ flex: 1, overflowY: 'auto', padding: 12, display: 'flex', flexDirection: 'column', gap: 8 }}>
{banks.length > 1 && (
<div style={{ display: 'flex', background: T.surface, borderRadius: 6, border: `1px solid ${T.border}`, overflow: 'hidden' }}>
{banks.map((b, i) => (
<button key={b.number} style={{
flex: 1, padding: '7px 12px', fontSize: 12, fontWeight: 500, letterSpacing: '0.04em',
background: selectedBank === i ? T.amber : 'none', border: 'none',
color: selectedBank === i ? '#000' : T.textSec, cursor: 'pointer', transition: 'all 0.15s',
}} onClick={() => setSelectedBank(i)}>{b.name}</button>
))}
</div>
)}
{currentPreset && (
<div style={{ background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: 12, display: 'flex', alignItems: 'center', gap: 8 }}>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 11, color: T.textDim }}>Current</div>
<div style={{ fontSize: 14, fontWeight: 600, color: T.amber }}>
{currentPreset.name}
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 10, color: T.textDim, marginLeft: 8 }}>Bank {currentPreset.bank} · Prog {currentPreset.program}</span>
</div>
</div>
</div>
)}
{presets.length === 0 ? (
<div style={{ textAlign: 'center', padding: 30, color: T.textDim, fontSize: 14 }}>No presets in this bank.</div>
) : (
presets.map((p, i) => {
if (!p) return null;
const isActive = currentPreset?.bank === p.bank && currentPreset?.program === p.program;
return (
<div key={i} className="preset-row"
style={{ border: isActive ? `1px solid ${T.amber}40` : '1px solid transparent', background: isActive ? `${T.amber}08` : 'transparent' }}
onClick={() => handleActivate(p.bank, p.program)}>
<div style={{
width: 28, height: 28, borderRadius: 6, display: 'flex', alignItems: 'center',
justifyContent: 'center', fontSize: 12, fontWeight: 700,
background: isActive ? `${T.amber}22` : T.surface,
color: isActive ? T.amber : T.textDim,
border: `1px solid ${isActive ? `${T.amber}60` : T.border}`,
fontFamily: "'JetBrains Mono', monospace",
}}>{p.program + 1}</div>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 13, fontWeight: 600 }}>{p.name}</div>
<div style={{ fontSize: 10, color: T.textDim }}>Bank {p.bank} · Program {p.program}</div>
</div>
{isActive && <span style={{ color: T.amber, fontSize: 16 }}></span>}
</div>
);
})
)}
</div>
</div>
);
}
// ══════════════════════════════════════════════════════════════
// SETTINGS SCREEN
// ══════════════════════════════════════════════════════════════
function SettingsScreen({ state: pedalState }: { state: PedalState | null; refresh?: () => void }) {
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div className="screen-header">
<div style={{ fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase', color: T.textSec }}>Settings</div>
</div>
<div style={{ flex: 1, overflowY: 'auto', padding: 12, display: 'flex', flexDirection: 'column', gap: 8 }}>
<div style={{ background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: 12 }}>
<div className="section-label">System</div>
{pedalState?.cpu_percent != null && (
<div className="setting-row">
<span style={{ fontSize: 13 }}>CPU</span>
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.amber }}>{pedalState.cpu_percent}%</span>
</div>
)}
{pedalState?.sample_rate && (
<div className="setting-row">
<span style={{ fontSize: 13 }}>Sample Rate</span>
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, color: T.amber }}>{pedalState.sample_rate / 1000}kHz</span>
</div>
)}
<div className="setting-row" style={{ border: 'none' }}>
<span style={{ fontSize: 13 }}>Connection</span>
<span className="pedal-badge pedal-badge-green">Live</span>
</div>
</div>
</div>
</div>
);
}
// ══════════════════════════════════════════════════════════════
// APP SHELL
// ══════════════════════════════════════════════════════════════
const TABS = [
{ id: 'rig', label: 'Rig', icon: '🎛' },
{ id: 'fx', label: 'FX', icon: '⛓' },
{ id: 'models', label: 'Models', icon: '📁' },
{ id: 'irs', label: 'IRs', icon: '🎚' },
{ id: 'presets', label: 'Presets', icon: '⭐' },
{ id: 'settings', label: 'Settings', icon: '⚙' },
] as const;
type TabId = (typeof TABS)[number]['id'];
// ── Pedal Shell Content (inner component that has context access) ──
function PedalContent() {
const [tab, setTab] = useState<TabId>('rig');
const { state, connected, refresh } = usePedalState();
// Build block list from current preset state
const [blocks, setBlocks] = useState<PedalBlock[]>([]);
const [bankNames, setBankNames] = useState<string[]>(['Default']);
useEffect(() => {
if (connected && state?.current_preset) {
fetchPresets().then(data => {
const names = (data.banks || []).map((b: BankData) => b.name);
if (names.length > 0) setBankNames(names);
const cp = state.current_preset;
if (!cp) return;
const bank = data.banks?.[cp.bank];
const preset = bank?.presets?.[cp.program];
if (preset?.chain) {
setBlocks(preset.chain.map((b, i) => ({
id: i + 1,
fx_type: b.fx_type,
title: FX_TYPE_LABELS[b.fx_type] || b.fx_type,
bypassed: b.bypassed ?? false,
})));
}
}).catch(() => {});
}
}, [connected, state?.current_preset]);
const handleToggleBlock = useCallback(async (blockId: number, newBypass: boolean) => {
setBlocks(prev => prev.map(b => b.id === blockId ? { ...b, bypassed: newBypass } : b));
if (connected) {
try { await apiPost('/api/blocks/toggle', { block_id: blockId, bypass: newBypass }); } catch {}
}
}, [connected]);
// Snapshots (placeholder — will be wired to real API)
const [snapshots] = useState<{ name: string; active: boolean }[]>(
Array.from({ length: 8 }, (_, i) => ({ name: `Snap ${i + 1}`, active: false }))
);
return (
<FootswitchModeProvider
state={state}
connected={connected}
refresh={refresh}
blocks={blocks}
bankNames={bankNames}
snapshots={snapshots}
onToggleBlock={handleToggleBlock}
>
<div className="pedal-shell">
{/* ── Status Bar ── */}
<div className="pedal-statusbar">
<div className="pedal-statusbar-left">
<div className="pedal-led-dot" style={{
background: connected ? T.green : T.red,
boxShadow: connected ? `0 0 6px ${T.green}` : 'none',
}} />
<span className="pedal-brand">PI MULTI-FX</span>
{state?.tuner_enabled && <span className="pedal-badge pedal-badge-amber">TUNER</span>}
</div>
<div className="pedal-statusbar-mid">
<ModeSelector collapsed />
</div>
<div className="pedal-statusbar-right">
{state?.cpu_percent != null && (
<span className="pedal-brand" style={{ color: T.textDim }}>CPU {state.cpu_percent}%</span>
)}
{state?.sample_rate && (
<span className="pedal-brand" style={{ color: T.textDim }}>{state.sample_rate / 1000}kHz</span>
)}
{state?.bypass && <span className="pedal-badge pedal-badge-red">BYP</span>}
{state?.nam_loaded && <span className="pedal-badge pedal-badge-blue">NAM</span>}
{state?.ir_loaded && <span className="pedal-badge pedal-badge-green">IR</span>}
</div>
</div>
{/* ── Screen Area ── */}
<div className="pedal-screen">
{tab === 'rig' && <RigScreen state={state} connected={connected} />}
{tab === 'fx' && <FXScreen state={state} connected={connected} />}
{tab === 'models' && <ModelsScreen connected={connected} refresh={refresh} />}
{tab === 'irs' && <IRsScreen connected={connected} refresh={refresh} />}
{tab === 'presets' && <PresetsScreen state={state} connected={connected} refresh={refresh} />}
{tab === 'settings' && <SettingsScreen state={state} />}
</div>
{/* ── Footswitch Bar ── */}
<FootswitchBar />
{/* ── Tab Bar ── */}
<div className="pedal-tabbar">
{TABS.map(t => (
<div key={t.id} className={`pedal-tab ${tab === t.id ? 'pedal-tab-active' : ''}`} onClick={() => setTab(t.id)}>
<span className="pedal-tab-icon">{t.icon}</span>
{t.label}
</div>
))}
</div>
</div>
</FootswitchModeProvider>
);
}
// ── Root App ─────────────────────────────────────────────────
export default function App() {
useEffect(() => { document.title = 'Pi Multi-FX Pedal'; }, []);
return (
<>
{/* Global styles for inline-styled components */}
<style>{`
.switch { width: 40px; height: 22px; border-radius: 11px; background: ${T.border}; cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; display: inline-block; }
.switch.on { background: ${T.green}; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform 0.15s; }
.switch.on::after { transform: translateX(18px); }
.btn { padding: 10px 18px; border-radius: 7px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; border: none; cursor: pointer; transition: all 0.12s; }
.btn-primary { background: ${T.amber}; color: #000; }
.btn-primary:active { filter: brightness(0.85); transform: scale(0.97); }
.btn-ghost { background: ${T.surface}; color: ${T.text}; border: 1px solid ${T.border}; }
.btn-ghost:active { background: ${T.border}; }
.btn-danger { background: rgba(200,64,64,0.2); color: ${T.red}; border: 1px solid rgba(200,64,64,0.3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.loader { width: 20px; height: 20px; border: 2px solid ${T.border}; border-top-color: ${T.amber}; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.screen-header { padding: 10px 14px 6px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid ${T.border}; flex-shrink: 0; }
.section-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: ${T.textDim}; font-weight: 600; margin-bottom: 8px; }
.preset-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.preset-row:active { background: rgba(232,160,48,0.08); }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid ${T.border}; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: ${T.panel}; }
::-webkit-scrollbar-thumb { background: ${T.border}; border-radius: 2px; }
`}</style>
<PedalContent />
</>
);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.5 KiB

-36
View File
@@ -1,36 +0,0 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const badgeVariants = cva(
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
variants: {
variant: {
default:
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
secondary:
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
destructive:
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
outline: "text-foreground",
},
},
defaultVariants: {
variant: "default",
},
}
)
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
)
}
export { Badge, badgeVariants }
-56
View File
@@ -1,56 +0,0 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline:
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
}
)
Button.displayName = "Button"
export { Button, buttonVariants }
-79
View File
@@ -1,79 +0,0 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"rounded-lg border bg-card text-card-foreground shadow-sm",
className
)}
{...props}
/>
))
Card.displayName = "Card"
const CardHeader = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
))
CardHeader.displayName = "CardHeader"
const CardTitle = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"text-2xl font-semibold leading-none tracking-tight",
className
)}
{...props}
/>
))
CardTitle.displayName = "CardTitle"
const CardDescription = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
CardDescription.displayName = "CardDescription"
const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
))
CardContent.displayName = "CardContent"
const CardFooter = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
))
CardFooter.displayName = "CardFooter"
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
-22
View File
@@ -1,22 +0,0 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className
)}
ref={ref}
{...props}
/>
)
}
)
Input.displayName = "Input"
export { Input }
-158
View File
@@ -1,158 +0,0 @@
import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select"
import { Check, ChevronDown, ChevronUp } from "lucide-react"
import { cn } from "@/lib/utils"
const Select = SelectPrimitive.Root
const SelectGroup = SelectPrimitive.Group
const SelectValue = SelectPrimitive.Value
const SelectTrigger = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Trigger
ref={ref}
className={cn(
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
className
)}
{...props}
>
{children}
<SelectPrimitive.Icon asChild>
<ChevronDown className="h-4 w-4 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
))
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
const SelectScrollUpButton = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
>(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollUpButton
ref={ref}
className={cn(
"flex cursor-default items-center justify-center py-1",
className
)}
{...props}
>
<ChevronUp className="h-4 w-4" />
</SelectPrimitive.ScrollUpButton>
))
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
const SelectScrollDownButton = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
>(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollDownButton
ref={ref}
className={cn(
"flex cursor-default items-center justify-center py-1",
className
)}
{...props}
>
<ChevronDown className="h-4 w-4" />
</SelectPrimitive.ScrollDownButton>
))
SelectScrollDownButton.displayName =
SelectPrimitive.ScrollDownButton.displayName
const SelectContent = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
>(({ className, children, position = "popper", ...props }, ref) => (
<SelectPrimitive.Portal>
<SelectPrimitive.Content
ref={ref}
className={cn(
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
)}
position={position}
{...props}
>
<SelectScrollUpButton />
<SelectPrimitive.Viewport
className={cn(
"p-1",
position === "popper" &&
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
)}
>
{children}
</SelectPrimitive.Viewport>
<SelectScrollDownButton />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
))
SelectContent.displayName = SelectPrimitive.Content.displayName
const SelectLabel = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Label>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Label
ref={ref}
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
{...props}
/>
))
SelectLabel.displayName = SelectPrimitive.Label.displayName
const SelectItem = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Item
ref={ref}
className={cn(
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className
)}
{...props}
>
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectPrimitive.ItemIndicator>
<Check className="h-4 w-4" />
</SelectPrimitive.ItemIndicator>
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
))
SelectItem.displayName = SelectPrimitive.Item.displayName
const SelectSeparator = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Separator
ref={ref}
className={cn("-mx-1 my-1 h-px bg-muted", className)}
{...props}
/>
))
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
export {
Select,
SelectGroup,
SelectValue,
SelectTrigger,
SelectContent,
SelectLabel,
SelectItem,
SelectSeparator,
SelectScrollUpButton,
SelectScrollDownButton,
}
-26
View File
@@ -1,26 +0,0 @@
import * as React from "react"
import * as SliderPrimitive from "@radix-ui/react-slider"
import { cn } from "@/lib/utils"
const Slider = React.forwardRef<
React.ElementRef<typeof SliderPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
>(({ className, ...props }, ref) => (
<SliderPrimitive.Root
ref={ref}
className={cn(
"relative flex w-full touch-none select-none items-center",
className
)}
{...props}
>
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
<SliderPrimitive.Range className="absolute h-full bg-primary" />
</SliderPrimitive.Track>
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
</SliderPrimitive.Root>
))
Slider.displayName = SliderPrimitive.Root.displayName
export { Slider }
-29
View File
@@ -1,29 +0,0 @@
"use client"
import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch"
import { cn } from "@/lib/utils"
const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>,
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
))
Switch.displayName = SwitchPrimitives.Root.displayName
export { Switch }
-55
View File
@@ -1,55 +0,0 @@
"use client"
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
import { cn } from "@/lib/utils"
const Tabs = TabsPrimitive.Root
const TabsList = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.List>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
>(({ className, ...props }, ref) => (
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
className
)}
{...props}
/>
))
TabsList.displayName = TabsPrimitive.List.displayName
const TabsTrigger = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
className
)}
{...props}
/>
))
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
const TabsContent = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className
)}
{...props}
/>
))
TabsContent.displayName = TabsPrimitive.Content.displayName
export { Tabs, TabsList, TabsTrigger, TabsContent }
-31
View File
@@ -1,31 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600&display=swap');
@import "tailwindcss";
@custom-variant dark (&:is(.dark *));
:root {
--background: #0A0A0C;
--foreground: #F0EDE6;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--radius-sm: calc(0.625rem - 4px);
--radius-md: calc(0.625rem - 2px);
--radius-lg: 0.625rem;
--radius-xl: calc(0.625rem + 4px);
}
@layer base {
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
background: var(--background);
color: var(--foreground);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
user-select: none;
-webkit-user-select: none;
overflow: hidden;
}
input, textarea, select { font-family: inherit; }
}
-6
View File
@@ -1,6 +0,0 @@
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
-10
View File
@@ -1,10 +0,0 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)
-369
View File
@@ -1,369 +0,0 @@
/**
* FootswitchMode Context — provides the current mode and mode switching
* to all footswitch components.
*/
import { createContext, useContext, useState, useCallback, useEffect, type ReactNode } from 'react';
import type { FootswitchMode, ScribbleStripData, PedalState, PedalBlock } from './types';
import { apiPost, activatePreset } from "./hooks/usePedalState";
// ── Context Shape ─────────────────────────────────────────────
interface FootswitchModeContextValue {
mode: FootswitchMode;
setMode: (mode: FootswitchMode) => void;
/** Scribble strip data for each footswitch position (07) */
scribbleData: ScribbleStripData[];
/** Handle a footswitch press at a given position */
handleFootswitch: (index: number) => void;
/** Handle secondary action (double-tap / long-press) at a given position */
handleSecondary: (index: number) => void;
/** Current banks/presets for preset mode */
currentBankIndex: number;
currentPresetIndex: number;
setBank: (bank: number) => void;
setPreset: (preset: number) => void;
/** Whether the preset has been modified */
dirty: boolean;
}
const FootswitchModeContext = createContext<FootswitchModeContextValue | null>(null);
// ── Mode-specific scribble strip generators ───────────────────
function stompScribbles(
blocks: PedalBlock[],
_state: PedalState | null,
): ScribbleStripData[] {
const items: ScribbleStripData[] = [];
for (let i = 0; i < 8; i++) {
const block = blocks[i];
if (block) {
items.push({
key: `stomp-${block.id}`,
label: block.title.length > 6 ? block.title.slice(0, 6) : block.title,
sublabel: block.bypassed ? 'BYP' : 'ON',
color: block.bypassed ? 'off' : 'green',
active: !block.bypassed,
bypassed: block.bypassed,
});
} else {
items.push({
key: `stomp-empty-${i}`,
label: '—',
sublabel: '',
color: 'off',
active: false,
bypassed: false,
});
}
}
return items;
}
function presetScribbles(
state: PedalState | null,
bankIndex: number,
bankNames: string[],
): ScribbleStripData[] {
const items: ScribbleStripData[] = [];
// FS 0-1: Bank navigation
items.push({
key: 'bank-down',
label: 'BANK',
sublabel: bankIndex > 0 ? `${bankNames[bankIndex - 1] || ''}` : '—',
color: 'blue',
active: bankIndex > 0,
});
items.push({
key: 'bank-up',
label: 'BANK',
sublabel: bankIndex < bankNames.length - 1 ? `${bankNames[bankIndex + 1] || '+'}` : '—',
color: 'blue',
active: bankIndex < bankNames.length - 1,
});
// FS 2-7: Preset slots
for (let i = 0; i < 6; i++) {
const presetIdx = i;
const isActive = state?.current_preset?.program === presetIdx &&
state?.current_preset?.bank === bankIndex;
items.push({
key: `preset-${presetIdx}`,
label: String(presetIdx + 1),
sublabel: state?.current_preset && state.current_preset.program === presetIdx
? state.current_preset.name : '',
color: isActive ? 'green' : 'off',
active: isActive,
});
}
return items;
}
function snapshotScribbles(
snapshots: { name: string; active: boolean }[],
): ScribbleStripData[] {
const items: ScribbleStripData[] = [];
for (let i = 0; i < 8; i++) {
const snap = snapshots[i];
if (snap) {
items.push({
key: `snapshot-${i}`,
label: snap.name.length > 6 ? snap.name.slice(0, 6) : (snap.name || `Snap ${i + 1}`),
sublabel: snap.active ? 'ACTIVE' : '',
color: snap.active ? 'amber' : 'off',
active: snap.active,
});
} else {
items.push({
key: `snapshot-empty-${i}`,
label: `Snap ${i + 1}`,
sublabel: '',
color: 'off',
active: false,
});
}
}
return items;
}
function comboScribbles(
blocks: PedalBlock[],
state: PedalState | null,
bankNames: string[],
bankIndex: number,
): ScribbleStripData[] {
// Combo = first 4 stomp + bank/preset info on last 4
const stomp = stompScribbles(blocks.slice(0, 4), state);
// FS 4: bank down, FS 5: bank up, FS 6-7: preset select
return [
...stomp.slice(0, 4),
{
key: 'bank-down',
label: 'BANK',
sublabel: bankIndex > 0 ? '▼' : '—',
color: 'blue',
active: bankIndex > 0,
},
{
key: 'bank-up',
label: 'BANK',
sublabel: bankIndex < bankNames.length - 1 ? '▲' : '—',
color: 'blue',
active: bankIndex < bankNames.length - 1,
},
{
key: 'preset-select',
label: state?.current_preset?.name?.slice(0, 6) || '—',
sublabel: state?.current_preset ? `B${bankIndex + 1}` : '',
color: 'amber',
active: true,
},
{
key: 'global-bypass',
label: 'BYP',
sublabel: state?.bypass ? 'ON' : 'OFF',
color: state?.bypass ? 'red' : 'off',
active: !!state?.bypass,
},
];
}
// ── Provider ──────────────────────────────────────────────────
interface FootswitchModeProviderProps {
children: ReactNode;
state: PedalState | null;
connected: boolean;
refresh: () => void;
blocks: PedalBlock[];
bankNames: string[];
/** Current snapshot definitions */
snapshots: { name: string; active: boolean }[];
/** Called when a block toggle needs to happen */
onToggleBlock?: (blockId: number, bypassed: boolean) => void;
}
export function FootswitchModeProvider({
children,
state,
connected,
refresh,
blocks,
bankNames,
snapshots,
onToggleBlock,
}: FootswitchModeProviderProps) {
const [mode, setMode] = useState<FootswitchMode>('stomp');
const [currentBankIndex, setCurrentBankIndex] = useState(() => {
try {
const saved = localStorage.getItem('pedal-footswitch-bank');
return saved !== null ? parseInt(saved, 10) : 0;
} catch {
return 0;
}
});
const [currentPresetIndex, setCurrentPresetIndex] = useState(0);
const [dirty, _setDirty] = useState(false);
// Persist bank index to localStorage
useEffect(() => {
try {
localStorage.setItem('pedal-footswitch-bank', String(currentBankIndex));
} catch { /* quota exceeded or storage disabled */ }
}, [currentBankIndex]);
// Generate scribble data based on mode
let scribbleData: ScribbleStripData[];
switch (mode) {
case 'stomp':
scribbleData = stompScribbles(blocks, state);
break;
case 'preset':
scribbleData = presetScribbles(state, currentBankIndex, bankNames);
break;
case 'snapshot':
scribbleData = snapshotScribbles(snapshots);
break;
case 'combo':
scribbleData = comboScribbles(blocks, state, bankNames, currentBankIndex);
break;
default:
scribbleData = stompScribbles(blocks, state);
}
const handleFootswitch = useCallback((index: number) => {
switch (mode) {
case 'stomp': {
const block = blocks[index];
if (block && onToggleBlock) {
onToggleBlock(block.id, !block.bypassed);
}
break;
}
case 'preset': {
// FS 0 = bank down, FS 1 = bank up, FS 2-7 = presets
if (index === 0) {
setCurrentBankIndex(prev => Math.max(0, prev - 1));
} else if (index === 1) {
setCurrentBankIndex(prev => Math.min(bankNames.length - 1, prev + 1));
} else {
const presetIndex = index - 2;
if (connected) {
activatePreset(currentBankIndex, presetIndex).then(() => refresh());
setCurrentPresetIndex(presetIndex);
}
}
break;
}
case 'snapshot': {
// Recall snapshot at index
if (connected) {
apiPost(`/api/snapshots/${index}/recall`).catch(() => {});
}
break;
}
case 'combo': {
// FS 0-3 = stomp toggles, FS 4 = bank down, FS 5 = bank up,
// FS 6 = open preset browser, FS 7 = global bypass
if (index < 4) {
const block = blocks[index];
if (block && onToggleBlock) {
onToggleBlock(block.id, !block.bypassed);
}
} else if (index === 4) {
setCurrentBankIndex(prev => Math.max(0, prev - 1));
} else if (index === 5) {
setCurrentBankIndex(prev => Math.min(bankNames.length - 1, prev + 1));
} else if (index === 6) {
setMode('preset');
} else if (index === 7) {
if (connected) {
apiPost('/api/bypass', { bypass: !state?.bypass }).catch(() => {});
}
}
break;
}
}
}, [mode, blocks, onToggleBlock, connected, currentBankIndex, bankNames, state, refresh]);
const handleSecondary = useCallback((index: number) => {
// Double-tap / long-press secondary actions per mode
switch (mode) {
case 'stomp': {
// Secondary: toggle tuner on FS 7 (last footswitch), or reset block params
if (index === 7 && connected) {
apiPost('/api/tuner', { enabled: !state?.tuner_enabled }).catch(() => {});
}
break;
}
case 'preset': {
// Secondary on bank switches: jump to first/last bank
if (index === 0) {
setCurrentBankIndex(0);
} else if (index === 1) {
setCurrentBankIndex(bankNames.length - 1);
}
break;
}
case 'snapshot': {
// Secondary: save current state to snapshot
if (connected) {
apiPost(`/api/snapshots/${index}/save`).catch(() => {});
}
break;
}
case 'combo': {
// Secondary on stomp blocks: edit block params (would open param panel)
// Secondary on bypass: enter tuner mode
if (index === 7 && connected) {
apiPost('/api/tuner', { enabled: !state?.tuner_enabled }).catch(() => {});
}
break;
}
}
}, [mode, state, connected, bankNames]);
const setBank = useCallback((bank: number) => {
setCurrentBankIndex(bank);
}, []);
const setPreset = useCallback((preset: number) => {
setCurrentPresetIndex(preset);
if (connected) {
activatePreset(currentBankIndex, preset).then(() => refresh());
}
}, [connected, currentBankIndex, refresh]);
const value: FootswitchModeContextValue = {
mode,
setMode,
scribbleData,
handleFootswitch,
handleSecondary,
currentBankIndex,
currentPresetIndex,
setBank,
setPreset,
dirty,
};
return (
<FootswitchModeContext.Provider value={value}>
{children}
</FootswitchModeContext.Provider>
);
}
// ── Consumer Hook ─────────────────────────────────────────────
export function useFootswitchMode(): FootswitchModeContextValue {
const ctx = useContext(FootswitchModeContext);
if (!ctx) {
throw new Error('useFootswitchMode must be used within a FootswitchModeProvider');
}
return ctx;
}
-41
View File
@@ -1,41 +0,0 @@
/**
* FootswitchBar — the bottom bar of 8 footswitches with scribble strip LCDs.
*
* Renders the appropriate scribble data per mode (handled via FootswitchModeContext).
* Each footswitch supports single-tap (primary action) and double-tap (secondary).
*/
import { useFootswitchMode } from '../FootswitchModeContext';
import { ScribbleStrip } from './ScribbleStrip';
export function FootswitchBar() {
const { scribbleData, handleFootswitch, handleSecondary } = useFootswitchMode();
return (
<div className="footswitch-bar">
{scribbleData.map((sd, i) => (
<div key={sd.key} className="footswitch-slot">
{/* Scribble strip LCD above the switch */}
<ScribbleStrip
data={sd}
onPress={() => handleFootswitch(i)}
onSecondary={() => handleSecondary(i)}
/>
{/* Footswitch button */}
<div
className={`footswitch-btn ${sd.active ? 'footswitch-btn-active' : ''} ${sd.bypassed ? 'footswitch-btn-bypassed' : ''}`}
onClick={() => handleFootswitch(i)}
onContextMenu={(e) => { e.preventDefault(); handleSecondary(i); }}
style={{
'--fs-color': sd.color,
} as React.CSSProperties}
>
<div className="footswitch-ring" />
<div className="footswitch-cap" />
</div>
</div>
))}
</div>
);
}
-56
View File
@@ -1,56 +0,0 @@
/**
* ModeSelector — mode switch buttons shown in the status bar.
* Lets the user cycle between Stomp, Preset, Snapshot, and Combo modes.
*/
import { useFootswitchMode } from '../FootswitchModeContext';
import type { FootswitchMode } from '../types';
import { FOOTSWITCH_MODE_LABELS } from '../types';
const MODES: FootswitchMode[] = ['stomp', 'preset', 'snapshot', 'combo'];
const MODE_ICONS: Record<FootswitchMode, string> = {
stomp: '◉',
preset: '☆',
snapshot: '◆',
combo: '◈',
transport: '▶',
};
interface ModeSelectorProps {
collapsed?: boolean;
}
export function ModeSelector({ collapsed = false }: ModeSelectorProps) {
const { mode, setMode } = useFootswitchMode();
if (collapsed) {
// Compact: just a single click target that cycles
const nextIdx = (MODES.indexOf(mode) + 1) % MODES.length;
return (
<div
className="mode-selector mode-selector-collapsed"
onClick={() => setMode(MODES[nextIdx])}
title={`Mode: ${FOOTSWITCH_MODE_LABELS[mode]} — tap to switch`}
>
<span className="mode-icon">{MODE_ICONS[mode]}</span>
<span className="mode-label">{FOOTSWITCH_MODE_LABELS[mode]}</span>
</div>
);
}
return (
<div className="mode-selector">
{MODES.map(m => (
<button
key={m}
className={`mode-btn ${mode === m ? 'mode-btn-active' : ''}`}
onClick={() => setMode(m)}
title={FOOTSWITCH_MODE_LABELS[m]}
>
<span className="mode-btn-icon">{MODE_ICONS[m]}</span>
<span className="mode-btn-label">{FOOTSWITCH_MODE_LABELS[m]}</span>
</button>
))}
</div>
);
}
-60
View File
@@ -1,60 +0,0 @@
/**
* ScribbleStrip — the LCD-like label display above each footswitch.
*
* Shows block/preset/snapshot name and status, mimicking the
* Helix / Line 6 scribble strip LCDs.
*/
import type { ScribbleStripData } from '../types';
import { SCRIBBLE_COLORS } from '../types';
import { useDoubleTap } from '../hooks/useDoubleTap';
interface ScribbleStripProps {
data: ScribbleStripData;
onPress: () => void;
onSecondary: () => void;
}
export function ScribbleStrip({ data, onPress, onSecondary }: ScribbleStripProps) {
const { handleTap } = useDoubleTap({
onSingleTap: onPress,
onDoubleTap: onSecondary,
});
const color = SCRIBBLE_COLORS[data.color ?? 'off'];
const isActive = data.active ?? false;
const isBypassed = data.bypassed ?? false;
return (
<div
className="scribble-strip"
data-active={isActive}
data-bypassed={isBypassed}
onClick={handleTap}
style={{
'--scribble-color': color,
} as React.CSSProperties}
>
{/* LED indicator */}
<div
className="scribble-led"
style={{
background: color,
boxShadow: isActive ? `0 0 6px ${color}` : 'none',
opacity: isActive ? 1 : 0.25,
}}
/>
{/* Label area — LCD-style */}
<div className="scribble-label-wrap">
<span className="scribble-label">{data.label || '—'}</span>
{data.sublabel && (
<span className="scribble-sublabel">{data.sublabel}</span>
)}
</div>
{/* Icon (optional) */}
{data.icon && <span className="scribble-icon">{data.icon}</span>}
</div>
);
}
-82
View File
@@ -1,82 +0,0 @@
/**
* Double-tap gesture hook for footswitch capacitive touch / secondary actions.
*
* Detects two rapid taps within a configurable threshold and fires
* onDoubleTap. Single taps fire onSingleTap after a short debounce.
*/
import { useRef, useCallback } from 'react';
interface UseDoubleTapOptions {
/** Max ms between taps to count as double-tap (default: 300) */
threshold?: number;
/** Called on single tap after debounce */
onSingleTap?: () => void;
/** Called on double tap */
onDoubleTap?: () => void;
}
export function useDoubleTap({
threshold = 300,
onSingleTap,
onDoubleTap,
}: UseDoubleTapOptions) {
const lastTapRef = useRef(0);
const singleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const handleTap = useCallback(() => {
const now = Date.now();
const sinceLast = now - lastTapRef.current;
if (sinceLast < threshold) {
// Double tap detected
if (singleTimerRef.current) {
clearTimeout(singleTimerRef.current);
singleTimerRef.current = null;
}
lastTapRef.current = 0;
onDoubleTap?.();
} else {
// Potential single tap — wait for double-tap window to close
lastTapRef.current = now;
if (singleTimerRef.current) {
clearTimeout(singleTimerRef.current);
}
singleTimerRef.current = setTimeout(() => {
onSingleTap?.();
singleTimerRef.current = null;
}, threshold);
}
}, [threshold, onSingleTap, onDoubleTap]);
return { handleTap };
}
/**
* Hook for long-press gesture detection.
* Fires onLongPress after `duration` ms of continuous hold.
*/
export function useLongPress({
duration = 500,
onLongPress,
}: {
duration?: number;
onLongPress?: () => void;
}) {
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const handleStart = useCallback(() => {
timerRef.current = setTimeout(() => {
onLongPress?.();
}, duration);
}, [duration, onLongPress]);
const handleEnd = useCallback(() => {
if (timerRef.current) {
clearTimeout(timerRef.current);
timerRef.current = null;
}
}, []);
return { handleStart, handleEnd };
}
-155
View File
@@ -1,155 +0,0 @@
/**
* Pi Multi-FX Pedal — State Hook
*
* API helpers, WebSocket real-time updates, and pedal state management.
* Ported and organized from frontend-react/App.jsx.
*/
import { useState, useRef, useEffect, useCallback } from 'react';
import type { PedalState, PresetListResponse } from '../types';
// ── API Base ──────────────────────────────────────────────────
const API = window.location.origin;
const WS_URL = API.replace(/^http/, 'ws') + '/ws';
// ── API Helpers ───────────────────────────────────────────────
export async function apiGet<T>(path: string): Promise<T> {
const r = await fetch(`${API}${path}`);
if (!r.ok) throw new Error(`${path} => ${r.status}`);
return r.json();
}
export async function apiPost<T>(path: string, data?: unknown): Promise<T> {
const r = await fetch(`${API}${path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: data != null ? JSON.stringify(data) : undefined,
});
if (!r.ok) throw new Error(`${path} => ${r.status}`);
return r.json();
}
export async function apiPut<T>(path: string, data: unknown): Promise<T> {
const r = await fetch(`${API}${path}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
});
if (!r.ok) throw new Error(`${path} => ${r.status}`);
return r.json();
}
export async function apiDelete<T>(path: string): Promise<T> {
const r = await fetch(`${API}${path}`, { method: 'DELETE' });
if (!r.ok) throw new Error(`${path} => ${r.status}`);
return r.json();
}
export async function apiUpload<T>(path: string, file: File): Promise<T> {
const fd = new FormData();
fd.append('file', file);
const r = await fetch(`${API}${path}`, { method: 'POST', body: fd });
if (!r.ok) throw new Error(`${path} => ${r.status}`);
return r.json();
}
// ── usePedalState Hook ────────────────────────────────────────
export interface PedalStateResult {
state: PedalState | null;
connected: boolean;
refresh: () => void;
}
export function usePedalState(): PedalStateResult {
const [state, setState] = useState<PedalState | null>(null);
const [connected, setConnected] = useState(false);
const wsRef = useRef<WebSocket | null>(null);
const pollRef = useRef<ReturnType<typeof setInterval> | null>(null);
useEffect(() => {
// Fetch initial state
apiGet<PedalState>('/api/state')
.then(s => { setState(s); setConnected(true); })
.catch(() => { setConnected(false); });
// WebSocket for real-time updates
let reconnectTimer: ReturnType<typeof setTimeout>;
function connect() {
try {
const ws = new WebSocket(WS_URL);
ws.onmessage = (e) => {
try {
const msg = JSON.parse(e.data);
if (msg.type === 'connected' || msg.type === 'state') {
setState(msg.state);
setConnected(true);
}
if (msg.type === 'preset_changed' && msg.state) setState(msg.state);
if (msg.type === 'bypass_changed') {
setState(prev => prev ? { ...prev, bypass: msg.bypass } : prev);
}
if (msg.type === 'tuner_changed') {
setState(prev => prev ? { ...prev, tuner_enabled: msg.tuner_enabled } : prev);
}
if (msg.type === 'routing_changed') {
setState(prev => prev ? {
...prev,
routing_mode: msg.routing_mode,
routing_breakpoint: msg.routing_breakpoint,
} : prev);
}
if (msg.type === 'model_loaded' || msg.type === 'ir_loaded') {
apiGet<PedalState>('/api/state').then(s => setState(s));
}
} catch {
// ignore parse errors
}
};
ws.onclose = () => {
setConnected(false);
reconnectTimer = setTimeout(connect, 3000);
};
ws.onerror = () => ws.close();
wsRef.current = ws;
} catch {
reconnectTimer = setTimeout(connect, 3000);
}
}
connect();
// Polling fallback every 5s
pollRef.current = setInterval(() => {
apiGet<PedalState>('/api/state')
.then(s => { setState(s); setConnected(true); })
.catch(() => {});
}, 5000);
return () => {
if (pollRef.current) clearInterval(pollRef.current);
clearTimeout(reconnectTimer);
if (wsRef.current) wsRef.current.close();
};
}, []);
const refresh = useCallback(() => {
apiGet<PedalState>('/api/state')
.then(s => { setState(s); setConnected(true); })
.catch(() => {});
}, []);
return { state, connected, refresh };
}
// ── Preset helpers ────────────────────────────────────────────
export async function fetchPresets(): Promise<PresetListResponse> {
return apiGet<PresetListResponse>('/api/presets');
}
export async function activatePreset(bank: number, program: number): Promise<void> {
await apiPost(`/api/presets/${bank}/${program}/activate`);
}
-447
View File
@@ -1,447 +0,0 @@
/* ══════════════════════════════════════════════════════════════
Pi Multi-FX Pedal — Styles
Dark pedal theme with Helix-inspired footswitch bar
══════════════════════════════════════════════════════════════ */
/* ── Design Tokens ─────────────────────────────────────────── */
:root {
--pedal-bg: #0A0A0C;
--pedal-panel: #141418;
--pedal-surface: #1C1C22;
--pedal-border: #2A2A32;
--pedal-border-light: #3A3A48;
--pedal-amber: #E8A030;
--pedal-amber-dim: #7A5218;
--pedal-blue: #3A7BA8;
--pedal-blue-dim: #1E4060;
--pedal-green: #3AB87A;
--pedal-green-dim: #1E6040;
--pedal-red: #C84040;
--pedal-red-dim: #602020;
--pedal-purple: #9B59B6;
--pedal-cyan: #1ABC9C;
--pedal-text: #F0EDE6;
--pedal-text-sec: #8888A0;
--pedal-text-dim: #444458;
--pedal-radius: 0.625rem;
--pedal-fs-height: 80px;
}
/* ── Status Bar ────────────────────────────────────────────── */
.pedal-statusbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 12px 4px;
background: var(--pedal-panel);
border-bottom: 1px solid var(--pedal-border);
flex-shrink: 0;
gap: 8px;
min-height: 32px;
}
.pedal-statusbar-left,
.pedal-statusbar-right {
display: flex;
align-items: center;
gap: 6px;
}
.pedal-statusbar-mid {
display: flex;
align-items: center;
gap: 4px;
flex: 1;
justify-content: center;
}
.pedal-brand {
font-family: 'JetBrains Mono', 'SF Mono', monospace;
font-size: 9px;
color: var(--pedal-text-sec);
letter-spacing: 0.08em;
text-transform: uppercase;
}
/* ── Mode Selector ─────────────────────────────────────────── */
.mode-selector {
display: flex;
gap: 2px;
background: var(--pedal-surface);
border-radius: 6px;
border: 1px solid var(--pedal-border);
overflow: hidden;
}
.mode-selector-collapsed {
display: flex;
align-items: center;
gap: 4px;
padding: 4px 8px;
cursor: pointer;
border-radius: 5px;
background: var(--pedal-surface);
border: 1px solid var(--pedal-border);
transition: background 0.15s;
}
.mode-selector-collapsed:hover {
background: var(--pedal-border);
}
.mode-btn {
flex: 1;
display: flex;
align-items: center;
gap: 3px;
padding: 5px 7px;
font-size: 10px;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
background: none;
border: none;
color: var(--pedal-text-dim);
cursor: pointer;
transition: all 0.12s;
white-space: nowrap;
}
.mode-btn:hover {
color: var(--pedal-text-sec);
}
.mode-btn-active {
background: var(--pedal-amber-dim);
color: var(--pedal-amber) !important;
}
.mode-btn-icon {
font-size: 11px;
}
.mode-icon {
font-size: 12px;
color: var(--pedal-amber);
}
.mode-label {
font-size: 10px;
color: var(--pedal-text-sec);
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
}
/* ── Badge chips in status bar ─────────────────────────────── */
.pedal-badge {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 1px 5px;
border-radius: 3px;
font-size: 8px;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.pedal-badge-amber {
background: rgba(232, 160, 48, 0.2);
color: var(--pedal-amber);
}
.pedal-badge-green {
background: rgba(58, 184, 122, 0.2);
color: var(--pedal-green);
}
.pedal-badge-red {
background: rgba(200, 64, 64, 0.2);
color: var(--pedal-red);
}
.pedal-badge-blue {
background: rgba(58, 123, 168, 0.2);
color: var(--pedal-blue);
}
/* ── Status LED dot ────────────────────────────────────────── */
.pedal-led-dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex-shrink: 0;
}
/* ── Footswitch Bar ────────────────────────────────────────── */
.footswitch-bar {
display: flex;
gap: 3px;
padding: 4px 6px 6px;
background: var(--pedal-panel);
border-top: 1px solid var(--pedal-border);
flex-shrink: 0;
justify-content: center;
}
.footswitch-slot {
display: flex;
flex-direction: column;
align-items: center;
gap: 3px;
flex: 1;
min-width: 0;
max-width: 56px;
}
/* ── Scribble Strip ────────────────────────────────────────── */
.scribble-strip {
display: flex;
flex-direction: column;
align-items: center;
gap: 1px;
width: 100%;
padding: 3px 2px;
background: #0D0D10;
border: 1px solid var(--pedal-border);
border-radius: 3px;
cursor: pointer;
transition: border-color 0.15s;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.scribble-strip[data-active="true"] {
border-color: var(--scribble-color, var(--pedal-amber));
}
.scribble-strip[data-bypassed="true"] {
opacity: 0.5;
}
.scribble-led {
width: 4px;
height: 4px;
border-radius: 50%;
flex-shrink: 0;
transition: opacity 0.15s;
margin-bottom: 1px;
}
.scribble-label-wrap {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
min-height: 22px;
justify-content: center;
}
.scribble-label {
font-family: 'JetBrains Mono', 'SF Mono', monospace;
font-size: 8px;
font-weight: 600;
color: var(--pedal-text);
text-align: center;
line-height: 1.1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.scribble-sublabel {
font-family: 'JetBrains Mono', 'SF Mono', monospace;
font-size: 6.5px;
color: var(--scribble-color, var(--pedal-text-sec));
text-align: center;
line-height: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.scribble-icon {
font-size: 9px;
line-height: 1;
}
/* ── Footswitch Button ─────────────────────────────────────── */
.footswitch-btn {
position: relative;
width: 42px;
height: 42px;
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
transition: transform 0.08s;
}
.footswitch-btn:active {
transform: scale(0.93);
}
.footswitch-ring {
position: absolute;
inset: 0;
border-radius: 50%;
border: 2.5px solid var(--pedal-border);
background: radial-gradient(circle at 40% 35%, #2A2A38, #141418);
transition: border-color 0.12s, box-shadow 0.12s;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.footswitch-btn-active .footswitch-ring {
border-color: var(--fs-color, var(--pedal-green));
box-shadow:
0 2px 6px rgba(0, 0, 0, 0.5),
inset 0 1px 0 rgba(255, 255, 255, 0.06),
0 0 8px var(--fs-color, var(--pedal-green));
}
.footswitch-btn-bypassed .footswitch-ring {
opacity: 0.5;
border-color: var(--pedal-text-dim);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.footswitch-cap {
position: absolute;
inset: 8px;
border-radius: 50%;
background: radial-gradient(circle at 38% 32%, #3A3A48, #1A1A22);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.08),
inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.footswitch-cap::after {
content: '';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 8px;
height: 8px;
border-radius: 50%;
background: radial-gradient(circle at 50% 35%, #5A5A6A, #2A2A38);
}
/* ── Tab bar (existing, aligned) ───────────────────────────── */
.pedal-tabbar {
display: flex;
background: var(--pedal-panel);
border-top: 1px solid var(--pedal-border);
flex-shrink: 0;
}
.pedal-tab {
flex: 1;
padding: 8px 4px 6px;
font-size: 9px;
font-weight: 500;
letter-spacing: 0.04em;
text-align: center;
text-transform: uppercase;
color: var(--pedal-text-dim);
cursor: pointer;
border-top: 2px solid transparent;
transition: all 0.12s;
user-select: none;
}
.pedal-tab-active {
color: var(--pedal-amber);
border-top-color: var(--pedal-amber);
}
.pedal-tab-icon {
font-size: 13px;
display: block;
margin-bottom: 1px;
}
/* ── Screen Area ───────────────────────────────────────────── */
.pedal-screen {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 420px) {
.footswitch-bar {
padding: 3px 3px 5px;
gap: 2px;
}
.footswitch-slot {
max-width: 48px;
}
.footswitch-btn {
width: 36px;
height: 36px;
}
.footswitch-cap {
inset: 6px;
}
.footswitch-cap::after {
width: 6px;
height: 6px;
}
.scribble-label {
font-size: 7px;
}
.mode-btn {
padding: 3px 5px;
font-size: 9px;
}
.mode-btn-label {
display: none;
}
}
/* ── Pedal Shell ───────────────────────────────────────────── */
.pedal-shell {
width: 100%;
max-width: 440px;
margin: 0 auto;
height: 100dvh;
display: flex;
flex-direction: column;
background: var(--pedal-bg);
color: var(--pedal-text);
overflow: hidden;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
@media (min-width: 441px) {
.pedal-shell {
border-left: 1px solid var(--pedal-border);
border-right: 1px solid var(--pedal-border);
}
}
-164
View File
@@ -1,164 +0,0 @@
/**
* Pi Multi-FX Pedal — Type Definitions
*
* Core types for footswitch modes, pedal state, and UI components.
*/
// ── Footswitch Modes ──────────────────────────────────────────
export type FootswitchMode = 'stomp' | 'preset' | 'snapshot' | 'combo' | 'transport';
export const FOOTSWITCH_MODES: FootswitchMode[] = ['stomp', 'preset', 'snapshot', 'combo'];
export const FOOTSWITCH_MODE_LABELS: Record<FootswitchMode, string> = {
stomp: 'Stomp',
preset: 'Preset',
snapshot: 'Snapshot',
combo: 'Combo',
transport: 'Transport',
};
// ── Scribble Strip ────────────────────────────────────────────
export interface ScribbleStripData {
/** Main label shown on the strip (uppercase track name) */
label: string;
/** Optional secondary line below the label */
sublabel?: string;
/** LED color for the footswitch ring / indicator */
color?: ScribbleColor;
/** Whether the footswitch is active/enabled */
active?: boolean;
/** Whether the block is bypassed (stomp mode) */
bypassed?: boolean;
/** Unique key for this footswitch */
key: string;
/** Optional icon */
icon?: string;
}
export type ScribbleColor =
| 'amber'
| 'green'
| 'red'
| 'blue'
| 'purple'
| 'cyan'
| 'white'
| 'off';
export const SCRIBBLE_COLORS: Record<ScribbleColor, string> = {
amber: '#E8A030',
green: '#3AB87A',
red: '#C84040',
blue: '#3A7BA8',
purple: '#9B59B6',
cyan: '#1ABC9C',
white: '#F0EDE6',
off: '#444458',
};
// ── Footswitch Action ─────────────────────────────────────────
export type FootswitchAction =
| { type: 'toggle_block'; blockId: string }
| { type: 'bank_up' }
| { type: 'bank_down' }
| { type: 'select_preset'; bank: number; program: number }
| { type: 'recall_snapshot'; snapshotIndex: number }
| { type: 'global_bypass' }
| { type: 'tap_tempo' }
| { type: 'tuner' }
| { type: 'bank_select'; bank: number };
// ── Pedal State (from API) ────────────────────────────────────
export interface PedalState {
master_volume?: number;
bypass?: boolean;
tuner_enabled?: boolean;
cpu_percent?: number;
sample_rate?: number;
nam_loaded?: boolean;
nam_model?: string;
ir_loaded?: boolean;
ir_name?: string;
current_preset?: { name: string; bank: number; program: number };
input_level?: number;
output_level?: number;
routing_mode?: string;
routing_breakpoint?: number;
wifi?: {
connected: boolean;
ssid?: string;
ip?: string;
signal?: number;
hotspot_active: boolean;
hotspot_ssid?: string;
};
bluetooth?: {
powered: boolean;
discoverable: boolean;
midi_enabled: boolean;
name?: string;
address?: string;
};
blocks?: PedalBlock[];
}
export interface PedalBlock {
id: number;
fx_type: string;
title: string;
bypassed: boolean;
params?: BlockParam[];
}
export interface BlockParam {
name: string;
key: string;
default?: number;
min?: number;
max?: number;
}
// ── Preset Data ───────────────────────────────────────────────
export interface PresetData {
name: string;
bank: number;
program: number;
chain?: PedalBlock[];
}
export interface BankData {
name: string;
number: number;
presets: (PresetData | null)[];
}
export interface PresetListResponse {
banks: BankData[];
}
// ── Snapshot ──────────────────────────────────────────────────
export interface SnapshotData {
name: string;
index: number;
/** Block bypass states at snapshot time */
blockStates: Record<number, boolean>;
/** Parameter values at snapshot time (blockId -> paramKey -> value) */
paramValues: Record<number, Record<string, number>>;
}
// ── WebSocket Messages ────────────────────────────────────────
export type WsMessage =
| { type: 'connected'; state: PedalState }
| { type: 'state'; state: PedalState }
| { type: 'preset_changed'; state: PedalState }
| { type: 'bypass_changed'; bypass: boolean }
| { type: 'tuner_changed'; tuner_enabled: boolean }
| { type: 'routing_changed'; routing_mode: string; routing_breakpoint: number }
| { type: 'model_loaded' }
| { type: 'ir_loaded' };
-30
View File
@@ -1,30 +0,0 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023", "DOM"],
"module": "esnext",
"types": ["vite/client"],
"skipLibCheck": true,
"ignoreDeprecations": "6.0",
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
-7
View File
@@ -1,7 +0,0 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
-24
View File
@@ -1,24 +0,0 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023"],
"module": "esnext",
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["vite.config.ts"]
}
-23
View File
@@ -1,23 +0,0 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
export default defineConfig({
base: '/ui/',
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
proxy: {
'/api': 'http://pedal.local:8080',
'/ws': {
target: 'ws://pedal.local:8080',
ws: true,
},
},
},
})