Conversation
…#110) * Add Drawing Manager component that can be used to add or remove shapes from drawing manager datasource * Add sample page for adding and removing shapes. * Add tests for DrawingManager.
…#115) - Drop net6.0 (EOL Nov 2024) and net7.0 (EOL May 2024) - Add net9.0 and net10.0 target frameworks to library and test projects - Update sample project to target net10.0 - Add per-TFM package references for net9.0 and net10.0 - Upgrade bunit from 1.26.64 to 1.37.7 for .NET 9/10 compatibility - Update all CI workflows to set up .NET 8.0, 9.0, and 10.0 SDKs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Re-enable the commented-out dotnet nuget push step in release.yml. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add .github/workflows/release.yml to the paths filter so the workflow also runs when the release workflow file itself is modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Razor SDK generates the static web assets manifest at dotnet build time. Previously, npm run build (which outputs the JS files to wwwroot/) ran after dotnet build, so the manifest was generated with an empty wwwroot/ and dotnet pack --no-build reused that stale manifest. Fix by moving the npm install/lint/build steps before dotnet restore and dotnet build, ensuring the compiled JS files exist in wwwroot/ when the static web assets manifest is generated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a new DrawingManager API to programmatically add/clear shapes in the Drawing Toolbar’s underlying data source, wires it into Map, and updates the repo to target newer .NET versions while adjusting CI/release workflows.
Changes:
- Add
DrawingManager(C#) + JS interop functions (TS) to add shapes to/clear the drawing manager source. - Expose
Map.DrawingManagerwhen a drawing toolbar is added; dispose it when the toolbar is removed. - Update test coverage and samples to demonstrate/validate the new DrawingManager behavior; update TFMs and workflows.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/AzureMapsControl.Components/Drawing/DrawingManager.cs |
New C# DrawingManager surface (AddShapesAsync/ClearAsync) calling drawing JS namespace. |
src/AzureMapsControl.Components/typescript/drawing/drawing.ts |
Adds JS addShapes and clear methods backing the new C# interop calls. |
src/AzureMapsControl.Components/Map/Map.cs |
Exposes and manages lifecycle of Map.DrawingManager. |
tests/AzureMapsControl.Components.Tests/Drawing/DrawingManager.cs |
New unit tests for DrawingManager behavior and error cases. |
tests/AzureMapsControl.Components.Tests/AzureMapsControl.Components.Tests.csproj |
Updates TFMs and bUnit version for tests. |
src/AzureMapsControl.Components/AzureMapsControl.Components.csproj |
Updates library TFMs and framework-specific package references. |
samples/AzureMapsControl.Sample/Components/Pages/Drawing/DrawingManagerLoadData.razor |
New sample page showing adding/clearing shapes via DrawingManager. |
samples/AzureMapsControl.Sample/Components/Layout/NavMenu.razor |
Adds nav link to the new sample page. |
samples/AzureMapsControl.Sample/AzureMapsControl.Sample.csproj |
Updates sample target framework. |
.github/workflows/build.yml |
Updates CI .NET setup steps to newer versions. |
.github/workflows/unit-tests.yml |
Updates unit test workflow .NET setup steps. |
.github/workflows/code-coverage.yml |
Updates coverage workflow .NET setup steps. |
.github/workflows/release.yml |
Updates release workflow .NET setup steps and re-enables NuGet publish. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// <summary> | ||
| /// List of shapes added to the data source | ||
| /// </summary> | ||
| private List<Shape> _sourceShapes; |
There was a problem hiding this comment.
_sourceShapes is only ever appended to and nulled out; it isn't used by any other production code (no reads/queries), so it adds ongoing memory overhead proportional to shapes added. If the library doesn't need to track shapes locally, consider removing this field and the AddRange/reset logic; if it is needed, consider exposing a read-only view or storing only IDs/metadata to reduce memory usage.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@arnaudleclerc I've opened a new pull request, #121, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Remove unused _sourceShapes field from DrawingManager to reduce memory overhead Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com>
…flicts Releases/1.17.1 (#119)
No description provided.