14 Commits

Author SHA1 Message Date
klevze 58e11ba4e3 Add YouTube Shorts tab (C# port of amigadb-short.sh)
New "Video | Shorts" tab strip on the main page. The existing Video tab and
its render pipeline are unchanged; Shorts is a new, independent workflow
sharing the same render-progress/log/output controls.

- Services/ShortsPipeline.cs: C# port of amigadb-short.sh rather than
  shelling out to bash — end users on plain Windows don't have bash/WSL, and
  shipping this as a native part of the app keeps distribution self-contained.
  All 19 visual style filtergraphs (brand, pixel, mirror, crop, workbench,
  blur, crt, copper, stars, grid, tiles, scan, starfield, plasma,
  rasterbars, vhs, monitor, split, spectrum) are copied verbatim from the
  bash heredocs. Per explicit decision, kept parity with the script's actual
  behavior where the brand-style HOOK_BOX_Y/INFO_BOX_Y/font-size variables
  are computed but never actually used in the final filter (dead code in
  the original) rather than "fixing" it and changing rendered output.
  Reuses ToolExtractor/MediaProbe/ProcessRunner exactly as RenderPipeline
  does, so FFmpeg resolution and NVENC fallback behave identically.

- Models/ShortSettings.cs: job parameters + ShortStyle enum.

- AppSettings gains sticky Shorts defaults (style, hook, website, font,
  background image, CRF, preset) alongside the existing Video defaults.

- MainPage: Video/Shorts tab buttons toggle two content panels; the
  background-image field auto-hides for non-brand styles; font field
  defaults to the first bold system font found (Segoe UI Bold, Segoe UI
  Semibold, Arial Bold, Calibri Bold); blank output path is auto-derived
  from the input filename and style, matching the script's default.

- 13 new unit tests (escaping order, meta-line joining, validation,
  every style producing a non-empty filter, the drawtext trailer's timing
  gates). Full run is 72/72 passing.

- Fixed a bug caught during manual testing: MainPage.Resources["PrimaryButtonStyle"]
  looked in the Page's own (empty) resource dictionary instead of
  Application.Current.Resources, throwing on every tab switch.

Verified end-to-end: rendered a real Short from an existing video through
the actual running app (not just unit tests) and inspected extracted
frames — hook/title/meta/website text overlays appear and disappear at the
correct timestamps with correct styling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 17:30:25 +02:00
klevze f1f1be778b Fix missing taskbar/Alt+Tab icon
AppWindow.SetIcon(executablePath) was passing the .exe's own path, but that
API requires an actual .ico file path — passing an .exe silently does
nothing, so the window fell back to a generic placeholder icon in the
taskbar and Alt+Tab (the custom title bar icon fixed earlier is a separate,
XAML-drawn Image and was unaffected).

Embed branding/AmiReel.ico as a resource, extract it once to
%LOCALAPPDATA%\AmiReel\app-icon.ico on startup, and call
AppWindow.SetIcon() with that file path instead. Verified via WM_GETICON
against the running window's HWND that both the big and small icons now
resolve to the real AmiReel logo.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 16:38:12 +02:00
klevze fc02cd9602 Update README project layout for tests and new Services files
Reflect the current repo structure: AmiReel.Tests/, Properties/AssemblyInfo.cs,
and the FfmpegProgressParser/FfmpegOutputFilter split out of ProcessRunner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 16:27:15 +02:00
klevze 8f27aee11a Fix title bar icon missing in single-file published builds
The title bar Image used Source="ms-appx:///Assets/Square44x44Logo.scale-200.png".
That resolves fine in a normal build (Assets/ and AmiReel.pri sit next to the exe),
but a single-file self-contained publish (IncludeAllContentForSelfExtract=true)
bundles Content items into the exe in a way ms-appx:// can no longer resolve at
runtime, leaving the title bar icon blank — reproduced with the actual
publish-win-x64.ps1 output, confirmed fixed the same way.

Load the icon from a plain embedded resource instead (same mechanism already
used for ffmpeg.exe/ffprobe.exe): the PNG is embedded via
<EmbeddedResource LogicalName="AmiReel.Assets.TitleBarIcon.png">, and
MainWindow loads it at startup via GetManifestResourceStream + BitmapImage.
SetSourceAsync. This bypasses the ms-appx/MRT resource pipeline entirely, so
it behaves identically in dotnet build, dotnet run, and a single-file publish.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 16:01:20 +02:00
klevze c412469773 Add unit tests, dedupe FFmpeg output filtering, harden settings records
Implements the suggestions from the last review pass:

- Add AmiReel.Tests (MSTest), covering the pure logic in Models/ and
  Services/: SupportedVideoFormats, AppSettings normalization,
  UserFacingErrors.Summarize, the new FfmpegProgressParser/
  FfmpegOutputFilter, RenderPipeline.Validate, BuildProgressMessage, and
  MoveSourceVideos. 59 tests, all passing. UI code-behind and anything that
  spawns an actual FFmpeg process are left to manual/integration testing.
  Exclude AmiReel.Tests\**\*.cs from AmiReel.csproj's default item glob —
  it's a subfolder of the app project now, so without the exclude the app
  itself was compiling the MSTest-only test files.

- Extract the FFmpeg version/library-banner boilerplate list that
  ProcessRunner (live log filter) and UserFacingErrors (error summarizer)
  had each duplicated into a shared FfmpegOutputFilter.IsBoilerplateLine;
  each caller keeps its own remaining context-specific checks on top.
  Also extract ProcessRunner's line-parsing regexes into a standalone
  FfmpegProgressParser so it's directly unit-testable without spawning a
  process.

- Convert AppSettings and RenderSettings from positional record
  constructors to named `required` init properties. Both records had
  runs of same-typed consecutive parameters (three string timing fields
  in AppSettings; three doubles then five ints in RenderSettings) that a
  positional constructor would let get silently transposed at a call site
  without the compiler catching it. Update the two call sites
  (MainPage.xaml.cs) to object-initializer syntax.

- Add Properties/AssemblyInfo.cs with InternalsVisibleTo("AmiReel.Tests")
  and make Validate/BuildProgressMessage/IsNoise internal so tests can
  reach them directly instead of only through process-spawning entry
  points.

- README: document `dotnet test`, and note that Package.appxmanifest's
  Identity is a local-dev placeholder that needs a real publisher/cert
  before MSIX distribution.

Verified: dotnet build (solution + test project) is 0 warnings/errors,
dotnet test is 59/59 passing, and the app still launches unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 14:27:57 +02:00
klevze 3de3357d23 Code review cleanup: dead code, unused capability, accessibility gap
- Remove unused `using Microsoft.Win32;` from MainPage.xaml.cs (leftover
  from the WPF OpenFileDialog era; WinUI uses Windows.Storage.Pickers)
- Trim App.xaml.cs down to the two usings it actually needs instead of the
  full WinUI3 template boilerplate list
- Change App.MainWindowInstance to an internal setter (only MainWindow
  itself should assign it)
- Add AutomationProperties.Name to the icon-only Settings button so screen
  readers announce it (it only had a mouse tooltip before)
- Delete Assets/AppIcon.ico: unreferenced by both the manifest and code,
  the real app icon comes from ApplicationIcon (branding/AmiReel.ico) and
  AppWindow.SetIcon at runtime
- Drop the systemAIModels capability from Package.appxmanifest; the app
  doesn't call any Windows AI API, so declaring it is an unnecessary
  privilege request

Verified: dotnet build produces 0 warnings/errors, app launches unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 14:13:22 +02:00
klevze 603af17e56 Remove legacy WPF app, flatten WinUI project to repo root, rename namespace
The repo carried two parallel UIs (WPF + WinUI) sharing Models/Services via
cross-directory Link includes. Now that WinUI is the only frontend, collapse
the structure so the WinUI project IS the repo root instead of a nested
sibling folder:

- Delete the WPF project entirely (App.xaml, MainWindow.xaml, csproj) and its
  bin/obj output
- Move AmiReel.WinUI/* up to the repo root (App, MainWindow, MainPage,
  DialogHelper, Assets, Package.appxmanifest, app.manifest, Properties,
  .github/instructions, AGENTS.md) via git mv, preserving history
- Rename AmiReel.WinUI.csproj -> AmiReel.csproj; regenerate the solution as
  AmiReel.slnx (the newer XML solution format) with a single project
- Rename namespace AmigaDB.VideoRenderer.{Models,Services} -> AmiReel.{...}
  and AmiReel_WinUI -> AmiReel across all files, including the embedded
  ffmpeg/ffprobe resource logical names in the csproj and ToolExtractor
- Models/ and Services/ no longer need the Link-based cross-directory
  <Compile Include>; they're picked up by the SDK's default globbing now
  that they live under the project directory
- Rename assets/ -> branding/ (source icon art) to avoid a case-insensitive
  collision with Assets/ (packaged tile art) once both sit at repo root
- Merge the two .gitignore files into one; track the PublishProfiles pubxml
  files instead of ignoring them (no secrets, and they keep publish
  reproducible across machines) as branding, gitignore, etc.
- Simplify publish-win-x64.ps1 (drop the -Target Wpf/WinUI switch, there's
  only one target now) and rewrite README.md to describe the single-project
  layout, build/run/publish commands, and file structure

Verified: dotnet build succeeds for both AmiReel.csproj and AmiReel.slnx, and
the built exe launches and renders identically to before the move.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 14:07:10 +02:00
klevze 3e881b79b8 Bring WinUI app to feature/visual parity with WPF, fix drag-and-drop and branding assets
- Restyle Fluent controls (buttons, fields, dialogs, ListView) to match the
  app's navy dark/light palette and consistent corner radii/sizing
- Fix ContentDialog (Settings, exit-confirm, error) styling by binding
  PrimaryButtonStyle/CloseButtonStyle explicitly via new DialogHelper,
  since ContentDialog ignores implicit Button styles and forces accent
  color onto whichever button is DefaultButton
- Remove MicaBackdrop and theme the title bar directly so it no longer
  shows a gray tint mismatched with the app's navy background
- Replace placeholder Assets/*.png (unused VS template art) with the real
  AmiReel logo at all required tile/splash/store sizes
- Set explicit default window size (1280x860, matching the old WPF app)
  with DPI-aware centering and a minimum size, instead of sizing to content
- Fix drag-and-drop silently failing: InputList_Drop needs a
  DragOperationDeferral before the first await or the DataView is torn
  down before GetStorageItemsAsync completes
- Add Preview player path setting (was present in WPF, missing in WinUI)
  and error handling for preview playback
- Accept all ffmpeg-readable video formats (mp4, mov, mkv, webm, ...) for
  file picker and drag-and-drop, not just .avi
- Add exit-confirmation dialog to WinUI, mirroring the WPF app

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 13:53:55 +02:00
klevze ab46a16726 Some fixes 2026-08-13 12:39:03 +02:00
klevze 027fc683ef Update README with setup and publish documentation 2026-08-11 16:35:42 +02:00
klevze d744056583 Refine WinUI shell and improve render diagnostics 2026-08-11 16:27:18 +02:00
klevze d62ae0b9fb Polish AmiReel UI and improve render workflow 2026-08-11 13:55:44 +02:00
klevze ad205bb534 Working version 2026-08-11 12:34:02 +02:00
klevze 438f163630 Initial AmiReel application 2026-08-11 10:43:27 +02:00