Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
(feat) Nota Remote in the new look, with clip previews in Scenes (#556, #557) (#569)
Egor Khindikaynenc613167d6f66
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7e90d40c..790e2c2e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,12 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Nota Remote shows what is in each clip on the Scenes screen** (#557, specs/090). A filled+ cell reads like the desktop's Session slot: the clip's name and length on top, and below+ them its notes as a small piano roll, or its waveform, in the clip's colour. Editing,+ replacing or recording a clip on the computer updates its cell on the phone within a+ second; a take being recorded grows as it records. Previews are sent only to a phone on+ Scenes and only for the clips that changed.- **A private Cue mix on its own outputs** (#483, specs/089). On an interface with more thantwo outputs, **Settings → Outputs** sends Main (what the audience hears) to oneoutput pair and Cue (your own mix) to another, for example Main on 1/2 and Cue on 3/4.@@ -156,6 +162,14 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.notes in their articulation's colour instead of the track's.### Changed+- **Nota Remote in the new look** (#556, specs/090). Every phone screen, sheet and banner now+ follows the style guide the desktop wears: the same corner scale, one typeface with+ fixed-width figures (Geist Mono is gone), sentence-case labels, a true minus and thin+ spaces in numbers. Orange means what it means on the desktop: solid for what is live+ (Play, a pad under your finger), a soft tint with orange text for what you picked (the+ current screen, a segment, a toggle that is on). Macros and XY draw their values in the+ track's colour; the mixer stays grey. The phone also wears your skin's typeface (when the+ phone has it) and corner roundness, under Follow Nota and Follow phone alike.- **Track headers, a little wider** (#296): the header column now starts at 252 px insteadof 228, so names and controls breathe in the new look. A width you dragged yourself stays.A group's **Link** key now matches M and S in the new look.diff --git a/DESIGN.md b/DESIGN.mdindex 6fb54cc1..318156ab 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -1400,10 +1400,12 @@ it doesn't draw.## Nota Remote-The phone page (`src/web/remote`, spec 014) **keeps its own styling for now**: its radii-(0 / 1 / 2 / 3 / 4 px), its type (Geist for words and Geist Mono for numbers, bundled with-the page) and its layout are not redrawn by this guide. Only the shared colour tokens it-reads change, and its guard test (`RunRemote`) keeps passing.+The phone page (`src/web/remote`, specs 014 and 090) follows this guide at phone sizes.+Its corners are the corner scale as custom properties (`--r-card` 9 … `--r-fine` 2, docked+bars and strips 0); its one typeface is `--font-ui` (Geist, with tabular figures on the+root; no monospace); numbers go through `lib/fmt.ts` (U+2212, thin space, fixed precision).+A skin's typeface and radii reach it with the theme (`font` and `r` per theme in the+`theme` message, resolved by `SkinGeometry`); a typeface the phone lacks falls back to Geist.It holds no colour value: Nota sends the theme it wears and the user's dark-mode andlight-mode picks with all their tokens (the `theme` message), and the page sets each token@@ -1416,9 +1418,15 @@ loads), or the Studio Dark fallback that `theme-plugin.ts` builds from the theme`npm run build`. Elevation is built the same way: `--bevel` (`ShadowBevel`), `--sunken`(`Rule`), `--popover` (`Seam` + `ShadowPopover`), `--scrim` (`ShadowModal`).-Its structure: seams, orange for live or chosen only, solid semantic fills with derived-ink, sentence case, at phone sizes: touch targets 36–56 px and words 11–16 px (the big-position and the count-in larger). Its icons are inline SVG with the shared stroke, since+Its structure: seams, solid semantic fills with derived ink, sentence case, at phone sizes:+touch targets 36–56 px and words 11–16 px (the big position and the count-in larger).+Orange in the guide's strengths: **live** solid (Play running, a pad or key under a finger,+a looping section, the count-in); **picked** the soft tint with `--picked-ink` (`AccentBright`+in dark themes, `AccentPale` in light ones) for the current screen, a segment, a toggle that+is on, a chosen row. **Values** on Macros and XY carry the playing track's colour (a phone+has no device card to hold orange values); the mixer is grey, a fader under a finger+borrows the soft tint and an orange line. A Session cell draws its clip's name, length and+content (notes or peaks, the `clips` message) like the desktop slot. Its icons are inline SVG with the shared stroke, since`Glyph` is native. `npm run mock` serves the built page against a stand-in Nota with ademo project and the real theme messages, for screenshots without the desktop app.@@ -1447,7 +1455,7 @@ drift).| `RunIcons` | No path geometry outside `Controls/Glyph.cs`: no `Geometry.Parse` / `StreamGeometry.Parse` / `PathGeometry.Parse`, no axaml `Data="M…"`, no SVG path string (`IconAllowList.txt`, a per-file count) || `RunMenus` | Menu icons through `MenuKit.Icon`, destructive items through `MenuKit.Danger`, no Color / Track height submenus (`MenuAllowList.txt`) || `RunBrowser` | Every built-in device sits in exactly one category of its own tab (`DeviceCategories.cs`); no stale or empty category; names in sentence case; 16 / 27 / 6 devices shelved |-| `RunRemote` | Nota Remote's page: no colour literal in its sources or `index.html`; the first-paint fallback built from the theme files; no letter-spacing, `uppercase`, `.toUpperCase()` or `.caps`; radii 0 / 1 / 2 / 3 / 4 px or 50 %; every custom property it reads is a theme token or one it defines |+| `RunRemote` | Nota Remote's page: no colour literal in its sources or `index.html`; the first-paint fallback built from the theme files; no letter-spacing, `uppercase`, `.toUpperCase()` or `.caps`; every radius `var(--r-*)`, 0 or 50 %; no monospace (`Geist Mono`, `monospace`, `.mono`, a Mono font file); `--picked-ink` defined for dark and light themes; every custom property it reads is a theme token or one it defines |Not enforced by a test yet: the type scale, the sizes in § Shapes, the device layouts in§ Devices, where orange may appear, the absence of depth in the shell, the@@ -1492,7 +1500,9 @@ Places where a screen's needs override a general rule, kept on purpose:- **Compact mixer meters are 18 px a channel**, 3 apart, against the 11 / 5 meter rule(specs/070, #386): the wide meter is what keeps a 72 px compact strip readable, and it isalso the strip's fader. Zones, the hold mark and the −60…+6 scale are unchanged.-- **Nota Remote keeps its own styling and Geist Mono** for now (§ Nota Remote).+- **Nota Remote draws Macros and XY values in the track's colour**, not orange lines+ (specs/090): outside a device card the phone has no other place for them, and the track+ colour ties the control to the track it plays (§ Nota Remote).- **The accent picker's spectrum** (Settings → Appearance → Accent → Custom, specs/084) isthe one rainbow in the app: a saturation/brightness area and a hue strip, drawn as bitmapsdiff --git a/FEATURES.md b/FEATURES.mdindex e1e029f4..357e46d3 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -574,8 +574,15 @@ docks as a panel under any of the three, or floats in its own window — see- **Nota Remote in Nota's theme**: the phone wears the colour theme Nota wears and followsevery change live (including Follow system); **Follow phone** (⋯ → Theme) wears theIn dark mode / In light mode themes by the phone's own scheme. Its screens follow the- Studio look — one accent (Nota's chosen accent) for what is live or chosen, semantic mute / solo / arm- colours, sentence-case labels — and a returning phone paints in its last theme at once.+ style guide the desktop wears — the corner scale, one typeface with tabular figures,+ orange solid for what is live and a soft tint for what is picked (Nota's chosen accent),+ values on Macros and XY in the track's colour, semantic mute / solo / arm colours,+ sentence-case labels — and a returning phone paints in its last theme at once. A user+ skin's typeface (when the phone has it) and corner roundness reach the phone too.+- **Nota Remote Scenes shows clip contents**: each filled cell has the clip's name and+ length and a preview of what is in it — notes as a small piano roll, audio as a+ waveform — in the clip's colour, updated within a second of an edit and growing while a+ take records.- **Nota Remote Keys — Expressive**: on a track whose instrument takes MPE, the phone'sKeyboard and Scale modes can keep each finger on the note it struck: sliding sideways bendsit (a key's width is its pitch step), the height on the key is its slide, and a screen thatdiff --git a/specs/090-remote-new-look/checklists/requirements.md b/specs/090-remote-new-look/checklists/requirements.mdnew file mode 100644index 00000000..47742b82--- /dev/null+++ b/specs/090-remote-new-look/checklists/requirements.md@@ -0,0 +1,37 @@+# Specification Quality Checklist: Nota Remote in the new look++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-11-11+**Feature**: [spec.md](../spec.md)++## Content Quality++- [x] No implementation details (languages, frameworks, APIs)+- [x] Focused on user value and business needs+- [x] Written for non-technical stakeholders+- [x] All mandatory sections completed++## Requirement Completeness++- [x] No [NEEDS CLARIFICATION] markers remain+- [x] Requirements are testable and unambiguous+- [x] Success criteria are measurable+- [x] Success criteria are technology-agnostic (no implementation details)+- [x] All acceptance scenarios are defined+- [x] Edge cases are identified+- [x] Scope is clearly bounded+- [x] Dependencies and assumptions identified++## Feature Readiness++- [x] All functional requirements have clear acceptance criteria+- [x] User scenarios cover primary flows+- [x] Feature meets measurable outcomes defined in Success Criteria+- [x] No implementation details leak into specification++## Notes++- Design-language terms (corner names, U+2212, token names) come from DESIGN.md and are the+ product's vocabulary, not implementation choices; the Nota Context section names files by+ project convention.+- Clarified 2026-11-11: phone theme modes, Macros/XY value colour, pressed pad colour.diff --git a/specs/090-remote-new-look/contracts/clips-message.md b/specs/090-remote-new-look/contracts/clips-message.mdnew file mode 100644index 00000000..1741469c--- /dev/null+++ b/specs/090-remote-new-look/contracts/clips-message.md@@ -0,0 +1,41 @@+# Contract: the `clips` message (Nota → phone)++Clip previews for the Scenes grid (#557). One text frame of JSON, alongside `ses` (which is+unchanged: slot state, length, progress).++```json+{+ "t": "clips",+ "all": false,+ "s": [+ { "id": 12, "i": 0, "nm": "Bass 1", "col": "#4FA3E0", "len": 16, "k": "n",+ "n": [[0, 4, 36], [8, 4, 36], [16, 2, 43], [24, 8, 41]] },+ { "id": 15, "i": 2, "nm": "Vox take", "col": "#D96A9A", "len": 32, "k": "p",+ "p": [3, 12, 40, 88, 99, 61, "…48 values"] },+ { "id": 12, "i": 3, "k": "x" }+ ]+}+```++| Field | Meaning |+|---|---|+| `all` | `true` on the first send to a phone that opened Scenes (or reconnected): the phone drops previews it holds for slots not in this batch series. `false` for change batches. |+| `s` | Slots: `id` track id, `i` scene index. |+| `nm` | Clip name as the desktop slot shows it (its own name, else "<track> <scene+1>"). |+| `col` | Clip colour as the desktop draws it (clip's own, else the track's), `#RRGGBB`. |+| `len` | Clip length in beats (2 decimals). For a recording slot: whole bars recorded so far. |+| `k` | `n` notes, `p` peaks, `x` the slot is empty now (drop its preview). |+| `n` | Note bars `[start, len, pitch]`: start and len in 1/64 of `len` (integers 0–64, len ≥ 1), pitch 0–127. At most 128. |+| `p` | 48 peak magnitudes, 0–99, normalised to the clip's loudest bucket. |+| `rec` | `true` while the slot is recording (the phone draws in the record colour). |++## Rules++- **C1** Sent only to a phone whose screen is Scenes (`screen` subscription, as `ses`).+- **C2** A slot is sent to a phone only when its signature differs from the one that phone+ last got for it. Nothing changes → nothing is sent.+- **C3** On a phone opening Scenes or connecting while on it: every filled slot, in batches+ of at most 64 slots, the first with `all: true` and following ones `all: false`.+- **C4** A recording slot is re-sent at most 4 times a second while it grows.+- **C5** An older phone ignores the message (unknown `t`).+- **C6** Group and return tracks are never in `s` (the phone's grid has no such columns).diff --git a/specs/090-remote-new-look/contracts/theme-message.md b/specs/090-remote-new-look/contracts/theme-message.mdnew file mode 100644index 00000000..3df29d00--- /dev/null+++ b/specs/090-remote-new-look/contracts/theme-message.md@@ -0,0 +1,31 @@+# Contract: the `theme` message, with skin geometry (Nota → phone)++Extends [spec 014's theme message](../../014-remote-studio/contracts/theme-message.md).+Every rule there (T1–T5) still holds. Two optional fields join each theme in `th`:++```json+"th": {+ "night-shift": {+ "name": "Night Shift", "dark": true, "c": { "…": "…" },+ "font": "IBM Plex Sans",+ "r": { "card": 4, "group": 4, "field": 3, "cell": 3, "valueBar": 2, "switch": 2, "fine": 1 }+ },+ "studio-dark": { "name": "Studio Dark", "dark": true, "c": { "…": "…" } }+}+```++| Field | Meaning |+|---|---|+| `font` | The skin's typeface family as the theme file names it. Absent → Geist. |+| `r` | Every radius step in whole px, as the desktop draws it under this skin (`SkinGeometry.RadiusOf`). Absent → the design scale (card 9, group 7, field 6, cell 5, valueBar 4, switch 3, fine 2). |++## Rules++- **G1** `font` is present only when the theme names a family; `r` only when the theme's+ radii differ from the design scale. A built-in theme carries neither.+- **G2** `r`, when present, has all seven keys.+- **G3** The phone puts `font` ahead of Geist in its font stack; a family the phone lacks+ falls through to Geist.+- **G4** An older phone ignores both fields; a phone receiving a theme without them wears+ Geist and the design scale (resetting any skin geometry worn before).+- **G5** A geometry change alone (same colours) re-sends the message (T1).diff --git a/specs/090-remote-new-look/data-model.md b/specs/090-remote-new-look/data-model.mdnew file mode 100644index 00000000..e3ffaef5--- /dev/null+++ b/specs/090-remote-new-look/data-model.md@@ -0,0 +1,57 @@+# Data model: Nota Remote in the new look, with clip previews++## RemoteTheme (Nota.Remote, extended)++| Field | Type | Notes |+|---|---|---|+| Id, Name, Dark, Colors | as spec 014 | unchanged |+| Font | `string?` | skin's `font.family`; null for built-ins / format 1 |+| Radii | `IReadOnlyDictionary<string,double>?` | 7 keys (`card … fine`), resolved px; null when the design scale |++Built by `MainWindow.Remote.RemoteThemeOf` from `NotaColourTheme.Geometry`+(`SkinGeometry.RadiusOf`, `SkinGeometry.Key`). Cache key already includes the theme+instance; a geometry change yields a new theme instance, so the hub re-sends (G5).++## Phone look state (web, `lib/theme.svelte.ts`)++| Custom property | Source | Default |+|---|---|---|+| `--<token>` (~110) | theme colours | first-paint fallback (spec 014) |+| `--font-ui` | `font` | `Geist, system-ui, -apple-system, sans-serif` |+| `--r-card … --r-fine` | `r` | 9 / 7 / 6 / 5 / 4 / 3 / 2 px |+| `--picked-ink` | `app.css` per `data-theme` | `--accent-bright` dark, `--accent-pale` light |++All of them go into the stored `nota-remote:vars` blob, so a returning phone first-paints+with the last typeface and radii too.++## ClipPreview (hub-side, per slot)++| Field | Type | Notes |+|---|---|---|+| TrackId, Scene | int | key `TrackId * 4096 + Scene` |+| Name | string | `GetSessionClipName` or "<track> <scene+1>" |+| Color | string | `IRemoteHost.ClipColor(track, scene)` |+| LenBeats | double | `SessionSlotLength`, or bars recorded so far while recording |+| Kind | n / p / x | instrument track → notes; audio → peaks; empty → x |+| Notes | `(byte start, byte len, byte pitch)[]` ≤ 128 | 1/64-of-length grid |+| Peaks | `byte[48]` | 0–99 |+| Recording | bool | state 4 / 5 |+| Signature | ulong | FNV-1a over all of the above |++Hub state: `Dictionary<int, ClipPreview> _previews`, a round-robin cursor over+(track, scene), `HashSet<int> _dirty`. Per phone: `Dictionary<int, ulong> SentClips`+(cleared when it leaves Scenes, so re-opening re-sends all — C3).++### Lifecycle++```text+empty ──(clip appears)──▶ filled ──(content/len/name/colour change)──▶ filled (new signature)+ ▲ │ ──(record starts)──▶ recording ──(stops)──▶ filled+ └────────(cleared)── x ◀──┘+```++## Phone Scenes cell (web)++`app.clips: Map<string, Preview>` keyed `"<id>:<i>"`, filled from `clips` messages (an+`all: true` batch clears it first). The cell draws from `ses` (state, progress) + `clips`+(name, colour, length, content).diff --git a/specs/090-remote-new-look/plan.md b/specs/090-remote-new-look/plan.mdnew file mode 100644index 00000000..a6123775--- /dev/null+++ b/specs/090-remote-new-look/plan.md@@ -0,0 +1,139 @@+# Implementation Plan: Nota Remote in the new look, with clip previews in Scenes++**Branch**: `feat/remote-new-look` | **Date**: 2026-11-11 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `specs/090-remote-new-look/spec.md` (issues+nota-daw/nota#556 and nota-daw/nota#557).++## Summary++Restyle Nota Remote (`src/web/remote`) to the spec 038 design language and make it wear+the desktop's skins (spec 087) — typeface and corner radii join the theme message — and+show clip contents (notes / waveform, with the clip name) in the Scenes grid, sent by the+hub as a compact `clips` message only to phones on Scenes and only on change.++Approach: (1) a token layer in `app.css` — radius variables, `--font-ui`, `--picked-ink`,+live / picked utility classes — then every component moves onto it; (2) `RemoteTheme`+gains `Font` / `Radii`, filled from `SkinGeometry`; (3) a `ClipPreviews` part of the hub+with round-robin change detection and per-phone signatures; a canvas per Scenes cell.++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) (§ Orange, § Type, § Numbers, § Labels,+ § Corner scale, § Session slot) and the `nota-design` skill.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md).++## Technical Context++**Language/Version**: TypeScript + Svelte 5 (phone page); C# / .NET 10 (`Nota.Remote`,+`Nota.App` host side, smoke test).++**Primary Dependencies**: Svelte, Vite (existing). No new dependency; Geist Mono removed.++**Storage**: phone `localStorage` (`nota-remote:vars` gains font and radii) — no project+or settings format change.++**Audio-Thread Impact**: None. The hub runs on the UI tick; previews use the+control-side engine reads the desktop Session view already makes (`GetSessionNotes`,+`GetSessionSlotPeaks` → `Engine::getClipPeaks` const, `GetSessionClipName`,+`AudioRecordPeaksOf`). No C ABI change.++**Testing**: `tests/Nota.SmokeTest` (`DesignTokenCheck.Remote`, `RemoteTests`),+`npm run check`, visual checks via the mock and the real-hub harness.++**Target Platform**: iOS Safari 16+, Chrome 100+ (Vite target unchanged), phone and tablet.++**Project Type**: desktop app + embedded mobile web page.++**Performance Goals**: theme / skin change on the phone < 1 s; preview change < 1 s;+round-robin ≤ 24 slot reads per UI tick and only while a phone is on Scenes.++**Constraints**: `clips` first full send for 32 × 32 < 64 KB; zero preview traffic while+nothing changes; no `color-mix()` (target lacks it).++**Scale/Scope**: ~16 Svelte / TS files restyled; 2 hub files; 1 host file; 2 test files;+mock extended.++## Constitution Check++| Principle | Status |+|---|---|+| 0 Approved issue | ✅ #556 and #557 both `approved`; both linked from the PR |+| I Real-time safety | ✅ no audio-thread change (see Audio-Thread Impact) |+| II Boundary | ✅ no C ABI change, no JUCE |+| III Licensing | ✅ SPDX headers on new files; no new dependency; a font file removed |+| IV Verification | ✅ smoke test extended (theme geometry, clips message, design scan) |+| V One logical change | ⚠️ two issues in one PR — at the user's request; both are "Remote Scenes / look" and the clip cell is designed in the new look, so splitting would restyle the Scenes cell twice. Recorded in Complexity Tracking |+| VI Docs | ✅ CHANGELOG, FEATURES.md, nota-docs Remote page (EN + RU) |+| VII Spec first | ✅ this spec |+| VIII | ✅ nothing weakened |++Post-design re-check: unchanged — the design adds no engine work and no dependency.++## Project Structure++### Documentation (this feature)++```text+specs/090-remote-new-look/+├── spec.md, plan.md, research.md, data-model.md, quickstart.md+├── contracts/theme-message.md # font + r per theme+├── contracts/clips-message.md # clip previews+└── tasks.md # /speckit-tasks+```++### Source Code++```text+src/web/remote/+├── index.html # head script: also restore font / radii (already generic over vars)+├── theme-plugin.ts # fallback unchanged; defaults for --r-* / --font-ui live in app.css+├── public/fonts/ # GeistMono-Medium.woff2 removed+├── mock/nota-mock.mjs # ?skin=, clips message with demo notes / peaks+└── src/+ ├── app.css # radius / font / picked tokens, .live / .picked, .btn .seg .switch restyled+ ├── App.svelte # tabs / rail: picked strength+ ├── lib/theme.svelte.ts # wear font + radii; store them+ ├── lib/palette.ts # cssVars(...) also emits --font-ui / --r-*+ ├── lib/types.ts # ThemeMessage font/r; ClipsMessage+ ├── lib/fmt.ts # NEW: db / pct / bpm / bars with − and thin space+ ├── lib/app.svelte.ts # clips map, 'clips' handler+ ├── components/{Header,Banner,Overlays,Sheets}.svelte+ ├── components/ClipPreview.svelte # NEW: canvas notes / peaks+ └── screens/{Scenes,Mixer,Keys,Pads,XY,Macros,BigTransport,Empty}.svelte++src/managed/Nota.Remote/+├── RemoteContracts.cs # RemoteTheme(Font, Radii); IRemoteHost.ClipColor+├── RemoteHub.State.cs # ThemeJson writes font / r; Push sends clips on Scenes+└── RemoteHub.Clips.cs # NEW: previews, signatures, round-robin, JSON++src/managed/Nota.App/MainWindow.Remote.cs # RemoteThemeOf fills Font / Radii; ClipColor++tests/Nota.SmokeTest/+├── DesignTokenCheck.Remote.cs # radii vars, no monospace, picked ink+└── RemoteTests.cs # theme geometry; clips on Scenes / on change / capped+```++**Structure Decision**: the existing Remote split (web page ↔ `Nota.Remote` hub ↔ host in+`Nota.App`) is kept; previews get their own hub partial file so `RemoteHub.State.cs` stays+about pushing state.++## Phases++1. **Foundation** — tokens in `app.css`, `fmt.ts`, theme geometry end-to-end (host → hub →+ phone), Geist Mono removed, smoke scan updated. Unblocks everything.+2. **US1 restyle** — header / transport / tabs / rail, sheets, overlays, banner; then each+ screen. Mixer grey, Macros / XY track colour, pads / keys live accent.+3. **US2 skins** — verify font / radii live under Follow Nota and Follow phone; stored for+ first paint.+4. **US4 clip previews** — hub `RemoteHub.Clips.cs`, host `ClipColor`, `clips` message,+ phone store + `ClipPreview.svelte`, Scenes cell layout with name / length / preview;+ recording growth; mock support; smoke tests.+5. **US3 guard rails + evidence** — hit-area and contrast measurement before / after,+ screenshots, docs, CHANGELOG, FEATURES.++## Complexity Tracking++| Violation | Why Needed | Simpler Alternative Rejected Because |+|---|---|---|+| Two issues (#556, #557) in one PR (principle V) | The user asked to extend this branch with #557; the Scenes cell is redesigned by both | Two PRs would restyle the Scenes cell twice and conflict in the same files; the PR keeps the two as separate commits and links both issues |diff --git a/specs/090-remote-new-look/quickstart.md b/specs/090-remote-new-look/quickstart.mdnew file mode 100644index 00000000..cd0680dc--- /dev/null+++ b/specs/090-remote-new-look/quickstart.md@@ -0,0 +1,55 @@+# Quickstart: validating spec 090++## Prerequisites++- Node from the repo's usual location (node is not on PATH in some shells — see BUILD.md),+ `npm ci` in `src/web/remote`.+- A Release engine build (`scripts/build.sh`).++## 1. Static checks++```bash+cd src/web/remote && npm run check && npm run build+```++Expected: svelte-check 0 errors / 0 warnings; the bundle builds into+`src/managed/Nota.Remote/wwwroot` with no `GeistMono` file.++```bash+scripts/build.sh+```++Expected: green, including `DesignTokenCheck.Remote` (radii on the scale variables, no+monospace, `--picked-ink` defined) and `RemoteTests` (theme `font` / `r`; `clips` sent on+Scenes only, on change only, capped).++## 2. The look, against the mock (no desktop needed)++```bash+cd src/web/remote && npm run mock+```++Open `http://127.0.0.1:7790/#p=1234` at 390 × 844 (phone), 844 × 390 (phone landscape) and+1024 × 1366 (tablet). For each of `?theme=studio-dark|studio-light|ember-graphite|ember-paper`+and `?skin=square-avenir` (a v2 skin with `radius.scale: 0` and a font family):++- every screen and overlay: picked = soft tint + orange text, never solid; live = solid;+ Mixer grey at rest; Macros / XY values in the track colour;+- numbers: tabular, `−` and thin-space units; labels sentence case;+- the skin: no rounded corners; text in the family if installed, Geist otherwise.++## 3. Clip previews, against the real hub++Use the real-server harness (RemoteServer + hub over an engine project with MIDI and audio+Session clips) and the desktop side by side:++1. Open Scenes on the phone: each filled cell shows name, length and its notes / waveform,+ matching the desktop slot.+2. Edit a MIDI clip's notes on the desktop → the phone cell follows within 1 s.+3. Record into a Session slot (MIDI and audio) → the phone cell grows in the record colour.+4. Leave Scenes → no `clips` frames arrive (browser devtools WS view); return → one full set.++## 4. Evidence for the PR++Before/after screenshots per screen × {phone, phone landscape, tablet} × 4 themes + the+skin; Scenes with previews beside the desktop Session view. Use the `nota-pr` skill.diff --git a/specs/090-remote-new-look/research.md b/specs/090-remote-new-look/research.mdnew file mode 100644index 00000000..cce9f60d--- /dev/null+++ b/specs/090-remote-new-look/research.md@@ -0,0 +1,122 @@+# Research: Nota Remote in the new look, with clip previews in Scenes++## R1 — What the phone is told about a skin's geometry++- **Decision**: per theme in the `theme` message, add `font` (family name, only when the skin+ names one) and `r` (the seven resolved radii in px, keyed by the theme-file step keys+ `card group field cell valueBar switch fine`, only when the skin differs from the design+ scale). Nota resolves them with `SkinGeometry.RadiusOf`, the function the desktop uses.+ `RemoteTheme` gains `string? Font` and `IReadOnlyDictionary<string, double>? Radii`.+- **Rationale**: the phone needs no copy of the roundness rule — one source of truth.+ Omitting both for built-ins keeps the message unchanged for the common case.+- **Alternatives**: send `scale` + `steps` and recompute in TypeScript (drift risk).++## R2 — Wearing a typeface the phone may not have++- **Decision**: `--font-ui: "<family>", Geist, system-ui, sans-serif`; CSS falls back to+ Geist per family and per glyph. The family is sanitised (quotes, backslashes, `;{}`+ stripped) before it goes into CSS. Nota sends no font files.+- **Alternatives**: `document.fonts.check()` detection — unreliable for local fonts on iOS.++## R3 — Radii as custom properties++- **Decision**: `app.css` defines `--r-card 9px … --r-fine 2px`; the theme layer overrides+ them from `r` and resets them when `r` is absent. Every `border-radius` in the phone's+ sources is `0`, `50%` or built from `var(--r-*)`.+- **Phone part → step** (DESIGN.md § Corner scale, by what the part is):++| Phone part | Step |+|---|---|+| Header, tabs, rail, banner, Mixer strips, covers, Big transport ground | Docked (0) |+| Big framed areas: Macros grid frame, XY field, Empty card, cover checklist, Big transport keys | Card |+| Sheet / menu, toast, segment group, `.btn`, transport keys, track and device pickers, axes panel | Group |+| Field (device name, code cells), row highlight, pad, Scenes clip cell | Field |+| Segment cell, M / S / Arm, scale cell, chord, scene button, Stop, section button, tag chips | Cell |+| Fader cap, pan bar, slots, rate chip | ValueBar |+| Switch track | Switch |+| Switch knob, meter channel, colour bars, note bars | Fine |++## R4 — Orange in three strengths on the phone++- **live** (solid `--accent` + `--ink-on-accent`): Play running, Record (record colour),+ count-in number, a looping section, pad / key / cell / chord under a finger, the Tilt pill.+- **picked** (`--accent-soft` fill + `--picked-ink`; `--picked-ink` = `--accent-bright` in+ dark themes, `--accent-pale` in light ones): current tab / rail item, segment `on`,+ `.btn.on` toggles (Full velocity, Repeat, Loop, Click, Tilt off-state stays raised), chosen+ row in sheets, chosen tonic, the open position readout.+- **values**: track colour on Macros arcs and the XY crosshair / point (clarification);+ Mixer grey at rest, a held fader / pan borrows soft tint + accent line.+- Switches in the phone's menu are settings switches: solid accent track when on, as+ DESIGN.md § Switch.+- **Track-colour tint** without `color-mix()` (target Safari 16 / Chrome 100): a layer+ filled with `var(--tc)` at a fixed opacity under the content.++## R5 — Type: one face, tabular figures, phone sizes++- **Decision**: root `font-family: var(--font-ui)`, `font-variant-numeric: tabular-nums`;+ drop `GeistMono-Medium.woff2`, the `Geist Mono` face and `.mono`. Phone sizes stay (never+ smaller than today); weights follow the scale (readouts 500, names 600, labels 400 ink 3).+- `lib/fmt.ts`: `db()`, `pct()`, `bpm()`, `bars()` with U+2212, U+2009 and fixed precision.++## R6 — Clip previews: what is sent (#557)++- **Decision**: a new message `clips` (Nota → phone) carrying, per changed slot, the clip's+ name, colour, length in beats and either `n` (note bars) or `p` (peaks). See+ [contracts/clips-message.md](contracts/clips-message.md).+ - **Notes**: `[start, len, pitch]` relative to the clip, start/len quantised to 1/64 of+ the clip length (integers 0–64) — the phone draws them at cell resolution anyway. More+ than 128 notes: merge per pitch row overlapping bars after quantisation; if still over,+ keep the first 128 by start (the shape stays readable; FR-021).+ - **Peaks**: 48 buckets of `max(|min|, |max|)` normalised 0–99 to the clip's loudest+ bucket (the desktop draws exactly this normalised magnitude; sign is not drawn).+ - Clip colour: `host.ClipColor(trackId, scene)` — the clip's own colour, else its+ track's, as `SessionView.ClipBrush` does. Name: `GetSessionClipName`, else+ "<track> <scene+1>", as `SessionView.ClipName`.+- **Rationale**: integers keep JSON small: a 64-note clip ≈ 0.8 KB, peaks ≈ 0.2 KB; a+ 32 × 32 grid of mixed clips stays well under 64 KB for the first send (SC-009).+- **Alternatives**: binary frames (the hub speaks JSON text only; not worth a second+ framing); sending raw notes (unbounded).++## R7 — Clip previews: when it is sent (change detection)++- **Decision**: no engine revision counter exists for Session slots, so the hub keeps per+ slot a 64-bit signature (FNV-1a over the compact preview + name + colour + length) and+ re-reads slots **round-robin**: at most 24 slots per UI tick, only while at least one+ phone is on Scenes, so a 32 × 32 grid is fully re-checked about every 0.7 s at 60 Hz.+ A slot whose `SessionSlotState` / length changed, and every recording slot (state 4 / 5,+ re-read 4× a second), jumps the queue. A changed signature marks the slot dirty; each+ phone on Scenes gets the dirty slots it has not seen (per-phone sent-signature map);+ opening Scenes or a new connection sends all non-empty slots once, batched up to 64+ slots per message.+- **Audio thread**: `GetSessionNotes`, `GetSessionSlotPeaks`, `GetSessionClipName`,+ `AudioRecordPeaksOf` are the control-side reads the desktop Session view already makes on+ the UI thread (`Engine_Session.cpp`: `sessionSlotPeaks` → `getClipPeaks`, const, no+ audio-thread work). No new locks; nothing new crosses the C ABI.+- **Recording MIDI**: stored notes via `GetSessionNotes` while recording, the length shown+ as whole bars recorded so far (as `DrawRecordingNotes`); the desktop's held-key overlay+ (`RecordPreview`) is app-side and not available to the hub — held keys appear when they+ are stored (an accepted simplification; the take still visibly grows).+- **Recording audio**: `AudioRecordPeaksOf(trackId, …)` for the slot recording.+- **Alternatives**: an engine-side revision counter (C ABI change, out of proportion for a+ look feature); re-reading everything each tick (FR-022 forbids).++## R8 — Drawing the preview on the phone++- **Decision**: one `<canvas>` per filled cell (device-pixel-ratio aware), redrawn only+ when its preview, colour, size or state changes; notes 3 px bars with `--r-fine`-scaled+ corners, peaks centred bars 62 % of a step wide, as `DrawPeaks`. Ink: the clip colour on+ a stopped cell, `--tc-ink` on a playing / queued (filled) cell, `--record` / its ink when+ recording. The canvas reads colours from computed custom properties, so a theme change+ repaints.+- **Cell layout**: top row name (ellipsis) + length; preview area below; play mark and+ progress line on top.+- **Alternatives**: inline SVG per cell (hundreds of nodes per clip on big grids).++## R9 — Checks++- `tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs`: radii `0`, `50%` or `var(--r-…)`; no+ `Geist Mono` / `monospace` / `class="mono"`; `--picked-ink` defined for both kinds.+- `tests/Nota.SmokeTest/RemoteTests.cs`: theme payload carries `font` / `r` for a skin and+ neither for a built-in; `clips` sent only to a phone on Scenes, once per change, capped,+ and not re-sent while nothing changes.+- `npm run check` clean; `npm run build` builds; `scripts/build.sh` green.diff --git a/specs/090-remote-new-look/spec.md b/specs/090-remote-new-look/spec.mdnew file mode 100644index 00000000..b7bdd7fc--- /dev/null+++ b/specs/090-remote-new-look/spec.md@@ -0,0 +1,403 @@+# Feature Specification: Nota Remote in the new look, with clip previews in Scenes++**Feature Branch**: `feat/remote-new-look`++**Created**: 2026-11-11++**Status**: Draft++**Input**: User description: "Nota Remote: restyle to the new look from the style guide (GitHub issue nota-daw/nota#556, approved). Restyle every Nota Remote screen and overlay (src/web/remote: header, transport, screen switcher; Scenes, Mixer, Keys, Pads, XY, Macros, Big transport; sheets, banners, pairing/empty states) to the spec 038 design language in DESIGN.md: flat grey shell where track colours carry the content, orange in three strengths (solid for live, soft tint for picked, orange lines only for values inside devices), Geist with tabular figures (no Geist Mono), sentence-case labels, the 038 corner scale, U+2212 minus and thin-space units. Colours keep coming from the theme tokens Nota sends (spec 014), never hand-copied hex. Must account for the new theme support: user skins (spec 087, theme file v2 with font.family and radius scale/steps) and the accent colour (spec 084) — the phone should wear the skin's corner radii and, where the phone has it, its typeface (falling back to Geist), following the desktop theme or the phone's own pick (Follow Nota / Follow phone). Keep touch targets, contrast and readability on phone and tablet in portrait and landscape no worse. No change to Remote protocol behaviour beyond adding the skin's font/radius to the theme message — look only. Evidence: before/after screenshots of each screen on phone and tablet in each theme."++**Input (extension, 2026-11-11)**: "Extend this branch with nota-daw/nota#557 (approved): show clip contents in the Remote Scenes grid as the desktop Session view does — a mini piano-roll of a MIDI clip's notes, an audio clip's waveform peaks — in the track colour, behind the name, play mark and progress line; updated when a clip is edited, recorded or replaced; a recording clip shows its growing content; sent compactly and only on change so a big grid loads neither the Wi-Fi link nor the audio thread."++**Issues**: nota-daw/nota#556 — "Nota Remote: restyle to the new look from the style guide" (approved);+nota-daw/nota#557 — "Nota Remote: show clip contents (notes or waveform) in the Session grid, as on the desktop" (approved).++## Nota Context *(fill in — drives plan and tasks)*++**Feature area** *(pick the main one)*:++- [ ] Engine (C++, `src/native/nota.engine`) — real-time audio rules apply, see `ARCHITECTURE.md` AR table+- [x] Managed app (C#, `src/managed/*`) — the theme message and a new clip-preview message Nota sends the phone (`Nota.Remote`)+- [x] UI — Nota Remote, the phone web app (`src/web/remote`); follows `DESIGN.md` (spec 038)+- [ ] Plugin hosting (`pluginhost/`) — the only place JUCE is allowed+- [ ] Build / packaging / CI (`scripts/`, `.github/`) — see `BUILD.md`+- [ ] Docs only++Builds on spec 014 (Nota Remote wears Nota's theme, live), spec 038 (the style guide, which+moved the desktop to the new look after 014 shipped), spec 084 (accent colour worn over any+theme) and spec 087 (user skins: colours, typeface, corner radii). The clip previews (#557)+mirror the desktop Session slot (`SessionView.Grid.cs`: the note preview, `GetSessionSlotPeaks`,+the recording preview of #56 / spec 086).++**Nota docs to keep in mind** *(links relative to `specs/<slug>/`, where this file lands)*:+[`ARCHITECTURE.md`](../../ARCHITECTURE.md) (AR rules),+[`CONTRIBUTING.md`](../../CONTRIBUTING.md) (licensing, dependency policy, PR+expectations), [`BUILD.md`](../../BUILD.md), [`DESIGN.md`](../../DESIGN.md),+[`FEATURES.md`](../../FEATURES.md),+[`../014-remote-studio/spec.md`](../014-remote-studio/spec.md),+[`../087-user-skins/contracts/theme-file-v2.md`](../087-user-skins/contracts/theme-file-v2.md).++## Clarifications++### Session 2026-11-11++- Q: Should the phone get its own pick of a specific theme or skin, beyond Follow Nota / Follow phone? → A: No — keep the two modes; skins (with typeface and radii) work in both. No new theme UI on the phone.+- Q: How are values drawn on the Macros and XY screens? → A: In the playing track's colour (a quiet tint of it as the fill, a solid line/handle in it), not orange; Mixer values stay grey.+- Q: How is a pad or key under the finger drawn? → A: Solid accent, as now (live); a note the track itself plays keeps the track's colour.+- Q: Does the phone's Scenes cell show the clip's name along with its preview (#557)? → A: Yes, as on the desktop slot: the clip name top left, the length top right, the preview below; the name travels with the preview data.++## Background++Spec 014 already made the phone wear Nota's theme colours live, as custom properties named+after the theme tokens, with Follow Nota / Follow phone in the phone's menu. It styled the+phone in the *previous* Studio look: radii 2 / 3 / 4, Geist Mono for numbers, solid orange+for anything chosen. Spec 038 since changed the desktop: a new corner scale (2–9), one+typeface with tabular figures and no monospace, orange in three strengths (a chosen option+is a soft tint, never solid), the shell type scale, U+2212 minus and thin-space units.+Spec 087 then let a theme carry its own typeface and corner radii, which Nota does not send+the phone today. So the phone now differs from the desktop in shape, type, the meaning of+orange, and — under a user skin — in typeface and roundness.++## User Scenarios & Testing *(mandatory)*++### User Story 1 - The phone looks like the desktop app (Priority: P1)++A musician plays from Nota Remote on a phone next to the computer. Every phone screen+(Scenes, Mixer, Keys, Pads, XY, Macros, Big transport), the header with its transport, the+screen switcher (tabs in portrait, rail in landscape and on a tablet), the sheets and menus,+the banners and the pairing / empty / connection states read as the same product as the+desktop: the same flat grey shell on seams, the same corner scale, the same typeface with+fixed-width figures, the same sentence-case labels, and orange used the way the desktop+uses it.++**Why this priority**: this is what the issue asks for; everything else refines it.++**Independent Test**: connect a phone (or a phone-sized browser) to Nota in Studio Dark;+open each screen and overlay and compare it with the desktop and DESIGN.md — shapes, type,+orange, labels and numbers follow the rules below.++**Acceptance Scenarios**:++1. **Given** the transport is playing or recording, **When** the user looks at the header+ or Big transport, **Then** Play (while running) and Record (while recording) are solid+ orange with readable ink — the only solid orange on screen apart from a playing Session+ clip's own live mark.+2. **Given** a chosen option — the current screen in the tabs or rail, a chosen segment+ (octave, scale, pad bank, XY mode…), a toggle that is on (Loop, Metronome, Follow,+ Learn), the selected track or row, **When** it is drawn, **Then** it wears the soft tint+ with orange text or icon (the bright orange in dark themes, the pale one in light ones),+ never a solid orange fill.+3. **Given** the Mixer, **When** faders, pans and meters are drawn at rest, **Then** they+ are grey (values outside a device stay neutral); a fader being dragged borrows the soft+ tint with an orange line while the finger is on it, as the desktop's shell slider does.+4. **Given** the Macros and XY screens (they drive device values), **When** values are+ drawn, **Then** they use the playing track's colour — a quiet tint of it as the fill and+ a solid line or handle in it — so the track colour carries the content; with no track+ they use neutral ink.+4a. **Given** Pads or Keys, **When** a pad or key is under a finger, **Then** it is solid+ accent with derived ink (live); **When** the track itself plays a note, **Then** that+ pad or key carries the track's colour.+5. **Given** a mute, solo or arm button that is on, **When** drawn, **Then** it uses the+ theme's Mute, Solo and Record colours with derived ink, as the desktop's track buttons.+6. **Given** Scenes, Mixer, Pads and Keys, **When** tracks and clips are drawn, **Then**+ the track colours carry the content (clip fills, strip marks, pad tints) while the shell+ around them stays grey; a selected clip or slot gets an outline in primary ink, not+ orange.+7. **Given** any number on screen (tempo, position, dB, percentages, note names, values),+ **When** drawn, **Then** it uses the shell typeface's fixed-width figures (no monospace+ face), a true minus sign (−), a thin space before its unit, and fixed precision so its+ width does not jump as it changes.+8. **Given** any label, button, heading, menu item or banner text, **When** drawn,+ **Then** it is sentence case with no letter spacing; acronyms and units (MIDI, XY, dB,+ BPM, USB) keep their own case.++---++### User Story 2 - The phone wears the user's skin (Priority: P1)++A user wears a skin of their own (spec 087) on the desktop — their colours over their+accent, a typeface such as IBM Plex Sans, and square corners (roundness 0). With the phone+on Follow Nota it wears the same colours, the same corner radii and, if the phone has that+typeface, the same typeface; otherwise the phone's text stays in Geist.++**Why this priority**: the issue asks to account for the new theme support; without it a+skinned desktop and its phone look like two apps again.++**Independent Test**: on the desktop, wear a user skin with `radius.scale` 0 and a font+family the phone has (and then one it lacks); the phone repaints live with square corners+and that typeface (then Geist).++**Acceptance Scenarios**:++1. **Given** the phone on Follow Nota and Nota wearing a user skin, **When** the skin is+ picked or edited on the desktop, **Then** the phone repaints in the skin's colours within+ a second, without a reload, exactly as for a built-in theme.+2. **Given** a skin with a roundness scale and/or exact step values, **When** worn, **Then**+ every rounded corner on the phone follows the same corner scale the desktop computes for+ that skin; docked panels (header, tabs, rail) stay square.+3. **Given** a skin naming a typeface, **When** worn on a phone that has that typeface+ installed, **Then** the phone's text uses it at the same sizes and weights; **When** the+ phone does not have it, **Then** the phone uses Geist and stays fully usable.+4. **Given** the phone on Follow phone, **When** the user's dark- or light-mode pick is a+ skin, **Then** the phone wears that skin's colours, radii and typeface for the phone's+ scheme.+5. **Given** the user's accent colour (spec 084), **When** the phone is connected, **Then**+ every orange on the phone is the user's accent in all three strengths, live.+6. **Given** a built-in theme, **When** worn, **Then** the phone uses Geist and the design+ corner scale.++---++### User Story 3 - Still easy to hit at arm's length (Priority: P2)++On a phone in a stand or on a tablet on a music stand, the user still hits pads, keys,+faders and transport reliably and reads values at a glance, in portrait and landscape and+in every built-in theme.++**Why this priority**: a restyle that shrinks targets or loses contrast would make the+remote worse at its job; it is the guard rail on stories 1–2.++**Independent Test**: measure hit areas and text contrast on each screen before and after+in phone portrait, phone landscape and tablet; none gets smaller or less readable.++**Acceptance Scenarios**:++1. **Given** any interactive control, **When** measured after the restyle, **Then** its hit+ area is at least what it was before (and never under 36 px on its short side).+2. **Given** any text, **When** measured in each built-in theme, **Then** its contrast is+ no lower than before the restyle and meets the desktop's readability bar for its role.+3. **Given** text on the phone, **When** compared with the desktop scale, **Then** it may+ be larger than the desktop's (phone-sized), never smaller than it was before the restyle.++---++### User Story 4 - See what is in each clip on the phone's Scenes grid (Priority: P2)++A musician launches clips from the phone. Like the desktop's Session view, every filled cell+on the Scenes screen shows what is in the clip — the notes of a MIDI clip as a mini+piano-roll across the clip's length, the waveform of an audio clip — in the track's colour,+behind the cell's text, play mark and progress line. Clips with similar lengths or names are+told apart at a glance. Editing, recording or replacing a clip on the desktop updates its+cell on the phone; a clip being recorded shows its content growing, as on the desktop.++**Why this priority**: the second approved issue folded into this branch; it builds on the+restyled Scenes cell (story 1) but is useful on its own.++**Independent Test**: with a project holding MIDI and audio clips in Session, open Scenes on+the phone: each filled cell shows its notes or waveform matching the desktop slot; edit a+clip's notes on the desktop and the phone's cell follows within a second; record a take and+watch it grow.++**Acceptance Scenarios**:++0. **Given** a filled slot, **When** shown, **Then** the cell reads like the desktop slot:+ the clip's name top left, its length top right, the preview below.+1. **Given** a MIDI clip in a Session slot, **When** the Scenes screen shows it, **Then** the+ cell draws its notes as short bars across the clip's length, pitch from the clip's lowest+ to highest note top to bottom, as the desktop slot does.+2. **Given** an audio clip in a Session slot, **When** shown, **Then** the cell draws its+ waveform as centred peak bars scaled to the clip's loudest part, as the desktop does.+3. **Given** a clip that is stopped, queued or playing, **When** drawn, **Then** the preview+ is in the track's colour on the stopped cell, and in readable ink on the cell when it is+ filled with the track colour (playing / queued); the play mark, length and progress line+ stay on top and readable.+4. **Given** a clip edited, replaced, cleared, copied or resized on the desktop, **When**+ the phone shows Scenes, **Then** the cell's preview follows within one second.+5. **Given** a slot recording, **When** shown, **Then** the cell shows the take growing — the+ recorded peaks of an audio take, the notes of a MIDI take so far — in the record colour.+6. **Given** the Scenes screen is not shown on a phone, **When** clips change, **Then** no+ preview data is sent to that phone; when it opens Scenes, it receives the current+ previews once.+7. **Given** a group or return track, **When** the grid is shown, **Then** nothing changes+ for it (the phone's grid has no group or return columns today).++### Edge Cases++- **Older Nota** that sends no typeface or radius information: the phone uses Geist and+ the design corner scale.+- **A returning phone before Nota answers**: it paints in the colours, radii and typeface+ it last wore, as it already does for colours.+- **Skin's typeface lacks glyphs** the phone draws (−, thin space, ▸): those characters fall+ back per character to a system font; layout does not shift.+- **A wide or very condensed typeface** pushes a label past its space: the label truncates+ with an ellipsis; controls do not resize.+- **Roundness 2×** on small parts (pads, keys, Session slots): corners never exceed half+ the part's short side, so nothing turns into a pill shape that hides its edges.+- **A light theme or a skin with a pale accent**: the soft tint and the picked-option text+ still read; ink on solid orange is chosen by contrast, as on the desktop.+- **Track colours under Follow phone**: unchanged from spec 014 — track colours are Nota's.+- **Link lost**: the dimmed surface and the reconnect banner use the new look too.+- **An empty MIDI clip or a silent audio clip**: the cell shows no preview, only its text.+- **A clip with hundreds or thousands of notes**: the preview stays capped in size (notes+ merged per pitch row and time column); what is drawn still reads as the clip's shape.+- **A big grid** (e.g. 32 tracks × 32 scenes): previews are sent once per clip and then only+ for the clips that change; a phone that joins late gets them once.+- **A tiny cell** (phone portrait with many tracks): the preview scales into the cell's+ preview area and never covers the text row.+- **A clip longer than its loop / a note past the end**: drawn up to the clip's length, as+ on the desktop.++## Requirements *(mandatory)*++### Functional Requirements++**Look (all screens and overlays)**++- **FR-001**: Every Nota Remote surface — header and transport, tabs and rail, Scenes,+ Mixer, Keys, Pads, XY, Macros, Big transport, sheets and menus, banners, pairing, empty+ and connection states — MUST follow DESIGN.md (spec 038) for shapes, type, orange, labels+ and numbers, adapted only in size for touch.+- **FR-002**: Orange MUST be used in the three strengths of DESIGN.md § Orange: solid only+ for live state (Play while running, Record, a recording or playing indicator, the+ playhead/loop in Big transport, a pad or key under a finger); soft tint with orange text/icon for a picked option or a+ tool that is on. Device values on Macros and XY MUST use the playing track's colour (tint+ fill, solid line or handle), not orange. A pad or key under a finger MUST be solid accent+ (live). A picked option MUST NOT be solid orange; Mixer faders, pans and meters MUST stay+ grey at rest.+- **FR-003**: Corners MUST follow the 038 corner scale (Card, Group, Field, Cell, Value bar,+ Switch, Fine; Docked = 0) mapped to each phone part by what it is, as one set of named+ radii so a skin can re-round them all.+- **FR-004**: All phone text MUST use one shell typeface (Geist by default) with fixed-width+ figures; the monospace face MUST no longer be used or shipped with the phone app.+- **FR-005**: Every label, button, heading, menu item, banner and state message MUST be+ sentence case without letter spacing, keeping acronyms and units in their own case.+- **FR-006**: Every number MUST use U+2212 for negatives, a thin space before its unit,+ fixed precision per DESIGN.md § Numbers (dB one decimal, tempo two, percent whole), and+ an en dash for ranges.+- **FR-007**: Mute, solo and arm MUST use the theme's Mute, Solo and Record colours with+ derived ink; a selected clip or slot MUST be outlined in primary ink.+- **FR-008**: The phone MUST keep sourcing every colour from theme tokens (spec 014): no+ colour value in the phone's sources beyond the build-time first-paint fallback generated+ from the theme files.++**Theme support (skins and accent)**++- **FR-009**: Nota MUST tell the phone, per theme it sends, the theme's typeface family and+ corner radii (the resolved corner scale, or the roundness scale and step overrides), so+ the phone computes the same radii the desktop wears. Themes without them (built-ins,+ older format) mean Geist and the design scale.+- **FR-010**: The phone MUST wear the sent typeface when the phone can render it, and+ Geist otherwise; it MUST NOT download fonts from anywhere but Nota.+- **FR-011**: Follow Nota and Follow phone MUST apply typeface and radii the same way they+ apply colours (the worn theme, or the user's dark/light pick for the phone's scheme),+ live on change, and the last worn typeface and radii MUST be remembered for first paint.+- **FR-012**: The user's accent (spec 084) MUST be worn by the phone in all three strengths,+ live.+- **FR-013**: The change to the theme message MUST be additive: an older phone ignores the+ new fields, a newer phone without them falls back to Geist and the design scale. Apart from+ this and the clip-preview message (FR-018–FR-023), no Remote message or behaviour changes.++**Usability guard rails**++- **FR-014**: No control's hit area MAY shrink, and none MAY be under 36 px on its short+ side; Pads, Keys and transport keep their current sizes or grow.+- **FR-015**: No text's contrast MAY drop below its value before the restyle in any+ built-in theme, and text MUST NOT be smaller than before.+- **FR-016**: Phone portrait, phone landscape and tablet layouts MUST all be restyled and+ keep their current arrangement of controls.++**Clip previews in Scenes (#557)**++- **FR-018**: Every filled Session cell on the phone's Scenes screen MUST show a preview of+ the clip's content: a MIDI clip's notes as bars (time across the clip's length, pitch over+ the clip's own pitch range), an audio clip's waveform as centred peak bars scaled to its+ loudest bucket — the same picture the desktop slot draws.+- **FR-018a**: Each filled cell MUST show the clip's name (as the desktop slot names it)+ top left and its length top right, above the preview, truncating the name with an ellipsis.+- **FR-019**: The preview MUST be drawn in the track's colour on a stopped cell and in the+ derived ink on a cell filled with the track colour; a recording cell's preview MUST use+ the record colour. Text, play mark and progress line MUST stay above it and readable.+- **FR-020**: A clip's preview MUST update on the phone within one second when its content,+ length or kind changes on the desktop (edit, record, replace, clear, copy, resize); a slot+ being recorded MUST show its take growing at least twice a second.+- **FR-021**: Preview data MUST be sent only to phones showing Scenes, only for clips whose+ content changed since that phone last got them, and compactly — at most 64 peak buckets+ for audio and at most 128 note bars for MIDI per clip — so a 32 × 32 grid's full set fits+ in a few tens of kilobytes.+- **FR-022**: Building previews MUST NOT touch the audio thread beyond the reads the desktop+ Session view already makes (no new locks or allocations on it), and MUST NOT re-read+ every clip's content every tick: unchanged clips cost a cheap change check only.+- **FR-023**: The preview message MUST be additive: an older phone ignores it; a phone+ without previews still launches clips as before.++**Evidence**++- **FR-017**: The pull request MUST carry before/after screenshots of each screen and the+ main overlays on a phone and a tablet, in each of the four built-in themes, plus one user+ skin with a custom typeface and roundness; and the Scenes grid with MIDI and audio clip+ previews (stopped, playing, recording) on a phone and a tablet beside the desktop's+ Session view.++### Key Entities++- **Theme message (spec 014)**: what Nota tells the phone about appearance — the worn theme,+ the dark and light picks, each theme's colour tokens and the ink pair. Gains, per theme,+ an optional typeface family and corner radii.+- **Corner scale**: seven named radii (Card 9, Group 7, Field 6, Cell 5, Value bar 4,+ Switch 3, Fine 2) plus Docked 0, re-rounded by a skin's scale and step overrides.+- **Clip preview**: per Session slot — the clip's name, kind (notes or peaks), the clip length it spans,+ and either note bars (start, length, pitch, relative to the clip) or peak buckets;+ identified by track and scene, with a content signature so unchanged previews are not+ re-sent.+- **Phone part → corner name / type role map**: which corner and which type role each phone+ part takes (a pad is a Cell or a Field, a sheet is a Card…), decided in the plan.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: On side-by-side screenshots of the desktop and the phone in each built-in+ theme, a reviewer finds no element where the phone uses orange, corners, typeface,+ label case or number format differently from DESIGN.md.+- **SC-002**: Changing theme, accent or skin on the desktop repaints the phone within one+ second, with no reload, in 100 % of tries.+- **SC-003**: Under a skin with roundness 0, no rounded corner remains on the phone; under+ a skin naming a typeface the phone has, 100 % of the phone's text uses it.+- **SC-004**: Every control's hit area and every text's contrast measured after the+ restyle is ≥ its value before, on phone portrait, phone landscape and tablet.+- **SC-005**: The phone's sources contain zero colour literals and zero monospace font+ references outside the generated fallback.+- **SC-006**: The phone app's download does not grow (dropping the monospace font file+ offsets any additions).+- **SC-007**: In a side-by-side check of 10 MIDI and 10 audio clips, a reviewer matches every+ phone Scenes cell to its desktop Session slot by its preview alone.+- **SC-008**: An edit to a clip on the desktop shows on the phone's cell within one second in+ 100 % of tries; a recording take visibly grows on the phone while it records.+- **SC-009**: With a 32 × 32 grid of filled clips and the phone on Scenes, preview traffic+ after the first full send is zero while nothing changes, and the first full send is under+ 64 KB.++## Assumptions++- "Each theme" for the screenshots means the four built-ins (Studio Dark, Studio Light,+ Ember Graphite, Ember Paper) plus one user skin; Follow Nota vs Follow phone is shown once.+- Phone sizes stay phone-sized: the desktop's type and control sizes are the design's+ proportions, scaled up for touch as spec 014 did; only the scale's relationships (which+ text is larger, which is quieter) are matched, not the desktop's point sizes.+- The phone can only render a skin's typeface if the phone itself has it installed; Nota+ does not ship the desktop's system fonts to the phone (licensing, size).+- Text size (Preferences → Appearance) and Interface scale are desktop settings and are not+ sent to the phone; the phone keeps its own sizes.+- The phone keeps exactly two appearance modes, Follow Nota and Follow phone (spec 014); it+ gets no picker of its own for a specific theme or skin.+- The Remote's behaviour, protocol (other than additive theme fields and the clip-preview+ message), screens and their+ arrangement stay as they are; this is look only.+- The preview reuses the engine reads the desktop Session view already makes+ (`GetSessionNotes`, `GetSessionSlotPeaks`, the recording peaks / notes); no engine change+ is expected. If change detection needs a cheaper signal than re-reading content, the plan+ decides it without touching the audio thread.+- The phone's grid keeps its current columns (no group or return columns), so group cells'+ child bars from the desktop are out of scope.+- The built phone page is not committed (spec #90); CI / the app build produces it.++## Nota Compliance Checklist *(review before implementation; re-check in tasks.md)*++- [x] Every new source file will carry the AGPL-3.0-only SPDX header (two lines, see CONTRIBUTING.md)+- [x] No new dependency — Geist is already bundled; Geist Mono is removed+- [x] Audio-thread impact considered: UI thread only — previews reuse the desktop Session view's existing engine reads (FR-022); no new audio-thread work+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no engine change+- [x] Smoke-test impact assessed: the theme payload is covered by the smoke test (spec 014); extend it for the typeface and radius fields and add the clip-preview message (sent on Scenes only, on change only, capped)+- [x] User-visible change → `CHANGELOG.md` `[Unreleased]` entry planned, FEATURES.md and the Remote docs page via nota-features / nota-docs+- [x] UI change → follows `DESIGN.md` (spec 038)diff --git a/specs/090-remote-new-look/tasks.md b/specs/090-remote-new-look/tasks.mdnew file mode 100644index 00000000..e9d84c43--- /dev/null+++ b/specs/090-remote-new-look/tasks.md@@ -0,0 +1,160 @@+---++description: "Tasks for spec 090 — Nota Remote in the new look, with clip previews in Scenes"+---++# Tasks: Nota Remote in the new look, with clip previews in Scenes++**Input**: Design documents from `specs/090-remote-new-look/`++**Prerequisites**: plan.md, spec.md, research.md, data-model.md, contracts/++**Tests**: the smoke test is the project's gate (constitution IV); the spec asks it to cover+the theme geometry and the clips message (Compliance checklist), so test tasks are included.++## Format: `[ID] [P?] [Story] Description`++- **[P]**: Can run in parallel (different files, no dependencies)+- **[Story]**: US1 look, US2 skins, US3 guard rails, US4 clip previews++## Path Conventions++- Phone page: `src/web/remote/`+- Hub: `src/managed/Nota.Remote/`; host: `src/managed/Nota.App/MainWindow.Remote.cs`+- Tests: `tests/Nota.SmokeTest/`++---++## Phase 1: Setup++- [X] T001 Capture "before" screenshots of every screen and overlay (phone 390×844, phone landscape 844×390, tablet 1024×1366; 4 built-in themes) from the current page via the mock (`src/web/remote/mock/nota-mock.mjs`, `npm run build && npm run mock`) into `/tmp/remote090/before/`, and record hit-area sizes and text contrast per screen (DOM measurement script) to `/tmp/remote090/before/metrics.json`++---++## Phase 2: Foundational (blocking)++- [X] T002 Add the design tokens to `src/web/remote/src/app.css`: `--r-card 9px; --r-group 7px; --r-field 6px; --r-cell 5px; --r-value-bar 4px; --r-switch 3px; --r-fine 2px` on `:root`; `--font-ui: Geist, system-ui, -apple-system, sans-serif`; `--picked-ink: var(--accent-bright)` under `:root, [data-theme='dark']` and `var(--accent-pale)` under `[data-theme='light']`; root `font-family: var(--font-ui)` and `font-variant-numeric: tabular-nums`; utilities `.live` (solid accent + ink-on-accent) and `.picked` (accent-soft + picked-ink)+- [X] T003 Remove Geist Mono: delete `src/web/remote/public/fonts/GeistMono-Medium.woff2`, its `@font-face` and the `.mono` rule in `src/web/remote/src/app.css`; replace every `class="mono"` / `.mono` use in `src/web/remote/src/**` with plain text (tabular figures are global) or a role class+- [X] T004 [P] Create `src/web/remote/src/lib/fmt.ts` (SPDX header): `db(v)` (one decimal, U+2212, `−∞`, `+` only when > 0), `pct(v)` (whole, thin space + `%`), `bpm(v)` (two decimals), `bars(beats)` ([n, unit]), `MINUS`, `THIN`; replace the helpers in `screens/Mixer.svelte`, `screens/Scenes.svelte`, `screens/XY.svelte`, `screens/Macros.svelte`, `components/Header.svelte`, `screens/BigTransport.svelte`+- [X] T005 Update `tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs`: radii must be `0`, `50%` or contain `var(--r-` (replace the 0–4 px list); fail on `Geist Mono`, `monospace` or `class="mono"` in `src/web/remote/src`; require `--picked-ink` defined for both theme kinds in `app.css`; require `GeistMono` absent from `src/web/remote/public/fonts`++**Checkpoint**: tokens exist; the page still renders; build and smoke scan pass.++---++## Phase 3: User Story 1 — the phone looks like the desktop (P1) 🎯 MVP++**Goal**: every surface follows DESIGN.md (spec 038): corner scale, one typeface, orange in three strengths, sentence case, number format.++**Independent Test**: mock at phone / landscape / tablet in Studio Dark; every screen and overlay matches DESIGN.md (quickstart § 2).++- [X] T006 [US1] Restyle shared controls in `src/web/remote/src/app.css`: `.btn` (radius `--r-group`, `.btn.on` = picked: soft tint + `--picked-ink`, no solid), `.seg` (group `--r-group`, cells `--r-cell`, `.on` = picked), `.switch` (track `--r-switch`, knob `--r-fine`, solid accent when on), `.label` (sentence case, ink 3, 400 weight), `.learnable`+- [X] T007 [US1] Restyle `src/web/remote/src/App.svelte`: tabs and rail — current screen = picked (soft tint fill, `--picked-ink` text, rail gets the 2 × 14 orange tick like the desktop's left rail, tabs keep the edge line); docked bars square+- [X] T008 [P] [US1] Restyle `src/web/remote/src/components/Header.svelte`: track picker and transport keys `--r-group`; Play running and Record = live solid (record colour for Record); position readout well `--r-field`, open = picked edge; readout 500 weight; link status text; `fmt.bpm`+- [X] T009 [P] [US1] Restyle `src/web/remote/src/components/Sheets.svelte`: sheet / menu `--r-group` with popover; chosen row = picked (soft tint + orange tick); `who` chips `--r-cell`; field `--r-field` with 1 px accent focus outline; tonic buttons picked; Theme segment picked+- [X] T010 [P] [US1] Restyle `src/web/remote/src/components/Overlays.svelte` and `components/Banner.svelte`: covers docked, checklist `--r-card`, code cells `--r-field` with the typing cell's accent edge, primary action by weight + tone, count-in number live accent, toast `--r-group`, banner docked; text sentence case+- [X] T011 [US1] Restyle `src/web/remote/src/screens/Mixer.svelte`: strips docked; fader cap `--r-value-bar`; pan bar and fader slot grey at rest, while held soft tint + accent line (shell slider rule); dB / pan via `fmt`; M / S / Arm `--r-cell` with Mute / Solo / Record fills and derived ink; meter channels `--r-fine`; group tag chip+- [X] T012 [US1] Restyle `src/web/remote/src/screens/Macros.svelte`: grid frame `--r-card`; device picker `--r-group`; knob arc and active value text in the playing track's colour (`--tc` from `app.track.color`, neutral `--viz-ink` when no track), arc groove grey; values via `fmt.pct`+- [X] T013 [US1] Restyle `src/web/remote/src/screens/XY.svelte`: field `--r-card`; crosshair and point in the track colour (`--tc`), a quiet `--tc` tint layer (opacity, no `color-mix`) behind the point while live; axes panel `--r-group`; Hold / Return picked; Tilt `.btn.on` picked, the "Tilt is moving the point" pill live solid; automation chip `--r-cell`+- [X] T014 [P] [US1] Restyle `src/web/remote/src/screens/Pads.svelte`: pads `--r-field`; under finger = live accent; played by the track = track colour + derived ink; bank segment picked; Full velocity / Repeat picked; rate chip `--r-value-bar`+- [X] T015 [P] [US1] Restyle `src/web/remote/src/screens/Keys.svelte`: keyboard frame `--r-group` bottom, keys `--r-fine` bottom; scale cells and chords `--r-cell`; under finger live accent; track-played band / edge in track colour; mode segment and key button picked; octave readout+- [X] T016 [P] [US1] Restyle `src/web/remote/src/screens/BigTransport.svelte`: keys `--r-card`; Play running live accent, Record live record; Loop / Click on = picked (soft tint + orange icon/text); section buttons `--r-cell`, current = orange tick, looping = live solid; position readout weight 500, record colour while recording; tempo via `fmt.bpm`+- [X] T017 [P] [US1] Restyle `src/web/remote/src/screens/Empty.svelte`: card `--r-card`, sentence case+- [X] T018 [US1] Restyle the Scenes chrome in `src/web/remote/src/screens/Scenes.svelte` (cell layout itself in US4): scene buttons and Stop `--r-cell`, clip cells `--r-field`, empty slots sunken; playing / queued in clip colour with derived ink; recording record colour; selected-looking states never orange+- [X] T019 [US1] Sweep `src/web/remote/src/**` for labels: sentence case everywhere ("Tap tempo", "Full velocity", "Follow Nota"), acronyms kept (MIDI, XY, USB, dB, BPM); no letter-spacing; ranges with en dash++**Checkpoint**: US1 complete — MVP of #556.++---++## Phase 4: User Story 2 — the phone wears the user's skin (P1)++**Goal**: font and radii from a spec 087 skin reach the phone, live, in both modes.++**Independent Test**: wear a v2 skin with `radius.scale: 0` and a font family; the phone repaints square and in that face (or Geist).++- [X] T020 [US2] Extend `src/managed/Nota.Remote/RemoteContracts.cs`: `RemoteTheme(string Id, string Name, bool Dark, IReadOnlyDictionary<string,string> Colors, string? Font = null, IReadOnlyDictionary<string,double>? Radii = null)` — `Radii` "7 keys (`card … fine`), resolved px; null when the design scale"+- [X] T021 [US2] Fill them in `src/managed/Nota.App/MainWindow.Remote.cs` `RemoteThemeOf`: `Font = t.Geometry.FontFamily`; `Radii` = `SkinGeometry.Key(step) → t.Geometry.RadiusOf(step)` for every `RadiusStep` when any differs from `SkinGeometry.Design(step)`, else null; make the cache key include `Geometry` if `NotaColourTheme` equality does not+- [X] T022 [US2] Write `font` / `r` per theme in `ThemeJson` in `src/managed/Nota.Remote/RemoteHub.State.cs` per contracts/theme-message.md G1–G2+- [X] T023 [US2] Phone side: `ThemeMessage` types in `src/web/remote/src/lib/types.ts` (`font?: string; r?: Record<string, number>`); in `src/web/remote/src/lib/palette.ts` `cssVars` also emits `--font-ui` (sanitised family, quoted, then Geist stack) and `--r-*` (from `r`, else the design values, so a theme without them resets — G4); `lib/theme.svelte.ts` applies and stores them (index.html restores them generically from `nota-remote:vars`)+- [X] T024 [P] [US2] Mock: `?skin=<file>` in `src/web/remote/mock/nota-mock.mjs` loads a v2 theme file (font + radius scale / steps, resolved like `SkinGeometry.RadiusOf`) and sends `font` / `r`; add a sample skin `src/web/remote/mock/square-avenir.json`+- [X] T025 [US2] Smoke test in `tests/Nota.SmokeTest/RemoteTests.cs`: a theme with `Font` and `Radii` sends `font` and all seven `r` keys; a built-in sends neither; a geometry-only change re-sends the theme++**Checkpoint**: US1 + US2 done — #556 complete.++---++## Phase 5: User Story 4 — clip previews in Scenes (P2, #557)++**Goal**: each filled cell shows name, length and notes / waveform like the desktop slot, updated on change, growing while recording.++**Independent Test**: quickstart § 3.++- [X] T026 [US4] Add `string ClipColor(int trackId, int scene)` to `IRemoteHost` in `src/managed/Nota.Remote/RemoteContracts.cs` and implement it in `src/managed/Nota.App/MainWindow.Remote.cs` (clip's own palette colour via `TryGetSessionClipProps`, else the track's — as `SessionView.ClipBrush`); update the test host in `tests/Nota.SmokeTest/RemoteTests.cs`+- [X] T027 [US4] Create `src/managed/Nota.Remote/RemoteHub.Clips.cs` (SPDX header): `ClipPreview` per data-model.md ("Notes ≤ 128, 1/64-of-length grid"; "Peaks byte[48] 0–99"); build from `GetSessionNotes` (instrument tracks) or `GetSessionSlotPeaks(…, 48)` (audio), `AudioRecordPeaksOf` / bars-so-far while recording (state 4 / 5); name `GetSessionClipName` else "<track> <scene+1>"; FNV-1a signature; round-robin ≤ 24 slots per tick while any phone is on Scenes; state/length changes and recording slots (≤ 4 Hz) jump the queue+- [X] T028 [US4] Send `clips` in `Push` (`src/managed/Nota.Remote/RemoteHub.State.cs`) per contracts/clips-message.md C1–C6: per-phone `SentClips` signatures on `RemoteClient` (`src/managed/Nota.Remote/RemoteClient.cs` or where the client class lives), cleared when the phone leaves Scenes; full set in batches ≤ 64 slots (first `all: true`); `k: "x"` for slots emptied+- [X] T029 [US4] Phone store: `ClipsMessage` / `Preview` types in `src/web/remote/src/lib/types.ts`; `clips` handler in `src/web/remote/src/lib/app.svelte.ts` keeping `clips: Map<"id:i", Preview>` (cleared on `all: true`, deleted on `k: "x"`)+- [X] T030 [US4] Create `src/web/remote/src/components/ClipPreview.svelte` (SPDX header): DPR-aware canvas; notes as 3 px bars over the clip's own pitch range, x by start/len ÷ 64; peaks as centred bars 62 % of a step wide; ink from a prop (CSS var resolved via computed style), redraw on data / size / ink / theme change only (ResizeObserver)+- [X] T031 [US4] Scenes cell layout in `src/web/remote/src/screens/Scenes.svelte`: top row clip name (ellipsis) + length; preview below in clip colour (stopped), `--tc-ink` (playing / queued), record colours (recording); play mark and progress line on top; use the clip colour from `clips` for `--tc`+- [X] T032 [P] [US4] Mock: `src/web/remote/mock/nota-mock.mjs` sends a `clips` message on Scenes with demo notes and peaks, and a growing recording slot+- [X] T033 [US4] Smoke test in `tests/Nota.SmokeTest/RemoteTests.cs`: a phone on Scenes gets `clips` for filled slots (notes for an instrument clip, 48 peaks for audio), none on another screen, none re-sent while unchanged, a note edit re-sends just that slot, notes capped at 128++**Checkpoint**: #557 complete.++---++## Phase 6: User Story 3 — guard rails (P2)++**Goal**: nothing smaller, nothing less readable.++- [X] T034 [US3] Capture "after" screenshots and metrics (same script and sizes as T001, plus the sample skin) into `/tmp/remote090/after/`; compare hit areas (≥ before, ≥ 36 px short side) and contrast (≥ before) per screen; fix regressions in the affected component++---++## Phase 7: Polish & cross-cutting++- [X] T035 Run `npm run check` and `npm run build` in `src/web/remote`; fix every error and warning+- [ ] T036 Run `scripts/build.sh`; smoke test green+- [X] T037 [P] `CHANGELOG.md` `[Unreleased]`: Changed — Nota Remote in the new look, wears skins' typeface and corners (#556); Added — clip previews in Remote Scenes (#557)+- [ ] T038 [P] FEATURES.md via the `nota-features` skill; user docs (Remote page EN + RU) via the `nota-docs` skill+- [ ] T039 Real-hub check (quickstart § 3) with the desktop side by side; Scenes with previews screenshots for the PR++---++## Dependencies & Execution Order++- Setup (T001) → Foundational (T002–T005) → US1 (T006–T019) → US2 (T020–T025) can start after T002 (independent of US1 screens) → US4 (T026–T033) after T018 → US3 (T034) after US1, US2, US4 → Polish.+- Within US1: T006 before T007–T018 (shared classes); T011–T013, T018 touch one file each.+- Within US4: T026 → T027 → T028; T029 → T030 → T031.++## Parallel Opportunities++- T004 with T002 / T003.+- US1: T008, T009, T010, T014, T015, T016, T017 in parallel after T006.+- US2 hub side (T020–T022) in parallel with US1 page work; T024 any time.+- US4: hub (T026–T028) in parallel with phone (T029–T031); T032 any time.++## Implementation Strategy++1. MVP: Phases 1–3 (the look) — demonstrable in the mock.+2. US2 (skins) — #556 done.+3. US4 (previews) — #557 done, separate commit.+4. Guard rails, polish, evidence, one PR closing both issues.++## Nota Compliance (re-check)++- [ ] SPDX header on `fmt.ts`, `ClipPreview.svelte`, `RemoteHub.Clips.cs`, mock skin file+- [ ] No new dependency; Geist Mono removed+- [ ] No audio-thread or C ABI change+- [ ] Smoke test extended (T005, T025, T033)+- [ ] CHANGELOG / FEATURES / docs (T037, T038)+- [ ] DESIGN.md followed++## Phase 8: Convergence++- [X] T040 Clamp every skinnable radius on small parts so a 2× skin never turns a part into a pill: wrap `var(--r-*)` in `min(var(--r-…), 25%)`-style caps (or a `--r-*-small` set) for buttons, segment cells, M / S / Arm, chips, pads, keys and Session cells in `src/web/remote/src/app.css` and the screen styles; keep `DesignTokenCheck.Remote` passing per spec Edge Cases "Roundness 2×" (partial)+- [ ] T041 Make the smoke test green: rerun `scripts/build.sh` on a quiet machine and compare the VST3 render-pool timing checks against `develop` built the same way; if they fail on `develop` too, record that they are unrelated, else fix per Constitution IV / plan Quality Gates (partial)+- [X] T042 Cover audio-clip previews end to end: a smoke test in `tests/Nota.SmokeTest/RemoteTests.cs` that puts an audio clip in a Session slot (`AddSessionAudioFile` or equivalent) and checks the `clips` slot has `k: "p"` with 48 values 0–99 and a 99 at the loudest bucket per FR-018 / US4/AC2 (partial)+- [ ] T043 Real-hub check with the desktop beside the phone (quickstart § 3): MIDI and audio previews match the desktop Session slot, an edit follows within 1 s, a recording grows; capture the side-by-side screenshots per FR-017 / SC-007 / SC-008 (missing)+- [ ] T044 Update the user manual's Nota Remote page (EN + RU) in `../nota-docs` via the `nota-docs` skill — new look, skin typeface / corners, Scenes clip previews — once that repo is free of the unrelated in-progress branch per Constitution VI (missing)+- [ ] T045 Review the two fixes outside the restyle — the tablet Mixer master strip width (`.tablet .masterstrip`) and full-width rows in the track sheet — and keep or split them with a line in the PR description per Constitution V (unrequested)diff --git a/src/managed/Nota.App/MainWindow.Remote.cs b/src/managed/Nota.App/MainWindow.Remote.csindex 41227b02..6d46fecd 100644--- a/src/managed/Nota.App/MainWindow.Remote.cs+++ b/src/managed/Nota.App/MainWindow.Remote.cs@@ -17,6 +17,7 @@ using Microsoft.Extensions.DependencyInjection;using Nota.Application;using Nota.Remote;using Nota.Application.Localization;+using Nota.Application.Themes;namespace Nota.App;@@ -125,14 +126,34 @@ public partial class MainWindow : IRemoteHostprivate RemoteTheme RemoteThemeOf(NotaColourTheme t){if (!_remoteThemes.TryGetValue(t, out var r))- _remoteThemes[t] = r = new RemoteTheme(t.Id, t.Name, t.IsDark, Enumerable.ToDictionary(t.Colors, c => c.Key, c => CssHex(c.Value)));+ _remoteThemes[t] = r = new RemoteTheme(t.Id, t.Name, t.IsDark, Enumerable.ToDictionary(t.Colors, c => c.Key, c => CssHex(c.Value)),+ t.Geometry.FontFamily, RemoteRadii(t.Geometry));return r;}+ // A skin's corners as the desktop draws them (spec 090): every step, or null when the+ // skin keeps the design scale, so a built-in theme's message is unchanged.+ private static IReadOnlyDictionary<string, double>? RemoteRadii(SkinGeometry g)+ {+ var steps = Enum.GetValues<RadiusStep>();+ if (steps.All(s => g.RadiusOf(s) == SkinGeometry.Design(s))) return null;+ return steps.ToDictionary(SkinGeometry.Key, g.RadiusOf);+ }+// CSS order: #RRGGBB, or #RRGGBBAA when translucent (Avalonia writes #AARRGGBB).private static string CssHex(Avalonia.Media.Color c) =>c.A == 0xFF ? $"#{c.R:X2}{c.G:X2}{c.B:X2}" : $"#{c.R:X2}{c.G:X2}{c.B:X2}{c.A:X2}";+ string IRemoteHost.ClipColor(int trackId, int scene)+ {+ if (Engine.TryGetSessionClipProps(trackId, scene, out var p) && p.Color >= 0)+ {+ var c = ArrangementView.TrackBrush(p.Color).Color;+ return $"#{c.R:X2}{c.G:X2}{c.B:X2}";+ }+ return ((IRemoteHost)this).TrackColor(trackId);+ }+string IRemoteHost.TrackColor(int trackId){var c = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(Engine, trackId)).Color;diff --git a/src/managed/Nota.Remote/RemoteClient.cs b/src/managed/Nota.Remote/RemoteClient.csindex 36f59824..372a5d4f 100644--- a/src/managed/Nota.Remote/RemoteClient.cs+++ b/src/managed/Nota.Remote/RemoteClient.cs@@ -53,6 +53,8 @@ public sealed class RemoteClientinternal string? SentLit;internal string? SentLearn;internal string? SentScreenState;+ /// <summary>Clip previews this phone has, by slot, while it shows Scenes (#557); null off Scenes.</summary>+ internal Dictionary<int, ulong>? SentClips;public bool Authenticated => Device is not null;diff --git a/src/managed/Nota.Remote/RemoteContracts.cs b/src/managed/Nota.Remote/RemoteContracts.csindex e79b8852..0cde82c0 100644--- a/src/managed/Nota.Remote/RemoteContracts.cs+++ b/src/managed/Nota.Remote/RemoteContracts.cs@@ -53,6 +53,9 @@ public interface IRemoteHostRemoteAppearance Appearance { get; }/// <summary>The track's colour as Nota draws it, "#RRGGBB".</summary>string TrackColor(int trackId);+ /// <summary>A Session clip's colour as the Session view draws it — its own, else its+ /// track's — "#RRGGBB" (#557).</summary>+ string ClipColor(int trackId, int scene);/// <summary>The track selected in Nota (0 = none), for "Follow Nota's selection".</summary>int SelectedTrackId { get; }/// <summary>The project key as a <c>MusicalKey.Code</c>, −1 = none.</summary>@@ -96,8 +99,13 @@ public interface IRemoteHost}/// <summary>One colour theme as the phone needs it: every token of Theme/Themes/<id>.json-/// as CSS hex (<c>#RRGGBB</c>, or <c>#RRGGBBAA</c> when translucent).</summary>-public sealed record RemoteTheme(string Id, string Name, bool Dark, IReadOnlyDictionary<string, string> Colors);+/// as CSS hex (<c>#RRGGBB</c>, or <c>#RRGGBBAA</c> when translucent), and a skin's typeface+/// and corner radii (spec 087; specs/090 contracts/theme-message.md).</summary>+/// <param name="Font">The skin's typeface family; null for Geist.</param>+/// <param name="Radii">Every radius step by its theme-file key (<c>card</c> … <c>fine</c>) in px,+/// as the desktop draws it under this skin; null when that is the design scale.</param>+public sealed record RemoteTheme(string Id, string Name, bool Dark, IReadOnlyDictionary<string, string> Colors,+ string? Font = null, IReadOnlyDictionary<string, double>? Radii = null);/// <summary>What the phone is told about colour: the theme Nota wears (Follow Nota), the user's/// dark-mode and light-mode picks (Follow phone), and the two inks text on a solid fill isdiff --git a/src/managed/Nota.Remote/RemoteHub.Clips.cs b/src/managed/Nota.Remote/RemoteHub.Clips.csnew file mode 100644index 00000000..98cac154--- /dev/null+++ b/src/managed/Nota.Remote/RemoteHub.Clips.cs@@ -0,0 +1,254 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// What is in each Session clip, for the phone's Scenes grid (#557; specs/090+// contracts/clips-message.md): the clip's name, colour and length, and either its notes on a+// 1/64-of-the-clip grid or 48 peaks — the picture the desktop's Session slot draws. The engine+// keeps no change counter for slots, so the hub re-reads them round-robin, a few per UI tick+// and only while a phone shows Scenes, and compares a signature of the compact preview: an+// unchanged clip costs one cheap read every second or so and is never re-sent. A slot whose+// state or length moved, or one being recorded, jumps the queue. The reads are the+// control-side ones the desktop Session view already makes on the UI thread; nothing here+// reaches the audio thread.++using System.Text;+using System.Text.Json;+using Nota.Application;++namespace Nota.Remote;++public sealed partial class RemoteHub+{+ internal const int PreviewGrid = 64, PreviewMaxNotes = 128, PreviewPeaks = 48;+ // The whole grid is re-read within PreviewSweepMs whatever the UI clock runs at (a 32 × 32+ // grid at a 33 ms tick: ~48 slots a tick), so an edit that keeps a slot's state and length —+ // notes, name, colour — still reaches the phone within a second. A recording slot is read+ // at most every PreviewRecordMs.+ internal const long PreviewSweepMs = 700;+ private const int PreviewMinReads = 8, PreviewMaxReads = 128, PreviewBatch = 64;+ private const long PreviewRecordMs = 250;++ /// <summary>One slot's preview as its JSON object; <c>Empty</c> for a slot with no clip.</summary>+ private sealed record SlotPreview(string Json, ulong Sig, bool Empty);++ private readonly Dictionary<int, SlotPreview> _previews = new();+ private readonly Dictionary<int, (int State, double Len)> _previewSlotSeen = new();+ private readonly float[] _peakBuf = new float[PreviewPeaks * 2];+ private int _previewCursor;+ private bool _previewsFresh;+ private long _previewRecordAt, _previewSweepAt;+ private double _previewReadCredit;++ private static int SlotKey(int trackId, int scene) => trackId * 4096 + scene;++ // The slots the phone's grid has: every track but groups and returns, every scene.+ private List<(TrackRow Track, int Scene)> PreviewSlots()+ {+ int scenes = _engine.SceneCount;+ var list = new List<(TrackRow, int)>();+ foreach (var r in _tracks)+ {+ if (r.Kind is "group" or "return") continue;+ for (int s = 0; s < scenes; s++) list.Add((r, s));+ }+ return list;+ }++ /// <summary>Bring the previews up to date for this tick. Called once per tick, before the+ /// phones are pushed; does nothing while no phone shows Scenes.</summary>+ private void UpdatePreviews(IRemoteHost host, bool anyOnScenes)+ {+ if (!anyOnScenes) { _previewsFresh = false; return; }+ var slots = PreviewSlots();+ var live = new HashSet<int>(slots.Count);+ foreach (var (t, s) in slots) live.Add(SlotKey(t.Id, s));+ foreach (var k in _previews.Keys.Where(k => !live.Contains(k)).ToList()) { _previews.Remove(k); _previewSlotSeen.Remove(k); }++ // Nobody watched since the last full read: read every slot once, so a phone opening+ // Scenes gets the whole grid in its first message.+ if (!_previewsFresh)+ {+ foreach (var (t, s) in slots) ReadPreview(host, t, s);+ _previewsFresh = true;+ _previewSweepAt = Environment.TickCount64;+ return;+ }++ long now = Environment.TickCount64;+ bool recordDue = now - _previewRecordAt >= PreviewRecordMs;+ if (recordDue) _previewRecordAt = now;+ var done = new HashSet<int>();+ var recordingSlots = new HashSet<int>();+ foreach (var (t, s) in slots)+ {+ int key = SlotKey(t.Id, s);+ int st = _engine.SessionSlotState(t.Id, s);+ double len = st == 0 ? 0 : _engine.SessionSlotLength(t.Id, s);+ bool moved = !_previewSlotSeen.TryGetValue(key, out var seen) || seen.State != st || Math.Abs(seen.Len - len) > 1e-6;+ bool recording = st is 4 or 5;+ if (recording) recordingSlots.Add(key);+ if (moved || (recording && recordDue)) { ReadPreview(host, t, s, st, len); done.Add(key); }+ }+ if (slots.Count == 0) return;+ // Read as many slots as the time since the last tick earns, so one sweep takes+ // PreviewSweepMs at any tick rate; recording slots keep their own 4 Hz pace.+ long dt = Math.Clamp(now - _previewSweepAt, 0, PreviewSweepMs);+ _previewSweepAt = now;+ _previewReadCredit += slots.Count * (double)dt / PreviewSweepMs;+ int reads = Math.Clamp((int)_previewReadCredit, PreviewMinReads, PreviewMaxReads);+ _previewReadCredit = Math.Max(0, _previewReadCredit - reads);+ for (int n = 0; n < Math.Min(reads, slots.Count); n++)+ {+ _previewCursor = (_previewCursor + 1) % slots.Count;+ var (t, s) = slots[_previewCursor];+ int key = SlotKey(t.Id, s);+ if (!done.Contains(key) && !recordingSlots.Contains(key)) ReadPreview(host, t, s);+ }+ }++ private void ReadPreview(IRemoteHost host, TrackRow t, int scene) =>+ ReadPreview(host, t, scene, _engine.SessionSlotState(t.Id, scene), 0);++ private void ReadPreview(IRemoteHost host, TrackRow t, int scene, int state, double len)+ {+ int key = SlotKey(t.Id, scene);+ if (state != 0 && len <= 0) len = _engine.SessionSlotLength(t.Id, scene);+ _previewSlotSeen[key] = (state, len);+ string json = state == 0 ? EmptySlotJson(t.Id, scene) : BuildPreview(host, t, scene, state, len);+ ulong sig = Fnv(json);+ if (_previews.TryGetValue(key, out var was) && was.Sig == sig) return;+ _previews[key] = new SlotPreview(json, sig, state == 0);+ }++ private static string EmptySlotJson(int trackId, int scene) => Json(w =>+ {+ w.WriteNumber("id", trackId);+ w.WriteNumber("i", scene);+ w.WriteString("k", "x");+ });++ private string BuildPreview(IRemoteHost host, TrackRow t, int scene, int state, double len)+ {+ bool recording = state is 4 or 5;+ bool audio = t.Kind == "audio";+ NotaNote[] notes = audio ? Array.Empty<NotaNote>() : _engine.GetSessionNotes(t.Id, scene);+ // A take being recorded shows whole bars recorded so far, as the desktop slot does.+ if (recording && !audio)+ {+ double end = notes.Length == 0 ? 0 : notes.Max(n => n.StartBeat + n.LengthBeats);+ double sofar = Math.Max(4, Math.Ceiling((end + 1e-6) / 4) * 4);+ len = len > 0 ? Math.Min(len, sofar) : sofar;+ }+ string name = _engine.GetSessionClipName(t.Id, scene);+ if (string.IsNullOrEmpty(name)) name = $"{t.Name} {scene + 1}";+ return Json(w =>+ {+ w.WriteNumber("id", t.Id);+ w.WriteNumber("i", scene);+ w.WriteString("nm", name);+ w.WriteString("col", host.ClipColor(t.Id, scene));+ w.WriteNumber("len", Math.Round(len, 2));+ if (recording) w.WriteBoolean("rec", true);+ if (audio)+ {+ w.WriteString("k", "p");+ int count = recording ? (state == 4 ? _engine.AudioRecordPeaksOf(t.Id, _peakBuf, PreviewPeaks) : 0)+ : _engine.GetSessionSlotPeaks(t.Id, scene, _peakBuf, PreviewPeaks);+ w.WriteStartArray("p");+ foreach (int v in Peaks(_peakBuf, count)) w.WriteNumberValue(v);+ w.WriteEndArray();+ }+ else+ {+ w.WriteString("k", "n");+ w.WriteStartArray("n");+ foreach (var (s, l, p) in NoteBars(notes, len))+ {+ w.WriteStartArray();+ w.WriteNumberValue(s);+ w.WriteNumberValue(l);+ w.WriteNumberValue(p);+ w.WriteEndArray();+ }+ w.WriteEndArray();+ }+ });+ }++ /// <summary>Peak magnitudes 0–99, scaled to the loudest bucket, as the desktop draws them.</summary>+ internal static int[] Peaks(float[] minMax, int count)+ {+ count = Math.Clamp(count, 0, minMax.Length / 2);+ float max = 1e-6f;+ for (int i = 0; i < count; i++) max = Math.Max(max, Math.Max(Math.Abs(minMax[i * 2]), Math.Abs(minMax[i * 2 + 1])));+ var out_ = new int[count];+ for (int i = 0; i < count; i++)+ out_[i] = (int)Math.Round(Math.Max(Math.Abs(minMax[i * 2]), Math.Abs(minMax[i * 2 + 1])) / max * 99);+ return out_;+ }++ /// <summary>A clip's notes on a 1/64-of-its-length grid: [start, length ≥ 1, pitch], the+ /// bars that land on one pitch row and overlap merged, at most <see cref="PreviewMaxNotes"/>+ /// (the first by start) — the clip's shape at the size a phone cell draws it.</summary>+ internal static List<(int Start, int Len, int Pitch)> NoteBars(IReadOnlyList<NotaNote> notes, double clipLen)+ {+ var bars = new List<(int Start, int Len, int Pitch)>();+ if (clipLen <= 0) return bars;+ foreach (var n in notes)+ {+ if (n.StartBeat >= clipLen || n.Pitch is < 0 or > 127) continue;+ int s = Math.Clamp((int)Math.Floor(n.StartBeat / clipLen * PreviewGrid), 0, PreviewGrid - 1);+ int e = Math.Clamp((int)Math.Ceiling(Math.Min(n.StartBeat + n.LengthBeats, clipLen) / clipLen * PreviewGrid), s + 1, PreviewGrid);+ bars.Add((s, e - s, n.Pitch));+ }+ bars.Sort((a, b) => a.Pitch != b.Pitch ? a.Pitch.CompareTo(b.Pitch) : a.Start.CompareTo(b.Start));+ var merged = new List<(int Start, int Len, int Pitch)>(bars.Count);+ foreach (var b in bars)+ {+ if (merged.Count > 0 && merged[^1].Pitch == b.Pitch && b.Start <= merged[^1].Start + merged[^1].Len)+ {+ var m = merged[^1];+ merged[^1] = (m.Start, Math.Max(m.Start + m.Len, b.Start + b.Len) - m.Start, m.Pitch);+ }+ else merged.Add(b);+ }+ merged.Sort((a, b) => a.Start != b.Start ? a.Start.CompareTo(b.Start) : a.Pitch.CompareTo(b.Pitch));+ if (merged.Count > PreviewMaxNotes) merged.RemoveRange(PreviewMaxNotes, merged.Count - PreviewMaxNotes);+ return merged;+ }++ private static ulong Fnv(string s)+ {+ ulong h = 14695981039346656037UL;+ foreach (char ch in s) { h ^= ch; h *= 1099511628211UL; }+ return h;+ }++ /// <summary>Send a phone on Scenes the previews it hasn't got (C1–C3): the whole grid,+ /// batched, when it arrives on Scenes; afterwards only the slots that changed.</summary>+ private void PushPreviews(RemoteClient c)+ {+ if (c.Screen != "Scenes") { c.SentClips = null; return; }+ bool first = c.SentClips is null;+ var sent = c.SentClips ??= new Dictionary<int, ulong>();+ var batch = new List<string>();+ foreach (var (key, p) in _previews)+ {+ if (sent.TryGetValue(key, out var was) ? was == p.Sig : p.Empty) continue;+ if (p.Empty) sent.Remove(key); else sent[key] = p.Sig;+ batch.Add(p.Json);+ }+ foreach (var key in sent.Keys.Where(k => !_previews.ContainsKey(k)).ToList())+ {+ sent.Remove(key);+ batch.Add(EmptySlotJson(key / 4096, key % 4096));+ }+ if (batch.Count == 0 && !first) return;+ for (int i = 0; i < Math.Max(1, batch.Count); i += PreviewBatch)+ {+ var sb = new StringBuilder("{\"t\":\"clips\",\"all\":").Append(first && i == 0 ? "true" : "false").Append(",\"s\":[");+ sb.AppendJoin(',', batch.Skip(i).Take(PreviewBatch));+ c.Send(sb.Append("]}").ToString());+ }+ }+}diff --git a/src/managed/Nota.Remote/RemoteHub.State.cs b/src/managed/Nota.Remote/RemoteHub.State.csindex 5142ed91..28c82fae 100644--- a/src/managed/Nota.Remote/RemoteHub.State.cs+++ b/src/managed/Nota.Remote/RemoteHub.State.cs@@ -71,6 +71,8 @@ public sealed partial class RemoteHubif (lit != c.SentLit) { c.Send(lit); c.SentLit = lit; }}+ if (screen != "Scenes") c.SentClips = null;+// A screen's live state at 15 Hz (every other UI tick); a new screen gets it at once.if (c.SentScreenState is not null && (_tick & 1) == 1) return;string? state = screen switch@@ -83,6 +85,7 @@ public sealed partial class RemoteHub};if (state is not null && state != c.SentScreenState) { c.Send(state); c.SentScreenState = state; }else if (state is null) c.SentScreenState = "";+ if (screen == "Scenes") PushPreviews(c);}// ---- project ------------------------------------------------------------------@@ -161,7 +164,8 @@ public sealed partial class RemoteHubprivate string _themeJson = "";// What the phone wears (specs/014 contracts/theme-message.md): the theme Nota wears, the- // dark-mode and light-mode picks, each theme once with every token, and the two inks.+ // dark-mode and light-mode picks, each theme once with every token and a skin's typeface+ // and radii (specs/090), and the two inks.// Rebuilt only when the host hands over a new appearance; the same string otherwise, so// Push's reference check tells a phone that already has it.private string ThemeJson(IRemoteHost host)@@ -189,6 +193,14 @@ public sealed partial class RemoteHubw.WriteStartObject("c");foreach (var (token, css) in t.Colors) w.WriteString(token, css);w.WriteEndObject();+ // A skin's typeface and corners (specs/090 contracts/theme-message.md G1–G2).+ if (!string.IsNullOrWhiteSpace(t.Font)) w.WriteString("font", t.Font);+ if (t.Radii is { Count: > 0 } radii)+ {+ w.WriteStartObject("r");+ foreach (var (step, px) in radii) w.WriteNumber(step, px);+ w.WriteEndObject();+ }w.WriteEndObject();}w.WriteEndObject();diff --git a/src/managed/Nota.Remote/RemoteHub.cs b/src/managed/Nota.Remote/RemoteHub.csindex 68482d4c..41a57109 100644--- a/src/managed/Nota.Remote/RemoteHub.cs+++ b/src/managed/Nota.Remote/RemoteHub.cs@@ -282,6 +282,9 @@ public sealed partial class RemoteHubif (clients.Count > 0){var snap = new Snapshot(this, host);+ if (_projectJson is null) RefreshProject(host);+ try { UpdatePreviews(host, clients.Any(c => c.Screen == "Scenes")); }+ catch (Exception) { /* a track removed mid-tick; next tick sees the new list */ }foreach (var c in clients){if (c.Backlog > 16) continue; // the phone isn't keeping up: let it drain firstdiff --git a/src/web/remote/mock/nota-mock.mjs b/src/web/remote/mock/nota-mock.mjsindex 013701f9..fe73bb9c 100644--- a/src/web/remote/mock/nota-mock.mjs+++ b/src/web/remote/mock/nota-mock.mjs@@ -9,6 +9,8 @@// ?theme=<id> the theme the stand-in wears (any Theme/Themes/<id>.json)// ?pick=<dark>,<light> its dark-mode and light-mode picks// ?legacy=1 behave like an older Nota: no theme message, only proj.dark+// ?skin=<name> wear mock/<name>.json, a format-2 skin (spec 087): its typeface and+// corner radii go out with the theme as Nota sends them (spec 090)// GET /mock?theme=<id> switch the worn theme live for the connected phonesimport { createServer } from 'node:http';@@ -36,6 +38,21 @@ const themes = Object.fromEntries(readdirSync(themesDir).filter((f) => f.endsWit}));const look = { on: 'studio-dark', dark: 'studio-dark', light: 'studio-light', legacy: false };+// A format-2 skin's corners as the desktop resolves them (SkinGeometry.RadiusOf): an exact+// step value, else round(design × scale). Sent only when they differ from the design scale.+const DESIGN_R = { card: 9, group: 7, field: 6, cell: 5, valueBar: 4, switch: 3, fine: 2 };+function loadSkin(name) {+ const file = join(here, `${name.replace(/[^\w-]/g, '')}.json`);+ if (!existsSync(file)) return null;+ const t = JSON.parse(readFileSync(file, 'utf8'));+ const base = themes[t.base] ?? themes['studio-dark'];+ const c = { ...base.c, ...Object.fromEntries(Object.entries(t.colors ?? {}).map(([k, v]) => [k, v.length === 9 ? '#' + v.slice(3) + v.slice(1, 3) : v])) };+ const scale = t.radius?.scale ?? 1, steps = t.radius?.steps ?? {};+ const r = Object.fromEntries(Object.entries(DESIGN_R).map(([k, d]) => [k, steps[k] ?? Math.round(d * scale)]));+ const differs = Object.entries(r).some(([k, v]) => v !== DESIGN_R[k]);+ return { name: t.name, dark: t.kind === 'dark', c, ...(t.font?.family ? { font: t.font.family } : {}), ...(differs ? { r } : {}) };+}+function themeMessage() {const ids = [...new Set([look.on, look.dark, look.light])];const ink = [themes['studio-dark'].c.TextOnAccent, themes['studio-dark'].c.ShadeUp];@@ -49,6 +66,8 @@ function readLook(url) {if (themes[pick[0]]?.dark) look.dark = pick[0];if (themes[pick[1]] && !themes[pick[1]].dark) look.light = pick[1];if (q.has('legacy')) look.legacy = q.get('legacy') === '1';+ const skin = q.get('skin') && loadSkin(q.get('skin'));+ if (skin) { themes[`skin-${q.get('skin')}`] = skin; look.on = `skin-${q.get('skin')}`; }}// ---- the demo project -----------------------------------------------------------------@@ -162,6 +181,37 @@ function sendScreen(c) {if (s) c.send(s());}+// Clip previews (#557, specs/090 contracts/clips-message.md): every filled slot once when a+// phone opens Scenes, then the recording slot as its take grows.+const rnd = (seed) => () => ((seed = (seed * 16807) % 2147483647) / 2147483647);+function notesOf(seed, count, lo, span, len = 4) {+ const r = rnd(seed), out = [];+ for (let i = 0; i < count; i++) out.push([Math.floor(r() * 60), Math.max(1, Math.round(len * (0.5 + r()))), lo + Math.floor(r() * span)]);+ return out;+}+const peaksOf = (seed, n = 48) => { const r = rnd(seed); return Array.from({ length: n }, (_, i) => Math.round(99 * Math.min(1, 0.25 + 0.75 * Math.abs(Math.sin(i / 3 + seed)) * r()))); };+const clipNames = { 1: ['Beat A', 'Beat B', 'Fill', ''], 2: ['Bass line', 'Bass line 2', 'Walk', ''], 3: ['Chords', '', 'Chords alt', 'Stab'], 4: ['', 'Vox take', '', ''], 6: ['Strings', 'Strings hi', '', 'Swell'] };+function clips(all) {+ const s = [];+ for (const tr of ses().tr) {+ const def = trackDefs.find((t) => t.id === tr.id);+ tr.c.forEach(([st, len], i) => {+ if (st === 0) return;+ const rec = st === 4;+ const base = { id: tr.id, i, nm: clipNames[tr.id]?.[i] || `${def.name} ${i + 1}`, col: colour(def.slot), len, ...(rec ? { rec: true } : {}) };+ if (def.kind === 'audio') {+ const p = peaksOf(tr.id * 10 + i);+ if (rec) { const grown = Math.floor(((Date.now() - state.started) / 250) % 48) + 1; for (let k = grown; k < 48; k++) p[k] = 0; }+ s.push({ ...base, k: 'p', p });+ } else {+ const drums = def.kind === 'drum';+ s.push({ ...base, k: 'n', n: notesOf(tr.id * 10 + i + 1, drums ? 40 : 18, drums ? 36 : 40, drums ? 10 : 20, drums ? 1 : 6) });+ }+ });+ }+ return { t: 'clips', all, s: all ? s : s.filter((x) => x.rec) };+}+function welcome(c, m) {c.paired = true;c.screen = m.screen ?? c.screen;@@ -173,6 +223,7 @@ function welcome(c, m) {c.send({ t: 'who', p: { 3: ['Anna'] } });c.send({ t: 'learn', on: false, pend: null });sendScreen(c);+ if (c.screen === 'Scenes') c.send(clips(true));}function onMessage(c, m) {@@ -180,7 +231,7 @@ function onMessage(c, m) {switch (m.t) {case 'pair': case 'hello': welcome(c, m); break;case 'ping': c.send({ t: 'pong', c: m.c }); break;- case 'sub': c.screen = m.s; sendScreen(c); break;+ case 'sub': c.screen = m.s; sendScreen(c); if (m.s === 'Scenes') c.send(clips(true)); break;case 'track': state.you = m.id; broadcast(proj()); break;case 'follow': state.follow = m.on; broadcast(proj()); break;case 'play': tp.play = true; broadcast({ t: 'tp', ...tp }); break;@@ -208,6 +259,7 @@ setInterval(() => {broadcast({ t: 'tp', ...state.tp });}for (const c of clients) if (c.paired && (c.screen === 'Mixer' || c.screen === 'Scenes')) sendScreen(c);+ for (const c of clients) if (c.paired && c.screen === 'Scenes') c.send(clips(false));}, 250);// ---- HTTP -----------------------------------------------------------------------------diff --git a/src/web/remote/mock/round-double.json b/src/web/remote/mock/round-double.jsonnew file mode 100644index 00000000..ba40cd2d--- /dev/null+++ b/src/web/remote/mock/round-double.json@@ -0,0 +1,9 @@+{+ "formatVersion": 2,+ "id": "round-double",+ "name": "Round Double",+ "kind": "light",+ "base": "studio-light",+ "radius": { "scale": 2, "steps": { "card": 24 } },+ "colors": {}+}diff --git a/src/web/remote/mock/square-avenir.json b/src/web/remote/mock/square-avenir.jsonnew file mode 100644index 00000000..011491fb--- /dev/null+++ b/src/web/remote/mock/square-avenir.json@@ -0,0 +1,10 @@+{+ "formatVersion": 2,+ "id": "square-avenir",+ "name": "Square Avenir",+ "kind": "dark",+ "base": "studio-dark",+ "font": { "family": "Avenir Next" },+ "radius": { "scale": 0 },+ "colors": {}+}diff --git a/src/web/remote/public/fonts/GeistMono-Medium.woff2 b/src/web/remote/public/fonts/GeistMono-Medium.woff2deleted file mode 100644index 6b9e1228..00000000Binary files a/src/web/remote/public/fonts/GeistMono-Medium.woff2 and /dev/null differdiff --git a/src/web/remote/src/App.svelte b/src/web/remote/src/App.svelteindex 91281108..2c2d1cbe 100644--- a/src/web/remote/src/App.svelte+++ b/src/web/remote/src/App.svelte@@ -83,17 +83,19 @@/* The link is down: touches are not sent, so the surface steps back until it returns. */main.dim { opacity: .35; pointer-events: none; }- /* Rail (landscape, tablet): a docked panel on a seam; the chosen screen is a row with an accent tick. */+ /* Rail (landscape, tablet): a docked panel on a seam; the chosen screen is picked — the soft+ tint, orange text and a 2 × 14 orange tick, as the desktop's left rail. */.rail { width: 104px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: var(--panel); border-right: 1px solid var(--seam); }.tablet .rail { padding: 12px 8px; }- .rail button { height: 44px; border-radius: 2px; font-size: 12px; font-weight: 500; color: var(--text-muted); position: relative; transition: background-color var(--ease), color var(--ease); }+ .rail button { height: 44px; border-radius: min(var(--r-field), 14px); font-size: 12px; font-weight: 500; color: var(--text-muted); position: relative; transition: background-color var(--ease), color var(--ease); }.tablet .rail button { height: 56px; font-size: 13px; }- .rail button.on { background: var(--surface-hover); color: var(--text-primary); }- .rail button.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }+ .rail button.on { background: var(--accent-soft); color: var(--picked-ink); }+ .rail button.on::before { content: ''; position: absolute; left: -6px; top: 50%; height: 14px; margin-top: -7px; width: 2px; border-radius: 0 var(--r-fine) var(--r-fine) 0; background: var(--accent); }+ .tablet .rail button.on::before { left: -8px; }- /* Tabs (portrait): a docked bar; the chosen screen is primary ink with an accent line on the edge facing it. */- .tabs { flex: none; display: flex; padding: 0 6px max(8px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--seam); }- .tabs button { flex: 1; min-width: 0; height: 48px; font-size: 12px; font-weight: 500; color: var(--text-muted); position: relative; transition: color var(--ease); }- .tabs button.on { color: var(--text-primary); }- .tabs button.on::before { content: ''; position: absolute; left: 8px; right: 8px; top: -1px; height: 2px; background: var(--accent); }+ /* Tabs (portrait): a docked bar; the chosen screen is picked — the soft tint and orange text,+ with an orange line on the edge facing the screen. */+ .tabs { flex: none; display: flex; padding: 4px 6px max(8px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--seam); }+ .tabs button { flex: 1; min-width: 0; height: 48px; border-radius: min(var(--r-field), 14px); font-size: 12px; font-weight: 500; color: var(--text-muted); position: relative; transition: background-color var(--ease), color var(--ease); }+ .tabs button.on { background: var(--accent-soft); color: var(--picked-ink); }</style>diff --git a/src/web/remote/src/app.css b/src/web/remote/src/app.cssindex 4981ff55..5e84985c 100644--- a/src/web/remote/src/app.css+++ b/src/web/remote/src/app.css@@ -1,16 +1,29 @@/* SPDX-License-Identifier: AGPL-3.0-only */-/* Nota Remote in Studio (DESIGN.md, spec 014). No colour value lives here: every colour is a- theme token as a custom property (BgApp → --bg-app), set from the theme Nota sends- (lib/theme.svelte.ts) over the fallback built from the theme files (theme-plugin.ts).- Structure follows the desktop: one accent for what is live or chosen, values neutral at- rest, panels on 1 px seams, radii 2 / 3 / 4, sentence case, Geist and Geist Mono. Sizes+/* Nota Remote in the style guide's look (DESIGN.md, spec 038; specs/090). No colour value+ lives here: every colour is a theme token as a custom property (BgApp → --bg-app), set+ from the theme Nota sends (lib/theme.svelte.ts) over the fallback built from the theme+ files (theme-plugin.ts). The corner scale and the typeface are custom properties too, so a+ skin (spec 087) re-rounds and re-sets the whole page in one pass. A small part caps its+ corner at about a third of its short side (min(var(--r-…), Npx)), so a 2× skin rounds it+ without turning it into a pill. Orange comes in three+ strengths: solid for what is live, a soft tint with orange text for what is picked, and+ values carry the track's colour. One typeface with tabular figures; sentence case. Sizesstay phone-sized — touch targets 36–56 px. */@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url('/fonts/Geist-Regular.woff2') format('woff2'); }@font-face { font-family: 'Geist'; font-weight: 500 700; font-display: swap; src: url('/fonts/Geist-SemiBold.woff2') format('woff2'); }-@font-face { font-family: 'Geist Mono'; font-weight: 400 700; font-display: swap; src: url('/fonts/GeistMono-Medium.woff2') format('woff2'); }:root {+ /* The corner scale (DESIGN.md § Corner scale); a skin's `r` overrides it. Docked = 0. */+ --r-card: 9px;+ --r-group: 7px;+ --r-field: 6px;+ --r-cell: 5px;+ --r-value-bar: 4px;+ --r-switch: 3px;+ --r-fine: 2px;+ /* The shell typeface; a skin's `font` goes first, Geist stays the fallback. */+ --font-ui: Geist, system-ui, -apple-system, sans-serif;/* Elevation, built from the theme's colours as on the desktop (NotaThemeService). */--bevel: inset 0 1px 0 0 var(--shadow-bevel);--sunken: inset 0 0 0 1px var(--rule);@@ -18,11 +31,14 @@--scrim: var(--shadow-modal);--ease: 120ms ease-out;}+/* A picked option's text: the bright orange in dark themes, the pale (deep) one in light. */+:root, [data-theme='dark'] { --picked-ink: var(--accent-bright); }+[data-theme='light'] { --picked-ink: var(--accent-pale); }* { box-sizing: border-box; margin: 0; padding: 0; }html, body {height: 100%; overflow: hidden; background: var(--bg-app); color: var(--text-primary);- font-family: Geist, system-ui, -apple-system, sans-serif; font-size: 13px;+ font-family: var(--font-ui); font-size: 13px; font-variant-numeric: tabular-nums;-webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;overscroll-behavior: none; touch-action: none;@@ -32,37 +48,41 @@ body { position: fixed; inset: 0; }button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; touch-action: manipulation; }input { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; touch-action: manipulation; }svg path { stroke-linecap: round; stroke-linejoin: round; }-.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }-/* A section label: sentence case, never tracked (DESIGN.md § Labels). */-.label { font-size: 11px; font-weight: 600; color: var(--text-muted); }+/* A section label: sentence case, never tracked; the muted ink a phone at arm's length needs. */+.label { font-size: 11px; font-weight: 400; color: var(--text-muted); }.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }-/* A raised key: seam border, top bevel. On = solid accent with derived ink; pressed sinks into the well. */+/* The two orange strengths a control wears (the third — values — is the track colour). */+.live { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); box-shadow: none; }+.picked { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--picked-ink); box-shadow: none; }++/* A raised key: seam border, top bevel. On = picked (soft tint, orange text), never solid;+ pressed sinks into the well. */.btn {height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;- border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel);+ border-radius: min(var(--r-group), 14px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel);color: var(--text-strong); font-size: 12px; font-weight: 500;transition: background-color var(--ease), border-color var(--ease), color var(--ease);}.btn:active { background: var(--bg-sunken); box-shadow: none; }-.btn.on { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); box-shadow: none; }+.btn.on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--picked-ink); box-shadow: none; }@media (hover: hover) { .btn:not(.on):hover { background: var(--surface-hover); } }-/* A segmented group: keys butted on 1 px seams, only the group's outer corners round. */-.seg { display: flex; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: 3px; overflow: hidden; }+/* A segment group: cells in a 2 px well, the chosen one picked. */+.seg { display: flex; gap: 2px; padding: 2px; background: var(--bg-sunken); box-shadow: var(--sunken); border-radius: min(var(--r-group), 14px); }.seg > button {- height: 36px; padding: 0 11px; flex: 1; background: var(--surface-raised); box-shadow: var(--bevel);+ height: 36px; padding: 0 11px; flex: 1; border-radius: min(var(--r-cell), 12px);color: var(--text-secondary); font-size: 12px; font-weight: 500;transition: background-color var(--ease), color var(--ease);}-.seg > button:active { background: var(--bg-sunken); box-shadow: none; }-.seg > button.on { background: var(--accent); color: var(--ink-on-accent); box-shadow: none; }+.seg > button:active { background: var(--surface-hover); }+.seg > button.on { background: var(--accent-soft); color: var(--picked-ink); }-/* The Settings-size switch: 28 × 16, squared knob 12, inset 2. */-.switch { width: 28px; height: 16px; border-radius: 2px; background: var(--bg-sunken); box-shadow: var(--sunken); position: relative; flex: none; display: block; transition: background-color var(--ease); }-.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 1px; background: var(--text-tertiary); transition: left var(--ease), background-color var(--ease); }+/* The Settings switch, phone-sized: 32 × 18, knob 14, inset 2. On = solid accent (a switch is live). */+.switch { width: 32px; height: 18px; border-radius: min(var(--r-switch), 6px); background: var(--bg-sunken); box-shadow: var(--sunken); position: relative; flex: none; display: block; transition: background-color var(--ease); }+.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: min(var(--r-fine), 5px); background: var(--text-tertiary); transition: left var(--ease), background-color var(--ease); }.switch.on { background: var(--accent); box-shadow: none; }-.switch.on::after { left: 14px; background: var(--panel); }+.switch.on::after { left: 16px; background: var(--ink-on-accent); }/* A control Nota's MIDI Learn can map, while Learn is on. */.learnable { outline: 1px dashed var(--accent); outline-offset: 2px; }diff --git a/src/web/remote/src/components/Banner.svelte b/src/web/remote/src/components/Banner.svelteindex 148e3bdb..16cfe954 100644--- a/src/web/remote/src/components/Banner.svelte+++ b/src/web/remote/src/components/Banner.svelte@@ -31,7 +31,7 @@{/if}<style>- /* A docked strip under the header. MIDI Learn listening is live, so its dot is the accent. */+ /* A docked strip under the header (square). MIDI Learn listening is live, so its dot is the accent. */.banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--panel); border-bottom: 1px solid var(--seam); }.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }.quiet .dot { background: var(--text-tertiary); }@@ -39,4 +39,6 @@@keyframes blink { 50% { opacity: .35; } }.t { font-size: 12px; font-weight: 600; color: var(--text-primary); }.s { font-size: 11px; color: var(--text-secondary); }+ .learn { background: var(--accent-soft); }+ .learn .t { color: var(--picked-ink); }</style>diff --git a/src/web/remote/src/components/ClipPreview.svelte b/src/web/remote/src/components/ClipPreview.sveltenew file mode 100644index 00000000..423826cd--- /dev/null+++ b/src/web/remote/src/components/ClipPreview.svelte@@ -0,0 +1,68 @@+<!-- SPDX-License-Identifier: AGPL-3.0-only -->+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->+<!-- What is in a Session clip, drawn as the desktop slot draws it (issue 557, SessionView.Grid.cs):+ a MIDI clip's notes as 3 px bars over the clip's own pitch range, an audio clip's waveform+ as centred bars scaled to its loudest part. One canvas per cell, redrawn only when the+ preview, the ink, the size or the theme changes. The ink is any CSS colour (a custom+ property included): the canvas reads it back as its own computed colour. -->+<script lang="ts">+ import type { ClipPreview } from '../lib/types';+ import { look } from '../lib/theme.svelte';++ let { preview, ink }: { preview: ClipPreview | undefined; ink: string } = $props();+ let canvas: HTMLCanvasElement | undefined = $state();+ let w = $state(0), h = $state(0);++ $effect(() => {+ const c = canvas;+ if (!c) return;+ const ro = new ResizeObserver(([e]) => { w = e.contentRect.width; h = e.contentRect.height; });+ ro.observe(c);+ return () => ro.disconnect();+ });++ $effect(() => {+ const c = canvas, p = preview;+ void look.applied; void ink; // a theme put on the page (colours, skin corners) redraws+ if (!c || w <= 0 || h <= 0) return;+ const dpr = window.devicePixelRatio || 1;+ c.width = Math.round(w * dpr); c.height = Math.round(h * dpr);+ const g = c.getContext('2d');+ if (!g) return;+ g.setTransform(dpr, 0, 0, dpr, 0, 0);+ g.clearRect(0, 0, w, h);+ if (!p) return;+ g.fillStyle = getComputedStyle(c).color;+ const radius = parseFloat(getComputedStyle(c).getPropertyValue('--r-fine')) / 2 || 0;+ const bar = (x: number, y: number, bw: number, bh: number) => {+ g.beginPath();+ if (radius > 0 && 'roundRect' in g) g.roundRect(x, y, bw, bh, Math.min(radius, bw / 2, bh / 2));+ else g.rect(x, y, bw, bh);+ g.fill();+ };+ if (p.k === 'n' && p.n?.length) {+ let lo = 127, hi = 0;+ for (const [, , pitch] of p.n) { lo = Math.min(lo, pitch); hi = Math.max(hi, pitch); }+ const range = Math.max(1, hi - lo), nh = Math.min(3, h);+ for (const [start, len, pitch] of p.n) {+ if (start >= 64) continue;+ const x = (start / 64) * w;+ const bw = Math.max(1.5, (Math.min(len, 64 - start) / 64) * w);+ const y = ((hi - pitch) / range) * (h - nh);+ bar(x, y, bw, nh);+ }+ } else if (p.k === 'p' && p.p?.length) {+ const n = p.p.length, step = w / n, bw = Math.max(1, step * 0.62);+ for (let i = 0; i < n; i++) {+ const bh = Math.max(1, (p.p[i] / 99) * h);+ bar(i * step, (h - bh) / 2, bw, bh);+ }+ }+ });+</script>++<canvas bind:this={canvas} style:color={ink} aria-hidden="true"></canvas>++<style>+ canvas { display: block; width: 100%; height: 100%; }+</style>diff --git a/src/web/remote/src/components/Header.svelte b/src/web/remote/src/components/Header.svelteindex 5740be39..06edf687 100644--- a/src/web/remote/src/components/Header.svelte+++ b/src/web/remote/src/components/Header.svelte@@ -5,6 +5,7 @@<script lang="ts">import { app } from '../lib/app.svelte';import { device, toggleFullscreen, type Form } from '../lib/device.svelte';+ import { bpm, unit } from '../lib/fmt';let { form }: { form: Form } = $props();@@ -31,8 +32,8 @@const link = $derived.by(() => {const usb = app.via === 'usb' ? 'USB · ' : '';switch (app.link) {- case 'ok': return { dot: 'var(--success)', ink: 'var(--text-muted)', label: app.rtt >= 0 ? `${usb}${app.rtt}\u2009ms` : 'Connected' };- case 'weak': return { dot: 'var(--warning)', ink: 'var(--warning)', label: `Weak · ${app.rtt}\u2009ms` };+ case 'ok': return { dot: 'var(--success)', ink: 'var(--text-muted)', label: app.rtt >= 0 ? usb + unit(app.rtt, 'ms') : 'Connected' };+ case 'weak': return { dot: 'var(--warning)', ink: 'var(--warning)', label: `Weak · ${unit(app.rtt, 'ms')}` };case 'lost': case 'connecting': return { dot: 'var(--text-tertiary)', ink: 'var(--text-secondary)', label: app.link === 'lost' ? 'Reconnecting' : 'Connecting', blink: true };case 'down': return { dot: 'var(--danger)', ink: 'var(--danger-bright)', label: 'No connection', blink: true };default: return { dot: 'var(--danger)', ink: 'var(--danger-bright)', label: 'Not paired' };@@ -84,11 +85,11 @@<div class="transport"><button class="tbtn" aria-label="Stop" onclick={stop}><span class="sq"></span></button>- <button class="tbtn play" class:on={app.tp.play} aria-label={app.tp.play ? 'Stop playback' : 'Play'} aria-pressed={app.tp.play} onclick={play}><span class="tri"></span></button>+ <button class="tbtn play" class:live={app.tp.play} aria-label={app.tp.play ? 'Stop playback' : 'Play'} aria-pressed={app.tp.play} onclick={play}><span class="tri"></span></button><button class="tbtn rec" class:on={app.tp.rec} class:count={app.countIn !== null} aria-label="Record" aria-pressed={app.tp.rec} onclick={rec}><span class="dot"></span></button><button class="pos" class:open={app.bigTransport} aria-label="Big transport" onclick={() => (app.bigTransport = !app.bigTransport)}>- <span class="mono p">{pos}</span>- <span class="mono bpm">{app.tp.bpm.toFixed(2)}</span>+ <span class="p">{pos}</span>+ <span class="bpm">{bpm(app.tp.bpm)}</span><svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" /></svg></button>{#if !device.standalone}@@ -105,7 +106,7 @@<div class="status"><button class="link" onclick={linkTip} aria-label="Connection: {link.label}"><span class="ldot" class:blink={link.blink} style:background={link.dot}></span>- <span class="mono" style:color={link.ink}>{link.label}</span>+ <span class="lt" style:color={link.ink}>{link.label}</span></button><button class="menu" class:open={app.sheet === 'menu'} aria-label="Menu" onclick={() => (app.sheet = 'menu')}><span></span><span></span><span></span>@@ -114,17 +115,17 @@</header><style>- /* A docked bar, like the desktop's transport row: panel, a seam below. */+ /* A docked bar, like the desktop's transport row: panel, a seam below, square. */header { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 6px 10px 10px; border-bottom: 1px solid var(--seam); background: var(--panel); position: relative; z-index: 6; }header.phoneLand { flex-wrap: nowrap; padding: 6px 10px; }header.tablet { flex-wrap: nowrap; padding: 10px 16px; }svg path { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }.picker { order: 1; flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }- .step { width: 36px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 3px; }+ .step { width: 36px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: min(var(--r-group), 14px); }.step:active { background: var(--bg-sunken); }- .track { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); border-radius: 3px; text-align: left; }- .bar { width: 3px; height: 24px; border-radius: 1px; flex: none; }+ .track { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); border-radius: min(var(--r-group), 14px); text-align: left; }+ .bar { width: 3px; height: 24px; border-radius: min(var(--r-fine), 1px); flex: none; }.names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }.name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.sub { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }@@ -132,33 +133,36 @@.transport { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: 6px; }.phoneLand .transport { order: 2; flex: 0 0 330px; }.tablet .transport { order: 2; flex: 0 0 460px; }- /* Transport keys: raised; Play on is solid accent, Record on solid record — each with derived ink. */- .tbtn { width: 44px; height: 40px; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-strong); transition: background-color var(--ease), border-color var(--ease), color var(--ease); }+ /* Transport keys: raised; Play while running is live (solid accent), Record solid record — ink derived. */+ .tbtn { width: 44px; height: 40px; border-radius: min(var(--r-group), 13px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-strong); transition: background-color var(--ease), border-color var(--ease), color var(--ease); }.tbtn:active { background: var(--bg-sunken); box-shadow: none; }.tbtn.play { width: 54px; }+ .tbtn.live { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); box-shadow: none; }.fs svg path { stroke: var(--text-secondary); }- .sq { width: 11px; height: 11px; border-radius: 1px; background: currentColor; }+ .sq { width: 11px; height: 11px; border-radius: calc(var(--r-fine) / 2); background: currentColor; }.tri { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }- .play.on { background: var(--accent); border-color: var(--accent); box-shadow: none; color: var(--ink-on-accent); }.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--record); }.rec.on, .rec.count { background: var(--record); border-color: var(--record); box-shadow: none; }- .rec.on .dot, .rec.count .dot { background: var(--record-ink); }- /* The position readout: a well with a rule edge; open (the big transport shows) = the edge turns accent. */- .pos { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 3px; background: var(--bg-sunken); box-shadow: var(--sunken); }- .pos.open { box-shadow: inset 0 0 0 1px var(--accent); }+ .rec.on .dot, .rec.count .dot { background: var(--ink-on-record); }+ /* The position readout: a well; open (the big transport shows) = picked, the soft tint. */+ .pos { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: min(var(--r-field), 13px); background: var(--bg-sunken); box-shadow: var(--sunken); }+ .pos.open { background: var(--accent-soft); box-shadow: none; }+ .pos.open .p, .pos.open .bpm { color: var(--picked-ink); }+ .pos.open path { stroke: var(--picked-ink); }.pos.open svg { transform: rotate(180deg); }.pos svg { margin-left: auto; }- .p { font-size: 16px; color: var(--text-primary); }+ .p { font-size: 16px; font-weight: 500; color: var(--text-primary); }.bpm { font-size: 11px; color: var(--text-muted); }.status { order: 2; display: flex; align-items: center; gap: 4px; }.phoneLand .status, .tablet .status { order: 3; }- .link { height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 3px; }- .link .mono { font-size: 11px; white-space: nowrap; }+ .link { height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: min(var(--r-group), 14px); }+ .lt { font-size: 11px; white-space: nowrap; }.ldot { width: 7px; height: 7px; border-radius: 50%; }.blink { animation: blink 800ms steps(1) infinite; }@keyframes blink { 50% { opacity: .35; } }- .menu { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 3px; }- .menu.open { background: var(--surface-hover); }+ .menu { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: min(var(--r-group), 14px); }+ .menu.open { background: var(--accent-soft); }+ .menu.open span { background: var(--picked-ink); }.menu span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-secondary); }</style>diff --git a/src/web/remote/src/components/Overlays.svelte b/src/web/remote/src/components/Overlays.svelteindex d5624c30..a163e5a5 100644--- a/src/web/remote/src/components/Overlays.svelte+++ b/src/web/remote/src/components/Overlays.svelte@@ -28,9 +28,9 @@<div class="cover" role="alert"><h1>Nota isn’t responding</h1><ol>- <li><span class="mono">1</span>Nota is open on {app.host}</li>- <li><span class="mono">2</span>Remote is on: the Remote button in Nota’s top bar is lit</li>- <li><span class="mono">3</span>The phone is on the same Wi-Fi. Guest networks often keep devices apart; share the phone’s hotspot with the computer instead.</li>+ <li><span class="n">1</span>Nota is open on {app.host}</li>+ <li><span class="n">2</span>Remote is on: the Remote button in Nota’s top bar is lit</li>+ <li><span class="n">3</span>The phone is on the same Wi-Fi. Guest networks often keep devices apart; share the phone’s hotspot with the computer instead.</li></ol><div class="retry"><span class="dot blink"></span>Retrying every few seconds</div></div>@@ -43,7 +43,7 @@oninput={() => (digits = digits.replace(/\D/g, '').slice(0, 4))} />{#each [0, 1, 2, 3] as i}<span class="cell" class:cur={digits.length === i}>- {#if digits[i]}<span class="mono">{digits[i]}</span>{:else if digits.length === i}<span class="caret"></span>{/if}+ {#if digits[i]}<span class="d">{digits[i]}</span>{:else if digits.length === i}<span class="caret"></span>{/if}</span>{/each}</label>@@ -58,7 +58,7 @@{#if app.countIn !== null}<button class="count" onclick={() => app.record()} aria-label="Cancel count-in">- <span class="mono num {form}">{app.countIn}</span>+ <span class="num {form}">{app.countIn}</span><span class="rec">Count-in · recording starts on 1</span></button>{/if}@@ -68,33 +68,35 @@{/if}<style>+ /* A cover is docked over the whole page (square); what sits on it uses the corner scale. */.cover { position: absolute; inset: 0; z-index: 40; background: var(--bg-app); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 28px; padding-top: calc(env(safe-area-inset-top) + 28px); }h1 { font-size: 22px; font-weight: 600; color: var(--text-heading); }p { font-size: 13px; line-height: 1.6; color: var(--text-secondary); max-width: 420px; }- /* The checklist: panel rows on rules, one frame. */- ol { list-style: none; border-radius: 3px; overflow: hidden; max-width: 420px; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }+ /* The checklist: panel rows on rules, one card. */+ ol { list-style: none; border-radius: var(--r-card); overflow: hidden; max-width: 420px; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }li { padding: 12px 14px; display: flex; gap: 12px; font-size: 12px; line-height: 1.5; color: var(--text-strong); }li + li { border-top: 1px solid var(--rule); }- li .mono { font-size: 11px; color: var(--text-muted); }+ li .n { font-size: 11px; color: var(--text-muted); }.retry { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); }.blink { animation: blink 800ms steps(1) infinite; }@keyframes blink { 50% { opacity: .35; } }- /* Code cells: wells with a rule edge; the one being typed into has an accent edge and caret. */+ /* Code cells: fields in the well; the one being typed into has the 1 px orange focus edge and caret. */.code { position: relative; display: grid; grid-template-columns: repeat(4, 64px); gap: 10px; }.code input { position: absolute; inset: 0; opacity: 0; font-size: 16px; }- .cell { height: 68px; border-radius: 3px; background: var(--bg-sunken); box-shadow: var(--sunken); display: flex; align-items: center; justify-content: center; pointer-events: none; }+ .cell { height: 68px; border-radius: var(--r-field); background: var(--bg-sunken); box-shadow: var(--sunken); display: flex; align-items: center; justify-content: center; pointer-events: none; }.cell.cur { box-shadow: inset 0 0 0 1px var(--accent); }- .cell .mono { font-size: 28px; color: var(--text-heading); }- .caret { width: 2px; height: 28px; background: var(--accent); animation: blink 1s steps(1) infinite; }+ .cell .d { font-size: 28px; font-weight: 500; color: var(--text-heading); }+ .caret { width: 2px; height: 28px; border-radius: min(var(--r-fine), 1px); background: var(--accent); animation: blink 1s steps(1) infinite; }/* The cover's one action is set apart by weight and a tone step, not by colour. */.big { height: 48px; align-self: flex-start; padding: 0 20px; font-size: 13px; }.primary { font-weight: 600; background: var(--surface-hover); color: var(--text-primary); }+ /* The count-in is live: the number in solid orange on the ground. */.count { position: absolute; inset: 0; z-index: 35; background: var(--bg-app); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }- .num { font-size: 200px; font-weight: 500; line-height: 1; color: var(--accent-bright); }+ .num { font-size: 200px; font-weight: 500; line-height: 1; color: var(--accent); }.num.phoneLand { font-size: 150px; }.num.tablet { font-size: 260px; }.rec { color: var(--record); font-size: 13px; font-weight: 600; }- .toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 86%; padding: 10px 14px; border-radius: 3px; background: var(--surface-raised); box-shadow: var(--popover); font-size: 12px; line-height: 1.45; color: var(--text-primary); text-align: center; }+ .toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 86%; padding: 10px 14px; border-radius: min(var(--r-group), 12px); background: var(--surface-raised); box-shadow: var(--popover); font-size: 12px; line-height: 1.45; color: var(--text-primary); text-align: center; }.toast.low { bottom: calc(env(safe-area-inset-bottom) + 84px); }</style>diff --git a/src/web/remote/src/components/Sheets.svelte b/src/web/remote/src/components/Sheets.svelteindex 6b71e306..32a512e4 100644--- a/src/web/remote/src/components/Sheets.svelte+++ b/src/web/remote/src/components/Sheets.svelte@@ -106,34 +106,36 @@<style>.scrim { position: absolute; inset: 0; z-index: 20; background: var(--scrim); }- /* A floating sheet drawn in the page: raised, a seam ring and the popover drop. */- .sheet { position: absolute; z-index: 21; left: 12px; top: calc(env(safe-area-inset-top) + 64px); width: 360px; max-width: calc(100% - 24px); max-height: calc(100% - 88px); background: var(--panel); border-radius: 3px; box-shadow: var(--popover); display: flex; flex-direction: column; overflow: hidden; }+ /* A floating sheet drawn in the page: a menu-sized card with the popover ring and drop. */+ .sheet { position: absolute; z-index: 21; left: 12px; top: calc(env(safe-area-inset-top) + 64px); width: 360px; max-width: calc(100% - 24px); max-height: calc(100% - 88px); background: var(--panel); border-radius: min(var(--r-group), 12px); box-shadow: var(--popover); display: flex; flex-direction: column; overflow: hidden; }.sheet.bottom { top: auto; right: 12px; width: auto; bottom: max(24px, env(safe-area-inset-bottom)); max-height: 75%; }.sheet.menu { left: auto; right: 12px; width: 300px; }.head { padding: 14px 16px 8px; }.list { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }- /* Rows divide on rules; the chosen one is raised hover with an accent tick. */+ /* Rows on rules, full width; the chosen one is picked: the soft tint, orange name and a 2 × 14 orange tick. */.row { width: 100%; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--rule); position: relative; text-align: left; transition: background-color var(--ease); }- .row.slim { border: none; padding: 0 10px; height: 44px; border-radius: 2px; }+ .row.slim { height: 44px; border: none; padding: 0 10px; border-radius: min(var(--r-field), 14px); }.row:active { background: var(--bg-sunken); }- .row.on { background: var(--surface-hover); }- .row.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }- .bar { width: 3px; height: 22px; border-radius: 1px; flex: none; }+ .row.on { background: var(--accent-soft); }+ .row.on .n { color: var(--picked-ink); }+ .row.on .d { color: var(--text-secondary); }+ .row.on::before { content: ''; position: absolute; left: 0; top: 50%; height: 14px; margin-top: -7px; width: 2px; border-radius: 0 var(--r-fine) var(--r-fine) 0; background: var(--accent); }+ .bar { width: 3px; height: 22px; border-radius: min(var(--r-fine), 1px); flex: none; }.names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }.n { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.d { font-size: 11px; color: var(--text-tertiary); }- .who { height: 20px; display: flex; align-items: center; padding: 0 6px; border-radius: 2px; background: var(--bg-sunken); font-size: 10px; font-weight: 600; color: var(--text-secondary); }+ .who { height: 20px; display: flex; align-items: center; padding: 0 7px; border-radius: min(var(--r-cell), 6px); background: var(--bg-sunken); font-size: 10px; font-weight: 500; color: var(--text-secondary); }.empty { padding: 16px; font-size: 12px; color: var(--text-tertiary); }.toggle { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--rule); text-align: left; }.n2 { display: block; font-size: 12px; color: var(--text-primary); }.d2 { display: block; font-size: 11px; color: var(--text-tertiary); }.block { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }.block + .block { border-top: 1px solid var(--rule); }- /* A field: the well with a rule edge; focus turns the edge accent. */- .field { height: 40px; padding: 0 12px; background: var(--bg-sunken); border: none; box-shadow: var(--sunken); border-radius: 3px; font-size: 13px; outline: none; }+ /* A field: the well; keyboard focus gets a 1 px orange outline. */+ .field { height: 40px; padding: 0 12px; background: var(--bg-sunken); border: none; box-shadow: var(--sunken); border-radius: min(var(--r-field), 13px); font-size: 13px; outline: none; }.field:focus { box-shadow: inset 0 0 0 1px var(--accent); }.tonics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }- .tonics .btn { padding: 0; height: 44px; }+ .tonics .btn { padding: 0; height: 44px; border-radius: min(var(--r-cell), 14px); }.disconnect { height: 52px; padding: 0 16px; border-top: 1px solid var(--rule); font-size: 13px; font-weight: 500; color: var(--text-primary); text-align: left; }.disconnect:active { background: var(--bg-sunken); }</style>diff --git a/src/web/remote/src/lib/app.svelte.ts b/src/web/remote/src/lib/app.svelte.tsindex e4132e6c..e8c6e93f 100644--- a/src/web/remote/src/lib/app.svelte.ts+++ b/src/web/remote/src/lib/app.svelte.ts@@ -4,7 +4,7 @@// the link indicator, and Nota releases a silent phone's notes. On a drop it retries on its// own — the only state that needs the person is a forgotten device or an expired code.-import type { Project, Transport, Mixer, Xy, Macros, Session, Learn, LinkState, Screen, Track } from './types';+import type { Project, Transport, Mixer, Xy, Macros, Session, ClipPreview, ClipsMessage, Learn, LinkState, Screen, Track } from './types';import { look } from './theme.svelte';const LS = 'nota-remote:';@@ -53,6 +53,8 @@ export class App {xy = $state<Xy | null>(null);mac = $state<Macros | null>(null);ses = $state<Session | null>(null);+ /** Session slot previews by "track:scene" (issue 557), from `clips` messages. */+ clips = $state<Record<string, ClipPreview>>({});learn = $state<Learn>({ on: false, pend: null });learned = $state<string | null>(null);@@ -268,6 +270,15 @@ export class App {case 'xy': delete m.t; this.xy = m; break;case 'mac': delete m.t; this.mac = m; break;case 'ses': delete m.t; this.ses = m; break;+ case 'clips': {+ const next: Record<string, ClipPreview> = m.all ? {} : { ...this.clips };+ for (const c of (m as ClipsMessage).s) {+ if (c.k === 'x') delete next[`${c.id}:${c.i}`];+ else next[`${c.id}:${c.i}`] = c;+ }+ this.clips = next;+ break;+ }case 'learn':this.learn = { on: m.on, pend: m.pend };if (!m.on) this.learned = null;diff --git a/src/web/remote/src/lib/fmt.ts b/src/web/remote/src/lib/fmt.tsnew file mode 100644index 00000000..f733b7bc--- /dev/null+++ b/src/web/remote/src/lib/fmt.ts@@ -0,0 +1,37 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+// Numbers as the desktop prints them (DESIGN.md § Numbers, NotaNum): a true minus (U+2212),+// a thin space before the unit, fixed precision so a value's width never jumps (the page+// draws figures tabular). One place, so every screen writes −3.0 dB, 72 % and 122.00 alike.++export const MINUS = '\u2212';+export const THIN = '\u2009';++/** A number with a true minus sign. */+export const num = (v: number, digits = 0) => (v < 0 ? MINUS : '') + Math.abs(v).toFixed(digits);++/** Linear gain as dB, one decimal: "+1.5", "0.0", "−6.0", "−∞". A plus only where it matters. */+export function db(gain: number): string {+ if (gain < 1e-4) return MINUS + '∞';+ const d = 20 * Math.log10(gain);+ if (Math.abs(d) < 0.05) return '0.0';+ return (d > 0 ? '+' : MINUS) + Math.abs(d).toFixed(1);+}++/** 0..1 as a whole percent with its unit: "72 %". */+export const pct = (v: number) => `${Math.round(v * 100)}${THIN}%`;++/** Tempo, two decimals: "122.00". */+export const bpm = (v: number) => v.toFixed(2);++/** A value with its unit after a thin space: "12 ms". */+export const unit = (v: string | number, u: string) => `${v}${THIN}${u}`;++/** A length in beats as [number, unit]: whole bars where it divides, else beats. */+export function bars(beats: number): [number, string] {+ const b = beats / 4;+ return b === Math.round(b) ? [b, b === 1 ? 'bar' : 'bars'] : [Math.round(beats * 100) / 100, beats === 1 ? 'beat' : 'beats'];+}++/** A pan position: "C", "L20", "R50" (as Nota's mixer writes it). */+export const pan = (p: number) => (Math.abs(p) < 0.01 ? 'C' : (p < 0 ? 'L' : 'R') + Math.round(Math.abs(p) * 50));diff --git a/src/web/remote/src/lib/palette.ts b/src/web/remote/src/lib/palette.tsindex 38981e39..3cdddfbd 100644--- a/src/web/remote/src/lib/palette.ts+++ b/src/web/remote/src/lib/palette.ts@@ -4,6 +4,8 @@// Pure: the page uses it at run time and the build (theme-plugin.ts) for the first-paint// fallback, so both name and derive colours the same way.+import type { RadiusStep } from './types';+export type Colors = Record<string, string>;/** The dark and light ink text on a solid fill is chosen from, as Nota chooses them. */export type Ink = readonly [string, string];@@ -50,3 +52,23 @@ export function cssVars(colors: Colors, ink: Ink): Record<string, string> {for (const [name, token] of FILLS) if (colors[token]) out[name] = inkOn(colors[token], ink);return out;}++/** The style guide's corner scale (DESIGN.md § Corner scale), the radii a theme without `r` wears. */+export const DESIGN_RADII: Record<RadiusStep, number> = { card: 9, group: 7, field: 6, cell: 5, valueBar: 4, switch: 3, fine: 2 };++/** The default typeface stack: Geist, then the system's. */+export const UI_FONT = 'Geist, system-ui, -apple-system, sans-serif';++/** A skin's typeface and radii as custom properties (spec 087): --font-ui with the family+ * ahead of Geist, --r-card … --r-fine. A theme without them gets Geist and the design scale,+ * so switching back from a skin resets every corner. */+export function geometryVars(font: string | undefined, r: Partial<Record<RadiusStep, number>> | undefined): Record<string, string> {+ // The family name goes into CSS: keep it a plain quoted name.+ const family = font?.replace(/["'\\;{}<>]/g, '').trim();+ const out: Record<string, string> = { '--font-ui': family ? `"${family}", ${UI_FONT}` : UI_FONT };+ for (const [step, design] of Object.entries(DESIGN_RADII) as [RadiusStep, number][]) {+ const v = r?.[step];+ out['--r-' + step.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase())] = `${typeof v === 'number' && v >= 0 && v <= 24 ? v : design}px`;+ }+ return out;+}diff --git a/src/web/remote/src/lib/theme.svelte.ts b/src/web/remote/src/lib/theme.svelte.tsindex 45842d45..fd2a44ef 100644--- a/src/web/remote/src/lib/theme.svelte.ts+++ b/src/web/remote/src/lib/theme.svelte.ts@@ -1,14 +1,15 @@// SPDX-License-Identifier: AGPL-3.0-only// What the phone wears (spec 014). Nota sends the theme it wears and the user's dark-mode and-// light-mode picks with all their colours; Follow Nota wears the first, Follow phone one of+// light-mode picks with all their colours, and a skin's typeface and corner radii (spec 090); Follow Nota wears the first, Follow phone one of// the picks by the phone's own scheme. The colours go onto the root as custom properties// named after the tokens (palette.ts), so a theme change is one pass over ~110 properties and// nothing re-renders. The last one worn is stored for the head script in index.html, which// paints a returning phone in it before any of this loads; a new phone starts on the// built-in fallback (theme-plugin.ts).-import { cssVars, inkOn, type Colors, type Ink } from './palette';-import type { ThemeMessage } from './types';+import { untrack } from 'svelte';+import { cssVars, geometryVars, inkOn, type Colors, type Ink } from './palette';+import type { RadiusStep, ThemeMessage } from './types';const MSG = 'nota-remote:theme', VARS = 'nota-remote:vars';const scheme = matchMedia('(prefers-color-scheme: dark)');@@ -21,7 +22,7 @@ function stored(): ThemeMessage | null {}export type Pref = 'nota' | 'phone';-interface Worn { id: string; name: string; dark: boolean; c: Colors }+interface Worn { id: string; name: string; dark: boolean; c: Colors; font?: string; r?: Partial<Record<RadiusStep, number>> }class Look {/** The last theme Nota sent (or the stored one, until Nota answers). */@@ -30,6 +31,9 @@ class Look {phoneDark = $state(scheme.matches);/** An older Nota says only dark or light: the fallback's two sides. */legacyDark = $state<boolean | null>(null);+ /** Bumped each time a theme is put on the page, so a canvas that reads the custom+ * properties (a clip preview) knows to redraw. */+ applied = $state(0);constructor() {scheme.addEventListener('change', (e) => (this.phoneDark = e.matches));@@ -66,10 +70,12 @@ class Look {const dark = t ? t.dark : this.legacyDark !== false;root.dataset.theme = dark ? 'dark' : 'light';if (t && this.msg) {- const vars = cssVars(t.c, this.msg.ink);+ const vars = { ...cssVars(t.c, this.msg.ink), ...geometryVars(t.font, t.r) };for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);try { localStorage.setItem(VARS, JSON.stringify({ dark, v: vars })); } catch { /* private mode */ }}+ // Untracked: apply runs inside App's effect, which must not come to depend on this counter.+ untrack(() => this.applied++);const ground = getComputedStyle(root).getPropertyValue('--bg-app').trim();if (ground) document.querySelector('meta[name=theme-color]')?.setAttribute('content', ground);}diff --git a/src/web/remote/src/lib/types.ts b/src/web/remote/src/lib/types.tsindex 28daad21..ceeb95ee 100644--- a/src/web/remote/src/lib/types.ts+++ b/src/web/remote/src/lib/types.ts@@ -26,10 +26,23 @@ export interface ThemeMessage {light: string;/** The dark and light ink text on a solid fill is chosen from. */ink: [string, string];- /** Each theme named above, once: token → CSS colour. */- th: Record<string, { name: string; dark: boolean; c: Record<string, string> }>;+ /** Each theme named above, once: token → CSS colour, and a skin's typeface and corner+ * radii (spec 087; specs/090 contracts/theme-message.md) — absent means Geist and the design scale. */+ th: Record<string, ThemeEntry>;}+export interface ThemeEntry {+ name: string;+ dark: boolean;+ c: Record<string, string>;+ /** The skin's typeface family; the phone wears it when it has it, Geist otherwise. */+ font?: string;+ /** Every corner step in px as the desktop draws it under this skin. */+ r?: Partial<Record<RadiusStep, number>>;+}++export type RadiusStep = 'card' | 'group' | 'field' | 'cell' | 'valueBar' | 'switch' | 'fine';+export interface Project {host: string;/** Whether Nota's theme is dark — only read when Nota sends no theme (an older Nota). */@@ -118,3 +131,26 @@ export const SCREENS: Screen[] = ['Pads', 'Keys', 'XY', 'Mixer', 'Macros', 'Scen/** ok · weak (> 50 ms) · lost (was connected, retrying) · down (Nota unreachable) · expired (needs a code). */export type LinkState = 'connecting' | 'ok' | 'weak' | 'lost' | 'down' | 'expired' | 'left';++/** One Session slot's content as the desktop slot draws it (issue 557; specs/090+ * contracts/clips-message.md): notes in 1/64 of the clip's length, or 48 peaks 0–99. */+export interface ClipPreview {+ /** Track id and scene index. */+ id: number;+ i: number;+ /** 'n' notes, 'p' peaks, 'x' the slot is empty now. */+ k: 'n' | 'p' | 'x';+ nm?: string;+ col?: string;+ len?: number;+ n?: [number, number, number][];+ p?: number[];+ rec?: boolean;+}++export interface ClipsMessage {+ t: 'clips';+ /** The first batch of a full send: forget previews not in it. */+ all: boolean;+ s: ClipPreview[];+}diff --git a/src/web/remote/src/screens/BigTransport.svelte b/src/web/remote/src/screens/BigTransport.svelteindex d4fb230e..42919a9e 100644--- a/src/web/remote/src/screens/BigTransport.svelte+++ b/src/web/remote/src/screens/BigTransport.svelte@@ -4,6 +4,7 @@<script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';+ import { bpm } from '../lib/fmt';let { form }: { form: Form } = $props();let pos = $state('1.1.1');@@ -54,24 +55,24 @@clearTimeout(holdTimer);if (!held) ctl({ t: 'seek', v: sections[i][1] });}- const bpmText = $derived(app.tp.bpm.toFixed(2));+ const bpmText = $derived(bpm(app.tp.bpm));</script><div class="big {form}"><div class="top"><div class="pblock"><span class="label">Position</span>- <span class="mono pos" class:rec={app.tp.rec}>{pos}</span>+ <span class="pos" class:rec={app.tp.rec}>{pos}</span></div><button class="tap" onclick={tap}>- <span class="mono">{bpmText}</span>+ <span class="tv">{bpmText}</span><span class="tl">Tap tempo</span></button></div><div class="btns" style:grid-template-columns="repeat({form === 'phone' ? 3 : 6}, minmax(0, 1fr))">- <button class="b play" class:on={app.tp.play} aria-pressed={app.tp.play} onclick={() => ctl({ t: app.tp.play ? 'stop' : 'play' })}><span class="tri"></span>Play</button>+ <button class="b play" class:live={app.tp.play} aria-pressed={app.tp.play} onclick={() => ctl({ t: app.tp.play ? 'stop' : 'play' })}><span class="tri"></span>Play</button><button class="b" onclick={() => ctl({ t: 'stop' })}><span class="sq"></span>Stop</button>- <button class="b recb" class:on={app.tp.rec} aria-pressed={app.tp.rec} onclick={() => app.canControl ? app.record() : ctl({})}><span class="dot"></span>Record</button>+ <button class="b recb" class:live={app.tp.rec} aria-pressed={app.tp.rec} onclick={() => app.canControl ? app.record() : ctl({})}><span class="dot"></span>Record</button><button class="b" class:on={app.tp.loop} aria-pressed={app.tp.loop} onclick={() => ctl({ t: 'loop', on: !app.tp.loop })}><svg width="30" height="26" viewBox="0 0 30 26"><path d="M7 9 H21 A5 5 0 0 1 21 19 H9 M9 19 L12 16 M9 19 L12 22 M7 9 A5 5 0 0 0 5 14" /></svg>Loop</button>@@ -89,7 +90,7 @@{#each sections as s, i}<button class="sec" class:cur={current === i} class:looping={loopSec === i} onpointerdown={() => secDown(i)} onpointerup={() => secUp(i)} onpointercancel={() => clearTimeout(holdTimer)}><span class="sn">{s[0]}</span>- <span class="si">{#if loopSec === i}Looping{:else}Bar <span class="mono">{Math.floor(s[1] / 4) + 1}</span>{/if}</span>+ <span class="si">{#if loopSec === i}Looping{:else}Bar {Math.floor(s[1] / 4) + 1}{/if}</span></button>{/each}</div>@@ -103,33 +104,36 @@.tablet.big { padding: 18px; }.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }.pblock { display: flex; flex-direction: column; gap: 4px; }- .pos { font-size: 52px; line-height: 1; color: var(--text-primary); }+ .pos { font-size: 52px; font-weight: 500; line-height: 1; color: var(--text-primary); }.phoneLand .pos { font-size: 40px; }.tablet .pos { font-size: 88px; }.pos.rec { color: var(--record); }- .tap { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 16px; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); }+ .tap { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 16px; border-radius: min(var(--r-group), 16px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); }.tap:active { background: var(--bg-sunken); box-shadow: none; }- .tap .mono { font-size: 18px; color: var(--text-primary); }- .tl { font-size: 11px; font-weight: 500; color: var(--text-muted); }+ .tv { font-size: 18px; font-weight: 500; color: var(--text-primary); }+ .tl { font-size: 11px; color: var(--text-muted); }.btns { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }- /* Keys sized for a hand on a guitar neck. On: solid accent; Record on: solid record — derived ink. */- .b { min-height: 0; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-strong); transition: background-color var(--ease), color var(--ease); }+ /* Keys sized for a hand on a guitar neck, on cards. Play running is live (solid accent),+ Record solid record; Loop and Click on are picked — the soft tint with orange icon and text. */+ .b { min-height: 0; border-radius: var(--r-card); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-strong); transition: background-color var(--ease), color var(--ease); }.b:active { background: var(--bg-sunken); box-shadow: none; }.b svg path { fill: none; stroke: currentColor; stroke-width: 2; }- .b.on { background: var(--accent); border-color: var(--accent); box-shadow: none; color: var(--ink-on-accent); }+ .b.on { background: var(--accent-soft); border-color: var(--accent-soft); box-shadow: none; color: var(--picked-ink); }+ .b.live { background: var(--accent); border-color: var(--accent); box-shadow: none; color: var(--ink-on-accent); }.b.dim { color: var(--text-faint); }.tri { width: 0; height: 0; border-left: 26px solid currentColor; border-top: 16px solid transparent; border-bottom: 16px solid transparent; margin-left: 6px; }- .sq { width: 26px; height: 26px; border-radius: 2px; background: currentColor; }+ .sq { width: 26px; height: 26px; border-radius: var(--r-fine); background: currentColor; }.dot { width: 28px; height: 28px; border-radius: 50%; background: var(--record); }- .recb.on { background: var(--record); border-color: var(--record); color: var(--ink-on-record); }- .recb.on .dot { background: var(--ink-on-record); }+ .recb.live { background: var(--record); border-color: var(--record); color: var(--ink-on-record); }+ .recb.live .dot { background: var(--ink-on-record); }.secs { display: flex; flex-direction: column; gap: 6px; }.sgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }- /* Sections: the playhead's one carries the accent tick; a looping one is the solid accent. */- .sec { height: 52px; position: relative; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }- .sec.cur::before { content: ''; position: absolute; left: 6px; right: 6px; top: -1px; height: 2px; background: var(--accent); }+ /* Sections: the playhead's one is picked (soft tint, orange name); a looping one is live (solid). */+ .sec { height: 52px; position: relative; border-radius: min(var(--r-cell), 16px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }+ .sec.cur { background: var(--accent-soft); border-color: var(--accent-soft); box-shadow: none; }+ .sec.cur .sn { color: var(--picked-ink); }.sec.looping { background: var(--accent); border-color: var(--accent); box-shadow: none; }.sn { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%; }.si { font-size: 11px; color: var(--text-tertiary); }- .looping .sn, .looping .si { color: var(--ink-on-accent); }+ .sec.looping .sn, .sec.looping .si { color: var(--ink-on-accent); }</style>diff --git a/src/web/remote/src/screens/Empty.svelte b/src/web/remote/src/screens/Empty.svelteindex 78746bb4..2a950675 100644--- a/src/web/remote/src/screens/Empty.svelte+++ b/src/web/remote/src/screens/Empty.svelte@@ -10,7 +10,7 @@</div><style>- .empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; border-radius: 3px; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }+ .empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; border-radius: var(--r-card); background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }.t { font-size: 14px; font-weight: 600; color: var(--text-primary); }.s { font-size: 12px; line-height: 1.6; color: var(--text-tertiary); max-width: 280px; }.btn { height: 44px; padding: 0 18px; font-size: 13px; }diff --git a/src/web/remote/src/screens/Keys.svelte b/src/web/remote/src/screens/Keys.svelteindex d479370d..eb1da459 100644--- a/src/web/remote/src/screens/Keys.svelte+++ b/src/web/remote/src/screens/Keys.svelte@@ -181,7 +181,7 @@<button class="btn sq" aria-label="Octave down" onclick={() => (app.prefs.octave = Math.max(0, app.prefs.octave - 1))}><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10" /></svg></button>- <span class="octn">Oct <span class="mono">{app.prefs.octave}</span></span>+ <span class="octn">Oct <span class="ov">{app.prefs.octave}</span></span><button class="btn sq" aria-label="Octave up" onclick={() => (app.prefs.octave = Math.min(7, app.prefs.octave + 1))}><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10 M6 2 V10" /></svg></button>@@ -194,7 +194,7 @@<div class="kb">{#each whites as n (n)}<div class="white" class:on={held['n' + n]} data-t={'n' + n}>- {#if n % 12 === 0}<span class="mono lbl">{noteName(n)}</span>{/if}+ {#if n % 12 === 0}<span class="lbl">{noteName(n)}</span>{/if}{#if lit.has(n)}<span class="band"></span>{/if}</div>{/each}@@ -208,7 +208,7 @@<div class="grid" style:grid-template-columns="repeat({gridCols}, minmax(0, 1fr))">{#each cells as c, i (i)}<div class="cell" class:tonic={c.tonic} class:on={held['n' + c.note]} class:lit={lit.has(c.note)} data-t={'n' + c.note}>- <span class="mono">{NN[c.note % 12]}{c.tonic ? Math.floor(c.note / 12) - 1 : ''}</span>+ <span class="cl">{NN[c.note % 12]}{c.tonic ? Math.floor(c.note / 12) - 1 : ''}</span></div>{/each}</div>@@ -216,7 +216,7 @@<div class="grid chords" style:grid-template-columns="repeat({form === 'phone' ? 2 : 7}, minmax(0, 1fr))">{#each chordList as ch, i (i)}<div class="chord" class:on={held['c' + i]} class:lit={ch.notes.every((n) => lit.has(n))} data-t={'c' + i}>- <span class="mono roman">{ch.roman}</span>+ <span class="roman">{ch.roman}</span><span class="cn">{ch.name}</span></div>{/each}@@ -236,34 +236,35 @@.modes button { flex: none; }.keybtn { gap: 7px; padding: 0 10px; }.expr { padding: 0 10px; }- .k { font-size: 11px; font-weight: 500; color: var(--text-muted); }+ .k { font-size: 11px; color: var(--text-muted); }.kn { font-size: 12px; font-weight: 600; color: var(--text-primary); }.src { font-size: 11px; color: var(--text-tertiary); }.oct { display: flex; align-items: center; gap: 2px; margin-left: auto; }.octn { width: 52px; text-align: center; font-size: 12px; color: var(--text-secondary); }- .octn .mono { color: var(--text-primary); }+ .ov { font-weight: 500; color: var(--text-primary); }.sq { width: 42px; padding: 0; }.sq path { stroke: currentColor; stroke-width: 1.5; fill: none; }.surface { flex: 1; min-height: 0; display: flex; touch-action: none; }- /* The keyboard: keys butted on seams; the key under a finger is the accent, a key the track plays carries its colour. */- .kb { flex: 1; min-width: 0; position: relative; display: flex; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-top: none; border-radius: 0 0 3px 3px; overflow: hidden; }- .white { flex: 1; min-width: 0; border-radius: 0 0 2px 2px; background: var(--mini-key-white); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 12px; }+ /* The keyboard: keys butted on seams in a group frame; the key under a finger is live+ (solid accent), a key the track plays carries its colour. */+ .kb { flex: 1; min-width: 0; position: relative; display: flex; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-top: none; border-radius: 0 0 var(--r-group) var(--r-group); overflow: hidden; }+ .white { flex: 1; min-width: 0; border-radius: 0 0 var(--r-fine) var(--r-fine); background: var(--mini-key-white); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 12px; }.white.on { background: var(--accent); }.lbl { font-size: 10px; color: var(--text-tertiary); }.white.on .lbl { color: var(--ink-on-accent); }- .black { position: absolute; top: 0; height: 58%; border-radius: 0 0 2px 2px; background: var(--mini-key-black); border: 1px solid var(--seam); border-top: none; overflow: hidden; z-index: 1; }+ .black { position: absolute; top: 0; height: 58%; border-radius: 0 0 var(--r-fine) var(--r-fine); background: var(--mini-key-black); border: 1px solid var(--seam); border-top: none; overflow: hidden; z-index: 1; }.black.on { background: var(--accent); border-color: var(--accent); }.band { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--tc); }- /* Scale cells and chords: tiles. Tonic cells sit a tone up. */+ /* Scale cells and chords: raised cells. Tonic cells sit a tone up. */.grid { flex: 1; min-width: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }- .cell { border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; min-height: 0; }- .cell .mono { font-size: 12px; color: var(--text-secondary); pointer-events: none; }+ .cell { border-radius: min(var(--r-cell), 14px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; min-height: 0; }+ .cl { font-size: 12px; color: var(--text-secondary); pointer-events: none; }.cell.tonic { background: var(--surface-hover); }- .cell.tonic .mono { color: var(--text-primary); font-weight: 600; }- .cell.lit, .chord.lit { border-color: var(--tc); }+ .cell.tonic .cl { color: var(--text-primary); font-weight: 600; }+ .cell.lit, .chord.lit { border-color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); }.cell.on { background: var(--accent); border-color: var(--accent); box-shadow: none; }- .cell.on .mono { color: var(--ink-on-accent); }- .chord { border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 0; }+ .cell.on .cl { color: var(--ink-on-accent); }+ .chord { border-radius: min(var(--r-cell), 14px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 0; }.chord * { pointer-events: none; }.roman { font-size: 12px; color: var(--text-muted); }.cn { font-size: 20px; font-weight: 600; color: var(--text-primary); }diff --git a/src/web/remote/src/screens/Macros.svelte b/src/web/remote/src/screens/Macros.svelteindex 64b5c558..d672b2fc 100644--- a/src/web/remote/src/screens/Macros.svelte+++ b/src/web/remote/src/screens/Macros.svelte@@ -1,17 +1,20 @@<!-- SPDX-License-Identifier: AGPL-3.0-only --><!-- Macros: eight big knobs for one device of the track's chain — a rack's macros, a built-ininstrument's or effect's parameters, a plug-in's first eight (paged). A vertical swipe turns- a knob, as in Nota; a dot marks an automated parameter. A knob mapped with MIDI Learn+ a knob, as in Nota; values carry the track's colour, the knob being turned a quiet tint of it; a dot marks an automated parameter. A knob mapped with MIDI Learnshows what it drives instead. --><script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';+ import { pct } from '../lib/fmt';let { form }: { form: Form } = $props();const cols = $derived(form === 'phone' ? 2 : 4);const size = $derived(form === 'phone' ? 64 : form === 'phoneLand' ? 52 : 112);const m = $derived(app.mac?.id === app.proj?.you ? app.mac : null);const devName = $derived(m?.devs[m.di] ?? 'No devices');+ // Values carry the playing track's colour (spec 090), neutral ink without a track.+ const tc = $derived(app.track?.color ?? 'var(--viz-ink)');let local = $state<Record<number, number>>({});let mappedPos = $state<Record<number, number>>({});@@ -51,20 +54,21 @@<button class="dev" onclick={() => m && m.devs.length > 1 && (app.sheet = 'devices')}><span class="k">Device</span><span class="dn">{devName}</span>- {#if m && m.devs.length > 1}<span class="mono pos">{m.di + 1}/{m.devs.length}</span>{/if}+ {#if m && m.devs.length > 1}<span class="pos">{m.di + 1}/{m.devs.length}</span>{/if}<svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" /></svg></button>{#if !m || m.devs.length === 0}<div class="empty">{m ? 'This track has no instrument or effects to control.' : 'Loading…'}</div>{:else}- <div class="grid" style:grid-template-columns="repeat({cols}, minmax(0, 1fr))">+ <div class="grid" style:--tc={tc} style:grid-template-columns="repeat({cols}, minmax(0, 1fr))">{#each m.k as k, i (i)}{@const v = local[i] ?? (k.map ? mappedPos[i] ?? 0.5 : k.v ?? 0)}{@const on = active === i}{@const empty = k.n === undefined && !k.map}<div class="knob" class:on class:empty class:learnable={app.learn.on && !empty}onpointerdown={(e) => !empty && down(e, i, v)} role="slider" tabindex="0"- aria-label={k.map ?? k.n ?? `Macro ${i + 1}`} aria-valuenow={Math.round(v * 100)} aria-valuetext={k.map ? `${Math.round(v * 100)}\u2009%` : k.txt}>+ aria-label={k.map ?? k.n ?? `Macro ${i + 1}`} aria-valuenow={Math.round(v * 100)} aria-valuetext={k.map ? pct(v) : k.txt}>+ <span class="tint"></span>{#if k.a && !k.map}<span class="auto"></span>{/if}<svg width={size} height={size} viewBox="0 0 52 52"><circle cx="26" cy="26" r="21" class="trk" stroke-dasharray="{ARC} {CIRC}" transform="rotate(135 26 26)" />@@ -73,7 +77,7 @@{#if !empty}<line x1="26" y1="26" x2="26" y2="14" class="ptr" transform="rotate({-135 + 270 * v} 26 26)" />{/if}</svg><span class="kn">{k.map ?? k.n ?? `Macro ${i + 1}`}</span>- <span class="mono kv">{empty ? '—' : k.map || on ? `${Math.round(v * 100)}\u2009%` : k.txt}</span>+ <span class="kv">{empty ? '—' : k.map || on ? pct(v) : k.txt}</span></div>{/each}</div>@@ -82,25 +86,28 @@<style>.macros { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; touch-action: none; }- /* The device picker reads like a readout: the well, a rule edge. */- .dev { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--bg-sunken); box-shadow: var(--sunken); border-radius: 3px; text-align: left; }- .k { font-size: 11px; font-weight: 500; color: var(--text-muted); }+ /* The device picker reads like a dropdown: raised, a group corner. */+ .dev { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); border-radius: min(var(--r-group), 14px); text-align: left; }+ .k { font-size: 11px; color: var(--text-muted); }.dn { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .pos { font-size: 11px; color: var(--text-tertiary); }+ .pos { font-size: 11px; color: var(--text-muted); }.dev path { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }- .grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: 3px; overflow: hidden; }+ /* Eight knobs on one card, cells on seams. */+ .grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: var(--r-card); overflow: hidden; }.knob { min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--panel); touch-action: none; }+ .knob > svg, .kn, .kv { position: relative; }+ /* The knob being turned: a quiet tint of the track colour behind it. */+ .knob > .tint { position: absolute; inset: 0; background: var(--tc); opacity: 0; transition: opacity var(--ease); }+ .knob.on > .tint { opacity: .14; }.auto { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }- /* Nota's knob: a well groove, the value in viz ink at rest and the accent while turned, a raised face with a seam edge. */+ /* Nota's knob: a grey groove, the value arc in the track colour, a raised face with a seam edge. */.trk { fill: none; stroke: var(--bg-sunken); stroke-width: 5; stroke-linecap: round; }- .arc { fill: none; stroke: var(--viz-ink); stroke-width: 5; stroke-linecap: round; }- .on .arc { stroke: var(--accent); }+ .arc { fill: none; stroke: var(--tc); stroke-width: 5; stroke-linecap: round; }.capc { fill: var(--surface-raised); stroke: var(--seam); }.ptr { stroke: var(--text-primary); stroke-width: 2.4; stroke-linecap: round; }- .kn { font-size: 11px; font-weight: 500; color: var(--text-secondary); max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .kv { font-size: 12px; color: var(--text-primary); }+ .kn { font-size: 11px; color: var(--text-secondary); max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .kv { font-size: 12px; font-weight: 500; color: var(--text-primary); }.on .kn { color: var(--text-primary); }- .on .kv { color: var(--accent-bright); }.knob.empty .kn, .knob.empty .kv { color: var(--text-faint); }.empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-tertiary); }.knob.empty { flex: initial; display: flex; }diff --git a/src/web/remote/src/screens/Mixer.svelte b/src/web/remote/src/screens/Mixer.svelteindex cb0ccc3c..f696c71f 100644--- a/src/web/remote/src/screens/Mixer.svelte+++ b/src/web/remote/src/screens/Mixer.svelte@@ -3,11 +3,13 @@until tapped, as in the arrangement. A fader moves relative to the finger (no jump to thetouch), a double tap resets it to 0 dB; values follow Nota live, and a fader another phoneis holding carries their name. Mute and Solo read as letters, not colour alone. Meters run- green, then amber from −6 dB and red from 0 dB, on the hub's −60…+6 dBFS scale. -->+ green, then amber from −6 dB and red from 0 dB. Values are grey at rest; a fader or pan+ under a finger borrows the soft tint and an orange line, as the desktop's shell slider, on the hub's −60…+6 dBFS scale. --><script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';import type { Track, MixRow } from '../lib/types';+ import { db, pan as panText } from '../lib/fmt';let { form }: { form: Form } = $props();const MAX = 1.5;@@ -83,12 +85,6 @@app.prefs.groupsOpen = [...s];}- const db = (v: number) => {- if (v < 1e-4) return '−∞';- const d = 20 * Math.log10(v);- return (d >= 0.05 ? '+' : d <= -0.05 ? '−' : '') + Math.abs(d).toFixed(1);- };- const panText = (p: number) => (Math.abs(p) < 0.01 ? 'C' : (p < 0 ? 'L' : 'R') + Math.round(Math.abs(p) * 50));const heldBy = (r: MixRow | undefined) => (r && r[8] && r[9] !== app.conn ? r[8] : '');const master = $derived(app.mix?.m);</script>@@ -106,24 +102,24 @@<span class="cbar" style:background={t.color}></span><span class="nm">{t.name}</span>{#if isGroup}- <span class="tag mono">+ <span class="tag"><svg width="8" height="8" viewBox="0 0 8 8" style:transform={open.has(t.id) ? 'rotate(90deg)' : 'none'}><path d="M2.5 1.5 L5.5 4 L2.5 6.5" /></svg>{childCount(t.id)}</span>{/if}</button><div class="pan" class:act={drag?.key === 'p' + t.id} onpointerdown={(e) => begin(e, 'p' + t.id, t.id, 'pan', pan)} role="slider" tabindex="0" aria-label="{t.name} pan" aria-valuetext={panText(pan)} aria-valuenow={pan}><div class="pbar"><span style:left="{50 + pan * 50}%"></span></div>- <span class="mono pv">{panText(pan)}</span>+ <span class="pv">{panText(pan)}</span></div><div class="fz">{#if held}<span class="held">{held} has it</span>{/if}<div class="meters"><div><span style:--lv={r?.[6] ?? 0}></span></div><div><span style:--lv={r?.[7] ?? 0}></span></div></div>- <div class="fader" class:act={drag?.key === 'v' + t.id} onpointerdown={(e) => begin(e, 'v' + t.id, t.id, 'vol', vol)} role="slider" tabindex="0" aria-label="{t.name} volume" aria-valuetext="{db(vol)} dB" aria-valuenow={vol}>+ <div class="fader" class:act={drag?.key === 'v' + t.id} onpointerdown={(e) => begin(e, 'v' + t.id, t.id, 'vol', vol)} role="slider" tabindex="0" aria-label="{t.name} volume" aria-valuetext={`${db(vol)}\u2009dB`} aria-valuenow={vol}><div class="slot"></div><div class="travel"><span class="cap" class:held={!!held} style:bottom="{(vol / MAX) * 100}%"><i></i></span></div></div></div>- <span class="mono dbv" class:act={drag?.key === 'v' + t.id}>{db(vol)}</span>+ <span class="dbv" class:act={drag?.key === 'v' + t.id}>{db(vol)}</span><div class="btns"><button class="ms" class:mute={r?.[3]} aria-pressed={!!r?.[3]} aria-label="Mute {t.name}" onclick={() => toggle('mute', t, !r?.[3])}>M</button><button class="ms" class:solo={r?.[4]} aria-pressed={!!r?.[4]} aria-label="Solo {t.name}" onclick={() => toggle('solo', t, !r?.[4])}>S</button>@@ -145,7 +141,7 @@<div class="travel"><span class="cap" style:bottom="{((local['m'] ?? master?.[0] ?? 1) / MAX) * 100}%"><i></i></span></div></div></div>- <span class="mono dbv" class:act={drag?.key === 'm'}>{db(local['m'] ?? master?.[0] ?? 1)}</span>+ <span class="dbv" class:act={drag?.key === 'm'}>{db(local['m'] ?? master?.[0] ?? 1)}</span></div></div>@@ -154,53 +150,56 @@/* Edge to edge: the strips dock against the header and tab bar like panels (main's padding undone). */.mixer.phoneLand { margin: -8px -10px calc(-1 * max(10px, env(safe-area-inset-bottom))) -10px; }.mixer.tablet { margin: -18px -18px calc(-1 * max(18px, env(safe-area-inset-bottom))); }- /* Docked strips meeting on seams, as in Nota's Mixer. */+ /* Docked strips meeting on seams, as in Nota's Mixer — square. */.strips { flex: 1; min-width: 0; display: flex; gap: 1px; background: var(--seam); overflow-x: auto; overflow-y: hidden; touch-action: pan-x; overscroll-behavior: contain; }.strip { flex: 0 0 88px; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 6px; background: var(--panel); }.phoneLand .strip { flex-basis: 84px; }.tablet .strip { flex: 1 1 0; min-width: 84px; }.strip.group { background: var(--surface-inset); }.head { display: flex; align-items: center; gap: 6px; min-width: 0; height: 28px; text-align: left; }- .cbar { width: 3px; height: 16px; border-radius: 1px; flex: none; }+ .cbar { width: 3px; height: 16px; border-radius: min(var(--r-fine), 1px); flex: none; }.nm { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.mh .nm { text-align: center; color: var(--text-secondary); }- .tag { display: flex; align-items: center; gap: 2px; font-size: 10px; color: var(--text-tertiary); }+ .tag { height: 18px; display: flex; align-items: center; gap: 2px; padding: 0 5px; border-radius: min(var(--r-cell), 6px); background: var(--bg-sunken); font-size: 10px; color: var(--text-tertiary); }.tag path { fill: none; stroke: currentColor; stroke-width: 1.5; }- /* Pan: a well track, the position in viz ink — the accent while a finger holds it. */+ /* Pan: a value-bar groove, the position in ink at rest; under a finger the soft tint and an orange line. */.pan { height: 22px; display: flex; align-items: center; gap: 4px; touch-action: none; }- .pbar { flex: 1; height: 3px; border-radius: 1px; background: var(--bg-sunken); box-shadow: var(--sunken); position: relative; }- .pbar span { position: absolute; top: -4px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 1px; background: var(--viz-ink); }+ .pbar { flex: 1; height: 4px; border-radius: min(var(--r-value-bar), 2px); background: var(--bg-sunken); box-shadow: var(--sunken); position: relative; }+ .pbar span { position: absolute; top: -4px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: min(var(--r-fine), 1px); background: var(--text-secondary); }+ .pan.act .pbar { background: var(--accent-soft); box-shadow: none; }.pan.act .pbar span { background: var(--accent); }.pv { font-size: 10px; color: var(--text-muted); width: 24px; text-align: right; }- .pan.act .pv { color: var(--accent-bright); }+ .pan.act .pv { color: var(--picked-ink); }.fz { flex: 1; min-height: 0; display: flex; gap: 6px; justify-content: center; position: relative; }- .held { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 2; height: 18px; display: flex; align-items: center; padding: 0 6px; border-radius: 2px; background: var(--surface-raised); box-shadow: var(--popover); font-size: 10px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }- /* Meters: a full-height bar in the three zones, clipped to the level (never animated). */+ .held { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 2; height: 18px; display: flex; align-items: center; padding: 0 6px; border-radius: min(var(--r-cell), 6px); background: var(--surface-raised); box-shadow: var(--popover); font-size: 10px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }+ /* Meters: 3 px channels in the three zones, clipped to the level (never animated). */.meters { display: flex; gap: 2px; padding: 4px 0; }- .meters div { width: 4px; height: 100%; border-radius: 1px; background: var(--bg-sunken); position: relative; overflow: hidden; }+ .meters div { width: 4px; height: 100%; border-radius: min(var(--r-fine), 2px); background: var(--bg-sunken); position: relative; overflow: hidden; }.meters.wide div { width: 5px; }.meters span { position: absolute; inset: 0; background: linear-gradient(to top, var(--success) 0 81.8%, var(--warning) 81.8% 90.9%, var(--danger) 90.9%); clip-path: inset(calc((1 - var(--lv, 0)) * 100%) 0 0 0); }.fader { width: 40px; position: relative; display: flex; justify-content: center; padding: 10px 0; touch-action: none; }- .slot { width: 3px; height: 100%; border-radius: 1px; background: var(--bg-sunken); box-shadow: var(--sunken); }+ .slot { width: 4px; height: 100%; border-radius: min(var(--r-value-bar), 2px); background: var(--bg-sunken); box-shadow: var(--sunken); }+ .fader.act .slot { background: var(--accent-soft); box-shadow: none; }.travel { position: absolute; left: 0; right: 0; top: 10px; bottom: 10px; }- /* The cap: a raised key; its line turns accent while a finger moves it, or while another phone holds it. */- .cap { position: absolute; left: 4px; right: 4px; height: 20px; margin-bottom: -10px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; }- .cap.held { border-color: var(--accent); }- .cap i { width: 18px; height: 2px; border-radius: 1px; background: var(--text-primary); }+ /* The cap: a raised key in grey; its line turns orange while a finger moves it. Another+ phone holding it shows an outline in ink 1, not orange (it is not live here). */+ .cap { position: absolute; left: 4px; right: 4px; height: 20px; margin-bottom: -10px; border-radius: min(var(--r-value-bar), 6px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; }+ .cap.held { border-color: var(--text-primary); }+ .cap i { width: 18px; height: 2px; border-radius: min(var(--r-fine), 1px); background: var(--text-primary); }.fader.act .cap i { background: var(--accent); }.dbv { font-size: 11px; color: var(--text-strong); text-align: center; }- .dbv.act { color: var(--accent-bright); }- /* Track toggles: raised at rest; mute amber, solo blue, arm red when on — ink derived from the fill. */+ .dbv.act { color: var(--picked-ink); }+ /* Track buttons: raised at rest; mute amber, solo blue, arm red when on — ink derived from the fill. */.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }- .ms, .arm { height: 34px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 12px; font-weight: 600; color: var(--text-secondary); transition: background-color var(--ease), color var(--ease); }+ .ms, .arm { height: 34px; border-radius: min(var(--r-cell), 11px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 12px; font-weight: 600; color: var(--text-secondary); transition: background-color var(--ease), color var(--ease); }.ms.mute { background: var(--mute); border-color: var(--mute); box-shadow: none; color: var(--ink-on-mute); }.ms.solo { background: var(--solo); border-color: var(--solo); box-shadow: none; color: var(--ink-on-solo); }- .arm { grid-column: span 2; height: 30px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; }+ .arm { grid-column: span 2; height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; }.arm span { width: 8px; height: 8px; border-radius: 50%; background: var(--record); }.arm.on { background: var(--record); border-color: var(--record); box-shadow: none; color: var(--ink-on-record); }.arm.on span { background: var(--ink-on-record); }.rule { width: 1px; background: var(--seam); }.masterstrip { flex: 0 0 84px; }- .tablet .masterstrip { flex-basis: 110px; }+ .tablet .masterstrip { flex: 0 0 110px; }.mh { justify-content: center; }</style>diff --git a/src/web/remote/src/screens/Pads.svelte b/src/web/remote/src/screens/Pads.svelteindex d44a9abb..76b259c2 100644--- a/src/web/remote/src/screens/Pads.svelte+++ b/src/web/remote/src/screens/Pads.svelte@@ -100,13 +100,13 @@<div class="bar"><div class="seg banks" role="group" aria-label="Bank">{#each banks as b}- <button class="mono" class:on={app.prefs.bank === b.i} onclick={() => (app.prefs.bank = b.i)}>{b.name}</button>+ <button class:on={app.prefs.bank === b.i} onclick={() => (app.prefs.bank = b.i)}>{b.name}</button>{/each}</div><button class="btn" class:on={app.prefs.fullVel} aria-pressed={app.prefs.fullVel} onclick={() => (app.prefs.fullVel = !app.prefs.fullVel)}>Full velocity</button><button class="btn rep" class:on={repeat} aria-pressed={repeat} onclick={() => (repeat = !repeat)}>Repeat- <span class="rate mono" role="button" tabindex="0" aria-label="Repeat rate"+ <span class="rate" role="button" tabindex="0" aria-label="Repeat rate"onclick={(e) => { e.stopPropagation(); rate = (rate + 1) % RATES.length; }}onkeydown={() => {}}>{RATES[rate].n}</span></button>@@ -118,10 +118,10 @@<button class="pad" class:on class:playing style:--tc={color} style:--tc-ink={colorInk}onpointerdown={(e) => press(e, note)} onpointerup={release} onpointercancel={release} onpointerleave={release}aria-label={names.get(note) ?? noteName(note)}>- <span class="num mono">{note - 35}</span>+ <span class="num">{note - 35}</span><span class="txt"><span class="name">{names.get(note) ?? noteName(note)}</span>- <span class="note mono">{noteName(note)}</span>+ <span class="note">{noteName(note)}</span></span></button>{/each}@@ -133,11 +133,11 @@.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }.banks button { min-width: 42px; flex: none; font-size: 12px; }.rep { padding: 0 6px 0 10px; gap: 8px; }- .rate { height: 30px; display: flex; align-items: center; padding: 0 7px; border-radius: 2px; background: var(--bg-sunken); font-size: 11px; color: var(--text-secondary); }- .rep.on .rate { color: var(--text-primary); }+ .rate { height: 30px; display: flex; align-items: center; padding: 0 7px; border-radius: min(var(--r-value-bar), 10px); background: var(--bg-sunken); font-size: 11px; color: var(--text-secondary); }+ .rep.on .rate { color: var(--picked-ink); }.grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }- /* Tiles: raised at rest; under the finger solid accent; played by the track solid in its colour — ink derived either way. */- .pad { border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 8px; min-height: 0; min-width: 0; overflow: hidden; text-align: left; touch-action: none; }+ /* Pads: raised at rest; under the finger live (solid accent); played by the track solid in its colour — ink derived either way. */+ .pad { border-radius: var(--r-field); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 8px; min-height: 0; min-width: 0; overflow: hidden; text-align: left; touch-action: none; }.num, .note { font-size: 10px; color: var(--text-tertiary); }.txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }.name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }diff --git a/src/web/remote/src/screens/Scenes.svelte b/src/web/remote/src/screens/Scenes.svelteindex eb721cc2..490519be 100644--- a/src/web/remote/src/screens/Scenes.svelte+++ b/src/web/remote/src/screens/Scenes.svelte@@ -1,22 +1,26 @@<!-- SPDX-License-Identifier: AGPL-3.0-only --><!-- Scenes: the Session grid, tracks across and scenes down, in the project's colours. Tap a clip- to launch it, a scene name to launch the row, Stop to stop a track. A queued clip blinks- until the launch point; a playing one shows a play mark and a progress line — readable at- arm's length. Every button takes its own finger (use:tap), so several clips launch at once. -->+ to launch it, a scene name to launch the row, Stop to stop a track. A filled cell reads like+ the desktop's Session slot (issue 557): the clip's name and length on top, what is in it below —+ its notes or its waveform, in the clip's colour. A queued clip blinks until the launch+ point; a playing one fills with its colour and shows a play mark and a progress line; a+ recording one is red and shows its take growing. Every button takes its own finger+ (use:tap), so several clips launch at once. --><script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';import { look } from '../lib/theme.svelte';import { tap } from '../lib/tap';+ import { bars } from '../lib/fmt';+ import ClipPreview from '../components/ClipPreview.svelte';let { form }: { form: Form } = $props();const s = $derived(app.ses);const tracks = $derived(new Map((app.proj?.tracks ?? []).map((t) => [t.id, t])));const cols = $derived(s?.tr ?? []);- const colMin = $derived(form === 'phone' ? 96 : form === 'phoneLand' ? 104 : 132);- const rowH = $derived(form === 'phone' ? 58 : form === 'phoneLand' ? 50 : 84);- // A clip's length as [number, unit]: whole bars where it divides, else beats.- const bars = (beats: number): [number, string] => { const b = beats / 4; return b === Math.round(b) ? [b, b === 1 ? 'bar' : 'bars'] : [beats, 'beats']; };+ const colMin = $derived(form === 'phone' ? 104 : form === 'phoneLand' ? 112 : 140);+ const rowH = $derived(form === 'phone' ? 62 : form === 'phoneLand' ? 54 : 84);+ const STATE = ['', 'Stopped', 'Queued', 'Playing', 'Recording', 'Recording'];function guard(): boolean {if (!app.canControl) { app.showToast('Nota lets this phone play notes only.'); return false; }@@ -41,14 +45,23 @@{#each cols as c (c.id)}{@const t = tracks.get(c.id)}{@const [st, len, prog] = c.c[si] ?? [0, 0, 0]}+ {@const pv = app.clips[`${c.id}:${si}`]}+ {@const col = pv?.col ?? t?.color}+ {@const rec = st === 4 || st === 5}+ {@const [bn, bu] = bars(pv?.len ?? len)}{#if st === 0}<div class="clip empty" style:height="{rowH}px"></div>{:else}- <button class="clip" class:playing={st === 3} class:queued={st === 2} class:rec={st === 4} style:height="{rowH}px" style:--tc={t?.color} style:--tc-ink={t ? look.inkOn(t.color) : undefined}+ <button class="clip" class:playing={st === 3} class:queued={st === 2} class:rec style:height="{rowH}px"+ style:--tc={col} style:--tc-ink={col ? look.inkOn(col) : undefined}use:tap={() => guard() && app.send({ t: 'launch', id: c.id, i: si })}- aria-label="{t?.name} scene {si + 1}: {st === 3 ? 'playing' : st === 2 ? 'queued' : st === 4 ? 'recording' : 'stopped'}">- <span class="cn">{#if st === 3}<span class="ptri"></span>{/if}<span><span class="mono">{bars(len)[0]}</span> {bars(len)[1]}</span></span>- <span class="cs">{st === 3 ? 'Playing' : st === 2 ? 'Queued' : st === 4 ? 'Recording' : ''}</span>+ aria-label="{pv?.nm ?? t?.name} · scene {si + 1}: {STATE[st].toLowerCase()}">+ <span class="top">+ {#if st === 3}<span class="ptri"></span>{:else if rec}<span class="rdot"></span>{/if}+ <span class="cn">{pv?.nm ?? STATE[st]}</span>+ <span class="len">{rec ? 'Rec' : `${bn} ${bu}`}</span>+ </span>+ <span class="pv"><ClipPreview preview={pv} ink={rec ? 'var(--ink-on-record)' : st === 2 || st === 3 ? 'var(--tc-ink)' : 'var(--tc)'} /></span>{#if st === 3}<span class="prog" style:width="{prog * 100}%"></span>{/if}</button>{/if}@@ -67,25 +80,30 @@.grid { display: grid; gap: 4px; min-width: min-content; }.corner { height: 36px; display: flex; align-items: center; padding-left: 4px; }.th { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 6px; min-width: 0; }- .th span { width: 3px; height: 14px; border-radius: 1px; flex: none; }+ .th span { width: 3px; height: 14px; border-radius: min(var(--r-fine), 1px); flex: none; }.th b { font-size: 12px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .scene { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 12px; font-weight: 600; color: var(--text-primary); }+ .scene { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: min(var(--r-cell), 14px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 12px; font-weight: 600; color: var(--text-primary); }.tri { width: 0; height: 0; border-left: 9px solid var(--text-secondary); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }- /* Clip slots: raised when filled; playing and queued in the track's colour, recording red — ink derived. */- .clip { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 0 10px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); overflow: hidden; min-width: 0; text-align: left; }+ /* A clip slot, as the desktop's: raised when filled — its name, the preview in its colour+ below; playing and queued fill with the clip's colour, recording with red — ink derived. */+ .clip { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 8px 7px; border-radius: min(var(--r-cell), 14px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); overflow: hidden; min-width: 0; text-align: left; }.clip.empty { background: var(--bg-sunken); border-color: transparent; box-shadow: none; }- .cn { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-strong); white-space: nowrap; }- .cs { font-size: 11px; color: var(--text-tertiary); }+ .top { display: flex; align-items: center; gap: 6px; min-width: 0; height: 16px; flex: none; }+ /* The name in ink 1 (read at arm's length in every theme); the clip's colour is in its preview and fill. */+ .cn { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .len { flex: none; font-size: 10px; color: var(--text-tertiary); }+ .pv { flex: 1; min-height: 0; display: block; }.clip.playing, .clip.queued { background: var(--tc); border-color: var(--tc); box-shadow: none; }- .clip.playing *, .clip.queued * { color: var(--tc-ink); }+ .clip.playing .cn, .clip.queued .cn, .clip.playing .len, .clip.queued .len { color: var(--tc-ink); }/* Queued waits for the launch point: it blinks until then (a time state, not a colour one). */.clip.queued { animation: blink 800ms steps(1) infinite; }.clip.rec { background: var(--record); border-color: var(--record); box-shadow: none; }- .clip.rec * { color: var(--ink-on-record); }+ .clip.rec .cn, .clip.rec .len { color: var(--ink-on-record); }@keyframes blink { 50% { opacity: .35; } }- .ptri { width: 0; height: 0; border-left: 8px solid var(--tc-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }+ .ptri { flex: none; width: 0; height: 0; border-left: 8px solid var(--tc-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }+ .rdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-on-record); }.prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--tc-ink); }- .stop, .stopall { height: 44px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }- .sq { width: 9px; height: 9px; border-radius: 1px; background: currentColor; }+ .stop, .stopall { height: 44px; border-radius: min(var(--r-cell), 14px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }+ .sq { width: 9px; height: 9px; border-radius: calc(var(--r-fine) / 2); background: currentColor; }.empty { padding: 20px; font-size: 12px; color: var(--text-tertiary); }</style>diff --git a/src/web/remote/src/screens/XY.svelte b/src/web/remote/src/screens/XY.svelteindex 4da6aff7..e3e5db38 100644--- a/src/web/remote/src/screens/XY.svelte+++ b/src/web/remote/src/screens/XY.svelte@@ -6,6 +6,7 @@<script lang="ts">import { app } from '../lib/app.svelte';import { tiltSupport, requestTilt, followTilt, type Form } from '../lib/device.svelte';+ import { pct } from '../lib/fmt';let { form }: { form: Form } = $props();const portrait = $derived(form === 'phone');@@ -20,8 +21,10 @@let lastSend = 0;let stopTilt: (() => void) | null = null;const support = tiltSupport();- // The point is live while a finger or the phone's tilt moves it: then, and only then, the accent.+ // The point is live while a finger or the phone's tilt moves it. Values carry the playing+ // track's colour (spec 090); live, a quiet tint of it fills the field.const live = $derived(dragging || tilt);+ const tc = $derived(app.track?.color ?? 'var(--viz-ink)');// Follow Nota's values while the finger is off (automation, the mouse, another phone).$effect(() => {@@ -115,7 +118,7 @@const s = app.xy?.[a];const v = a === 'x' ? x : y;if (s && !s.map && !(tilt && s.tilt) && s.txt && !dragging && !tilt) return s.txt;- return Math.round(v * 100) + '\u2009%';+ return pct(v);};const note = $derived(tilt ? 'Tilt the phone to move the point. Tap Tilt again to use your finger.'@@ -124,12 +127,13 @@</script><div class="xy" class:col={portrait}>- <div class="field" class:learnable={app.learn.on} role="slider" tabindex="0" aria-label="XY pad" aria-valuenow={Math.round(x * 100)}+ <div class="field" class:moving={live} class:learnable={app.learn.on} style:--tc={tc} role="slider" tabindex="0" aria-label="XY pad" aria-valuenow={Math.round(x * 100)}onpointerdown={down} onpointermove={move} onpointerup={up} onpointercancel={up}>+ <div class="tint"></div><div class="gridlines"></div>- <div class="vl" class:live style:left="{x * 100}%"></div>- <div class="hl" class:live style:top="{(1 - y) * 100}%"></div>- <div class="pt" class:live style:left="{x * 100}%" style:top="{(1 - y) * 100}%"><span></span></div>+ <div class="vl" class:moving={live} style:left="{x * 100}%"></div>+ <div class="hl" class:moving={live} style:top="{(1 - y) * 100}%"></div>+ <div class="pt" class:moving={live} style:left="{x * 100}%" style:top="{(1 - y) * 100}%"><span></span></div><span class="ax ax-x">{label('x')} →</span><span class="ax ax-y">↑ {label('y')}</span>{#if tilt}<span class="pill">Tilt is moving the point</span>{/if}@@ -138,9 +142,9 @@<div class="axes">{#each ['x', 'y'] as const as a}<div class="axis" class:learnable={app.learn.on}>- <span class="mono an">{a === 'x' ? 'X' : 'Y'}</span>+ <span class="an">{a === 'x' ? 'X' : 'Y'}</span><span class="names"><span class="pn">{label(a)}</span><span class="pd">{sub(a)}</span></span>- <span class="mono av">{value(a)}</span>+ <span class="av">{value(a)}</span></div>{/each}</div>@@ -168,38 +172,41 @@<style>.xy { flex: 1; min-height: 0; display: flex; gap: 12px; }.xy.col { flex-direction: column; }- /* A graph window: the well, a rule frame, the viz grid. Crosshair and point neutral at rest. */- .field { flex: 1; min-height: 0; min-width: 0; position: relative; border-radius: 3px; background: var(--bg-sunken); box-shadow: var(--sunken); overflow: hidden; touch-action: none; }+ /* A graph window on a card: the well, a rule frame, the viz grid. The crosshair and point+ carry the track colour; while live a quiet tint of it fills the field. */+ .field { flex: 1; min-height: 0; min-width: 0; position: relative; border-radius: var(--r-card); background: var(--bg-sunken); box-shadow: var(--sunken); overflow: hidden; touch-action: none; }+ .tint { position: absolute; inset: 0; background: var(--tc); opacity: 0; transition: opacity var(--ease); }+ .field.moving .tint { opacity: .1; }.gridlines { position: absolute; inset: 0; background-image: linear-gradient(var(--viz-grid) 1px, transparent 1px), linear-gradient(90deg, var(--viz-grid) 1px, transparent 1px); background-size: 25% 25%; background-position: -1px -1px; }- .vl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }- .hl { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule); }- .vl.live, .hl.live { background: var(--accent); }- .pt { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--viz-ink); display: flex; align-items: center; justify-content: center; }- .pt span { width: 10px; height: 10px; border-radius: 50%; background: var(--viz-ink); }- .pt.live { border-color: var(--accent); }- .pt.live span { background: var(--accent); }- .ax { position: absolute; font-size: 11px; color: var(--text-faint); pointer-events: none; }+ .vl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--tc); opacity: .45; }+ .hl { position: absolute; left: 0; right: 0; height: 1px; background: var(--tc); opacity: .45; }+ .vl.moving, .hl.moving { opacity: 1; }+ .pt { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--tc); display: flex; align-items: center; justify-content: center; }+ .pt span { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); }+ .pt.moving span { width: 14px; height: 14px; }+ .ax { position: absolute; font-size: 11px; color: var(--text-tertiary); pointer-events: none; }.ax-x { right: 10px; bottom: 8px; }.ax-y { left: 10px; top: 8px; }- .pill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 24px; display: flex; align-items: center; padding: 0 9px; border-radius: 3px; background: var(--accent); font-size: 11px; font-weight: 600; color: var(--ink-on-accent); white-space: nowrap; }+ /* Tilt moving the point is live: the solid accent pill. */+ .pill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 24px; display: flex; align-items: center; padding: 0 9px; border-radius: min(var(--r-cell), 8px); background: var(--accent); font-size: 11px; font-weight: 600; color: var(--ink-on-accent); white-space: nowrap; }.panel { width: 290px; flex: none; display: flex; flex-direction: column; gap: 10px; }:global(.tablet) .panel { width: 340px; }.col .panel { width: auto; }- .axes { border-radius: 3px; overflow: hidden; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }+ .axes { border-radius: min(var(--r-group), 14px); overflow: hidden; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }.axis { height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 12px; outline-offset: -3px; }.axis + .axis { border-top: 1px solid var(--rule); }- .an { font-size: 13px; color: var(--text-muted); width: 12px; }+ .an { font-size: 13px; font-weight: 600; color: var(--text-muted); width: 12px; }.names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }.pn { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.pd { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .av { font-size: 13px; color: var(--text-primary); white-space: nowrap; }+ .av { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }.row { display: flex; gap: 8px; }.row .seg { flex: 1; }.row .seg button { height: 44px; }.tilt { height: 46px; padding: 0 14px; }- .ph { width: 10px; height: 14px; border-radius: 2px; border: 1.5px solid currentColor; transform: rotate(-18deg); }+ .ph { width: 10px; height: 14px; border-radius: min(var(--r-fine), 3px); border: 1.5px solid currentColor; transform: rotate(-18deg); }.note { font-size: 11px; line-height: 1.5; color: var(--text-muted); }.note.dim { color: var(--text-tertiary); }- .auto { height: 30px; align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 11px; font-weight: 600; color: var(--text-primary); }+ .auto { height: 30px; align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: min(var(--r-cell), 10px); background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 11px; font-weight: 600; color: var(--text-primary); }.rd { width: 7px; height: 7px; border-radius: 50%; background: var(--record); }</style>diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs b/tests/Nota.SmokeTest/DesignTokenCheck.Remote.csindex 62a70e7f..98831cd2 100644--- a/tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs+++ b/tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs@@ -3,8 +3,10 @@//// Nota Remote's page (src/web/remote, spec 014) held as the desktop is: no colour value of// its own — every colour is a theme token as a custom property, its first-paint fallback-// built from the theme files — and the Studio rules a source scan can see: sentence case-// with no tracking, radii 0–4, every custom property it reads defined. A failure names the+// built from the theme files — and the style guide's rules a source scan can see (spec 090):+// sentence case with no tracking, every corner on the skinnable scale (var(--r-*)), one+// typeface (no monospace), the picked ink for both theme kinds, every custom property it+// reads defined. A failure names the// file and what it found.using System.Text.Json;@@ -20,7 +22,7 @@ internal static partial class DesignTokenCheckprivate static readonly Regex Radius = new(@"border-radius\s*:\s*(?<v>[^;}""]+)");private static readonly Regex VarUse = new(@"var\(\s*(?<n>--[a-z0-9-]+)");private static readonly Regex VarDef = new(@"(?<![\w-])(?<n>--[a-z0-9-]+)\s*:|style:(?<n>--[a-z0-9-]+)|['""](?<n>--[a-z0-9-]+)['""]");- private static readonly HashSet<string> RadiusOk = new() { "0", "1px", "2px", "3px", "4px", "50%" };+ private static readonly HashSet<string> RadiusOk = new() { "0", "50%" };public static IEnumerable<(bool Ok, string Label)> RunRemote(){@@ -56,12 +58,27 @@ internal static partial class DesignTokenCheck.Select(kv => Rel(src, kv.Key)).ToArray();yield return (caps.Length == 0, caps.Length == 0 ? "phone: no forced capitals" : $"phone: forced capitals (uppercase, toUpperCase, .caps): {string.Join(", ", caps)}");- // Radii 2 / 3 / 4 (0 docked, 1 for bars, 50 % for round dots).+ // Corners on the scale a skin can re-round: var(--r-*) (or built from it), 0 docked,+ // 50 % for round dots. A literal px radius would ignore the skin.var radii = text.SelectMany(kv => Radius.Matches(kv.Value)- .Where(m => m.Groups["v"].Value.Split(' ', StringSplitOptions.RemoveEmptyEntries).Any(v => !RadiusOk.Contains(v.Trim())))+ .Where(m => !m.Groups["v"].Value.Contains("var(--r-")+ && m.Groups["v"].Value.Split(' ', StringSplitOptions.RemoveEmptyEntries).Any(v => !RadiusOk.Contains(v.Trim()))).Select(m => $"{Rel(src, kv.Key)}: {m.Value.Trim()}")).ToArray();- yield return (radii.Length == 0, radii.Length == 0 ? "phone: radii are 0 / 1 / 2 / 3 / 4" : $"phone: off-scale radii: {string.Join(", ", radii.Take(8))}");+ yield return (radii.Length == 0, radii.Length == 0 ? "phone: corners are on the skinnable scale (var(--r-*), 0, 50 %)" : $"phone: literal radii — use var(--r-*): {string.Join(", ", radii.Take(8))}");++ // One typeface with tabular figures: no monospace face, no .mono class, no font file for one.+ var mono = text.Where(kv => kv.Value.Contains("Geist Mono") || kv.Value.Contains("monospace") || Regex.IsMatch(kv.Value, @"class=""[^""]*\bmono\b|class:mono|\.mono\b"))+ .Select(kv => Rel(src, kv.Key)).ToArray();+ var monoFont = Directory.Exists(Path.Combine(web, "public/fonts")) && Directory.GetFiles(Path.Combine(web, "public/fonts"), "*Mono*").Length > 0;+ yield return (mono.Length == 0 && !monoFont, mono.Length == 0 && !monoFont ? "phone: one typeface, no monospace"+ : $"phone: monospace still used — numbers are tabular Geist: {string.Join(", ", mono)}{(monoFont ? " (and a Mono font file ships)" : "")}");++ // A picked option's text is the bright orange in dark themes and the pale one in light.+ var css = File.ReadAllText(Path.Combine(src, "app.css"));+ bool picked = Regex.IsMatch(css, @"\[data-theme='dark'\][^{]*\{[^}]*--picked-ink:\s*var\(--accent-bright\)")+ && Regex.IsMatch(css, @"\[data-theme='light'\][^{]*\{[^}]*--picked-ink:\s*var\(--accent-pale\)");+ yield return (picked, "phone: --picked-ink defined for dark (accent-bright) and light (accent-pale) themes");// Every custom property read is a theme token or one the page defines — a renamed or// removed token fails here, not as a silently transparent fill on the phone.diff --git a/tests/Nota.SmokeTest/RemoteTests.cs b/tests/Nota.SmokeTest/RemoteTests.csindex f0949cfa..1d89abd6 100644--- a/tests/Nota.SmokeTest/RemoteTests.cs+++ b/tests/Nota.SmokeTest/RemoteTests.cs@@ -13,6 +13,7 @@ using System.Net.WebSockets;using System.Text;using System.Text.Json;using System.Text.RegularExpressions;+using Nota.Application;using Nota.Infrastructure;using Nota.Remote;@@ -189,10 +190,18 @@ internal static class RemoteTestspublic static readonly RemoteTheme Dark = Theme("test-dark", true, "#1E1F22"), Light = Theme("test-light", false, "#C9CBCF");public static readonly RemoteAppearance DarkOn = new(Dark, Dark, Light, "#17181A", "#FFFFFF");public static readonly RemoteAppearance LightOn = new(Light, Dark, Light, "#17181A", "#FFFFFF");+ // A user skin (spec 087) with its own typeface and square corners (specs/090).+ public static readonly RemoteTheme Skin = Theme("test-skin", true, "#101010") with+ {+ Font = "IBM Plex Sans",+ Radii = new Dictionary<string, double> { ["card"] = 0, ["group"] = 0, ["field"] = 0, ["cell"] = 0, ["valueBar"] = 0, ["switch"] = 0, ["fine"] = 0 },+ };+ public static readonly RemoteAppearance SkinOn = new(Skin, Dark, Light, "#17181A", "#FFFFFF");public RemoteAppearance Appearance { get; set; } = DarkOn;private static RemoteTheme Theme(string id, bool dark, string ground) =>new(id, id, dark, new Dictionary<string, string> { ["BgApp"] = ground, ["Accent"] = "#FF9F1C", ["ShadowBevel"] = "#FFFFFF12" });public string TrackColor(int trackId) => "#58B368";+ public string ClipColor(int trackId, int scene) => "#4FA3E0";public int SelectedTrackId { get; set; }public int ProjectKeyCode => -1;public IReadOnlyList<(string Name, double StartBeat)> Sections => new[] { ("Intro", 0.0), ("Drop", 16.0) };@@ -363,9 +372,102 @@ internal static class RemoteTests"a theme change in Nota reaches the phone");yield return (Wait("theme", 200) is null, "and is sent once");yield return (Wait("proj", 1000, m => !m.GetProperty("dark").GetBoolean()) is not null, "the project's dark flag follows the theme");+ // A skin's typeface and corners travel with its colours (specs/090 contracts/theme-message.md).+ host.Appearance = FakeHost.SkinOn;+ var skin = Wait("theme");+ var skinTh = skin?.GetProperty("th");+ yield return (skinTh is { } sk && sk.GetProperty("test-skin").GetProperty("font").GetString() == "IBM Plex Sans"+ && sk.GetProperty("test-skin").GetProperty("r").EnumerateObject().Count() == 7+ && sk.GetProperty("test-skin").GetProperty("r").GetProperty("card").GetDouble() == 0,+ "a skin's typeface and all seven corner radii reach the phone");+ yield return (skinTh is { } sb && !sb.GetProperty("test-light").TryGetProperty("font", out _) && !sb.GetProperty("test-light").TryGetProperty("r", out _),+ "a theme on the design scale carries neither a typeface nor radii");host.Appearance = FakeHost.DarkOn;+ yield return (Wait("theme") is not null, "leaving the skin re-sends the theme");yield return (hub.Devices.Count == 1 && hub.Devices[0].Name == "Anna's iPhone", "Nota lists the phone");+ // Clip previews on Scenes (#557; specs/090 contracts/clips-message.md): sent to a phone+ // on Scenes only, the whole grid once, then only what changed; notes capped.+ e.AddSessionMidiClip(inst, 0, 8);+ e.SetSessionNotes(inst, 0, new[] { new NotaNote(60, 0, 1, 0.8f), new NotaNote(64, 2, 2, 0.8f), new NotaNote(67, 4, 4, 0.8f) });+ yield return (Wait("clips", 300) is null, "no clip previews while the phone is off Scenes");+ Send(new { t = "sub", s = "Scenes" });+ var clips = Wait("clips");+ JsonElement? Slot(JsonElement? m, int scene) => m is { } cm+ ? cm.GetProperty("s").EnumerateArray().Cast<JsonElement?>().FirstOrDefault(x => x!.Value.GetProperty("id").GetInt32() == inst && x.Value.GetProperty("i").GetInt32() == scene)+ : null;+ var s0 = Slot(clips, 0);+ yield return (clips?.GetProperty("all").GetBoolean() == true && s0 is { } c0 && c0.GetProperty("k").GetString() == "n"+ && c0.GetProperty("n").GetArrayLength() == 3 && c0.GetProperty("col").GetString() == "#4FA3E0"+ && c0.GetProperty("nm").GetString()!.Length > 0 && c0.GetProperty("len").GetDouble() == 8+ && c0.GetProperty("n")[1].EnumerateArray().Select(v => v.GetInt32()).SequenceEqual(new[] { 16, 16, 64 }),+ "opening Scenes sends every filled slot: name, colour, length and its notes on the 1/64 grid");+ yield return (Wait("clips", 1500) is null, "an unchanged clip is not sent again");+ e.SetSessionNotes(inst, 0, Enumerable.Range(0, 300).Select(i => new NotaNote(36 + i % 60, i * 8.0 / 300, 0.01, 0.8f)).ToArray());+ var edited = Wait("clips", 3000);+ var s0b = Slot(edited, 0);+ yield return (edited?.GetProperty("all").GetBoolean() == false && s0b is { } cb && cb.GetProperty("n").GetArrayLength() is > 0 and <= 128+ && edited.Value.GetProperty("s").GetArrayLength() == 1,+ "an edit re-sends just that slot, with at most 128 note bars");+ Send(new { t = "sub", s = "Mixer" });+ Thread.Sleep(60); hub.Tick();+ e.SetSessionNotes(inst, 0, new[] { new NotaNote(48, 0, 1, 0.8f) });+ yield return (Wait("clips", 800) is null, "a phone off Scenes gets no previews when clips change");+ Send(new { t = "sub", s = "Scenes" });+ var again = Wait("clips");+ yield return (again?.GetProperty("all").GetBoolean() == true && Slot(again, 0)?.GetProperty("n").GetArrayLength() == 1,+ "coming back to Scenes sends the current grid once");+ // An audio clip's preview is its waveform: 48 magnitudes scaled to the loudest bucket.+ string rampWav = Path.Combine(Path.GetTempPath(), $"nota-remote-ramp-{Guid.NewGuid():N}.wav");+ var ramp = new float[48000 * 2];+ for (int i = 0; i < ramp.Length; i++) ramp[i] = (float)(0.8 * i / ramp.Length * Math.Sin(2 * Math.PI * 220 * i / 48000.0));+ using (var ww = new Nota.Infrastructure.WavWriter(rampWav, 48000, 1, WavBitDepth.Float32)) ww.WriteFrames(ramp, ramp.Length);+ int aud = e.AddAudioTrack();+ bool audioIn = e.AddSessionAudioFile(aud, 0, rampWav);+ var withAudio = Wait("clips", 3000, m => m.GetProperty("s").EnumerateArray().Any(x => x.GetProperty("id").GetInt32() == aud));+ var pk = withAudio?.GetProperty("s").EnumerateArray().First(x => x.GetProperty("id").GetInt32() == aud);+ var peaks = pk is { } pp && pp.TryGetProperty("p", out var pa) ? pa.EnumerateArray().Select(v => v.GetInt32()).ToArray() : Array.Empty<int>();+ yield return (audioIn && pk?.GetProperty("k").GetString() == "p" && peaks.Length == 48 && peaks.Max() == 99 && peaks.All(v => v is >= 0 and <= 99)+ && peaks[0] < peaks[^1],+ $"an audio clip's preview is 48 peaks scaled to its loudest part (first {peaks.FirstOrDefault()}, last {peaks.LastOrDefault()})");+ e.RemoveTrack(aud);+ try { File.Delete(rampWav); } catch { }++ // A big grid at the real UI clock (33 ms): an edit that keeps a slot's state and length+ // (only its notes change) still reaches the phone within a second — the sweep is sized+ // by time, not by a fixed number of slots per tick.+ var big = Enumerable.Range(0, 15).Select(_ => e.AddInstrumentTrack()).ToArray();+ int scenesBefore = e.SceneCount;+ while (e.SceneCount < 32) e.AddScene();+ foreach (var bt in big.Prepend(inst))+ for (int sc = 1; sc < 32; sc++) { e.AddSessionMidiClip(bt, sc, 4); e.SetSessionNotes(bt, sc, new[] { new NotaNote(60, 0, 1, 0.8f) }); }+ Send(new { t = "sub", s = "Mixer" });+ Thread.Sleep(60); hub.Tick();+ Send(new { t = "sub", s = "Scenes" });+ Wait("clips", 3000);+ for (int k = 0; k < 40; k++) { hub.Tick(); Thread.Sleep(33); }+ lock (inbox) inbox.RemoveAll(m => m.GetProperty("t").GetString() == "clips");+ int far = big[^1];+ e.SetSessionNotes(far, 31, new[] { new NotaNote(72, 1, 2, 0.8f) });+ var sw = System.Diagnostics.Stopwatch.StartNew();+ JsonElement? farMsg = null;+ while (sw.ElapsedMilliseconds < 2500 && farMsg is null)+ {+ hub.Tick();+ lock (inbox)+ {+ var hit = inbox.FirstOrDefault(m => m.GetProperty("t").GetString() == "clips"+ && m.GetProperty("s").EnumerateArray().Any(x => x.GetProperty("id").GetInt32() == far && x.GetProperty("i").GetInt32() == 31));+ if (hit.ValueKind != JsonValueKind.Undefined) farMsg = hit;+ }+ Thread.Sleep(33);+ }+ long farMs = sw.ElapsedMilliseconds;+ yield return (farMsg is not null && farMs < 1000, $"on a 16 × 32 grid at a 33 ms tick a note edit reaches the phone within a second ({farMs} ms)");+ foreach (var bt in big) e.RemoveTrack(bt);+ while (e.SceneCount > scenesBefore && e.RemoveScene(e.SceneCount - 1)) { }+ Send(new { t = "sub", s = "Mixer" });+Send(new { t = "ping", c = 1 });yield return (Wait("pong") is not null, "a ping is answered");