-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add input password as custom component #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Keploy failed to create test cases for this PR. For retrying, please click here |
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
There was a problem hiding this 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 introduces a reusable PasswordInput
component with a show/hide toggle and replaces all existing <Input type="password">
fields across various forms with this new component. It also updates the API version’s release_date
.
- Add
PasswordInput
component underview/components/ui
- Replace password fields in login, registration, reset, team management, and notification settings
- Bump
release_date
for API v1 inapi/api/versions.json
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
view/components/ui/password-input.tsx | New PasswordInput component with visibility toggle |
view/components/features/login-form.tsx | Swap <Input> for <PasswordInput> on the login form |
view/app/settings/teams/components/AddMember.tsx | Swap <Input> for <PasswordInput> in AddMember dialog |
view/app/settings/notifications/components/channelTab.tsx | Swap SMTP password <Input> for <PasswordInput> |
view/app/reset-password/components/ResetPasswordForm.tsx | Swap new/confirm password <Input> fields for <PasswordInput> |
view/app/register/page.tsx | Swap registration password <Input> fields for <PasswordInput> |
api/api/versions.json | Update API v1 release_date |
Comments suppressed due to low confidence (1)
view/components/ui/password-input.tsx:48
- Add unit tests for
PasswordInput
to verify the show/hide toggle behavior and ensure correcttype
switching.
export { PasswordInput };
interface PasswordInputProps extends React.InputHTMLAttributes<HTMLInputElement> { | ||
className?: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The className
prop is already included in React.InputHTMLAttributes<HTMLInputElement>
, so it’s redundant here; consider removing the explicit declaration.
interface PasswordInputProps extends React.InputHTMLAttributes<HTMLInputElement> { | |
className?: string; | |
} | |
interface PasswordInputProps extends React.InputHTMLAttributes<HTMLInputElement> {} |
Copilot uses AI. Check for mistakes.
const [showPassword, setShowPassword] = useState(false); | ||
|
||
const togglePasswordVisibility = () => { | ||
setShowPassword(!showPassword); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Use the functional update form setShowPassword(prev => !prev)
to avoid potential stale state issues.
setShowPassword(!showPassword); | |
setShowPassword(prev => !prev); |
Copilot uses AI. Check for mistakes.
size="sm" | ||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent" | ||
onClick={togglePasswordVisibility} | ||
aria-label={showPassword ? 'Hide password' : 'Show password'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add aria-pressed={showPassword}
to this button to clearly convey toggle state to assistive technologies.
aria-label={showPassword ? 'Hide password' : 'Show password'} | |
aria-label={showPassword ? 'Hide password' : 'Show password'} | |
aria-pressed={showPassword} |
Copilot uses AI. Check for mistakes.
Description:
This PR adds a new PasswordInput component with a show/hide password toggle (in view/components/ui).
Replaces all fields with the new component.