Remove the demo text-parsing domain
The scaffolding domain existed to prove the shell end to end before there was
anything real to put in it. There is now, so it goes - as CLAUDE.md promised it
would.
Gone: the two sample parsers, ITextParser, ParsedRecord, the parser catalog,
ParseViewModel and ParseView, their tests, and the settings key that remembered
which parser was last used. ParseError.LineNumber becomes Index, since for a
listing "line 42" was simply untrue, and the error keys move from Parse.Error.*
to Collect.Error.* now that parsing is not a concept here.
Kept: IParser<,>, ParseOutcome, ParseProgress and ParseError. The streaming
contract was always the general part - it was only ever the text-shaped closure
of it that was scaffolding.
Rendering the dashboard caught two keys that were referenced but never added
during the rename: the XAML was repointed and the resources were not. The parity
test could not see it, because it compares the two files against each other and
a key absent from both is consistent. That gap now has its own test, which reads
every {l:Loc} in the XAML and checks it resolves - a screenshot is too late and
too manual a way to find a missing string.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
fe62bcf53f
commit
f8744c930a
@@ -1,4 +1,4 @@
|
||||
using AvParser.Core.Parsing;
|
||||
using AvParser.Core.Collecting;
|
||||
using AvParser.Infrastructure.Storage;
|
||||
using AvParser.UI.Navigation;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -13,24 +13,25 @@ public sealed class DashboardViewModel : PageViewModel
|
||||
private readonly IServiceProvider _services;
|
||||
|
||||
/// <summary>Creates the dashboard.</summary>
|
||||
/// <param name="catalog">Registered parsers, shown as cards.</param>
|
||||
/// <param name="catalog">Registered media sources, shown as cards.</param>
|
||||
/// <param name="paths">Where the app writes settings and logs.</param>
|
||||
/// <param name="services">
|
||||
/// Used to resolve <see cref="INavigationService"/> at click time rather than at construction
|
||||
/// time. Injecting it directly would be a cycle: the navigation service is built from every
|
||||
/// page, so a page cannot also depend on it up front.
|
||||
/// </param>
|
||||
public DashboardViewModel(IParserCatalog catalog, IAppPaths paths, IServiceProvider services)
|
||||
public DashboardViewModel(IMediaSourceCatalog catalog, IAppPaths paths, IServiceProvider services)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(catalog);
|
||||
ArgumentNullException.ThrowIfNull(paths);
|
||||
|
||||
_services = services ?? throw new ArgumentNullException(nameof(services));
|
||||
|
||||
Parsers = [.. catalog.Parsers.Select(parser => new ParserViewModel(parser))];
|
||||
Sources = [.. catalog.Sources.Select(source => new MediaSourceViewModel(source))];
|
||||
DataDirectory = paths.DataDirectory;
|
||||
MediaDirectory = paths.MediaDirectory;
|
||||
|
||||
GoToParseCommand = ReactiveCommand.Create(() => Navigate<ParseViewModel>());
|
||||
GoToCollectCommand = ReactiveCommand.Create(() => Navigate<CollectViewModel>());
|
||||
GoToSettingsCommand = ReactiveCommand.Create(() => Navigate<SettingsViewModel>());
|
||||
}
|
||||
|
||||
@@ -40,14 +41,17 @@ public sealed class DashboardViewModel : PageViewModel
|
||||
/// <inheritdoc />
|
||||
public override string IconKey => "IconHome";
|
||||
|
||||
/// <summary>Registered parsers, shown as cards.</summary>
|
||||
public IReadOnlyList<ParserViewModel> Parsers { get; }
|
||||
/// <summary>Registered media sources, shown as cards.</summary>
|
||||
public IReadOnlyList<MediaSourceViewModel> Sources { get; }
|
||||
|
||||
/// <summary>Where settings and logs are written.</summary>
|
||||
public string DataDirectory { get; }
|
||||
|
||||
/// <summary>Jumps to the Parse page.</summary>
|
||||
public ReactiveCommand<RxVoid, RxVoid> GoToParseCommand { get; }
|
||||
/// <summary>Where collected media is written.</summary>
|
||||
public string MediaDirectory { get; }
|
||||
|
||||
/// <summary>Jumps to the Collect page.</summary>
|
||||
public ReactiveCommand<RxVoid, RxVoid> GoToCollectCommand { get; }
|
||||
|
||||
/// <summary>Jumps to the Settings page.</summary>
|
||||
public ReactiveCommand<RxVoid, RxVoid> GoToSettingsCommand { get; }
|
||||
|
||||
Reference in New Issue
Block a user