Skip to content

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented May 19, 2025

Fixes #13247

Cause:

Proposed changes

  • Removing unnecessary judgment if (obj is Control) from method Serialize of DemoConsole.DesignerSerializationService

Customer Impact

  • The ToolStrip can be copy and paste normally

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

The subitem of the ToolStrip cannot be copied
BeforeChangs

After

All of the content can be copied normally
AfterChanges

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.100-preview.5.25265.106
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner May 19, 2025 09:40
@LeafShi1 LeafShi1 requested review from Copilot and removed request for a team May 19, 2025 09:40
@LeafShi1 LeafShi1 requested a review from RussKie May 19, 2025 09:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes an unnecessary if (obj is Control) check in the Serialize method of the test integration for the designer serialization service, allowing all objects in the collection to be serialized rather than only controls.

  • Eliminates a type guard that prevented non-Control objects from being serialized in tests.
  • Ensures tool strip items (and other objects) can be round-tripped in designer serialization tests.
Comments suppressed due to low confidence (2)

src/test/integration/DesignSurface/DesignSurfaceExt/DesignerSerializationServiceImpl.cs:35

  • [nitpick] Consider adding a brief comment explaining why the Control type check was removed, so future readers understand the intentional widening of serialization behavior.
componentSerializationService.Serialize(serializationStore, obj);

src/test/integration/DesignSurface/DesignSurfaceExt/DesignerSerializationServiceImpl.cs:33

  • Add a test case that includes non-Control objects in the objects collection to verify that serialization still succeeds and does not throw unexpected exceptions.
public object Serialize(ICollection objects)

@ricardobossan ricardobossan added the waiting-author-feedback The team requires more information from the author label May 19, 2025
@ricardobossan

This comment was marked as resolved.

Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.59949%. Comparing base (716bc12) to head (81bafee).
Report is 27 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13478         +/-   ##
===================================================
+ Coverage   76.59823%   76.59949%   +0.00126%     
===================================================
  Files           3230        3230                 
  Lines         639097      639157         +60     
  Branches       47289       47295          +6     
===================================================
+ Hits          489537      489591         +54     
+ Misses        145992      145989          -3     
- Partials        3568        3577          +9     
Flag Coverage Δ
Debug 76.59949% <ø> (+0.00126%) ⬆️
integration 18.77994% <ø> (-0.00219%) ⬇️
production 51.00698% <ø> (+0.00816%) ⬆️
test 97.40411% <ø> (ø)
unit 48.37893% <ø> (-0.00734%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback The team requires more information from the author label May 20, 2025
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM!

@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label May 29, 2025
Copy link
Member

@Shyam-Gupta Shyam-Gupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@Shyam-Gupta Shyam-Gupta removed the waiting-review This item is waiting on review by one or more members of team label Jun 5, 2025
@LeafShi1 LeafShi1 merged commit 94e240e into dotnet:main Jun 9, 2025
9 checks passed
@MelonWang1 MelonWang1 added this to the 10 Preview6 milestone Jun 13, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy & paste the ToolStrip & MenuStrip & contextMenuStrip controls without existing items when running the DemoConsole application on net481
4 participants