Scaffold AvParser: Avalonia 12 shell with adaptive layout

Greenfield skeleton for a parser desktop app. The domain is deliberately a
placeholder — IParser<TIn,TOut> plus two sample parsers — so the shell is
runnable and verifiable end to end before real logic lands.

Layers run one way: Core (no Avalonia, no IO) <- Infrastructure <- UI <- Desktop.
UI is a class library rather than the exe so headless tests build real views
without dragging in Program.cs, Serilog or the container.

Adaptive layout is built from what Avalonia actually offers, since it has no
AdaptiveTrigger or media queries: ResponsiveLayout observes Visual.Bounds and
projects a breakpoint onto both an attached property and :compact/:medium/
:expanded pseudoclasses, with 24px hysteresis so dragging a window edge cannot
make the layout flap. Pane state lives in the view model because a style setter
loses to a local value permanently; styles own only the visual variance.

Stack notes worth remembering: Avalonia.ReactiveUI is deprecated in favour of
ReactiveUI.Avalonia, and ReactiveUI 24 runs on the Primitives engine (RxVoid,
ISequencer, Signal<T>) and no longer self-initialises. Avalonia.Headless.XUnit
12.x requires xUnit v3. InvariantGlobalization must stay false or Semi.Avalonia
throws in its static constructor.

102 tests across three projects, including headless guards for the two failures
that are otherwise completely silent: a stylesheet whose selectors match nothing,
and a light palette too low-contrast for cards to read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-08-13 16:07:08 +03:00
co-authored by Claude Opus 5
commit 3db9d4dfc6
94 changed files with 5966 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Icons as StreamGeometry rather than an icon font: no extra package, no font-fallback
surprises on Linux, and they recolour with the theme like any other Path.
All are drawn on a 24x24 grid.
-->
<StreamGeometry x:Key="IconHome">M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z</StreamGeometry>
<StreamGeometry x:Key="IconDocument">
M6 2h9l5 5v15H6V2zm8 1.5V8h4.5L14 3.5zM8 12h8v1.6H8V12zm0 3.4h8V17H8v-1.6z
</StreamGeometry>
<StreamGeometry x:Key="IconSettings">
M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7zm9.4 3.5c0 .5 0 .9-.1 1.3l2 1.6-1.9 3.3-2.4-1a7.6 7.6 0 0 1-2.2 1.3l-.4 2.5h-3.8l-.4-2.5a7.6 7.6 0 0 1-2.2-1.3l-2.4 1-1.9-3.3 2-1.6a7.7 7.7 0 0 1 0-2.6l-2-1.6L5.6 5.8l2.4 1a7.6 7.6 0 0 1 2.2-1.3l.4-2.5h3.8l.4 2.5a7.6 7.6 0 0 1 2.2 1.3l2.4-1 1.9 3.3-2 1.6c.1.4.1.8.1 1.3z
</StreamGeometry>
<StreamGeometry x:Key="IconInfo">
M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z
</StreamGeometry>
<StreamGeometry x:Key="IconMenu">M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z</StreamGeometry>
<StreamGeometry x:Key="IconBack">M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z</StreamGeometry>
<StreamGeometry x:Key="IconPlay">M8 5v14l11-7z</StreamGeometry>
<StreamGeometry x:Key="IconStop">M6.5 6.5h11v11h-11z</StreamGeometry>
<StreamGeometry x:Key="IconBroom">
M4 20h16v-1.6H4V20zm3.6-3.6h8.8l-1.2-5.2-2-1V4.4h-2.4v5.8l-2 1-1.2 5.2z
</StreamGeometry>
<StreamGeometry x:Key="IconSun">
M12 7.2a4.8 4.8 0 1 0 0 9.6 4.8 4.8 0 0 0 0-9.6zM11 1.4h2v3.2h-2V1.4zm0 18h2v3.2h-2v-3.2zM1.4 11h3.2v2H1.4v-2zm18 0h3.2v2h-3.2v-2zM4.3 5.7 5.7 4.3l2.2 2.3-1.4 1.4-2.2-2.3zm11.8 11.9 1.4-1.4 2.3 2.2-1.4 1.4-2.3-2.2zM18.3 4.3l1.4 1.4-2.3 2.2-1.4-1.4 2.3-2.2zM4.3 18.3l2.2-2.3 1.4 1.4-2.2 2.3-1.4-1.4z
</StreamGeometry>
<StreamGeometry x:Key="IconMoon">M12.4 3a9 9 0 1 0 8.6 11.2A7 7 0 0 1 12.4 3z</StreamGeometry>
<StreamGeometry x:Key="IconAlert">M12 2 1 21h22L12 2zm1 14.2h-2v-2h2v2zm0-3.8h-2V8.6h2v3.8z</StreamGeometry>
<StreamGeometry x:Key="IconSparkle">
M12 2.5 13.9 9l6.6 1.9-6.6 1.9L12 19.4l-1.9-6.6L3.5 11 10.1 9 12 2.5z
</StreamGeometry>
</ResourceDictionary>