Extract AvalonDraw into reusable Svg.Editor.* packages#470
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e85598b608
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 502584ef46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9618fa93b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
PR Summary: Extract AvalonDraw into reusable
Svg.Editor.*packagesOverview
This change turns
samples/AvalonDrawinto a thin demo host and moves reusable editor functionality into a new package family undersrc/Svg.Editor.*.The extracted packages are intended to let consuming applications embed:
samples/AvalonDrawremains the sample application that wires desktop-specific behavior such as top-level hosting, preview chrome, and storage-provider integration.Package layout
src/Svg.Editor.CoreOwns reusable editor state and session primitives, including:
src/Svg.Editor.SvgOwns SVG mutation and resource management concerns, including:
src/Svg.Editor.SkiaOwns rendering/editing behavior that is not Avalonia-specific, including:
src/Svg.Editor.AvaloniaOwns reusable non-canvas Avalonia UI, including:
DocumentOutlineViewResourceBrowserViewPropertyInspectorViewToolPaletteViewStatusBarViewsrc/Svg.Editor.Skia.AvaloniaOwns the reusable Skia/Avalonia composition layer, including:
SvgEditorSurfaceSvgEditorWorkspaceThe workspace now exposes host-facing dialog/file-dialog seams so applications can embed the editor without inheriting sample-specific modal or storage logic.
Sample host changes
samples/AvalonDrawnow behaves as a composition shell instead of the primary implementation site.Key changes:
MainWindowhostsSvgEditorWorkspaceinstead of owning editor logic directlyLarge blocks of reusable code were removed from:
samples/AvalonDraw/ServicesPublic API and reuse improvements
This refactor establishes clear reusable seams for downstream applications:
MainWindow-local templatesTest coverage added
Three new test projects were added to the solution:
tests/Svg.Editor.Svg.UnitTeststests/Svg.Editor.Skia.UnitTeststests/Svg.Editor.Skia.Avalonia.UnitTestsSolution integration
Svg.Skia.slnxnow includes:src/Svg.Editor.Coresrc/Svg.Editor.Svgsrc/Svg.Editor.Skiasrc/Svg.Editor.Avaloniasrc/Svg.Editor.Skia.Avaloniatests/Svg.Editor.Svg.UnitTeststests/Svg.Editor.Skia.UnitTeststests/Svg.Editor.Skia.Avalonia.UnitTestsDocumentation for package selection and consumer guidance was added in
docs/editor-packages.md.Commit breakdown
This branch is split into three commits:
d78a550eExtract Svg.Editor core service librariesSvg.Editor.Core,Svg.Editor.Svg, andSvg.Editor.Skia01294aaaMove AvalonDraw UI into reusable editor packagesSvg.Editor.AvaloniaandSvg.Editor.Skia.Avaloniasamples/AvalonDrawto a thin hoste85598b6Add editor solution tests and docsValidation
Validated on branch
refactor/svg-editor-packageswith:dotnet format --no-restore dotnet build Svg.Skia.slnx -c Release dotnet test Svg.Skia.slnx -c Release --no-buildResults:
dotnet formatcompleted successfullydotnet buildcompleted successfullydotnet testcompleted successfullyWarnings and follow-up notes
The branch is valid but the solution still emits pre-existing warnings outside the scope of this extraction, including:
NU1510insamples/svgcSvg.Editor.Skia.Avaloniaonnet461becauseSvg.Controls.Skia.Avaloniais not strong-namedThe extracted editor workspace still contains obsolete Avalonia drag/drop and container APIs that build successfully but should be modernized in a follow-up cleanup.
Working tree note
The
externals/SVGsubmodule is dirty in the local workspace and was intentionally left untouched because it is unrelated to this refactor.