Skip to content
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

feat: signup password hint #959

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

anikdhabal
Copy link
Contributor

@anikdhabal anikdhabal commented Feb 23, 2024

fixes #954

14b819e39cfe404188af025df75cd6d9.mp4

Summary by CodeRabbit

  • New Features
    • Introduced a new HintedPasswordInput component across the app which enhances password fields with interactive validation hints to help users create stronger passwords.
  • Enhancements
    • Updated password validation rules to include requirements for uppercase, lowercase, digits, and special characters, ensuring improved security.
  • Refactor
    • Improved import organization in the password input components for better code clarity.

Copy link
Contributor

coderabbitai bot commented Feb 23, 2024

Walkthrough

The recent updates focus on enhancing password input components across various forms by introducing HintedPasswordInput, which provides dynamic validation feedback and visual indicators for password criteria. This change aligns with the need for more interactive and user-friendly password inputs, particularly highlighted in the signup process.

Changes

File Path Change Summary
.../forms/reset-password.tsx Imported ZHintedPasswordSchema, replaced PasswordInput with HintedPasswordInput.
.../forms/signup.tsx Replaced ZPasswordSchema with ZHintedPasswordSchema, updated component to HintedPasswordInput.
.../auth-router/schema.ts Added ZHintedPasswordSchema with detailed password validation rules.
.../primitives/password-input.tsx Reorganized import statements, improving code readability.
.../primitives/hinted-password-input.tsx Introduced HintedPasswordInput component for enhanced password input with hints.

Assessment against linked issues

Objective Addressed Explanation
Show password hints in signup form [#954]

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4b90add and e519739.
Files selected for processing (7)
  • apps/web/src/components/forms/password.tsx (4 hunks)
  • apps/web/src/components/forms/reset-password.tsx (3 hunks)
  • apps/web/src/components/forms/signup.tsx (4 hunks)
  • apps/web/src/components/forms/v2/signup.tsx (4 hunks)
  • packages/trpc/server/auth-router/schema.ts (1 hunks)
  • packages/ui/primitives/hinted-password-input.tsx (1 hunks)
  • packages/ui/primitives/password-input.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • apps/web/src/components/forms/reset-password.tsx
  • apps/web/src/components/forms/signup.tsx
  • packages/trpc/server/auth-router/schema.ts
  • packages/ui/primitives/hinted-password-input.tsx
  • packages/ui/primitives/password-input.tsx
Additional Context Used
Learnings (1)
apps/web/src/components/forms/password.tsx (1)
User: Mythie
PR: documenso/documenso#697
File: apps/web/src/components/forms/password.tsx:114-114
Timestamp: 2023-12-07T00:28:25.495Z
Learning: The `FormMessage` components in the `password.tsx` file are intentionally left without content as they work with context to display messages.
Additional comments not posted (6)
apps/web/src/components/forms/password.tsx (4)

11-11: The import of ZHintedPasswordSchema is correctly added to support the new password validation schema.


29-30: The replacement of ZPasswordSchema with ZHintedPasswordSchema in the form schema is consistent with the PR's objectives to enhance password inputs.


120-120: The replacement of PasswordInput with HintedPasswordInput for the password field aligns with the PR's goal to provide dynamic password hints. Ensure that the HintedPasswordInput component is thoroughly tested across different devices and browsers for consistent behavior.


134-134: The use of HintedPasswordInput for the repeated password field is appropriate and ensures consistency in user experience across password fields.

apps/web/src/components/forms/v2/signup.tsx (2)

22-22: The import of ZHintedPasswordSchema is correctly added to support the new password validation schema in the signup form.


298-298: The replacement of PasswordInput with HintedPasswordInput in the signup form is consistent with the PR's objectives and enhances the user experience by providing interactive password hints. Ensure that this component behaves consistently across various screen sizes and user interactions.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

vercel bot commented Feb 23, 2024

@anikdhabal is attempting to deploy a commit to the Documenso Team Team on Vercel.

A member of the Team first needs to authorize it.

@prajwalkulkarni
Copy link
Contributor

As per the React docs, it is advised to use useEffect to synchronize the component with an external system. Since no synchronizations are being done here, I believe the code in the effect handler can be extracted out and conditionally executed in the component, i.e., the validation can run whenever the input is changed and the user has focused on the input field. This way we can get rid of the useEffect. What do you think?

@anikdhabal anikdhabal changed the title feat: password hint feat: signup password hint Feb 24, 2024
@adithyaakrishna
Copy link
Member

@anikdhabal The in-built schema validation is giving errors due to the changes to password-input.tsx file. I've also attached the screenshots below for reference

Sign up:

Screenshot 2024-03-01 at 13 35 29

Sign in:

Screenshot 2024-03-01 at 13 34 17

@github-actions github-actions bot added the apps: web Issues related to the webapp label Mar 6, 2024
@anikdhabal
Copy link
Contributor Author

@anikdhabal The in-built schema validation is giving errors due to the changes to password-input.tsx file. I've also attached the screenshots below for reference

Sign up:

Screenshot 2024-03-01 at 13 35 29 **Sign in:** Screenshot 2024-03-01 at 13 34 17

Hey @adithyaakrishna thanks for the review. I've fixed it.

@dguyen
Copy link
Collaborator

dguyen commented Apr 4, 2024

Some feedback on the design, I haven't looked at the code yet:

  • This doesn't really work with many resolutions since it'll overflow out of the screen, especially with the new sign up form design
  • The arrow symbol should probably match the color of the tooltip on light theme

Maybe have a look at the PopOver primitive?

@anikdhabal
Copy link
Contributor Author

Some feedback on the design, I haven't looked at the code yet:

  • This doesn't really work with many resolutions since it'll overflow out of the screen, especially with the new sign up form design
  • The arrow symbol should probably match the color of the tooltip on light theme

Maybe have a look at the PopOver primitive?

Thank you for the review. We can move the tooltip to the left side from the right as it is overflows in the new design. Additionally, I will fix the arrow symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apps: web Issues related to the webapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: signup password hint
4 participants