From 5aeb6aa78741a0df3bf5347d003a2065afdbd8b5 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Mon, 19 Oct 2026 12:10:42 +0200 Subject: [PATCH] Add comprehensive tests for EditSection functionality in the Windows application - Implement tests for picker behavior, including loading sequences, searching, and handling empty libraries. - Validate sequence opening via Enter key and double-click actions. - Ensure proper handling of unsaved edits and sequence deletion scenarios. - Verify accessibility features for picker rows across different languages. - Introduce a dialog counting mechanism to manage unsaved edit confirmations. --- docs/ARCHITECTURE.md | 4 +- docs/BRIEF.md | 65 ++- docs/CHANGELOG.md | 20 + docs/DECISIONS.md | 5 + docs/STATUS.md | 5 +- docs/requests/2026-10-15-owner-review-1.md | 4 +- docs/ui/DESIGN.md | 18 +- docs/ui/mockups/Archive.html | 2 +- docs/ui/mockups/Editor.html | 76 +-- docs/ui/mockups/Export.html | 72 +-- docs/ui/mockups/Import.html | 2 +- docs/ui/mockups/Jobs.html | 2 +- docs/ui/mockups/Main.html | 2 +- docs/ui/mockups/Server.html | 2 +- docs/ui/mockups/Settings.html | 2 +- docs/ui/mockups/Welcome.html | 2 +- i18n/GLOSSARY.md | 6 +- i18n/ar/Editor.ar.resx | 46 +- i18n/ar/Shell.ar.resx | 2 +- i18n/ar/Tooltips.ar.resx | 36 +- i18n/ar/glossary.tsv | 4 + i18n/bg/Editor.bg.resx | 44 +- i18n/bg/Shell.bg.resx | 2 +- i18n/bg/Tooltips.bg.resx | 34 +- i18n/bg/glossary.tsv | 4 + i18n/cs/Editor.cs.resx | 45 +- i18n/cs/Shell.cs.resx | 2 +- i18n/cs/Tooltips.cs.resx | 35 +- i18n/cs/glossary.tsv | 4 + i18n/da/Editor.da.resx | 44 +- i18n/da/Shell.da.resx | 2 +- i18n/da/Tooltips.da.resx | 34 +- i18n/da/glossary.tsv | 4 + i18n/de/Editor.de.resx | 46 +- i18n/de/Shell.de.resx | 2 +- i18n/de/Tooltips.de.resx | 34 +- i18n/de/glossary.tsv | 4 + i18n/el/Editor.el.resx | 44 +- i18n/el/Shell.el.resx | 2 +- i18n/el/Tooltips.el.resx | 34 +- i18n/el/glossary.tsv | 4 + i18n/en/Editor.resx | 46 +- i18n/en/Shell.resx | 2 +- i18n/en/Tooltips.resx | 35 +- i18n/es/Editor.es.resx | 44 +- i18n/es/Shell.es.resx | 2 +- i18n/es/Tooltips.es.resx | 34 +- i18n/es/glossary.tsv | 4 + i18n/et/Editor.et.resx | 44 +- i18n/et/Shell.et.resx | 2 +- i18n/et/Tooltips.et.resx | 34 +- i18n/et/glossary.tsv | 4 + i18n/fi/Editor.fi.resx | 44 +- i18n/fi/Shell.fi.resx | 2 +- i18n/fi/Tooltips.fi.resx | 34 +- i18n/fi/glossary.tsv | 4 + i18n/fr/Editor.fr.resx | 44 +- i18n/fr/Shell.fr.resx | 2 +- i18n/fr/Tooltips.fr.resx | 34 +- i18n/fr/glossary.tsv | 4 + i18n/he/Editor.he.resx | 45 +- i18n/he/Shell.he.resx | 2 +- i18n/he/Tooltips.he.resx | 35 +- i18n/he/glossary.tsv | 4 + i18n/hi/Editor.hi.resx | 44 +- i18n/hi/Shell.hi.resx | 2 +- i18n/hi/Tooltips.hi.resx | 34 +- i18n/hi/glossary.tsv | 4 + i18n/hr/Editor.hr.resx | 45 +- i18n/hr/Shell.hr.resx | 2 +- i18n/hr/Tooltips.hr.resx | 35 +- i18n/hr/glossary.tsv | 4 + i18n/hu/Editor.hu.resx | 44 +- i18n/hu/Shell.hu.resx | 2 +- i18n/hu/Tooltips.hu.resx | 34 +- i18n/hu/glossary.tsv | 4 + i18n/id/Editor.id.resx | 44 +- i18n/id/Shell.id.resx | 2 +- i18n/id/Tooltips.id.resx | 34 +- i18n/id/glossary.tsv | 4 + i18n/it/Editor.it.resx | 50 +- i18n/it/Shell.it.resx | 2 +- i18n/it/Tooltips.it.resx | 34 +- i18n/ja/Editor.ja.resx | 44 +- i18n/ja/Shell.ja.resx | 2 +- i18n/ja/Tooltips.ja.resx | 34 +- i18n/ja/glossary.tsv | 4 + i18n/ko/Editor.ko.resx | 44 +- i18n/ko/Shell.ko.resx | 2 +- i18n/ko/Tooltips.ko.resx | 34 +- i18n/ko/glossary.tsv | 4 + i18n/lt/Editor.lt.resx | 45 +- i18n/lt/Shell.lt.resx | 2 +- i18n/lt/Tooltips.lt.resx | 35 +- i18n/lt/glossary.tsv | 4 + i18n/lv/Editor.lv.resx | 45 +- i18n/lv/Shell.lv.resx | 2 +- i18n/lv/Tooltips.lv.resx | 35 +- i18n/lv/glossary.tsv | 4 + i18n/ms/Editor.ms.resx | 44 +- i18n/ms/Shell.ms.resx | 2 +- i18n/ms/Tooltips.ms.resx | 34 +- i18n/ms/glossary.tsv | 4 + i18n/nb/Editor.nb.resx | 44 +- i18n/nb/Shell.nb.resx | 2 +- i18n/nb/Tooltips.nb.resx | 34 +- i18n/nb/glossary.tsv | 4 + i18n/nl/Editor.nl.resx | 44 +- i18n/nl/Shell.nl.resx | 2 +- i18n/nl/Tooltips.nl.resx | 34 +- i18n/nl/glossary.tsv | 4 + i18n/pl/Editor.pl.resx | 46 +- i18n/pl/Shell.pl.resx | 2 +- i18n/pl/Tooltips.pl.resx | 36 +- i18n/pl/glossary.tsv | 4 + i18n/pt-BR/Editor.pt-BR.resx | 44 +- i18n/pt-BR/Shell.pt-BR.resx | 2 +- i18n/pt-BR/Tooltips.pt-BR.resx | 34 +- i18n/pt-BR/glossary.tsv | 4 + i18n/pt-PT/Editor.pt-PT.resx | 44 +- i18n/pt-PT/Shell.pt-PT.resx | 2 +- i18n/pt-PT/Tooltips.pt-PT.resx | 34 +- i18n/pt-PT/glossary.tsv | 4 + i18n/ro/Editor.ro.resx | 45 +- i18n/ro/Shell.ro.resx | 2 +- i18n/ro/Tooltips.ro.resx | 35 +- i18n/ro/glossary.tsv | 4 + i18n/ru/Editor.ru.resx | 46 +- i18n/ru/Shell.ru.resx | 2 +- i18n/ru/Tooltips.ru.resx | 36 +- i18n/ru/glossary.tsv | 4 + i18n/sk/Editor.sk.resx | 45 +- i18n/sk/Shell.sk.resx | 2 +- i18n/sk/Tooltips.sk.resx | 35 +- i18n/sk/glossary.tsv | 4 + i18n/sl/Editor.sl.resx | 45 +- i18n/sl/Shell.sl.resx | 2 +- i18n/sl/Tooltips.sl.resx | 35 +- i18n/sl/glossary.tsv | 4 + i18n/sv/Editor.sv.resx | 44 +- i18n/sv/Shell.sv.resx | 2 +- i18n/sv/Tooltips.sv.resx | 34 +- i18n/sv/glossary.tsv | 4 + i18n/th/Editor.th.resx | 44 +- i18n/th/Shell.th.resx | 2 +- i18n/th/Tooltips.th.resx | 34 +- i18n/th/glossary.tsv | 4 + i18n/tr/Editor.tr.resx | 44 +- i18n/tr/Shell.tr.resx | 2 +- i18n/tr/Tooltips.tr.resx | 34 +- i18n/tr/glossary.tsv | 4 + i18n/uk/Editor.uk.resx | 46 +- i18n/uk/Shell.uk.resx | 2 +- i18n/uk/Tooltips.uk.resx | 36 +- i18n/uk/glossary.tsv | 4 + i18n/vi/Editor.vi.resx | 44 +- i18n/vi/Shell.vi.resx | 2 +- i18n/vi/Tooltips.vi.resx | 34 +- i18n/vi/glossary.tsv | 4 + i18n/zh-Hans/Editor.zh-Hans.resx | 44 +- i18n/zh-Hans/Shell.zh-Hans.resx | 2 +- i18n/zh-Hans/Tooltips.zh-Hans.resx | 34 +- i18n/zh-Hans/glossary.tsv | 4 + i18n/zh-Hant/Editor.zh-Hant.resx | 44 +- i18n/zh-Hant/Shell.zh-Hant.resx | 2 +- i18n/zh-Hant/Tooltips.zh-Hant.resx | 34 +- i18n/zh-Hant/glossary.tsv | 4 + src/Titano.App/Archive/SequenceDeletion.cs | 13 +- src/Titano.App/Editor/AnalysisTab.cs | 155 ++++++ src/Titano.App/Editor/EditPath.cs | 293 +++++++++++ src/Titano.App/Editor/EditorMeasures.xaml | 59 ++- src/Titano.App/Editor/EditorPanels.xaml | 45 +- src/Titano.App/Editor/EditorSession.cs | 13 + src/Titano.App/Editor/EditorSettings.cs | 21 + src/Titano.App/Editor/EditorStyles.xaml | 149 +++++- src/Titano.App/Editor/EditorTab.cs | 78 ++- src/Titano.App/Editor/EditorViewModel.cs | 191 ++++++- src/Titano.App/Editor/ExportTab.cs | 3 + src/Titano.App/Editor/ExposureTab.cs | 7 +- src/Titano.App/Editor/FramesTab.cs | 7 +- src/Titano.App/Editor/ISequenceSource.cs | 8 +- src/Titano.App/Editor/LocalSequenceSource.cs | 18 +- src/Titano.App/Editor/MotionTab.cs | 11 +- src/Titano.App/Editor/ProjectSaver.cs | 84 ++- src/Titano.App/Editor/RemoteSequenceSource.cs | 17 +- src/Titano.App/Editor/SequenceJobs.cs | 13 +- src/Titano.App/Infrastructure/AppServices.cs | 2 +- src/Titano.App/Infrastructure/AppSettings.cs | 3 + src/Titano.App/Library/SequenceItem.cs | 3 + src/Titano.App/Sections/LibraryView.xaml | 5 +- src/Titano.App/Sections/LibraryView.xaml.cs | 16 + src/Titano.App/Sections/LibraryViewModel.cs | 6 + .../Sections/SequencePickerView.xaml | 105 ++++ .../Sections/SequencePickerView.xaml.cs | 112 ++++ .../Sections/SequencePickerViewModel.cs | 213 ++++++++ src/Titano.App/Sections/SequenceView.xaml | 410 +++++++++------ src/Titano.App/Sections/SequenceView.xaml.cs | 100 +++- src/Titano.App/Sections/SequenceViewModel.cs | 301 +++++++++-- src/Titano.App/Sections/SettingsViewModel.cs | 5 +- src/Titano.App/Shell/MainWindow.xaml | 4 +- src/Titano.App/Shell/ScreenCapture.cs | 58 ++- src/Titano.App/Shell/SectionViewModel.cs | 4 +- src/Titano.App/Shell/ShellViewModel.cs | 25 +- src/Titano.Core/Advice/AdvisorRules.cs | 2 +- .../Analysis/Deep/DeepAnalysisReport.cs | 9 +- .../Editor/EditPathSmokeTests.cs | 390 ++++++++++++++ .../Titano.App.Tests/Editor/EditPathTests.cs | 302 +++++++++++ .../Titano.App.Tests/Editor/EditorFixture.cs | 4 + .../Editor/EditorSmokeTests.cs | 5 + .../Editor/SchedulingTests.cs | 69 +++ .../Editor/SequenceJobsTests.cs | 21 + .../Windows/EditSectionTests.cs | 482 ++++++++++++++++++ .../Windows/ScreenSmokeTests.cs | 14 +- .../Windows/ShellNotificationTests.cs | 2 +- 214 files changed, 6547 insertions(+), 826 deletions(-) create mode 100644 src/Titano.App/Editor/AnalysisTab.cs create mode 100644 src/Titano.App/Editor/EditPath.cs create mode 100644 src/Titano.App/Sections/SequencePickerView.xaml create mode 100644 src/Titano.App/Sections/SequencePickerView.xaml.cs create mode 100644 src/Titano.App/Sections/SequencePickerViewModel.cs create mode 100644 tests/Titano.App.Tests/Editor/EditPathSmokeTests.cs create mode 100644 tests/Titano.App.Tests/Editor/EditPathTests.cs create mode 100644 tests/Titano.App.Tests/Windows/EditSectionTests.cs diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index cc124d20..1320c325 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -65,9 +65,9 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S | Folder | Content | |---|---| | `Shell` | `MainWindow` (rail and its shortcuts, taskbar progress), `ShellViewModel` (rail, sections, first run), `OsNotifications` (toasts as Windows notifications while the window is minimised or in the background), dialogs, `ErrorText` (the sentence of an error toast), `ScreenCapture` (`--capture` scenes), `SectionTemplates.xaml` (view model → view) | -| `Sections` | One `XxxView.xaml` + `XxxViewModel` per screen: Welcome, Library, Sequence (editor), Import, Archive, Jobs, Server, Settings, About | +| `Sections` | One `XxxView.xaml` + `XxxViewModel` per screen: Welcome, Library, Sequence (the Edit section: the editor, and `SequencePickerView` choosing the sequence in place), Import, Archive, Jobs, Server, Settings, About | | `Library` | Filter, facets, pager, timeline, saved views, quick and mass actions, remote cards and thumbnails, thumbnail cache, list export | -| `Editor` | `EditorSession` (project, undo/redo, saving, merges), `ISequenceSource` (`LocalSequenceSource`, `RemoteSequenceSource`), tabs (Frames, Exposure, Camera, Motion, Export), `PreviewRenderer`, `ExportPlanner`, `ExportSync`, `SavedCopies`, `SequenceJobs`, `ProjectFiles` (save and open `.titano` project files) | +| `Editor` | `EditorSession` (project, undo/redo, saving, merges), `ISequenceSource` (`LocalSequenceSource`, `RemoteSequenceSource`), the steps of the Edit path (`EditPath`: their order, each step's state, the step of each finding, the memory of the step shown; tabs Analysis, Frames, Exposure, Motion, Camera, Time, Stack, Export), `PreviewRenderer`, `ExportPlanner`, `ExportSync`, `SavedCopies`, `SequenceJobs`, `ProjectFiles` (save and open `.titano` project files) | | `Import` | `CardPool` (inserted cards, remembered cards, folders), camera profiles, plans and choices, destinations (archive, folder, server through `ServerImportSink`), card actions (verified delete, format, eject) | | `Archive` | `CurrentArchive`, `ArchiveTree`, figures for the charts, maintenance reports, mass rename and move, delete and trash dialogs (`SequenceDeletion`, `DeletePlans`), `ArchiveFailures` | | `Server` | `ServerSession`, `ConnectFlow` (trust on first use), `SyncHost` (sync engine, agent, metered hold, editor connections, Export Sync), sync table, `RemoteSequenceApi` | diff --git a/docs/BRIEF.md b/docs/BRIEF.md index c4233ed1..c3fd45b7 100644 --- a/docs/BRIEF.md +++ b/docs/BRIEF.md @@ -226,7 +226,7 @@ Project references: `App` → `Core`, `Core.Windows`, `Data`, `Protocol`. `Serve ``` ┌────────────────────────────────────────────────────────────────┐ │ Titano (WPF client) │ - │ Library · Sequence editor · Import · Archive manager · Jobs │ + │ Library · Edit · Import · Archive manager · Jobs │ │ Local mode: SQLite + local/network archive │ │ Server mode: REST/WS client, proxies cache, render node │ └───────┬───────────────────────────────────────┬────────────────┘ @@ -567,7 +567,7 @@ residuals → deflicker window), exposure steps *as actually received* by the pi star-field detection (small bright point density on night frames), cloud coverage estimate (sky-region texture), scene-change detection (histogram distance), duplicate/black/white frames, motion magnitude histogram (for motion-blur recommendation), suggested hero frame. -Results → `analysis.json` + compact summary in DB; charts in the Sequence editor. +Results → `analysis.json` + compact summary in DB; charts in the Edit section (§12.3; amended 2026-10-16, R7). ### 10.3 Recommendations (rules, each with reason and confidence) @@ -679,7 +679,7 @@ player smoke test on Windows CI. │ ⬇ │ section content (edge to edge) │ │Imp │ │ │ ✎ │ commands of the section live INSIDE the section, in one row above the │ -│Seq │ content they act on; every command has a tooltip │ +│Edit│ content they act on; every command has a tooltip │ │ ▣ │ │ │Arch│ │ │ ⚙ │ │ @@ -731,36 +731,56 @@ player smoke test on Windows CI. - Filters are chips; saved views (e.g. "Night, 4K, not rendered"); search is instant (indexed columns); everything virtualized (in-house `VirtualizingWrapPanel`). -### 12.3 Sequence editor +### 12.3 Edit (amended 2026-10-16, R7; formerly "Sequence editor") ``` -│ ← Harbour sunset · 3,600 frames · Canon EOS R5 · 2 s interval · 2 h 00 m [Analyse] [Optimise all] [Render ▾] │ +│ ← Harbour sunset ▾ · 3,600 frames · Canon EOS R5 · 2 s interval · 2 h 00 m [Analyse] [Optimise all] [Render ▾] │ +│ ✓ Analysis ── ▲ Frames ── ✓ Exposure ── ✓ Motion ── ✓ Camera ── ✓ Time ── ⑦ Stack ── ⑧ Export │ ← the path ├──────────────────────────────────────────────────────────────────┬──────────────────────────────────┤ │ ┌──────────────────────────────────────────────────────────────┐ │ Exposure │ -│ │ │ │ Deflicker [●] Auto 41 ⓘ │ -│ │ PREVIEW │ │ Strength ───●──── 0.8 │ -│ │ │ │ Regions [●] Auto horizon │ -│ │ [◧ compare] [⊹ vectors] [▭ regions] [▦ crop mask] [1:1] [⛶] │ │ Transitions [●] Auto 18 ⓘ │ -│ └──────────────────────────────────────────────────────────────┘ │ WB smoothing [●] Auto │ -│ ▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏ filmstrip + markers │ │ -│ [Frames] [Exposure] [Motion] [Camera] [Time] [Stack] [Export] │ [Optimise section] [Reset] │ +│ │ PREVIEW │ │ Deflicker [●] Auto 41 ⓘ │ +│ │ [◧ compare] [⊹ vectors] [▭ regions] [▦ crop mask] [1:1] [⛶] │ │ Strength ───●──── 0.8 │ +│ └──────────────────────────────────────────────────────────────┘ │ Transitions [●] Auto 18 ⓘ │ +│ ▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏ filmstrip + markers │ [Optimise section] [Reset] │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ -│ │ measured (amber) vs target (accent) luminance chart, │ │ │ -│ │ exposure-step markers, region curves; click = seek preview │ │ │ +│ │ the step's measuring tool (charts, frame table, curves) │ │ [‹ Previous] 3 / 8 [Next ›] │ │ └──────────────────────────────────────────────────────────────┘ │ │ ``` +- One sequence at a time. Without an open sequence, or after **Change sequence** (the + title's ▾, Ctrl+O, or Next on the last step), Edit shows a picker: this PC's sequences + and the signed-in server's, newest first, searched by title, camera or tag, the open + sequence (else the one edited last) selected and in view; Enter (on what was typed) or a + double-click opens one, Esc clears the search, then goes back. The next sequence is read + first: the open one stays open behind the picker until another one opens (a server + sequence whose proxies are still coming, or one that cannot open, leaves it open), its + last edit saved first, or discarded on the user's word and then never written. The + Library, Jobs, the Server screen, project files and the command line still open + sequences in Edit; ← goes back to the Library. +- The steps form a guided path, freely navigable: **Analysis** (every finding of the + analyses with the step that deals with it; light, flicker, exposure steps received, + shake and flagged frames; Analyse), **Frames** (virtualized table: index, time, + exposure, ISO, f, size, tier, flags; exclude/include; set hero; the findings about + single frames), **Exposure** (deflicker, regions, holy-grail transitions, WB) with + luminance/waveform charts, **Motion** (blur, flow quality, stabilization) with shake + path chart, **Camera** (crop, aspect, virtual camera keyframes with a spline editor), + **Time** (fps, timing mode, remap curve, fit-to-duration, plan chart), **Stack** + (median/max, trail length; optional), **Export** (preset, values, output name, batch + list, render history, sponsor slot — Phase 9 only). +- Each step shows where it stands, by its own glyph as well as its colour: to do (its + number), done ✓ (nothing is missing: Auto, or Edited once a setting or value of the step + was set by hand), attention ▲ (a saved analysis of other frames or one that cannot be + read now, frames still flagged, data an Auto setting that applies lacks, a render + blocked or none made from the current settings), running ◐ (its analysis or render), + waiting ○ (it needs the deep analysis). Statuses guide; they never block a step. + Previous and Next (Ctrl+PgUp/PgDn), Alt+1…8 and the step bar (←/→) move between steps, + the keyboard following; each step's tooltip starts with its name and ends with its + shortcut, and screen readers hear the step and its state. The editor opens on the step + last shown for that sequence in this run; else on Analysis while the sequence has no + current deep analysis or one waits, runs or is paused; else on Frames. - Preview always on top with tools: zoom/pan (1:1 shows raw pixels), wipe compare original/corrected, motion-vector overlay, region boundary, crop mask ("what I lose" vs "how it will look"), full-screen native-resolution window with collapsible shot data. -- Sections (tabs inside the editor; each with its measuring tool below the filmstrip and - its settings column on the right): **Frames** (virtualized table: index, time, exposure, - ISO, f, size, tier, flags; exclude/include; set hero; warnings list), **Exposure** - (deflicker, regions, holy-grail transitions, WB) with luminance/waveform charts, - **Motion** (blur, flow quality, stabilization) with shake path chart, **Camera** (crop, - aspect, virtual camera keyframes with a spline editor), **Time** (fps, timing mode, remap - curve, fit-to-duration, plan chart), **Stack** (median/max, trail length), **Export** - (preset, values, output name, batch list, render history, sponsor slot — Phase 9 only). - Every deducible control shows Auto/manual state (§10.4); every control has a tooltip with the reason and the effect of moving it the wrong way. - While a job runs on this sequence, settings that would change the rules mid-render are @@ -1333,6 +1353,7 @@ questions asked and the answers; DECISIONS rows give the reasons. | 2026-10-16 | Owner review 1, R4 | §8.1, §8.2 | DNG decodes through the managed decoder (WIC only through the Raw Image Extension, never DNG); a GoPro DNG is GPR only when VC-5; analyses and previews take an adequate embedded preview by choice, renders decode natively. | | 2026-10-16 | Owner review 1, R2 | §12.8, §14.6, §14.8, §14.9 | Jobs run one at a time; the parallelism is photos the running job processes at once; an optional priority queue by job kind pauses lower jobs and resumes them by itself; `TITANO_PARALLELISM` (former `TITANO_WORKERS`) and `TITANO_PRIORITY_QUEUE`. | | 2026-10-16 | Owner review 1, R1 | §12.1, §14.8 | The rail is 200 px and collapses to 48 px of icons with ≡ or Ctrl+B, their tooltips naming the sections, saved at once; the admin panel's sidebar is 256 px and collapses the same way, kept in the browser. | +| 2026-10-16 | Owner review 1, R7 | §4.1, §10.2, §12.1, §12.3 | The Sequence section is now Edit: one sequence at a time, chosen in a picker inside the section (Change sequence, Ctrl+O); the editor's tabs are the steps of a guided, freely navigable path that starts with a new Analysis step, each step showing where it stands, with Previous and Next. | ## Appendix A — `CLAUDE.md` content (create verbatim in Phase 0, keep updated) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 701b232c..95af09ba 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -190,6 +190,20 @@ commits follow Conventional Commits (release notes are generated from them by `T cache folder, the editor's header (a server job's Cancel always stays), preview tools (a second line when needed) and frame table share their width differently; headers, titles and cells that may be shortened end in an ellipsis and show their text in their tooltip. +- Owner review 1 (2026-10-16, R7): the Sequence section is now **Edit** (Ctrl+3) and edits one sequence at a time. + Without an open sequence, or after *Change sequence* (the title's ▾, Ctrl+O, or *Next sequence* on the last step), + it shows a picker of this PC's and the server's sequences, newest first, with a search; the open sequence (else the + one edited last) is selected and in view. Enter, also right after typing, or a double-click opens one, and Esc goes + back to the open one, which stays open behind the picker until another one has loaded: a server sequence whose + proxies are still coming, or one that cannot open, leaves it open. Its last edit is saved first, or discarded on the + user's word and then never written. The editor's tabs are now the steps of a guided path under the header, freely + navigable: a new first step, **Analysis**, lists every finding of the analyses with a button to the step that deals + with it, five measurements (light, flicker, exposure steps received, shake, flagged frames) and where each other + step stands. Each step shows its status with its own glyph (to do, done, attention, running, waiting); its tooltip + starts with its name, says why and names its shortcut. *Previous* · n / m · *Next* under the settings column, + Alt+1…8, Ctrl+PgUp/PgDn and the arrow keys in the step bar move between steps, the keyboard following. The editor + opens on the step last shown for that sequence in this run, else on Analysis while the sequence is not analysed or + its analysis waits or runs, else on Frames, whose list is now the frame warnings. ### Deprecated - `TITANO_WORKERS` and the `Workers` key of `server.json` set the parallelism (photos the running job processes at @@ -198,6 +212,12 @@ commits follow Conventional Commits (release notes are generated from them by `T ### Fixed - Owner review 1 (2026-10-16, `docs/requests/2026-10-15-owner-review-1.md`): - the App test program could crash on exit after every test had passed (WPF's binding cleanup racing the process's end); + - choosing *Keep editing* when the open sequence's last edit could not be saved left the other sequence as the one + asked for, so every later visit to the section asked again (R7); + - choosing *Discard change* for an edit that could not be saved still wrote it when the archive answered again while + the question was open (R7 review); + - a double-click on a row or card of the Library opened nothing (only one on the empty space under the list opened the + selected sequence): the row took the mouse-down (R7 review); - thumbnail and proxy jobs over several sequences failed after 10–20 minutes with "TimeSpan overflowed" and then stayed Running; their progress now counts frames, a stalled job shows no time left, and a job's end is always recorded (R10); diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index b6264a1d..4a5cc5db 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -413,3 +413,8 @@ One line per decision: date · decision · alternative · reason. | 2026-10-16 | `LeaseFile.TryCreate` treats "access denied" on creating a lease as the name of a lease just released while a reader still holds it (pending deletion on Windows, since readers share deletion) and tries again for some 130 ms (8 attempts, 1 ms doubling), as it already did for the create-or-check race. | Return "held" at once; stop sharing deletion in readers | Returning "held" makes the caller wait its whole poll back-off for a name free milliseconds later, and readers must never block a release or a takeover. A real permission problem still fails after the short retry. Found when the phase 2 test runs hit it in `MassRenameTests` under load. | | 2026-10-16 | The rail is 200 px (`Width.Rail`, was 128 growing to 200 with the language's longest name) and collapses to the 48 px icons (`Width.RailCollapsed`) with ≡ or Ctrl+B, a window key binding gated like Ctrl+1…6 (not behind the first-run dialog; a held key toggles once). A collapsed icon's tooltip is "Name · description" (`Tooltips.Nav.Collapsed`, invariant) so the section is named without its label, while screen readers keep the name and, as help text, the description alone. The state is written the moment it changes, through `AppServices.SavePreferences` (the settings file and nothing else: no render node restart, no engine wake), and Settings reset and import keep it, as they keep the window. The admin panel's sidebar is 256 px (was 220) and collapses to 56 px of icons with its own ≡ or Ctrl+B (matched on the physical B key when that key types no letter a–z, as in Cyrillic, Greek, Hebrew or Arabic layouts; Latin layouts keep their own Ctrl shortcuts), the choice kept in the browser (`localStorage` `titano.admin.sidebar`, like the theme; a browser that refuses storage keeps it for the page), the tables fitting their columns again after each toggle and the links' names kept for screen readers; at 900 px and below it stays the top bar, which shows icons only already, and Ctrl+B stays the browser's. Beside the wider rail at the 1200 px minimum, in every shipped language: the Jobs table's Kind, Where and State became star columns (minimums 90, 80, 116; at most 140, 140, 170, so on wide windows Target takes the rest, as in Jobs.html) and Target and Progress give way first (84, 104), so the row actions fit; a cut kind, place or header shows whole in its tooltip, and the state's tooltip starts with the state, as the sync table's does (the explanations after it were reworded not to repeat it, and "waiting for a worker" became "waits for its turn"); the trusted certificates row's server column and the cache folder's path give way first; the editor's preview tools wrap to a second line (6 px apart) instead of losing Play and Full screen, the crop-result tool always beside Crop mask and disabled while the mask is off (with its reason), so turning the mask on never moves the tools; the editor header gives the server job and its Cancel their own column, the title and the summary giving way first; the Archive tree keeps a year's label and lets its figures trim; the Import session rows, Show plan and the result line fit; the frame table's Time column holds every language's widest time and its header names trim with the name in the tooltip, header and rows sharing the actions column. Cells that can be cut repeat their text in their tooltip (Library list, Jobs, sync state, Settings encoder table and adapter, priority queue rows; `EmptyToNullConverter` so an empty cell shows none). Tests check, in all 38 languages at 1200 px: the Jobs row buttons, Settings' Clear and Forget, the Archive years, the Import rows and result, the frame table's times, the editor's tools and a server job's Cancel. (Owner review 1, R1.) | A width that follows the language; save the rail state at exit; keep the admin sidebar state per user on the server | The owner fixed 200 and 256 px so names fit in every language without a jumping rail; a crash or a forced shutdown no longer loses the choice; the server keeps no presentation state per user and the theme already lives in the browser. Found by the phase's review rounds: buttons and labels cut at 1200 px in some languages (Jobs row actions, Forget, Clear, the preview's Play, a remote job's Cancel, Merge, a year in the Archive tree), Ctrl+B behind the first-run dialog, and admin tables that kept their old fit. | | 2026-10-16 | The App test program shuts the shared WPF dispatcher down in order (`WpfApplication.Shutdown`: `InvokeShutdown`, then a join of up to 10 s) after the runner finishes, instead of letting the process end under its background thread. (Owner review 1, R1.) | Leave the background STA thread to die with the process | The binding engine's cleanup then ran against a half-torn-down engine and crashed the exit (code 127) after every test had passed; the tests that walk 38 languages made it likely. | +| 2026-10-16 | The Sequence section is renamed Edit ("Modifica"): `SectionKey.Edit`, `Shell.Nav.Edit` and `Tooltips.Nav.Edit`; the classes keep their names (`SequenceView`, `SequenceViewModel`, `ShellViewModel.Sequence`, `Icon.Sequence`) and so do the editor's resource keys (`Editor.*`). Screenshots are `edit-*` (`edit-picker`, `edit-`, `edit-change`, `edit-busy`). (Owner review 1, R7.) | Rename the classes and keys too | The owner's word is the section's name; renaming twenty files and two hundred keys would change nothing the user sees and would bury the real change in churn. | +| 2026-10-16 | The editor's tabs become the steps of a guided path, freely navigable (the owner's choice): a step bar of equal cells under the header (the tab strip under the filmstrip is gone), a new first step **Analysis** (every finding with the step that deals with it, five measurements, the other steps with their states, Analyse), Previous · n / m · Next under the step's column (both buttons measured whole, the counter giving way), Alt+1…8, Ctrl+PgUp/PgDn (read on the way down the tree, since the filmstrip and the curve editors take Page Up/Down whatever the modifiers) and ←/→ in the bar. Each step shows a status by its own glyph (to do, ✓ done, ▲ attention, ◐ running, ○ waiting) worked out by `EditPath.Of` from the content, the advice, the project, the active analysis and render (`SequenceJobs.Active`), the render's blocker and whether a render has the current settings; no status ever blocks a step. The step's tooltip is "name · what it is for · state · Alt+n" (the name first, because a long name ends in an ellipsis in its cell: about 82 px at the 1200 px minimum, which every English and Italian name fits). After a step change the keyboard goes to the new step's cell when it was in the bar, on a control of the replaced step or on Previous turning itself off, and the preview takes it back if it falls to the window; Space on the step shown plays; Ctrl+click or Ctrl+Space never leaves the bar without a current step. The editor opens on the step last shown for that sequence in this run (a deep analysis that ended meanwhile resets its visited marks), else on Analysis while there is no current deep analysis or one waits, runs or is paused (`EditPath.Start`, applied again once the jobs are read unless the user chose a step), else on Frames. Last step's Next is "Next sequence". (Owner review 1, R7.) | Steps that unlock in order; a wizard with its own window; a ninth "Result" step | The owner asked for a path from the deep analysis to completion that stays freely navigable; locking steps would get in the way of photographers who know what they want; the result belongs to phase 5's export and videos library. | +| 2026-10-16 | Step rules: Analysis is running while a deep analysis is active; needs attention when the index says AnalyzedDeep but the saved analysis describes another number of frames ("Frames changed") or cannot be read now ("Analysis unavailable": archive offline, file moved or damaged, a server that sends none; `SequenceContent.DeepOfOtherFrames` tells them apart); done with its warning count; else to do. Frames waits for the analysis, then needs attention while frames the analysis flags as black, white, duplicate or unreadable are neither excluded nor skipped by the render anyway. Exposure, Motion, Camera and Time wait while an Auto setting of the section needs the deep analysis and there is none, need attention while an Auto setting that applies lacks other data (timestamps, exposure data, source size: the tooltip is the advisor's reason), which taking the value over by hand settles; a setting whose switch is off (`EditorSettings.Applies`, the same rule as the rows' n/a) is never asked for, and a value the analysis could not measure (no usable region mask) stays at the engine's fallback. Otherwise Auto, or Edited once an Auto setting or a value set by hand differs (crop, offsets, camera moves, fit to a duration, exposure offset). Stack is optional. Export is running with its render, needs attention when the export cannot render or no render, of any age, was made from settings with the project's `EditPath.Signature` (which leaves out hero, frames to place, batch, folder, output name and server copy); the renders count as current when the newest keeps no settings (a server's, or one fetched from it) or none's settings can be read. Findings go to steps through `EditPath.FindingSteps` (all 29 keys, tested by reflection; frames of another size or orientation go to Frames, which excludes them); Frames lists its own under "Frame warnings". | A finding count per step; any missing data as "waiting" | Counts would turn Frames ▲ for timing findings it cannot fix; analysis cannot supply timestamps or exposure data, so those need the user, not a wait; a setting shown n/a cannot be taken over, so asking for it would leave a ▲ nobody can clear. | +| 2026-10-16 | The sequence is chosen inside Edit: without an open sequence, or after Change sequence (the title's ▾, Ctrl+O, Next on the last step), a picker covers the editor in place (not a popup): this PC's sequences and the server's sequences the Library knows, newest first, searched after 250 ms (Enter and ↓ in the search box wait for the list to match what was typed), read page by page (more pages are read until the open sequence, else the one edited last, is listed, then it is selected and scrolled into view); Enter or a double-click opens, Esc clears the search then goes back. The open editor stays laid out behind it (hidden, not collapsed, so its preview is not rendered again) and keeps saving each change a moment after it is made (2026-10-03 autosave). Choosing another sequence reads it first; only once it has loaded is the open one's pending change written at once and the editor closed. When the next one cannot open now (its proxies are on their way, or it fails), the open one stays open and is again the sequence asked for (`ShellViewModel.KeepSequence`), so coming back to Edit neither asks again nor retries; Cancel also stops a server sequence chosen meanwhile from opening over it when its proxies arrive. A failed write is either kept (Keep editing) or discarded on the user's word. Asking for the open sequence again (Library, Jobs, a project file) ends a choice of another; coming back to Edit leaves it on screen (`ShellViewModel.SequenceRequests`). Deleting the sequence asked for clears the request. The section remembers each sequence's step and visited steps for the run, and `AppSettings.LastEditedSequence` (saved with `SavePreferences`) is selected first in the picker. (Owner review 1, R7.) | A popup or a separate window; close the editor when the picker opens; close it before the next sequence is read | Captures render the window's visual tree and off-screen test windows make popups fragile; keeping the editor open makes Cancel instant, and closing it only once the next sequence has loaded means a sequence that cannot open never costs the open one (nor its undo history). | +| 2026-10-17 | A double-click on a row is read on the row (`MouseDoubleClick` on its `ListBoxItem`, left button only, not over one of its own buttons) in Edit's picker and in the Library's list and grid, instead of a gesture on the list: a `ListBoxItem` marks every left mouse-down handled to select, so the list's gesture only ever fired on its empty area. While the user is asked whether to discard a change that could not be written, no retry runs (`ProjectSaver.HoldAsync`, `EditorSession.HoldPendingAsync`); Discard drops it unwritten (`DiscardPending`), Keep editing lets the retries go on (`KeepPending`). (Owner review 1, R7 review.) | A double-click binding on the row template; retry during the question and drop only what is still pending | A template binding misses the row's padding; a retry that succeeds while the question is open would write the change the user is about to drop. | diff --git a/docs/STATUS.md b/docs/STATUS.md index 4c7a13b7..ccf2e149 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -13,7 +13,7 @@ Phase plan: docs/BRIEF.md §22. Windows behaviour is verified on CI (`windows-la | 6 Engine, encoding, editor | Done: render pipeline, MP4/AVI/GIF/APNG/image sequences, Media Foundation H.264/HEVC/AV1 with managed fallbacks; the sequence editor (Frames, Exposure, Camera, Motion and Export tabs, preview tools, section charts, curve editor, undo/redo, batch export) for local and server sequences. Gate: self-test suite green; the in-house inspector validates the containers the tests write; the encoder in use is logged. Playback: MediaPlayer opens the Media Foundation output and a source reader decodes its first frame (Windows tests). The pixel diff of every `--capture` screen against `tests/visual/baselines` (`screenshots diff`, BRIEF §20.2) is wired into CI but not armed: no baseline is committed yet, so the step compares nothing and only warns until the first baselines are accepted from `ci-screenshots` (Next steps). | | 7 Server, sync, uploader | Done: server (API, auth, uploads, jobs, render nodes, events, admin panel with light and dark themes, Windows service), Uploader, client sync (sync table, conflicts with *Save both*, proxies kept offline, metered pause), server sequences edited with proxies and rendered where the originals are, this PC as a render node. Gate covered in-process: a sequence uploaded from one PC downloads identically on another, interrupted uploads and downloads resume, server events update a PC, renders run on a node and on the server's managed fallback, jobs resume after a restart, sign-ins and administrative actions are audited. The run with two real PCs and the Uploader against the Docker server is part of the release test. | | 8 Release readiness | Release pipeline end to end (installers, portable and server zips, SHA256SUMS, release notes, optional signing, multi-arch GHCR image, public releases repository content), update check with verified download, scrubbed diagnostics bundles (desktop and server), performance gates, 38 cultures (`en`, `it` and 36 machine translations with glossaries and independent reviews), RTL pass (`ar`, `he`: mirrored windows, left-to-right islands for media, charts, numbers and paths; any right-to-left culture added later follows), accessibility pass (names, live regions, keyboard paths for charts and the curve editor). CI installs the packed installers silently on a clean `windows-latest` runner, runs the installed programs, upgrades in place and uninstalls (files, Add/Remove Programs, shortcuts, file type, user data kept, exit codes). Pending: a tagged pre-release published from CI, the interactive install on a real PC, Unraid template validation on a real server. | -| 8.1 Owner review 1 | In progress (request, answers and plan: `docs/requests/2026-10-15-owner-review-1.md`). Phase 1 done: stalled thumbnail and proxy jobs no longer fail and stay Running (frame-counted progress, bounded time left, final state always written); the editor's cancelled decodes stay in their tasks (no debugger stops in `WicDecoderProvider.cs`); WIC decodes RAW only through the Raw Image Extension and never DNG; GoPro DNGs converted by Adobe software are DNGs, developed natively for videos, read through their embedded preview for analyses and previews, and reclassified in existing archives by the next light analysis. Phase 2 done: jobs run one at a time on the desktop and the server; Parallelism is how many photos the running job processes at once (thumbnail and proxy passes, tier probes, deep analysis, render decodes); pausing the running job starts the next; an optional priority queue by job kind (Settings › Rendering, admin panel › Settings › Jobs, `TITANO_PRIORITY_QUEUE`) pauses lower jobs and resumes them by themselves; `TITANO_PARALLELISM` replaces `TITANO_WORKERS`. Phase 3a done: the rail is 200 px and collapses to icons with ≡ or Ctrl+B (tooltips then name the sections, the choice saved at once); the admin panel's sidebar is 256 px and collapses the same way. Next: phase 3b, the Edit section as a guided path with a sequence picker. | +| 8.1 Owner review 1 | In progress (request, answers and plan: `docs/requests/2026-10-15-owner-review-1.md`). Phase 1 done: stalled thumbnail and proxy jobs no longer fail and stay Running (frame-counted progress, bounded time left, final state always written); the editor's cancelled decodes stay in their tasks (no debugger stops in `WicDecoderProvider.cs`); WIC decodes RAW only through the Raw Image Extension and never DNG; GoPro DNGs converted by Adobe software are DNGs, developed natively for videos, read through their embedded preview for analyses and previews, and reclassified in existing archives by the next light analysis. Phase 2 done: jobs run one at a time on the desktop and the server; Parallelism is how many photos the running job processes at once (thumbnail and proxy passes, tier probes, deep analysis, render decodes); pausing the running job starts the next; an optional priority queue by job kind (Settings › Rendering, admin panel › Settings › Jobs, `TITANO_PRIORITY_QUEUE`) pauses lower jobs and resumes them by themselves; `TITANO_PARALLELISM` replaces `TITANO_WORKERS`. Phase 3a done: the rail is 200 px and collapses to icons with ≡ or Ctrl+B (tooltips then name the sections, the choice saved at once); the admin panel's sidebar is 256 px and collapses the same way. Phase 3b done: the Sequence section is now Edit, one sequence at a time chosen in a picker inside the section (Change sequence, Ctrl+O; the sequence edited last selected first), and the editor's tabs are the steps of a guided, freely navigable path from a new Analysis step (every finding with the step that deals with it) to Export, each step showing where it stands, with Previous and Next. Next: phase 4, the visual crop locked to the output's proportions (R5) and mirroring, 90° rotations, straightening and colour filters (R6). | | 9 Monetization | Not started: requires explicit approval (§22). | ## Verification (2026-10-12) @@ -58,6 +58,9 @@ src/Titano.App/bin/Release/net10.0-windows/Titano.exe --capture out/screenshots opens the sequence with those settings in the running Titano. - Notifications: minimise Titano and insert a card or finish a job: a Windows notification appears; Ctrl+1…6 and Ctrl+, switch sections. +- Edit: Ctrl+3 with no sequence open shows the picker (type to search, Enter opens); the title's ▾ or Ctrl+O chooses + another sequence and Esc comes back. The step bar, *Previous*/*Next* (Ctrl+PgUp/PgDn) and Alt+1…8 move between + steps; on Analysis each finding's button opens the step that deals with it. ## Next steps (Phase 8 gate) diff --git a/docs/requests/2026-10-15-owner-review-1.md b/docs/requests/2026-10-15-owner-review-1.md index d8aeb994..a9209606 100644 --- a/docs/requests/2026-10-15-owner-review-1.md +++ b/docs/requests/2026-10-15-owner-review-1.md @@ -59,8 +59,8 @@ |---|---|---|---| | 1 | Bugs: R10 job throughput/ETA and stuck jobs; R4 cancellation boundary, WIC decoder truth, GoPro DNG classification, decode policy (preview for analysis, native for renders) | done 2026-10-16: BRIEF §8.1, §8.2, §24; five DECISIONS rows dated 2026-10-16; all test suites, i18n check, format, package guard and xaml-lint green | `34d0305` | | 2 | R2 jobs one at a time, Parallelism = photos at once, priority queue with automatic pause/resume (desktop + server) | done 2026-10-16: BRIEF §12.8, §14.6, §14.8, §14.9, §24; nine DECISIONS rows dated 2026-10-16 (engine, priority queue, parallel passes and decode budget, sequential IO jobs, server settings, `i18n prune`, Jobs toolbar, atomic writes that wait for a reader, leases taken after a reader lets go); five adversarial review rounds before the commit; levels per kind rather than an ordered list (DECISIONS) | `43b6871` | -| 3a | R1 rail 200 px and admin sidebar 256 px, both collapsing to icons with ≡ or Ctrl+B | done 2026-10-16: BRIEF §12.1, §14.8, §24; one DECISIONS row; DESIGN and every mockup with a rail or the admin sidebar; the two new admin tooltips in all 38 languages. Six adversarial review rounds (desktop and web, each finding verified; the last found only two wording slips, fixed): buttons and labels cut at 1200 px beside the wider rail in some languages (Jobs row actions, Forget, Clear, the preview's Play, a remote job's Cancel, Merge, a year in the Archive tree), Ctrl+B behind the first-run dialog and on non-Latin keyboards, and admin tables not re-fitted after a toggle, all fixed; some older cut texts found on the way got tooltips; tests now check those rows in all 38 languages. Phase 3 lands as two commits because R1 and R7 edit the same shell files and R1 was finished and verified first | phase 3a commit | -| 3b | R7 Edit section ("Sequenza" → "Modifica"), sequence picker, guided path from analysis to export | todo | | +| 3a | R1 rail 200 px and admin sidebar 256 px, both collapsing to icons with ≡ or Ctrl+B | done 2026-10-16: BRIEF §12.1, §14.8, §24; one DECISIONS row; DESIGN and every mockup with a rail or the admin sidebar; the two new admin tooltips in all 38 languages. Six adversarial review rounds (desktop and web, each finding verified; the last found only two wording slips, fixed): buttons and labels cut at 1200 px beside the wider rail in some languages (Jobs row actions, Forget, Clear, the preview's Play, a remote job's Cancel, Merge, a year in the Archive tree), Ctrl+B behind the first-run dialog and on non-Latin keyboards, and admin tables not re-fitted after a toggle, all fixed; some older cut texts found on the way got tooltips; tests now check those rows in all 38 languages. Phase 3 lands as two commits because R1 and R7 edit the same shell files and R1 was finished and verified first | `4ea44bb` | +| 3b | R7 Edit section ("Sequenza" → "Modifica"), sequence picker, guided path from analysis to export | done 2026-10-16: BRIEF §4.1, §10.2, §12.1, §12.3, §24; four DECISIONS rows (the rename, the path, the step rules, the picker); DESIGN §4 step bar and §7; `Editor.html` with the step bar and every mockup's rail label; `i18n/GLOSSARY.md` and the 36 language glossaries (Edit, Path, Step, Findings); the new strings in all 38 languages. REVIEW_PLACEHOLDER | phase 3b commit | | 4 | R5 visual crop, proportions win; R6 transforms, straighten, colour filters | todo | | | 5 | R3 export panel and Render menu; R8 export options; R9 videos library (desktop, server API, admin page, copy folder, trash) | todo | | | 6 | Docker/Unraid/deploy docs, BRIEF §24 amendments, full verification | todo | | diff --git a/docs/ui/DESIGN.md b/docs/ui/DESIGN.md index 2ad79ef2..4a4d3605 100644 --- a/docs/ui/DESIGN.md +++ b/docs/ui/DESIGN.md @@ -74,6 +74,14 @@ Label column left of controls: 116 px in panels, 180 px in Settings. time left, pause; hidden when idle only in the editor (it shows "Ready" elsewhere). - **Rail item**: 36 px; active = Card fill + 3 px Accent left edge; badge = Accent pill with the count of things needing attention. +- **Step bar** (Edit, owner review 1): one row of equal 36 px cells under the editor's header, + one per step, 4 px padding: a 22 px badge, the name (about 82 px at the 1200 px minimum, an + ellipsis beyond) and a 1 px Stroke connector to the next step. Badge = the number in a Stroke + ring (to do), `✓` Success (done), `▲` Warning (attention), `◐` Warning (running), `○` faint + (waiting): each status has its own glyph, so colour never carries it alone. Current step = + 2 px Accent underline and a semibold name; visited steps' names in Text, the others muted. The + tooltip names the step, then what it is for, its state and its shortcut (Alt+n). Previous · + n / m · Next sit under the settings column: both buttons whole, the counter giving way. - **Cards** (Library): 236 px wide, thumbnail 16:9, count badge top-right, checkbox top-left on hover/selection, selected = Accent border + `AccentSelected` glow; hover scrubs the thumbnail. - **Tables**: header 11 px faint, sortable; rows Card fill on hover; numbers right-aligned, @@ -107,8 +115,8 @@ from the SVG geometry (no raster assets checked in as sources). Badges only at | Mockup | Brief | Notes | |---|---|---| | `Main.html` | §12.2 Library | grid/list, year·camera·status filters, selection panel | -| `Editor.html` | §12.3 Sequence editor | Exposure tab, wipe compare, curves, advisor Auto pills | -| `Export.html` | §12.3 / §11.4 | preset cards with size/time estimate, Output panel, batch | +| `Editor.html` | §12.3 Edit | Exposure step: step bar, title ▾ (Change sequence), wipe compare, curves, advisor Auto pills, Previous · n / m · Next | +| `Export.html` | §12.3 / §11.4 | the Export step: step bar with Export current, preset cards with size/time estimate, Output panel, batch, Previous · 8 / 8 · Next sequence | | `Import.html` | §12.4 / §13 | card profile, sessions, plan, verification, after-import actions | | `Archive.html` | §12.5 | tree, mass operations, stats, verify/rebuild, maintenance | | `Jobs.html` | §12.6 | filters, queue order, expandable log, retry/open/folder | @@ -121,6 +129,6 @@ from the SVG geometry (no raster assets checked in as sources). Badges only at | `Components.html` | §12.1 | the control kit above, with hex values and state rules | | `Icon.html` | §17 | construction, sizes, variants, wordmark | -Missing on purpose (build from the brief and this kit): About, Login dialog, the other editor -tabs (Frames, Motion, Camera, Time, Stack), Import "Show plan", Archive rebuild dialog, the -admin Archive/Jobs/Settings/Logs pages. Reuse the shell and the kit; do not invent new colours. +Missing on purpose (build from the brief and this kit): About, Login dialog, the Edit picker +and the other steps (Analysis, Frames, Motion, Camera, Time, Stack), Import "Show plan", +Archive rebuild dialog, the admin Archive/Jobs/Settings/Logs pages. Reuse the shell and the kit; do not invent new colours. diff --git a/docs/ui/mockups/Archive.html b/docs/ui/mockups/Archive.html index 68c3d59a..69b8fb7d 100644 --- a/docs/ui/mockups/Archive.html +++ b/docs/ui/mockups/Archive.html @@ -21,7 +21,7 @@ a{color:#4cc2ff}a:hover{color:#8ad8ff} Library Import - Sequence + Edit Archive Jobs1 Server diff --git a/docs/ui/mockups/Editor.html b/docs/ui/mockups/Editor.html index 9e1dd27c..22b396df 100644 --- a/docs/ui/mockups/Editor.html +++ b/docs/ui/mockups/Editor.html @@ -2,7 +2,7 @@ -Titano — Sequence editor +Titano — Edit + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Titano.App/Editor/EditorPanels.xaml b/src/Titano.App/Editor/EditorPanels.xaml index bf1d3b5f..2fb8bf73 100644 --- a/src/Titano.App/Editor/EditorPanels.xaml +++ b/src/Titano.App/Editor/EditorPanels.xaml @@ -6,8 +6,8 @@ xmlns:shell="clr-namespace:Titano.App.Shell" xmlns:e="clr-namespace:Titano.App.Editor"> @@ -159,6 +159,42 @@ + + + + + + + + + + + + + + + + @@ -243,8 +279,9 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Titano.App/Sections/SequenceView.xaml.cs b/src/Titano.App/Sections/SequenceView.xaml.cs index a71f907a..b96fe7ba 100644 --- a/src/Titano.App/Sections/SequenceView.xaml.cs +++ b/src/Titano.App/Sections/SequenceView.xaml.cs @@ -25,10 +25,26 @@ public partial class SequenceView : UserControl EditorRoot.AddHandler(Thumb.DragCompletedEvent, new DragCompletedEventHandler((_, _) => EndEditRun()), handledEventsToo: true); EditorRoot.AddHandler(MouseLeftButtonUpEvent, new MouseButtonEventHandler((_, _) => EndEditRun()), handledEventsToo: true); EditorRoot.AddHandler(KeyUpEvent, new KeyEventHandler((_, _) => EndEditRun()), handledEventsToo: true); + EditorRoot.IsKeyboardFocusWithinChanged += OnEditorFocusWithinChanged; } private EditorViewModel? Editor => (DataContext as SequenceViewModel)?.Editor; + /// The picker covers the open sequence: its keys are the picker's. + private bool IsPicking => (DataContext as SequenceViewModel)?.IsPicking == true; + + /// + /// Ctrl+PgDn and Ctrl+PgUp move one step along the path (owner review 1, R7); null for any other key. They are read as + /// the key goes down the tree, because the filmstrip and the curve editors take Page Up and Page Down whatever the + /// modifiers. + /// + internal static int? StepDelta(Key key, ModifierKeys modifiers) => modifiers != ModifierKeys.Control ? null : key switch + { + Key.PageDown => 1, + Key.PageUp => -1, + _ => null, + }; + /// /// The project is saved a moment after each edit; closing the window first stores the last edit, and asks before /// discarding one that cannot be stored (once per window, so it holds even when another section is showing). @@ -70,10 +86,13 @@ public partial class SequenceView : UserControl } } - /// Space plays or pauses, arrows step a frame (BRIEF §12.3) — unless a text field or a control that uses the key has it. + /// + /// Space plays or pauses, arrows step a frame (BRIEF §12.3) — unless a text field or a control that uses the key has + /// it, or the picker covers the editor. + /// private void OnKeyDown(object sender, KeyEventArgs e) { - if (e.Handled || Editor is not { } editor || Keyboard.Modifiers != ModifierKeys.None || e.OriginalSource is TextBoxBase) return; + if (e.Handled || IsPicking || Editor is not { } editor || Keyboard.Modifiers != ModifierKeys.None || e.OriginalSource is TextBoxBase) return; var command = e.Key switch { Key.Space => editor.PlayCommand, @@ -86,12 +105,84 @@ public partial class SequenceView : UserControl e.Handled = true; } + /// Ctrl+PgDn and Ctrl+PgUp: the next and the previous step, stopping at the ends. + private void OnEditorPreviewKeyDown(object sender, KeyEventArgs e) + { + if (e.Handled || Editor is not { } editor || StepDelta(e.Key, Keyboard.Modifiers) is not { } delta) return; + editor.MoveStep(delta); + e.Handled = true; + } + + /// The arrows move between steps while the step bar has the keyboard; at either end they do nothing else (no frame step). + private void OnStepsKeyDown(object sender, KeyEventArgs e) + { + if (e.Key is Key.Left or Key.Right or Key.Up or Key.Down) e.Handled = true; + } + + /// + /// On the step shown, Space plays or pauses as everywhere in the editor (the list would only select the step again), and + /// Ctrl+Space does nothing (the list would leave the bar without a current step). Read on the way down, before the list. + /// + private void OnStepsPreviewKeyDown(object sender, KeyEventArgs e) + { + if (e.Key != Key.Space || IsPicking || Editor is not { } editor || e.OriginalSource is not ListBoxItem { IsSelected: true }) return; + if (Keyboard.Modifiers == ModifierKeys.None) editor.PlayCommand.Execute(null); + e.Handled = Keyboard.Modifiers is ModifierKeys.None or ModifierKeys.Control; + } + + /// Ctrl+click on the step shown keeps it the current one (a list would unselect it). + private void OnStepsPreviewMouseDown(object sender, MouseButtonEventArgs e) + { + if ((Keyboard.Modifiers & ModifierKeys.Control) == 0 + || ItemsControl.ContainerFromElement(Steps, e.OriginalSource as DependencyObject) is not ListBoxItem { IsSelected: true } item) return; + item.Focus(); + e.Handled = true; + } + + /// + /// After a step change (Alt+n, Ctrl+PgUp/PgDn, Previous/Next, a step's own button) the keyboard stays in the editor: when + /// it was in the step bar, on a control of the step that is about to be replaced, or on Previous about to be disabled + /// on the first step, it goes to the new step's cell; otherwise it stays where it is. + /// + private void OnStepsSelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (!ReferenceEquals(e.OriginalSource, Steps) || IsPicking || Editor is not { } editor || e.AddedItems.Count == 0) return; + if (Window.GetWindow(this) is not { } window || FocusManager.GetFocusedElement(window) is not DependencyObject focused) return; + var follows = Steps.IsAncestorOf(focused) || StepMeasure.IsAncestorOf(focused) || StepPanel.IsAncestorOf(focused) + || (ReferenceEquals(focused, PreviousStep) && editor.SelectedTab.Number == 1); + if (!follows) return; + // After the step's templates are swapped and the commands re-read (Background), so the cell is laid out and nothing takes it back; + // logical focus too, so a window that is not active gives the keyboard to the cell when it is activated. + Dispatcher.BeginInvoke(() => + { + if (Editor is not { } current || Steps.ItemContainerGenerator.ContainerFromItem(current.SelectedTab) is not ListBoxItem { IsVisible: true } cell) return; + FocusManager.SetFocusedElement(FocusManager.GetFocusScope(cell), cell); + Keyboard.Focus(cell); + }, DispatcherPriority.Background); + } + /// An opened editor takes the keyboard, so its shortcuts work without clicking into it first. private void OnEditorVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if (e.NewValue is true) FocusPreview(); } + /// + /// The focused control left the editor's tree or was disabled (a control of a step replaced by another, a button whose + /// command stopped applying): the keyboard fell to the window, where none of the editor's shortcuts are, so the preview + /// takes it back. A deliberate move out of the editor (the rail, a toast, another window) is left alone. + /// + private void OnEditorFocusWithinChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (e.NewValue is true) return; + // After WPF has re-evaluated the focus (Input), which is what raised this. + Dispatcher.BeginInvoke(() => + { + if (Window.GetWindow(this) is { IsActive: true } window && ReferenceEquals(Keyboard.FocusedElement, window) && EditorRoot.IsVisible && !IsPicking && Editor is not null) + Keyboard.Focus(Preview); + }, DispatcherPriority.Background); + } + /// A tool clicked with the mouse hands the keyboard back to the preview (Space keeps playing); keyboard users keep their focus. private void OnToolClicked(object sender, RoutedEventArgs e) { @@ -100,10 +191,11 @@ public partial class SequenceView : UserControl private void FocusPreview() { - if (Editor is null) return; + if (Editor is null || IsPicking) return; Dispatcher.BeginInvoke(() => { - if (Preview.IsVisible && !IsKeyboardFocusWithin) Keyboard.Focus(Preview); + // Back from the picker, the focus is still in it (now hidden): the preview takes it. + if (Preview.IsVisible && (!IsKeyboardFocusWithin || Picker.IsKeyboardFocusWithin)) Keyboard.Focus(Preview); }, DispatcherPriority.Input); } diff --git a/src/Titano.App/Sections/SequenceViewModel.cs b/src/Titano.App/Sections/SequenceViewModel.cs index 9f52f821..b3e38a8b 100644 --- a/src/Titano.App/Sections/SequenceViewModel.cs +++ b/src/Titano.App/Sections/SequenceViewModel.cs @@ -4,6 +4,7 @@ using System.Windows.Input; using System.Windows.Threading; using Titano.App.Editor; using Titano.App.Infrastructure; +using Titano.App.Library; using Titano.App.Shell; using Titano.Core.Diagnostics; using Titano.Core.Export; @@ -18,54 +19,124 @@ using Titano.Ui.Mvvm; namespace Titano.App.Sections; /// -/// The Sequence section (BRIEF §12.3): opens the sequence the Library, Jobs or the Server screen chose into an -/// (from this PC's archive, or a server sequence with this PC's proxies) and closes the -/// previous one after saving it; without a sequence it shows the empty state. A server sequence whose proxies are -/// missing or out of date fetches them first and opens once they are here. A failed open is reported and leaves the -/// section usable; an edit that cannot be saved is never dropped without the user's confirmation. +/// The Edit section (BRIEF §12.3; owner review 1, R7, formerly Sequence): opens the sequence the Library, Jobs, the +/// Server screen or its own picker chose into an (from this PC's archive, or a server +/// sequence with this PC's proxies). The next sequence is read first; only then does the open one close, after its +/// last edit is stored. Without a sequence, or after Change sequence, it shows the picker (the editor stays open behind +/// it until another sequence opens). A server sequence whose proxies are missing or out of date fetches them first and +/// opens once they are here, the open sequence staying open meanwhile. A failed open is reported once and leaves the +/// open sequence open; an edit that cannot be saved is never dropped without the user's confirmation, and never written +/// after they chose to drop it. The step each sequence showed is kept for the rest of the run. /// public sealed class SequenceViewModel : SectionViewModel { private readonly Dispatcher _dispatcher = Dispatcher.CurrentDispatcher; + private readonly Dictionary _steps = []; private EditorViewModel? _editor; private Guid? _openId; private bool _isLoading; + private bool _isPicking; + private bool _showsPicker = true; + + /// The shell's this section has answered. + private int _seenRequests; private Task _switch = Task.CompletedTask; private ProxyFetch? _fetch; public SequenceViewModel(ShellViewModel shell) - : base(SectionKey.Sequence, "Icon.Sequence") + : base(SectionKey.Edit, "Icon.Sequence") { Shell = shell; - OpenLibraryCommand = new RelayCommand(() => Shell.Navigate(SectionKey.Library)); + Picker = new SequencePickerViewModel(this); + OpenImportCommand = new RelayCommand(() => Shell.Navigate(SectionKey.Import)); + OpenJobsCommand = new RelayCommand(() => Shell.Navigate(SectionKey.Jobs)); + ChangeSequenceCommand = new RelayCommand(() => IsPicking = true, () => _editor is not null && !_isLoading && !_isPicking); + CancelPickCommand = new RelayCommand(KeepOpenSequence, () => CanCancelPick); shell.PropertyChanged += OnShellChanged; } public ShellViewModel Shell { get; } - public ICommand OpenLibraryCommand { get; } + /// The list the next sequence is chosen from. + public SequencePickerViewModel Picker { get; } - /// The open sequence; null shows the empty state. + /// Import, from the picker of an empty library. + public ICommand OpenImportCommand { get; } + + /// The Jobs screen, from the picker's line about proxies on their way. + public ICommand OpenJobsCommand { get; } + + /// + /// Shows the picker over the open sequence (Ctrl+O, the title's ▾, Next on the last step); the editor is not closed and + /// its changes keep being saved as usual. + /// + public ICommand ChangeSequenceCommand { get; } + + /// Hides the picker again, back to the open sequence (Esc); a server sequence chosen meanwhile no longer opens over it. + public ICommand CancelPickCommand { get; } + + /// The open sequence; null shows the picker. public EditorViewModel? Editor { get => _editor; private set { if (!Set(ref _editor, value)) return; - OnPropertyChanged(nameof(IsEmpty)); + // A sequence that opens ends the choice. + if (value is not null) + { + _isPicking = false; + OnPropertyChanged(nameof(IsPicking)); + Picker.SearchText = string.Empty; + } OnPropertyChanged(nameof(Title)); + OnPickerChanged(); } } - public bool IsLoading { get => _isLoading; private set => Set(ref _isLoading, value); } + /// The id of the open sequence; null when none is open. + public Guid? OpenSequenceId => _editor is null ? null : _openId; - public bool IsEmpty => _editor is null && !_isLoading; + public bool IsLoading + { + get => _isLoading; + private set + { + if (Set(ref _isLoading, value)) OnPickerChanged(); + } + } + + /// The picker shows over the open sequence, which stays laid out behind it. + public bool IsPicking + { + get => _isPicking; + private set + { + if (!Set(ref _isPicking, value)) return; + OnPropertyChanged(nameof(Title)); + OnPickerChanged(); + } + } + + /// The picker is on screen: no sequence is open, or another is being chosen. + public bool ShowsPicker => _showsPicker; + + /// An open sequence waits behind the picker, so Cancel (Esc) goes back to it; not while a switch is under way. + public bool CanCancelPick => _isPicking && _editor is not null && !_isLoading; + + public string? CancelPickToolTip => _editor is { } editor ? Loc.L("Tooltips.Editor.Picker.Cancel", editor.Title) : null; + + /// The server sequence whose proxies are on their way before it opens; null when none. + public string? FetchingTitle => _fetch?.Title; + + /// "Getting the proxies · Harbour sunset". + public string? FetchingText => _fetch is { } fetch ? string.Join(Loc.Separator, Loc.L("Editor.Proxies.Fetching"), fetch.Title) : null; /// The open sequence has an edit not stored yet (the save follows each change after a moment, and retries after a failure). public bool HasPendingSave => _editor?.Session.HasPendingSave == true; - /// "Titano — Harbour sunset" while a sequence is open. - public override string Title => _editor?.Title ?? Label; + /// "Titano — Harbour sunset" while a sequence is open and shown; the section's name while choosing one. + public override string Title => !_isPicking && _editor is { } editor ? editor.Title : Label; /// Opens (the editor of another sequence is saved and closed first). /// Opens it again even when it is the open one (its proxies were fetched again). @@ -83,10 +154,30 @@ public sealed class SequenceViewModel : SectionViewModel public async Task ShowAsync(Guid sequenceId) { Shell.OpenSequence(sequenceId); - // Already chosen and shown but not open (an earlier open failed): opening it again is what is asked now. - if (_openId != sequenceId && _switch.IsCompleted) _ = OpenAsync(sequenceId); + // Already the sequence asked for but not open (the shell did not change, so nothing started): opening it again is + // what is asked now, unless its proxies are on their way (it opens when they are here). + if (_openId != sequenceId && _switch.IsCompleted && Shell.CurrentSequenceId == sequenceId && !Fetching(sequenceId)) _ = OpenAsync(sequenceId); await Settled(_switch); - return _openId == sequenceId ? Editor : null; + if (_openId != sequenceId) return null; + // Asking for the open sequence ends a choice of another. + IsPicking = false; + return Editor; + } + + /// + /// Opens the sequence chosen in the picker: the open one simply shows again; another opens once it is read, after the + /// open one's last edit is stored (or the user chose to discard it). Keeping an edit that cannot be stored keeps the + /// open sequence; a server sequence whose proxies are not here yet leaves the picker on screen while they arrive. + /// + public async Task PickAsync(SequenceItem item) + { + ArgumentNullException.ThrowIfNull(item); + if (_editor is not null && item.Id == _openId) + { + KeepOpenSequence(); + return; + } + await ShowAsync(item.Id); } /// @@ -100,36 +191,61 @@ public sealed class SequenceViewModel : SectionViewModel var sync = services.Sync; if (sync.Server is not { } server || sync.Service is not { } service) throw new InvalidOperationException(Loc.L("Editor.Error.SignedOut")); if (services.Engine is not { } engine || services.Database is not { } db) throw new InvalidOperationException(Loc.L("Editor.Error.NoEngine")); + var followed = _fetch is { } current && current.RemoteId == remoteId ? current.JobId : Guid.Empty; StopFetch(); var fetch = new ProxyFetch(remoteId, title, engine); fetch.Handler = job => _dispatcher.BeginInvoke(() => OnFetchChanged(fetch, job)); engine.JobChanged += fetch.Handler; _fetch = fetch; - var job = await service.EnqueueDownloadAsync(engine, server, remoteId, title, SyncDownloadMode.Proxies, null); + OnFetchingChanged(); + Job job; + try + { + job = await service.EnqueueDownloadAsync(engine, server, remoteId, title, SyncDownloadMode.Proxies, null); + } + catch + { + // Nothing is on its way: the picker's line about it goes, and asking for the sequence again tries again. + if (ReferenceEquals(_fetch, fetch)) StopFetch(); + throw; + } fetch.JobId = job.Id; - Shell.Notify(Loc.L("Editor.Proxies.Fetching"), title, Loc.L("Shell.Nav.Jobs"), Loc.L("Tooltips.Nav.Jobs"), () => Shell.Navigate(SectionKey.Jobs)); + // The download already followed (the same sequence asked for again) is not announced twice. + if (job.Id != followed) + Shell.Notify(Loc.L("Editor.Proxies.Fetching"), title, Loc.L("Shell.Nav.Jobs"), Loc.L("Tooltips.Nav.Jobs"), () => Shell.Navigate(SectionKey.Jobs)); // A download that ended before its id was known here is handled now. if (await db.Jobs.GetAsync(job.Id) is { State: JobState.Done or JobState.Failed or JobState.Cancelled } ended) OnFetchChanged(fetch, ended); } /// /// Stores the open sequence's last edit. When the save fails (archive offline, read-only, busy), asks whether to - /// discard the edit (BRIEF §12.1: modals only for destructive confirmations). + /// discard the edit (BRIEF §12.1: modals only for destructive confirmations). No retry runs while the question is + /// open, so the answer holds: Discard drops the edit unwritten, Keep editing lets the retries go on. /// /// True when the editor may close: everything is stored or the user chose to discard. public async Task ConfirmCloseAsync() { if (Editor is not { } editor || await editor.Session.FlushAsync()) return true; - return Shell.Services.Dialogs.Confirm(new ConfirmRequest + var session = editor.Session; + if (!await session.HoldPendingAsync()) + { + // A retry stored it meanwhile: nothing to ask. + session.KeepPending(); + return true; + } + var discard = Shell.Services.Dialogs.Confirm(new ConfirmRequest { Heading = Loc.L("Editor.Unsaved.Title"), - Message = Loc.L("Editor.Unsaved.Message", editor.Title, editor.Session.LastSaveError?.Message ?? string.Empty), + Message = Loc.L("Editor.Unsaved.Message", editor.Title, session.LastSaveError?.Message ?? string.Empty), SafeText = Loc.L("Editor.Unsaved.Keep"), SafeToolTip = Loc.L("Tooltips.Editor.Unsaved.Keep"), ActionText = Loc.L("Editor.Unsaved.Discard"), ActionToolTip = Loc.L("Tooltips.Editor.Unsaved.Discard"), IsDestructive = true, }); + if (discard) session.DiscardPending(); + else session.KeepPending(); + return discard; } /// Closes the open sequence (after , which stores its last edit). @@ -137,6 +253,7 @@ public sealed class SequenceViewModel : SectionViewModel { await Settled(_switch); if (Editor is not { } editor) return; + Remember(editor); Editor = null; _openId = null; await editor.DisposeAsync(); @@ -146,6 +263,7 @@ public sealed class SequenceViewModel : SectionViewModel internal void Attach(EditorViewModel editor) { _openId = editor.Session.Content.Sequence.Id; + if (_steps.TryGetValue(editor.Session.Content.Sequence.Id, out var memory)) editor.RestoreSteps(memory); Editor = editor; } @@ -154,17 +272,80 @@ public sealed class SequenceViewModel : SectionViewModel Shell.PropertyChanged -= OnShellChanged; StopFetch(); Editor?.Dispose(); + Picker.Dispose(); base.Dispose(); } protected override void OnActivated() { - if (Shell.CurrentSequenceId is { } id && id != _openId) _ = OpenAsync(id); + OpenRequested(); + ShowRequested(); + if (_showsPicker) _ = Picker.ReloadAsync(); } + /// Opens the sequence the shell asks for when it is not the open one (nor one whose proxies are on their way). + private void OpenRequested() + { + if (Shell.CurrentSequenceId is { } id && id != _openId && !Fetching(id)) _ = OpenAsync(id); + } + + /// + /// Asking for the open sequence again (the Library, Jobs, a project file, also while Edit is on screen) ends a choice of + /// another; coming back to Edit alone leaves the choice on screen. + /// + private void ShowRequested() + { + if (Shell.SequenceRequests == _seenRequests) return; + _seenRequests = Shell.SequenceRequests; + if (_editor is not null && Shell.CurrentSequenceId == _openId) KeepOpenSequence(); + } + + /// + /// Back to the open sequence (Cancel, Esc, or the open sequence chosen again): it is again the one asked for, and a + /// server sequence still waiting for its proxies no longer opens over it when they arrive (its download goes on). + /// + private void KeepOpenSequence() + { + if (_fetch is { } pending && pending.RemoteId != _openId) StopFetch(); + Shell.KeepSequence(_openId); + IsPicking = false; + } + + /// The proxies of server sequence are on their way: it opens when they are here. + private bool Fetching(Guid sequenceId) => _fetch?.RemoteId == sequenceId; + + /// + /// Whether the picker shows changed (a sequence opened or failed to, Change sequence, Cancel): it reads the list again + /// each time it appears on screen. + /// + private void OnPickerChanged() + { + OnPropertyChanged(nameof(CanCancelPick)); + OnPropertyChanged(nameof(CancelPickToolTip)); + var shows = !_isLoading && (_editor is null || _isPicking); + if (shows != _showsPicker) + { + _showsPicker = shows; + OnPropertyChanged(nameof(ShowsPicker)); + if (shows && IsSelected) _ = Picker.ReloadAsync(); + } + CommandManager.InvalidateRequerySuggested(); + } + + private void OnFetchingChanged() + { + OnPropertyChanged(nameof(FetchingTitle)); + OnPropertyChanged(nameof(FetchingText)); + } + + /// Keeps the step shows and the steps visited, for when its sequence opens again in this run. + private void Remember(EditorViewModel editor) => _steps[editor.Session.Content.Sequence.Id] = editor.StepMemory(); + private void OnShellChanged(object? sender, PropertyChangedEventArgs e) { - if (e.PropertyName == nameof(ShellViewModel.CurrentSequenceId) && IsSelected) OnActivated(); + if (!IsSelected) return; + if (e.PropertyName == nameof(ShellViewModel.CurrentSequenceId)) OpenRequested(); + else if (e.PropertyName == nameof(ShellViewModel.SequenceRequests)) ShowRequested(); } /// @@ -228,6 +409,7 @@ public sealed class SequenceViewModel : SectionViewModel if (_fetch is not { } fetch) return; _fetch = null; if (fetch.Handler is { } handler) fetch.Engine.JobChanged -= handler; + OnFetchingChanged(); } /// Set hero changed the frame the Library shows (any thread): its card loads the new thumbnail. @@ -253,26 +435,17 @@ public sealed class SequenceViewModel : SectionViewModel { await Settled(previous); if (sequenceId == _openId && !reload) return; - // The open sequence keeps its editor while its last edit is neither stored nor deliberately discarded. - if (!await ConfirmCloseAsync()) return; + // Asked for again while its proxies are on their way (the next visit, a second pick): it opens when they are here. + if (!reload && Fetching(sequenceId)) return; var services = Shell.Services; + // The progress bar shows until the switch ends; the picker, its Cancel and the editor are hidden meanwhile. IsLoading = true; - OnPropertyChanged(nameof(IsEmpty)); + ISequenceSource? source = null; try { - if (Editor is { } old) - { - Editor = null; - await old.DisposeAsync(); - } - _openId = sequenceId; - if (await OpenSourceAsync(services, sequenceId) is not { } opened) - { - // The proxies are on their way; the sequence opens when they are here. - _openId = null; - return; - } - var (source, title) = opened; + // The next sequence is read first: the open one stays open when this one cannot open now. + if (await OpenSourceAsync(services, sequenceId) is not { } opened) return; + source = opened.Source; SequenceContent content; try { @@ -282,34 +455,62 @@ public sealed class SequenceViewModel : SectionViewModel { // The server's frames are no longer these proxies: fetch them again, then open. await source.DisposeAsync(); - _openId = null; - await FetchProxiesAsync(sequenceId, title); + source = null; + await FetchProxiesAsync(sequenceId, opened.Title); return; } - catch + // Only now does the open sequence close: its last edit is stored first, or discarded on the user's word. Keeping + // it keeps the open sequence as the one asked for, so the next visit to Edit does not ask once more. + if (!await ConfirmCloseAsync()) { - await source.DisposeAsync(); - throw; + Shell.KeepSequence(_openId); + IsPicking = false; + return; + } + // A server sequence that was waiting for its proxies is no longer the one asked for. + if (_fetch is { } pending && pending.RemoteId != sequenceId) StopFetch(); + if (Editor is { } old) + { + Remember(old); + Editor = null; + _openId = null; + await old.DisposeAsync(); } var processing = services.Processing?.Options; var encoders = processing?.Encoders ?? []; var session = new EditorSession(source, content, [.. encoders.SelectMany(e => e.Capabilities)]); - var editor = new EditorViewModel(Shell, session, encoders, processing?.Host ?? EncoderHost.Client); + // The session owns the source from here on. + source = null; + EditorViewModel editor; + try + { + editor = new EditorViewModel(Shell, session, encoders, processing?.Host ?? EncoderHost.Client); + } + catch + { + await session.DisposeAsync(); + throw; + } + if (_steps.TryGetValue(sequenceId, out var memory)) editor.RestoreSteps(memory); + _openId = sequenceId; Editor = editor; + services.Settings.LastEditedSequence = sequenceId; + services.SavePreferences(); await editor.AttachJobsAsync(); } catch (Exception ex) when (ex is not OutOfMemoryException) { - // Whatever failed (index, decoder set-up, advisor, the job list), the section stays usable: an editor that - // opened stays open, otherwise the next Open tries again. - if (Editor is null) _openId = null; + // Whatever failed (index, decoder set-up, advisor, the job list), the section stays usable: the sequence open + // before (or the one that has just opened) stays open and is again the one asked for, so coming back to Edit + // neither tries nor reports it again; choosing the sequence again does. Log.Warning("editor", $"Sequence {sequenceId} could not be opened", ex); Shell.ReportError(ex); + Shell.KeepSequence(OpenSequenceId); } finally { + if (source is not null) await source.DisposeAsync(); IsLoading = false; - OnPropertyChanged(nameof(IsEmpty)); } } diff --git a/src/Titano.App/Sections/SettingsViewModel.cs b/src/Titano.App/Sections/SettingsViewModel.cs index 86f7efb4..3925ffae 100644 --- a/src/Titano.App/Sections/SettingsViewModel.cs +++ b/src/Titano.App/Sections/SettingsViewModel.cs @@ -1559,6 +1559,7 @@ public sealed class SettingsViewModel : SectionViewModel RecentServers = _s.RecentServers, Window = _s.Window, RailCollapsed = _s.RailCollapsed, + LastEditedSequence = _s.LastEditedSequence, FirstRunCompleted = _s.FirstRunCompleted, JobsClearedAt = _s.JobsClearedAt, }; @@ -1629,11 +1630,13 @@ public sealed class SettingsViewModel : SectionViewModel Shell.Notify(Loc.L("Errors.Settings.Import"), isError: true); return; } - // Everything but the session, the window and its rail, and the first-run flag. + // Everything but the session, the window and its rail, the sequence edited last (another PC's ids mean nothing here) + // and the first-run flag. imported.ProtectedToken = _s.ProtectedToken; imported.ServerUrl = _s.ServerUrl; imported.Window = _s.Window; imported.RailCollapsed = _s.RailCollapsed; + imported.LastEditedSequence = _s.LastEditedSequence; imported.FirstRunCompleted = _s.FirstRunCompleted; ApplyAll(imported); // Settings of a PC never rewrite the shared archive.json: the imported templates and sizes are the defaults of new diff --git a/src/Titano.App/Shell/MainWindow.xaml b/src/Titano.App/Shell/MainWindow.xaml index 4b4207f9..8a0d9450 100644 --- a/src/Titano.App/Shell/MainWindow.xaml +++ b/src/Titano.App/Shell/MainWindow.xaml @@ -17,13 +17,13 @@ - + - + diff --git a/src/Titano.App/Shell/ScreenCapture.cs b/src/Titano.App/Shell/ScreenCapture.cs index d6003e96..a4d6bb94 100644 --- a/src/Titano.App/Shell/ScreenCapture.cs +++ b/src/Titano.App/Shell/ScreenCapture.cs @@ -116,8 +116,10 @@ public static class ScreenCapture shell.Navigate(SectionKey.About); written += await SaveAsync(window, directory, "about", theme); - shell.Navigate(SectionKey.Sequence); - written += await SaveAsync(window, directory, "sequence", theme); + // Edit with no sequence open: the picker (owner review 1, R7). + shell.Navigate(SectionKey.Edit); + await shell.Sequence.Picker.Loading; + written += await SaveAsync(window, directory, "edit-picker", theme, waitForThumbnails: shell); foreach (var state in ImportScenes.States) { @@ -218,10 +220,11 @@ public static class ScreenCapture } /// - /// The sequence editor on the synthetic sunset: every section in both themes (sequence-<tab>-<theme>.png, - /// the Camera tab with a keyframe selected, the Export tab as Export.html with the crop mask and no compare), then - /// the preview overlays, the waveform, the "what changed" toast of Optimise all, the Export tab of the sequence once - /// the server has it (Sync on) with two "Save both" copies to restore, and the busy state. + /// The editor on the synthetic sunset: every step of the Edit path in both themes (edit-<step>-<theme>.png, + /// the Camera step with a keyframe selected, the Export step as Export.html with the crop mask and no compare), then + /// the preview overlays, the waveform, the "what changed" toast of Optimise all, the picker over the open sequence + /// (edit-change), the Export step of the sequence once the server has it (Sync on) with two "Save both" copies + /// to restore, and the Analysis step while the analysis runs (edit-busy). /// private static async Task CaptureEditorAsync(MainWindow window, ShellViewModel shell, SampleData sample, string directory) { @@ -243,22 +246,28 @@ public static class ScreenCapture editor.SelectedTab = tab; editor.IsCompare = tab is not ExportTab; editor.CurrentIndex = tab is ExportTab ? 40 : 45; - written += await SaveEditorAsync(window, editor, directory, "sequence-" + tab.Key.ToLowerInvariant(), theme); + written += await SaveEditorAsync(window, editor, directory, "edit-" + tab.Key.ToLowerInvariant(), theme); } editor.SelectedTab = editor.Exposure; editor.IsCompare = true; editor.ShowVectors = editor.ShowRegions = true; - written += await SaveEditorAsync(window, editor, directory, "sequence-exposure-overlays", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-exposure-overlays", theme); editor.ShowVectors = editor.ShowRegions = false; editor.Exposure.ChartMode = ExposureChart.Waveform; - written += await SaveEditorAsync(window, editor, directory, "sequence-exposure-waveform", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-exposure-waveform", theme); editor.Exposure.ChartMode = ExposureChart.Luminance; editor.OptimiseAllCommand.Execute(null); - written += await SaveEditorAsync(window, editor, directory, "sequence-optimise", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-optimise", theme); editor.Session.Undo(); foreach (var toast in window.Toasts.Toasts.ToList()) window.Toasts.Dismiss(toast); + + // Change sequence: the picker over the open sequence, which stays open behind it until another opens. + shell.Sequence.ChangeSequenceCommand.Execute(null); + await shell.Sequence.Picker.Loading; + written += await SaveAsync(window, directory, "edit-change", theme, waitForThumbnails: shell); + shell.Sequence.CancelPickCommand.Execute(null); } // The server has the sequence (Sync can be ticked) and two copies of this PC's settings were kept by "Save both". @@ -272,7 +281,7 @@ public static class ScreenCapture foreach (var theme in Themes) { ThemeManager.Apply(theme); - written += await SaveEditorAsync(window, editor, directory, "sequence-export-copies", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-export-copies", theme); } export.SyncToServer = false; editor.SelectedTab = editor.Exposure; @@ -280,15 +289,16 @@ public static class ScreenCapture written += await CaptureRightToLeftAsync(window, shell, editor, directory); - // Last, as it stays: an analysis of the sequence running (settings disabled, viewing tools live). + // Last, as it stays: an analysis of the sequence running (settings disabled, viewing tools live), on the step that follows it. await sample.MarkAnalysingAsync(id); await editor.AttachJobsAsync(); + editor.SelectedTab = editor.Analysis; // The job bar shows the analysis, the one job running. await shell.Jobs.ReloadAsync(); foreach (var theme in Themes) { ThemeManager.Apply(theme); - written += await SaveEditorAsync(window, editor, directory, "sequence-busy", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-busy", theme); } return written; } @@ -309,11 +319,11 @@ public static class ScreenCapture shell.Navigate(SectionKey.Library); written += await SaveAsync(window, directory, "library-rtl", AppTheme.Dark, waitForThumbnails: shell); - shell.Navigate(SectionKey.Sequence); + shell.Navigate(SectionKey.Edit); editor.SelectedTab = editor.Exposure; editor.IsCompare = true; editor.CurrentIndex = 45; - written += await SaveEditorAsync(window, editor, directory, "sequence-exposure-rtl", AppTheme.Dark); + written += await SaveEditorAsync(window, editor, directory, "edit-exposure-rtl", AppTheme.Dark); await ImportScenes.ShowAsync(shell, "plan"); DismissToasts(window); @@ -323,17 +333,17 @@ public static class ScreenCapture { UiLanguage.Apply("en"); } - shell.Navigate(SectionKey.Sequence); + shell.Navigate(SectionKey.Edit); editor.CurrentIndex = frame; return written; } /// /// A server sequence open with this PC's proxies (Sunrise over Superga, cached by the sync captures): the server in - /// the header, the preview from the proxies, the project from the server (sequence-remote); its Export tab, - /// where the server picks the encoder and keeps the renders (sequence-remote-export); a render running on the - /// server with its bar and Cancel (sequence-remote-running); then, last as it stays, the sequence opened by an - /// account without the Edit right (sequence-remote-readonly). + /// the header, the preview from the proxies, the project from the server (edit-remote); its Export tab, + /// where the server picks the encoder and keeps the renders (edit-remote-export); a render running on the + /// server with its bar and Cancel (edit-remote-running); then, last as it stays, the sequence opened by an + /// account without the Edit right (edit-remote-readonly). /// private static async Task CaptureRemoteEditorAsync(MainWindow window, ShellViewModel shell, SampleData sample, string directory) { @@ -353,10 +363,10 @@ public static class ScreenCapture ThemeManager.Apply(theme); editor.SelectedTab = editor.Exposure; editor.IsCompare = true; - written += await SaveEditorAsync(window, editor, directory, "sequence-remote", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-remote", theme); editor.SelectedTab = export; editor.IsCompare = false; - written += await SaveEditorAsync(window, editor, directory, "sequence-remote-export", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-remote-export", theme); } sample.RunServerRender(); @@ -366,7 +376,7 @@ public static class ScreenCapture foreach (var theme in Themes) { ThemeManager.Apply(theme); - written += await SaveEditorAsync(window, editor, directory, "sequence-remote-running", theme); + written += await SaveEditorAsync(window, editor, directory, "edit-remote-running", theme); } sample.EndServerJobs(); @@ -382,7 +392,7 @@ public static class ScreenCapture foreach (var theme in Themes) { ThemeManager.Apply(theme); - written += await SaveEditorAsync(window, viewer, directory, "sequence-remote-readonly", theme); + written += await SaveEditorAsync(window, viewer, directory, "edit-remote-readonly", theme); } return written; } diff --git a/src/Titano.App/Shell/SectionViewModel.cs b/src/Titano.App/Shell/SectionViewModel.cs index ce4af17a..a8d3f1ef 100644 --- a/src/Titano.App/Shell/SectionViewModel.cs +++ b/src/Titano.App/Shell/SectionViewModel.cs @@ -7,7 +7,9 @@ public enum SectionKey { Library, Import, - Sequence, + + /// One sequence analysed, edited and rendered step by step (owner review 1, R7; formerly Sequence). + Edit, Archive, Jobs, Server, diff --git a/src/Titano.App/Shell/ShellViewModel.cs b/src/Titano.App/Shell/ShellViewModel.cs index e50691f9..c487e691 100644 --- a/src/Titano.App/Shell/ShellViewModel.cs +++ b/src/Titano.App/Shell/ShellViewModel.cs @@ -30,6 +30,7 @@ public sealed class ShellViewModel : LocalizedViewModel private int _unseenFailures; private WelcomeViewModel? _welcome; private Guid? _currentSequenceId; + private int _sequenceRequests; public ShellViewModel(AppServices services) { @@ -146,24 +147,44 @@ public sealed class ShellViewModel : LocalizedViewModel private set => Set(ref _currentSequenceId, value); } + /// + /// Counts calls: asking for the open sequence again (the Library, Jobs, a project file) ends a + /// choice of another in Edit, while coming back to Edit alone does not (owner review 1, R7). + /// + public int SequenceRequests + { + get => _sequenceRequests; + private set => Set(ref _sequenceRequests, value); + } + /// Loads the data of every screen once the index is open (or failed to open). public async Task StartAsync() { if (Services.OpenError is { } error) ReportError(error); Jobs.Attach(); await Library.AttachAsync(); + // Edit opened before the index did shows its picker empty until now (neither "no sequences" nor Import). + if (Sequence.ShowsPicker && Sequence.IsSelected) _ = Sequence.Picker.ReloadAsync(); Settings.Attach(); About.Attach(); await Server.AttachAsync(); } - /// Opens a sequence in the editor. + /// Opens a sequence in Edit. public void OpenSequence(Guid sequenceId) { CurrentSequenceId = sequenceId; - Navigate(SectionKey.Sequence); + SequenceRequests++; + Navigate(SectionKey.Edit); } + /// + /// Edit's open sequence (or none) is again the sequence asked for: after Keep editing, a choice cancelled, an open that + /// failed, or the sequence asked for deleted. Coming back to Edit then neither asks once more nor tries again; asking + /// for a sequence again () does. + /// + internal void KeepSequence(Guid? sequenceId) => CurrentSequenceId = sequenceId; + /// Closes the first-run overlay for good. public void CompleteWelcome() { diff --git a/src/Titano.Core/Advice/AdvisorRules.cs b/src/Titano.Core/Advice/AdvisorRules.cs index 4a34dcbe..a42af767 100644 --- a/src/Titano.Core/Advice/AdvisorRules.cs +++ b/src/Titano.Core/Advice/AdvisorRules.cs @@ -435,7 +435,7 @@ internal sealed class AdvisorRules return; } var shake = _deep.Shake; - if (shake.MeasuredFraction < 0.5) + if (shake.MeasuredFraction < ShakeSummary.MinMeasuredFraction) { Missing(section, AdvisorParameters.Stabilize, AdvisorKeys.MissingShake, R(100 * shake.MeasuredFraction, 0)); return; diff --git a/src/Titano.Core/Analysis/Deep/DeepAnalysisReport.cs b/src/Titano.Core/Analysis/Deep/DeepAnalysisReport.cs index 5a479ce9..c534c0f2 100644 --- a/src/Titano.Core/Analysis/Deep/DeepAnalysisReport.cs +++ b/src/Titano.Core/Analysis/Deep/DeepAnalysisReport.cs @@ -89,7 +89,14 @@ public sealed record WhiteBalanceSummary(double JitterLog2, double DriftLog2, do /// Area fraction a centred crop must give up to hide every correction. /// Average drift of the smoothed path. /// Share of frame pairs whose shift could be measured (textured patches). -public sealed record ShakeSummary(double RmsPx, double MaxPx, double CropCost, double PanPxPerFrame, bool PanDetected, double MeasuredFraction); +public sealed record ShakeSummary(double RmsPx, double MaxPx, double CropCost, double PanPxPerFrame, bool PanDetected, double MeasuredFraction) +{ + /// + /// Below this share of measured frame pairs the shake is unknown: the advisor decides nothing about stabilisation and + /// the editor shows no shake value (unmeasured shifts count as none, so the path would look steadier than it is). + /// + public const double MinMeasuredFraction = 0.5; +} /// Median of the sampled pairs' median flow magnitude, source px per frame. /// Median of the sampled pairs' 95th-percentile magnitude: the typical speed of moving content. diff --git a/tests/Titano.App.Tests/Editor/EditPathSmokeTests.cs b/tests/Titano.App.Tests/Editor/EditPathSmokeTests.cs new file mode 100644 index 00000000..02ad69ec --- /dev/null +++ b/tests/Titano.App.Tests/Editor/EditPathSmokeTests.cs @@ -0,0 +1,390 @@ +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Threading; +using Titano.App.Editor; +using Titano.App.Infrastructure; +using Titano.App.Sections; +using Titano.App.Shell; +using Titano.App.Tests.Windows; +using Titano.Core.Export; +using Titano.Core.Localization; +using Titano.Testing; + +namespace Titano.App.Tests.Editor; + +/// +/// The Edit path in the real main window at the 1200 × 788 capture size (owner review 1, R7): the step bar for screen +/// readers and the keyboard, Previous and Next, the findings' way to their step, the step memory and right to left. +/// +[WindowsOnly] +[Serial] +[Timeout(300_000)] +public sealed class EditPathSmokeTests +{ + [Test] + public Task TheStepBarNamesEachStepItsStateAndItsShortcut() => ScreenHost.RunAsync(async () => + { + await using var app = await ScreenSmokeTests.SampleApp.StartAsync(); + var (editor, view) = await OpenAsync(app); + await using (editor) + { + var steps = StepItems(view); + Assert.Count(8, steps); + for (var i = 0; i < steps.Count; i++) + { + var tab = (EditorTab)steps[i].DataContext; + Assert.Equal(i + 1, tab.Number); + Assert.Equal(tab.Header, AutomationProperties.GetName(steps[i])); + Assert.Equal(tab.StateText, AutomationProperties.GetItemStatus(steps[i])); + Assert.Equal($"Alt+{i + 1}", AutomationProperties.GetAcceleratorKey(steps[i])); + Assert.True(((string)steps[i].ToolTip).EndsWith($"Alt+{i + 1}", StringComparison.Ordinal), $"{tab.Key}: the tooltip names the shortcut"); + Assert.False(string.IsNullOrEmpty(tab.StateText), $"{tab.Key}: a state"); + } + Assert.Equal(EditPath.Frames, editor.SelectedTab.Key, "an analysed sequence opens on Frames"); + Assert.True(editor.Frames.IsVisited); + Assert.False(editor.Exposure.IsVisited); + + // Previous waits on the first step; Next names where it goes. + editor.SelectedTab = editor.Analysis; + Assert.False(editor.PreviousStepCommand.CanExecute(null)); + Assert.Equal(Loc.L("Tooltips.Editor.Step.First"), editor.PreviousToolTip); + Assert.Equal(Loc.L("Tooltips.Editor.Step.Next", editor.Frames.Header), editor.NextToolTip); + Assert.Equal("1 / 8", editor.StepCounter); + editor.NextStepCommand.Execute(null); + Assert.Same(editor.Frames, editor.SelectedTab); + Assert.Equal(Loc.L("Editor.Step.Announce", 2, 8, editor.Frames.Header, editor.Frames.StateText), editor.StepAnnouncement); + + // Alt+3 opens the third step; Ctrl+PgDn and Ctrl+PgUp move one step and stop at the ends. + var root = Find(view).Single(g => g.Name == "EditorRoot"); + var alt3 = root.InputBindings.OfType().Single(b => b.Key == Key.D3 && b.Modifiers == ModifierKeys.Alt); + alt3.Command.Execute(alt3.CommandParameter); + Assert.Same(editor.Exposure, editor.SelectedTab); + Assert.Equal(1, SequenceView.StepDelta(Key.PageDown, ModifierKeys.Control)); + Assert.Equal(-1, SequenceView.StepDelta(Key.PageUp, ModifierKeys.Control)); + Assert.Null(SequenceView.StepDelta(Key.PageDown, ModifierKeys.None), "Page Down alone stays the filmstrip's"); + editor.MoveStep(-10); + Assert.Same(editor.Exposure, editor.SelectedTab, "a move past the first step does nothing"); + Assert.False(root.InputBindings.OfType().Any(b => b.Modifiers == ModifierKeys.Alt && b.Key is >= Key.NumPad0 and <= Key.NumPad9), + "no Alt+NumPad binding: those type characters into text fields"); + + // On the last step, Next chooses the next sequence: the picker covers the editor, which stays open. + editor.SelectedTab = editor.Tabs[^1]; + Assert.Equal(Loc.L("Editor.Step.NextSequence"), editor.NextText); + editor.NextStepCommand.Execute(null); + Assert.True(app.Shell.Sequence.IsPicking); + Assert.Same(editor, app.Shell.Sequence.Editor); + app.Shell.Sequence.CancelPickCommand.Execute(null); + Assert.False(app.Shell.Sequence.IsPicking); + } + }); + + [Test] + public Task AFindingOpensTheStepThatDealsWithIt() => ScreenHost.RunAsync(async () => + { + await using var app = await ScreenSmokeTests.SampleApp.StartAsync(); + var (editor, view) = await OpenAsync(app); + await using (editor) + { + editor.SelectedTab = editor.Analysis; + await SettleAsync(app.Window); + var finding = Assert.Contains(editor.Analysis.Findings, f => f.Step is not null && !ReferenceEquals(f.Step, editor.Analysis)); + var row = Find(view).Single(i => ReferenceEquals(i.DataContext, finding)); + var goTo = Find