From fe253d5ae2b0c98f8861816e0106f3fcc4f7ea61 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 28 Oct 2026 11:05:02 +0100 Subject: [PATCH 01/19] fix: align top bar and sidebar --- src/components/Sidebar/Sidebar.css | 6 +---- src/components/Topbar/Topbar.css | 38 ++++++++++++++++-------------- src/variables.css | 2 ++ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/components/Sidebar/Sidebar.css b/src/components/Sidebar/Sidebar.css index 03853b9..872b549 100644 --- a/src/components/Sidebar/Sidebar.css +++ b/src/components/Sidebar/Sidebar.css @@ -462,14 +462,10 @@ bottom: 0; padding-bottom: var(--safe-bottom); padding-left: var(--safe-left); - width: calc(var(--sidebar-width-collapsed) + var(--safe-left)); + width: var(--sidebar-rail-w); } - - /* Expanded = drawer on top of the content, not pushing it */ .sidebar-rail--expanded { width: calc(var(--sidebar-width-expanded) + var(--safe-left)); - z-index: 50; - box-shadow: 8px 0 24px rgba(0, 0, 0, 0.45); } .app-root--sidebar-expanded .sidebar-backdrop { diff --git a/src/components/Topbar/Topbar.css b/src/components/Topbar/Topbar.css index bd6bf5b..b4c9c75 100644 --- a/src/components/Topbar/Topbar.css +++ b/src/components/Topbar/Topbar.css @@ -309,27 +309,29 @@ } } -@media (max-width: 768px) { +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .topbar { - --header-height: 56px; - --tab-height: 40px; - gap: var(--space-2); - padding-inline: var(--space-2); - } + /* delete: --header-height: 56px; (it differs from the sidebar's 3.1rem) */ + --tab-height: 40px; + --logo-size: 2.2rem; + gap: 0; + padding-left: 0; + padding-right: var(--space-2); +} - .logo-slot { - height: 70%; - flex: 0 0 auto; - } +/* Logo centred in the rail area; tabstrip's border-left lands exactly on the sidebar's right border */ +.logo-slot { + flex: 0 0 auto; + height: var(--logo-size); + width: var(--logo-size); + margin-left: calc(var(--safe-left) + (var(--sidebar-width-collapsed) - 1px - var(--logo-size)) / 2); + margin-right: calc((var(--sidebar-width-collapsed) - 1px - var(--logo-size)) / 2); +} - .tabstrip { - gap: var(--space-2); - padding-left: var(--space-2); - scroll-snap-type: x mandatory; - scrollbar-width: none; - -webkit-overflow-scrolling: touch; - overscroll-behavior-x: contain; - } +.tabstrip { + margin-right: var(--space-2); /* replaces the gap we removed */ + /* keep your existing gap / padding-left / scroll rules here */ +} .tabstrip::-webkit-scrollbar { display: none; } diff --git a/src/variables.css b/src/variables.css index 5f15e12..464847c 100644 --- a/src/variables.css +++ b/src/variables.css @@ -87,6 +87,7 @@ /* ---------- SideBar ---------- */ --sidebar-width-collapsed: calc(var(--header-height) * 0.85 + 2 * var(--space-3)); --sidebar-width-expanded: 11rem; + --sidebar-rail-w: var(--sidebar-width-collapsed); /* ---------- DSP ---------- */ --dsp-control-heigth: 40%; @@ -106,6 +107,7 @@ --tab-height: 2.2rem; --sidebar-width-collapsed: 3.1rem; --sidebar-width-expanded: min(80vw, 15.5rem); + --sidebar-rail-w: calc(var(--sidebar-width-collapsed) + var(--safe-left)); --touch-target: 2.45rem; } } \ No newline at end of file From 3be7cff6b4f25735b279bc96ff54f9376c157888 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 28 Oct 2026 11:20:50 +0100 Subject: [PATCH 02/19] fix: sidebar items for mobile --- src/components/Sidebar/Sidebar.css | 295 ++++++++++++++--------------- 1 file changed, 139 insertions(+), 156 deletions(-) diff --git a/src/components/Sidebar/Sidebar.css b/src/components/Sidebar/Sidebar.css index 872b549..3280fbe 100644 --- a/src/components/Sidebar/Sidebar.css +++ b/src/components/Sidebar/Sidebar.css @@ -5,6 +5,7 @@ top: var(--topbar-h); left: 0; bottom: 0; + z-index: 30; width: var(--sidebar-width-collapsed); @@ -14,9 +15,7 @@ background: var(--bg-void); border-right: var(--border-width) solid var(--border-hairline); - z-index: 30; overflow: visible; - transition: width var(--dur-base) var(--ease-standard); user-select: none; @@ -53,15 +52,14 @@ aspect-ratio: 1; height: calc(var(--header-height) * 0.7); + padding: 0; border: var(--border-width-active) solid transparent; border-radius: var(--radius-pill); background: var(--bg-void); color: var(--text-muted); - cursor: pointer; - padding: 0; transition: background var(--dur-base) var(--ease-standard), @@ -85,6 +83,8 @@ transform: rotate(180deg); } +/* ---------- App combobox ---------- */ + .sidebar-app-combobox { position: relative; flex: 1 1 auto; @@ -106,13 +106,9 @@ transition-delay: var(--dur-fast); } -.sidebar-app-trigger { +.sidebar-app-trigger, +.sidebar-app-input { width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - gap: var(--space-2); - height: calc(var(--header-height) * 0.6); padding: 0 var(--space-2); @@ -124,6 +120,13 @@ font-family: var(--font-ui); font-size: var(--font-xs); font-weight: var(--font-weight-semibold); +} + +.sidebar-app-trigger { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-2); cursor: pointer; transition: border-color var(--dur-base) var(--ease-standard); @@ -134,6 +137,11 @@ border-color: var(--accent-brand); } +.sidebar-app-input { + border-color: var(--accent-brand); + outline: none; +} + .sidebar-app-trigger-label { overflow: hidden; text-overflow: ellipsis; @@ -150,23 +158,6 @@ transform: rotate(180deg); } -.sidebar-app-input { - width: 100%; - height: calc(var(--header-height) * 0.6); - padding: 0 var(--space-2); - - background: var(--bg-panel); - border: var(--border-width) solid var(--accent-brand); - border-radius: var(--radius-sm); - - color: var(--text-primary); - font-family: var(--font-ui); - font-size: var(--font-xs); - font-weight: var(--font-weight-semibold); - - outline: none; -} - .sidebar-app-listbox { position: absolute; top: calc(100% + var(--space-1)); @@ -206,17 +197,14 @@ color: var(--accent-brand); font-weight: var(--font-weight-semibold); } -.sidebar-rail--expanded .sidebar-app-select { - opacity: 1; - max-width: 200px; - padding-inline: var(--space-2); - pointer-events: auto; - transition-delay: var(--dur-fast); -} /* ---------- Scroll ---------- */ .sidebar-scroll { + /* Fade sizes are toggled by data-fade-top / data-fade-bottom */ + --fade-top: 0px; + --fade-bottom: 0px; + flex: 1 1 auto; min-height: 0; @@ -228,8 +216,28 @@ padding-block: var(--space-1) var(--space-3); overflow-y: auto; - -webkit-mask-image: linear-gradient(to bottom, transparent, black 0); - mask-image: linear-gradient(to bottom, transparent, black 0); + -webkit-mask-image: linear-gradient( + to bottom, + transparent, + black var(--fade-top), + black calc(100% - var(--fade-bottom)), + transparent + ); + mask-image: linear-gradient( + to bottom, + transparent, + black var(--fade-top), + black calc(100% - var(--fade-bottom)), + transparent + ); +} + +.sidebar-scroll[data-fade-top='true'] { + --fade-top: 24px; +} + +.sidebar-scroll[data-fade-bottom='true'] { + --fade-bottom: 24px; } .sidebar-rail--expanded .sidebar-scroll { @@ -237,54 +245,26 @@ padding-inline: var(--space-2); } -.sidebar-scroll[data-fade-top='true'] { - -webkit-mask-image: linear-gradient( - to bottom, - transparent, - black 24px, - black calc(100% - 24px), - black - ); - mask-image: linear-gradient(to bottom, transparent, black 24px, black calc(100% - 24px), black); -} -.sidebar-scroll[data-fade-bottom='true'] { - -webkit-mask-image: linear-gradient(to bottom, black, black calc(100% - 24px), transparent); - mask-image: linear-gradient(to bottom, black, black calc(100% - 24px), transparent); -} -.sidebar-scroll[data-fade-top='true'][data-fade-bottom='true'] { - -webkit-mask-image: linear-gradient( - to bottom, - transparent, - black 24px, - black calc(100% - 24px), - transparent - ); - mask-image: linear-gradient( - to bottom, - transparent, - black 24px, - black calc(100% - 24px), - transparent - ); -} - /* ---------- Item ---------- */ -.sidebar-item { +.sidebar-item, +.sidebar-item--editing { display: flex; align-items: center; justify-content: center; + flex: 0 0 auto; /* never shrink: let the list scroll instead */ gap: var(--sidebar-item-gap); aspect-ratio: 1; height: calc(var(--header-height) * 0.7); +} +.sidebar-item { border: var(--border-width-active) solid transparent; border-radius: var(--radius-lg); background: transparent; color: var(--text-muted); - cursor: pointer; transition: @@ -296,7 +276,7 @@ .sidebar-item:hover { background: var(--bg-raised); color: var(--text-primary); - border: var(--border-width-active) solid var(--accent-brand); + border-color: var(--accent-brand); } .sidebar-item--active { @@ -310,6 +290,47 @@ padding-inline: var(--space-2); } +/* Editing state */ + +.sidebar-item--editing { + padding: 0; + border: none; + background: transparent; +} + +.sidebar-item-input { + width: 0; + flex: 1 1 auto; + min-width: 0; + max-width: 0; + + appearance: none; + -webkit-appearance: none; + background: transparent; + border: none; + outline: none; + box-shadow: none; + + text-align: center; + + color: var(--text-primary); + font-family: var(--font-ui); + font-size: var(--font-sm); + font-weight: var(--font-weight-semibold); + + opacity: 0; + + transition: + opacity var(--dur-fast) var(--ease-standard), + max-width var(--dur-base) var(--ease-standard); +} + +.sidebar-rail--expanded .sidebar-item-input { + width: auto; + max-width: 200px; + opacity: 1; +} + /* ---------- Icon ---------- */ .sidebar-icon { @@ -335,15 +356,15 @@ /* ---------- Label ---------- */ .sidebar-label { + flex: 1 1 auto; + min-width: 0; + max-width: 0; + font-size: var(--font-sm); white-space: nowrap; overflow: hidden; - flex: 1 1 auto; - min-width: 0; - opacity: 0; - max-width: 0; transition: opacity var(--dur-fast) var(--ease-standard), @@ -351,11 +372,11 @@ } .sidebar-rail--expanded .sidebar-label { - opacity: 1; max-width: 200px; + opacity: 1; } -/* ---------- Content ---------- */ +/* ---------- Content offset ---------- */ .stage--with-sidebar { margin-left: var(--sidebar-width-collapsed); @@ -366,58 +387,7 @@ margin-left: var(--sidebar-width-expanded); } -/* ---------- Item (editing state) ---------- */ - -.sidebar-item--editing { - display: flex; - align-items: center; - justify-content: center; - gap: var(--sidebar-item-gap); - - aspect-ratio: 1; - height: calc(var(--header-height) * 0.7); - - border: none; - - background: transparent; - padding: 0; -} - -.sidebar-item-input { - width: 0; - flex: 1 1 auto; - min-width: 0; - - appearance: none; - -webkit-appearance: none; - background: transparent; - border: none; - outline: none; - box-shadow: none; - - text-align: center; - - color: var(--text-primary); - font-family: var(--font-ui); - font-size: var(--font-sm); - font-weight: var(--font-weight-semibold); - - opacity: 0; - max-width: 0; - - transition: - opacity var(--dur-fast) var(--ease-standard), - max-width var(--dur-base) var(--ease-standard); -} - -.sidebar-rail--expanded .sidebar-item-input { - width: auto; - opacity: 1; - max-width: 200px; - border: none; -} - -/* ---------- Phone / touch ---------- */ +/* ---------- Touch devices ---------- */ .sidebar-backdrop { display: none; @@ -444,26 +414,28 @@ } @media (pointer: coarse) { - /* Cancel the global 44px min-height, sizes are set explicitly below */ + /* Cancel the global 44px min-height; sizes are set explicitly below */ .sidebar-rail button { min-height: 0; } - /* No iOS/Android callout menu on long-press (we use it for rename) */ + /* No iOS/Android callout menu on long-press (used for rename) */ .sidebar-item, .sidebar-app-trigger { -webkit-touch-callout: none; } } -@media (max-width: 768px) { +/* ---------- Phone (portrait + landscape) ---------- */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .sidebar-rail { - top: var(--topbar-h); - bottom: 0; + z-index: 50; /* above .sidebar-backdrop (45) */ padding-bottom: var(--safe-bottom); padding-left: var(--safe-left); width: var(--sidebar-rail-w); } + .sidebar-rail--expanded { width: calc(var(--sidebar-width-expanded) + var(--safe-left)); } @@ -475,8 +447,8 @@ left: 0; right: 0; bottom: 0; - background: rgba(0, 0, 0, 0.5); z-index: 45; + background: rgba(0, 0, 0, 0.5); } .sidebar-scroll { @@ -484,46 +456,57 @@ -webkit-overflow-scrolling: touch; } - /* Touch-sized items */ - .sidebar-item, - .sidebar-item--editing { - height: var(--touch-target); + /* Items: touch-sized, grow with content, fixed-size icon. + `.sidebar-rail` prefix beats `.sidebar-rail button { min-height: 0 }` */ + .sidebar-rail .sidebar-item, + .sidebar-rail .sidebar-item--editing { + aspect-ratio: auto; + height: auto; + min-height: var(--touch-target); + width: var(--touch-target); } - .sidebar-rail--expanded .sidebar-item { + + .sidebar-rail--expanded .sidebar-item, + .sidebar-rail--expanded .sidebar-item--editing { width: 100%; } + + .sidebar-icon { + aspect-ratio: auto; + width: calc(var(--touch-target) * 0.5); + height: calc(var(--touch-target) * 0.5); + } + + .sidebar-label, + .sidebar-item-input { + font-size: max(16px, var(--font-sm)); /* >= 16px prevents iOS focus-zoom */ + } + .sidebar-toggle { height: calc(var(--touch-target) * 0.9); } - /* Preset dropdown */ + /* App dropdown */ .sidebar-app-trigger, .sidebar-app-input { height: calc(var(--touch-target) * 0.9); } - .sidebar-app-input, - .sidebar-item-input { + + .sidebar-app-trigger { + font-size: max(13px, var(--font-xs)); + } + + .sidebar-app-input { font-size: 16px; /* prevents iOS focus-zoom */ } + .sidebar-app-listbox { max-height: min(240px, 50dvh); -webkit-overflow-scrolling: touch; } + .sidebar-app-option { padding: var(--space-3) var(--space-2); - font-size: var(--font-sm); - } -} - -@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { - .sidebar-label, - .sidebar-item-input { - font-size: max(20px, var(--font-sm)); - } - - .sidebar-app-trigger, - .sidebar-app-input, - .sidebar-app-option { - font-size: max(13px, var(--font-xs)); + font-size: max(13px, var(--font-sm)); } } \ No newline at end of file From 9ec847acb31d20fcd322f72713868b3f240bbda8 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 28 Oct 2026 12:56:43 +0100 Subject: [PATCH 03/19] feat: connection section for mobile --- .../ConnectionSection/ConnectionSection.tsx | 13 +++++-------- .../dsp408/components/DSP408Panel/DSP408Panel.css | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/features/dsp408/components/ConnectionSection/ConnectionSection.tsx b/src/features/dsp408/components/ConnectionSection/ConnectionSection.tsx index 3732a89..f5371a5 100644 --- a/src/features/dsp408/components/ConnectionSection/ConnectionSection.tsx +++ b/src/features/dsp408/components/ConnectionSection/ConnectionSection.tsx @@ -15,12 +15,9 @@ function ConnectionPanel({ onDisconnect: () => void; }) { - const statusLabel = - isConnected(dsp) - ? 'Connected' - : dsp.isConnecting - ? 'Connecting…' - : 'Disconnected'; + const connected = isConnected(dsp); + const status = dsp.isConnecting ? 'connecting' : connected ? 'connected' : 'disconnected'; + const statusLabel = { connecting: 'Connecting…', connected: 'Connected', disconnected: 'Disconnected' }[status]; return (
@@ -36,7 +33,7 @@ function ConnectionPanel({
- + {statusLabel} @@ -65,7 +62,7 @@ function ConnectionPanel({
- {isConnected(dsp) ? ( + {connected ? ( diff --git a/src/features/dsp408/components/DSP408Panel/DSP408Panel.css b/src/features/dsp408/components/DSP408Panel/DSP408Panel.css index 8106109..654a1a2 100644 --- a/src/features/dsp408/components/DSP408Panel/DSP408Panel.css +++ b/src/features/dsp408/components/DSP408Panel/DSP408Panel.css @@ -40,7 +40,7 @@ display: none; } -@media (max-width: 768px) { +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { .dsp-content, .dsp-loading-overlay, .app-root:has(.sidebar-rail--expanded) .dsp-content, From 73ea8731f7e277a83f03384258437e72a30ef190 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 28 Oct 2026 16:33:17 +0100 Subject: [PATCH 04/19] feat: mobile version of gain section --- README.md | 2 +- .../components/GainSection/GainSection.css | 485 ++++++++++++++++-- .../components/GainSection/GainSection.tsx | 206 ++++---- 3 files changed, 538 insertions(+), 155 deletions(-) diff --git a/README.md b/README.md index fb3f374..c0ef129 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ This template should help get you started developing with Tauri, React and Types - Check end to end behavioour -- Make phone version \ No newline at end of file +- Make phone version (avoid slider move when scrolling horizontaly) \ No newline at end of file diff --git a/src/features/dsp408/components/GainSection/GainSection.css b/src/features/dsp408/components/GainSection/GainSection.css index c83072b..205cf88 100644 --- a/src/features/dsp408/components/GainSection/GainSection.css +++ b/src/features/dsp408/components/GainSection/GainSection.css @@ -1,3 +1,24 @@ +/* ---------- Page wrapper ---------- */ + +.gain-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.gain-tabs, +.gain-rotate-hint { + display: none; /* phones only */ +} + +.gain-panel__btns { + display: contents; /* desktop: buttons stay direct children of the panel */ +} + +.gain-panel__btn-short { + display: none; +} + +/* ---------- Fader strip ---------- */ + .gain-section { container-type: size; @@ -5,6 +26,7 @@ left: 0; right: 0; bottom: 0; + z-index: 20; height: var(--dsp-control-heigth); @@ -13,12 +35,9 @@ justify-content: center; box-sizing: border-box; - background: var(--bg-panel); - - z-index: 20; - border-top: var(--border-width) solid var(--border-hairline); + user-select: none; -webkit-user-select: none; } @@ -33,39 +52,50 @@ .gain-panel { position: relative; + flex: 0 0 auto; height: 100%; aspect-ratio: 1 / 4; - flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; + gap: 2cqh; + padding-bottom: 2cqh; + box-sizing: border-box; + + background: var(--bg-void); border: var(--border-width) solid var(--border-hairline); border-radius: var(--radius-md); - box-sizing: border-box; - gap: 2cqh; - background: var(--bg-void); - padding-bottom: 2cqh; } .gain-panel__title { flex: 0 0 auto; width: 100%; - text-align: center; + min-width: 0; + + padding-block: 2cqh; + font-family: var(--font-ui); font-size: 4cqh; font-weight: var(--font-weight-semibold); - padding-top: 2cqh; - padding-bottom: 2cqh; - border-bottom: var(--border-width) solid var(--border-hairline); + text-align: center; - min-width: 0; + border-bottom: var(--border-width) solid var(--border-hairline); overflow: hidden; text-overflow: ellipsis; } +.gain-panel .gain-panel__btn { + width: 85%; + min-height: 0; + padding: 2cqh 0; + font-size: 4cqh; +} + +/* ---------- Graphs ---------- */ + .gain-linear-graph-section { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -94,17 +124,6 @@ border-radius: var(--radius-md); } -.gain-graph-title { - flex: 0 0 auto; - - text-align: center; - padding: 1cqh; - - font-family: var(--font-ui); - font-size: 2.5cqh; - font-weight: var(--font-weight-semibold); -} - .gain-graph-panel > .container { flex: 1; min-height: 0; @@ -112,42 +131,49 @@ .gain-graph-title-row { flex: 0 0 auto; + min-width: 0; display: flex; flex-direction: column; align-items: stretch; - gap: 0.75cqh; - padding: 1cqh 1.5cqh; - min-width: 0; + padding: 1cqh 1.5cqh; overflow: hidden; } -/* First row: title left, Show stages right */ +/* Title left, "Show stages" right */ .gain-graph-title-line { display: flex; align-items: center; justify-content: space-between; + gap: 1cqh; width: 100%; min-width: 0; - gap: 1cqh; +} + +.gain-graph-title { + flex: 0 0 auto; + padding: 1cqh; + + font-family: var(--font-ui); + font-size: 2.5cqh; + font-weight: var(--font-weight-semibold); + text-align: center; } .gain-graph-title-line .gain-graph-title { flex: 1 1 auto; min-width: 0; - padding: 0; text-align: left; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; } -/* Compact button on the right */ .gain-stages-toggle { flex: 0 0 auto; @@ -157,11 +183,11 @@ padding: 0.4cqh 1cqh; font-size: 1.8cqh; line-height: 1.2; - white-space: nowrap; } -/* Channel Selector */ +/* ---------- Channel selector ---------- */ + .magnitude-selector { width: 100%; min-width: 0; @@ -169,7 +195,6 @@ display: flex; align-items: center; flex-wrap: nowrap; - gap: 0.5cqh; overflow: hidden; @@ -183,24 +208,21 @@ display: flex; align-items: center; - gap: 0.6cqh; - font-family: var(--font-ui); - font-size: 1.8cqh; - padding: 0.4cqh 1cqh; + font-family: var(--font-ui); + font-size: 1.8cqh; + white-space: nowrap; + background: var(--bg-void); color: var(--text-muted); - border: var(--border-width) solid var(--border-hairline); border-radius: var(--radius-sm); - cursor: pointer; opacity: 0.5; - - white-space: nowrap; + cursor: pointer; overflow: hidden; } @@ -211,19 +233,384 @@ } .magnitude-selector__swatch { + flex: 0 0 auto; width: 1.2cqh; height: 1.2cqh; - border-radius: 50%; background: var(--chip-color); - - flex: 0 0 auto; } .magnitude-selector__label { min-width: 0; - + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; } + +/* ---------- Phone (shared) ---------- + Landscape: tabs (Faders / Input curve / Output curve), one view at a time. + Portrait: faders only + a hint to rotate for the graphs. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .gain-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .gain-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .gain-page .gain-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .gain-page .gain-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .gain-page[data-view='faders'] .gain-linear-graph-section, + .gain-page:not([data-view='faders']) .gain-section, + .gain-page[data-view='input'] .gain-graph-panel[data-panel='output'], + .gain-page[data-view='output'] .gain-graph-panel[data-panel='input'] { + display: none; + } + + /* ----- Curve views: graph fills everything ----- */ + + .gain-linear-graph-section { + flex: 1 1 0; + min-height: 0; + flex-direction: column; + gap: 0; + padding: var(--space-1); + } + + .gain-graph-panel { + flex: 1 1 0; + height: auto; + } + + /* Compact header: chips scroll on the left, "Show stages" on the right */ + .gain-graph-title-row { + flex-direction: row; + align-items: center; + gap: var(--space-2); + padding: var(--space-1) var(--space-2); + } + + .gain-graph-title-line { + order: 2; + flex: 0 0 auto; + width: auto; + } + + .gain-graph-title-line .gain-graph-title { + display: none; /* the tab already says which graph this is */ + } + + .gain-stages-toggle { + min-height: 0; + height: 32px; + padding: 0 var(--space-3); + font-size: var(--font-xs); + } + + .magnitude-selector { + order: 1; + flex: 1 1 auto; + width: auto; + gap: var(--space-1); + + overflow-x: auto; + overflow-y: hidden; + scrollbar-width: none; + -webkit-overflow-scrolling: touch; + } + + .magnitude-selector::-webkit-scrollbar { + display: none; + } + + .magnitude-selector__chip { + flex: 0 0 auto; + min-height: 0; + height: 32px; + padding: 0 var(--space-3); + gap: var(--space-2); + font-size: var(--font-xs); + } + + .magnitude-selector__swatch { + width: 10px; + height: 10px; + } + + /* ----- Faders view: mixer strips, swipe sideways, snap per group ----- */ + + .gain-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .gain-panels { + display: flex; + width: 100%; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + .gain-section .channel-group { + flex: 0 0 auto; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .gain-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .gain-section .channel-group__items { + height: auto; + align-self: stretch; + } + + .gain-panel { + flex: 0 0 auto; + width: clamp(64px, 10vw, 80px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + gap: var(--space-2); + padding-bottom: var(--space-2); + } + + .gain-panel__title { + padding-block: var(--space-2); + font-size: var(--font-xs); + } + + /* The fader (element right after the title) takes all remaining height. + pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. */ + .gain-panel__title + * { + flex: 1 1 0; + min-height: 0; + width: 100%; + } + + /* Applied to the thumb/track too: a swipe that starts on them must scroll the + strip, not drag the fader. */ + .gain-panel__title + *, + .gain-panel__title + * * { + touch-action: pan-x !important; + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't + (auto margins collapse to 0 on overflow, unlike justify-content: center) */ + .gain-panels > .channel-group:first-child { + margin-left: auto; + } + + .gain-panels > .channel-group:last-child { + margin-right: auto; + } + + .gain-panel__btns { + display: flex; + flex-direction: column; + gap: var(--space-2); + width: calc(100% - var(--space-3)); + } + + .gain-panel .gain-panel__btns .gain-panel__btn { + flex: 1 1 auto; + width: 100%; + min-height: 44px; + padding: 0; + font-size: var(--font-xs); + } +} + +/* ---------- Portrait phone: faders only, 2 rows (Input on top, Output below) ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .gain-tabs { + display: none; + } + + .gain-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-2) var(--space-3); + + font-family: var(--font-ui); + font-size: var(--font-xs); + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the faders */ + .gain-page[data-view] .gain-linear-graph-section { + display: none; + } + + .gain-page[data-view] .gain-section { + display: flex; + } + + /* Two rows: each group is a row that scrolls sideways on its own */ + .gain-panels { + flex-direction: column; + gap: var(--space-2); + overflow: hidden; + scroll-snap-type: none; + } + + /* Each row is its own size container: everything sized in cqh inside + (fader thumb, track, readout) scales to the row height, like in landscape, + instead of to the whole screen. */ + .gain-section .channel-group { + container-type: size; + flex: 1 1 0; + min-height: 0; + width: 100%; + box-sizing: border-box; + padding: 28px var(--space-2) var(--space-2); + scroll-snap-align: none; + } + + .gain-section .channel-group__label { + top: 6px; + font-size: var(--font-xs); + } + + .gain-section .channel-group__items { + flex: 1 1 auto; + width: 100%; + min-width: 0; + gap: var(--space-1); + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + .gain-section .channel-group__items > :first-child { + margin-left: auto; + } + + .gain-section .channel-group__items > :last-child { + margin-right: auto; + } + + /* Same strip as landscape: narrow, compact, buttons stacked */ + .gain-panel { + width: clamp(60px, 17vw, 72px); + gap: var(--space-1); + padding-bottom: var(--space-1); + scroll-snap-align: start; + } + + .gain-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + .gain-panel__btns { + gap: var(--space-1); + } + + .gain-panel .gain-panel__btns .gain-panel__btn { + min-height: 36px; + font-size: 11px; + } +} + +/* ---------- Landscape phone: thinner strips, buttons stacked ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .gain-panels { + padding: var(--space-1) var(--space-2); + } + + .gain-section .channel-group { + padding-top: 24px; + } + + .gain-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .gain-panel { + width: clamp(56px, 7.5vw, 76px); + gap: var(--space-1); + padding-bottom: var(--space-1); + } + + .gain-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + .gain-panel__btns { + gap: var(--space-1); + } + + .gain-panel .gain-panels .gain-panel__btn, + .gain-panel .gain-panel__btns .gain-panel__btn { + min-height: 36px; + font-size: 11px; + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/GainSection/GainSection.tsx b/src/features/dsp408/components/GainSection/GainSection.tsx index 858888e..7997160 100644 --- a/src/features/dsp408/components/GainSection/GainSection.tsx +++ b/src/features/dsp408/components/GainSection/GainSection.tsx @@ -19,6 +19,34 @@ import { getPeqCurvePoints } from '../../utils/graph/peq'; import { getCrossoverCurvePoints } from '../../utils/graph/crossover'; import { ChannelCurves, formatY, ResponseGraph } from './GainGraph'; +// ---- Helpers ------------------------------------------------------------ + +type GainView = 'faders' | 'input' | 'output'; + +const GAIN_VIEWS: { id: GainView; label: string }[] = [ + { id: 'faders', label: 'Faders' }, + { id: 'input', label: 'Input curve' }, + { id: 'output', label: 'Output curve' }, +]; + +function toggleInSet(set: Set, value: T): Set { + const next = new Set(set); + if (next.has(value)) next.delete(value); + else next.add(value); + return next; +} + +function withLiveValue( + prev: Partial>, + key: K, + value: number | null +): Partial> { + const next = { ...prev }; + if (value === null) delete next[key]; + else next[key] = value; + return next; +} + // ---- Curve construction ----------------------------------------------- function getGainCurvePoints(freqs: number[], gainDb: number): CurvePoint[] { @@ -131,15 +159,9 @@ function GainPanel({ await setInverse(channel, !inverted); }; - const handleLiveValue = (value: number) => { - onLiveGain(value); - }; - const commitGain = async (value: number) => { const success = await setGain(channel, value); - if (success) { - onLiveGain(null); - } + if (success) onLiveGain(null); return success; }; @@ -154,42 +176,29 @@ function GainPanel({ unit=" dB" value={gain} formatValue={(v, d) => (v > 0 ? `+${v.toFixed(d)}` : v.toFixed(d))} - onInput={handleLiveValue} + onInput={onLiveGain} onChange={commitGain} /> - - +
+ + + +
); } @@ -241,7 +250,11 @@ function GainSection({ setInverse: (channel: Channel, inverted: boolean) => Promise; }) { const [selectedInputs, setSelectedInputs] = useState>(new Set(INPUT_ORDER)); - const [selectedOutputs, setSelectedOutputs] = useState>(new Set(OUTPUT_ORDER)); + const [selectedOutputs, setSelectedOutputs] = useState>( + new Set(OUTPUT_ORDER) + ); + + const [view, setView] = useState('faders'); const [showInputStages, setShowInputStages] = useState(false); const [showOutputStages, setShowOutputStages] = useState(false); @@ -251,70 +264,54 @@ function GainSection({ {} ); - const setLiveInputGain = (channel: InputChannel, value: number | null) => { - setLiveInputGains((prev) => { - if (value === null) { - const next = { ...prev }; - delete next[channel]; - return next; - } - return { ...prev, [channel]: value }; - }); - }; + const setLiveInputGain = (channel: InputChannel, value: number | null) => + setLiveInputGains((prev) => withLiveValue(prev, channel, value)); - const setLiveOutputGain = (channel: OutputChannel, value: number | null) => { - setLiveOutputGains((prev) => { - if (value === null) { - const next = { ...prev }; - delete next[channel]; - return next; - } - return { ...prev, [channel]: value }; - }); - }; + const setLiveOutputGain = (channel: OutputChannel, value: number | null) => + setLiveOutputGains((prev) => withLiveValue(prev, channel, value)); - const inputLabels: Record = INPUT_ORDER.reduce( - (acc, channel) => ({ - ...acc, - [channel]: dsp.state.current_config.input_states[channel].name, - }), - {} as Record - ); + const inputStates = dsp.state.current_config.input_states; + const outputStates = dsp.state.current_config.output_states; - const outputLabels: Record = OUTPUT_ORDER.reduce( - (acc, channel) => ({ - ...acc, - [channel]: dsp.state.current_config.output_states[channel].name, - }), - {} as Record - ); + const inputLabels = Object.fromEntries( + INPUT_ORDER.map((channel) => [channel, inputStates[channel].name]) + ) as Record; - const toggleInput = (channel: InputChannel) => { - setSelectedInputs((prev) => { - const next = new Set(prev); - next.has(channel) ? next.delete(channel) : next.add(channel); - return next; - }); - }; - - const toggleOutput = (channel: OutputChannel) => { - setSelectedOutputs((prev) => { - const next = new Set(prev); - next.has(channel) ? next.delete(channel) : next.add(channel); - return next; - }); - }; + const outputLabels = Object.fromEntries( + OUTPUT_ORDER.map((channel) => [channel, outputStates[channel].name]) + ) as Record; return ( - <> +
+ {/* Phone only (hidden on desktop by CSS): one view at a time */} +
+ {GAIN_VIEWS.map((v) => ( + + ))} +
+ + {/* Portrait phone only (CSS): graphs need the width of landscape */} +
+ Rotate your phone to landscape to see the response graphs. +
+
-
+
Input Response
-
+
Output Response
- setSelectedOutputs((prev) => toggleInSet(prev, c))} />
- +
); } -export default GainSection; +export default GainSection; \ No newline at end of file From e70082f6ccb949ada7304ec385d5ac3d3859e79d Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 10:14:49 +0100 Subject: [PATCH 05/19] fix: dont move sliders when horizontal scroll --- .../VerticalSlider/VerticalSlider.tsx | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/components/VerticalSlider/VerticalSlider.tsx b/src/components/VerticalSlider/VerticalSlider.tsx index 751c9ba..392db11 100644 --- a/src/components/VerticalSlider/VerticalSlider.tsx +++ b/src/components/VerticalSlider/VerticalSlider.tsx @@ -49,6 +49,7 @@ function formatValueDefault(v: number, decimals: number) { return v.toFixed(decimals); } +const TOUCH_INTENT_PX = 20; const MIN_TICKS = 3; const MAX_TICK_SPACING_PX = 16; const WHEEL_COMMIT_DELAY_MS = 250; @@ -214,6 +215,7 @@ export default function VerticalSlider({ // --- per-input-method "is the user still doing something" flags -------- const dragging = useRef(false); const activePointerId = useRef(null); + const pendingTouch = useRef<{ id: number; x: number; y: number } | null>(null); const keysHeld = useRef>(new Set()); const wheelTimeout = useRef | null>(null); @@ -353,6 +355,7 @@ export default function VerticalSlider({ dragging.current = false; activePointerId.current = null; + pendingTouch.current = null; keysHeld.current.clear(); pendingCommit.current = null; if (wheelTimeout.current) { @@ -482,6 +485,30 @@ export default function VerticalSlider({ // --- pointer / mouse --------------------------------------------------- + function handlePointerMove(e: React.PointerEvent) { + const pending = pendingTouch.current; + if (pending && e.pointerId === pending.id) { + const dx = e.clientX - pending.x; + const dy = e.clientY - pending.y; + if (Math.abs(dx) < TOUCH_INTENT_PX && Math.abs(dy) < TOUCH_INTENT_PX) return; + + pendingTouch.current = null; + + if (Math.abs(dy) > Math.abs(dx)) { + // Vertical intent: start the drag now + dragging.current = true; + activePointerId.current = e.pointerId; + e.currentTarget.setPointerCapture(e.pointerId); + valueFromPointer(e.clientY); + } + // Horizontal intent: do nothing, the browser scrolls the strip + return; + } + + if (!dragging.current || e.pointerId !== activePointerId.current) return; + valueFromPointer(e.clientY); + } + function valueFromPointer(clientY: number) { if (!sliderRef.current) return; const rect = sliderRef.current.getBoundingClientRect(); @@ -492,6 +519,14 @@ export default function VerticalSlider({ function startDrag(e: React.PointerEvent) { if (disabled) return; + + // Touch: don't move anything yet. Wait to see if the gesture is vertical + // (fader) or horizontal (the strip scrolling). + if (e.pointerType === 'touch') { + if (dragging.current || pendingTouch.current) return; + pendingTouch.current = { id: e.pointerId, x: e.clientX, y: e.clientY }; + return; + } if (e.pointerType === 'mouse' && e.button !== 0) return; // Ignore a second pointer (multi-touch) while one is already dragging. if (dragging.current) return; @@ -503,12 +538,11 @@ export default function VerticalSlider({ valueFromPointer(e.clientY); } - function handlePointerMove(e: React.PointerEvent) { - if (!dragging.current || e.pointerId !== activePointerId.current) return; - valueFromPointer(e.clientY); - } - function endDrag(e: React.PointerEvent) { + if (pendingTouch.current?.id === e.pointerId) { + pendingTouch.current = null; + return; + } if (!dragging.current || e.pointerId !== activePointerId.current) return; // Release the gesture synchronously. The old code awaited onChange first, From f3745db9270fc5037c60e5b6f8da35dac7c4aed3 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 10:40:26 +0100 Subject: [PATCH 06/19] feat: gate section for mobile --- .../components/GateSection/GateSection.css | 384 ++++++++++++++++++ .../components/GateSection/GateSection.tsx | 52 ++- 2 files changed, 427 insertions(+), 9 deletions(-) diff --git a/src/features/dsp408/components/GateSection/GateSection.css b/src/features/dsp408/components/GateSection/GateSection.css index ed7eac8..e153a3c 100644 --- a/src/features/dsp408/components/GateSection/GateSection.css +++ b/src/features/dsp408/components/GateSection/GateSection.css @@ -1,4 +1,22 @@ /* GateSection.css */ + +/* ---------- Page wrapper ---------- */ + +.gate-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.gate-tabs, +.gate-rotate-hint { + display: none; /* phones only */ +} + +.gate-panel__label-short { + display: none; +} + +/* ---------- Control strip ---------- */ + .gate-section { container-type: size; @@ -98,6 +116,8 @@ white-space: nowrap; } +/* ---------- Graph ---------- */ + .gate-linear-graph-section { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -165,3 +185,367 @@ gap: 1cqh; padding: 1cqh; } + +/* ---------- Phone (shared) ---------- + Landscape: tabs (Controls / Gate response), one view at a time. + Portrait: controls only + a hint to rotate for the graph. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .gate-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .gate-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .gate-page .gate-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .gate-page .gate-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .gate-page[data-view='controls'] .gate-linear-graph-section, + .gate-page[data-view='response'] .gate-section { + display: none; + } + + /* ----- Response view: graph + meters fill everything ----- */ + + .gate-linear-graph-section { + flex: 1 1 0; + min-height: 0; + gap: var(--space-1); + padding: var(--space-1); + } + + .gate-graph-title { + display: none; /* the tab already says which graph this is */ + } + + .gate-graph__meters { + gap: var(--space-1); + padding: var(--space-1); + } + + /* ----- Controls view: strips, swipe sideways, snap per panel ----- */ + + .gate-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .gate-panels { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* The group is as wide as its 4 strips (never shrunk to the viewport), + so .gate-panels is the only thing that scrolls. */ + .gate-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .gate-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .gate-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + gap: var(--space-2); + overflow: visible; /* no nested scroller: it would fight with .gate-panels */ + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't */ + .gate-panels > .channel-group:first-child { + margin-left: auto; + } + + .gate-panels > .channel-group:last-child { + margin-right: auto; + } + + /* One strip per input: 4 faders side by side, full height */ + .gate-panel { + flex: 0 0 auto; + width: clamp(200px, 30vw, 260px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + scroll-snap-align: start; + } + + .gate-panel__title { + padding-block: var(--space-2); + font-size: var(--font-xs); + } + + .gate-panel__grid { + grid-template-columns: repeat(4, minmax(0, 1fr)); + grid-template-rows: minmax(0, 1fr); + gap: var(--space-1); + padding: var(--space-2) var(--space-1); + } + + .gate-panel__cell { + gap: var(--space-1); + } + + .gate-panel__cell-label { + max-width: 100%; + font-size: 10px; + overflow: hidden; + text-overflow: ellipsis; + } + + .gate-panel__label-long { + display: none; + } + + .gate-panel__label-short { + display: inline; + } + + /* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. + Applied to the thumb/track too so a swipe that starts on them scrolls. */ + .gate-panel__cell > :first-child, + .gate-panel__cell > :first-child * { + touch-action: pan-x !important; + } +} + +/* ---------- Portrait phone: controls only, 2x2 panels, each with 2x2 sliders ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .gate-tabs { + display: none; + } + + .gate-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-2) var(--space-3); + + font-family: var(--font-ui); + font-size: var(--font-xs); + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the controls */ + .gate-page[data-view] .gate-linear-graph-section { + display: none; + } + + .gate-page[data-view] .gate-section { + display: flex; + } + + /* Everything fits on screen: no horizontal scroll */ + .gate-panels { + overflow: hidden; + scroll-snap-type: none; + padding: var(--space-1); + gap: 0; + } + + .gate-section .channel-group { + flex: 1 1 auto; + width: 100%; + min-width: 0; + min-height: 0; + box-sizing: border-box; + padding: 28px var(--space-1) var(--space-1); + scroll-snap-align: none; + } + + .gate-section .channel-group__label { + top: 6px; + font-size: var(--font-xs); + } + + /* The 4 input panels in a 2x2 grid */ + .gate-section .channel-group__items { + flex: 1 1 auto; + width: 100%; + min-width: 0; + min-height: 0; + + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + gap: var(--space-1); + } + + .gate-panel { + width: 100%; + min-width: 0; + min-height: 0; + scroll-snap-align: none; + margin: 0; + } + + .gate-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + /* Each panel keeps its 2x2 sliders */ + .gate-panel__grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + gap: var(--space-1); + padding: var(--space-1); + } + + .gate-panel__label-long { + display: inline; + } + + .gate-panel__label-short { + display: none; + } + + /* Each panel is its own size container (like the rows in GainSection): + the slider's cqh sizes (thumb, track, readout) scale to the panel height, + which is bigger than a single cell but never the whole screen. */ + .gate-panel { + container-type: size; + } + + /* The thumb sticks out of the track by half its height at min/max: leave that + room inside the cell (padding) instead of clipping it or letting it slide + under the title. */ + .gate-panel__cell { + overflow: visible; + padding-block: 3cqh; + box-sizing: border-box; + } + + .gate-panel__grid { + position: relative; + z-index: 1; /* paint above the title if a thumb still reaches it */ + } + + .gate-panel__cell > :first-child { + min-height: 0; + max-height: 100%; + } + + /* Give the height back to the sliders: tighter hint, title, gaps and label */ + .gate-rotate-hint { + padding: var(--space-1) var(--space-2); + font-size: 11px; + } + + .gate-panel__title { + padding-block: 4px; + } + + .gate-panel__grid { + gap: 2px; + padding: 4px; + } + + .gate-panel__cell { + gap: 2px; + } + + .gate-panel__cell-label { + font-size: 10px; + line-height: 1.1; + } +} + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .gate-panels { + padding: var(--space-1) var(--space-2); + } + + .gate-section .channel-group { + padding-top: 24px; + } + + .gate-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .gate-panel { + width: clamp(190px, 24vw, 240px); + } + + .gate-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + .gate-panel__grid { + padding: var(--space-1); + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/GateSection/GateSection.tsx b/src/features/dsp408/components/GateSection/GateSection.tsx index 74260a2..6f2ce2a 100644 --- a/src/features/dsp408/components/GateSection/GateSection.tsx +++ b/src/features/dsp408/components/GateSection/GateSection.tsx @@ -9,10 +9,10 @@ import { useState } from 'react'; import './GateSection.css'; const GATE_PARAMS = [ - { key: 'threshold', label: 'Threshold', min: -90, max: 0, step: 0.5, unit: ' dB' }, - { key: 'attack', label: 'Attack', min: 1, max: 999, step: 1, unit: ' ms' }, - { key: 'hold', label: 'Hold', min: 10, max: 999, step: 1, unit: ' ms' }, - { key: 'release', label: 'Release', min: 10, max: 3000, step: 1, unit: ' ms' }, + { key: 'threshold', label: 'Threshold', short: 'Thr', min: -90, max: 0, step: 0.5, unit: ' dB' }, + { key: 'attack', label: 'Attack', short: 'Atk', min: 1, max: 999, step: 1, unit: ' ms' }, + { key: 'hold', label: 'Hold', short: 'Hld', min: 10, max: 999, step: 1, unit: ' ms' }, + { key: 'release', label: 'Release', short: 'Rel', min: 10, max: 3000, step: 1, unit: ' ms' }, ] as const; type GateParamKey = (typeof GATE_PARAMS)[number]['key']; @@ -32,6 +32,14 @@ type SetGateFn = ( release: number ) => Promise; +// Phone only: one view at a time (CSS hides the tabs on desktop) +type GateView = 'controls' | 'response'; + +const GATE_VIEWS: { id: GateView; label: string }[] = [ + { id: 'controls', label: 'Controls' }, + { id: 'response', label: 'Gate response' }, +]; + function GatePanel({ channel, dsp, @@ -71,7 +79,10 @@ function GatePanel({ }} style={{ width: '100%', flex: '1 1 auto' }} /> -
{param.label}
+
+ {param.label} + {param.short} +
))}
@@ -84,6 +95,7 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) { const [activeChannel, setActiveChannel] = useState(inputs[0]); const [liveGate, setLiveGate] = useState>>({}); + const [view, setView] = useState('controls'); const handleLiveValue = (channel: InputChannel, key: GateParamKey, value: number) => { setActiveChannel(channel); @@ -113,7 +125,28 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) { const activeGate = liveGate[activeChannel] ?? activeInputState.gate; return ( - <> +
+ {/* Phone only (hidden on desktop by CSS): one view at a time */} +
+ {GATE_VIEWS.map((v) => ( + + ))} +
+ + {/* Portrait phone only (CSS): the graph needs the width of landscape */} +
+ Rotate your phone to landscape to see the gate response graph. +
+
Gate Response
@@ -135,7 +168,7 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) { key={input} label={inputState.name} meter={dsp.input_meters.meters[input]} - variant='input' + variant="input" /> ); })} @@ -158,7 +191,8 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) {
- +
); } -export default GateSection; + +export default GateSection; \ No newline at end of file From 5bbef3f96057b77d39a086d85ddfc0dcf5984fc2 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 10:58:35 +0100 Subject: [PATCH 07/19] feat: compressor section for mobile --- README.md | 2 +- .../CompressorSection/CompressorSection.css | 385 +++++++++++++++++- .../CompressorSection/CompressorSection.tsx | 51 ++- 3 files changed, 419 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c0ef129..c5d4042 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ This template should help get you started developing with Tauri, React and Types - Check end to end behavioour -- Make phone version (avoid slider move when scrolling horizontaly) \ No newline at end of file +- Make phone version (Crown on topbar dont respect phoen padding + Open keyboard on phone when input slider) diff --git a/src/features/dsp408/components/CompressorSection/CompressorSection.css b/src/features/dsp408/components/CompressorSection/CompressorSection.css index 71c4c71..0f773f7 100644 --- a/src/features/dsp408/components/CompressorSection/CompressorSection.css +++ b/src/features/dsp408/components/CompressorSection/CompressorSection.css @@ -1,3 +1,22 @@ +/* CompressorSection.css */ + +/* ---------- Page wrapper ---------- */ + +.compressor-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.compressor-tabs, +.compressor-rotate-hint { + display: none; /* phones only */ +} + +.compressor-panel__label-short { + display: none; +} + +/* ---------- Control strip ---------- */ + .compressor-section { container-type: size; position: absolute; @@ -146,6 +165,20 @@ white-space: nowrap; } +.compressor-panel__stepper--centered .choice-stepper__input { + text-align: center; + padding: 0; + margin: 0; +} + +.compressor-panel__stepper--centered .choice-stepper__arrows { + flex: 0 0 20%; + width: 20%; + padding-right: 0; +} + +/* ---------- Graph ---------- */ + .compressor-graph__channel { font-size: var(--font-xs); color: var(--text-muted); @@ -230,14 +263,350 @@ min-height: 0; } -.compressor-panel__stepper--centered .choice-stepper__input { - text-align: center; - padding: 0; - margin: 0; +/* ---------- Phone (shared) ---------- + Landscape: tabs (Controls / Compressor response), one view at a time. + Portrait: controls only + a hint to rotate for the graph. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .compressor-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .compressor-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .compressor-page .compressor-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .compressor-page .compressor-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .compressor-page[data-view='controls'] .compressor-linear-graph-section, + .compressor-page[data-view='response'] .compressor-section { + display: none; + } + + /* ----- Response view: graph + meters fill everything ----- */ + + .compressor-linear-graph-section { + flex: 1 1 0; + min-height: 0; + gap: var(--space-1); + padding: var(--space-1); + } + + .compressor-graph__title { + padding: var(--space-1); + font-size: var(--font-xs); + } + + .compressor-graph__meters { + gap: var(--space-1); + padding: var(--space-1); + } + + /* ----- Controls view: strips, swipe sideways, snap per panel ----- */ + + .compressor-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .compressor-panels { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* The group is as wide as its strips (never shrunk to the viewport), + so .compressor-panels is the only thing that scrolls. */ + .compressor-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .compressor-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .compressor-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + gap: var(--space-2); + overflow: visible; /* no nested scroller: it would fight with .compressor-panels */ + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't */ + .compressor-panels > .channel-group:first-child { + margin-left: auto; + } + + .compressor-panels > .channel-group:last-child { + margin-right: auto; + } + + /* One strip per output: 3 faders + a column with the Ratio / Knee steppers */ + .compressor-panel { + flex: 0 0 auto; + width: clamp(260px, 34vw, 320px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + scroll-snap-align: start; + } + + .compressor-panel__title { + padding-block: var(--space-2); + font-size: var(--font-xs); + } + + .compressor-panel__grid { + grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.8fr); + grid-template-rows: minmax(0, 1fr); + grid-template-areas: 'threshold attack release steppers'; + gap: var(--space-1); + padding: var(--space-2) var(--space-1); + } + + .compressor-panel__cell { + gap: var(--space-1); + } + + .compressor-panel__cell--steppers { + gap: var(--space-2); + } + + .compressor-panel__stepper { + font-size: 11px; + } + + .compressor-panel__cell-label { + max-width: 100%; + font-size: 10px; + overflow: hidden; + text-overflow: ellipsis; + } + + .compressor-panel__label-long { + display: none; + } + + .compressor-panel__label-short { + display: inline; + } + + /* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. + Applied to the thumb/track too so a swipe that starts on them scrolls. */ + .compressor-panel__cell:not(.compressor-panel__cell--steppers) > :first-child, + .compressor-panel__cell:not(.compressor-panel__cell--steppers) > :first-child * { + touch-action: pan-x !important; + } } -.compressor-panel__stepper--centered .choice-stepper__arrows { - flex: 0 0 20%; - width: 20%; - padding-right: 0; +/* ---------- Portrait phone: controls only, 8 panels in 2 rows, each with 2x2 controls ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .compressor-tabs { + display: none; + } + + .compressor-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-1) var(--space-2); + + font-family: var(--font-ui); + font-size: 11px; + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the controls */ + .compressor-page[data-view] .compressor-linear-graph-section { + display: none; + } + + .compressor-page[data-view] .compressor-section { + display: flex; + } + + /* Swipe sideways: both rows move together (Out1-4 on top, Out5-8 below) */ + .compressor-panels { + padding: var(--space-1); + gap: 0; + } + + .compressor-section .channel-group { + padding: 28px var(--space-1) var(--space-1); + } + + .compressor-section .channel-group__label { + top: 6px; + font-size: var(--font-xs); + } + + .compressor-section .channel-group__items { + flex: 1 1 auto; + min-height: 0; + + display: grid; + grid-template-columns: repeat(4, clamp(150px, 46vw, 200px)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + gap: var(--space-1); + } + + .compressor-panel { + width: 100%; + min-width: 0; + min-height: 0; + margin: 0; + + /* Each panel is its own size container (like the rows in GainSection): + the slider's cqh sizes (thumb, track, readout) scale to the panel height. */ + container-type: size; + } + + .compressor-panel__title { + padding-block: 4px; + font-size: 11px; + } + + /* Each panel keeps its 2x2 layout: Thr | Atk, steppers | Rel */ + .compressor-panel__grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + grid-template-areas: + 'threshold attack' + 'steppers release'; + gap: 2px; + padding: 4px; + + position: relative; + z-index: 1; /* paint above the title if a thumb still reaches it */ + } + + .compressor-panel__label-long { + display: inline; + } + + .compressor-panel__label-short { + display: none; + } + + .compressor-panel__cell { + gap: 2px; + } + + /* The thumb sticks out of the track by half its height at min/max: leave that + room inside the cell instead of clipping it or letting it slide under the title. */ + .compressor-panel__cell:not(.compressor-panel__cell--steppers) { + overflow: visible; + padding-block: 3cqh; + box-sizing: border-box; + } + + .compressor-panel__cell > :first-child { + min-height: 0; + max-height: 100%; + } + + .compressor-panel__cell--steppers { + justify-content: space-around; + } + + .compressor-panel__cell-label { + font-size: 10px; + line-height: 1.1; + } } + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .compressor-panels { + padding: var(--space-1) var(--space-2); + } + + .compressor-section .channel-group { + padding-top: 24px; + } + + .compressor-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .compressor-panel { + width: clamp(240px, 30vw, 300px); + } + + .compressor-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + .compressor-panel__grid { + padding: var(--space-1); + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/CompressorSection/CompressorSection.tsx b/src/features/dsp408/components/CompressorSection/CompressorSection.tsx index 3de8bca..ca478c8 100644 --- a/src/features/dsp408/components/CompressorSection/CompressorSection.tsx +++ b/src/features/dsp408/components/CompressorSection/CompressorSection.tsx @@ -11,9 +11,9 @@ import './CompressorSection.css'; import { RATIO_ORDER, RATIO_LABEL, KNEE_VALUES } from '../../constants'; const COMPRESSOR_SLIDER_PARAMS = [ - { key: 'threshold', label: 'Threshold', min: -90, max: 20, step: 0.5, unit: ' dB' }, - { key: 'attack', label: 'Attack', min: 1, max: 999, step: 1, unit: ' ms' }, - { key: 'release', label: 'Release', min: 10, max: 3000, step: 1, unit: ' ms' }, + { key: 'threshold', label: 'Threshold', short: 'Thr', min: -90, max: 20, step: 0.5, unit: ' dB' }, + { key: 'attack', label: 'Attack', short: 'Atk', min: 1, max: 999, step: 1, unit: ' ms' }, + { key: 'release', label: 'Release', short: 'Rel', min: 10, max: 3000, step: 1, unit: ' ms' }, ] as const; type CompressorParamKey = 'ratio' | 'attack' | 'release' | 'knee' | 'threshold'; @@ -35,6 +35,14 @@ type SetCompressorFn = ( threshold: number ) => Promise; +// Phone only: one view at a time (CSS hides the tabs on desktop) +type CompressorView = 'controls' | 'response'; + +const COMPRESSOR_VIEWS: { id: CompressorView; label: string }[] = [ + { id: 'controls', label: 'Controls' }, + { id: 'response', label: 'Compressor response' }, +]; + function CompressorPanel({ channel, dsp, @@ -74,7 +82,10 @@ function CompressorPanel({ onChange={(value) => commit({ [param.key]: value } as Partial)} style={{ width: '100%', flex: '1 1 auto' }} /> -
{param.label}
+
+ {param.label} + {param.short} +
))} @@ -112,8 +123,6 @@ function CompressorPanel({ ); } - - function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor: SetCompressorFn }) { const outputs = [ OutputChannel.Out1, @@ -128,6 +137,7 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor: const [activeChannel, setActiveChannel] = useState(outputs[0]); const [liveComp, setLiveComp] = useState>>({}); + const [view, setView] = useState('controls'); const handleLiveValue = ( channel: OutputChannel, @@ -170,7 +180,28 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor: const activeComp = liveComp[activeChannel] ?? (activeOutputState.compressor as CompressorValues); return ( - <> +
+ {/* Phone only (hidden on desktop by CSS): one view at a time */} +
+ {COMPRESSOR_VIEWS.map((v) => ( + + ))} +
+ + {/* Portrait phone only (CSS): the graph needs the width of landscape */} +
+ Rotate your phone to landscape to see the compressor graph. +
+
{activeOutputState.name} - RMS Compressor
@@ -191,7 +222,7 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor: key={output} label={outputState.name} meter={dsp.output_meters.meters[output]} - variant='output' + variant="output" /> ); })} @@ -214,8 +245,8 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor:
- +
); } -export default CompressorSection; +export default CompressorSection; \ No newline at end of file From 8e6e4b5a659f7e593bff92ec6d3ac4955398014c Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 11:07:15 +0100 Subject: [PATCH 08/19] feat: limiter section for mobile --- .../LimiterSection/LimiterSection.css | 356 ++++++++++++++++++ .../LimiterSection/LimiterSection.tsx | 49 ++- 2 files changed, 397 insertions(+), 8 deletions(-) diff --git a/src/features/dsp408/components/LimiterSection/LimiterSection.css b/src/features/dsp408/components/LimiterSection/LimiterSection.css index 49b00f6..13931fd 100644 --- a/src/features/dsp408/components/LimiterSection/LimiterSection.css +++ b/src/features/dsp408/components/LimiterSection/LimiterSection.css @@ -1,3 +1,22 @@ +/* LimiterSection.css */ + +/* ---------- Page wrapper ---------- */ + +.limiter-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.limiter-tabs, +.limiter-rotate-hint { + display: none; /* phones only */ +} + +.limiter-panel__label-short { + display: none; +} + +/* ---------- Control strip ---------- */ + .limiter-section { container-type: size; position: absolute; @@ -110,6 +129,8 @@ white-space: nowrap; } +/* ---------- Graph ---------- */ + .limiter-linear-graph-section { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -177,3 +198,338 @@ flex: 1; min-height: 0; } + +/* ---------- Phone (shared) ---------- + Landscape: tabs (Controls / Limiter response), one view at a time. + Portrait: controls only + a hint to rotate for the graph. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .limiter-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .limiter-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .limiter-page .limiter-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .limiter-page .limiter-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .limiter-page[data-view='controls'] .limiter-linear-graph-section, + .limiter-page[data-view='response'] .limiter-section { + display: none; + } + + /* ----- Response view: graph + meters fill everything ----- */ + + .limiter-linear-graph-section { + flex: 1 1 0; + min-height: 0; + gap: var(--space-1); + padding: var(--space-1); + } + + .limiter-graph__title { + padding: var(--space-1); + font-size: var(--font-xs); + } + + .limiter-graph__meters { + gap: var(--space-1); + padding: var(--space-1); + } + + /* ----- Controls view: strips, swipe sideways, snap per panel ----- */ + + .limiter-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .limiter-panels { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* The group is as wide as its strips (never shrunk to the viewport), + so .limiter-panels is the only thing that scrolls. */ + .limiter-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .limiter-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .limiter-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + gap: var(--space-2); + overflow: visible; /* no nested scroller: it would fight with .limiter-panels */ + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't */ + .limiter-panels > .channel-group:first-child { + margin-left: auto; + } + + .limiter-panels > .channel-group:last-child { + margin-right: auto; + } + + /* One strip per output: 3 faders side by side, full height */ + .limiter-panel { + flex: 0 0 auto; + width: clamp(160px, 22vw, 200px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + scroll-snap-align: start; + } + + .limiter-panel__title { + padding-block: var(--space-2); + font-size: var(--font-xs); + } + + .limiter-panel__grid { + grid-template-columns: repeat(3, minmax(0, 1fr)); + grid-template-rows: minmax(0, 1fr); + grid-template-areas: 'threshold attack release'; + gap: var(--space-1); + padding: var(--space-2) var(--space-1); + } + + .limiter-panel__cell { + gap: var(--space-1); + } + + .limiter-panel__cell-label { + max-width: 100%; + font-size: 10px; + overflow: hidden; + text-overflow: ellipsis; + } + + .limiter-panel__label-long { + display: none; + } + + .limiter-panel__label-short { + display: inline; + } + + /* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. + Applied to the thumb/track too so a swipe that starts on them scrolls. */ + .limiter-panel__cell > :first-child, + .limiter-panel__cell > :first-child * { + touch-action: pan-x !important; + } +} + +/* ---------- Portrait phone: controls only, 8 panels in 2 rows, each with its own layout ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .limiter-tabs { + display: none; + } + + .limiter-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-1) var(--space-2); + + font-family: var(--font-ui); + font-size: 11px; + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the controls */ + .limiter-page[data-view] .limiter-linear-graph-section { + display: none; + } + + .limiter-page[data-view] .limiter-section { + display: flex; + } + + /* Swipe sideways: both rows move together (Out1-4 on top, Out5-8 below) */ + .limiter-panels { + padding: var(--space-1); + gap: 0; + } + + .limiter-section .channel-group { + padding: 28px var(--space-1) var(--space-1); + } + + .limiter-section .channel-group__label { + top: 6px; + font-size: var(--font-xs); + } + + .limiter-section .channel-group__items { + flex: 1 1 auto; + min-height: 0; + + display: grid; + grid-template-columns: repeat(4, clamp(150px, 46vw, 200px)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + gap: var(--space-1); + } + + .limiter-panel { + width: 100%; + min-width: 0; + min-height: 0; + margin: 0; + + /* Each panel is its own size container (like the rows in GainSection): + the slider's cqh sizes (thumb, track, readout) scale to the panel height. */ + container-type: size; + } + + .limiter-panel__title { + padding-block: 4px; + font-size: 11px; + } + + /* Each panel keeps its desktop layout: Threshold tall on the left, + Attack above Release on the right */ + .limiter-panel__grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + grid-template-areas: + 'threshold attack' + 'threshold release'; + gap: 2px; + padding: 4px; + + position: relative; + z-index: 1; /* paint above the title if a thumb still reaches it */ + } + + .limiter-panel__label-long { + display: inline; + } + + .limiter-panel__label-short { + display: none; + } + + .limiter-panel__cell { + gap: 2px; + + /* The thumb sticks out of the track by half its height at min/max: leave that + room inside the cell instead of clipping it or letting it slide under the title. */ + overflow: visible; + padding-block: 3cqh; + box-sizing: border-box; + } + + .limiter-panel__cell > :first-child { + min-height: 0; + max-height: 100%; + } + + .limiter-panel__cell-label { + font-size: 10px; + line-height: 1.1; + } +} + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .limiter-panels { + padding: var(--space-1) var(--space-2); + } + + .limiter-section .channel-group { + padding-top: 24px; + } + + .limiter-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .limiter-panel { + width: clamp(150px, 19vw, 190px); + } + + .limiter-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + .limiter-panel__grid { + padding: var(--space-1); + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/LimiterSection/LimiterSection.tsx b/src/features/dsp408/components/LimiterSection/LimiterSection.tsx index 8896c6c..1a096cf 100644 --- a/src/features/dsp408/components/LimiterSection/LimiterSection.tsx +++ b/src/features/dsp408/components/LimiterSection/LimiterSection.tsx @@ -9,9 +9,9 @@ import { useState } from 'react'; import './LimiterSection.css'; const LIMITER_SLIDER_PARAMS = [ - { key: 'threshold', label: 'Threshold', min: -90, max: 20, step: 0.5, unit: ' dB' }, - { key: 'attack', label: 'Attack', min: 1, max: 999, step: 1, unit: ' ms' }, - { key: 'release', label: 'Release', min: 10, max: 3000, step: 1, unit: ' ms' }, + { key: 'threshold', label: 'Threshold', short: 'Thr', min: -90, max: 20, step: 0.5, unit: ' dB' }, + { key: 'attack', label: 'Attack', short: 'Atk', min: 1, max: 999, step: 1, unit: ' ms' }, + { key: 'release', label: 'Release', short: 'Rel', min: 10, max: 3000, step: 1, unit: ' ms' }, ] as const; type LimiterParamKey = 'threshold' | 'attack' | 'release'; @@ -29,6 +29,14 @@ type SetLimiterFn = ( release: number ) => Promise; +// Phone only: one view at a time (CSS hides the tabs on desktop) +type LimiterView = 'controls' | 'response'; + +const LIMITER_VIEWS: { id: LimiterView; label: string }[] = [ + { id: 'controls', label: 'Controls' }, + { id: 'response', label: 'Limiter response' }, +]; + function LimiterPanel({ channel, dsp, @@ -66,7 +74,10 @@ function LimiterPanel({ onChange={(value) => commit({ [param.key]: value } as Partial)} style={{ width: '100%', flex: '1 1 auto' }} /> -
{param.label}
+
+ {param.label} + {param.short} +
))}
@@ -88,6 +99,7 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite const [activeChannel, setActiveChannel] = useState(outputs[0]); const [liveLim, setLiveLim] = useState>>({}); + const [view, setView] = useState('controls'); const handleLiveValue = (channel: OutputChannel, key: LimiterParamKey, value: number) => { setActiveChannel(channel); @@ -118,7 +130,28 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite const activeLim = liveLim[activeChannel] ?? (activeOutputState.limiter as LimiterValues); return ( - <> +
+ {/* Phone only (hidden on desktop by CSS): one view at a time */} +
+ {LIMITER_VIEWS.map((v) => ( + + ))} +
+ + {/* Portrait phone only (CSS): the graph needs the width of landscape */} +
+ Rotate your phone to landscape to see the limiter graph. +
+
{activeOutputState.name} - Limiter
@@ -135,7 +168,7 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite key={output} label={outputState.name} meter={dsp.output_meters.meters[output]} - variant='output' + variant="output" /> ); })} @@ -158,8 +191,8 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite
- +
); } -export default LimiterSection; +export default LimiterSection; \ No newline at end of file From dd58425ec2444b09b14a598191be8dc8c1133618 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 11:12:59 +0100 Subject: [PATCH 09/19] feat: delay section for mobile --- .../components/DelaySection/DelaySection.css | 355 ++++++++++++++++++ .../components/DelaySection/DelaySection.tsx | 47 ++- 2 files changed, 396 insertions(+), 6 deletions(-) diff --git a/src/features/dsp408/components/DelaySection/DelaySection.css b/src/features/dsp408/components/DelaySection/DelaySection.css index fc89cab..3b26589 100644 --- a/src/features/dsp408/components/DelaySection/DelaySection.css +++ b/src/features/dsp408/components/DelaySection/DelaySection.css @@ -1,3 +1,22 @@ +/* DelaySection.css */ + +/* ---------- Page wrapper ---------- */ + +.delay-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.delay-tabs, +.delay-rotate-hint { + display: none; /* phones only */ +} + +.delay-graph-wrap { + display: contents; /* invisible on desktop: the graphs stay direct flex children */ +} + +/* ---------- Fader strip ---------- */ + .delay-section { container-type: size; @@ -80,6 +99,8 @@ box-sizing: border-box; } +/* ---------- Graphs ---------- */ + .delay-linear-graph-section { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -123,3 +144,337 @@ flex: 1; min-height: 0; } + +/* ---------- Phone (shared) ---------- + Landscape: tabs (Faders / Input delay / Output delay), one view at a time. + Portrait: faders only + a hint to rotate for the graphs. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .delay-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .delay-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .delay-page .delay-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .delay-page .delay-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .delay-page[data-view='faders'] .delay-linear-graph-section, + .delay-page:not([data-view='faders']) .delay-section, + .delay-page[data-view='input'] .delay-graph-wrap[data-panel='output'], + .delay-page[data-view='output'] .delay-graph-wrap[data-panel='input'] { + display: none; + } + + /* ----- Curve views: graph fills everything ----- */ + + .delay-linear-graph-section { + flex: 1 1 0; + min-height: 0; + flex-direction: column; + gap: 0; + padding: var(--space-1); + } + + .delay-graph-wrap { + flex: 1 1 0; + min-height: 0; + display: flex; + flex-direction: column; + } + + .delay-graph-wrap .delay-graph-panel { + flex: 1 1 0; + height: auto; + } + + .delay-graph-title { + display: none; /* the tab already says which graph this is */ + } + + /* ----- Faders view: mixer strips, swipe sideways, snap per group ----- */ + + .delay-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .delay-panels { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + .delay-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .delay-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .delay-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + overflow: visible; /* no nested scroller: it would fight with .delay-panels */ + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't */ + .delay-panels > .channel-group:first-child { + margin-left: auto; + } + + .delay-panels > .channel-group:last-child { + margin-right: auto; + } + + .delay-panel { + flex: 0 0 auto; + width: clamp(72px, 10vw, 90px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + gap: var(--space-2); + padding-bottom: var(--space-2); + } + + .delay-panel__title { + padding-block: var(--space-2); + font-size: var(--font-xs); + } + + /* The fader (element right after the title) takes all remaining height. + pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. */ + .delay-panel__title + * { + flex: 1 1 0; + min-height: 0; + width: 100%; + } + + .delay-panel__title + *, + .delay-panel__title + * * { + touch-action: pan-x !important; + } + + /* Unit selector: ms / m / ft stacked */ + .delay-unit-selector { + width: 72px; + height: auto; + align-self: center; + gap: var(--space-2); + } + + .delay-unit-selector .delay-unit-selector__btn { + width: 100% !important; + min-height: 44px !important; + padding: 0 !important; + font-size: var(--font-xs) !important; + } +} + +/* ---------- Portrait phone: faders only, Input row + Output row + Unit row ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .delay-tabs { + display: none; + } + + .delay-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-2) var(--space-3); + + font-family: var(--font-ui); + font-size: var(--font-xs); + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the faders */ + .delay-page[data-view] .delay-linear-graph-section { + display: none; + } + + .delay-page[data-view] .delay-section { + display: flex; + } + + /* Rows: Input on top, Output below (scrolls on its own), Unit at the bottom */ + .delay-panels { + flex-direction: column; + gap: var(--space-2); + overflow: hidden; + scroll-snap-type: none; + } + + .delay-section .channel-group { + flex: 1 1 0; + min-height: 0; + width: 100%; + box-sizing: border-box; + padding: 28px var(--space-2) var(--space-2); + scroll-snap-align: none; + } + + /* Input and Output rows are their own size containers: everything the slider + sizes in cqh (thumb, track, readout) scales to the row height, like in landscape. */ + .delay-section .channel-group:not(:last-child) { + container-type: size; + } + + .delay-section .channel-group__label { + top: 6px; + font-size: var(--font-xs); + } + + .delay-section .channel-group__items { + flex: 1 1 auto; + width: 100%; + min-width: 0; + gap: var(--space-1); + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + .delay-section .channel-group__items > :first-child { + margin-left: auto; + } + + .delay-section .channel-group__items > :last-child { + margin-right: auto; + } + + .delay-panel { + width: clamp(64px, 18vw, 76px); + gap: var(--space-1); + padding-bottom: var(--space-1); + scroll-snap-align: start; + } + + .delay-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + /* Unit row: compact, buttons side by side, sized by its content */ + .delay-section .channel-group:last-child { + flex: 0 0 auto; + padding-top: 24px; + } + + .delay-unit-selector { + flex-direction: row; + width: 100%; + gap: var(--space-2); + align-self: stretch; + } + + .delay-unit-selector .delay-unit-selector__btn { + flex: 1 1 0; + min-height: 36px !important; + font-size: 11px !important; + } +} + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .delay-panels { + padding: var(--space-1) var(--space-2); + } + + .delay-section .channel-group { + padding-top: 24px; + } + + .delay-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .delay-panel { + width: clamp(64px, 8vw, 84px); + gap: var(--space-1); + padding-bottom: var(--space-1); + } + + .delay-panel__title { + padding-block: var(--space-1); + font-size: 11px; + } + + .delay-unit-selector .delay-unit-selector__btn { + min-height: 36px !important; + font-size: 11px !important; + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/DelaySection/DelaySection.tsx b/src/features/dsp408/components/DelaySection/DelaySection.tsx index 83daf17..3e3a880 100644 --- a/src/features/dsp408/components/DelaySection/DelaySection.tsx +++ b/src/features/dsp408/components/DelaySection/DelaySection.tsx @@ -19,6 +19,15 @@ const DELAY_STEP: Record = { type SetDelayFn = (channel: Channel, delay: number) => Promise; +// Phone only: one view at a time (CSS hides the tabs on desktop) +type DelayView = 'faders' | 'input' | 'output'; + +const DELAY_VIEWS: { id: DelayView; label: string }[] = [ + { id: 'faders', label: 'Faders' }, + { id: 'input', label: 'Input delay' }, + { id: 'output', label: 'Output delay' }, +]; + function channelKey(channel: Channel): string { return 'Input' in channel ? `Input:${channel.Input}` : `Output:${channel.Output}`; } @@ -76,7 +85,7 @@ function DelayUnitSelector({ + ))} + + + {/* Portrait phone only (CSS): graphs need the width of landscape */} +
+ Rotate your phone to landscape to see the delay graphs. +
+
- - +
+ +
+
+ +
@@ -218,8 +253,8 @@ function DelaySection({
- + ); } -export default DelaySection; +export default DelaySection; \ No newline at end of file From 9b262348dca357a5a5279a40f3f930a871d34c05 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 11:32:18 +0100 Subject: [PATCH 10/19] feat: matrix section for mobile --- .../Matrixsection/Matrixsection.css | 321 +++++++++++++++++- .../Matrixsection/Matrixsection.tsx | 39 ++- 2 files changed, 348 insertions(+), 12 deletions(-) diff --git a/src/features/dsp408/components/Matrixsection/Matrixsection.css b/src/features/dsp408/components/Matrixsection/Matrixsection.css index a2858d3..6e5721a 100644 --- a/src/features/dsp408/components/Matrixsection/Matrixsection.css +++ b/src/features/dsp408/components/Matrixsection/Matrixsection.css @@ -1,4 +1,18 @@ -/* MatrixSection.css */ +/* Matrixsection.css (imported as './Matrixsection.css') */ + +/* ---------- Page wrapper ---------- */ + +.matrix-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.matrix-tabs, +.matrix-rotate-hint { + display: none; /* phones only */ +} + +/* ---------- Routing strip ---------- */ + .matrix-section { container-type: size; position: absolute; @@ -96,6 +110,19 @@ flex: 0 0 auto; } +.matrix-gain-stepper .choice-stepper__input { + font-size: 2.8cqh; + text-align: center; +} + +.matrix-gain-stepper .choice-stepper__arrows { + flex: 0 0 20%; + width: 20%; + padding-right: 0; +} + +/* ---------- Signal flow ---------- */ + .matrix-flow { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -107,13 +134,291 @@ -webkit-user-select: none; } -.matrix-gain-stepper .choice-stepper__input { - font-size: 2.8cqh; - text-align: center; +/* ---------- Phone (shared) ---------- + Landscape: tabs (Routing / Signal flow), one view at a time. + Portrait: routing only + a hint to rotate for the signal flow. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .matrix-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .matrix-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .matrix-page .matrix-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .matrix-page .matrix-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .matrix-page[data-view='controls'] .matrix-flow, + .matrix-page[data-view='flow'] .matrix-section { + display: none; + } + + /* ----- Flow view: fills everything ----- */ + + .matrix-flow { + flex: 1 1 0; + min-height: 0; + padding: var(--space-1); + border-bottom: none; + } + + /* ----- Routing view: strips, swipe sideways, snap per panel ----- */ + + .matrix-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .matrix-panels { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* The group is as wide as its strips (never shrunk to the viewport), + so .matrix-panels is the only thing that scrolls. */ + .matrix-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .matrix-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .matrix-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + gap: var(--space-2); + overflow: visible; /* no nested scroller: it would fight with .matrix-panels */ + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't */ + .matrix-panels > .channel-group:first-child { + margin-left: auto; + } + + .matrix-panels > .channel-group:last-child { + margin-right: auto; + } + + /* One strip per output: 4 rows of [input button | gain stepper] */ + .matrix-panel { + flex: 0 0 auto; + width: clamp(180px, 26vw, 220px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + scroll-snap-align: start; + } + + .matrix-panel__title { + padding-block: var(--space-1); + font-size: var(--font-xs); + } + + .matrix-panel__rows { + gap: var(--space-1); + padding: var(--space-1); + } + + .matrix-panel__row { + grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); + gap: var(--space-1); + padding-inline: 0; + align-items: center; + } + + /* Input toggle: fixed readable size, overrides the desktop inline cqh styles */ + .matrix-panel .matrix-panel__btn { + width: 100%; + height: 36px !important; + min-height: 0 !important; + margin: 0 !important; + padding: 0 !important; + font-size: 11px !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .matrix-panel__row .choice-stepper { + aspect-ratio: auto; + width: 100%; + height: 36px; + min-height: 0; + } + + .matrix-gain-stepper .choice-stepper__input { + font-size: 11px; + } } -.matrix-gain-stepper .choice-stepper__arrows { - flex: 0 0 20%; - width: 20%; - padding-right: 0; +/* ---------- Portrait phone: routing only, 8 panels in 2 rows ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .matrix-tabs { + display: none; + } + + .matrix-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-1) var(--space-2); + + font-family: var(--font-ui); + font-size: 11px; + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the routing */ + .matrix-page[data-view] .matrix-flow { + display: none; + } + + .matrix-page[data-view] .matrix-section { + display: flex; + } + + /* Swipe sideways: both rows move together (Out1-4 on top, Out5-8 below) */ + .matrix-panels { + padding: var(--space-1); + gap: 0; + } + + .matrix-section .channel-group { + padding: 28px var(--space-1) var(--space-1); + } + + .matrix-section .channel-group__label { + top: 6px; + font-size: var(--font-xs); + } + + .matrix-section .channel-group__items { + flex: 1 1 auto; + min-height: 0; + + display: grid; + grid-template-columns: repeat(4, clamp(170px, 50vw, 210px)); + grid-template-rows: repeat(2, minmax(0, 1fr)); + gap: var(--space-1); + } + + .matrix-panel { + width: 100%; + min-width: 0; + min-height: 0; + margin: 0; + } + + .matrix-panel__title { + padding-block: 4px; + font-size: 11px; + } + + .matrix-panel__rows { + grid-template-rows: repeat(4, minmax(0, 1fr)); + gap: 2px; + padding: 4px; + } + + .matrix-panel .matrix-panel__btn { + height: min(36px, 100%) !important; + } + + .matrix-panel__row .choice-stepper { + height: min(36px, 100%); + } } + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .matrix-panels { + padding: var(--space-1) var(--space-2); + } + + .matrix-section .channel-group { + padding-top: 24px; + } + + .matrix-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .matrix-panel { + width: clamp(170px, 24vw, 210px); + } + + .matrix-panel__title { + font-size: 11px; + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/Matrixsection/Matrixsection.tsx b/src/features/dsp408/components/Matrixsection/Matrixsection.tsx index 46cd6ca..cafb41c 100644 --- a/src/features/dsp408/components/Matrixsection/Matrixsection.tsx +++ b/src/features/dsp408/components/Matrixsection/Matrixsection.tsx @@ -24,6 +24,14 @@ const GAIN_VALUES: number[] = (() => { return values; })(); +// Phone only: one view at a time (CSS hides the tabs on desktop) +type MatrixView = 'controls' | 'flow'; + +const MATRIX_VIEWS: { id: MatrixView; label: string }[] = [ + { id: 'controls', label: 'Routing' }, + { id: 'flow', label: 'Signal flow' }, +]; + function getMatrixRoutes(dsp: DSP, output: OutputChannel): MatrixRoutes { return dsp.state.current_config.output_states[output].matrix_routes; } @@ -61,6 +69,8 @@ function MatrixSection({ ) => Promise; setActiveSidebar: React.Dispatch>; }) { + const [view, setView] = useState('controls'); + const handleToggle = (output: OutputChannel, input: InputChannel) => { const current = getRoutedInputs(dsp, output); @@ -91,7 +101,28 @@ function MatrixSection({ }; return ( - <> +
+ {/* Phone only (hidden on desktop by CSS): one view at a time */} +
+ {MATRIX_VIEWS.map((v) => ( + + ))} +
+ + {/* Portrait phone only (CSS): the signal flow needs the width of landscape */} +
+ Rotate your phone to landscape to see the signal flow. +
+
- + ); } -export default MatrixSection; +export default MatrixSection; \ No newline at end of file From 9d706fe6e21d3eb53de382afce03e3dfa9c9f4e2 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 11:41:12 +0100 Subject: [PATCH 11/19] feat: geq section for mobile --- .../components/GeqSection/GeqSection.css | 394 +++++++++++++++++- .../components/GeqSection/GeqSection.tsx | 49 ++- 2 files changed, 435 insertions(+), 8 deletions(-) diff --git a/src/features/dsp408/components/GeqSection/GeqSection.css b/src/features/dsp408/components/GeqSection/GeqSection.css index 02374ac..9167beb 100644 --- a/src/features/dsp408/components/GeqSection/GeqSection.css +++ b/src/features/dsp408/components/GeqSection/GeqSection.css @@ -1,3 +1,18 @@ +/* GeqSection.css */ + +/* ---------- Page wrapper ---------- */ + +.geq-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.geq-tabs, +.geq-rotate-hint { + display: none; /* phones only */ +} + +/* ---------- Control strip ---------- */ + .geq-section { container-type: size; @@ -45,8 +60,6 @@ flex-direction: row; align-items: stretch; - /* padding: 2cqh 1.5cqh; */ - border: var(--border-width) solid var(--border-hairline); border-radius: var(--radius-md); box-sizing: border-box; @@ -106,6 +119,8 @@ min-height: 0; } +/* ---------- Graph ---------- */ + .geq-linear-graph-section { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -175,3 +190,378 @@ opacity: 0.85; user-select: none; } + +/* ---------- Phone (shared) ---------- + Landscape: tabs (Faders / GEQ curve), one view at a time. + Portrait: faders only + a hint to rotate for the graph. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .geq-page { + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .geq-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .geq-page .geq-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .geq-page .geq-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .geq-page[data-view='faders'] .geq-linear-graph-section, + .geq-page[data-view='curve'] .geq-section { + display: none; + } + + /* ----- Curve view: graph fills everything ----- */ + + .geq-linear-graph-section { + flex: 1 1 0; + min-height: 0; + gap: 0; + padding: var(--space-1); + } + + .geq-graph-panel { + flex: 1 1 0; + height: auto; + } + + .geq-graph-title { + padding: var(--space-1); + font-size: var(--font-xs); + } + + /* ----- Faders view: [Input | Actions] then 31 bands, all in one sideways swipe ----- */ + + .geq-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .geq-panels { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + .geq-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + } + + .geq-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .geq-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + overflow: visible; /* no nested scroller: it would fight with .geq-panels */ + } + + /* Input selector + actions come first so they are always one swipe away */ + .geq-side-panels { + order: -1; + flex: 0 0 auto; + height: auto; + align-self: stretch; + gap: var(--space-2); + } + + .geq-side-panels > :first-child, + .geq-side-panels > :last-child { + flex: 1 1 0; + min-height: 0; + } + + .geq-side-panels .channel-group { + width: 100%; + height: 100%; + } + + /* Input: 2x2 buttons. Actions: Bypass above Reset. */ + .geq-channel-selector { + width: 124px; + height: auto; + align-self: stretch; + justify-content: center; + gap: var(--space-1); + } + + .geq-side-panels > :first-child .geq-channel-selector { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-content: center; + } + + .geq-channel-selector .geq-btn { + width: 100% !important; + height: 34px !important; + min-height: 0 !important; + padding: 0 !important; + font-size: 11px !important; + overflow: hidden; + text-overflow: ellipsis; + } + + /* The 31 bands: fixed width per band so they stay usable, the strip scrolls */ + .geq-band-panel { + flex: 0 0 auto; + width: calc(var(--geq-bands, 31) * 40px + 8px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + padding-block: var(--space-1); + } + + .geq-band-cell { + flex: 0 0 40px; + min-width: 40px; + gap: var(--space-1); + } + + .geq-band-cell__label { + font-size: 10px; + } + + /* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. + Applied to the thumb/track too so a swipe that starts on them scrolls. */ + .geq-band-cell > :first-child, + .geq-band-cell > :first-child * { + touch-action: pan-x !important; + } +} + +/* ---------- Portrait phone: buttons on top, bands in 2 rows below ---------- */ + +@media (max-width: 768px) and (orientation: portrait) { + .geq-tabs { + display: none; + } + + .geq-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-2) var(--space-3); + + font-family: var(--font-ui); + font-size: var(--font-xs); + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the faders */ + .geq-page[data-view] .geq-linear-graph-section { + display: none; + } + + .geq-page[data-view] .geq-section { + display: flex; + } + + /* Column: [Input | Actions] bar on top, bands below taking all the rest */ + .geq-panels { + flex-direction: column; + gap: var(--space-2); + overflow: hidden; + scroll-snap-type: none; + padding: var(--space-1) var(--space-2); + } + + .geq-section .channel-group { + padding: 24px var(--space-2) var(--space-2); + } + + .geq-section .channel-group__label { + top: 5px; + font-size: var(--font-xs); + } + + /* ----- Buttons bar ----- */ + + .geq-side-panels { + flex-direction: row; + flex: 0 0 auto; + align-self: stretch; + width: 100%; + height: auto; + gap: var(--space-2); + } + + .geq-side-panels > :first-child { + flex: 2 1 0; + } + + .geq-side-panels > :last-child { + flex: 1 1 0; + } + + .geq-side-panels .channel-group { + width: auto; + height: auto; + min-width: 0; + box-sizing: border-box; + } + + .geq-side-panels .channel-group__items { + width: 100%; + height: auto; + } + + .geq-channel-selector { + width: 100%; + height: auto; + gap: var(--space-1); + } + + /* Input: 4 buttons in a row. Actions: Bypass | Reset in a row. */ + .geq-side-panels > :first-child .geq-channel-selector { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + + .geq-side-panels > :last-child .geq-channel-selector { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .geq-channel-selector .geq-btn { + height: 40px !important; + font-size: 12px !important; + } + + /* ----- Bands: 2 rows, both rows scroll together ----- */ + + .geq-panels > .channel-group { + flex: 1 1 0; + min-height: 0; + width: 100%; + box-sizing: border-box; + } + + .geq-panels > .channel-group .channel-group__items { + flex: 1 1 auto; + width: 100%; + min-width: 0; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: none; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* Bands 1-16 on the first row, 17-31 on the second: column N holds band N and N+16 */ + .geq-band-panel { + display: grid; + grid-template-columns: repeat(var(--geq-cols, 16), 40px); + grid-template-rows: repeat(2, minmax(0, 1fr)); + grid-auto-flow: row; + gap: var(--space-1) 0; + + width: calc(var(--geq-cols, 16) * 40px + 8px); + padding: var(--space-1); + } + + /* Each slider cell is its own size container: the slider's cqh sizes + (thumb, track, readout) scale to this cell, i.e. about half the height. */ + .geq-band-cell { + width: auto; + min-width: 0; + min-height: 0; + container-type: size; + + /* room for the thumb sticking out of the track at min/max */ + padding-block: 8px; + box-sizing: border-box; + overflow: visible; + } + + .geq-band-cell > :first-child { + min-height: 0; + max-height: 100%; + } +} + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .geq-panels { + padding: var(--space-1) var(--space-2); + } + + .geq-section .channel-group { + padding-top: 24px; + } + + .geq-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .geq-channel-selector .geq-btn { + height: 32px !important; + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/GeqSection/GeqSection.tsx b/src/features/dsp408/components/GeqSection/GeqSection.tsx index f3ac8bc..cf8febd 100644 --- a/src/features/dsp408/components/GeqSection/GeqSection.tsx +++ b/src/features/dsp408/components/GeqSection/GeqSection.tsx @@ -24,6 +24,14 @@ type SetGeqBandFn = ( type SetGeqBypassFn = (input: InputChannel, bypass: boolean) => Promise; +// Phone only: one view at a time (CSS hides the tabs on desktop) +type GeqView = 'faders' | 'curve'; + +const GEQ_VIEWS: { id: GeqView; label: string }[] = [ + { id: 'faders', label: 'Faders' }, + { id: 'curve', label: 'GEQ curve' }, +]; + function GeqBandPanel({ channel, dsp, @@ -39,7 +47,15 @@ function GeqBandPanel({ const geq = inputState.geq; return ( -
+
{GEQ_BANDS_LABEL.map(({ frequency, label }) => (
onSelect(c)} style={{ width: '100%', @@ -109,7 +125,7 @@ function GeqActions({
+ ))} +
+ + {/* Portrait phone only (CSS): the graph needs the width of landscape */} +
Rotate your phone to landscape to see the GEQ graph.
+
)} - +
); } -export default GeqSection; +export default GeqSection; \ No newline at end of file From f456cb21d90a1854ae5f45b667558ba3006d9830 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 11:51:38 +0100 Subject: [PATCH 12/19] fix: right padding on topbar for mobile --- README.md | 2 +- src/components/Topbar/Topbar.css | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5d4042..39ce599 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ This template should help get you started developing with Tauri, React and Types - Check end to end behavioour -- Make phone version (Crown on topbar dont respect phoen padding + Open keyboard on phone when input slider) +- Make phone version (Open keyboard on phone when input slider) diff --git a/src/components/Topbar/Topbar.css b/src/components/Topbar/Topbar.css index b4c9c75..884965a 100644 --- a/src/components/Topbar/Topbar.css +++ b/src/components/Topbar/Topbar.css @@ -316,7 +316,9 @@ --logo-size: 2.2rem; gap: 0; padding-left: 0; - padding-right: var(--space-2); + padding-right: calc(var(--space-2) + var(--safe-right)); + box-sizing: border-box; + min-width: 0; } /* Logo centred in the rail area; tabstrip's border-left lands exactly on the sidebar's right border */ From 776bc0c95d802c6bcac894776bd0d276e5010fd1 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 29 Oct 2026 11:58:52 +0100 Subject: [PATCH 13/19] chore: readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39ce599..81a28e9 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ This template should help get you started developing with Tauri, React and Types - Check end to end behavioour -- Make phone version (Open keyboard on phone when input slider) +- Make phone version From 51c0c44ded21b3ea222b23f996210b6a8abf7501 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 30 Oct 2026 13:52:54 +0100 Subject: [PATCH 14/19] fix: arrow in selector --- src/components/ChoiceSelect/ChoiceSelect.css | 99 ++++++++++++-------- src/pages/AddDspPage/AddDspPage.css | 4 - 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/src/components/ChoiceSelect/ChoiceSelect.css b/src/components/ChoiceSelect/ChoiceSelect.css index 64de880..31b9920 100644 --- a/src/components/ChoiceSelect/ChoiceSelect.css +++ b/src/components/ChoiceSelect/ChoiceSelect.css @@ -1,24 +1,54 @@ -/* ChoiceSelect.css */ +/* ------ root ------ */ + .choice-select { + width: 100%; + height: 100%; + min-width: 0; + min-height: 0; + flex: 1 1 auto; + position: relative; display: flex; - - container-type: size; - height: var(--card-control-height); + align-items: stretch; - color: var(--accent-brand); + box-sizing: border-box; + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + background: transparent; } .choice-select[data-disabled] { opacity: 0.5; } +/* ------ label ------ */ + +.choice-select__label { + flex: 1 1 auto; + min-width: 0; + width: 100%; + + font-family: var(--font-mono); + font-size: var(--font--sm); + font-weight: var(--font-weight-normal); + text-align: left; + + background: transparent; + border: none; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/* ------ trigger ------ */ + .choice-select__trigger { - /* Keep the existing outer dimensions and border */ flex: 1 1 auto; width: 100%; height: 100%; min-width: 0; + min-height: 0; display: flex; align-items: center; @@ -28,6 +58,7 @@ padding-left: 5%; padding-right: 1%; + box-sizing: border-box; background: transparent; border: var(--border-width) solid var(--border-hairline); border-radius: var(--radius-sm); @@ -49,16 +80,6 @@ cursor: not-allowed; } -.choice-select__label { - flex: 1 1 auto; - min-width: 0; - - text-align: left; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - .choice-select__chevron { flex: 0 0 auto; align-self: stretch; @@ -81,29 +102,11 @@ .choice-select__chevron svg { display: block; width: auto; - height: 100%; + height: 85%; max-width: none; } -.choice-select__option { - padding: 1%; - border-radius: var(--radius-sm); - font-size: 100%; - color: var(--text-primary); - cursor: pointer; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.choice-select__option--highlight { - background: var(--bg-raised); -} - -.choice-select__option--selected { - color: var(--accent-brand); - font-weight: var(--font-weight-semibold); -} +/* ------ listbox ------ */ .choice-select__listbox { position: absolute; @@ -133,5 +136,27 @@ .choice-select__listbox--portal { position: fixed; - z-index: 1000; /* clear of any local stacking contexts in the panel */ + z-index: 1000; +} + +/* ------ listbox options ------ */ + +.choice-select__option { + padding: 1%; + border-radius: var(--radius-sm); + font-size: 100%; + color: var(--text-primary); + cursor: pointer; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.choice-select__option--highlight { + background: var(--bg-raised); +} + +.choice-select__option--selected { + color: var(--accent-brand); + font-weight: var(--font-weight-semibold); } diff --git a/src/pages/AddDspPage/AddDspPage.css b/src/pages/AddDspPage/AddDspPage.css index 4597e82..ebce3ad 100644 --- a/src/pages/AddDspPage/AddDspPage.css +++ b/src/pages/AddDspPage/AddDspPage.css @@ -187,10 +187,6 @@ color: var(--border-hairline); } -.choice-stepper__input:disabled { - cursor: not-allowed; -} - /* ---------- Phone / touch ---------- */ @media (pointer: coarse) { From f78d872625de7e43ef54de20bf7181127e1376ed Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 30 Oct 2026 15:25:12 +0100 Subject: [PATCH 15/19] feat: misc section for mobile --- .../MiscellaneousSection/CopyChannelModal.css | 80 +++++++- .../MiscellaneousSection/CopyChannelModal.tsx | 6 +- .../LinkChannelsModal.css | 171 +++++++++++++++++- .../LinkChannelsModal.tsx | 10 +- .../MiscellaneousSection.css | 150 +++++++++++++-- 5 files changed, 387 insertions(+), 30 deletions(-) diff --git a/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.css b/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.css index 23a5a31..2ce8985 100644 --- a/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.css +++ b/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.css @@ -137,20 +137,92 @@ margin-top: var(--space-2); } -/* Mobile */ +/* ---------- Phone (shared) ---------- */ -@media (max-width: 600px) { +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .copy-channel-overlay { + padding: var(--space-2); + box-sizing: border-box; + } + + .copy-channel-modal { + --card-control-height: 44px; + + width: 100%; + max-width: 440px; + max-height: calc(100dvh - var(--space-4)); + box-sizing: border-box; + + overflow-x: hidden; + overflow-y: auto; + } + + /* From / arrow / To stacked */ .copy-channel-modal__transfer { flex-direction: column; align-items: stretch; + gap: var(--space-2); } .copy-channel-modal__arrow { + width: 100%; + height: auto; + } + + /* Rotate the SVG only, so the container keeps a sensible size */ + .copy-channel-modal__arrow svg { transform: rotate(90deg); } .copy-channel-modal__actions { - justify-content: flex-start; - flex-wrap: wrap; + flex-direction: column-reverse; + align-items: stretch; + gap: var(--space-2); + } + + .copy-channel-modal__actions > * { + width: 100%; + } +} + +/* ---------- Landscape phone: From -> To on one row ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .copy-channel-modal { + --card-control-height: 36px; + } + + .copy-channel-modal__transfer { + flex-direction: row; + align-items: flex-end; + gap: var(--space-3); + } + + .copy-channel-modal__arrow { + width: auto; + height: var(--card-control-height); + } + + .copy-channel-modal__arrow svg { + transform: none; + } + + .copy-channel-modal__actions { + flex-direction: row; + align-items: center; + justify-content: flex-end; + } + + .copy-channel-modal__actions > * { + width: auto; + } +} + +@keyframes copy-channel-slide-up { + from { + transform: translateY(100%); + } + to { + transform: translateY(0); } } \ No newline at end of file diff --git a/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.tsx b/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.tsx index 2c68c98..cdd0f85 100644 --- a/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.tsx +++ b/src/features/dsp408/components/MiscellaneousSection/CopyChannelModal.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useState } from 'react'; +import { createPortal } from 'react-dom'; import { Channel, InputChannel, OutputChannel } from '../../types'; import Button from '../../../../components/Button/Button'; @@ -70,7 +71,7 @@ function CopyChannelModal({ } }; - return ( + return createPortal(
{ @@ -138,7 +139,8 @@ function CopyChannelModal({
-
+
, + document.body ); } diff --git a/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.css b/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.css index af8548f..15d7aab 100644 --- a/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.css +++ b/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.css @@ -223,15 +223,174 @@ margin-top: var(--space-2); } -/* Mobile */ +/* ---------- Phone (shared) ---------- */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .link-channels-overlay { + padding: var(--space-2); + box-sizing: border-box; + } + + .link-channels-modal { + --card-control-height: 44px; + + width: 100%; + max-width: 480px; + max-height: calc(100dvh - var(--space-4)); + box-sizing: border-box; + + overflow-x: hidden; + overflow-y: auto; + } + + .link-channels-modal__mode-toggle { + display: grid; + grid-template-columns: 1fr 1fr; + width: 100%; + box-sizing: border-box; + } + + /* Same specificity as the base rule, so it can't be beaten by a global touch rule */ + .link-channels-modal .link-channels-modal__mode-btn { + flex: none; + height: 100%; + min-height: 0; + padding: 0 var(--space-2); + font-size: var(--font-sm); + border-width: var(--border-width); + -webkit-appearance: none; + appearance: none; + } + + .link-channels-modal__mode-btn { + flex: 1; + } + + /* Matrix: "Out1".."Out8" at --font-sm needs ~310px, so smaller labels and gaps */ + .link-matrix { + gap: 2px; + width: 100%; + box-sizing: border-box; + } + + .link-matrix__col-label, + .link-matrix__row-label { + min-width: 0; + font-size: 10px; + letter-spacing: -0.02em; + } + + .link-matrix__row-label { + padding-right: var(--space-1); + } -@media (max-width: 600px) { .link-matrix__cell { - min-width: 26px; + position: relative; + width: 100%; + max-width: 32px; + height: auto; + min-width: 0; + aspect-ratio: 1 / 1; + } + + /* Bigger invisible tap area, same visual size */ + .link-matrix__cell--toggle::after { + content: ''; + position: absolute; + inset: -2px; + } + + /* No sticky hover state on touch */ + .link-matrix__cell--toggle:hover { + border-color: var(--border-hairline); + } + + .link-matrix__cell--toggle.is-active:hover { + border-color: var(--accent-brand); } .link-channels-modal__actions { - justify-content: flex-start; - flex-wrap: wrap; + flex-direction: column-reverse; + align-items: stretch; + gap: var(--space-2); } -} \ No newline at end of file + + .link-channels-modal__actions > * { + width: 100%; + } +} + +/* ---------- Landscape phone: controls left, matrix right ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .link-channels-modal { + --card-control-height: 34px; + + max-width: 640px; + + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + grid-template-rows: auto auto 1fr; + grid-template-areas: + 'header matrix' + 'toggle matrix' + 'actions matrix'; + column-gap: var(--space-4); + align-items: start; + } + + .link-channels-modal__header { + grid-area: header; + margin-bottom: var(--space-2); + } + + .link-channels-modal__mode-toggle { + grid-area: toggle; + margin-bottom: 0; + } + + .link-matrix { + grid-area: matrix; + align-self: center; + justify-self: center; + + display: grid; + grid-auto-rows: 22px; + align-content: center; + + width: max-content; + min-width: calc(38px + (8 * 22px) + (8 * 3px)); + min-height: calc(9 * 22px + 8 * 3px); + gap: 3px; + + box-sizing: border-box; + } + + .link-matrix__cell { + width: 22px; + height: 16px; + min-height: 0; + aspect-ratio: auto; + align-self: center; + } + + .link-channels-modal__actions { + grid-area: actions; + align-self: end; + flex-direction: row; + justify-content: flex-end; + } + + .link-channels-modal__actions > * { + width: auto; + } +} + +@keyframes link-channels-slide-up { + from { + transform: translateY(100%); + } + to { + transform: translateY(0); + } +} diff --git a/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.tsx b/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.tsx index 696843b..2c61e45 100644 --- a/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.tsx +++ b/src/features/dsp408/components/MiscellaneousSection/LinkChannelsModal.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react'; +import { createPortal } from 'react-dom'; import { DSP408 } from '../../../../types'; import { Channel, InputChannel, OutputChannel } from '../../types'; @@ -244,7 +245,7 @@ function LinkChannelsModal({ } }; - return ( + return createPortal(
{ @@ -286,7 +287,9 @@ function LinkChannelsModal({
@@ -361,7 +364,8 @@ function LinkChannelsModal({
-
+
, + document.body ); } diff --git a/src/features/dsp408/components/MiscellaneousSection/MiscellaneousSection.css b/src/features/dsp408/components/MiscellaneousSection/MiscellaneousSection.css index 1adeb2e..363c26c 100644 --- a/src/features/dsp408/components/MiscellaneousSection/MiscellaneousSection.css +++ b/src/features/dsp408/components/MiscellaneousSection/MiscellaneousSection.css @@ -178,21 +178,6 @@ height: 65%; } - - -/* Mobile */ - -@media (max-width: 600px) { - .miscellaneous-panel__row { - flex-direction: column; - } - - .miscellaneous-panel__actions { - justify-content: flex-start; - flex-wrap: wrap; - } -} - .miscellaneous-panel { user-select: none; -webkit-user-select: none; @@ -247,4 +232,139 @@ margin-top: var(--space-5); } +/* ---------- Phone (shared) ---------- */ +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + /* Scrolls when the content is taller than the screen */ + .miscellaneous-section { + height: 100%; + min-height: 0; + padding: var(--space-3); + box-sizing: border-box; + + overflow-x: hidden; + overflow-y: auto; + } + + /* margin: auto centers both ways when it fits, and starts at the top + (no clipping) when it doesn't. align-items: center can't do that. */ + .miscellaneous-panel { + --card-control-height: 44px; + + width: 100%; + max-width: 720px; + margin: auto; + box-sizing: border-box; + } + + .miscellaneous-panel__section-header { + flex-direction: column; + align-items: flex-start; + gap: var(--space-1); + } + + .miscellaneous-panel__row { + flex-direction: column; + gap: var(--space-2); + } + + /* 16px stops iOS Safari from zooming on focus */ + .miscellaneous-panel__field input { + width: 100%; + box-sizing: border-box; + font-size: 16px; + } + + .miscellaneous-panel__password-toggle { + right: 0; + width: 44px; + } + + .miscellaneous-panel__actions { + flex-direction: column; + align-items: stretch; + gap: var(--space-2); + } + + .miscellaneous-panel__actions > * { + width: 100%; + } + + .miscellaneous-panel__section--danger .miscellaneous-panel__section-header p { + max-width: none; + } + + /* Confirm modal: still centered, the margin lives on the overlay */ + .confirm-modal-overlay { + padding: var(--space-3); + box-sizing: border-box; + } + + .confirm-modal { + width: 100%; + max-width: 400px; + max-height: 100%; + margin: 0; + box-sizing: border-box; + overflow-y: auto; + } + + .confirm-modal__actions { + flex-direction: column-reverse; /* primary action on top */ + gap: var(--space-2); + } + + .confirm-modal__actions > * { + width: 100%; + } +} + +/* ---------- Landscape phone ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .miscellaneous-section { + padding: var(--space-2); + } + + .miscellaneous-panel { + --card-control-height: 36px; + } + + /* Title left, description right, wraps if it doesn't fit */ + .miscellaneous-panel__section-header { + flex-direction: row; + flex-wrap: wrap; + align-items: baseline; + justify-content: space-between; + gap: 0 var(--space-3); + } + + .miscellaneous-panel__section-header p { + flex: 1 1 200px; + min-width: 0; + text-align: right; + } + + .miscellaneous-panel__row { + flex-direction: row; + gap: var(--space-3); + } + + .miscellaneous-panel__actions { + flex-direction: row; + align-items: center; + justify-content: flex-end; + } + + .miscellaneous-panel__actions > * { + width: auto; + } + + .confirm-modal__actions { + flex-direction: row; + } + + .confirm-modal__actions > * { + width: auto; + } +} \ No newline at end of file From 3caec3041343982ef6a9fc2f324c65a0a2857863 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 30 Oct 2026 15:39:33 +0100 Subject: [PATCH 16/19] feat: peq section for mobile --- .../ChannelSection/ChannelSection.css | 666 +++++++++++++++--- .../ChannelSection/ChannelSection.tsx | 243 ++++--- 2 files changed, 737 insertions(+), 172 deletions(-) diff --git a/src/features/dsp408/components/ChannelSection/ChannelSection.css b/src/features/dsp408/components/ChannelSection/ChannelSection.css index 3948725..97fed7d 100644 --- a/src/features/dsp408/components/ChannelSection/ChannelSection.css +++ b/src/features/dsp408/components/ChannelSection/ChannelSection.css @@ -1,4 +1,35 @@ -/* InputSection.css */ +/* ChannelSection.css */ + +/* Font-size hooks: desktop uses the cqh values, the phone block below + overrides them with fixed px sizes. + --ch-fs main text in the control strip (titles, steppers, buttons) + --ch-fs-action buttons in the Actions group + --ch-fs-label small labels under the sliders */ + +/* ---------- Page wrapper ---------- */ + +.channel-page { + display: contents; /* invisible on desktop; a flex column on phones */ +} + +.channel-tabs, +.channel-rotate-hint { + display: none; /* phones only */ +} + +.channel-panel__label-short, +.peq-band-list__label-short { + display: none; +} + +/* Invisible wrappers on desktop (layout identical to before) */ +.peq-block, +.crossover-panel__slider { + display: contents; +} + +/* ---------- Graph ---------- */ + .channel-graph-section { flex: 0 0 calc(100% - var(--dsp-control-heigth)); min-height: 0; @@ -65,9 +96,55 @@ min-height: 0; } -/* Bottom control bar — same pattern as .compressor-section: absolute, +.channel-graph-panel__magnitude-wrap { + flex: 1 1 0; + min-height: 0; + min-width: 0; + position: relative; +} + +.channel-graph__title-row { + flex: 0 0 auto; + display: flex; + align-items: center; + justify-content: space-between; + padding: 1cqh 1.5cqh; +} + +.channel-graph__title-row .channel-graph__title { + padding: 0; /* was on the standalone title element; row now owns spacing */ +} + +.channel-graph-view-toggle { + display: flex; + gap: 0.4cqh; + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + padding: 0.3cqh; + background: var(--bg-void); +} + +.channel-graph-view-toggle__btn { + font-family: var(--font-ui); + font-size: 2cqh; + padding: 0.6cqh 1.2cqh; + background: transparent; + color: var(--text-muted); + border: none; + border-radius: var(--radius-sm); + cursor: pointer; +} + +.channel-graph-view-toggle__btn.active { + background: var(--accent-brand); + color: var(--bg-void); +} + +/* ---------- Control strip ---------- + Bottom control bar — same pattern as .compressor-section: absolute, bottom-anchored, panels flow in a row and scroll horizontally instead of squeezing into a fixed max-width. */ + .channel-control-section { container-type: size; position: absolute; @@ -105,7 +182,8 @@ padding: 2cqh; } -/* Peq Sliders */ +/* ---------- PEQ sliders ---------- */ + .channel-panel { position: relative; height: 100%; @@ -129,7 +207,7 @@ width: 100%; text-align: center; font-family: var(--font-ui); - font-size: 4cqh; + font-size: var(--ch-fs, 4cqh); font-weight: var(--font-weight-semibold); padding-top: 2cqh; padding-bottom: 2cqh; @@ -167,11 +245,13 @@ .channel-panel__cell-label { flex: 0 0 auto; font-family: var(--font-ui); - font-size: 3.2cqh; + font-size: var(--ch-fs-label, 3.2cqh); color: var(--text-muted); white-space: nowrap; } +/* ---------- Crossover ---------- */ + .crossover-panel { position: relative; height: 100%; @@ -196,7 +276,7 @@ width: 100%; text-align: center; font-family: var(--font-ui); - font-size: 4cqh; + font-size: var(--ch-fs, 4cqh); font-weight: var(--font-weight-semibold); padding-top: 2cqh; padding-bottom: 2cqh; @@ -207,36 +287,20 @@ text-overflow: ellipsis; } -/* Now the root of a ChoiceSelect rather than a native . */ .crossover-panel__select { flex: 0 0 auto; width: 85%; + height: auto; + min-height: 0; + font-family: var(--font-ui); -} + font-size: var(--ch-fs, 4cqh); -.crossover-panel__select .choice-select__input, -.crossover-panel__select .choice-select__input option { - font-size: 4cqh; color: var(--accent-brand); - /* padding-left: 1cqh; */ } -.crossover-panel__select { - flex: 0 0 auto; - width: 85%; - font-family: var(--font-ui); - font-size: 4cqh; -} - -.crossover-panel__select .choice-select__input, -.crossover-panel__select .choice-select__input option { - height: 100%; - padding: 0; - padding-left: 2cqh; - font-size: 4cqh; - color: var(--accent-brand); - border-radius: var(--radius-sm); -} +/* ---------- PEQ band list ---------- */ .peq-band-list { flex: 1 1 auto; @@ -267,6 +331,8 @@ align-items: stretch; gap: 1cqh; + color: var(--accent-brand); + box-sizing: border-box; } @@ -274,7 +340,7 @@ flex: 0 0 auto; font-family: var(--font-ui); - font-size: 4cqh; + font-size: var(--ch-fs, 4cqh); color: var(--text-primary); text-align: center; font-weight: var(--font-weight-semibold); @@ -334,66 +400,494 @@ min-height: 0; font-family: var(--font-ui); - font-size: 4cqh; + font-size: var(--ch-fs, 4cqh); } -.channel-graph-panel__magnitude-wrap { - flex: 1 1 0; - min-height: 0; - min-width: 0; - position: relative; -} - -.channel-graph__title-row { - flex: 0 0 auto; - display: flex; - align-items: center; - justify-content: space-between; - padding: 1cqh 1.5cqh; -} - -.channel-graph__title-row .channel-graph__title { - padding: 0; /* was on the standalone title element; row now owns spacing */ -} - -.channel-graph-view-toggle { - display: flex; - gap: 0.4cqh; - border: var(--border-width) solid var(--border-hairline); - border-radius: var(--radius-sm); - padding: 0.3cqh; - background: var(--bg-void); -} - -.channel-graph-view-toggle__btn { - font-family: var(--font-ui); - font-size: 2cqh; - padding: 0.6cqh 1.2cqh; - background: transparent; - color: var(--text-muted); - border: none; - border-radius: var(--radius-sm); - cursor: pointer; -} - -.channel-graph-view-toggle__btn.active { - background: var(--accent-brand); - color: var(--bg-void); -} - -.peq-band-list__stepper .choice-stepper__input, -.peq-band-list__select .choice-select__input { +.peq-channel-selector { + width: 80px; height: 100%; - min-height: 0; + align-self: stretch; - font-family: var(--font-mono); - font-size: 4cqh; - color: var(--accent-brand); + display: flex; + flex-direction: column; + justify-content: center; + align-items: stretch; - background: transparent; - - text-align: center; - text-align-last: center; - padding: 0; - margin: 0; + gap: var(--space-1); + box-sizing: border-box; } + +/* ---------- Phone (shared) ---------- + Landscape: tabs (Controls / Filter response), one view at a time. + Portrait: controls only + a hint to rotate for the graphs. */ + +@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) { + .channel-page { + --ch-fs: 11px; + --ch-fs-action: 12px; + --ch-fs-label: 10px; + --peq-list-width: 480px; + + flex: 1 1 0; + min-height: 0; + width: 100%; + + display: flex; + flex-direction: column; + background: var(--bg-panel); + } + + /* ----- Tabs ----- */ + + .channel-tabs { + flex: 0 0 auto; + display: flex; + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + border-bottom: var(--border-width) solid var(--border-hairline); + } + + .channel-page .channel-tabs__tab { + flex: 1 1 0; + min-width: 0; + min-height: 0; + height: 34px; + padding: 0 var(--space-2); + + font-family: var(--font-ui); + font-size: var(--font-xs); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + background: var(--bg-void); + color: var(--text-muted); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-sm); + cursor: pointer; + } + + .channel-page .channel-tabs__tab[aria-selected='true'] { + background: var(--bg-raised); + color: var(--text-primary); + border-color: var(--accent-brand); + } + + /* ----- Which view is visible ----- */ + + .channel-page[data-view='controls'] .channel-graph-section, + .channel-page:not([data-view='controls']) .channel-control-section { + display: none; + } + + /* ----- Magnitude / Phase tabs: one graph fills everything ----- */ + + .channel-graph-section { + flex: 1 1 0; + min-height: 0; + gap: var(--space-1); + padding: var(--space-1); + } + + .channel-graph__title { + padding: 0; + font-size: var(--font-xs); + } + + .channel-graph__title-row { + padding: var(--space-1); + gap: var(--space-2); + } + + .channel-graph-view-toggle { + gap: 2px; + padding: 2px; + } + + .channel-graph-view-toggle__btn { + font-size: 11px; + padding: 4px 10px; + } + + .channel-bypass-overlay span { + font-size: 28px; + } + + /* ----- Controls view: groups, swipe sideways, snap per group ----- */ + + .channel-control-section { + position: relative; + z-index: auto; + flex: 1 1 0; + height: auto; + min-height: 0; + + align-items: stretch; + justify-content: flex-start; + border-top: none; + } + + .channel-control-panel { + display: flex; + justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */ + width: 100%; + min-width: 0; + height: auto; + gap: var(--space-3); + padding: var(--space-2); + box-sizing: border-box; + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: x proximity; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* Each group is as wide as its content (never shrunk to the viewport), + so .channel-control-panel is the only thing that scrolls. */ + .channel-control-section .channel-group { + flex: 0 0 auto; + width: max-content; + max-width: none; + margin: 0; + padding: 30px var(--space-2) var(--space-2); + scroll-snap-align: start; + } + + .channel-control-section .channel-group__label { + top: 7px; + font-size: var(--font-sm); + } + + .channel-control-section .channel-group__items { + height: auto; + align-self: stretch; + justify-content: flex-start; + gap: var(--space-2); + overflow: visible; /* no nested scroller: it would fight with .channel-control-panel */ + } + + /* Centered when everything fits, left-aligned and scrollable when it doesn't */ + .channel-control-panel > .channel-group:first-child { + margin-left: auto; + } + + .channel-control-panel > .channel-group:last-child { + margin-right: auto; + } + + /* PEQ group: band table + slider panel side by side (landscape) */ + .peq-block { + display: flex; + flex-direction: row; + align-items: stretch; + gap: var(--space-2); + min-height: 0; + } + + .peq-band-list { + flex: 0 0 auto; + width: var(--peq-list-width); + gap: 3px; + padding: 3px; + } + + .peq-band-list__row { + gap: 3px; + } + + .peq-band-list__row--header { + padding-block: 3px; + } + + .channel-panel { + flex: 0 0 auto; + width: clamp(210px, 28vw, 260px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + } + + .channel-panel__title { + padding-block: var(--space-1); + } + + .channel-panel__grid { + gap: var(--space-1); + padding: var(--space-2) var(--space-1); + } + + .channel-panel__cell { + gap: var(--space-1); + } + + .channel-panel__cell-label { + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + } + + /* Crossover: two narrow strips */ + .crossover-panel { + flex: 0 0 auto; + width: clamp(80px, 8vw, 100px); + height: auto; /* stretches to the row */ + aspect-ratio: auto; + gap: var(--space-2); + padding-bottom: var(--space-2); + } + + .peq-channel-selector { + width: 80px; + height: 100%; + align-self: stretch; + + display: flex; + flex-direction: column; + justify-content: center; + align-items: stretch; + + gap: var(--space-2); + box-sizing: border-box; + } + + .crossover-panel__title { + padding-block: var(--space-1); + } + + .crossover-panel__slider > * { + min-height: 0; + } + + .peq-band-list__label-long { + display: none; + } + + .peq-band-list__label-short { + display: inline; + } + + .channel-panel__label-long { + display: none; + } + + .channel-panel__label-short { + display: inline; + } + + /* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. + Applied to the thumb/track too so a swipe that starts on them scrolls. */ + .channel-panel__cell > :first-child, + .channel-panel__cell > :first-child *, + .crossover-panel__slider, + .crossover-panel__slider * { + touch-action: pan-x !important; + } +} + +/* ---------- Portrait phone: controls only, no groups ---------- + Row 1: PEQ band table (full width) + Row 2: PEQ sliders | HighPass | LowPass | Actions (all on the same row) + The groups are flattened (display: contents) so panels from different + groups can share a row. Nothing scrolls. */ + +@media (max-width: 768px) and (orientation: portrait) { + .channel-page { + --ch-fs: 11px; + --ch-fs-action: 13px; + } + + .channel-tabs { + display: none; + } + + .channel-rotate-hint { + flex: 0 0 auto; + display: block; + padding: var(--space-1) var(--space-2); + + font-family: var(--font-ui); + font-size: 11px; + text-align: center; + color: var(--text-muted); + + border-bottom: var(--border-width) solid var(--border-hairline); + } + + /* Whatever tab was active in landscape, portrait always shows the controls */ + .channel-page[data-view] .channel-graph-section { + display: none; + } + + .channel-page[data-view] .channel-control-section { + display: flex; + } + + .channel-control-panel { + flex: 1 1 auto; + display: grid; + width: 100%; + min-width: 0; + box-sizing: border-box; + + /* Fixed widths (same idea as the 40px GEQ cells): the strip scrolls instead of shrinking. + Total ≈ the landscape band-table width (--peq-list-width), so the table stays readable. */ + grid-template-columns: + 210px /* PEQ sliders */ + 100px /* HighPass */ + 100px /* LowPass */ + 110px; /* Actions */ + grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); + justify-content: start; /* desktop's "center" would clip the left side on overflow */ + gap: var(--space-1); + padding: var(--space-1) var(--space-2); + + overflow-x: auto; + overflow-y: hidden; + scroll-snap-type: none; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; + } + + /* Flatten the groups (and hide their labels) */ + .channel-control-section .channel-group, + .channel-control-section .channel-group__items, + .peq-block { + display: contents; + } + + .channel-control-section .channel-group__label { + display: none; + } + + /* Each panel is its own size container (like the panels in CompressorSection): + the cqh sizes inside (slider thumb, track, readout, paddings) scale to the panel. */ + .peq-band-list { + grid-row: 1; + grid-column: 1 / -1; + width: auto; + min-width: var(--peq-list-width); /* 480px, same as landscape */ + min-height: 0; + container-type: size; + --peq-cols: 0.45fr 0.9fr 0.55fr 0.9fr 1.1fr 0.55fr; + } + + .peq-band-list__row { + grid-template-columns: var(--peq-cols); + } + + /* Row 2: columns fill in DOM order = PEQ sliders, HighPass, LowPass, Actions */ + .channel-panel, + .crossover-panel { + grid-row: 2; + width: auto; /* fills its fixed grid column */ + min-width: 0; + min-height: 0; + height: auto; + margin: 0; + container-type: size; + } + + .channel-panel__title, + .crossover-panel__title { + padding-block: 4px; + } + + .channel-panel__grid { + gap: 2px; + padding: 4px; + + position: relative; + z-index: 1; /* paint above the title if a thumb still reaches it */ + } + + /* The thumb sticks out of the track by half its height at min/max: leave that + room inside the cell instead of clipping it or letting it slide under the title. */ + .channel-panel__cell { + overflow: visible; + padding-block: 3cqh; + box-sizing: border-box; + gap: 2px; + } + + .channel-panel__cell > :first-child { + min-height: 0; + max-height: 100%; + } + + .crossover-panel { + gap: 4px; + padding-bottom: 4px; + } + + .crossover-panel__slider { + display: contents; + } + + .crossover-panel__select { + width: 90%; + } + + /* Actions: its own panel in the 4th column, Bypass above Reset */ + .channel-control-section .peq-channel-selector { + grid-row: 2; + width: auto; + height: auto; + min-width: 0; + min-height: 0; + align-self: stretch; + + display: flex; + flex-direction: column; + justify-content: center; + gap: var(--space-1); + + padding: var(--space-1); + box-sizing: border-box; + background: var(--bg-void); + border: var(--border-width) solid var(--border-hairline); + border-radius: var(--radius-md); + } + + .channel-control-section .peq-channel-selector > * { + flex: 1 1 0; + min-height: 0; + max-height: 64px; + width: 100% !important; + padding: 0 !important; /* inline paddings are in cqh: too big on a phone */ + font-size: var(--ch-fs-action) !important; + overflow: hidden; + text-overflow: ellipsis; + } +} + +/* ---------- Landscape phone: thinner strips ---------- */ + +@media (max-height: 500px) and (pointer: coarse) { + .channel-control-panel { + padding: var(--space-1) var(--space-2); + } + + .channel-control-section .channel-group { + padding-top: 24px; + } + + .channel-control-section .channel-group__label { + top: 4px; + font-size: var(--font-xs); + } + + .channel-panel { + width: clamp(200px, 26vw, 240px); + } + + .channel-panel__title, + .crossover-panel__title { + padding-block: var(--space-1); + } + + .channel-panel__grid { + padding: var(--space-1); + } +} \ No newline at end of file diff --git a/src/features/dsp408/components/ChannelSection/ChannelSection.tsx b/src/features/dsp408/components/ChannelSection/ChannelSection.tsx index ce07179..86bda22 100644 --- a/src/features/dsp408/components/ChannelSection/ChannelSection.tsx +++ b/src/features/dsp408/components/ChannelSection/ChannelSection.tsx @@ -28,6 +28,10 @@ import { } from '../../constants'; import { MagnitudeGraph, PhaseGraph } from './ChannelGraph'; +// Font size used by the buttons below. On desktop it falls back to the cqh value; +// the mobile CSS overrides --ch-fs with a fixed px size. +const BTN_FS = 'var(--ch-fs, 4cqh)'; + function nearestQValue(q: number, values: readonly number[] = PEAK_Q_VALUES): number { return values.reduce((nearest, current) => Math.abs(current - q) < Math.abs(nearest - q) ? current : nearest @@ -36,6 +40,32 @@ function nearestQValue(q: number, values: readonly number[] = PEAK_Q_VALUES): nu type GraphView = 'both' | 'magnitude' | 'phase'; +// Phone only: one view at a time (CSS hides the tabs on desktop) +type ChannelView = 'controls' | 'magnitude' | 'phase'; + +const CHANNEL_VIEWS: { id: ChannelView; label: string }[] = [ + { id: 'controls', label: 'Controls' }, + { id: 'magnitude', label: 'Magnitude' }, + { id: 'phase', label: 'Phase' }, +]; + +// Must match the phone media query in ChannelSection.css +const MOBILE_QUERY = '(max-width: 768px), (max-height: 500px) and (pointer: coarse)'; + +function useIsMobile(): boolean { + const [matches, setMatches] = useState(() => window.matchMedia(MOBILE_QUERY).matches); + + useEffect(() => { + const mql = window.matchMedia(MOBILE_QUERY); + const onChange = () => setMatches(mql.matches); + onChange(); + mql.addEventListener('change', onChange); + return () => mql.removeEventListener('change', onChange); + }, []); + + return matches; +} + function GraphViewToggle({ view, onChange, @@ -77,14 +107,14 @@ function ChannelActions({ onReset: () => void; }) { return ( -
+
@@ -249,21 +282,24 @@ function CrossoverPanel({
{title}
- (value >= 1000 ? 'kHz' : 'Hz')} - value={frequency} - formatValue={(value) => - value >= 1000 ? `${(value / 1000).toFixed(2)}` : `${value.toFixed(1)}` - } - onChange={(value) => commit({ frequency: value })} - onInput={(value) => onLiveValue(value)} - style={{ width: '100%', flex: '1 1 auto' }} - /> + {/* display: contents on desktop; lets the mobile CSS target the slider for touch-action */} +
+ (value >= 1000 ? 'kHz' : 'Hz')} + value={frequency} + formatValue={(value) => + value >= 1000 ? `${(value / 1000).toFixed(2)}` : `${value.toFixed(1)}` + } + onChange={(value) => commit({ frequency: value })} + onInput={(value) => onLiveValue(value)} + style={{ width: '100%', flex: '1 1 auto' }} + /> +
setActiveBand(band)} style={{ minHeight: 0, - fontSize: '4cqh', }} > {`B${i + 1}`} @@ -423,9 +458,10 @@ function PeqBandList({ variant="toggle" className={peq.bypass ? 'active-warning' : ''} onClick={() => commit(band, { bypass: !peq.bypass })} - style={{ minHeight: 0, fontSize: '4cqh', paddingInline: 0 }} + style={{ minHeight: 0, fontSize: BTN_FS, paddingInline: 0 }} > - {peq.bypass ? 'Bypassed' : 'Bypass'} + {peq.bypass ? 'Bypassed' : 'Bypass'} + Byp
); @@ -468,6 +504,15 @@ function ChannelSection({ const [graphView, setGraphView] = useState('both'); const [resetting, setResetting] = useState(false); const [isResetConfirmOpen, setIsResetConfirmOpen] = useState(false); + const [view, setView] = useState('controls'); + const isMobile = useIsMobile(); + + // Phone: one tab per graph, so the Both / Mag / Phase toggle is not shown + const shownGraph: GraphView = isMobile + ? view === 'phase' + ? 'phase' + : 'magnitude' + : graphView; // Live values const [liveHpFreq, setLiveHpFreq] = useState(FREQUENCY_MIN); @@ -595,72 +640,98 @@ function ChannelSection({ return ( <> -
-
-
-
{activeChannelState.name} - Filters
- -
- - {(graphView === 'both' || graphView === 'magnitude') && ( -
- -
- )} - - {(graphView === 'both' || graphView === 'phase') && } - - {ActivePeq.bypass && ( -
- BYPASSED -
- )} +
+ {/* Phone only (hidden on desktop by CSS): one view at a time */} +
+ {CHANNEL_VIEWS.map((v) => ( + + ))}
-
-
-
- - - - commitPEQ(activeBand, gain, frequency, q, filter_type, bypass) - } - onLiveValue={(value) => handleLivePEQValue(activeBand, value)} - /> - + {/* Portrait phone only (CSS): the graphs need the width of landscape */} +
+ Rotate your phone to landscape to see the filter graphs. +
- - - - +
+
+
+
{activeChannelState.name} - Filters
+ {!isMobile && } +
- - - + {(shownGraph === 'both' || shownGraph === 'magnitude') && ( +
+ +
+ )} + + {(shownGraph === 'both' || shownGraph === 'phase') && } + + {ActivePeq.bypass && ( +
+ BYPASSED +
+ )} +
+
+ +
+
+ + {/* display: contents on desktop; a row (landscape) / column (portrait) on phones */} +
+ + + commitPEQ(activeBand, gain, frequency, q, filter_type, bypass) + } + onLiveValue={(value) => handleLivePEQValue(activeBand, value)} + /> +
+
+ + + + + + + + + +
@@ -688,4 +759,4 @@ function ChannelSection({ ); } -export default ChannelSection; +export default ChannelSection; \ No newline at end of file From f2726b61af27113ee1059943185980c770e86775 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 30 Oct 2026 16:47:17 +0100 Subject: [PATCH 17/19] feat: android build --- README.md | 7 +- src-tauri/.gitignore | 2 + src-tauri/gen/android/.editorconfig | 12 - src-tauri/gen/android/.gitignore | 20 - src-tauri/gen/android/app/.gitignore | 6 - src-tauri/gen/android/app/build.gradle.kts | 37 +- src-tauri/gen/android/app/proguard-rules.pro | 21 - .../android/app/src/main/AndroidManifest.xml | 1 + .../com/lucas/thomann_dsp_app/MainActivity.kt | 11 - .../lucas/thomann_dsp_app/generated/Ipc.kt | 25 + .../lucas/thomann_dsp_app/generated/Logger.kt | 89 +++ .../generated/PermissionHelper.kt | 117 ++++ .../lucas/thomann_dsp_app/generated/Rust.kt | 46 ++ .../generated/RustWebChromeClient.kt | 519 ++++++++++++++ .../thomann_dsp_app/generated/RustWebView.kt | 98 +++ .../generated/RustWebViewClient.kt | 103 +++ .../generated/TauriActivity.kt | 60 ++ .../thomann_dsp_app/generated/WryActivity.kt | 199 ++++++ .../generated/proguard-wry.pro | 37 + .../arm64-v8a/libthomann_dsp_app_lib.so | 1 + .../armeabi-v7a/libthomann_dsp_app_lib.so | 1 + .../jniLibs/x86/libthomann_dsp_app_lib.so | 1 + .../jniLibs/x86_64/libthomann_dsp_app_lib.so | 1 + .../drawable-v24/ic_launcher_foreground.xml | 30 - .../res/drawable/ic_launcher_background.xml | 170 ----- .../app/src/main/res/layout/activity_main.xml | 18 - .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3524 -> 3199 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 14102 -> 16956 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 3524 -> 3753 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 3377 -> 3033 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 9081 -> 10015 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 3377 -> 3608 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 7971 -> 8051 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 18900 -> 25197 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7971 -> 9031 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 12392 -> 13887 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 29506 -> 45048 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 12392 -> 16037 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 16751 -> 20376 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 40510 -> 70307 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 16751 -> 23244 bytes .../res/values/ic_launcher_background.xml | 4 + .../gen/android/app/tauri.build.gradle.kts | 7 + src-tauri/gen/android/app/tauri.properties | 3 + .../reports/problems/problems-report.html | 663 ++++++++++++++++++ .../executionHistory/executionHistory.bin | Bin 0 -> 53769 bytes .../executionHistory/executionHistory.lock | Bin 0 -> 17 bytes .../buildOutputCleanup.lock | Bin 0 -> 17 bytes .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/outputFiles.bin | Bin 0 -> 18929 bytes .../buildSrc/.gradle/file-system.probe | Bin 0 -> 8 bytes .../kotlin/main/BuildTask$runTauriCli$1.class | Bin 0 -> 2956 bytes .../build/classes/kotlin/main/BuildTask.class | Bin 0 -> 4419 bytes .../build/classes/kotlin/main/Config.class | Bin 0 -> 1185 bytes .../main/META-INF/buildSrc.kotlin_module | Bin 0 -> 42 bytes .../main/RustPlugin$apply$1$1$1$1$1.class | Bin 0 -> 1878 bytes .../main/RustPlugin$apply$1$1$1$1.class | Bin 0 -> 1764 bytes .../main/RustPlugin$apply$1$1$1$2$1$1.class | Bin 0 -> 1912 bytes .../main/RustPlugin$apply$1$1$1$2$1.class | Bin 0 -> 1833 bytes .../kotlin/main/RustPlugin$apply$1$1$1.class | Bin 0 -> 3748 bytes .../kotlin/main/RustPlugin$apply$1$1.class | Bin 0 -> 2107 bytes .../kotlin/main/RustPlugin$apply$1$2.class | Bin 0 -> 6786 bytes ...$apply$lambda$0$$inlined$configure$1.class | Bin 0 -> 1102 bytes ...nlined$sam$i$org_gradle_api_Action$0.class | Bin 0 -> 1076 bytes .../classes/kotlin/main/RustPlugin.class | Bin 0 -> 4772 bytes .../classes/kotlin/main/RustPluginKt.class | Bin 0 -> 466 bytes .../caches-jvm/inputs/source-to-output.tab | Bin 0 -> 4096 bytes .../inputs/source-to-output.tab.keystream | Bin 0 -> 4096 bytes .../inputs/source-to-output.tab.keystream.len | Bin 0 -> 8 bytes .../inputs/source-to-output.tab.len | Bin 0 -> 8 bytes .../inputs/source-to-output.tab.values.at | Bin 0 -> 1691 bytes .../caches-jvm/inputs/source-to-output.tab_i | Bin 0 -> 32768 bytes .../inputs/source-to-output.tab_i.len | Bin 0 -> 8 bytes .../jvm/kotlin/class-attributes.tab | Bin 0 -> 4096 bytes .../jvm/kotlin/class-attributes.tab.keystream | Bin 0 -> 4096 bytes .../kotlin/class-attributes.tab.keystream.len | Bin 0 -> 8 bytes .../jvm/kotlin/class-attributes.tab.len | Bin 0 -> 8 bytes .../jvm/kotlin/class-attributes.tab.values.at | Bin 0 -> 58 bytes .../jvm/kotlin/class-attributes.tab_i | Bin 0 -> 32768 bytes .../jvm/kotlin/class-attributes.tab_i.len | Bin 0 -> 8 bytes .../jvm/kotlin/class-fq-name-to-source.tab | Bin 0 -> 4096 bytes .../class-fq-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../class-fq-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/class-fq-name-to-source.tab.len | Bin 0 -> 8 bytes .../class-fq-name-to-source.tab.values.at | Bin 0 -> 425 bytes .../jvm/kotlin/class-fq-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/class-fq-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/constants.tab | Bin 0 -> 4096 bytes .../jvm/kotlin/constants.tab.keystream | Bin 0 -> 4096 bytes .../jvm/kotlin/constants.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/constants.tab.len | Bin 0 -> 8 bytes .../jvm/kotlin/constants.tab.values.at | Bin 0 -> 87 bytes .../caches-jvm/jvm/kotlin/constants.tab_i | Bin 0 -> 32768 bytes .../caches-jvm/jvm/kotlin/constants.tab_i.len | Bin 0 -> 8 bytes .../jvm/kotlin/internal-name-to-source.tab | Bin 0 -> 4096 bytes .../internal-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../internal-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab.len | Bin 0 -> 8 bytes .../internal-name-to-source.tab.values.at | Bin 0 -> 1809 bytes .../jvm/kotlin/internal-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/internal-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/package-parts.tab | Bin 0 -> 4096 bytes .../jvm/kotlin/package-parts.tab.keystream | Bin 0 -> 4096 bytes .../kotlin/package-parts.tab.keystream.len | Bin 0 -> 8 bytes .../jvm/kotlin/package-parts.tab.len | Bin 0 -> 8 bytes .../jvm/kotlin/package-parts.tab.values.at | Bin 0 -> 52 bytes .../caches-jvm/jvm/kotlin/package-parts.tab_i | Bin 0 -> 32768 bytes .../jvm/kotlin/package-parts.tab_i.len | Bin 0 -> 8 bytes .../cacheable/caches-jvm/jvm/kotlin/proto.tab | Bin 0 -> 4096 bytes .../caches-jvm/jvm/kotlin/proto.tab.keystream | Bin 0 -> 4096 bytes .../jvm/kotlin/proto.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/proto.tab.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/proto.tab.values.at | Bin 0 -> 1091 bytes .../caches-jvm/jvm/kotlin/proto.tab_i | Bin 0 -> 32768 bytes .../caches-jvm/jvm/kotlin/proto.tab_i.len | Bin 0 -> 8 bytes .../jvm/kotlin/source-to-classes.tab | Bin 0 -> 4096 bytes .../kotlin/source-to-classes.tab.keystream | Bin 0 -> 4096 bytes .../source-to-classes.tab.keystream.len | Bin 0 -> 8 bytes .../jvm/kotlin/source-to-classes.tab.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.values.at | Bin 0 -> 814 bytes .../jvm/kotlin/source-to-classes.tab_i | Bin 0 -> 32768 bytes .../jvm/kotlin/source-to-classes.tab_i.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/subtypes.tab | Bin 0 -> 4096 bytes .../jvm/kotlin/subtypes.tab.keystream | Bin 0 -> 4096 bytes .../jvm/kotlin/subtypes.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/subtypes.tab.len | Bin 0 -> 8 bytes .../jvm/kotlin/subtypes.tab.values.at | Bin 0 -> 74 bytes .../caches-jvm/jvm/kotlin/subtypes.tab_i | Bin 0 -> 32768 bytes .../caches-jvm/jvm/kotlin/subtypes.tab_i.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/supertypes.tab | Bin 0 -> 4096 bytes .../jvm/kotlin/supertypes.tab.keystream | Bin 0 -> 4096 bytes .../jvm/kotlin/supertypes.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/jvm/kotlin/supertypes.tab.len | Bin 0 -> 8 bytes .../jvm/kotlin/supertypes.tab.values.at | Bin 0 -> 102 bytes .../caches-jvm/jvm/kotlin/supertypes.tab_i | Bin 0 -> 32768 bytes .../jvm/kotlin/supertypes.tab_i.len | Bin 0 -> 8 bytes .../cacheable/caches-jvm/lookups/counters.tab | 2 + .../caches-jvm/lookups/file-to-id.tab | Bin 0 -> 4096 bytes .../lookups/file-to-id.tab.keystream | Bin 0 -> 4096 bytes .../lookups/file-to-id.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/lookups/file-to-id.tab.len | Bin 0 -> 8 bytes .../lookups/file-to-id.tab.values.at | Bin 0 -> 61 bytes .../caches-jvm/lookups/file-to-id.tab_i | Bin 0 -> 32768 bytes .../caches-jvm/lookups/file-to-id.tab_i.len | Bin 0 -> 8 bytes .../caches-jvm/lookups/id-to-file.tab | Bin 0 -> 4096 bytes .../lookups/id-to-file.tab.keystream | Bin 0 -> 4096 bytes .../lookups/id-to-file.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/lookups/id-to-file.tab.len | Bin 0 -> 8 bytes .../lookups/id-to-file.tab.values.at | Bin 0 -> 174 bytes .../caches-jvm/lookups/id-to-file.tab_i | Bin 0 -> 32768 bytes .../caches-jvm/lookups/id-to-file.tab_i.len | Bin 0 -> 8 bytes .../cacheable/caches-jvm/lookups/lookups.tab | Bin 0 -> 8192 bytes .../caches-jvm/lookups/lookups.tab.keystream | Bin 0 -> 20480 bytes .../lookups/lookups.tab.keystream.len | Bin 0 -> 8 bytes .../caches-jvm/lookups/lookups.tab.len | Bin 0 -> 8 bytes .../caches-jvm/lookups/lookups.tab.values.at | Bin 0 -> 3409 bytes .../caches-jvm/lookups/lookups.tab_i | Bin 0 -> 32768 bytes .../caches-jvm/lookups/lookups.tab_i.len | Bin 0 -> 8 bytes .../compileKotlin/cacheable/last-build.bin | Bin 0 -> 18 bytes .../shrunk-classpath-snapshot.bin | Bin 0 -> 33455 bytes .../local-state/build-history.bin | Bin 0 -> 31 bytes .../android/buildSrc/build/libs/buildSrc.jar | Bin 0 -> 20734 bytes .../build/pluginDescriptors/rust.properties | 1 + .../META-INF/gradle-plugins/rust.properties | 1 + .../buildSrc/build/tmp/jar/MANIFEST.MF | 2 + src-tauri/gen/android/keystore.properties | 3 + src-tauri/gen/android/tauri.settings.gradle | 5 + src-tauri/icons/128x128.png | Bin 9579 -> 12555 bytes src-tauri/icons/128x128@2x.png | Bin 24541 -> 33014 bytes src-tauri/icons/32x32.png | Bin 1595 -> 1993 bytes src-tauri/icons/64x64.png | Bin 3824 -> 4944 bytes src-tauri/icons/Square107x107Logo.png | Bin 7432 -> 9888 bytes src-tauri/icons/Square142x142Logo.png | Bin 11141 -> 14132 bytes src-tauri/icons/Square150x150Logo.png | Bin 11805 -> 15258 bytes src-tauri/icons/Square284x284Logo.png | Bin 28144 -> 37135 bytes src-tauri/icons/Square30x30Logo.png | Bin 1448 -> 1873 bytes src-tauri/icons/Square310x310Logo.png | Bin 31458 -> 42133 bytes src-tauri/icons/Square44x44Logo.png | Bin 2457 -> 2989 bytes src-tauri/icons/Square71x71Logo.png | Bin 4367 -> 5837 bytes src-tauri/icons/Square89x89Logo.png | Bin 5956 -> 7848 bytes src-tauri/icons/StoreLogo.png | Bin 2838 -> 3587 bytes src-tauri/icons/icon.icns | Bin 349454 -> 432122 bytes src-tauri/icons/icon.ico | Bin 35911 -> 46548 bytes src-tauri/icons/icon.png | Bin 62377 -> 62078 bytes src-tauri/icons/ios/AppIcon-20x20@1x.png | Bin 834 -> 1004 bytes src-tauri/icons/ios/AppIcon-20x20@2x-1.png | Bin 2104 -> 2545 bytes src-tauri/icons/ios/AppIcon-20x20@2x.png | Bin 2104 -> 2545 bytes src-tauri/icons/ios/AppIcon-20x20@3x.png | Bin 3619 -> 4378 bytes src-tauri/icons/ios/AppIcon-29x29@1x.png | Bin 1392 -> 1706 bytes src-tauri/icons/ios/AppIcon-29x29@2x-1.png | Bin 3388 -> 4340 bytes src-tauri/icons/ios/AppIcon-29x29@2x.png | Bin 3388 -> 4340 bytes src-tauri/icons/ios/AppIcon-29x29@3x.png | Bin 5669 -> 7294 bytes src-tauri/icons/ios/AppIcon-40x40@1x.png | Bin 2104 -> 2545 bytes src-tauri/icons/ios/AppIcon-40x40@2x-1.png | Bin 5148 -> 6482 bytes src-tauri/icons/ios/AppIcon-40x40@2x.png | Bin 5148 -> 6482 bytes src-tauri/icons/ios/AppIcon-40x40@3x.png | Bin 8566 -> 11020 bytes src-tauri/icons/ios/AppIcon-512@2x.png | Bin 155370 -> 199175 bytes src-tauri/icons/ios/AppIcon-60x60@2x.png | Bin 8566 -> 11020 bytes src-tauri/icons/ios/AppIcon-60x60@3x.png | Bin 14977 -> 18934 bytes src-tauri/icons/ios/AppIcon-76x76@1x.png | Bin 4880 -> 6121 bytes src-tauri/icons/ios/AppIcon-76x76@2x.png | Bin 12056 -> 15154 bytes src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png | Bin 13502 -> 17150 bytes 204 files changed, 2044 insertions(+), 291 deletions(-) delete mode 100644 src-tauri/gen/android/.editorconfig delete mode 100644 src-tauri/gen/android/.gitignore delete mode 100644 src-tauri/gen/android/app/.gitignore delete mode 100644 src-tauri/gen/android/app/proguard-rules.pro delete mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/MainActivity.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Ipc.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Logger.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/PermissionHelper.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Rust.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/RustWebChromeClient.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/RustWebView.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/RustWebViewClient.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/TauriActivity.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/WryActivity.kt create mode 100644 src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/proguard-wry.pro create mode 120000 src-tauri/gen/android/app/src/main/jniLibs/arm64-v8a/libthomann_dsp_app_lib.so create mode 120000 src-tauri/gen/android/app/src/main/jniLibs/armeabi-v7a/libthomann_dsp_app_lib.so create mode 120000 src-tauri/gen/android/app/src/main/jniLibs/x86/libthomann_dsp_app_lib.so create mode 120000 src-tauri/gen/android/app/src/main/jniLibs/x86_64/libthomann_dsp_app_lib.so delete mode 100644 src-tauri/gen/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 src-tauri/gen/android/app/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 src-tauri/gen/android/app/src/main/res/layout/activity_main.xml create mode 100644 src-tauri/gen/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 src-tauri/gen/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 src-tauri/gen/android/app/src/main/res/values/ic_launcher_background.xml create mode 100644 src-tauri/gen/android/app/tauri.build.gradle.kts create mode 100644 src-tauri/gen/android/app/tauri.properties create mode 100644 src-tauri/gen/android/build/reports/problems/problems-report.html create mode 100644 src-tauri/gen/android/buildSrc/.gradle/8.14.3/executionHistory/executionHistory.bin create mode 100644 src-tauri/gen/android/buildSrc/.gradle/8.14.3/executionHistory/executionHistory.lock create mode 100644 src-tauri/gen/android/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock create mode 100644 src-tauri/gen/android/buildSrc/.gradle/buildOutputCleanup/cache.properties create mode 100644 src-tauri/gen/android/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin create mode 100644 src-tauri/gen/android/buildSrc/.gradle/file-system.probe create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/BuildTask$runTauriCli$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/BuildTask.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/Config.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/META-INF/buildSrc.kotlin_module create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$1$1$1$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$1$1$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$1$1$2$1$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$1$1$2$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$1$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$1$2.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$apply$lambda$0$$inlined$configure$1.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin$inlined$sam$i$org_gradle_api_Action$0.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPlugin.class create mode 100644 src-tauri/gen/android/buildSrc/build/classes/kotlin/main/RustPluginKt.class create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/counters.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin create mode 100644 src-tauri/gen/android/buildSrc/build/kotlin/compileKotlin/local-state/build-history.bin create mode 100644 src-tauri/gen/android/buildSrc/build/libs/buildSrc.jar create mode 100644 src-tauri/gen/android/buildSrc/build/pluginDescriptors/rust.properties create mode 100644 src-tauri/gen/android/buildSrc/build/resources/main/META-INF/gradle-plugins/rust.properties create mode 100644 src-tauri/gen/android/buildSrc/build/tmp/jar/MANIFEST.MF create mode 100644 src-tauri/gen/android/keystore.properties create mode 100644 src-tauri/gen/android/tauri.settings.gradle diff --git a/README.md b/README.md index 81a28e9..da5b048 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,13 @@ This template should help get you started developing with Tauri, React and Types - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) +# Mobile Install +- npm run tauri android build -- --apk +- adb uninstall com.lucas.thomann_dsp_app +- adb install src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk + # TODO - Check end to end behavioour -- Make phone version + diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore index d8769d0..6e79684 100644 --- a/src-tauri/.gitignore +++ b/src-tauri/.gitignore @@ -5,3 +5,5 @@ # Generated by Tauri # will have schema files for capabilities auto-completion /gen/schemas + +/src-tauri/gen/android/keystore.properties \ No newline at end of file diff --git a/src-tauri/gen/android/.editorconfig b/src-tauri/gen/android/.editorconfig deleted file mode 100644 index ebe51d3..0000000 --- a/src-tauri/gen/android/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# EditorConfig is awesome: https://EditorConfig.org - -# top-most EditorConfig file -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = false -insert_final_newline = false \ No newline at end of file diff --git a/src-tauri/gen/android/.gitignore b/src-tauri/gen/android/.gitignore deleted file mode 100644 index 1c636c3..0000000 --- a/src-tauri/gen/android/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -build -/captures -.externalNativeBuild -.cxx -local.properties -key.properties -keystore.properties - -/.tauri -/tauri.settings.gradle \ No newline at end of file diff --git a/src-tauri/gen/android/app/.gitignore b/src-tauri/gen/android/app/.gitignore deleted file mode 100644 index 6c4d56b..0000000 --- a/src-tauri/gen/android/app/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/src/main/**/generated -/src/main/jniLibs/**/*.so -/src/main/assets/tauri.conf.json -/tauri.build.gradle.kts -/proguard-tauri.pro -/tauri.properties \ No newline at end of file diff --git a/src-tauri/gen/android/app/build.gradle.kts b/src-tauri/gen/android/app/build.gradle.kts index e9468cd..a6f5eb5 100644 --- a/src-tauri/gen/android/app/build.gradle.kts +++ b/src-tauri/gen/android/app/build.gradle.kts @@ -1,4 +1,6 @@ + import java.util.Properties +import java.io.FileInputStream plugins { id("com.android.application") @@ -13,9 +15,18 @@ val tauriProperties = Properties().apply { } } +// Load release keystore properties +val keystoreProperties = Properties().apply { + val keystoreFile = rootProject.file("keystore.properties") + if (keystoreFile.exists()) { + keystoreFile.inputStream().use { load(it) } + } +} + android { compileSdk = 36 namespace = "com.lucas.thomann_dsp_app" + defaultConfig { manifestPlaceholders["usesCleartextTraffic"] = "false" applicationId = "com.lucas.thomann_dsp_app" @@ -24,20 +35,40 @@ android { versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") } + + // Release signing configuration + signingConfigs { + create("release") { + val keystorePath = keystoreProperties.getProperty("storeFile") + + if (keystorePath != null) { + storeFile = file(keystorePath) + storePassword = keystoreProperties.getProperty("password") + keyAlias = keystoreProperties.getProperty("keyAlias") + keyPassword = keystoreProperties.getProperty("password") + } + } + } + buildTypes { getByName("debug") { manifestPlaceholders["usesCleartextTraffic"] = "true" isDebuggable = true isJniDebuggable = true isMinifyEnabled = false - packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so") + packaging { + jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so") jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so") jniLibs.keepDebugSymbols.add("*/x86/*.so") jniLibs.keepDebugSymbols.add("*/x86_64/*.so") } } + getByName("release") { isMinifyEnabled = true + + signingConfig = signingConfigs.getByName("release") + proguardFiles( *fileTree(".") { include("**/*.pro") } .plus(getDefaultProguardFile("proguard-android-optimize.txt")) @@ -45,9 +76,11 @@ android { ) } } + kotlinOptions { jvmTarget = "1.8" } + buildFeatures { buildConfig = true } @@ -68,4 +101,4 @@ dependencies { androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") } -apply(from = "tauri.build.gradle.kts") \ No newline at end of file +apply(from = "tauri.build.gradle.kts") diff --git a/src-tauri/gen/android/app/proguard-rules.pro b/src-tauri/gen/android/app/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/src-tauri/gen/android/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/src-tauri/gen/android/app/src/main/AndroidManifest.xml b/src-tauri/gen/android/app/src/main/AndroidManifest.xml index e88b1ab..e1e719e 100644 --- a/src-tauri/gen/android/app/src/main/AndroidManifest.xml +++ b/src-tauri/gen/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ diff --git a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/MainActivity.kt b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/MainActivity.kt deleted file mode 100644 index c07df14..0000000 --- a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/MainActivity.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.lucas.thomann_dsp_app - -import android.os.Bundle -import androidx.activity.enableEdgeToEdge - -class MainActivity : TauriActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - enableEdgeToEdge() - super.onCreate(savedInstanceState) - } -} diff --git a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Ipc.kt b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Ipc.kt new file mode 100644 index 0000000..96c8bec --- /dev/null +++ b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Ipc.kt @@ -0,0 +1,25 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!! */ + +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("unused") + +package com.lucas.thomann_dsp_app + +import android.webkit.* + +class Ipc(val webView: RustWebView, val webViewClient: RustWebViewClient) { + @JavascriptInterface + fun postMessage(message: String?) { + message?.let {m -> + // we're not using WebView::getUrl() here because it needs to be executed on the main thread + // and it would slow down the Ipc + // so instead we track the current URL on the webview client + Rust.ipc(webView.id, webViewClient.currentUrl, m) + } + } + + +} diff --git a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Logger.kt b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Logger.kt new file mode 100644 index 0000000..2891ec3 --- /dev/null +++ b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Logger.kt @@ -0,0 +1,89 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!! */ + +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("unused", "MemberVisibilityCanBePrivate") + +package com.lucas.thomann_dsp_app + +// taken from https://github.com/ionic-team/capacitor/blob/6658bca41e78239347e458175b14ca8bd5c1d6e8/android/capacitor/src/main/java/com/getcapacitor/Logger.java + +import android.text.TextUtils +import android.util.Log + +class Logger { + companion object { + private const val LOG_TAG_CORE = "Tauri" + + fun tags(vararg subtags: String): String { + return if (subtags.isNotEmpty()) { + LOG_TAG_CORE + "/" + TextUtils.join("/", subtags) + } else LOG_TAG_CORE + } + + fun verbose(message: String) { + verbose(LOG_TAG_CORE, message) + } + + private fun verbose(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.v(tag, message) + } + + fun debug(message: String) { + debug(LOG_TAG_CORE, message) + } + + fun debug(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.d(tag, message) + } + + fun info(message: String) { + info(LOG_TAG_CORE, message) + } + + fun info(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.i(tag, message) + } + + fun warn(message: String) { + warn(LOG_TAG_CORE, message) + } + + fun warn(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.w(tag, message) + } + + fun error(message: String) { + error(LOG_TAG_CORE, message, null) + } + + fun error(message: String, e: Throwable?) { + error(LOG_TAG_CORE, message, e) + } + + fun error(tag: String, message: String, e: Throwable?) { + if (!shouldLog()) { + return + } + Log.e(tag, message, e) + } + + private fun shouldLog(): Boolean { + return BuildConfig.DEBUG + } + } +} diff --git a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/PermissionHelper.kt b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/PermissionHelper.kt new file mode 100644 index 0000000..dc7f528 --- /dev/null +++ b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/PermissionHelper.kt @@ -0,0 +1,117 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!! */ + +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package com.lucas.thomann_dsp_app + +// taken from https://github.com/ionic-team/capacitor/blob/6658bca41e78239347e458175b14ca8bd5c1d6e8/android/capacitor/src/main/java/com/getcapacitor/PermissionHelper.java + +import android.content.Context +import android.content.pm.PackageManager +import android.os.Build +import androidx.core.app.ActivityCompat +import java.util.ArrayList + +object PermissionHelper { + /** + * Checks if a list of given permissions are all granted by the user + * + * @param permissions Permissions to check. + * @return True if all permissions are granted, false if at least one is not. + */ + fun hasPermissions(context: Context?, permissions: Array): Boolean { + for (perm in permissions) { + if (ActivityCompat.checkSelfPermission( + context!!, + perm + ) != PackageManager.PERMISSION_GRANTED + ) { + return false + } + } + return true + } + + /** + * Check whether the given permission has been defined in the AndroidManifest.xml + * + * @param permission A permission to check. + * @return True if the permission has been defined in the Manifest, false if not. + */ + fun hasDefinedPermission(context: Context, permission: String): Boolean { + var hasPermission = false + val requestedPermissions = getManifestPermissions(context) + if (!requestedPermissions.isNullOrEmpty()) { + val requestedPermissionsList = listOf(*requestedPermissions) + val requestedPermissionsArrayList = ArrayList(requestedPermissionsList) + if (requestedPermissionsArrayList.contains(permission)) { + hasPermission = true + } + } + return hasPermission + } + + /** + * Check whether all of the given permissions have been defined in the AndroidManifest.xml + * @param context the app context + * @param permissions a list of permissions + * @return true only if all permissions are defined in the AndroidManifest.xml + */ + fun hasDefinedPermissions(context: Context, permissions: Array): Boolean { + for (permission in permissions) { + if (!hasDefinedPermission(context, permission)) { + return false + } + } + return true + } + + /** + * Get the permissions defined in AndroidManifest.xml + * + * @return The permissions defined in AndroidManifest.xml + */ + private fun getManifestPermissions(context: Context): Array? { + var requestedPermissions: Array? = null + try { + val pm = context.packageManager + val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + pm.getPackageInfo(context.packageName, PackageManager.PackageInfoFlags.of(PackageManager.GET_PERMISSIONS.toLong())) + } else { + @Suppress("DEPRECATION") + pm.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS) + } + if (packageInfo != null) { + requestedPermissions = packageInfo.requestedPermissions + } + } catch (_: Exception) { + } + return requestedPermissions + } + + /** + * Given a list of permissions, return a new list with the ones not present in AndroidManifest.xml + * + * @param neededPermissions The permissions needed. + * @return The permissions not present in AndroidManifest.xml + */ + fun getUndefinedPermissions(context: Context, neededPermissions: Array): Array { + val undefinedPermissions = ArrayList() + val requestedPermissions = getManifestPermissions(context) + if (!requestedPermissions.isNullOrEmpty()) { + val requestedPermissionsList = listOf(*requestedPermissions) + val requestedPermissionsArrayList = ArrayList(requestedPermissionsList) + for (permission in neededPermissions) { + if (!requestedPermissionsArrayList.contains(permission)) { + undefinedPermissions.add(permission) + } + } + var undefinedPermissionArray = arrayOfNulls(undefinedPermissions.size) + undefinedPermissionArray = undefinedPermissions.toArray(undefinedPermissionArray) + return undefinedPermissionArray + } + return neededPermissions + } +} diff --git a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Rust.kt b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Rust.kt new file mode 100644 index 0000000..9aa2cfe --- /dev/null +++ b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/Rust.kt @@ -0,0 +1,46 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!! */ + +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("unused") + +package com.lucas.thomann_dsp_app + +import android.content.Intent +import android.webkit.WebView +import android.webkit.WebResourceRequest +import android.webkit.WebResourceResponse + +object Rust { + init { + System.loadLibrary("thomann_dsp_app_lib") + } + + // Tao bindings + @JvmStatic external fun onFirstActivityCreate() + @JvmStatic external fun onCreate(activity: WryActivity) + @JvmStatic external fun onStart(activity: WryActivity) + @JvmStatic external fun onResume(activity: WryActivity) + @JvmStatic external fun onPause(activity: WryActivity) + @JvmStatic external fun onStop(activity: WryActivity) + @JvmStatic external fun onDestroy(activity: WryActivity) + @JvmStatic external fun onWindowFocusChanged(activity: WryActivity, focus: Boolean) + @JvmStatic external fun onLowMemory() + @JvmStatic external fun onNewIntent(intent: Intent) + + @JvmStatic external fun onFirstActivityCreateWry() + @JvmStatic external fun onWebviewDestroy(activity: WryActivity, webviewId: String) + + @JvmStatic external fun ipc(webviewId: String, url: String, message: String) + + @JvmStatic external fun assetLoaderDomain(webviewId: String): String? + @JvmStatic external fun handleRequest(webviewId: String, request: WebResourceRequest, isDocumentStartScriptEnabled: Boolean): WebResourceResponse? + @JvmStatic external fun shouldOverride(webviewId: String, url: String): Boolean + @JvmStatic external fun onPageLoading(webviewId: String, url: String) + @JvmStatic external fun onPageLoaded(webviewId: String, url: String) + @JvmStatic external fun onEval(webviewId: String, id: Int, result: String) + + @JvmStatic external fun handleReceivedTitle(webviewId: String, title: String) +} \ No newline at end of file diff --git a/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/RustWebChromeClient.kt b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/RustWebChromeClient.kt new file mode 100644 index 0000000..502af08 --- /dev/null +++ b/src-tauri/gen/android/app/src/main/java/com/lucas/thomann_dsp_app/generated/RustWebChromeClient.kt @@ -0,0 +1,519 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!! */ + +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("ObsoleteSdkInt", "RedundantOverride", "QueryPermissionsNeeded", "SimpleDateFormat") + +package com.lucas.thomann_dsp_app + +// taken from https://github.com/ionic-team/capacitor/blob/6658bca41e78239347e458175b14ca8bd5c1d6e8/android/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java + +import android.Manifest +import android.app.Activity +import android.app.AlertDialog +import android.content.ActivityNotFoundException +import android.content.DialogInterface +import android.content.Intent +import android.graphics.Bitmap +import android.net.Uri +import android.os.Build +import android.os.Environment +import android.provider.MediaStore +import android.view.View +import android.webkit.* +import android.widget.EditText +import androidx.core.content.FileProvider +import java.io.File +import java.io.IOException +import java.text.SimpleDateFormat +import java.util.* + +class RustWebChromeClient(private val activity: WryActivity, private val webViewId: String) : WebChromeClient() { + private companion object { + const val PERMISSION_REQUEST_DEFAULT = 0 + const val PERMISSION_REQUEST_ALLOW = 1 + const val PERMISSION_REQUEST_DENY = 2 + } + + /** + * Render web content in `view`. + * + * Both this method and [.onHideCustomView] are required for + * rendering web content in full screen. + * + * @see [](https://developer.android.com/reference/android/webkit/WebChromeClient.onShowCustomView + ) */ + override fun onShowCustomView(view: View, callback: CustomViewCallback) { + callback.onCustomViewHidden() + super.onShowCustomView(view, callback) + } + + /** + * Render web content in the original Web View again. + * + * Do not remove this method--@see #onShowCustomView(View, CustomViewCallback). + */ + override fun onHideCustomView() { + super.onHideCustomView() + } + + override fun onPermissionRequest(request: PermissionRequest) { + val requestedResources = request.resources + if (requestedResources.isEmpty()) { + request.deny() + return + } + + val allowedResources = ArrayList() + val defaultResources = ArrayList() + + for (resource in requestedResources) { + when (onPermissionRequestNative(webViewId, resource)) { + PERMISSION_REQUEST_DENY -> {} + PERMISSION_REQUEST_ALLOW -> allowedResources.add(resource) + PERMISSION_REQUEST_DEFAULT -> defaultResources.add(resource) + } + } + + val resources = + allowedResources.plus(filterKnownPermissions(defaultResources)).toList().toTypedArray() + grantPermissionRequest(request, resources) + } + + private fun grantPermissionRequest(request: PermissionRequest, resources: Array) { + if (resources.isEmpty()) { + request.deny() + return + } + + val isRequestPermissionRequired = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M + val permissionList = androidPermissionsForResources(resources) + if (permissionList.isNotEmpty() && isRequestPermissionRequired) { + val permissions = permissionList.toTypedArray() + activity.requestPermissions(permissions) { isGranted -> + if (isGranted == true) { + request.grant(resources) + } else { + request.deny() + } + } + } else { + request.grant(resources) + } + } + + private fun androidPermissionsForResources(resources: Array): MutableList { + val permissionList: MutableList = ArrayList() + if (resources.contains(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + permissionList.add(Manifest.permission.CAMERA) + } + if (resources.contains(PermissionRequest.RESOURCE_AUDIO_CAPTURE)) { + permissionList.add(Manifest.permission.MODIFY_AUDIO_SETTINGS) + permissionList.add(Manifest.permission.RECORD_AUDIO) + } + return permissionList + } + + /** + * @return one of the PERMISSION_REQUEST_* constants. + */ + private external fun onPermissionRequestNative(webviewId: String, resource: String): Int + + override fun getDefaultVideoPoster(): Bitmap { + // Return a transparent bitmap so Chromium doesn't paint its default gray play-button placeholder on