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) Give every release its own splash art (#466)
Egor Khindikaynend30d43284cbb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 11bac648..c1508c8d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,12 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Every release opens with its own splash art**: the launch screen now shows an abstract+ picture generated from the version number. It is built from piano-roll notes, rhythm+ rings, waveform strata, panels, a Lissajous figure or fader rails, in a few of the+ theme's track colours, so each release gets its own picture. The same version always+ shows the same one, in whichever colour theme is active. The logo, version and progress+ bar sit beside it on the plain ground.- **File → Open recent** (#443): the recent projects from the start window, newest first, arein the File menu too, so another project is two clicks away while you work. Picking one asksto save your changes first, as Open… does; hover an entry to see where it lives.diff --git a/DESIGN.md b/DESIGN.mdindex bc6a7bc4..40eb9128 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -179,6 +179,13 @@ HSL lightness (hue kept) that passes the bar:a picture of the plug-in's own window under `NotaPalette.PluginPreviewWash`, a verticalwash of the card's own `SurfaceCard` (specs/046). It lives in `Theme/` like everytoken; views still draw no gradients of their own.+ A second exception: the launch splash's release art (`Theme/SplashArt/`, specs/074),+ generated from the version number so every release opens with a picture of its own.+ It may use gradients between theme tokens (including fades to transparent) and strokes+ heavier than 1px. It still draws only theme tokens: track colours as the work,+ neutral greys for its structure, and one accent mark that reads as live (a playhead,+ the current step). It has no glow, blur or shadow, and the text beside it stays on the+ plain ground behind a 1px seam.7. **Small, nearly square corners.** 2 for inner keys, rows, clips and menu items; 3 forcontrols, cards, graph windows and popovers; 4 only for modals. 0 for docked panels; 1for bars inside a plot.@@ -813,7 +820,7 @@ sections) and fails the build on:| `Run` | `NotaTheme.axaml` holds no colour; every referenced `Brush.*` key is published (`KeyMap`); every `Shadow.*` key is built from the theme || `RunThemes` | Every theme file: shape, id, kind, exactly the token catalogue, valid opaque colours (shadows may be translucent), and every readability pairing (§ Readability bar); `BuiltInOrder` lists exactly the files || `RunAppearance` | Old settings migrate (Dark / Light / System); unknown and wrong-kind ids fall back; storing keeps the legacy setting in step |-| `RunGeometry` | XAML ↔ `NotaGeometry` values; no undefined `Radius`/`Control`/`Space` keys; no `CornerRadius` literals, drop shadows or gradients in views; `Rectangle` `RadiusX` / `RadiusY` literals on the 0/1/2/3/4 scale (`RadiusAllowList.txt`) |+| `RunGeometry` | XAML ↔ `NotaGeometry` values; no undefined `Radius`/`Control`/`Space` keys; no `CornerRadius` literals, drop shadows or gradients in views; gradients inside `Theme/` only in `NotaPalette.cs` and `Theme/SplashArt/`; `Rectangle` `RadiusX` / `RadiusY` literals on the 0/1/2/3/4 scale (`RadiusAllowList.txt`) || `RunType` | Fonts bundled and matched; no font names in views; nothing under 7 px || `RunControls` | No unicode icons typed as text; Knob / Switch / Slider sizes || `RunVisualisers` | Graph windows via `NotaGraph`; no fills under curves; no meter ballistics; meter 11/5; playhead 1 px without glow |diff --git a/FEATURES.md b/FEATURES.mdindex 6f32d876..a927b35e 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -1282,6 +1282,12 @@ audio effects after it keep running and keep their settings; saved with the projknob or fader turns orange while you hover or drag it; mute is amber, solo blue,record-arm red; labels are in sentence case. Switching applies immediately, across everyopen window — including the custom-drawn arrangement, piano roll, mixer and device cards.+- **Release splash art** — the launch splash shows an abstract picture generated from the+ version number: piano-roll notes, rhythm rings, waveform strata, panels, a Lissajous+ figure or fader rails, in a few of the theme's track colours, with one orange mark that+ reads as live. The same version always shows the same picture, consecutive releases+ always differ, and the picture follows the colour theme. The logo, version and progress+ bar sit beside it on the plain ground.- **Right-click menus, one system** — every context menu opens with the object it acts on(name, colour, type and position: "Vocals · Audio · 3", "3 tracks", "MIDI clip") and listsits commands in one order: properties → settings → actions → create / group → Copy · Cut ·diff --git a/specs/074-release-splash-art/checklists/requirements.md b/specs/074-release-splash-art/checklists/requirements.mdnew file mode 100644index 00000000..ad7aac05--- /dev/null+++ b/specs/074-release-splash-art/checklists/requirements.md@@ -0,0 +1,35 @@+# Specification Quality Checklist: Per-release splash art++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-11-03+**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++- FR-006 resolved 2026-11-03: track-colour palette per version plus at most one "live" accent element; no semantic colours.+- File paths in "Nota Context" and "Assumptions" come from the project template's own Nota Context section and are not requirements.diff --git a/specs/074-release-splash-art/contracts/splash-art.md b/specs/074-release-splash-art/contracts/splash-art.mdnew file mode 100644index 00000000..0b8a8a02--- /dev/null+++ b/specs/074-release-splash-art/contracts/splash-art.md@@ -0,0 +1,53 @@+# Contract: splash art++This feature has no external API. It has two internal surfaces that other code and tools+rely on.++## 1. Composer (C#, `Nota.App/Theme/SplashArt/SplashArtComposer.cs`)++```text+SplashScene SplashArtComposer.Compose(string version)+```++- **Pure.** No Avalonia types, no I/O, no statics that change. It is safe to call from the+ smoke test, which links the file.+- **Deterministic.** Equal `version` strings give structurally equal scenes (record+ equality over all fields, coordinates rounded to 0.1).+- **Total.** Any string, including empty or non-semver, returns a valid, non-empty scene.+ It never throws.+- **Version-sensitive.** For `a.b.p` and `a.b.(p+1)`, `Family` differs.++## 2. Renderer (Avalonia, `Nota.App/Theme/SplashArt/SplashArtView.cs`)++```text+new SplashArtView(SplashScene scene) // a Control, sized 420×300+```++- Draws `scene.Items` clipped to `scene.ArtRect`, then a 1px `Seam` line on the boundary+ between `ArtRect` and `TextRect`.+- Resolves every `ColorRef` from the live `NotaPalette` slots inside `Render`, with no+ cached colours.+- Uses gradient brushes. This is allowed only in `Theme/SplashArt/` (DESIGN.md rule 6+ exception), and `DesignTokenCheck` enforces that.++`SplashWindow` composes, then hosts `SplashArtView` under the existing content. The+content panel moves into `scene.TextRect`. If anything throws, it falls back to today's+card.++## 3. Review sheet (smoke-test mode)++```text+dotnet run --project tests/Nota.SmokeTest -- --splash-sheet <out.html> [theme-id] [from-version] [count]+```++| Arg | Default | Meaning |+|---|---|---|+| `out.html` | required | Output path, overwritten |+| `theme-id` | `studio-dark` | Any file stem in `Theme/Themes/` |+| `from-version` | current `VERSION` | First version |+| `count` | 40 | Versions in the sheet: 4 next patches, then successive minors `.0` |++- Output: one standalone HTML page. It holds one inline SVG per version (420×300) and a+ caption `version · family[+overlay] · palette mode`.+- Exit code: 0 on success, 1 on a bad theme id or an unwritable path.+- Text is not drawn on the sheet: it shows the art and the text region's ground.diff --git a/specs/074-release-splash-art/data-model.md b/specs/074-release-splash-art/data-model.mdnew file mode 100644index 00000000..a6c7cbb6--- /dev/null+++ b/specs/074-release-splash-art/data-model.md@@ -0,0 +1,72 @@+# Data model: Per-release splash art++Everything here exists only in memory at launch. Nothing is persisted.++## ReleaseSeed++| Field | Type | Notes |+|---|---|---|+| `Version` | string | `AppInfo.Version`, with `+metadata` already stripped. Fallback `0.0.0`. |+| `Full` | uint | FNV-1a + finaliser over `Version` (research R3) |+| `Line` | uint | The same hash over `"major.minor"`. Used only for the family step (R4). |+| `Patch` | int | Parsed patch number. 0 if `Version` is not semver. |++Validation: a non-semver string still yields a seed, with `Line = Full` and `Patch = 0`.+It never throws.++## SplashScene++| Field | Type | Notes |+|---|---|---|+| `Version` | string | The seed's input, for labels in the review sheet |+| `Layout` | enum `TextLeft / TextRight / TextBottom` | Decides `ArtRect` and `TextRect` |+| `ArtRect` / `TextRect` | rect in the 420×300 card space | `TextLeft`: text 0,0,150,300 · art 150,0,270,300. `TextRight`: mirrored. `TextBottom`: art 0,0,420,196 · text 0,196,420,104. |+| `Family` | enum `Roll / Rings / Strata / Panels / Lissajous / Faders` | `(Line + 5·Patch) mod 6` |+| `Overlay` | Family? | Neutral and quiet, from the allowed pairs (R5) |+| `PaletteMode` | enum `Mono / Analog / Pair / Triad` | |+| `Palette` | int[] | 1–3 indices into `Track1..9` |+| `StrokeWeight` | double | One of {1.5, 2, 2.5, 3} |+| `ColourShare` | double | 0.35–0.85. The share of a family's elements in palette colours: notes in Roll, rings in Rings (the outer one always), faders in Faders (the touched one always), and cells in Panels (half of it). |+| `Wash` | enum `None / Radial / Linear` | Plus the focus point (0..1, 0..1) |+| `Items` | `IReadOnlyList<Prim>` | Drawn in order, clipped to `ArtRect` |++Invariants, all checked by the smoke test:+- every coordinate is finite and within one card size of the card. Motifs may run past the+ art region on purpose (outer rings, a roll's last notes), and the renderer clips them;+- `Items` is not empty;+- at most one live mark uses `Role.Accent`, which is at most 2 items (a playhead's line+ and head, the current step's spoke and ring);+- no item uses a semantic role (none exists in `Role`);+- `Overlay` items use neutral roles only.++## Prim (primitive)++| Kind | Geometry | Paint fields |+|---|---|---|+| `Rect` | x, y, w, h, corner radius | fill, stroke?, strokeWidth |+| `Line` | x1, y1, x2, y2 | stroke, strokeWidth (round caps) |+| `Polyline` | points[] | stroke?, fill?, strokeWidth (round joins) |+| `Polygon` | points[] | fill |+| `Circle` | cx, cy, r | fill?, stroke?, strokeWidth |++## Paint++`Solid(ColorRef)`, or `Linear(stops[], start, end, space)`, or+`Radial(stops[], centre, radius, space)`.++- A stop is `(offset 0..1, ColorRef)`.+- `space` is `Bounds` (relative to the shape) or `Art` (absolute in card space, for strokes+ that run across the whole art).++## ColorRef++| Field | Type | Notes |+|---|---|---|+| `Role` | enum | `Ground` (BgSunken), `App` (BgApp), `Panel`, `Raised` (SurfaceRaised), `Hover` (SurfaceHover), `Seam`, `Rule`, `Grid` (VizGrid), `Faint` (TextFaint), `Tertiary` (TextTertiary), `Ink` (VizInk), `Accent`, `Track` |+| `TrackIndex` | int | 0–8, used when `Role = Track` |+| `TowardBlack` | double 0..1 | Clip title bands, note outlines: 0.3–0.45 |+| `TowardGround` | double 0..1 | Panel gradient ends: 0.7 |+| `Alpha` | double 0..1 | Washes and velocity fades |++Resolution happens at draw time: the role's live `NotaPalette` slot `.Color` (or the+theme JSON value in the review sheet), then the mixes, then the alpha.diff --git a/specs/074-release-splash-art/plan.md b/specs/074-release-splash-art/plan.mdnew file mode 100644index 00000000..86af5221--- /dev/null+++ b/specs/074-release-splash-art/plan.md@@ -0,0 +1,139 @@+# Implementation Plan: Per-release splash art++**Branch**: `074-release-splash-art` (off `develop`) | **Date**: 2026-11-03 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `/specs/074-release-splash-art/spec.md`++**Note**: This template is filled in by the `/speckit-plan` command; its definition describes the execution workflow.++## Summary++The launch splash shows an abstract composition generated from the app version. Each+version picks its own layout, one of six motif families (piano roll, rhythm rings,+waveform strata, panels, Lissajous, fader rails), a palette of track colours, a stroke+weight and a gradient wash. Exactly one orange element is "live".++The technical approach has five parts:+1. A pure, theme-free composer turns the version into a scene of primitives with colour+ roles.+2. An Avalonia `Control` resolves those roles against the live palette and draws the scene.+3. Both live in `Theme/SplashArt/`, the one place where gradients are allowed, next to the+ existing plug-in wash. DESIGN.md records the exception and a smoke check pins it.+4. The smoke test checks determinism and variety on the scene, and gains a `--splash-sheet`+ mode that writes an HTML contact sheet for review.+5. The splash text stays on today's plain ground, in a region of its own.++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) (Studio) and the `nota-design` skill. Rule 6+ gets a documented splash exception (gradients, heavier strokes). Rules 1 (accent only for+ live elements) and 3 (no semantic colours) hold unchanged.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md). The new files carry the SPDX+ header, and there is no new dependency.+- Engine, instruments and build are not touched.++## Technical Context++**Language/Version**: C# / .NET 10 (managed app only)++**Primary Dependencies**: Avalonia 12.1.4 (already used): `Control.Render`,+`DrawingContext`, `StreamGeometry`, `Linear/RadialGradientBrush`. No new dependency.++**Storage**: N/A. The art is composed in memory at launch.++**Audio-Thread Impact**: None. The splash runs on the UI thread before the engine is+constructed.++**Testing**: `tests/Nota.SmokeTest`:+- a new `SplashArtTests` block on the linked composer;+- the extended `DesignTokenCheck` gradient check;+- the `--splash-sheet` review mode;+- a headless Avalonia capture for the four-theme check (quickstart §3).++**Target Platform**: macOS, Windows, Linux. The app uses no platform-specific drawing.++**Project Type**: desktop app (Avalonia)++**Performance Goals**: compose ≤ 10 ms median. First splash paint ≤ 50 ms later than today+(SC-005).++**Constraints**:+- deterministic per version (FR-001);+- consecutive patches change family (FR-002, research R4);+- colours only from theme tokens, with gradients only in `Theme/SplashArt/` (FR-004);+- at most one accent item (FR-006);+- static, with no animation besides the progress bar (FR-009);+- never blocks launch (FR-010).++**Scale/Scope**: about 4 new source files (~700 lines including six motif ports), 2 edited+app files, 2 test files plus a csproj link, DESIGN.md, CHANGELOG and FEATURES.++## Constitution Check++*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*++| Principle | Status | Note |+|---|---|---|+| 0. Approved issue first | Waived | The core maintainer waived the issue for this feature in chat on 2026-11-03. Recorded in spec.md. |+| I. Real-time audio safety | Pass | UI thread only, before the engine exists. |+| II. Boundary discipline | Pass | No C ABI or JUCE involvement. |+| III. Licensing hygiene | Pass | New files carry the two-line SPDX header. No dependency. |+| IV. Verification gate | Pass | Smoke test extended (`SplashArtTests`, gradient-location check). `scripts/build.sh` must pass. |+| V. One logical change per PR | Pass | Splash art only, with its DESIGN.md exception and tests. |+| VI. Docs in sync | Pass | CHANGELOG *Added*, FEATURES.md via `nota-features`, `nota-docs` check, DESIGN.md exception. |+| VII. Spec-first | Pass | spec → plan → tasks. |+| VIII. Safety rules not weakened | Pass | Rule 6 is a design rule, not one of I–III. The exception is narrow, documented in DESIGN.md first, and enforced by a stricter check than today's. |++Post-design re-check: unchanged, all pass.++## Project Structure++### Documentation (this feature)++```text+specs/074-release-splash-art/+├── plan.md # This file+├── research.md # Phase 0: R1–R9 decisions+├── data-model.md # Phase 1: seed, scene, primitives, paints, colour refs+├── quickstart.md # Phase 1: validation guide+├── prototype.html # Reviewed browser prototype (reference for the port)+├── contracts/+│ └── splash-art.md # Composer, renderer and review-sheet contracts+└── tasks.md # Phase 2 (/speckit-tasks)+```++### Source Code (repository root)++```text+src/managed/Nota.App/+├── SplashWindow.cs # EDIT: compose, host SplashArtView, put the content in TextRect, fallback+└── Theme/+ └── SplashArt/ # NEW: the only gradient code outside NotaPalette+ ├── SplashScene.cs # records: SplashScene, Prim, Paint, ColorRef, enums (no Avalonia)+ ├── SplashArtComposer.cs # seed, PRNG, layout, palette, six families + overlays (no Avalonia)+ └── SplashArtView.cs # Control: resolve ColorRefs from NotaPalette in Render, draw++tests/Nota.SmokeTest/+├── Nota.SmokeTest.csproj # EDIT: link SplashScene.cs and SplashArtComposer.cs+├── SplashArtTests.cs # NEW: determinism, variety, invariants, timing, edge versions; --splash-sheet writer+├── DesignTokenCheck.cs # EDIT: gradients inside Theme/ only in NotaPalette.cs + Theme/SplashArt/+└── Program.cs # EDIT: "-- design: splash art --" block, --splash-sheet mode++DESIGN.md # EDIT: rule 6 second exception; Enforced by tests+CHANGELOG.md # EDIT: [Unreleased] Added+FEATURES.md # EDIT via nota-features+```++**Structure Decision**:+- All new code stays in `Nota.App`, the only project that knows Avalonia drawing and the+ palette.+- The composer is kept Avalonia-free so the smoke test can link it, as it already links+ `Changelog.cs` and `ClipEditor/*.cs`.+- `Theme/SplashArt/` follows DESIGN.md: gradient-bearing code lives with the tokens, and+ views draw none.++## Complexity Tracking++No constitution violations. The one design-rule exception (gradients and heavier strokes+on the splash) is the feature itself. It is documented in DESIGN.md and enforced by test,+not tracked as a violation.diff --git a/specs/074-release-splash-art/prototype.html b/specs/074-release-splash-art/prototype.htmlnew file mode 100644index 00000000..efc93ca7--- /dev/null+++ b/specs/074-release-splash-art/prototype.html@@ -0,0 +1,123 @@+<!doctype html>+<!-- SPDX-License-Identifier: AGPL-3.0-only -->+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->+<html><head><meta charset="utf-8"><title>Nota splash art prototype</title>+<style>+@font-face{font-family:'Geist';src:url(Geist-Regular.ttf);font-weight:400}@font-face{font-family:'Geist';src:url(Geist-SemiBold.ttf);font-weight:600}@font-face{font-family:'Geist Mono';src:url(GeistMono-Regular.ttf);font-weight:400}@font-face{font-family:'Geist Mono';src:url(GeistMono-SemiBold.ttf);font-weight:600}+body{margin:0;padding:24px;background:#111214;color:#C0C4C9;font:13px -apple-system,system-ui,sans-serif}+.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 16px}+input,select,button{background:#2B2D31;color:#E8E9EB;border:1px solid #45484E;border-radius:3px;padding:5px 8px;font:inherit}+input{font-family:ui-monospace,Menlo,monospace;width:110px}+button{cursor:pointer}+.sheet{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:20px;max-width:1300px}+.sheet div{cursor:pointer;font:12px ui-monospace,Menlo,monospace;color:#92969D}+.sheet svg{display:block;width:100%;height:auto}+#main svg{display:block;width:100%;max-width:630px;height:auto}+@keyframes slide{0%{transform:translateX(-60px)}100%{transform:translateX(220px)}}+</style></head><body>+<div class="row">+<input id="ver" value="0.58.1" aria-label="Version"/>+<button id="prev">← patch</button><button id="next">patch →</button>+<select id="theme"><option value="sd">Studio Dark</option><option value="sl">Studio Light</option><option value="eg">Ember Graphite</option><option value="ep">Ember Paper</option></select>+<label style="display:flex;gap:4px;align-items:center"><input type="checkbox" id="col" checked style="width:auto"/>colour</label>+<label style="display:flex;gap:4px;align-items:center"><input type="checkbox" id="grad" checked style="width:auto"/>gradients</label>+<span id="info"></span>+</div>+<div id="main"></div>+<div class="sheet" id="sheet"></div>+<script>+const LOGO='logo.png';+const SANS='Geist',MONO='Geist Mono';+const TH={+sd:{g:'#17181A',app:'#1E1F22',p:'#2B2D31',r:'#34363B',h:'#393C41',seam:'#141517',rule:'#45484E',grid:'#2E2F32',faint:'#82868C',ter:'#92969D',ink:'#D7D8DA',tp:'#E8E9EB',acc:'#FF9F1C',tr:['#7FB87A','#5FB3A8','#5AA6C4','#6A9FD8','#E0A84A','#9D90C9','#D77A8F','#B3B45E','#8E9DB0']},+sl:{g:'#D6D8DB',app:'#C9CBCF',p:'#E4E5E7',r:'#EEEFF1',h:'#F7F8F9',seam:'#9DA0A6',rule:'#B3B6BB',grid:'#C0C3C6',faint:'#797C81',ter:'#65696F',ink:'#252629',tp:'#16171A',acc:'#EF8A0C',tr:['#4A7F46','#3A8A7F','#357C99','#3F78B8','#B8862F','#7363A8','#B4566B','#7E7F2F','#5D6C80']},+eg:{g:'#100F0D',app:'#0B0A09',p:'#141310',r:'#1C1A16',h:'#252219',seam:'#0C0B09',rule:'#3A362D',grid:'#232019',faint:'#646054',ter:'#716D60',ink:'#D8D3C8',tp:'#E9E4D8',acc:'#D8A03D',tr:['#58B368','#4E9E7A','#3E8E8E','#5AA0B8','#C77F55','#7A6FB0','#B05A7A','#9AA64A','#7FA88E']},+ep:{g:'#E4DFD1',app:'#DCD6C5',p:'#EAE5D7',r:'#F8F5EC',h:'#E7E1D0',seam:'#E0DAC9',rule:'#BDB5A0',grid:'#DDD7C6',faint:'#8D866F',ter:'#7E786C',ink:'#332E26',tp:'#241F17',acc:'#AD7716',tr:['#328140','#306F53','#256464','#317187','#985127','#4B4082','#7F3450','#6C752C','#598C69']}};+function seedOf(s){let h=2166136261;for(const c of s){h^=c.charCodeAt(0);h=Math.imul(h,16777619)}h^=h>>>15;h=Math.imul(h,2246822507);h^=h>>>13;return h>>>0}+function rng(a){return()=>{a|=0;a=a+0x6D2B79F5|0;let t=Math.imul(a^a>>>15,1|a);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296}}+function mix(c,to,k){const a=parseInt(c.slice(1),16),b=parseInt(to.slice(1),16),f=(s)=>Math.round(((a>>s)&255)*(1-k)+((b>>s)&255)*k);return '#'+[16,8,0].map(s=>f(s).toString(16).padStart(2,'0')).join('')}+const pick=(r,a)=>a[Math.floor(r()*a.length)];+let D,GID,uid=0;+function lin(stops,x1=0,y1=0,x2=0,y2=1,units){const id=`g${GID}_${D.length}`;D.push(`<linearGradient id="${id}" x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}"${units?' gradientUnits="userSpaceOnUse"':''}>${stops.map(([o,c,a])=>`<stop offset="${o}" stop-color="${c}" stop-opacity="${a??1}"/>`).join('')}</linearGradient>`);return `url(#${id})`}+function rad(stops,cx=.5,cy=.5,r=.5,units){const id=`g${GID}_${D.length}`;D.push(`<radialGradient id="${id}" cx="${cx}" cy="${cy}" r="${r}"${units?' gradientUnits="userSpaceOnUse"':''}>${stops.map(([o,c,a])=>`<stop offset="${o}" stop-color="${c}" stop-opacity="${a??1}"/>`).join('')}</radialGradient>`);return `url(#${id})`}+const f1=v=>(+v).toFixed(1);+function R(x,y,w,h,f,s,sw=1){return `<rect x="${f1(x)}" y="${f1(y)}" width="${f1(Math.max(1,w))}" height="${f1(Math.max(1,h))}" fill="${f}"${s?` stroke="${s}" stroke-width="${sw}"`:''}/>`}+function L(x1,y1,x2,y2,c,w=1){return `<line x1="${f1(x1)}" y1="${f1(y1)}" x2="${f1(x2)}" y2="${f1(y2)}" stroke="${c}" stroke-width="${w}" stroke-linecap="round"/>`}+function PL(pts,c,fill,w=1){return `<polyline points="${pts.map(p=>p[0].toFixed(1)+','+p[1].toFixed(1)).join(' ')}" fill="${fill||'none'}" stroke="${c}" stroke-width="${w}" stroke-linejoin="round" stroke-linecap="round"/>`}+function playhead(b,x,T,w){return L(x,b.y+5,x,b.y+b.h,T.acc,Math.max(1.5,w*.75))+`<polygon points="${x-5},${b.y} ${x+5},${b.y} ${x},${b.y+6}" fill="${T.acc}"/>`}+const F={+roll(b,r,T,C){let o='';const steps=16*(1+Math.floor(r()*2)),sw=b.w/steps,rows=10+Math.floor(r()*12),rh=b.h/rows;+for(let s=0;s<=steps;s++)o+=L(b.x+s*sw,b.y,b.x+s*sw,b.y+b.h,s%4?T.grid:T.rule,s%16?1:C.w);+const voices=1+Math.floor(r()*3);+for(let v=0;v<voices;v++){const vc=C.pal[v%C.pal.length];let p=Math.floor(rows*(.25+r()*.5)),s=Math.floor(r()*4);+while(s<steps){const len=pick(r,[1,1,2,2,3,4]);if(r()<.78){const x=b.x+s*sw+1,w=len*sw-2,y=b.y+p*rh+1,vel=.35+r()*.65;+const fill=C.grad?lin([[0,vc,1],[1,vc,.25+.4*(1-vel)]],0,0,1,0):vc;o+=`<rect x="${f1(x)}" y="${f1(y)}" width="${f1(w)}" height="${f1(rh-2)}" rx="2" fill="${fill}" stroke="${mix(vc,'#000000',.35)}" stroke-width="1"/>`}+s+=len;p=Math.max(0,Math.min(rows-1,p+pick(r,[-2,-1,-1,0,1,1,2])))}}+o+=playhead(b,b.x+sw*Math.floor(steps*(.3+r()*.4)),T,C.w);return o},+rings(b,r,T,C){let o='';const cx=b.x+b.w*(.3+r()*.4),cy=b.y+b.h*(.3+r()*.4),k=3+Math.floor(r()*4),R0=Math.min(b.w,b.h)*.12,dr=(Math.max(b.w,b.h)*.6-R0)/k;let last=null;+const lw=Math.max(1.5,C.w),dot=3+lw;+if(C.grad)o+=`<circle cx="${cx}" cy="${cy}" r="${R0+(k-1)*dr}" fill="${rad([[0,C.pal[0],.35],[.6,C.pal[C.pal.length-1],.12],[1,T.g,0]])}"/>`;+for(let i=0;i<k;i++){const radius=R0+i*dr,n=pick(r,[8,12,16,5,7,9,13]),hits=1+Math.floor(r()*(n-1)),rot=r()*6.28,rc=C.pal[i%C.pal.length];+o+=`<circle cx="${cx}" cy="${cy}" r="${radius.toFixed(1)}" fill="none" stroke="${T.rule}" stroke-width="${lw}"/>`;+for(let j=0;j<n;j++){const on=Math.floor((j+1)*hits/n)!==Math.floor(j*hits/n),a=rot+j/n*6.283,x=cx+Math.cos(a)*radius,y=cy+Math.sin(a)*radius;+o+=on?`<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="${dot}" fill="${rc}"/>`:`<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="${lw}" fill="${T.h}"/>`;if(on&&i==k-1){o+=L(cx,cy,x,y,T.grid,lw*.7);last=[x,y]}}}+if(last)o+=L(cx,cy,last[0],last[1],T.acc,lw)+`<circle cx="${last[0].toFixed(1)}" cy="${last[1].toFixed(1)}" r="${dot+3}" fill="none" stroke="${T.acc}" stroke-width="${lw}"/>`;return o},+strata(b,r,T,C){let o='';const n=9+Math.floor(r()*10),gap=b.h/(n+3),fs=[1+r()*3,4+r()*6,9+r()*9],ph=[r()*6,r()*6,r()*6],c=b.x+b.w*(.3+r()*.4),wid=b.w*(.12+r()*.2);+const hero=new Map();C.pal.forEach((col,i)=>hero.set(Math.floor(n*(.35+.5*i/C.pal.length)),col));+const stroke=C.grad&&C.pal.length>1?lin(C.pal.map((p,i)=>[i/(C.pal.length-1),p]),b.x,0,b.x+b.w,0,true):null;+for(let i=0;i<n;i++){const y0=b.y+gap*(i+3);let pts=[];for(let x=0;x<=b.w;x+=2){const X=b.x+x,env=Math.exp(-Math.pow((X-c)/wid,2)),v=Math.sin(x/b.w*fs[0]*6.28+ph[0]+i*.4)*.5+Math.sin(x/b.w*fs[1]*6.28+ph[1]-i*.3)*.35+Math.sin(x/b.w*fs[2]*6.28+ph[2]+i)*.15;pts.push([X,y0-Math.abs(v)*env*gap*3.2])}+const poly=[[b.x,b.y+b.h],...pts,[b.x+b.w,b.y+b.h]],hc=hero.get(i);o+=PL(poly,'none',T.g);+if(C.grad&&hc)o+=PL(poly,'none',lin([[0,hc,.45],[.35,hc,0]]));+o+=PL(pts,hc?(stroke||hc):T.ter,null,hc?C.w*1.4:Math.max(1,C.w*.6))}+o+=playhead(b,c+wid*(r()-.5),T,C.w);return o},+faders(b,r,T,C){let o='';const n=8+Math.floor(r()*10),sw=b.w/n,fq=r()*3+.5,ph=r()*6,hot=Math.floor(r()*n),lw=Math.max(1,C.w*.8);+for(let i=0;i<n;i++){const x=b.x+sw*(i+.5),col=C.pal[Math.floor(i/n*C.pal.length)];o+=L(x,b.y+12,x,b.y+b.h-12,T.rule,lw);+const v=.5+.4*Math.sin(i/n*fq*6.28+ph)+.1*(r()-.5),y=b.y+12+(1-v)*(b.h-24),fw=Math.min(8,sw*.3);+o+=R(x-fw/2,y,fw,b.y+b.h-12-y,C.grad?lin([[0,col,1],[1,col,.15]]):col);+o+=R(x-Math.min(10,sw*.38),y-4,Math.min(20,sw*.76),8,T.h,T.seam)+L(x-Math.min(6,sw*.22),y,x+Math.min(6,sw*.22),y,i==hot?T.acc:T.ink,i==hot?2:lw)}return o},+panels(b,r,T,C){let o='';const tones=[T.g,T.p,T.r,T.h,T.app];let cells=[];+function split(x,y,w,h,d){if(d>4||w<40||h<30||(d>1&&r()<.25)){cells.push([x,y,w,h]);return}+if(w>h*1.2||(w>h*.8&&r()<.5)){const s=w*(.25+r()*.5);split(x,y,s,h,d+1);split(x+s,y,w-s,h,d+1)}else{const s=h*(.25+r()*.5);split(x,y,w,s,d+1);split(x,y+s,w,h-s,d+1)}}+split(b.x,b.y,b.w,b.h,0);const colored=new Set();const m=Math.max(1,Math.round(cells.length*C.amt*.5));while(colored.size<Math.min(m,cells.length))colored.add(Math.floor(r()*cells.length));+let accDone=false;+cells.forEach(([x,y,w,h],idx)=>{const col=colored.has(idx)?pick(r,C.pal):null;const dir=pick(r,[[0,0,0,1],[0,0,1,0],[0,1,1,0]]);+o+=R(x,y,w,h,col?(C.grad?lin([[0,col,1],[1,mix(col,T.g,.7),1]],...dir):col):pick(r,tones));const k=r(),ink=col?mix(col,'#000000',.35):T.rule;+if(k<.22){for(let q=x+4;q<x+w;q+=3+C.w*2)o+=L(q,y,q,y+h-1,ink,C.w*.8)}else if(k<.38){for(let q=y+5;q<y+h;q+=6)for(let p=x+5;p<x+w;p+=6)o+=`<circle cx="${p}" cy="${q}" r="${C.w*.6}" fill="${col?ink:T.ter}"/>`}+else if(k<.52){const ac=!accDone&&!col&&r()<.5;if(ac)accDone=true;o+=`<circle cx="${x+w/2}" cy="${y+h/2}" r="${Math.min(w,h)*.3}" fill="none" stroke="${ac?T.acc:col?ink:T.ink}" stroke-width="${C.w}"/>`}+o+=`<rect x="${f1(x+.5)}" y="${f1(y+.5)}" width="${f1(w-1)}" height="${f1(h-1)}" fill="none" stroke="${T.seam}" stroke-width="${Math.max(1,C.w*.75)}"/>`});return o},+lissa(b,r,T,C){let o='';for(let x=b.x+20;x<b.x+b.w;x+=20)o+=L(x,b.y,x,b.y+b.h,T.grid);for(let y=b.y+20;y<b.y+b.h;y+=20)o+=L(b.x,y,b.x+b.w,y,T.grid);+const a=pick(r,[1,2,3,3,4,5]),bb=pick(r,[2,3,4,5,7]),d=r()*3,cx=b.x+b.w/2,cy=b.y+b.h/2,ax=b.w*.4,ay=b.h*.38;let pts=[];+for(let t=0;t<=6.2832+.001;t+=.01)pts.push([cx+ax*Math.sin(a*t+d),cy+ay*Math.sin(bb*t)]);+const g1=C.grad?lin(C.pal.length>1?C.pal.map((p,i)=>[i/(C.pal.length-1),p]):[[0,C.pal[0]],[1,mix(C.pal[0],T.g,.6)]],b.x+b.w*.1,b.y,b.x+b.w*.9,b.y+b.h,true):C.pal[0];+o+=PL(pts.map(p=>[p[0],cy+(p[1]-cy)*.6]),C.pal[1]||T.rule,null,Math.max(1,C.w*.6))+PL(pts,g1,null,C.w*1.3);+const q=pts[Math.floor(r()*pts.length)];o+=`<circle cx="${q[0].toFixed(1)}" cy="${q[1].toFixed(1)}" r="${3+C.w}" fill="${T.acc}"/>`;return o}};+const PRIMARY=['roll','roll','rings','rings','strata','strata','faders','panels','panels','lissa','lissa'],OVER={panels:['rings','lissa'],strata:['rings'],faders:['strata'],roll:['rings']};+function palette(r,T){const b=Math.floor(r()*9),mode=pick(r,['analog','analog','pair','triad','mono']);+const idx=mode=='mono'?[b]:mode=='pair'?[b,(b+4)%9]:mode=='triad'?[b,(b+3)%9,(b+6)%9]:[b,(b+1)%9,(b+2)%9];return{mode,pal:idx.map(i=>T.tr[i])}}+const neutral=T=>[T.ter,T.ink,T.faint];+function art(ver,T,showText,colour,grad){const r=rng(seedOf(ver.trim()));const W=420,H=300,lay=pick(r,['left','right','bottom','left','bottom']);GID='u'+(uid++);D=[];+let A,Tx;if(lay=='left'){A={x:150,y:0,w:270,h:300};Tx={x:0,y:0,w:150,h:300}}else if(lay=='right'){A={x:0,y:0,w:270,h:300};Tx={x:270,y:0,w:150,h:300}}else{A={x:0,y:0,w:420,h:196};Tx={x:0,y:196,w:420,h:104}}+const fam=pick(r,PRIMARY);let ov=OVER[fam]&&r()<.35?pick(r,OVER[fam]):null;+const pr=palette(r,T),amt=.35+r()*.5,w=pick(r,[1.5,2,2,2.5,3]),wash=pick(r,['none','radial','linear','radial']),wx=r(),wy=r();+const C={pal:colour?pr.pal:neutral(T),amt,w,grad};+const Cov={...C,pal:[T.rule,T.ter],grad:false,w:Math.max(1,w*.6)};+let ground=R(0,0,W,H,T.g);+if(grad&&colour&&wash!='none')ground+=R(A.x,A.y,A.w,A.h,wash=='radial'?rad([[0,pr.pal[0],.28],[1,pr.pal[pr.pal.length-1],0]],wx,wy,.8):lin([[0,pr.pal[0],.22],[1,pr.pal[pr.pal.length-1],0]],wx,0,1-wx,1));+const body=F[fam](A,r,T,C),over=ov?F[ov](A,r,T,{...Cov}).replace(new RegExp(T.acc,'g'),T.ink):'';+let o=`<svg viewBox="0 0 ${W} ${H}" xmlns="http://www.w3.org/2000/svg"><defs>${D.join('')}<clipPath id="a${GID}"><rect x="${A.x}" y="${A.y}" width="${A.w}" height="${A.h}"/></clipPath><clipPath id="k${GID}"><rect width="420" height="300" rx="4"/></clipPath></defs><g clip-path="url(#k${GID})">`+R(0,0,W,H,T.g)+`<g clip-path="url(#a${GID})">`+ground+body+over+`</g>`;+o+=lay=='left'?L(150.5,0,150.5,300,T.seam):lay=='right'?L(269.5,0,269.5,300,T.seam):L(0,195.5,420,195.5,T.seam);+if(showText){let cx,cy;if(lay=='bottom'){cx=28;cy=226}else{cx=Tx.x+22;cy=110}+o+=`<image href="${LOGO}" x="${cx}" y="${cy}" width="28" height="28"/>`;+const tx=lay=='bottom'?cx+40:cx,ty=lay=='bottom'?cy+20:cy+58;+o+=`<text x="${tx}" y="${ty}" font-size="22" font-weight="600" fill="${T.tp}" font-family="${SANS}">Nota</text><text x="${tx}" y="${ty+18}" font-size="11" fill="${T.ter}" font-family="${MONO}">Version ${ver}</text>`;+const bx=tx,by=ty+30,bw=lay=='bottom'?160:106;o+=R(bx,by,bw,2,T.rule)+`<svg x="${bx}" y="${by}" width="${bw}" height="2"><rect width="50" height="2" fill="${T.acc}" style="animation:slide 1.4s linear infinite"/></svg>`}+o+=`<rect x=".5" y=".5" width="419" height="299" rx="4" fill="none" stroke="${T.seam}"/></g></svg>`;return{svg:o,fam,ov,lay,mode:pr.mode,w,wash}}+const $=id=>document.getElementById(id);+function bump(v,d){const m=v.trim().match(/^(\d+)\.(\d+)\.(\d+)$/);if(!m)return v;return `${m[1]}.${m[2]}.${Math.max(0,+m[3]+d)}`}+function draw(){const v=$('ver').value.trim()||'0.0.0',T=TH[$('theme').value],col=$('col').checked,gr=$('grad').checked;const a=art(v,T,true,col,gr);$('main').innerHTML=a.svg;$('info').textContent=`motif: ${a.fam}${a.ov?' + '+a.ov:''} · palette ${a.mode} · line ${a.w}px · wash ${a.wash} · text ${a.lay}`;+const m=v.match(/^(\d+)\.(\d+)\.(\d+)$/);let list=[];if(m){const mi=+m[2];for(let i=0;i<4;i++)list.push(`${m[1]}.${mi}.${+m[3]+i+1}`);for(let i=1;i<=12;i++)list.push(`${m[1]}.${mi+i}.0`)}+$('sheet').innerHTML=list.map(vv=>{const x=art(vv,T,false,col,gr);return `<div data-v="${vv}">${x.svg}<span>${vv} · ${x.fam}${x.ov?'+'+x.ov:''} · ${x.mode}</span></div>`}).join('');+$('sheet').querySelectorAll('div').forEach(d=>d.onclick=()=>{$('ver').value=d.dataset.v;draw();scrollTo(0,0)})}+$('ver').oninput=draw;$('theme').onchange=draw;$('col').onchange=draw;$('grad').onchange=draw;$('prev').onclick=()=>{$('ver').value=bump($('ver').value,-1);draw()};$('next').onclick=()=>{$('ver').value=bump($('ver').value,1);draw()};+draw();+</script></body></html>diff --git a/specs/074-release-splash-art/quickstart.md b/specs/074-release-splash-art/quickstart.mdnew file mode 100644index 00000000..152a12a8--- /dev/null+++ b/specs/074-release-splash-art/quickstart.md@@ -0,0 +1,66 @@+# Quickstart: validate per-release splash art++## Prerequisites++- The repository builds with `scripts/build.sh`. The engine is needed only for the full+ smoke run.+- The feature branch is checked out.++## 1. Smoke checks (determinism, variety, bans)++```bash+scripts/build.sh+```++The `-- design: splash art --` block must show PASS for:+- same version → equal scene, for each of 50 sampled versions (SC-001);+- consecutive patches over 0.60.0–0.79.9 → different family, and all 200 scenes distinct+ and non-empty (SC-002);+- every scene → at most one accent item, overlay neutral, coordinates within the card;+- composing one scene takes under 10 ms (median of 20) (SC-005 budget);+- non-semver, empty and pre-release versions → valid scenes, no exception (edge cases).++The `-- design: geometry --` block must still show "no gradients in views", plus the new+"gradients in Theme/ only in NotaPalette.cs and Theme/SplashArt/".++## 2. Review sheet (FR-012, SC-003)++```bash+dotnet run --project tests/Nota.SmokeTest -- --splash-sheet /tmp/splash-dark.html studio-dark 0.58.1 40+```++```bash+dotnet run --project tests/Nota.SmokeTest -- --splash-sheet /tmp/splash-light.html studio-light 0.58.1 40+```++Open both pages. Expected:+- the 40 cards fall into at least 5 visibly different structures;+- no card is empty;+- colours are track colours plus neutral greys, with at most one orange element;+- the families read like the reviewed prototype. Exact compositions differ, because the+ family is stepped by patch (research R4).++## 3. Real splash in all four themes (FR-007, FR-011, SC-004)++Use the headless harness recipe (Avalonia.Headless + Skia, `NotaThemeService.Set` by+reflection):+- construct `new SplashWindow()`, `Show()`, then `CaptureRenderedFrame()` for each theme:+ `studio-dark`, `studio-light`, `ember-graphite`, `ember-paper`;+- repeat at scale 2.++Expected:+- logo, "Nota", version and progress sit on the plain ground in the text region;+- the art is in its region, behind a 1px seam;+- the light themes give a light splash;+- lines are crisp at 2×.++## 4. Fallback (FR-010)++Temporarily make `Compose` throw (a local edit, not committed). Launch: the plain card+appears and the app starts normally.++## 5. Launch time (SC-005)++Compare launch → first splash paint against `develop` on the reference Mac (log a+timestamp in `App` before `splash.Show()` and in the splash's first `Render`). The+increase must be ≤ 50 ms.diff --git a/specs/074-release-splash-art/research.md b/specs/074-release-splash-art/research.mdnew file mode 100644index 00000000..080f27b7--- /dev/null+++ b/specs/074-release-splash-art/research.md@@ -0,0 +1,153 @@+# Research: Per-release splash art++Decisions taken while planning [spec.md](spec.md). Each entry gives the decision, why it+was chosen, and the alternatives considered.++The visual reference is the browser prototype reviewed with the maintainer on 2026-11-03,+kept as [`prototype.html`](prototype.html). Open it in a browser; the logo and Geist fonts+are missing there and fall back. Its generator is the behavioural reference for the C#+port: motif families, palettes, stroke weights, washes and layouts.++## R1 — Where the art code lives: `Theme/SplashArt/`++**Decision**: Put the composer and the renderer in `src/managed/Nota.App/Theme/SplashArt/`.++**Rationale**: `DesignTokenCheck.RunGeometry` bans `Linear|Radial|ConicGradientBrush` in+every `Nota.App` file outside `Theme/`. DESIGN.md rule 6 already keeps its one gradient+exception, `NotaPalette.PluginPreviewWash`, in `Theme/` ("It lives in `Theme/` like every+token; views still draw no gradients of their own"). The splash art is the second exception+of the same kind, so it lives in the same place. The ban on gradients in views stays intact.++A new check pins the exception down: inside `Theme/`, gradient brushes may appear only in+`NotaPalette.cs` and `Theme/SplashArt/`. Without it, any file dropped into `Theme/` could+use gradients.++**Alternatives**:+- Exempt `SplashWindow.cs` in the gradient check. Rejected: it widens a view-layer ban+ instead of keeping the exception with the tokens, and it breaks the precedent.+- Pre-render PNGs. Rejected: FR-003 forbids per-release assets.++## R2 — Composer and renderer are separate; the scene is theme-free++**Decision**: Split the work in two:+- `SplashArtComposer.Compose(string version)` is pure C#, with no Avalonia and no theme.+ It returns a `SplashScene`: the layout, plus primitives (rect, line, polyline, polygon,+ circle) whose paints refer to colour roles (`Ground`, `Rule`, `Track(i)`, `Accent`, ...).+ A role can be shaded toward black or the ground, and can carry an alpha.+- `SplashArtView : Control` resolves the roles against the live `NotaPalette` slots inside+ `Render` and draws the scene. Gradient brushes are built per render from the resolved+ colours.++**Rationale**:+- Determinism (FR-001, SC-001) can be tested on the scene itself, without a renderer. The+ smoke test links the composer file the way it already links other `Nota.App` sources+ (`<Compile Include="..\..\src\managed\Nota.App\…" Link=…>`).+- Theme changes only re-resolve colours. Reading `.Color` inside `Render` is the pattern+ DESIGN.md asks for, and `DesignTokenCheck` flags snapshotting brushes.+- The same scene feeds the review sheet (R6).++**Alternatives**: one class that draws as it rolls dice. Rejected: its output can't be+compared or exported without rendering.++## R3 — Seed and PRNG++**Decision**:+- The seed is FNV-1a (32-bit) over the UTF-16 code units of `AppInfo.Version`, which has+ `+metadata` already stripped, followed by a murmur-style finaliser.+- The PRNG is mulberry32. Both are hand-written, about 15 lines.+- Coordinates are rounded to 0.1 in the scene.++**Rationale**:+- `string.GetHashCode` is randomised per process, so it can't be the seed.+- `new Random(seed)` is stable today, but its algorithm is not a documented contract.+- mulberry32 matches the reviewed prototype, so a version gives the same composition in+ the prototype and in the app. That makes review easy.+- Rounding keeps scenes comparable and the SVG export small.+- `Math.Sin`/`Math.Exp` may differ by an ULP between CPU architectures. After rounding,+ differences are practically invisible, and SC-001 asks for identity on a given machine.++## R4 — Neighbouring versions must differ (FR-002, SC-002)++**Decision**: The primary motif family is no longer a free pick. It is+`family = (H(major.minor) + 5·patch) mod 6`, where `H` is the seed hash of `"major.minor"`+and 5 is coprime to 6. Every other choice is drawn from the full-version seed: palette,+stroke weight, wash, layout, motif parameters and the overlay. A pre-release suffix+changes those choices but keeps the release's family.++**Rationale**: With free picks, two consecutive patches share a family one time in six,+which reads as "the same picture again". Stepping by a number coprime to 6 guarantees that+consecutive patches change family. Minor bumps rehash, so they still vary freely. Their+palette, layout and weight almost always differ as well, which SC-002's distinct-scene+check covers.++**Alternatives**: reroll when the family equals the previous version's. Rejected: it can+still collide with an adjusted neighbour, and it is harder to reason about.++## R5 — Motif families, weights and colour, as approved++**Decision**: Port the reviewed prototype with these settings:++| Setting | Values |+|---|---|+| Families | `Roll`, `Rings`, `Strata`, `Panels`, `Lissajous`, `Faders`. Arrangement lanes are excluded (FR-005). |+| Overlay | Optional and quiet: neutral roles only, thinner stroke, never the accent. Allowed pairs: Panels→{Rings, Lissajous}, Strata→Rings, Faders→Strata, Roll→Rings. |+| Palette | Track colours by mode `mono / analog (i, i+1, i+2) / pair (i, i+4) / triad (i, i+3, i+6)` over `Track1..9` |+| Colour share | 0.35–0.85 |+| Stroke weight | {1.5, 2, 2.5, 3} px per version. Rings never go below 1.5. Seams between the art and the text stay 1px. |+| Wash | none / radial / linear, from the palette's first colour at ≤28% to transparent |+| Accent | Exactly one "live" element per primary family: playhead (Roll, Strata), current step (Rings), touched fader (Faders), a point on the curve (Lissajous), at most one ringed circle (Panels). Overlays never add one (FR-006). |++**Rationale**: These are the settings the maintainer accepted in review on 2026-11-03.++## R6 — Reviewing many versions without building them (FR-012)++**Decision**: Add a smoke-test mode, `--splash-sheet <out.html> [theme-id] [from] [count]`.+- It composes scenes for a range of versions and resolves roles from+ `Theme/Themes/<id>.json`. The default theme is Studio Dark.+- It writes one HTML page of inline SVGs, with the version, family and palette under each.++**Rationale**:+- It follows the existing `--palette-dump` and `--sample-dump` modes.+- It needs neither Avalonia rendering nor a display.+- The SVG writer only maps primitives one-to-one (about 60 lines). The app's renderer+ does the same mapping, so both draw from the same scene.++**Alternatives**: a `NOTA_SPLASH_VERSION` environment override in the app. Rejected as+the main tool: it shows one version per launch, for 650 ms. It may be added later for+manual checks, but is not needed.++## R7 — Text, layout and readability (FR-007)++**Decision**:+- The composer picks a layout: text left (art 270×300 on the right), text right, or text+ at the bottom (art 420×196 on top).+- `SplashWindow` places the existing logo, name, version and progress bar in the text+ region. That region is the plain `BgSunken` ground today's splash already uses.+- The art is clipped to its region, and a 1px `Seam` separates the two.++**Rationale**: The text keeps exactly today's ground and colours, so it passes the+readability bar in every theme without new contrast work (SC-004). The art never sits+under text.++## R8 — Failure and timing (FR-008, FR-010, SC-005)++**Decision**:+- `SplashWindow` composes synchronously in its constructor, inside `try/catch`. On any+ exception it builds today's plain card.+- The smoke test asserts that composing one scene takes under 10 ms (median of 20).+ Rendering is a few hundred to about 3,000 primitives, drawn once.++**Rationale**: Composition is cheap: the largest family, Strata, is about 20 polylines of+135 points. The splash then paints on its first frame with the art in place.++## R9 — Documentation++**Decision**:+- DESIGN.md rule 6 gets a second named exception, the splash art, next to the plug-in+ preview wash. The "Enforced by tests" section names the new check.+- CHANGELOG `[Unreleased]` gets an *Added* line.+- `nota-features` updates FEATURES.md.+- `nota-docs` checks whether the manual shows the splash. If it does, the screenshot is+ re-shot.++No new strings: the motif names are not shown in the app.diff --git a/specs/074-release-splash-art/spec.md b/specs/074-release-splash-art/spec.mdnew file mode 100644index 00000000..d554080a--- /dev/null+++ b/specs/074-release-splash-art/spec.md@@ -0,0 +1,175 @@+# Feature Specification: Per-release splash art++**Feature Branch**: `074-release-splash-art`++**Created**: 2026-11-03++**Status**: Draft++**Input**: User description: "Per-release splash screen art. Each Nota release shows its own abstract image on the launch splash screen (SplashWindow), generated procedurally in the app with the release version as the seed — no image assets, no manual step at release time. The same version always yields the same image; a different version yields a visibly different one. The art must sit inside Nota's "Studio" design language (neutral greys, dark 1px seams, the single orange accent used sparingly, the colour themes) while being genuinely creative — not a generic gradient. The existing splash content (logo, name, version, indeterminate progress) stays readable on top of it. No GitHub issue: the core maintainer waived it for this feature."++**Issue**: none — waived by the core maintainer for this feature (constitution § 0).++## 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+- [ ] Managed app (C#, `src/managed/*`) — domain, application, infrastructure, presentation+- [x] UI (Avalonia, `src/managed/Nota.Presentation`) — follow `DESIGN.md` (Studio)+- [ ] Plugin hosting (`pluginhost/`) — the only place JUCE is allowed+- [ ] Build / packaging / CI (`scripts/`, `.github/`) — see `BUILD.md`+- [ ] Docs only++The splash is `src/managed/Nota.App/SplashWindow.cs`, shown by+`App.OnFrameworkInitializationCompleted` for at least 650 ms while the engine starts.++**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).++## User Scenarios & Testing *(mandatory)*++### User Story 1 - Each release greets you with its own picture (Priority: P1)++A musician updates Nota and launches it. The splash shows an abstract composition they+have not seen before. Every launch of that version shows the same composition, so the+picture becomes the face of that release. When they next update, the picture changes.++**Why this priority**: This is the feature. Without it nothing else matters.++**Independent Test**: Launch builds with two different versions and the same version+twice; capture the splash each time. The same-version captures are identical; the+different-version captures are clearly different.++**Acceptance Scenarios**:++1. **Given** Nota version A, **When** it is launched twice (any machine, any day), **Then** the splash art is identical both times.+2. **Given** versions A and B that differ in any part of MAJOR.MINOR.PATCH (including a patch bump), **When** each is launched, **Then** the two compositions are visibly different at a glance, not just shifted or re-tinted.+3. **Given** a release is being cut, **When** the maintainer follows the release process, **Then** no step concerns the splash art. The new version number alone produces the new picture.++---++### User Story 2 - The art looks like Nota, and it looks deliberate (Priority: P1)++The art is built from Studio's vocabulary (tone planes, seams and rules, crisp geometry)+and from motifs taken from the work of making music: a piano roll, Euclidean rhythm rings,+stacked waveform strata, a partition into panels, a Lissajous figure, and fader rails. The+splash is the one place that also allows soft gradients and heavier strokes. Each version+arranges these into one composed image. It does not read as a stock gradient, random noise+or a screensaver.++**Why this priority**: The maintainer asked for it explicitly. Art that breaks the design+language or looks generic is worse than the current plain splash.++**Independent Test**: Render the art for a set of versions (e.g. the 20 most recent+release numbers plus 20 future ones) as a contact sheet. Review it against DESIGN.md and+for variety.++**Acceptance Scenarios**:++1. **Given** any version, **When** the art is rendered, **Then** every colour comes from the active theme's tokens, and it contains no glow, blur, raster textures or photographic imagery. Gradients and strokes heavier than 1px are allowed (FR-004).+2. **Given** any version, **When** the art is rendered, **Then** its colours are the theme's neutral tones plus that version's track-colour palette, with at most one "live" accent element and no semantic colours (FR-006).+3. **Given** a contact sheet of 40 versions, **When** reviewed, **Then** the compositions show real variety (different motif families, structures and densities), not one template with different random numbers.++---++### User Story 3 - The splash still does its job (Priority: P2)++The logo, the name "Nota", the version line and the indeterminate progress bar stay+legible on top of the art in every theme. The splash appears just as quickly as it does now.++**Why this priority**: The splash exists to show that the app is starting. Art must not+cost readability or launch time.++**Independent Test**: Capture the splash for several versions in each of the four+built-in themes. Check text contrast and measure the time from launch to the first+painted splash against the current build.++**Acceptance Scenarios**:++1. **Given** any version and any built-in theme, **When** the splash shows, **Then** the name and version text meet the theme's readability bar for text on its ground.+2. **Given** the app launches, **When** the splash first paints, **Then** the art is already drawn (no blank frame first, no art popping in later) and launch-to-first-paint is no slower than today by any noticeable amount.+3. **Given** the user's active theme is Studio Light (or any other built-in theme), **When** the splash shows, **Then** the art is drawn in that theme's values. A light theme gets a light splash.++---++### Edge Cases++- **Version string with a suffix or build metadata** (`0.71.0-beta.1`, `+commit`): the art depends only on the release number shown on the splash, so builds of the same release look alike. A pre-release counts as its own version.+- **Version unreadable** (falls back to `0.0.0`): the splash still shows a valid composition for that fallback seed and never fails or shows a blank card.+- **Art generation fails for any reason**: the splash falls back to today's plain card. A launch is never blocked by the art.+- **High-DPI or scaled displays**: lines stay crisp at 1 device-independent pixel; nothing blurs from bitmap scaling.+- **Theme change while the splash is up**: not supported, because the splash closes before Preferences can be opened.+- **Consecutive patch releases** (0.70.1 → 0.70.2): must still look different (Scenario 1.2). Seeding is not allowed to cluster nearby numbers.++## Requirements *(mandatory)*++### Functional Requirements++- **FR-001**: The splash MUST show an abstract composition derived only from the app's release version. The same version MUST give the same composition on every machine, OS, run and date.+- **FR-002**: Two different versions MUST give visibly different compositions, including versions one patch apart.+- **FR-003**: The art MUST be produced at launch from code. No per-release image files, and no step added to the release process.+- **FR-004**: The art MUST take every colour from the active colour theme's tokens, with no hard-coded colours. As a documented splash-only exception to DESIGN.md rule 6:+ - the art MAY use linear and radial gradients between those token colours, including fades to transparent (washes behind a motif, note velocity fades, level fills, gradient strokes);+ - the art MAY use strokes heavier than 1px, and each version picks its stroke weight (about 1.5–3px).+ The art MUST NOT use glow, blur, drop shadows, raster textures or photographic imagery. Seams between the art and the text area stay 1px.+- **FR-005**: The art MUST choose, per version, one primary motif family from: piano roll, rhythm rings, waveform strata, panels, Lissajous figure, fader rails. It MAY add a secondary, quieter family on top. Arrangement-style clip lanes are excluded. The version MUST choose the structure, not only parameters, so releases differ in character as well as in detail.+- **FR-006**: Colour in the art follows Studio's "the work carries the colour":+ - The art MAY colour its "work" elements (clips, notes, waveforms, rhythm hits, level fills, panels) with the active theme's nine track colours, drawn the way the app draws them. A clip, for example, gets a track-colour body and a title band 30% toward black.+ - Each version MUST pick a small palette from those track colours: one colour, an adjacent pair or trio, a complementary pair, or a triad. The share of coloured elements MUST vary, so palette and colour amount differ between releases along with structure.+ - The orange accent MAY appear at most once in the art, and only as something "live" in Nota's sense: a playhead, the current step, the fader being touched (DESIGN.md rule 1).+ - Semantic colours (mute, solo, record, danger, success, warning) MUST NOT be used.+ - The neutral tones carry the chrome of the art: grounds, seams, rules and grids.+- **FR-007**: The existing splash content (logo, "Nota", version line, indeterminate progress) MUST stay, in the same order. The name and version MUST meet the active theme's readability bar against what lies behind them.+- **FR-008**: The art MUST be fully drawn on the splash's first paint and MUST NOT measurably delay launch-to-first-paint.+- **FR-009**: The art MUST be static: no animation. The indeterminate progress bar is the only moving element.+- **FR-010**: If the art cannot be produced, the splash MUST fall back to the current plain card without delaying or failing the launch.+- **FR-011**: The art MUST render crisply at any display scale.+- **FR-012**: Developers MUST be able to render the art for any given version without building or launching that version, so it can be reviewed and tested.++### Key Entities++- **Release seed**: the MAJOR.MINOR.PATCH(-pre-release) version shown on the splash. It is the only input besides the theme.+- **Composition**: what one seed produces — a chosen structure, a set of motifs and their placement, rendered in the theme's tokens.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: For the same version, 100% of renders are pixel-identical in a given theme at a given scale.+- **SC-002**: Across 200 consecutive patch versions (e.g. 0.60.0 to 0.79.9), no two compositions are judged the same or near-same by an automated visual-difference check, and none of them is empty.+- **SC-003**: In a contact sheet of 40 versions, a reviewer can find at least 5 clearly different structural families.+- **SC-004**: The name and version text pass the theme readability bar in all four built-in themes for every version in the SC-002 range.+- **SC-005**: Launch-to-first-painted-splash grows by no more than 50 ms over the current build on the reference Mac.+- **SC-006**: Releasing a new version takes no extra action for the splash. The maintainer's release checklist is unchanged.++## Assumptions++- "Release version" means the app version on the splash (`AppInfo.Version`, from the `VERSION` file). Local dev builds of an unreleased version show the art that version will ship with, which serves as a preview.+- The splash keeps its current size (420 × 300) and its 4px modal corner. The art fills the card behind the content, which may be moved within the card (for example to one side or onto a calm area of the art) as long as FR-007 holds.+- DESIGN.md applies to the splash except where FR-004 relaxes rule 6 (gradients, heavier strokes). The exception is written into DESIGN.md, next to the existing plug-in preview wash exception, so it stays the only one.++## Clarifications++### Session 2026-11-03++- Q: How should the art use the orange accent, given DESIGN.md rule 1? → A: First answer: not at all, strictly neutral. Revised the same day after the maintainer reviewed the neutral prototype and asked for more colour (see next question).+- Q: May the art use gradients and strokes heavier than 1px, given DESIGN.md rule 6? → A: Yes, as a splash-only exception documented in DESIGN.md (FR-004).+- Q: Which motif families stay after reviewing the prototype? → A: Piano roll, rhythm rings (with heavier lines), waveform strata, panels and Lissajous are approved. Arrangement lanes are dropped. Fader rails stay too (confirmed by the maintainer) (FR-005).+- Q: Which colours may the art use? → A: The theme's track colours as "the work", using a per-version palette, plus at most one accent element that reads as live (a playhead, the current step). No semantic colours (FR-006).+- No new third-party dependency is needed. The art is drawn with the UI toolkit already in use.+- The About window and other surfaces are out of scope. The art may be reused there later.+- The seed must not depend on the runtime's per-process string hashing, which differs between runs.++## Nota Compliance Checklist *(review before implementation; re-check in tasks.md)*++- [ ] Every new source file will carry the AGPL-3.0-only SPDX header (two lines, see CONTRIBUTING.md)+- [x] No new dependency — or: license checked, AGPL-compatible, `LICENSES/third-party.md` row planned+- [x] Audio-thread impact considered: no alloc / lock / I/O on the audio thread (AR-6), command queue for data in (AR-4), immutable snapshots for structural edits (AR-5) — UI thread only, before the engine starts+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/` — no crossing+- [ ] Smoke-test impact assessed: engine behaviour change → extend `tests/Nota.SmokeTest` — no engine change; determinism and token use are worth a smoke check (FR-001, FR-004)+- [ ] User-visible change → `CHANGELOG.md` `[Unreleased]` entry planned (and FEATURES.md / user docs via the nota-features / nota-docs skills when working with an agent that has them)+- [ ] UI change → follows `DESIGN.md` (Studio design language)diff --git a/specs/074-release-splash-art/tasks.md b/specs/074-release-splash-art/tasks.mdnew file mode 100644index 00000000..4558a1eb--- /dev/null+++ b/specs/074-release-splash-art/tasks.md@@ -0,0 +1,275 @@+---++description: "Task list for per-release splash art"+---++# Tasks: Per-release splash art++**Input**: Design documents from `/specs/074-release-splash-art/`++**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [contracts/splash-art.md](contracts/splash-art.md), [quickstart.md](quickstart.md)++**Reference**: [prototype.html](prototype.html) is the reviewed generator, written in JS. Port its family functions (`F.roll`, `F.rings`, `F.strata`, `F.panels`, `F.lissa`, `F.faders`), plus `palette`, `art` and the helpers, to C#. Follow the decisions in research R3–R5 where they differ from the prototype, for example the family step.++**Tests**: Included. The spec's success criteria (SC-001–SC-005) and quickstart §1 are smoke-test checks.++**Organization**: Tasks are grouped by user story so each story can be implemented and tested on its own.++## Format: `[ID] [P?] [Story] Description`++- **[P]**: Can run in parallel (different files, no dependencies)+- **[Story]**: Which user story the task belongs to (US1, US2, US3)++## Path Conventions++- App: `src/managed/Nota.App/` (new code in `Theme/SplashArt/`)+- Tests: `tests/Nota.SmokeTest/`++---++## Phase 1: Setup++**Purpose**: Branch and folder.++- [X] T001 Create branch `074-release-splash-art` from `develop`. The uncommitted 073 work in the current `feat/section-rearrange` checkout stays there: use a separate worktree, or ask the user before stashing. Carry over the untracked `specs/074-release-splash-art/` folder.+- [X] T002 Create the folder `src/managed/Nota.App/Theme/SplashArt/`++---++## Phase 2: Foundational (blocking prerequisites)++**Purpose**: The scene model, seed and PRNG, and the test wiring that every story builds on.++**⚠️ CRITICAL**: No user story work can begin until this phase is complete.++- [X] T003 [P] Create `src/managed/Nota.App/Theme/SplashArt/SplashScene.cs`. It holds Avalonia-free records and enums from [data-model.md](data-model.md):+ - `SplashScene` with `Version`, `Layout`, `ArtRect`, `TextRect`, `Family`, `Overlay`, `PaletteMode`, `Palette`, `StrokeWeight`, `Wash`, `Items`;+ - `SplashLayout { TextLeft, TextRight, TextBottom }`;+ - `SplashFamily { Roll, Rings, Strata, Panels, Lissajous, Faders }`;+ - `PaletteMode { Mono, Analog, Pair, Triad }`;+ - `WashKind { None, Radial, Linear }`;+ - the `Prim` kinds `Rect`, `Line`, `Polyline`, `Polygon`, `Circle`;+ - `Paint` as `Solid`, `Linear` or `Radial`, with stops and a `Bounds`/`Art` space;+ - `ColorRef` with `Role`, `TrackIndex` (0–8), `TowardBlack` (0..1), `TowardGround` (0..1) and `Alpha` (0..1);+ - `Role { Ground, App, Panel, Raised, Hover, Seam, Rule, Grid, Faint, Tertiary, Ink, Accent, Track }`. Semantic roles must not exist.++ Use a plain rect struct rather than `Avalonia.Rect`. Use value equality, so scenes compare structurally. Store point lists as arrays wrapped for sequence equality.+- [X] T004 [P] Create `src/managed/Nota.App/Theme/SplashArt/SplashArtComposer.cs` with the seed and PRNG only (research R3):+ - FNV-1a 32-bit over the UTF-16 code units, then the finaliser (`h^=h>>>15; h*=2246822507; h^=h>>>13`);+ - `ReleaseSeed` parsing `Full`, `Line` (hash of `"major.minor"`) and `Patch`. A non-semver string gives `Line = Full` and `Patch = 0`, and parsing never throws;+ - a `Mulberry32` struct with `NextDouble()` and `Pick<T>(T[])`;+ - a helper that rounds coordinates to 0.1.++ Port the arithmetic so that unchecked `uint` math matches the prototype's `Math.imul` and `>>>`.+- [X] T005 Link `SplashScene.cs` and `SplashArtComposer.cs` into the smoke test with `<Compile Include="..\..\src\managed\Nota.App\Theme\SplashArt\SplashScene.cs" Link=…/>`. Do the same for the composer, in `tests/Nota.SmokeTest/Nota.SmokeTest.csproj` (depends on T003, T004).+- [X] T006 Create `tests/Nota.SmokeTest/SplashArtTests.cs` with an empty `Run()` that yields `(bool, string)`, and print it from `tests/Nota.SmokeTest/Program.cs` under `-- design: splash art --` next to the other design blocks (depends on T005).+- [X] T007 [P] In `SplashArtTests.cs`, add a seed check: FNV and mulberry32 outputs for `"0.58.1"` equal the values the prototype's `seedOf`/`rng` produce. Record the first three doubles as constants, taken by running `prototype.html`'s functions in a browser console.++**Checkpoint**: The scene model compiles in both projects and the seed matches the prototype.++---++## Phase 3: User Story 1 — Each release greets you with its own picture (Priority: P1) 🎯 MVP++**Goal**: The splash shows a deterministic, version-specific composition from the six motif families. In this story it is drawn in neutral roles only, with solid fills.++**Independent Test**: Launch, or render headless, with two versions and with the same version twice. Same version gives identical output, different versions give visibly different compositions. The smoke checks below pass.++### Tests for User Story 1++- [X] T008 [P] [US1] In `tests/Nota.SmokeTest/SplashArtTests.cs`, add determinism: for 50 sampled versions, `Compose(v) == Compose(v)` (SC-001).+- [X] T009 [P] [US1] In `tests/Nota.SmokeTest/SplashArtTests.cs`, add variety: over 0.60.0–0.79.9 (200 versions),+ - consecutive patches have different `Family`;+ - all 200 scenes are pairwise distinct;+ - every `Items` is non-empty (SC-002).+- [X] T010 [P] [US1] In `tests/Nota.SmokeTest/SplashArtTests.cs`, add edge versions: `""`, `"0.0.0"`, `"abc"`, `"0.71.0-beta.1"` and `"1.2.3+deadbeef"` each give a valid non-empty scene, with no exception.+ - `"0.71.0-beta.1"` has the same `Family` as `"0.71.0"`.+ - Every coordinate is finite and within one card size of the 420×300 card. Motifs may+ overrun the art region on purpose, and the renderer clips them.++### Implementation for User Story 1++- [X] T011 [US1] In `SplashArtComposer.cs`, implement `Compose(string version)`. It must be pure, total and deterministic.+ - Layout uses the prototype's pick over `[TextLeft, TextRight, TextBottom, TextLeft, TextBottom]`, with rects from data-model.md: `TextLeft` gives text 0,0,150,300 and art 150,0,270,300; `TextRight` is mirrored; `TextBottom` gives art 0,0,420,196 and text 0,196,420,104.+ - `Family = (Line + 5·Patch) mod 6` (research R4).+ - Optional overlay at 35% from the allowed pairs Panels→{Rings, Lissajous}, Strata→Rings, Faders→Strata, Roll→Rings. The overlay is drawn in neutral roles with a thinner stroke.++ Wrap the body so any exception still returns a minimal valid scene, for example `Panels` in neutral roles.+- [X] T012 [US1] In `SplashArtComposer.cs`, port the `Roll` and `Rings` families from `prototype.html` as primitive emitters. Use neutral roles in place of the palette for now. Roll is a step grid with a bar line every 16 steps, plus 1–3 voices of note bars (rx 2) as a random walk. Rings are Euclidean rings with hits and rests.+- [X] T013 [US1] In `SplashArtComposer.cs`, port the `Strata` family: 9–18 stacked lines, each a sum of three sines under a Gaussian envelope. Each layer occludes the one below by filling to the bottom with `Ground`.+- [X] T014 [US1] In `SplashArtComposer.cs`, port the `Panels` family (recursive split, depth ≤ 4, with hatch, dot grid or circle fills and seam outlines) and the `Lissajous` family (20px grid, a:b from {1,2,3,3,4,5}×{2,3,4,5,7}, and a flattened echo curve).+- [X] T015 [US1] In `SplashArtComposer.cs`, port the `Faders` family: 8–17 rails with ticks, a level fill under each cap, and caps on a sine.+- [X] T016 [US1] Create `src/managed/Nota.App/Theme/SplashArt/SplashArtView.cs`, a `Control` sized 420×300. Its `Render` does the following:+ - clips to the card with the same corner radius `SplashWindow` uses today (`NotaRadius.Body`);+ - fills `Ground`;+ - pushes a clip to `scene.ArtRect` and draws `Items` in order;+ - draws a 1px `Seam` line on the art/text boundary and the 1px card border.++ Resolve each `ColorRef` from the live `NotaPalette` slots (`.Color`) inside `Render`, applying `TowardBlack`/`TowardGround` mixes and `Alpha`. Never cache colours in fields. Polylines and polygons use `StreamGeometry`, lines use round caps and polylines round joins. Only `Solid` paints are needed in this story.+- [X] T017 [US1] Edit `src/managed/Nota.App/SplashWindow.cs`:+ - compose from `AppInfo.Version`;+ - put a `Panel` in the card with a `SplashArtView` underneath;+ - place the existing logo, name, version and progress `StackPanel` in `scene.TextRect`. For `TextBottom`, lay it out as a row: logo, then a column with the name, version and bar.++ Keep the existing strings (`Loc.T("Nota")`, `Loc.F("Version {0}", …)`) and sizes. Update the file's header comment to say the card carries the release's art.++**Checkpoint**: The splash shows a per-version neutral composition. The T008–T010 checks pass.++---++## Phase 4: User Story 2 — The art looks like Nota, and it looks deliberate (Priority: P1)++**Goal**: Track-colour palettes, one live accent, gradients and per-version stroke weights, under a documented DESIGN.md exception enforced by test. A contact sheet supports review.++**Independent Test**: Run `--splash-sheet` for 40 versions in Studio Dark and Studio Light. Expected: at least 5 distinct structures, track colours plus greys, at most one orange element per card, and gradients present. The geometry and bans checks pass.++### Tests for User Story 2++- [X] T018 [P] [US2] In `tests/Nota.SmokeTest/SplashArtTests.cs`, add colour invariants for all 200 versions:+ - at most one live mark paints with `Role.Accent` (≤ 2 items: a playhead's line and head);+ - overlay items use only `Ground`, `App`, `Panel`, `Raised`, `Hover`, `Seam`, `Rule`, `Grid`, `Faint`, `Tertiary` or `Ink`;+ - `Palette` has 1–3 indices in 0–8, matching `PaletteMode`: Mono 1, Analog and Triad 3, Pair 2;+ - `StrokeWeight ∈ {1.5, 2, 2.5, 3}`.+- [X] T019 [P] [US2] In `tests/Nota.SmokeTest/DesignTokenCheck.cs` (`RunGeometry`), add the check "gradients in Theme/ only in NotaPalette.cs and Theme/SplashArt/". It scans `Theme/**/*.cs` for `(Linear|Radial|Conic)GradientBrush`. The existing "no gradients in views" check stays as it is.++### Implementation for User Story 2++- [X] T020 [US2] In `SplashArtComposer.cs`, add the palette (research R5):+ - base `i` in 0–8;+ - mode from `[Analog, Analog, Pair, Triad, Mono]`, with indices Mono `[i]`, Analog `[i, i+1, i+2]`, Pair `[i, i+4]`, Triad `[i, i+3, i+6]`, all mod 9;+ - colour share 0.35–0.85;+ - stroke weight from `[1.5, 2, 2, 2.5, 3]`;+ - wash from `[None, Radial, Linear, Radial]` with a focus point.++ Thread these through every family as `C.pal`, `C.amt` and `C.w`, the way the second prototype version does: Roll voices take palette colours, Rings colour per ring, Strata colour hero lines, Panels colour about `amt·0.5` of the cells, Lissajous colours its curves, and Faders colour the level fills.+- [X] T021 [US2] In `SplashArtComposer.cs`, add exactly one live accent per primary family: the playhead line plus a triangle head (Roll, Strata), the current step's spoke plus a ring (Rings), the touched fader's cap line (Faders), a point on the curve (Lissajous), and at most one accent circle (Panels). Overlays never emit `Accent`.+- [X] T022 [US2] In `SplashArtComposer.cs`, emit gradient paints:+ - Roll note velocity fade, horizontal from colour to alpha 0.25–0.65;+ - Rings centre disc, radial from palette first at 0.35 to transparent;+ - Strata hero-layer underglow, vertical from alpha 0.45 to 0 over 35%;+ - Strata hero stroke, horizontal across the palette in `Art` space;+ - Panels coloured cells, from colour to `TowardGround` 0.7, vertical, horizontal or diagonal;+ - Lissajous main curve across the palette in `Art` space;+ - Faders level fill, from colour to alpha 0.15;+ - the wash rect behind the art, from palette first at ≤ 0.28 to the last palette colour at 0.+- [X] T023 [US2] In `src/managed/Nota.App/Theme/SplashArt/SplashArtView.cs`, render `Linear`/`Radial` paints as `LinearGradientBrush`/`RadialGradientBrush`, built inside `Render` from the resolved colours. Map `Bounds` space to relative units and `Art` space to absolute card coordinates. Stroke widths come from the primitives. Brushes are never stored in static fields, because they would snapshot theme colours.+- [X] T024 [US2] Add the review-sheet writer to `tests/Nota.SmokeTest/SplashArtTests.cs` (contract §3):+ - `WriteSheet(outPath, themeId, fromVersion, count)` resolves roles from `src/managed/Nota.App/Theme/Themes/<themeId>.json`, using the same role→token map as `SplashArtView`;+ - it writes one standalone HTML page with an inline SVG per version (420×300, gradients as `<linearGradient>`/`<radialGradient>`, ids unique per card) and a caption `version · family[+overlay] · mode`;+ - the version list is the next 4 patches, then successive minors `.0`, with 40 versions by default.++ Wire `--splash-sheet <out.html> [theme-id] [from] [count]` into `tests/Nota.SmokeTest/Program.cs` next to `--palette-dump`. It exits 1 on an unknown theme or an unwritable path.+- [X] T025 [US2] In `DESIGN.md` rule 6, add a second exception after the plug-in wash paragraph. It says the launch splash's art (`Theme/SplashArt/`, specs/074) may use gradients between theme tokens, including fades to transparent, and strokes heavier than 1px. It is still drawn only from tokens, and has no glow, blur or shadow. In § Enforced by tests, name the new gradient-location check.++**Checkpoint**: The sheet shows coloured, gradient-bearing, varied compositions in both Studio themes. The T018–T019 checks pass.++---++## Phase 5: User Story 3 — The splash still does its job (Priority: P2)++**Goal**: The text stays readable, the art never blocks or slows launch, and the art renders crisply at any scale.++**Independent Test**: Run a headless capture in four themes at 1× and 2× (quickstart §3), a forced-failure launch (§4) and the timing check (§1, §5).++### Tests for User Story 3++- [X] T026 [P] [US3] In `tests/Nota.SmokeTest/SplashArtTests.cs`, add timing: the median of 20 `Compose` calls over different versions is under 10 ms (research R8, SC-005 budget).++### Implementation for User Story 3++- [X] T027 [US3] In `src/managed/Nota.App/SplashWindow.cs`, wrap compose and view creation in `try/catch`. On failure, build today's plain card exactly as before, so launch is never blocked (FR-010).+- [X] T028 [US3] Verify readability and crispness with a throwaway headless harness outside the repository (Avalonia.Headless + Skia, `NotaThemeService.Set` via reflection). Capture `new SplashWindow()` for `studio-dark`, `studio-light`, `ember-graphite` and `ember-paper`, at scale 1 and 2, for 3 versions. Confirm:+ - the text sits on the plain ground;+ - the art is in its region behind a 1px seam;+ - the light themes give a light splash;+ - nothing is blurred.++ Save the captures for the PR's screenshots.+- [X] T029 [US3] Measure launch-to-first-splash-paint against `develop` (quickstart §5, temporary timestamps, not committed). Record the result in the PR. The increase must be ≤ 50 ms.+ - Measured headless on 2026-11-03, on a loaded machine: `new SplashWindow()` → first rendered frame.+ - Art card: cold 237 ms, warm median 4.0 ms. Plain card (the `develop` card, via a forced fallback): cold 201–207 ms, warm median 3.2–3.4 ms.+ - Increase: about 30–36 ms cold and under 1 ms warm, within 50 ms.+ - Not yet measured on a real GUI launch on the reference Mac.++**Checkpoint**: All three stories work. The splash is readable, fast, and safe on failure.++---++## Phase 6: Polish & Cross-Cutting Concerns++- [X] T030 [P] Generate review sheets for Studio Dark and Studio Light (`--splash-sheet`, 40 versions from the current `VERSION`). Check SC-003 (≥ 5 distinct structures) and attach the sheets or their screenshots to the PR.+- [ ] T031 Run every quickstart.md check, §1–§5.++### Nota closing tasks *(PR gates)*++- [ ] T032 Run `scripts/build.sh` until native + managed + smoke test are green+- [X] T033 Add the AGPL-3.0-only SPDX two-line header to `SplashScene.cs`, `SplashArtComposer.cs`, `SplashArtView.cs` and `SplashArtTests.cs` (CONTRIBUTING.md)+- [X] T034 New dependency: N/A. Avalonia drawing APIs are already in use.+- [X] T035 Add a `CHANGELOG.md` `[Unreleased]` *Added* entry: every release now opens with its own splash art, generated from its version number.+- [X] T036 Update FEATURES.md via the `nota-features` skill. Run the `nota-docs` skill to check whether the user manual shows the splash, and re-shoot it if so. Shortcuts: N/A.+- [X] T037 Engine behaviour change: N/A. The smoke test is extended for the managed composer (T007–T010, T018–T019, T026).++---++## Dependencies & Execution Order++### Phase Dependencies++- **Setup (Phase 1)** comes first.+- **Foundational (Phase 2)** follows Setup and blocks every story.+- **US1 (Phase 3)** follows Foundational. It is the MVP.+- **US2 (Phase 4)** follows US1: it extends the composer and view that US1 creates.+- **US3 (Phase 5)**: T026 can start after Foundational. T027–T029 need US1's `SplashWindow` change, and T028's captures are most useful after US2.+- **Polish (Phase 6)** comes after all stories.++### Within stories++- The test tasks (T008–T010, T018–T019, T026) are written first and fail until their implementation lands.+- T011 → T012 → T013 → T014 → T015 all edit `SplashArtComposer.cs`, so they run sequentially.+- T016 (view) can run in parallel with T012–T015 once T011 has defined the scene's shape. T017 needs T016.+- T020 → T021 → T022 run sequentially (same file). T023 needs T022's paint shapes. T024 needs T022. T025 is independent.++### Parallel Opportunities++- T003 ∥ T004+- T008 ∥ T009 ∥ T010 (same file but independent methods; merge carefully)+- T016 ∥ T012–T015+- T018 ∥ T019 ∥ T025+- T030 ∥ T033 ∥ T035++## Parallel Example: User Story 2++```bash+Task: "T019 gradient-location check in tests/Nota.SmokeTest/DesignTokenCheck.cs"+Task: "T025 DESIGN.md rule 6 splash exception"+Task: "T018 colour invariants in tests/Nota.SmokeTest/SplashArtTests.cs"+```++## Implementation Strategy++### MVP first (US1)++Phases 1–3 give a per-release neutral composition with determinism and variety checks.+Stop and validate it on the real splash.++### Incremental delivery++1. US1: the neutral per-release art, already shippable.+2. US2: colour, accent, gradients, the DESIGN.md exception and the review sheet. This+ brings the art to the reviewed look.+3. US3: hardening (fallback, timing) and four-theme verification for the PR.++## Notes++- Tests here are smoke-test checks that print PASS/FAIL. There is no separate test framework.+- Keep the composer free of Avalonia types. The smoke test links it.+- Don't commit temporary timing or verification code (T029). Harnesses live outside the+ repository.++---++## Phase 7: Convergence++- [X] T038 Make the version's colour share (`Amt`, 0.35–0.85) decide how much of each family is coloured, not only Panels, in `src/managed/Nota.App/Theme/SplashArt/SplashArtComposer.cs`. Roll: the share of notes in palette colours, the rest in neutral `Raised`/`Hover`. Rings: coloured hits on that share of rings. Faders: coloured level fills on that share of faders. Strata already scales with palette size. Add a smoke check that the coloured fraction of items differs across versions. Per FR-006 (partial).+- [X] T039 Give `SplashArtView` and the review sheet one role→token map: resolve roles in `src/managed/Nota.App/Theme/SplashArt/SplashArtView.cs` through `SplashTokens.Name`, for example by matching `NotaPalette.AllKeys` on the token name without a raw `"Brush."` literal, and drop the separate `Slot` switch. Or add a smoke check that the two agree. Per plan R2 / T024 (partial).+- [ ] T040 Measure launch → first splash paint on a real GUI launch on the reference Mac, against `develop`, and record it in the PR. The headless figure (+30–36 ms cold) stands in until then. Per SC-005 (partial).diff --git a/src/managed/Nota.App/SplashWindow.cs b/src/managed/Nota.App/SplashWindow.csindex 53f1ca92..dfaed890 100644--- a/src/managed/Nota.App/SplashWindow.cs+++ b/src/managed/Nota.App/SplashWindow.cs@@ -3,9 +3,12 @@//// Splash screen — a borderless, centred window shown the instant the app launches// while the audio engine and services spin up (see App.OnFrameworkInitializationCompleted).-// It is dismissed the moment the main window is ready. No chrome, no taskbar entry:-// just the brand mark, version and an indeterminate progress bar so the launch never-// looks frozen.+// It is dismissed the moment the main window is ready. No chrome, no taskbar entry.+// The card carries the release's own art (specs/074): SplashArtComposer turns the version+// into a composition, so every release opens with a picture of its own. The brand mark,+// version and an indeterminate progress bar (so the launch never looks frozen) sit on the+// plain ground beside it. If the art fails for any reason, the plain card from before is+// shown instead — the art never stands between the user and the app.using System;using Avalonia;@@ -28,31 +31,85 @@ public sealed class SplashWindow : WindowCanResize = false;ShowInTaskbar = false;Topmost = true;- Width = 420;- Height = 300;+ Width = SplashScene.Width;+ Height = SplashScene.Height;WindowStartupLocation = WindowStartupLocation.CenterScreen;Background = Brushes.Transparent;TransparencyLevelHint = new[] { WindowTransparencyLevel.Transparent };- var logo = new Image+ try { Content = ArtCard(SplashArtComposer.Compose(AppInfo.Version)); }+ catch { Content = PlainCard(); }+ }++ /// <summary>The release's art with the brand block on the plain ground of its text region.</summary>+ private static Control ArtCard(SplashScene scene)+ {+ var t = scene.TextRect;+ bool row = scene.Layout == SplashLayout.TextBottom;+ double barW = row ? 160 : t.W - 44;++ var words = new StackPanel { Spacing = 4, VerticalAlignment = VerticalAlignment.Center };+ words.Children.Add(new TextBlock{- Width = 84,- Height = 84,- HorizontalAlignment = HorizontalAlignment.Center,+ Text = Loc.T("Nota"),+ FontSize = 24,+ FontWeight = FontWeight.SemiBold,+ Foreground = NotaPalette.TextPrimary,+ });+ words.Children.Add(new TextBlock+ {+ Text = Loc.F("Version {0}", AppInfo.Version),+ FontSize = 12,+ Foreground = NotaPalette.TextTertiary,+ });+ words.Children.Add(Bar(barW, new Thickness(0, 8, 0, 0)));++ var brand = new StackPanel+ {+ Orientation = row ? Orientation.Horizontal : Orientation.Vertical,+ Spacing = 14,+ HorizontalAlignment = HorizontalAlignment.Left,+ VerticalAlignment = VerticalAlignment.Center,};- try+ brand.Children.Add(Logo(row ? 44 : 40));+ brand.Children.Add(words);++ var text = new Border{- using var s = AssetLoader.Open(new Uri("avares://Nota.App/Assets/logo.png"));- logo.Source = new Bitmap(s);- }- catch { /* logo is decorative — the splash still reads without it */ }+ Width = t.W,+ Height = t.H,+ Padding = new Thickness(22, 0),+ Child = brand,+ };+ Canvas.SetLeft(text, t.X);+ Canvas.SetTop(text, t.Y);+ var canvas = new Canvas { Width = SplashScene.Width, Height = SplashScene.Height };+ canvas.Children.Add(new SplashArtView(scene));+ canvas.Children.Add(text);++ // The 1px card edge, as before; the art itself is clipped to the same corner.+ return new Border+ {+ BorderBrush = NotaPalette.BorderDefault,+ BorderThickness = new Thickness(1),+ CornerRadius = NotaRadius.Body,+ ClipToBounds = true,+ Child = canvas,+ };+ }++ /// <summary>The splash before specs/074: logo, name, version and progress on a plain card.</summary>+ private static Control PlainCard()+ {var stack = new StackPanel{Spacing = 12,HorizontalAlignment = HorizontalAlignment.Center,VerticalAlignment = VerticalAlignment.Center,};+ var logo = Logo(84);+ logo.HorizontalAlignment = HorizontalAlignment.Center;stack.Children.Add(logo);stack.Children.Add(new TextBlock{@@ -69,22 +126,13 @@ public sealed class SplashWindow : WindowForeground = NotaPalette.TextTertiary,HorizontalAlignment = HorizontalAlignment.Center,});-- var bar = new ProgressBar- {- IsIndeterminate = true,- Width = 220,- Height = 3,- Margin = new Thickness(0, 10, 0, 0),- Foreground = NotaPalette.Accent,- Background = NotaPalette.BorderDefault,- HorizontalAlignment = HorizontalAlignment.Center,- };+ var bar = Bar(220, new Thickness(0, 10, 0, 0));+ bar.HorizontalAlignment = HorizontalAlignment.Center;stack.Children.Add(bar);// Rounded card on the transparent window, structured with a 1px border to match// the rest of the chrome (no drop shadow — this is a solid launch panel).- Content = new Border+ return new Border{Background = NotaPalette.BgSunken,BorderBrush = NotaPalette.BorderDefault,@@ -93,4 +141,28 @@ public sealed class SplashWindow : WindowChild = stack,};}++ private static Image Logo(double size)+ {+ var logo = new Image { Width = size, Height = size, HorizontalAlignment = HorizontalAlignment.Left };+ try+ {+ using var s = AssetLoader.Open(new Uri("avares://Nota.App/Assets/logo.png"));+ logo.Source = new Bitmap(s);+ }+ catch { /* logo is decorative — the splash still reads without it */ }+ return logo;+ }++ private static ProgressBar Bar(double width, Thickness margin) => new()+ {+ IsIndeterminate = true,+ Width = width,+ Height = 3,+ MinWidth = 0,+ Margin = margin,+ Foreground = NotaPalette.Accent,+ Background = NotaPalette.BorderDefault,+ HorizontalAlignment = HorizontalAlignment.Left,+ };}diff --git a/src/managed/Nota.App/Theme/SplashArt/SplashArtComposer.cs b/src/managed/Nota.App/Theme/SplashArt/SplashArtComposer.csnew file mode 100644index 00000000..d9412313--- /dev/null+++ b/src/managed/Nota.App/Theme/SplashArt/SplashArtComposer.cs@@ -0,0 +1,430 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Composes the launch splash's art from the release version (specs/074). The version is+// the only input: it seeds a small PRNG that picks a layout, one of six motif families+// drawn from the work of making music, a palette of track colours, a stroke weight and a+// wash. The same version always gives the same scene; consecutive patches always change+// family (research R4). The generator is a port of specs/074-release-splash-art/prototype.html,+// the version the maintainer reviewed. Pure and Avalonia-free — the smoke test links it.++using System;+using System.Collections.Generic;+using System.Linq;+using System.Text.RegularExpressions;++namespace Nota.App;++internal static partial class SplashArtComposer+{+ /// <summary>The release version as seeds: <c>Full</c> over the whole string, <c>Line</c> over+ /// "major.minor" (it steps the family), and the patch number.</summary>+ internal readonly record struct ReleaseSeed(uint Full, uint Line, int Patch)+ {+ public static ReleaseSeed Of(string version)+ {+ version = (version ?? "").Trim();+ var full = Hash(version);+ var m = SemVer().Match(version);+ if (!m.Success) return new ReleaseSeed(full, full, 0);+ int.TryParse(m.Groups[3].Value, out var patch);+ return new ReleaseSeed(full, Hash($"{m.Groups[1].Value}.{m.Groups[2].Value}"), patch);+ }+ }++ [GeneratedRegex(@"^(\d+)\.(\d+)\.(\d+)")]+ private static partial Regex SemVer();++ /// <summary>FNV-1a over UTF-16 code units plus a finaliser — not string.GetHashCode, which+ /// is randomised per process.</summary>+ internal static uint Hash(string s)+ {+ unchecked+ {+ uint h = 2166136261;+ foreach (var c in s) { h ^= c; h *= 16777619; }+ h ^= h >> 15; h *= 2246822507; h ^= h >> 13;+ return h;+ }+ }++ /// <summary>mulberry32 — tiny, well-mixed, and identical to the reviewed prototype's.</summary>+ internal sealed class Mulberry32(uint seed)+ {+ private uint _a = seed;+ public double Next()+ {+ unchecked+ {+ _a += 0x6D2B79F5;+ uint t = (_a ^ (_a >> 15)) * (1 | _a);+ t = (t + ((t ^ (t >> 7)) * (61 | t))) ^ t;+ return (t ^ (t >> 14)) / 4294967296.0;+ }+ }+ public T Pick<T>(T[] a) => a[(int)(Next() * a.Length)];+ }++ private static readonly Dictionary<SplashFamily, SplashFamily[]> Overlays = new()+ {+ [SplashFamily.Panels] = new[] { SplashFamily.Rings, SplashFamily.Lissajous },+ [SplashFamily.Strata] = new[] { SplashFamily.Rings },+ [SplashFamily.Faders] = new[] { SplashFamily.Strata },+ [SplashFamily.Roll] = new[] { SplashFamily.Rings },+ };++ /// <summary>The scene for <paramref name="version"/>. Total: any string yields a valid,+ /// non-empty scene and nothing throws.</summary>+ public static SplashScene Compose(string version)+ {+ version ??= "";+ try { return ComposeCore(version, ReleaseSeed.Of(version)); }+ catch+ {+ // Unreachable in practice; the splash must never lose its art to a bug in a motif.+ var c = new Ctx(new Mulberry32(1), 2, 0.5, new[] { R(SplashRole.Rule) }, grad: false, overlay: false);+ var art = new SRect(150, 0, 270, 300);+ c.Line(new SPoint(art.X + 20, 150), new SPoint(art.X + art.W - 20, 150), R(SplashRole.Rule), 2);+ return new SplashScene(version, SplashLayout.TextLeft, art, new SRect(0, 0, 150, 300), SplashFamily.Panels, null,+ SplashPaletteMode.Mono, new EqList<int>(new[] { 0 }), 2, 0.5, SplashWash.None, new EqList<Prim>(c.Out), c.Out.Count);+ }+ }++ private static SplashScene ComposeCore(string version, ReleaseSeed seed)+ {+ var r = new Mulberry32(seed.Full);+ var layout = r.Pick(new[] { SplashLayout.TextLeft, SplashLayout.TextRight, SplashLayout.TextBottom, SplashLayout.TextLeft, SplashLayout.TextBottom });+ var (art, text) = layout switch+ {+ SplashLayout.TextLeft => (new SRect(150, 0, 270, 300), new SRect(0, 0, 150, 300)),+ SplashLayout.TextRight => (new SRect(0, 0, 270, 300), new SRect(270, 0, 150, 300)),+ _ => (new SRect(0, 0, 420, 196), new SRect(0, 196, 420, 104)),+ };++ // The family steps by a number coprime to 6 per patch, so neighbours always differ.+ var family = (SplashFamily)(int)(unchecked(seed.Line + 5u * (uint)Math.Max(0, seed.Patch)) % 6u);+ SplashFamily? overlay = Overlays.TryGetValue(family, out var ovs) && r.Next() < 0.35 ? r.Pick(ovs) : null;++ int b = (int)(r.Next() * 9);+ var mode = r.Pick(new[] { SplashPaletteMode.Analog, SplashPaletteMode.Analog, SplashPaletteMode.Pair, SplashPaletteMode.Triad, SplashPaletteMode.Mono });+ int[] idx = mode switch+ {+ SplashPaletteMode.Mono => new[] { b },+ SplashPaletteMode.Pair => new[] { b, (b + 4) % 9 },+ SplashPaletteMode.Triad => new[] { b, (b + 3) % 9, (b + 6) % 9 },+ _ => new[] { b, (b + 1) % 9, (b + 2) % 9 },+ };+ double amt = 0.35 + r.Next() * 0.5;+ double w = r.Pick(new[] { 1.5, 2, 2, 2.5, 3 });+ var wash = r.Pick(new[] { SplashWash.None, SplashWash.Radial, SplashWash.Linear, SplashWash.Radial });+ double wx = r.Next(), wy = r.Next();++ var pal = idx.Select(i => new ColorRef(SplashRole.Track, i)).ToArray();+ var c = new Ctx(r, w, amt, pal, grad: true, overlay: false);++ if (wash != SplashWash.None)+ {+ var first = pal[0]; var last = pal[^1];+ Paint p = wash == SplashWash.Radial+ ? new RadialPaint(Stops((0, first.At(0.28)), (1, last.At(0))), new SPoint(wx, wy), 0.8, PaintSpace.Bounds)+ : new LinearPaint(Stops((0, first.At(0.22)), (1, last.At(0))), new SPoint(wx, 0), new SPoint(1 - wx, 1), PaintSpace.Bounds);+ c.Rect(art, p);+ }++ Draw(family, art, c);+ int overlayStart = c.Out.Count;+ if (overlay is { } ov)+ {+ var co = new Ctx(r, Math.Max(1, w * 0.6), amt, new[] { R(SplashRole.Rule), R(SplashRole.Tertiary) }, grad: false, overlay: true, c.Out);+ Draw(ov, art, co);+ }++ return new SplashScene(version, layout, art, text, family, overlay, mode, new EqList<int>(idx), w, amt, wash,+ new EqList<Prim>(c.Out), overlayStart);+ }++ private static void Draw(SplashFamily f, SRect b, Ctx c)+ {+ switch (f)+ {+ case SplashFamily.Roll: Roll(b, c); break;+ case SplashFamily.Rings: Rings(b, c); break;+ case SplashFamily.Strata: Strata(b, c); break;+ case SplashFamily.Panels: Panels(b, c); break;+ case SplashFamily.Lissajous: Lissajous(b, c); break;+ default: Faders(b, c); break;+ }+ }++ // ---- motif families ------------------------------------------------------------++ /// <summary>A piano roll: a step grid and one to three voices walking a scale.</summary>+ private static void Roll(SRect b, Ctx c)+ {+ var r = c.R;+ int steps = 16 * (1 + (int)(r.Next() * 2)); double sw = b.W / steps;+ int rows = 10 + (int)(r.Next() * 12); double rh = b.H / rows;+ for (int s = 0; s <= steps; s++)+ c.Line(new SPoint(b.X + s * sw, b.Y), new SPoint(b.X + s * sw, b.Y + b.H),+ R(s % 4 != 0 ? SplashRole.Grid : SplashRole.Rule), s % 16 != 0 ? 1 : c.W);+ int voices = 1 + (int)(r.Next() * 3);+ for (int v = 0; v < voices; v++)+ {+ var vc = c.Pal[v % c.Pal.Length];+ int p = (int)(rows * (0.25 + r.Next() * 0.5)), st = (int)(r.Next() * 4);+ while (st < steps)+ {+ int len = r.Pick(new[] { 1, 1, 2, 2, 3, 4 });+ if (r.Next() < 0.78)+ {+ double x = b.X + st * sw + 1, nw = len * sw - 2, y = b.Y + p * rh + 1, vel = 0.35 + r.Next() * 0.65;+ // The version's colour share decides how many notes carry the voice's colour.+ if (r.Next() < c.Amt)+ {+ Paint fill = c.Grad+ ? new LinearPaint(Stops((0, vc), (1, vc.At(0.25 + 0.4 * (1 - vel)))), new SPoint(0, 0), new SPoint(1, 0), PaintSpace.Bounds)+ : new SolidPaint(vc);+ c.Rect(new SRect(x, y, nw, rh - 2), fill, vc.Darker(0.35), 1, radius: 2);+ }+ else c.Rect(new SRect(x, y, nw, rh - 2), new SolidPaint(R(SplashRole.Hover)), R(SplashRole.Seam), 1, radius: 2);+ }+ st += len;+ p = Math.Clamp(p + r.Pick(new[] { -2, -1, -1, 0, 1, 1, 2 }), 0, rows - 1);+ }+ }+ c.Playhead(b, b.X + sw * Math.Floor(steps * (0.3 + r.Next() * 0.4)));+ }++ /// <summary>Euclidean rhythm rings around a centre; the outer ring's last hit is the current step.</summary>+ private static void Rings(SRect b, Ctx c)+ {+ var r = c.R;+ double cx = b.X + b.W * (0.3 + r.Next() * 0.4), cy = b.Y + b.H * (0.3 + r.Next() * 0.4);+ int k = 3 + (int)(r.Next() * 4);+ double r0 = Math.Min(b.W, b.H) * 0.12, dr = (Math.Max(b.W, b.H) * 0.6 - r0) / k;+ double lw = Math.Max(1.5, c.W), dot = 3 + lw;+ var centre = new SPoint(cx, cy);+ if (c.Grad)+ c.Circle(centre, r0 + (k - 1) * dr,+ new RadialPaint(Stops((0, c.Pal[0].At(0.35)), (0.6, c.Pal[^1].At(0.12)), (1, R(SplashRole.Ground).At(0))), new SPoint(0.5, 0.5), 0.5, PaintSpace.Bounds));+ SPoint? last = null;+ for (int i = 0; i < k; i++)+ {+ double radius = r0 + i * dr;+ int n = r.Pick(new[] { 8, 12, 16, 5, 7, 9, 13 });+ int hits = 1 + (int)(r.Next() * (n - 1));+ double rot = r.Next() * 6.28;+ // The outer ring always carries colour; the others by the version's colour share.+ var rc = i == k - 1 || r.Next() < c.Amt ? c.Pal[i % c.Pal.Length] : R(SplashRole.Tertiary);+ c.Circle(centre, radius, null, R(SplashRole.Rule), lw);+ for (int j = 0; j < n; j++)+ {+ bool on = (j + 1) * hits / n != j * hits / n;+ double a = rot + (double)j / n * 6.283;+ var pt = new SPoint(cx + Math.Cos(a) * radius, cy + Math.Sin(a) * radius);+ if (on) c.Circle(pt, dot, new SolidPaint(rc));+ else c.Circle(pt, lw, new SolidPaint(R(SplashRole.Hover)));+ if (on && i == k - 1) { c.Line(centre, pt, R(SplashRole.Grid), lw * 0.7); last = pt; }+ }+ }+ if (last is { } l)+ {+ c.Line(centre, l, c.Live, lw);+ c.Circle(l, dot + 3, null, c.Live, lw);+ }+ }++ /// <summary>Stacked waveform strata under a Gaussian swell; palette colours mark hero lines.</summary>+ private static void Strata(SRect b, Ctx c)+ {+ var r = c.R;+ int n = 9 + (int)(r.Next() * 10);+ double gap = b.H / (n + 3);+ double[] fs = { 1 + r.Next() * 3, 4 + r.Next() * 6, 9 + r.Next() * 9 };+ double[] ph = { r.Next() * 6, r.Next() * 6, r.Next() * 6 };+ double cen = b.X + b.W * (0.3 + r.Next() * 0.4), wid = b.W * (0.12 + r.Next() * 0.2);+ var hero = new Dictionary<int, ColorRef>();+ for (int i = 0; i < c.Pal.Length; i++) hero[(int)(n * (0.35 + 0.5 * i / c.Pal.Length))] = c.Pal[i];+ Paint? across = c.Grad && c.Pal.Length > 1+ ? new LinearPaint(Spread(c.Pal), new SPoint(b.X, 0), new SPoint(b.X + b.W, 0), PaintSpace.Art) : null;+ for (int i = 0; i < n; i++)+ {+ double y0 = b.Y + gap * (i + 3);+ var pts = new List<SPoint>();+ for (double x = 0; x <= b.W; x += 2)+ {+ double X = b.X + x, env = Math.Exp(-Math.Pow((X - cen) / wid, 2));+ double v = Math.Sin(x / b.W * fs[0] * 6.28 + ph[0] + i * 0.4) * 0.5+ + Math.Sin(x / b.W * fs[1] * 6.28 + ph[1] - i * 0.3) * 0.35+ + Math.Sin(x / b.W * fs[2] * 6.28 + ph[2] + i) * 0.15;+ pts.Add(new SPoint(X, y0 - Math.Abs(v) * env * gap * 3.2));+ }+ var poly = new List<SPoint> { new(b.X, b.Y + b.H) };+ poly.AddRange(pts);+ poly.Add(new SPoint(b.X + b.W, b.Y + b.H));+ bool isHero = hero.TryGetValue(i, out var hc);+ c.Polyline(poly, null, new SolidPaint(R(SplashRole.Ground)), 1);+ if (c.Grad && isHero)+ c.Polyline(poly, null, new LinearPaint(Stops((0, hc.At(0.45)), (0.35, hc.At(0))), new SPoint(0, 0), new SPoint(0, 1), PaintSpace.Bounds), 1);+ c.Polyline(pts, isHero ? across ?? new SolidPaint(hc) : new SolidPaint(R(SplashRole.Tertiary)), null,+ isHero ? c.W * 1.4 : Math.Max(1, c.W * 0.6));+ }+ c.Playhead(b, cen + wid * (r.Next() - 0.5));+ }++ /// <summary>Fader rails with level fills; one fader is being touched.</summary>+ private static void Faders(SRect b, Ctx c)+ {+ var r = c.R;+ int n = 8 + (int)(r.Next() * 10);+ double sw = b.W / n, fq = r.Next() * 3 + 0.5, ph = r.Next() * 6, lw = Math.Max(1, c.W * 0.8);+ int hot = (int)(r.Next() * n);+ for (int i = 0; i < n; i++)+ {+ double x = b.X + sw * (i + 0.5);+ // The touched fader always carries colour; the others by the version's colour share.+ var col = i == hot || r.Next() < c.Amt ? c.Pal[(int)((double)i / n * c.Pal.Length)] : R(SplashRole.Tertiary);+ c.Line(new SPoint(x, b.Y + 12), new SPoint(x, b.Y + b.H - 12), R(SplashRole.Rule), lw);+ double v = 0.5 + 0.4 * Math.Sin((double)i / n * fq * 6.28 + ph) + 0.1 * (r.Next() - 0.5);+ double y = b.Y + 12 + (1 - v) * (b.H - 24), fw = Math.Min(8, sw * 0.3);+ Paint level = c.Grad+ ? new LinearPaint(Stops((0, col), (1, col.At(0.15))), new SPoint(0, 0), new SPoint(0, 1), PaintSpace.Bounds)+ : new SolidPaint(col);+ c.Rect(new SRect(x - fw / 2, y, fw, b.Y + b.H - 12 - y), level);+ c.Rect(new SRect(x - Math.Min(10, sw * 0.38), y - 4, Math.Min(20, sw * 0.76), 8), new SolidPaint(R(SplashRole.Hover)), R(SplashRole.Seam), 1);+ double hw = Math.Min(6, sw * 0.22);+ if (i == hot) c.Line(new SPoint(x - hw, y), new SPoint(x + hw, y), c.Live, 2);+ else c.Line(new SPoint(x - hw, y), new SPoint(x + hw, y), R(SplashRole.Ink), lw);+ }+ }++ /// <summary>The art split into panels on seams, some in track colours, some hatched or dotted.</summary>+ private static void Panels(SRect b, Ctx c)+ {+ var r = c.R;+ var tones = new[] { R(SplashRole.Ground), R(SplashRole.Panel), R(SplashRole.Raised), R(SplashRole.Hover), R(SplashRole.App) };+ var cells = new List<SRect>();+ void Split(double x, double y, double w, double h, int d)+ {+ if (d > 4 || w < 40 || h < 30 || (d > 1 && r.Next() < 0.25)) { cells.Add(new SRect(x, y, w, h)); return; }+ if (w > h * 1.2 || (w > h * 0.8 && r.Next() < 0.5))+ {+ double s = w * (0.25 + r.Next() * 0.5);+ Split(x, y, s, h, d + 1); Split(x + s, y, w - s, h, d + 1);+ }+ else+ {+ double s = h * (0.25 + r.Next() * 0.5);+ Split(x, y, w, s, d + 1); Split(x, y + s, w, h - s, d + 1);+ }+ }+ Split(b.X, b.Y, b.W, b.H, 0);++ var colored = new HashSet<int>();+ int m = Math.Max(1, (int)Math.Round(cells.Count * c.Amt * 0.5));+ while (colored.Count < Math.Min(m, cells.Count)) colored.Add((int)(r.Next() * cells.Count));++ var dirs = new[] { (0d, 0d, 0d, 1d), (0d, 0d, 1d, 0d), (0d, 1d, 1d, 0d) };+ bool accDone = false;+ for (int idx = 0; idx < cells.Count; idx++)+ {+ var (x, y, w, h) = cells[idx];+ ColorRef? col = colored.Contains(idx) ? r.Pick(c.Pal) : null;+ var dir = r.Pick(dirs);+ Paint fill = col is { } cc+ ? c.Grad ? new LinearPaint(Stops((0, cc), (1, cc.ToGround(0.7))), new SPoint(dir.Item1, dir.Item2), new SPoint(dir.Item3, dir.Item4), PaintSpace.Bounds)+ : new SolidPaint(cc)+ : new SolidPaint(r.Pick(tones));+ c.Rect(new SRect(x, y, w, h), fill);+ double k = r.Next();+ var ink = col is { } c2 ? c2.Darker(0.35) : R(SplashRole.Rule);+ if (k < 0.22)+ {+ for (double q = x + 4; q < x + w; q += 3 + c.W * 2)+ c.Line(new SPoint(q, y), new SPoint(q, y + h - 1), ink, c.W * 0.8);+ }+ else if (k < 0.38)+ {+ var dotFill = new SolidPaint(col is null ? R(SplashRole.Tertiary) : ink);+ for (double q = y + 5; q < y + h; q += 6)+ for (double p = x + 5; p < x + w; p += 6)+ c.Circle(new SPoint(p, q), c.W * 0.6, dotFill);+ }+ else if (k < 0.52)+ {+ bool ac = !accDone && col is null && r.Next() < 0.5;+ if (ac) accDone = true;+ c.Circle(new SPoint(x + w / 2, y + h / 2), Math.Min(w, h) * 0.3, null,+ ac ? c.Live : col is null ? R(SplashRole.Ink) : ink, c.W);+ }+ c.Rect(new SRect(x + 0.5, y + 0.5, w - 1, h - 1), null, R(SplashRole.Seam), Math.Max(1, c.W * 0.75));+ }+ }++ /// <summary>A Lissajous figure on a grid, its echo flattened beneath, and a live point on it.</summary>+ private static void Lissajous(SRect b, Ctx c)+ {+ var r = c.R;+ for (double x = b.X + 20; x < b.X + b.W; x += 20) c.Line(new SPoint(x, b.Y), new SPoint(x, b.Y + b.H), R(SplashRole.Grid), 1);+ for (double y = b.Y + 20; y < b.Y + b.H; y += 20) c.Line(new SPoint(b.X, y), new SPoint(b.X + b.W, y), R(SplashRole.Grid), 1);+ int a = r.Pick(new[] { 1, 2, 3, 3, 4, 5 }), bb = r.Pick(new[] { 2, 3, 4, 5, 7 });+ double d = r.Next() * 3, cx = b.X + b.W / 2, cy = b.Y + b.H / 2, ax = b.W * 0.4, ay = b.H * 0.38;+ var pts = new List<SPoint>();+ for (double t = 0; t <= 6.2832 + 0.001; t += 0.01)+ pts.Add(new SPoint(cx + ax * Math.Sin(a * t + d), cy + ay * Math.Sin(bb * t)));+ Paint main = c.Grad+ ? new LinearPaint(c.Pal.Length > 1 ? Spread(c.Pal) : Stops((0, c.Pal[0]), (1, c.Pal[0].ToGround(0.6))),+ new SPoint(b.X + b.W * 0.1, b.Y), new SPoint(b.X + b.W * 0.9, b.Y + b.H), PaintSpace.Art)+ : new SolidPaint(c.Pal[0]);+ c.Polyline(pts.Select(p => new SPoint(p.X, cy + (p.Y - cy) * 0.6)),+ new SolidPaint(c.Pal.Length > 1 ? c.Pal[1] : R(SplashRole.Rule)), null, Math.Max(1, c.W * 0.6));+ c.Polyline(pts, main, null, c.W * 1.3);+ var q = pts[(int)(r.Next() * pts.Count)];+ c.Circle(q, 3 + c.W, new SolidPaint(c.Live));+ }++ // ---- helpers ---------------------------------------------------------------------++ private static ColorRef R(SplashRole role) => new(role);++ private static EqList<SStop> Stops(params (double Offset, ColorRef Color)[] s) => new(s.Select(x => new SStop(x.Offset, x.Color)));++ private static EqList<SStop> Spread(ColorRef[] pal) => new(pal.Select((p, i) => new SStop((double)i / (pal.Length - 1), p)));++ private static double Q(double v) => Math.Round(v * 10) / 10;+ private static SPoint Q(SPoint p) => new(Q(p.X), Q(p.Y));++ /// <summary>The drawing context of one family: the shared PRNG, the version's stroke weight,+ /// colour share and palette, and whether gradients and the live accent are allowed (an+ /// overlay draws neutral, flat, and never live).</summary>+ private sealed class Ctx(Mulberry32 r, double w, double amt, ColorRef[] pal, bool grad, bool overlay, List<Prim>? output = null)+ {+ public readonly Mulberry32 R = r;+ public readonly double W = w, Amt = amt;+ public readonly ColorRef[] Pal = pal;+ public readonly bool Grad = grad;+ public readonly List<Prim> Out = output ?? new List<Prim>();++ /// <summary>The colour of the one live element: the accent, or plain ink in an overlay.</summary>+ public ColorRef Live => new(overlay ? SplashRole.Ink : SplashRole.Accent);++ public void Rect(SRect s, Paint? fill, ColorRef? stroke = null, double sw = 1, double radius = 0) =>+ Out.Add(new RectPrim(new SRect(Q(s.X), Q(s.Y), Q(Math.Max(1, s.W)), Q(Math.Max(1, s.H))), radius, fill,+ stroke is { } st ? new SolidPaint(st) : null, sw));+ public void Rect(SRect s, Paint fill) => Rect(s, fill, null);+ public void Line(SPoint a, SPoint b, ColorRef col, double sw) => Out.Add(new LinePrim(Q(a), Q(b), new SolidPaint(col), sw));+ public void Polyline(IEnumerable<SPoint> pts, Paint? stroke, Paint? fill, double sw) =>+ Out.Add(new PolylinePrim(new EqList<SPoint>(pts.Select(Q)), stroke, fill, sw));+ public void Circle(SPoint centre, double radius, Paint? fill, ColorRef? stroke = null, double sw = 1) =>+ Out.Add(new CirclePrim(Q(centre), Q(radius), fill, stroke is { } st ? new SolidPaint(st) : null, sw));+ public void Circle(SPoint centre, double radius, Paint fill) => Circle(centre, radius, fill, null);++ /// <summary>A playhead: the live line down the art with a small head at the top.</summary>+ public void Playhead(SRect b, double x)+ {+ Line(new SPoint(x, b.Y + 5), new SPoint(x, b.Y + b.H), Live, Math.Max(1.5, W * 0.75));+ Out.Add(new PolygonPrim(new EqList<SPoint>(new[] { new SPoint(x - 5, b.Y), new SPoint(x + 5, b.Y), new SPoint(x, b.Y + 6) }.Select(Q)),+ new SolidPaint(Live)));+ }+ }+}diff --git a/src/managed/Nota.App/Theme/SplashArt/SplashArtView.cs b/src/managed/Nota.App/Theme/SplashArt/SplashArtView.csnew file mode 100644index 00000000..17568ada--- /dev/null+++ b/src/managed/Nota.App/Theme/SplashArt/SplashArtView.cs@@ -0,0 +1,145 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Draws a SplashScene — the release's art on the launch splash (specs/074). Colour roles+// resolve against the live NotaPalette slots inside Render, so the art follows the theme.+// This is the one view-like class allowed gradients and strokes heavier than 1px: the+// splash exception to DESIGN.md rule 6, kept in Theme/ beside the plug-in preview wash+// and pinned there by DesignTokenCheck.++using System;+using System.Collections.Generic;+using System.Linq;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Media;++namespace Nota.App;++internal sealed class SplashArtView : Control+{+ private readonly SplashScene _scene;++ public SplashArtView(SplashScene scene)+ {+ _scene = scene;+ Width = SplashScene.Width;+ Height = SplashScene.Height;+ IsHitTestVisible = false;+ }++ public override void Render(DrawingContext ctx)+ {+ var card = new Rect(0, 0, SplashScene.Width, SplashScene.Height);+ var ground = Resolve(new ColorRef(SplashRole.Ground));+ using (ctx.PushClip(new RoundedRect(card, NotaRadius.BodyValue)))+ {+ ctx.FillRectangle(new SolidColorBrush(ground), card);+ var a = _scene.ArtRect;+ using (ctx.PushClip(new Rect(a.X, a.Y, a.W, a.H)))+ foreach (var p in _scene.Items) Draw(ctx, p);++ // The seam between the art and the text's plain ground.+ var seam = new Pen(new SolidColorBrush(Resolve(new ColorRef(SplashRole.Seam))), 1);+ switch (_scene.Layout)+ {+ case SplashLayout.TextLeft: ctx.DrawLine(seam, new Point(a.X + 0.5, 0), new Point(a.X + 0.5, card.Height)); break;+ case SplashLayout.TextRight: ctx.DrawLine(seam, new Point(a.X + a.W - 0.5, 0), new Point(a.X + a.W - 0.5, card.Height)); break;+ default: ctx.DrawLine(seam, new Point(0, a.Y + a.H - 0.5), new Point(card.Width, a.Y + a.H - 0.5)); break;+ }+ }+ }++ private static void Draw(DrawingContext ctx, Prim p)+ {+ switch (p)+ {+ case RectPrim r:+ ctx.DrawRectangle(Brush(r.Fill), Pen(r.Stroke, r.StrokeWidth), new Rect(r.R.X, r.R.Y, r.R.W, r.R.H), r.Radius, r.Radius);+ break;+ case LinePrim l:+ ctx.DrawLine(Pen(l.Stroke, l.StrokeWidth)!, new Point(l.A.X, l.A.Y), new Point(l.B.X, l.B.Y));+ break;+ case PolylinePrim pl:+ ctx.DrawGeometry(Brush(pl.Fill), Pen(pl.Stroke, pl.StrokeWidth), Geometry(pl.Points, closed: pl.Fill is not null));+ break;+ case PolygonPrim pg:+ ctx.DrawGeometry(Brush(pg.Fill), null, Geometry(pg.Points, closed: true));+ break;+ case CirclePrim c:+ ctx.DrawEllipse(Brush(c.Fill), Pen(c.Stroke, c.StrokeWidth), new Point(c.C.X, c.C.Y), c.R, c.R);+ break;+ }+ }++ private static StreamGeometry Geometry(EqList<SPoint> pts, bool closed)+ {+ var g = new StreamGeometry();+ using var s = g.Open();+ if (pts.Count == 0) return g;+ s.BeginFigure(new Point(pts[0].X, pts[0].Y), closed);+ for (int i = 1; i < pts.Count; i++) s.LineTo(new Point(pts[i].X, pts[i].Y));+ s.EndFigure(closed);+ return g;+ }++ private static IPen? Pen(Paint? paint, double width) =>+ paint is null ? null : new Pen(Brush(paint), width, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);++ /// <summary>A brush for one paint, built per render from the live palette — never stored,+ /// since a gradient brush snapshots its stop colours.</summary>+ private static IBrush? Brush(Paint? paint)+ {+ switch (paint)+ {+ case null: return null;+ case SolidPaint s: return new SolidColorBrush(Resolve(s.Color));+ case LinearPaint l:+ {+ var unit = l.Space == PaintSpace.Art ? RelativeUnit.Absolute : RelativeUnit.Relative;+ var g = new LinearGradientBrush+ {+ StartPoint = new RelativePoint(l.Start.X, l.Start.Y, unit),+ EndPoint = new RelativePoint(l.End.X, l.End.Y, unit),+ };+ foreach (var st in l.Stops) g.GradientStops.Add(new GradientStop(Resolve(st.Color), st.Offset));+ return g;+ }+ case RadialPaint r:+ {+ var unit = r.Space == PaintSpace.Art ? RelativeUnit.Absolute : RelativeUnit.Relative;+ var centre = new RelativePoint(r.Center.X, r.Center.Y, unit);+ var g = new RadialGradientBrush+ {+ Center = centre,+ GradientOrigin = centre,+ RadiusX = new RelativeScalar(r.Radius, unit),+ RadiusY = new RelativeScalar(r.Radius, unit),+ };+ foreach (var st in r.Stops) g.GradientStops.Add(new GradientStop(Resolve(st.Color), st.Offset));+ return g;+ }+ default: return null;+ }+ }++ private static Color Resolve(ColorRef c)+ {+ static (byte, byte, byte) Rgb(SolidColorBrush slot) => (slot.Color.R, slot.Color.G, slot.Color.B);+ var (a, r, g, b) = SplashTokens.Shade(c, Rgb(Slot(c)), Rgb(NotaPalette.BgSunken));+ return new Color(a, r, g, b);+ }++ /// <summary>The live palette slot of a role, found by the token name+ /// <see cref="SplashTokens.Name"/> gives it — the same table the review sheet reads the+ /// theme files with, so the app and the sheet cannot disagree.</summary>+ private static SolidColorBrush Slot(ColorRef c) =>+ SlotsByToken.TryGetValue(SplashTokens.Name(c), out var slot) ? slot : NotaPalette.BgSunken;++ /// <summary>Palette slots by token name (the published key without its "Brush." prefix).+ /// Holds the live slots themselves, so it follows every theme change.</summary>+ private static readonly Dictionary<string, SolidColorBrush> SlotsByToken = NotaPalette.AllKeys+ .Where(kv => kv.Key.StartsWith(nameof(Brush) + ".", StringComparison.Ordinal))+ .GroupBy(kv => kv.Key[(kv.Key.IndexOf('.') + 1)..], StringComparer.Ordinal)+ .ToDictionary(g => g.Key, g => g.First().Value, StringComparer.Ordinal);+}diff --git a/src/managed/Nota.App/Theme/SplashArt/SplashScene.cs b/src/managed/Nota.App/Theme/SplashArt/SplashScene.csnew file mode 100644index 00000000..6c88be78--- /dev/null+++ b/src/managed/Nota.App/Theme/SplashArt/SplashScene.cs@@ -0,0 +1,158 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The splash art's scene (specs/074): what SplashArtComposer makes of a version and what+// SplashArtView draws. It is a list of primitives that name colour *roles*, not colours,+// so it is theme-free: the same scene re-tints with the theme, and the smoke test can+// compare two scenes for equality. No Avalonia types here — the smoke test links this file.++using System;+using System.Collections;+using System.Collections.Generic;+using System.Linq;++namespace Nota.App;++internal enum SplashLayout { TextLeft, TextRight, TextBottom }+internal enum SplashFamily { Roll, Rings, Strata, Panels, Lissajous, Faders }+internal enum SplashPaletteMode { Mono, Analog, Pair, Triad }+internal enum SplashWash { None, Radial, Linear }++/// <summary>A colour role. Every role is a theme token (see <see cref="SplashTokens"/>);+/// there are deliberately no semantic roles (mute, solo, record, danger …).</summary>+internal enum SplashRole { Ground, App, Panel, Raised, Hover, Seam, Rule, Grid, Faint, Tertiary, Ink, Accent, Track }++internal readonly record struct SPoint(double X, double Y);+internal readonly record struct SRect(double X, double Y, double W, double H);++/// <summary>A role, optionally shaded toward black or toward the ground, at an alpha.</summary>+internal readonly record struct ColorRef(SplashRole Role, int TrackIndex = 0, double TowardBlack = 0,+ double TowardGround = 0, double Alpha = 1)+{+ public ColorRef Darker(double k) => this with { TowardBlack = k };+ public ColorRef ToGround(double k) => this with { TowardGround = k };+ public ColorRef At(double alpha) => this with { Alpha = alpha };+ public bool IsNeutral => Role is not (SplashRole.Track or SplashRole.Accent);+}++internal readonly record struct SStop(double Offset, ColorRef Color);++/// <summary>Bounds: gradient points relative to the shape (0..1). Art: absolute card coordinates.</summary>+internal enum PaintSpace { Bounds, Art }++internal abstract record Paint+{+ public abstract IEnumerable<ColorRef> Colors { get; }+}+internal sealed record SolidPaint(ColorRef Color) : Paint+{+ public override IEnumerable<ColorRef> Colors => new[] { Color };+}+internal sealed record LinearPaint(EqList<SStop> Stops, SPoint Start, SPoint End, PaintSpace Space) : Paint+{+ public override IEnumerable<ColorRef> Colors => Stops.Select(s => s.Color);+}+internal sealed record RadialPaint(EqList<SStop> Stops, SPoint Center, double Radius, PaintSpace Space) : Paint+{+ public override IEnumerable<ColorRef> Colors => Stops.Select(s => s.Color);+}++internal abstract record Prim+{+ public abstract IEnumerable<Paint> Paints { get; }+}+internal sealed record RectPrim(SRect R, double Radius, Paint? Fill, Paint? Stroke, double StrokeWidth) : Prim+{+ public override IEnumerable<Paint> Paints => new[] { Fill, Stroke }.OfType<Paint>();+}+internal sealed record LinePrim(SPoint A, SPoint B, Paint Stroke, double StrokeWidth) : Prim+{+ public override IEnumerable<Paint> Paints => new[] { Stroke };+}+internal sealed record PolylinePrim(EqList<SPoint> Points, Paint? Stroke, Paint? Fill, double StrokeWidth) : Prim+{+ public override IEnumerable<Paint> Paints => new[] { Fill, Stroke }.OfType<Paint>();+}+internal sealed record PolygonPrim(EqList<SPoint> Points, Paint Fill) : Prim+{+ public override IEnumerable<Paint> Paints => new[] { Fill };+}+internal sealed record CirclePrim(SPoint C, double R, Paint? Fill, Paint? Stroke, double StrokeWidth) : Prim+{+ public override IEnumerable<Paint> Paints => new[] { Fill, Stroke }.OfType<Paint>();+}++internal sealed record SplashScene(+ string Version,+ SplashLayout Layout,+ SRect ArtRect,+ SRect TextRect,+ SplashFamily Family,+ SplashFamily? Overlay,+ SplashPaletteMode PaletteMode,+ EqList<int> Palette,+ double StrokeWeight,+ double ColourShare,+ SplashWash Wash,+ EqList<Prim> Items,+ int OverlayStart)+{+ public const double Width = 420, Height = 300;+}++/// <summary>The role → theme-token table, shared by the app's renderer (NotaPalette.ByKey)+/// and the smoke test's review sheet (theme JSON), so both resolve a role the same way.</summary>+internal static class SplashTokens+{+ public static string Name(ColorRef c) => c.Role switch+ {+ SplashRole.Ground => "BgSunken",+ SplashRole.App => "BgApp",+ // Where the role and the token share a name, nameof keeps the two in step.+ SplashRole.Panel => nameof(SplashRole.Panel),+ SplashRole.Raised => "SurfaceRaised",+ SplashRole.Hover => "SurfaceHover",+ SplashRole.Seam => nameof(SplashRole.Seam),+ SplashRole.Rule => nameof(SplashRole.Rule),+ SplashRole.Grid => "VizGrid",+ SplashRole.Faint => "TextFaint",+ SplashRole.Tertiary => "TextTertiary",+ SplashRole.Ink => "VizInk",+ SplashRole.Accent => nameof(SplashRole.Accent),+ SplashRole.Track => nameof(SplashRole.Track) + (Math.Clamp(c.TrackIndex, 0, 8) + 1),+ _ => "BgSunken",+ };++ /// <summary>Applies the shades and alpha to a resolved token colour (8-bit channels).</summary>+ public static (byte A, byte R, byte G, byte B) Shade(ColorRef c, (byte R, byte G, byte B) token, (byte R, byte G, byte B) ground)+ {+ double r = token.R, g = token.G, b = token.B;+ if (c.TowardGround > 0)+ {+ r += (ground.R - r) * c.TowardGround; g += (ground.G - g) * c.TowardGround; b += (ground.B - b) * c.TowardGround;+ }+ if (c.TowardBlack > 0) { r *= 1 - c.TowardBlack; g *= 1 - c.TowardBlack; b *= 1 - c.TowardBlack; }+ static byte B8(double v) => (byte)Math.Clamp(Math.Round(v), 0, 255);+ return (B8(c.Alpha * 255), B8(r), B8(g), B8(b));+ }+}++/// <summary>An immutable list with value equality, so records holding it compare by content.</summary>+internal readonly struct EqList<T> : IEquatable<EqList<T>>, IReadOnlyList<T>+{+ private readonly T[] _items;+ public EqList(IEnumerable<T> items) => _items = items.ToArray();+ private T[] Items => _items ?? Array.Empty<T>();+ public int Count => Items.Length;+ public T this[int i] => Items[i];+ public bool Equals(EqList<T> other) => Items.AsSpan().SequenceEqual(other.Items, EqualityComparer<T>.Default);+ public override bool Equals(object? obj) => obj is EqList<T> o && Equals(o);+ public override int GetHashCode()+ {+ var h = new HashCode();+ foreach (var x in Items) h.Add(x);+ return h.ToHashCode();+ }+ public IEnumerator<T> GetEnumerator() => ((IEnumerable<T>)Items).GetEnumerator();+ IEnumerator IEnumerable.GetEnumerator() => Items.GetEnumerator();+}diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.cs b/tests/Nota.SmokeTest/DesignTokenCheck.csindex 03f68a4f..6882d813 100644--- a/tests/Nota.SmokeTest/DesignTokenCheck.cs+++ b/tests/Nota.SmokeTest/DesignTokenCheck.cs@@ -134,6 +134,17 @@ internal static partial class DesignTokenCheckvar gradients = Offenders(@"\b(?:Linear|Radial|Conic)GradientBrush\b|NotaPalette\.VGradient\(");yield return (gradients.Length == 0,gradients.Length == 0 ? "no gradients in views" : $"gradients in: {string.Join(", ", gradients)}");+ // Inside Theme/ too, gradients stay where DESIGN.md rule 6 names them: the palette+ // (the plug-in preview wash) and the splash's release art (specs/074).+ var themeGradients = Files(Path.Combine(app, "Theme"), "*.cs", SearchOption.AllDirectories)+ .Where(f => !f.Contains("/obj/") && !f.Contains("/bin/"))+ .Where(f => Regex.IsMatch(File.ReadAllText(f), @"\b(?:Linear|Radial|Conic)GradientBrush\b"))+ .Select(f => Rel(app, f))+ .Where(f => f != "Theme/NotaPalette.cs" && !f.StartsWith("Theme/SplashArt/"))+ .OrderBy(f => f).ToArray();+ yield return (themeGradients.Length == 0, themeGradients.Length == 0+ ? "gradients in Theme/ only in NotaPalette.cs and Theme/SplashArt/"+ : $"gradients elsewhere in Theme/: {string.Join(", ", themeGradients)}");// A Rectangle's RadiusX/RadiusY is a corner radius too, so it keeps the 0/1/2/3/4// scale (spec 012 R9: the add-device targets drew at 7 and 6). Ratchet indiff --git a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj b/tests/Nota.SmokeTest/Nota.SmokeTest.csprojindex a1b22fe5..f080c531 100644--- a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj+++ b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj@@ -49,6 +49,9 @@<Compile Include="..\..\src\managed\Nota.App\Controls\ValueText.cs" Link="ValueText.cs" /><!-- Clip editor position / tempo / ruler math (specs/036; no Avalonia inside). --><Compile Include="..\..\src\managed\Nota.App\ClipEditor\*.cs" LinkBase="ClipEditor" />+ <!-- The splash's per-release art: scene + composer (specs/074; no Avalonia inside). -->+ <Compile Include="..\..\src\managed\Nota.App\Theme\SplashArt\SplashScene.cs" Link="SplashArt/SplashScene.cs" />+ <Compile Include="..\..\src\managed\Nota.App\Theme\SplashArt\SplashArtComposer.cs" Link="SplashArt/SplashArtComposer.cs" /></ItemGroup></Project>diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex 18b86aaf..2e9890a4 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -79,6 +79,8 @@ Console.WriteLine($"engine v{NotaEngine.Version}");foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunStudio()) Check(ok, label);Console.WriteLine("-- design: themes --");foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunThemes()) Check(ok, label);+ Console.WriteLine("-- design: splash art --");+ foreach (var (ok, label) in Nota.SmokeTest.SplashArtTests.Run()) Check(ok, label);Console.WriteLine("-- design: appearance --");foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunAppearance()) Check(ok, label);Console.WriteLine("-- design: interface scale --");@@ -138,6 +140,14 @@ if (args.Length >= 1 && args[0] == "--localization")Console.WriteLine(failures == 0 ? "LOCALIZATION PASSED" : $"LOCALIZATION FAILED ({failures})");return failures == 0 ? 0 : 1;}+// Splash art review sheet (specs/074): `--splash-sheet <out.html> [theme-id] [from-version] [count]`.+if (args.Length >= 2 && args[0] == "--splash-sheet")+{+ var sheetError = SplashArtTests.WriteSheet(args[1], args.Length > 2 ? args[2] : "studio-dark", args.Length > 3 ? args[3] : null,+ args.Length > 4 && int.TryParse(args[4], out var sheetCount) ? sheetCount : 40);+ Console.WriteLine(sheetError ?? $"wrote {args[1]}");+ return sheetError is null ? 0 : 1;+}// Command palette alone: `--palette`; `--palette-dump <query>` prints a query's ranking.if (args.Length >= 2 && args[0] == "--palette-dump") { PaletteTests.Dump(string.Join(' ', args[1..])); return 0; }if (args.Length >= 1 && args[0] == "--palette")diff --git a/tests/Nota.SmokeTest/SplashArtTests.cs b/tests/Nota.SmokeTest/SplashArtTests.csnew file mode 100644index 00000000..21179bf5--- /dev/null+++ b/tests/Nota.SmokeTest/SplashArtTests.cs@@ -0,0 +1,284 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The splash's per-release art (specs/074): the composer is deterministic, neighbouring+// versions differ, every scene keeps the colour rules (track palette, one live accent,+// neutral overlays), composing is cheap, and odd version strings never throw. Plus the+// review sheet (`--splash-sheet`): many versions as SVGs on one HTML page, resolved+// against a theme file, so the art can be judged without building each release.++using System.Diagnostics;+using System.Globalization;+using System.Text;+using System.Text.Json;+using Nota.App;++namespace Nota.SmokeTest;++internal static class SplashArtTests+{+ private static readonly string[] Range = Enumerable.Range(60, 20)+ .SelectMany(minor => Enumerable.Range(0, 10).Select(p => $"0.{minor}.{p}")).ToArray();++ public static IEnumerable<(bool Ok, string Label)> Run()+ {+ // Seed and PRNG match the reviewed prototype (prototype.html: seedOf / rng).+ var rng = new SplashArtComposer.Mulberry32(SplashArtComposer.Hash("0.58.1"));+ double r1 = rng.Next(), r2 = rng.Next(), r3 = rng.Next();+ yield return (SplashArtComposer.Hash("0.58.1") == 3467694582u && SplashArtComposer.Hash("0.58") == 3356754079u+ && SplashArtComposer.Hash("") == 535972289u+ && Math.Abs(r1 - 0.03265987150371075) < 1e-12 && Math.Abs(r2 - 0.4006672299001366) < 1e-12+ && Math.Abs(r3 - 0.8660609039943665) < 1e-12,+ "seed hash and mulberry32 match the reviewed prototype");++ // SC-001: the same version always gives the same scene.+ var sample = Range.Where((_, i) => i % 4 == 0).ToArray();+ var unstable = sample.Where(v => !SplashArtComposer.Compose(v).Equals(SplashArtComposer.Compose(v))).ToArray();+ yield return (unstable.Length == 0, unstable.Length == 0+ ? $"same version → same scene ({sample.Length} versions)"+ : $"scene differs between two composes: {string.Join(", ", unstable.Take(5))}");++ // SC-002: consecutive patches change family; all 200 scenes distinct and non-empty.+ var scenes = Range.Select(SplashArtComposer.Compose).ToArray();+ var sameFamily = new List<string>();+ for (int i = 1; i < scenes.Length; i++)+ if (i % 10 != 0 && scenes[i].Family == scenes[i - 1].Family) sameFamily.Add(scenes[i].Version);+ yield return (sameFamily.Count == 0, sameFamily.Count == 0+ ? "consecutive patches change motif family (0.60.0–0.79.9)"+ : $"same family as the previous patch: {string.Join(", ", sameFamily.Take(5))}");+ int distinct = scenes.Select(s => s.Items).Distinct().Count();+ yield return (distinct == scenes.Length && scenes.All(s => s.Items.Count > 0),+ $"{distinct}/{scenes.Length} scenes distinct, none empty");+ var families = scenes.Select(s => s.Family).Distinct().Count();+ yield return (families == 6, $"all six motif families occur ({families})");++ // Geometry stays near the card. Motifs may run past the art region on purpose (outer+ // rhythm rings, the last notes of a roll); the renderer clips them. A point more than+ // a card's size away means a broken formula, not a composition.+ static IEnumerable<SPoint> Points(Prim p) => p switch+ {+ RectPrim r => new[] { new SPoint(r.R.X, r.R.Y), new SPoint(r.R.X + r.R.W, r.R.Y + r.R.H) },+ LinePrim l => new[] { l.A, l.B },+ PolylinePrim pl => pl.Points,+ PolygonPrim pg => pg.Points,+ CirclePrim c => new[] { c.C },+ _ => Array.Empty<SPoint>(),+ };+ var stray = scenes.Where(s => s.Items.SelectMany(Points).Any(p =>+ !double.IsFinite(p.X) || !double.IsFinite(p.Y) || p.X < -SplashScene.Width || p.X > 2 * SplashScene.Width || p.Y < -SplashScene.Height || p.Y > 2 * SplashScene.Height))+ .Select(s => s.Version).ToArray();+ yield return (stray.Length == 0, stray.Length == 0 ? "every coordinate is finite and near the card"+ : $"coordinates far off the card: {string.Join(", ", stray.Take(5))}");++ // Edge versions: never throw, always a valid scene; a pre-release keeps its release's family.+ var edges = new[] { "", "0.0.0", "abc", "0.71.0-beta.1", "1.2.3+deadbeef", " 0.58.1 ", "99999999999.1.2" };+ var broken = new List<string>();+ foreach (var v in edges)+ {+ try { if (SplashArtComposer.Compose(v).Items.Count == 0) broken.Add($"'{v}' empty"); }+ catch (Exception e) { broken.Add($"'{v}' threw {e.GetType().Name}"); }+ }+ yield return (broken.Count == 0, broken.Count == 0 ? "odd version strings give valid scenes" : string.Join("; ", broken));+ yield return (SplashArtComposer.Compose("0.71.0-beta.1").Family == SplashArtComposer.Compose("0.71.0").Family,+ "a pre-release keeps its release's motif family");++ // FR-006: track palette by mode, at most one live accent mark, overlays neutral; FR-004 weights.+ var colourIssues = new List<string>();+ foreach (var s in scenes)+ {+ int want = s.PaletteMode switch { SplashPaletteMode.Mono => 1, SplashPaletteMode.Pair => 2, _ => 3 };+ if (s.Palette.Count != want || s.Palette.Any(i => i is < 0 or > 8)) colourIssues.Add($"{s.Version} palette");+ if (!new[] { 1.5, 2, 2.5, 3 }.Contains(s.StrokeWeight)) colourIssues.Add($"{s.Version} weight {s.StrokeWeight}");+ int accents = s.Items.Count(p => p.Paints.SelectMany(x => x.Colors).Any(c => c.Role == SplashRole.Accent));+ if (accents > 2) colourIssues.Add($"{s.Version} {accents} accent items");+ if (s.Items.Skip(s.OverlayStart).Any(p => p.Paints.SelectMany(x => x.Colors).Any(c => !c.IsNeutral)))+ colourIssues.Add($"{s.Version} coloured overlay");+ if (s.Items.Any(p => p.Paints.SelectMany(x => x.Colors).Any(c => c.Role == SplashRole.Track && !s.Palette.Contains(c.TrackIndex))))+ colourIssues.Add($"{s.Version} track colour outside its palette");+ }+ yield return (colourIssues.Count == 0, colourIssues.Count == 0+ ? "colour: version palette, ≤ 1 live accent mark, neutral overlays, weights 1.5–3"+ : $"colour rules broken: {string.Join(", ", colourIssues.Take(6))}");++ // FR-006: how much is coloured varies with the version. In a roll, the share of notes+ // (the 2-radius rects) in palette colours follows the version's colour share.+ var rolls = scenes.Where(s => s.Family == SplashFamily.Roll).Select(s =>+ {+ var notes = s.Items.Take(s.OverlayStart).OfType<RectPrim>().Where(r => r.Radius == 2).ToArray();+ double lit = notes.Count(n => n.Fill?.Colors.Any(c => c.Role == SplashRole.Track) == true);+ return (Share: s.ColourShare, Lit: notes.Length == 0 ? s.ColourShare : lit / notes.Length);+ }).ToArray();+ double meanError = rolls.Average(x => Math.Abs(x.Lit - x.Share));+ double spread = rolls.Max(x => x.Lit) - rolls.Min(x => x.Lit);+ yield return (rolls.Length > 10 && meanError < 0.15 && spread > 0.3,+ $"colour share varies by version: coloured notes follow it (mean error {meanError.ToString("0.00", CultureInfo.InvariantCulture)}, spread {spread.ToString("0.00", CultureInfo.InvariantCulture)}, {rolls.Length} rolls)");++ // One role → token table: every name it gives exists in every theme file.+ var root = RepoRoot();+ var missingTokens = new List<string>();+ if (root is not null)+ {+ var refs = Enum.GetValues<SplashRole>().Where(r => r != SplashRole.Track).Select(r => new ColorRef(r))+ .Concat(Enumerable.Range(0, 9).Select(i => new ColorRef(SplashRole.Track, i))).ToArray();+ foreach (var f in Directory.GetFiles(Path.Combine(root, "src/managed/Nota.App/Theme/Themes"), "*.json"))+ {+ var colors = JsonDocument.Parse(File.ReadAllText(f)).RootElement.GetProperty("colors");+ missingTokens.AddRange(refs.Select(SplashTokens.Name).Where(n => !colors.TryGetProperty(n, out _))+ .Select(n => $"{Path.GetFileNameWithoutExtension(f)}:{n}"));+ }+ }+ yield return (root is not null && missingTokens.Count == 0, missingTokens.Count == 0+ ? "every splash colour role names a token every theme defines"+ : $"tokens missing: {string.Join(", ", missingTokens.Take(6))}");++ // SC-005 budget: composing is cheap enough to do synchronously before the first paint.+ for (int i = 0; i < 5; i++) SplashArtComposer.Compose($"0.1.{i}"); // JIT warm-up+ var times = Range.Take(20).Select(v =>+ {+ var sw = Stopwatch.StartNew();+ SplashArtComposer.Compose(v);+ return sw.Elapsed.TotalMilliseconds;+ }).OrderBy(t => t).ToArray();+ double median = times[times.Length / 2];+ yield return (median < 10, $"compose median {median.ToString("0.00", CultureInfo.InvariantCulture)} ms (< 10 ms)");+ }++ // ---- review sheet -------------------------------------------------------------------++ /// <summary>Writes an HTML page of the art for <paramref name="count"/> versions starting+ /// at <paramref name="from"/> (the next 4 patches, then successive minors), resolved+ /// against Theme/Themes/<paramref name="themeId"/>.json. Returns an error or null.</summary>+ public static string? WriteSheet(string outPath, string themeId, string? from, int count)+ {+ var root = RepoRoot();+ if (root is null) return "repo root not found";+ var themeFile = Path.Combine(root, "src/managed/Nota.App/Theme/Themes", themeId + ".json");+ if (!File.Exists(themeFile)) return $"no theme '{themeId}' in Theme/Themes";+ var colours = JsonDocument.Parse(File.ReadAllText(themeFile)).RootElement.GetProperty("colors")+ .EnumerateObject().ToDictionary(p => p.Name, p => p.Value.GetString() ?? "#000000");+ from ??= File.ReadAllText(Path.Combine(root, "VERSION")).Trim();++ var versions = new List<string> { from };+ var m = System.Text.RegularExpressions.Regex.Match(from, @"^(\d+)\.(\d+)\.(\d+)");+ if (m.Success)+ {+ int major = int.Parse(m.Groups[1].Value), minor = int.Parse(m.Groups[2].Value), patch = int.Parse(m.Groups[3].Value);+ for (int i = 1; i <= 4 && versions.Count < count; i++) versions.Add($"{major}.{minor}.{patch + i}");+ for (int i = 1; versions.Count < count; i++) versions.Add($"{major}.{minor + i}.0");+ }++ var page = new StringBuilder();+ page.Append("<!doctype html><meta charset=\"utf-8\"><title>Nota splash art — ").Append(themeId).Append("</title>")+ .Append("<style>body{margin:0;padding:24px;background:#111214;font:12px ui-monospace,Menlo,monospace;color:#92969D}")+ .Append(".g{display:grid;grid-template-columns:repeat(4,420px);gap:18px}svg{display:block}</style><div class=\"g\">");+ int uid = 0;+ foreach (var v in versions)+ {+ var s = SplashArtComposer.Compose(v);+ page.Append("<div>").Append(Svg(s, colours, ref uid))+ .Append($"<div>{v} · {s.Family}{(s.Overlay is { } o ? "+" + o : "")} · {s.PaletteMode} · {s.Layout}</div></div>");+ }+ page.Append("</div>");+ try { File.WriteAllText(outPath, page.ToString()); }+ catch (Exception e) { return $"cannot write {outPath}: {e.Message}"; }+ return null;+ }++ private static string Svg(SplashScene s, IReadOnlyDictionary<string, string> theme, ref int uid)+ {+ var defs = new StringBuilder();+ var body = new StringBuilder();+ string id = "s" + uid++;+ int g = 0;+ string N(double v) => v.ToString("0.##", CultureInfo.InvariantCulture);+ (byte, byte, byte) Hex(string token)+ {+ var h = theme.TryGetValue(token, out var x) ? x.TrimStart('#') : "000000";+ return (Convert.ToByte(h[..2], 16), Convert.ToByte(h[2..4], 16), Convert.ToByte(h[4..6], 16));+ }+ string Col(ColorRef c, out double alpha)+ {+ var (a, r, gg, b) = SplashTokens.Shade(c, Hex(SplashTokens.Name(c)), Hex("BgSunken"));+ alpha = a / 255.0;+ return $"#{r:X2}{gg:X2}{b:X2}";+ }+ string Fill(Paint? p)+ {+ switch (p)+ {+ case null: return "none";+ case SolidPaint sp:+ {+ var hex = Col(sp.Color, out var a);+ return a < 1 ? $"{hex}\" fill-opacity=\"{N(a)}" : hex;+ }+ case LinearPaint lp:+ {+ var gid = $"{id}g{g++}";+ defs.Append($"<linearGradient id=\"{gid}\" x1=\"{N(lp.Start.X)}\" y1=\"{N(lp.Start.Y)}\" x2=\"{N(lp.End.X)}\" y2=\"{N(lp.End.Y)}\"")+ .Append(lp.Space == PaintSpace.Art ? " gradientUnits=\"userSpaceOnUse\">" : ">");+ foreach (var st in lp.Stops) defs.Append($"<stop offset=\"{N(st.Offset)}\" stop-color=\"{Col(st.Color, out var a)}\" stop-opacity=\"{N(a)}\"/>");+ defs.Append("</linearGradient>");+ return $"url(#{gid})";+ }+ case RadialPaint rp:+ {+ var gid = $"{id}g{g++}";+ defs.Append($"<radialGradient id=\"{gid}\" cx=\"{N(rp.Center.X)}\" cy=\"{N(rp.Center.Y)}\" r=\"{N(rp.Radius)}\"")+ .Append(rp.Space == PaintSpace.Art ? " gradientUnits=\"userSpaceOnUse\">" : ">");+ foreach (var st in rp.Stops) defs.Append($"<stop offset=\"{N(st.Offset)}\" stop-color=\"{Col(st.Color, out var a)}\" stop-opacity=\"{N(a)}\"/>");+ defs.Append("</radialGradient>");+ return $"url(#{gid})";+ }+ default: return "none";+ }+ }+ // A solid paint with alpha carries its own opacity attribute; as a stroke it must name stroke-opacity.+ string Strk(Paint? p) => Fill(p).Replace("fill-opacity", "stroke-opacity");+ string Pts(IEnumerable<SPoint> pts) => string.Join(" ", pts.Select(q => $"{N(q.X)},{N(q.Y)}"));++ foreach (var p in s.Items)+ {+ switch (p)+ {+ case RectPrim r:+ body.Append($"<rect x=\"{N(r.R.X)}\" y=\"{N(r.R.Y)}\" width=\"{N(r.R.W)}\" height=\"{N(r.R.H)}\" rx=\"{N(r.Radius)}\" fill=\"{Fill(r.Fill)}\" stroke=\"{Strk(r.Stroke)}\" stroke-width=\"{N(r.StrokeWidth)}\"/>");+ break;+ case LinePrim l:+ body.Append($"<line x1=\"{N(l.A.X)}\" y1=\"{N(l.A.Y)}\" x2=\"{N(l.B.X)}\" y2=\"{N(l.B.Y)}\" stroke=\"{Strk(l.Stroke)}\" stroke-width=\"{N(l.StrokeWidth)}\" stroke-linecap=\"round\"/>");+ break;+ case PolylinePrim pl:+ body.Append($"<polyline points=\"{Pts(pl.Points)}\" fill=\"{Fill(pl.Fill)}\" stroke=\"{Strk(pl.Stroke)}\" stroke-width=\"{N(pl.StrokeWidth)}\" stroke-linejoin=\"round\" stroke-linecap=\"round\"/>");+ break;+ case PolygonPrim pg:+ body.Append($"<polygon points=\"{Pts(pg.Points)}\" fill=\"{Fill(pg.Fill)}\"/>");+ break;+ case CirclePrim c:+ body.Append($"<circle cx=\"{N(c.C.X)}\" cy=\"{N(c.C.Y)}\" r=\"{N(c.R)}\" fill=\"{Fill(c.Fill)}\" stroke=\"{Strk(c.Stroke)}\" stroke-width=\"{N(c.StrokeWidth)}\"/>");+ break;+ }+ }++ var a = s.ArtRect;+ var ground = Col(new ColorRef(SplashRole.Ground), out _);+ var seam = Col(new ColorRef(SplashRole.Seam), out _);+ string seamLine = s.Layout switch+ {+ SplashLayout.TextLeft => $"<line x1=\"{N(a.X + 0.5)}\" y1=\"0\" x2=\"{N(a.X + 0.5)}\" y2=\"300\" stroke=\"{seam}\"/>",+ SplashLayout.TextRight => $"<line x1=\"{N(a.X + a.W - 0.5)}\" y1=\"0\" x2=\"{N(a.X + a.W - 0.5)}\" y2=\"300\" stroke=\"{seam}\"/>",+ _ => $"<line x1=\"0\" y1=\"{N(a.Y + a.H - 0.5)}\" x2=\"420\" y2=\"{N(a.Y + a.H - 0.5)}\" stroke=\"{seam}\"/>",+ };+ return $"<svg width=\"420\" height=\"300\" viewBox=\"0 0 420 300\" xmlns=\"http://www.w3.org/2000/svg\"><defs>{defs}"+ + $"<clipPath id=\"{id}a\"><rect x=\"{N(a.X)}\" y=\"{N(a.Y)}\" width=\"{N(a.W)}\" height=\"{N(a.H)}\"/></clipPath>"+ + $"<clipPath id=\"{id}k\"><rect width=\"420\" height=\"300\" rx=\"3\"/></clipPath></defs>"+ + $"<g clip-path=\"url(#{id}k)\"><rect width=\"420\" height=\"300\" fill=\"{ground}\"/><g clip-path=\"url(#{id}a)\">{body}</g>{seamLine}"+ + $"<rect x=\".5\" y=\".5\" width=\"419\" height=\"299\" rx=\"3\" fill=\"none\" stroke=\"{seam}\"/></g></svg>";+ }++ private static string? RepoRoot()+ {+ var d = new DirectoryInfo(AppContext.BaseDirectory);+ while (d is not null && !File.Exists(Path.Combine(d.FullName, "Nota.sln"))) d = d.Parent;+ return d?.FullName;+ }+}