feat: implement FormHelperText base component wrapper (#1400)#1659
feat: implement FormHelperText base component wrapper (#1400)#1659abhinavkdeval08-design wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new wrapper component, FormHelperText, which wraps Material-UI's FormHelperText component, and updates peer dependency flags in package-lock.json. The review feedback recommends wrapping the new component with React.forwardRef to ensure proper integration with other components and form libraries by forwarding the ref to the underlying DOM element.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| export const FormHelperText: React.FC<SistentFormHelperTextProps> = ({ children, ...props }) => { | ||
| return <MuiFormHelperText {...props}>{children}</MuiFormHelperText>; | ||
| }; |
There was a problem hiding this comment.
To ensure proper integration with other components, form libraries, and overlays (such as tooltips or focus managers), it is highly recommended to forward the ref to the underlying DOM element. This maintains consistency with other wrapper components in the repository (e.g., TextField).
| export const FormHelperText: React.FC<SistentFormHelperTextProps> = ({ children, ...props }) => { | |
| return <MuiFormHelperText {...props}>{children}</MuiFormHelperText>; | |
| }; | |
| export const FormHelperText = React.forwardRef<HTMLParagraphElement, SistentFormHelperTextProps>( | |
| ({ children, ...props }, ref) => { | |
| return ( | |
| <MuiFormHelperText ref={ref} {...props}> | |
| {children} | |
| </MuiFormHelperText> | |
| ); | |
| } | |
| ); | |
| FormHelperText.displayName = 'FormHelperText'; |
KhushamBansal
left a comment
There was a problem hiding this comment.
@abhinavkdeval08-design Please sign your commits and address the bot's feedback on your PR.
Signed-off-by: Abhinav Deval <abhinavkdeval08@gmail.com>
0f694d4 to
536f203
Compare
|
Hi @KhushamBansal, thank you for the review! I have addressed the bot's feedback by wrapping the component in React.forwardRef and adding the displayName. I've also amended the commit to include the DCO sign-off. Please let me know if it looks good to go! |
|
@leecalcote @KhushamBansal |
|
@abhinavkdeval08-design Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂 |
|
Hi @Bhumikagarggg, thank you for the invite! Unfortunately, I won't be able to join the website call tomorrow due to prior personal commitments. However, I have already addressed the code feedback by implementation of |
|
@KhushamBansal @Bhumikagarggg @leecalcote |
|
@leecalcote @KhushamBansal @rishiraj38 @Bhumikagarggg |
|
@abhinavkdeval08-design Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂 |
Bhumikagarggg
left a comment
There was a problem hiding this comment.
- Please change the name of file from
src/base/FormHelperText/FormHelperText.tsxthis tosrc/base/FormHelperText/FormHelperTextIcon.tsx - Please take this PR as reference - #1332
| "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", | ||
| "dev": true, | ||
| "license": "MIT", | ||
| "peer": true, |
There was a problem hiding this comment.
Please revert package-lock.json file.
| @@ -0,0 +1,2 @@ | |||
| export * from './FormHelperText'; | |||
Signed-off-by: Abhinav Deval <abhinavkdeval08@gmail.com>
|
@Bhumikagarggg @leecalcote @KhushamBansal I've renamed the component file to |
6f78a41 to
e344196
Compare
KhushamBansal
left a comment
There was a problem hiding this comment.
@abhinavkdeval08-design The file shouldn't be named src/base/FormHelperText/FormHelperTextIcon.tsx. It should be src/base/FormHelperText/FormHelperText.tsx. The component isn't an icon.
Signed-off-by: Abhinav Deval <abhinavkdeval08@gmail.com>
5f0765b to
483690c
Compare
|
@KhushamBansal That makes total sense, it is indeed a text wrapper and not an icon. I had renamed it earlier based on the previous review request, but I have now reverted the file name back to |
|
@leecalcote @KhushamBansal @Bhumikagarggg kindly review the PR |
📝 WalkthroughWalkthroughA new typed ChangesFormHelperText component
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/base/FormHelperText/FormHelperText.tsx`:
- Around line 6-8: Replace the empty SistentFormHelperTextProps interface with a
type alias that preserves its extension of MuiFormHelperTextProps, removing the
unused empty-interface declaration and its comment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 600cd717-a3bc-410b-830f-ddb11bd6d530
📒 Files selected for processing (3)
src/base/FormHelperText/FormHelperText.tsxsrc/base/FormHelperText/index.tssrc/base/index.tsx
| export interface SistentFormHelperTextProps extends MuiFormHelperTextProps { | ||
| // Custom props for future extension of the Sistent wrapper | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Replace the empty interface with a type alias.
SistentFormHelperTextProps adds no members, so this triggers @typescript-eslint/no-empty-object-type and can fail linting.
Proposed fix
-export interface SistentFormHelperTextProps extends MuiFormHelperTextProps {
- // Custom props for future extension of the Sistent wrapper
-}
+export type SistentFormHelperTextProps = MuiFormHelperTextProps;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export interface SistentFormHelperTextProps extends MuiFormHelperTextProps { | |
| // Custom props for future extension of the Sistent wrapper | |
| } | |
| export type SistentFormHelperTextProps = MuiFormHelperTextProps; |
🧰 Tools
🪛 ESLint
[error] 6-6: An interface declaring no members is equivalent to its supertype.
(@typescript-eslint/no-empty-object-type)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/base/FormHelperText/FormHelperText.tsx` around lines 6 - 8, Replace the
empty SistentFormHelperTextProps interface with a type alias that preserves its
extension of MuiFormHelperTextProps, removing the unused empty-interface
declaration and its comment.
Source: Linters/SAST tools
|
@abhinavkdeval08-design, not @leecalcote, but @KhushamBansal and @Bhumikagarggg |
Description
This PR resolves #1400 by implementing the missing
FormHelperTextcomponent wrapper from@mui/materialinto the Sistent design system base components directory matrix.Changes Proposed
FormHelperTextdirectory component undersrc/base.SistentFormHelperTextPropsextending MUI's core typings to preserve strict type definitions.cross-envandtsup.cc @leecalcote @KhushamBansal
Please review this PR and let me know if any changes are required. Happy to iterate!
Summary by CodeRabbit