Skip to content

Blazor supports DisplayName for models#4

Open
tomerqodo wants to merge 17 commits into
codex_full_base_blazor_supports_displayname_for_models_pr4from
codex_full_head_blazor_supports_displayname_for_models_pr4
Open

Blazor supports DisplayName for models#4
tomerqodo wants to merge 17 commits into
codex_full_base_blazor_supports_displayname_for_models_pr4from
codex_full_head_blazor_supports_displayname_for_models_pr4

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#4

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d720c560e

ℹ️ 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".

Comment on lines +15 to +16
private static readonly ConcurrentDictionary<Expression, MemberInfo> _memberInfoCache = new();
private static readonly ConcurrentDictionary<MemberInfo, string> _displayNameCache = new();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid caching by Expression instance

Keying _memberInfoCache by Expression will grow unbounded in normal Blazor usage: For="() => model.Property" creates a new expression instance on each render, so every render adds a new entry and the cache is never evicted (except hot reload). In long‑lived pages with frequent re-renders this leaks memory and increases lookup costs. Consider caching by MemberInfo/FieldIdentifier, or use a value-based comparer or ConditionalWeakTable so repeated renders reuse entries.

Useful? React with 👍 / 👎.

Comment on lines +9 to +10
namespace Microsoft.AspNetCore.Components.Forms
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Convert to file-scoped namespace

Repo compliance rule #2 in /workspace/aspnetcore-combined-codex/AGENTS.md requires file-scoped namespaces. This new file uses a block-scoped namespace (namespace ... { }), which violates that rule; it should be switched to namespace ...;.

Useful? React with 👍 / 👎.

Comment on lines +158 to +162
[Fact]
public async Task SupportsLocalizationWithResourceType()
{
var model = new TestModel();
var rootComponent = new TestHostComponent

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add Arrange/Act/Assert comments in test

Repo rule #6 in /workspace/aspnetcore-combined-codex/AGENTS.md requires explicit // Arrange, // Act, and // Assert comments in each test method. This test omits those markers, so it doesn’t meet the required AAA structure.

Useful? React with 👍 / 👎.

Comment on lines +176 to +177
private static async Task<string> RenderAndGetOutput(TestHostComponent rootComponent)
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Rename async helper to include Async suffix

Repo rule #8 in /workspace/aspnetcore-combined-codex/AGENTS.md requires Task-returning methods to end with Async. RenderAndGetOutput is async but lacks the suffix, so it violates the naming convention.

Useful? React with 👍 / 👎.

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