Skip to content

MudX Maintenance - Sln to Slnx, api json references, AI files, editorconfig#59

Open
versile2 wants to merge 8 commits intoMudXtra:devfrom
versile2:maintenance/versile2
Open

MudX Maintenance - Sln to Slnx, api json references, AI files, editorconfig#59
versile2 wants to merge 8 commits intoMudXtra:devfrom
versile2:maintenance/versile2

Conversation

@versile2
Copy link
Copy Markdown
Collaborator

@versile2 versile2 commented Mar 8, 2026

Summary
This maintenance PR includes several improvements and updates across the MudX codebase:
• Solution Format Modernization:
• All references to MudX.sln have been updated to use the new .slnx format for improved compatibility and future-proofing.
• API JSON Documentation:
• Generator projects now ensure deterministic and normalized API JSON output, with improved handling for component summaries, parameters, events, and default values.
• Null reference warnings in API source generation have been resolved.
• AI/Editor Files:
• Added and/or updated AI-related files and .editorconfig for consistent code style and tooling support.
• General Maintenance:
• Minor code cleanups, improved error handling, and updated project references as needed.
Details
• Refactored code in ApiSource.cs to prevent null reference warnings and ensure robust API documentation generation.
• Searched and replaced .sln references in documentation, build scripts, and project files.
• Verified and updated MudX.csproj files for both Generator projects.
• Ensured workspace and repository are aligned with new solution standards and tooling.

versile2 added 6 commits March 8, 2026 14:09
- Added deterministic property ordering to JSON serialization
  by setting `PropertyNamingPolicy` and `DictionaryKeyPolicy`
  to `null` in `JsonSerializerOptions`.
- Introduced `NormalizeJson` to standardize JSON formatting
  (normalize line endings and trim trailing whitespace).
- Updated `WriteIfDifferent` to use normalized JSON for
  comparisons, reducing false positives for changes.
- Added a special case for `LottiePlayer.ElementId` to ensure
  its default value is always `lottie-[auto-generated]`.
- Updated `LottiePlayer.api.json` to reflect the new default
  value for `ElementId`.
- Improved exception handling and logging in `WriteIfDifferent`.
- Enhanced code readability with comments explaining new logic.
Introduced a `.editorconfig` file to enforce consistent coding style, including indentation, naming conventions, and analyzer rules. Added `AGENTS.md` as a project-specific guide for AI coding agents, detailing best practices, project structure, and contribution guidelines.

Updated `MudX.sln` to include `.editorconfig` and Markdown files. Enhanced `AGENTS.md` with rules for component development, testing, documentation, and handling breaking changes. Emphasized adherence to `.editorconfig` and the importance of running `dotnet format` for changed files.

These changes standardize coding practices, improve project organization, and ensure high-quality contributions.
Copilot AI review requested due to automatic review settings March 8, 2026 19:38
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant infrastructure and documentation improvements to the MudX codebase. By migrating to the .slnx solution format, the project benefits from a more modern and manageable structure. The enhancements to API documentation generation ensure greater accuracy and consistency, which is crucial for developers consuming the library. Additionally, the introduction of standardized code style configurations and AI agent guidelines promotes a more uniform and high-quality development environment.

Highlights

  • Solution Format Modernization: The solution file has been updated from the traditional .sln format to the newer .slnx format, improving readability and version control management.
  • API JSON Documentation Enhancements: The API documentation generation process has been refined to produce deterministic and normalized JSON output, resolving previous null reference warnings and improving the accuracy of component summaries, parameters, events, and default values.
  • Code Style and AI Guidelines: A new .editorconfig file has been added to enforce consistent code style across the project, alongside a new AGENTS.md file providing specific guidelines for AI coding agents.
  • General Maintenance and Cleanup: Various minor code cleanups, improved error handling, and updated project references have been implemented to enhance overall code quality and maintainability.
Changelog
  • .editorconfig
    • Added a new file to define code style and formatting rules based on Roslyn team defaults with MudX team overrides.
  • AGENTS.md
    • Added a new markdown file providing guidelines for AI coding agents working on the MudX project.
  • src/MudX.Docs.Generator/ApiSource.cs
    • Modified JSON serialization options to ensure deterministic property order.
    • Introduced a NormalizeJson utility to standardize JSON output.
    • Updated GetDefaultValue methods to handle Activator.CreateInstance more robustly and to special-case LottiePlayer.ElementId.
  • src/MudX.Docs.Generator/ExampleSource.cs
    • Ensured the file ended with a newline.
  • src/MudX.Docs.Hybrid/MudX.Docs.Hybrid.Client/Program.cs
    • Updated the file to include a Unicode byte order mark (BOM).
  • src/MudX.Docs.Hybrid/MudX.Docs.Hybrid/Program.cs
    • Updated the file to include a Unicode byte order mark (BOM).
  • src/MudX.Docs.Server/Program.cs
    • Updated the file to include a Unicode byte order mark (BOM).
  • src/MudX.Docs/Components/Examples/ChatAvatarExample.g.cs
    • Modified the MudXChat component in the example to include a CSS class and added a style block to customize its appearance.
  • src/MudX.Docs/Data/VersionsList.cs
    • Removed trailing whitespace from a line.
  • src/MudX.Docs/Shared/MudXTextFieldSearch.razor.cs
    • Updated the file to include a Unicode byte order mark (BOM) and ensured it ends with a newline.
  • src/MudX.Docs/wwwroot/api/Blazor.Lottie.Player.xml
    • Removed XML documentation for TotalAnimationFrames from LottiePlayer and CurrentFrame, TotalFrames from LottiePlayerModule.
  • src/MudX.Docs/wwwroot/api/LottiePlayer.api.json
    • Updated the description for TotalAnimationFrames to null and the default value for ElementId to "lottie-[auto-generated]".
  • src/MudX.Docs/wwwroot/api/LottiePlayerModule.api.json
    • Updated the descriptions for CurrentFrame and TotalFrames to null.
  • src/MudX.Generator/JavaScriptCompressor.cs
    • Ensured the file ended with a newline.
  • src/MudX.Generator/StaticAssetsFileMethods.cs
    • Ensured the file ended with a newline.
  • src/MudX.sln
    • Renamed the solution file to src/MudX.sln.bak.
    • Updated solution items to include .editorconfig and AGENTS.md.
  • src/MudX.slnx
    • Added a new solution file in the .slnx format, listing all projects and solution items.
  • tests/MudX.UnitTests.Viewer/Program.cs
    • Updated the file to include a Unicode byte order mark (BOM).
  • tests/MudX.UnitTests/Components/CodeBlockTests.cs
    • Ensured the file ended with a newline.
  • tests/MudX.UnitTests/Components/CopyToClipboardTests.cs
    • Ensured the file ended with a newline.
  • tests/MudX.UnitTests/Components/SheetTests.cs
    • Ensured the file ended with a newline.
Activity
  • No specific activity (comments, reviews, progress) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 8, 2026

Coverage Status

coverage: 92.92%. remained the same
when pulling 11fc576 on versile2:maintenance/versile2
into cfd4058 on MudXtra:dev.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several maintenance improvements, including migrating the solution to the modern .slnx format, adding an .editorconfig for consistent styling, and making API documentation generation deterministic. The changes are generally well-implemented. I've added a few comments with suggestions for minor code quality improvements and to point out a style violation according to the newly introduced AGENTS.md guide.

Comment on lines +389 to +391
object? instance = null;
if (type != null)
instance = Activator.CreateInstance(type);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to a previous comment, the if (type != null) check on line 390 is redundant because of the null check on line 384. This can be simplified.

                object? instance = Activator.CreateInstance(type);

Copy link
Copy Markdown
Contributor

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

Maintenance update to modernize the MudX solution/workspace setup and improve generated API documentation artifacts (JSON/XML) while aligning repo style/tooling through new editor/agent config files.

Changes:

  • Added a new MudX.slnx solution format and updated related solution item organization.
  • Updated API docs generation to normalize output and reduce noisy diffs (line ending/trailing whitespace normalization, default value handling tweaks).
  • Added repo-wide .editorconfig and an AGENTS.md guide; applied formatting/encoding touch-ups across several files.

Reviewed changes

Copilot reviewed 14 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/MudX.UnitTests/Components/SheetTests.cs Formatting-only (closing brace alignment).
tests/MudX.UnitTests/Components/CopyToClipboardTests.cs Formatting-only (closing brace alignment).
tests/MudX.UnitTests/Components/CodeBlockTests.cs Formatting-only (closing brace alignment).
tests/MudX.UnitTests.Viewer/Program.cs Adds UTF-8 BOM / formatting normalization for using directive line.
src/MudX.slnx Introduces the .slnx solution definition with solution folders and project references.
src/MudX.sln.bak Updates a backup .sln artifact content (VisualStudioVersion + solution items).
src/MudX.Generator/StaticAssetsFileMethods.cs Formatting-only (closing brace alignment).
src/MudX.Generator/JavaScriptCompressor.cs Formatting-only (closing brace alignment).
src/MudX.Docs/wwwroot/api/Mudblazor.xml Updates cached MudBlazor XML docs content used for API descriptions.
src/MudX.Docs/wwwroot/api/LottiePlayerModule.api.json Updates generated API JSON output (notably null descriptions).
src/MudX.Docs/wwwroot/api/LottiePlayer.api.json Updates generated API JSON output (default value normalization + null description).
src/MudX.Docs/wwwroot/api/Blazor.Lottie.Player.xml Updates cached LottiePlayer XML docs content used for API descriptions.
src/MudX.Docs/Shared/MudXTextFieldSearch.razor.cs Adds UTF-8 BOM / formatting normalization + trailing brace alignment.
src/MudX.Docs/Data/VersionsList.cs Minor whitespace cleanup in dependency version list.
src/MudX.Docs/Components/Examples/ChatAvatarExample.g.cs Updates docs example markup and adds an inline style snippet.
src/MudX.Docs.Server/Program.cs Adds UTF-8 BOM / formatting normalization for using directive line.
src/MudX.Docs.Hybrid/MudX.Docs.Hybrid/Program.cs Adds UTF-8 BOM / formatting normalization for using directive line.
src/MudX.Docs.Hybrid/MudX.Docs.Hybrid.Client/Program.cs Adds UTF-8 BOM / formatting normalization for using directive line.
src/MudX.Docs.Generator/ExampleSource.cs Formatting-only (closing brace alignment).
src/MudX.Docs.Generator/ApiSource.cs Normalizes generated API JSON and tweaks default handling; attempts to improve determinism.
AGENTS.md Adds project-specific AI coding agent guidance and conventions.
.editorconfig Adds repo-wide code style, encoding, analyzers, and header conventions.
Comments suppressed due to low confidence (1)

src/MudX.sln.bak:5

  • This looks like an IDE-generated backup artifact (.sln.bak). Since nothing in the repo references it, keeping it tracked can confuse tooling and reviewers. Consider removing it from source control (and/or adding a gitignore rule) once the .slnx migration is complete.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 122 to 126
var jsonOptions = new JsonSerializerOptions { WriteIndented = true };
// Ensure deterministic property order
jsonOptions.PropertyNamingPolicy = null;
jsonOptions.DictionaryKeyPolicy = null;

Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The comment says this ensures deterministic JSON, but setting PropertyNamingPolicy/DictionaryKeyPolicy to null is already the default and doesn't address the main non-determinism risk here (reflection enumeration order for types/properties/methods). To make output deterministic across runtimes, sort the component list and member lists (e.g., by FullName/Name/signature) before serializing, and consider removing or rewording this comment if ordering isn't actually guaranteed.

Copilot uses AI. Check for mistakes.
versile2 and others added 2 commits March 8, 2026 15:57
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Versile Johnson II <148913404+versile2@users.noreply.github.com>
Simplify JSON writing and instance creation logic

Removed the `NormalizeJson` step before writing serialized JSON
to files, directly using the serialized output in `WriteIfDifferent`.
This eliminates unnecessary normalization.

Simplified instance creation by removing redundant null checks
before calling `Activator.CreateInstance`, relying on its built-in
behavior to handle null cases. These changes improve code clarity
and maintainability.
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.

3 participants