From d472dfdec15d8e84ed940fe8a3d44e4850516bb4 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Thu, 5 Nov 2026 01:48:33 +0100 Subject: [PATCH] feat: phase 5 groundwork (playback format 3, videos contracts, migration 0010, strings) Lays down every contract the later parcels of owner review 1 phase 5 build on, so they compile against shared types without touching each other's files. - Settings format 3: export.playback (direction, loops, fades, hold), omitted at its default and member by member; RequiredFormat is 3 only while used. - OutputProgram public API with a forward-only body; still-frame job parameters (StillFrame, StillPhoto) routed to format-3 nodes only. - Render.Sha256/Kind, RenderCopy, RenderKind; JobKind.VideoCopy = 24. - Migration 0010 (sqlite, postgres): renders.sha256/kind, ix_renders_created, render_copies without a foreign key. - Videos protocol DTOs, client calls, ServerCapabilities.Videos (declared, not announced yet), ServerSettingsDto.VideosPath. - IVideoLibrary with a NotImplemented stub registered on the server; TrashKind.Videos, VideoTrashNames, VideoErrors. - en and it strings for the whole phase, five icons, decisions 1-22 and the open-question defaults; tests that used format 3 as "newer" now use 4. Refs #21 Co-Authored-By: Claude Opus 5.5 --- branding/ui-icons/icons.py | 11 +- branding/ui-icons/icons.svg | 431 +++++++++--------- docs/DECISIONS.md | 24 + i18n/en/Admin.resx | 82 ++++ i18n/en/Archive.resx | 1 + i18n/en/Editor.resx | 8 + i18n/en/Errors.resx | 9 + i18n/en/Export.resx | 66 +++ i18n/en/Jobs.resx | 1 + i18n/en/Server.resx | 7 + i18n/en/Settings.resx | 4 + i18n/en/Shell.resx | 1 + i18n/en/Tooltips.resx | 77 ++++ i18n/en/Videos.resx | 68 +++ i18n/it/Admin.it.resx | 82 ++++ i18n/it/Archive.it.resx | 1 + i18n/it/Editor.it.resx | 8 + i18n/it/Errors.it.resx | 9 + i18n/it/Export.it.resx | 66 +++ i18n/it/Jobs.it.resx | 1 + i18n/it/Server.it.resx | 7 + i18n/it/Settings.it.resx | 4 + i18n/it/Shell.it.resx | 1 + i18n/it/Tooltips.it.resx | 77 ++++ i18n/it/Videos.it.resx | 68 +++ src/Chronos.App/Server/SyncText.cs | 1 + src/Chronos.Core/Model/Entities.cs | 69 +++ src/Chronos.Core/Model/Enums.cs | 6 + src/Chronos.Core/Project/ProjectSettings.cs | 133 +++++- src/Chronos.Core/Render/OutputProgram.cs | 81 ++++ src/Chronos.Core/Render/RenderRules.cs | 20 + src/Chronos.Data/Archiving/ArchiveService.cs | 6 + src/Chronos.Data/Archiving/SequenceTrash.cs | 6 + .../Migrations/postgres/0010_videos.sql | 21 + .../Migrations/sqlite/0010_videos.sql | 21 + src/Chronos.Data/Processing/ProcessingJobs.cs | 28 ++ src/Chronos.Data/Videos/IVideoLibrary.cs | 289 ++++++++++++ src/Chronos.Protocol/Admin.cs | 6 +- src/Chronos.Protocol/Client/ChronosClient.cs | 36 ++ src/Chronos.Protocol/Dtos.cs | 6 + src/Chronos.Protocol/Jobs.cs | 22 +- src/Chronos.Protocol/ProtocolJson.cs | 6 + src/Chronos.Protocol/Sequences.cs | 9 +- src/Chronos.Protocol/Uploads.cs | 6 +- src/Chronos.Protocol/Videos.cs | 132 ++++++ src/Chronos.Server/Admin/web/icons.js | 6 + src/Chronos.Server/Storage/ArchiveModule.cs | 3 + src/Chronos.Ui/Icons/Icons.xaml | 5 + .../Editor/CameraTabTests.cs | 4 +- .../Editor/EditorSessionTests.cs | 2 +- .../Editor/ProjectHistoryTests.cs | 2 +- .../Project/ProjectBundleTests.cs | 4 +- .../Project/ProjectContentTests.cs | 6 +- .../Project/ProjectSettingsTests.cs | 149 +++++- .../Render/OutputProgramTests.cs | 64 +++ .../Render/RenderRulesTests.cs | 14 +- tests/Chronos.Data.Tests/Jobs/JobWireTests.cs | 1 + .../Migrations/MigrationTests.cs | 36 ++ .../Processing/ProjectStoreTests.cs | 2 +- .../Processing/RenderJobTests.cs | 4 +- .../Projects/ProjectMergeTests.cs | 6 +- .../Projects/ProjectRecoveryTests.cs | 4 +- .../Chronos.Data.Tests/Sync/SyncRulesTests.cs | 2 +- .../Workspaces/WorkspaceTests.cs | 2 +- .../Chronos.Server.Tests/Api/ProjectTests.cs | 6 +- .../Api/VideoContractTests.cs | 115 +++++ tests/fixtures/settings/format3-playback.json | 22 + 67 files changed, 2233 insertions(+), 244 deletions(-) create mode 100644 i18n/en/Videos.resx create mode 100644 i18n/it/Videos.it.resx create mode 100644 src/Chronos.Core/Render/OutputProgram.cs create mode 100644 src/Chronos.Data/Migrations/postgres/0010_videos.sql create mode 100644 src/Chronos.Data/Migrations/sqlite/0010_videos.sql create mode 100644 src/Chronos.Data/Videos/IVideoLibrary.cs create mode 100644 src/Chronos.Protocol/Videos.cs create mode 100644 tests/Chronos.Core.Tests/Render/OutputProgramTests.cs create mode 100644 tests/Chronos.Server.Tests/Api/VideoContractTests.cs create mode 100644 tests/fixtures/settings/format3-playback.json diff --git a/branding/ui-icons/icons.py b/branding/ui-icons/icons.py index 2a4f0971..408239d6 100644 --- a/branding/ui-icons/icons.py +++ b/branding/ui-icons/icons.py @@ -162,6 +162,14 @@ I["Mirror"] = ("M8 1.5 V3 M8 5.5 V7.5 M8 10 V12 M8 14 V14.5 M6 4 V12.5 H1.5 Z", I["Flip"] = ("M1.5 8 H3 M5.5 8 H7.5 M10 8 H12 M14 8 H14.5 M4 6 H12.5 V1.5 Z", "M4 10 L12.5 14.5 V10 Z") I["Straighten"] = ("M1.5 12.5 H14.5 M2.5 12.5 L13 6 "+arc(2.5,12.5,7,58.2,90), None) +# Owner review 1, phase 5: the Videos section (a clip in front of the stack of the others), Copy to folder, Save frame +# (one frame of a filmstrip held), the playback fades (a ramp from black) and the boomerang direction (there and back). +I["Videos"] = (rr(1.5,4,11,10,1.5)+" M4.5 1.5 H13 A1.5 1.5 0 0 1 14.5 3 V11.5", "M5.5 6.5 L9.5 9 L5.5 11.5 Z") +I["CopyToFolder"] = (I["Folder"][0]+" M8 6.5 V11 M6 9 L8 11 L10 9", None) +I["StillFrame"] = (I["Filmstrip"][0], rr(6,5.5,4,5,0.5)) +I["Fade"] = (rr(1.5,2.5,13,11,1.5), "M3 12 L13 4 V12 Z") +I["Boomerang"] = ("M2 5 H11 A3 3 0 0 1 11 11 H3 M5 8.8 L2.8 11 L5 13.2", None) + # Glyphs that point along the reading direction (arrows, chevrons, start-aligned text lines): mirrored in RTL. # Everything else (clocks, media controls, the ▶ rendered status, symmetric shapes) never mirrors. DIRECTIONAL = {"Back", "Forward", "ChevronLeft", "ChevronRight", "ExternalLink", "Jobs", "Logs", "ViewList"} @@ -206,7 +214,8 @@ WEB = {"dashboard": "Library", "library": "Image", "users": "Users", "archive": "logs": "Logs", "menu": "Menu", "power": "Power", "moon": "Moon", "refresh": "Refresh", "close": "Close", "plus": "Plus", "copy": "Copy", "search": "Search", "grid": "ViewGrid", "list": "ViewList", "trash": "Delete", "upload": "Upload", "download": "Download", "back": "Back", "previous": "ChevronLeft", "next": "ChevronRight", "star": "Star", - "starFilled": "StarFilled", "hero": "Hero", "image": "Image", "warning": "Warning"} + "starFilled": "StarFilled", "hero": "Hero", "image": "Image", "warning": "Warning", "videos": "Videos", + "play": "Play", "copyToFolder": "CopyToFolder", "stillFrame": "StillFrame", "fade": "Fade", "boomerang": "Boomerang"} STROKE = 'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"' with write(os.path.join(here, "..", "..", "src", "Chronos.Server", "Admin", "web", "icons.js")) as f: f.write("// Generated by branding/ui-icons/icons.py (same 16-px set as the desktop apps). Do not edit by hand.\n") diff --git a/branding/ui-icons/icons.svg b/branding/ui-icons/icons.svg index 092669c9..d7527c6f 100644 --- a/branding/ui-icons/icons.svg +++ b/branding/ui-icons/icons.svg @@ -1,4 +1,4 @@ - + @@ -20,420 +20,443 @@ Back + + +Boomerang + -Calendar - +Calendar + -Camera - +Camera + -Cancel - +Cancel + -Card - +Card + -Chart - +Chart + -Check - +Check + -ChevronDown - +ChevronDown + -ChevronLeft - +ChevronLeft + -ChevronRight - +ChevronRight + -ChevronUp - +ChevronUp + -Clipboard - +Clipboard + -Clock - +Clock + -Close - +Close + -Compare - +Compare + -Copy - +Copy + + + +CopyToFolder + -CropMask - +CropMask + -Cross - +Cross + -Database - +Database + -Delete - +Delete + -Dot - +Dot + -Download - +Download + -Drive - +Drive + -Duplicate - +Duplicate + -Eject - +Eject + -ErrorCircle - +ErrorCircle + -Exclude - +Exclude + -Export - +Export + -Exposure - +Exposure + -ExternalLink - +ExternalLink + -Eye - +Eye + + + + +Fade + -Filmstrip - +Filmstrip + -Filter - +Filter + -Flip - +Flip + -Folder - +Folder + -FolderOpen - +FolderOpen + -Forward - +Forward + -Fullscreen - +Fullscreen + -Gpu - +Gpu + -Grip - +Grip + -HalfDot - +HalfDot + -Hero - +Hero + -Image - +Image + -Import - +Import + -Info - +Info + -Jobs - +Jobs + -Key - +Key + -Keyframe - +Keyframe + -Layers - +Layers + -Library - +Library + -Link - +Link + -Lock - +Lock + -Logs - +Logs + -Menu - +Menu + -Minus - +Minus + -Mirror - +Mirror + -Moon - +Moon + -More - +More + -Motion - +Motion + -Network - +Network + -Optimise - +Optimise + -Pause - +Pause + -Play - +Play + -Plus - +Plus + -Power - +Power + -Refresh - +Refresh + -Regions - +Regions + -Render - +Render + -Reset - +Reset + -Retry - +Retry + -Ring - +Ring + -RotateLeft - +RotateLeft + -RotateRight - +RotateRight + -Search - +Search + -Sequence - +Sequence + -Server - +Server + -Settings - +Settings + -Sort - +Sort + -Spline - +Spline + -Stack - +Stack + -Star - +Star + -StarFilled - +StarFilled + + + + +StillFrame + -Stop - +Stop + -Straighten - +Straighten + -SuccessCircle - +SuccessCircle + -Sun - +Sun + -Sync - +Sync + -Tag - +Tag + -Time - +Time + -Tray - +Tray + -Triangle - +Triangle + -TriangleRight - +TriangleRight + -Upload - +Upload + -User - +User + -Users - +Users + -Vectors - +Vectors + -Verify - +Verify + + + + +Videos + -ViewGrid - +ViewGrid + -ViewList - +ViewList + -ViewTimeline - +ViewTimeline + -Warning - +Warning + -Window - +Window + -Wipe +Wipe \ No newline at end of file diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index f6634ebe..0e4b1ddc 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -734,3 +734,27 @@ One line per decision: date · decision · alternative · reason. | 2026-11-04 | Phase 4 review fixes, routing and gates: render routing sizes a job from its resolved preset box, never from the size posted with it (the posted size only without a preset size); the server's wait for a node re-routes the job as the claim does; the remote editor lets edits happen but refuses to save settings the server cannot read (`NeedsNewerServer` toast); archive sync keeps such settings here (`ServerFormatException`, the row stays LocalAhead with the reason; the server's format is cached for 1 minute, none announced = 1); a workspace push is refused whole, before its first version, when any unpushed version needs a newer home, and Sync's reason includes the unpushed versions; a local render of a workspace project (`RendersLocally`) is not gated by the server's format; the Library's Render on a remote card applies the editor's older-server gate and sizes the job on the project it read, without embedding it (the server renders the sequence's settings of the moment). (Owner review 1, phase 4.) | Let the server refuse | Nothing an older server would store and then fail to render is sent to it, and no job waits for a node that never takes it. | | 2026-11-04 | Phase 4 review fixes, editing: a turn or mirror on one side and a framing edit on the other (crop, keyframes, offsets, aspect, keyframes of waiting photos) are one merge conflict at the orientation member, settled with that side's framing; the derived top-level `version` is no settings difference while both are at most this Chronos's; a quarter turn transposes the aspect text without reducing it (21:9 → 9:21); an out-of-range crop is turned as it renders (clamped first); off-grid crop and keyframe values land on the 12-decimal grid at their first press and the keyframe centre sliders write gridded values; the Rotation row shows the turn as seen (reversed while exactly one of Mirror and Flip is on); Reset framing undoes the orientation press by press so keyframes and aspect stay on their content; the look strength minimum is 1 % and 0 or less clears the look; motion vectors are computed without the look and the knee; the horizon advisor maps its rows through turn, flip, straighten and cover zoom (the mirror moves only columns); inside a box with no slack a press pans while zoomed and the middle button always pans; the selected box shows a 2 px Accent ring; translations of keys whose English meaning changed are deleted (English fallback) instead of new keys. (Owner review 1, phase 4.) | — | Simplest safe choices for the review's findings. | | 2026-11-04 | Project text is written with LF on every OS (`NewLine = "\n"` in the `ProjectJson` source-gen options and in `ProjectSettings.IndentedJson`), so a project's canonical text and content hash are the same on Windows and on the Linux server. Versions already stored keep their text and hash (a Windows build's are CRLF): `ProjectContent.SameChoices` compares both texts with CRLF read as LF (lossless: a raw CR or LF in the JSON is whitespace between tokens), and the places that ask "is this text that version" (the workspace's tip and base, the head a render names, the render job's version, the send's matching version, the history's current marker) use `ProjectContent.MatchesHash`, true for the hash of the text's LF or CRLF form. Integrity checks (`Verifies` of a stored or pushed version, stored hash against stored hash) stay exact. The other indented JSON writers (`AdvisorJson`, `ArchiveJsonIndented`, `WorkspaceJson`, `WorkspaceMoveJson`, the `ProjectBundle` writer, settings files) feed no project hash and are left as they are. | LF only, comparisons exact | With LF alone, every version a Windows build stored would stop matching the text the new build writes: unchanged projects would read as modified at the upgrade. | +| 2026-11-05 | Owner review 1 phase 5 (1): the editor header's Render button reads "Render" (Ctrl+R, `Editor.RenderButton`) at a fixed width; its tooltip (`Tooltips.Editor.RenderDetails`) gives preset, size, codec, fps, estimated size and time and the blocked reason; the Render menu's checked item shows the current preset. Supersedes "Render · preset" (`Editor.Render`, removed in phase 5's prune). | Keep the preset in the label (Q3) | The label's width changed with every preset and pushed the header around; the details stay one hover away. | +| 2026-11-05 | Owner review 1 phase 5 (2): the Render menu lists, in order, the recommended preset, the batch presets, up to 3 recent presets of this sequence's render history and "Other presets ›" grouped by `ExportPreset.Group`; then a separator, Render batch (n), Add to queue, Save frame ›, Videos of this sequence. Each preset item has a muted size · codec · fps line; no estimates in the menu. | Estimates per item | An estimate costs a render plan per preset; the menu must open at once. | +| 2026-11-05 | Owner review 1 phase 5 (3): a grouped preset table (28 px rows, collapsible group headers; columns batch ☐, Name + Recommended chip, Size, Codec, fps, Est. size, Est. time) replaces the preset cards of the Export step; a row click selects, the checkbox adds to the batch. Supersedes the card grid. | Keep the cards | Twenty presets as cards did not fit the measure area; a table compares them. | +| 2026-11-05 | Owner review 1 phase 5 (4): collapsible setting groups are a new DESIGN §4 pattern: the header is the group name (Text.Body 600) with a chevron and, collapsed, a muted one-line summary; the state is kept per group in app settings, not in the project. Defaults: Output open, Encoding collapsed, Playback collapsed, File open. | Tabs inside the step | One scroll keeps every value reachable; summaries show the collapsed values. | +| 2026-11-05 | Owner review 1 phase 5 (5): the Export footer stays fixed below the scrolling groups with the summary " · ·