Files
OpenNest/OpenNest.Data/IDrawingLibrary.cs
T
ajandClaude Opus 5.5 175782d8f8 feat(data): library browse session
Add from Drawing Library needs the same race-safe paging as the Database-mode
Open dialog: a generation counter so an older response never replaces a newer
one, cancellation after the superseding request is installed, and IsLoading
tracking only the latest request. `DrawingLibraryBrowseSession` mirrors
`NestBrowseSession` for library queries.

It starts filtered to the nest's material, grade and thickness, since that is
almost always what the operator wants and a mismatch drops cut pins anyway
(D3). "Show all" lifts the filter. A nest with no thickness filters by material
only, and the empty-result text tells the operator when the nest filter, rather
than an empty library, is why nothing is listed. Archived drawings stay hidden.

`IDrawingLibrary` is the read side the session and the add flow use, so both
are testable with fakes; `RemoteDrawingLibrary` implements it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:33:18 -04:00

15 lines
720 B
C#

namespace OpenNest.Data;
/// <summary>
/// The read side of the server drawing library that browsing and adding to a nest use.
/// <see cref="RemoteDrawingLibrary"/> is the only production implementation.
/// </summary>
public interface IDrawingLibrary
{
/// <summary>One bounded page of drawings matching the query, filtered and ordered by the server.</summary>
Task<DrawingLibraryPage> QueryAsync(DrawingLibraryQuery query, CancellationToken cancellationToken = default);
/// <summary>The exact package of one immutable revision, or null when the drawing or revision is unknown.</summary>
Task<byte[]?> GetRevisionPackageAsync(Guid id, int revision, CancellationToken cancellationToken = default);
}