Skip to content

Conversation

@Tyme-Bleyaert
Copy link
Collaborator

Pull Request

📖 Description

This pr will remove the TODO from the property column about boxing value types when using a format.

📑 Test Plan

Added test cases for each type of format (nullable value types, value types and reference types).
Also added test to check if exception is thrown.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

  • I have added a new component
  • I have added Unit Tests for my new component
  • I have modified an existing component
  • I have validated the Unit Tests for an existing component

@Tyme-Bleyaert Tyme-Bleyaert marked this pull request as ready for review August 14, 2025 09:51
@Tyme-Bleyaert Tyme-Bleyaert changed the title [Property Column] Remove boxing when formatting the property in property columns. [Property Column] Remove boxing when formatting the property. Aug 14, 2025
@vnbaaij vnbaaij requested a review from Copilot August 14, 2025 10:21
Copy link

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 the boxing overhead when formatting property values in the PropertyColumn component by implementing type-specific formatters through reflection. It addresses the TODO comment about avoiding boxing value types when calling IFormattable.ToString().

  • Replaces generic boxing approach with specialized formatters for nullable value types, value types, and reference types
  • Adds comprehensive test coverage for all formatter scenarios including error cases
  • Removes unnecessary else clause in the non-formatting path

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
PropertyColumn.cs Implements type-specific formatters using reflection to avoid boxing, adds CreateFormatter method and specialized formatting helpers
PropertyColumnFormatterTests.razor.cs Adds test infrastructure with Person record and CustomFormattable class for testing different formatting scenarios
PropertyColumnFormatterTests.razor Provides test cases covering value types, nullable types, reference types, and error conditions
Comments suppressed due to low confidence (2)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Aug 14, 2025

Need to take a proper look at it from a PC. Won't be near one for the next week and a half...

@vnbaaij vnbaaij merged commit c4a900d into microsoft:dev Aug 28, 2025
4 checks passed
@vnbaaij vnbaaij added this to the v4.12.2 milestone Sep 5, 2025
vnbaaij added a commit that referenced this pull request Oct 6, 2025
@vnbaaij vnbaaij mentioned this pull request Oct 6, 2025
dvoituron pushed a commit that referenced this pull request Oct 6, 2025
* Implement #4036

* Implement #4070

* Implement #4112

* Implement #4116

* Add extra test. Brings back code coverage to 100% for Row and Cell
vnbaaij added a commit that referenced this pull request Oct 8, 2025
* Implement #4036

* Implement #4070

* Implement #4112

* Implement #4116

* Add extra test. Brings back code coverage to 100% for Row and Cell

* Implement #4172

* Implement #4177

* - Remove NoTabbing parameter (not being used)
- Exclude ErrorContent from code coverage
- Add (partial) ErrorContentTest, add IsFixed test, update tests

* Implement #4178

Related Work Items: #41

* Add CustomIcon and IconsExtensions + tests

---------

Co-authored-by: Denis Voituron <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants