Skip to content

Conversation

@Anu6is
Copy link
Contributor

@Anu6is Anu6is commented Sep 23, 2025

User description

Closes #45


PR Type

Enhancement


Description

  • Remove Lines parameter restriction from MudStaticTextField

  • Allow consumers to modify Lines property directly


Diagram Walkthrough

flowchart LR
  A["MudStaticTextField"] -- "removes restriction" --> B["Lines parameter"]
  B -- "allows direct modification" --> C["Consumer access"]
Loading

File Walkthrough

Relevant files
Enhancement
MudStaticTextField.razor.cs
Remove Lines parameter protection                                               

src/Components/MudStaticTextField.razor.cs

  • Removed protected Lines property with default value of 1
  • Allows inherited Lines parameter to be accessible to consumers
+0/-1     

Summary by CodeRabbit

  • Refactor
    • The Static Text Field now relies on standard defaults for line/height behavior, aligning its appearance with other text fields.
    • You may notice slightly adjusted field height in some cases to match consistent defaults.
    • No changes are required to how you configure this component in your app.

@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

Removed the derived Lines property from MudStaticTextField, stopping it from hiding the base class property and default value.

Changes

Cohort / File(s) Summary
Static Text Field cleanup
src/Components/MudStaticTextField.razor.cs
Deleted the hidden property protected new int Lines { get; set; } = 1; from MudStaticTextField<T> to rely on the base class Lines property.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A nibble of code, a hop of delight,
I unhid the lines; now textarea’s right.
No shadows to cast, no props to mislead—
Just base lines to follow, simple indeed.
Thump-thump! Bugs flee in the moonlit night.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "MudStaticTextField: Remove restriction on text field Lines parameter" succinctly and accurately describes the main change in the PR — removing the restriction on the Lines parameter for MudStaticTextField — and matches the file-level change (removal of the protected Lines property), making it clear and useful in history.
Linked Issues Check ✅ Passed The change removes the protected "Lines" member from MudStaticTextField, which restores use of the base Lines parameter and directly addresses the linked issue [#45] by enabling multi-line text areas; this fulfills the coding objective described in the issue.
Out of Scope Changes Check ✅ Passed The PR only removes the protected Lines property in src/Components/MudStaticTextField.razor.cs and does not modify other files or introduce unrelated functionality, so there are no out-of-scope changes detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Issue_45_LinesRestriction

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 613368c and 4db79f1.

📒 Files selected for processing (1)
  • src/Components/MudStaticTextField.razor.cs (0 hunks)
💤 Files with no reviewable changes (1)
  • src/Components/MudStaticTextField.razor.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Anu6is, 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 addresses an existing limitation in the MudStaticTextField component by removing the hardcoded default value for the Lines parameter. This change enables greater flexibility in configuring the text field's height, allowing it to display multiple lines of text as intended by other properties like MaxLines.

Highlights

  • Lines Parameter Restriction Removed: The default initialization of the Lines parameter to 1 in MudStaticTextField has been removed, allowing for more flexible control over the number of lines in the text field.
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

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.

@what-the-diff
Copy link

what-the-diff bot commented Sep 23, 2025

PR Summary

  • Removed the "Lines" Property from the MudStaticTextField Class
    The developer made alterations to tidy up the code. Previously, the "MudStaticTextField" class had a property called "Lines" that was always set to '1'. This was found to be unnecessary and has been removed. Effectively simplifying the class structure and enhancing the overall performance of the code.

@qodo-code-review
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

45 - Partially compliant

Compliant requirements:

  • Remove the restriction that hides the Lines parameter on MudStaticTextField.
  • Allow consumers to set the Lines property to create multi-line text areas.

Non-compliant requirements:

  • Ensure existing behavior remains intact aside from exposing Lines.

Requires further human verification:

  • Validate visually and functionally that setting Lines on MudStaticTextField results in expected multi-line behavior across browsers.
  • Verify no regressions in autosizing/MaxLines interactions when Lines is set by consumers.
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Behavioral Regression

Confirm that removing the shadowing of Lines does not conflict with MaxLines and AutoGrow behaviors inherited from MudTextField, and that prior defaults (e.g., single-line default) remain sensible.

public partial class MudStaticTextField<T> : MudTextField<T>
{
    /**********************************************
     * Hide these inherited properties to prevent *
     * consumers from modifying them directly.    *
     **********************************************/

    protected new int? Counter { get; set; }
    protected new int MaxLines { get; set; }
    protected new bool AutoFocus { get; set; }
    protected new bool AutoGrow { get; set; }
    protected new bool Clearable { get; set; }
    protected new bool Immediate { get; set; }

@qodo-code-review
Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

Copy link

@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 correctly removes the restriction on the Lines parameter for the MudStaticTextField, enabling its use for multi-line inputs. The change is straightforward and effective. My review includes a suggestion to also expose the MaxLines and AutoGrow parameters to provide a more complete and consistent feature set for multi-line text fields.

@github-actions
Copy link

Test Results

48 tests   48 ✅  12s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 4db79f1.

@Anu6is Anu6is merged commit a70be4b into master Sep 23, 2025
3 checks passed
@Anu6is Anu6is deleted the Issue_45_LinesRestriction branch September 23, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not able to create text area

2 participants