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.
This commit is contained in:
Alby96 committed 2026-10-19 12:10:42 +02:00
1 parent 4ea44bb917
commit 5aeb6aa787
214 files changed
+6547 -826

No files matched your search

+5
View File
@@ -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-<step>`, `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. |