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

API Key Field Enhancement: Replaced Show/Hide button with Eye ReactIcons #579

Merged
merged 2 commits into from Apr 12, 2024

Conversation

rjwignar
Copy link
Collaborator

This fixes #552
As a followup to #530,
I replaced the Show/Hide Button with the IoMdEye/IoMdEyeOff react icons:
image

I modelled the behaviour based on what I observed on Facebook Messenger (show 'Eye On' when text is obscured, show 'Eye Off' when text is visible:
messengerEyeIcons

@rjwignar rjwignar changed the title replaced Show/Hide button with Eye ReactIcons API Key Field Enhancement: Replaced Show/Hide button with Eye ReactIcons Apr 10, 2024
@Rachit1313 Rachit1313 added this to the Release 1.9 milestone Apr 10, 2024
Copy link
Collaborator

@Amnish04 Amnish04 left a comment

Choose a reason for hiding this comment

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

@rjwignar Looks pretty good.

I was wondering maybe we should also set a title to this button saying "Show" or "Hide" based on its state.

If we don't want a visual indication, it should at least have an aria-label

Copy link
Collaborator

@kliu57 kliu57 left a comment

Choose a reason for hiding this comment

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

Just tested this. Works great!

@Amnish04
Copy link
Collaborator

Amnish04 commented Apr 11, 2024

And I think we should probably be using an IconButton now

<IconButton
  variant={"ghost"}
  size={buttonSize}
  icon={show ? <IoMdEyeOff /> : <IoMdEye />}
  onClick={() => setShow(!show)}
  aria-label={show ? "Hide" : "Show"} // This is not needed if we are providing a title, but the linter screams if we don't have this on an IconButton
  title={show ? "Hide" : "Show"}
/>

Copy link

cloudflare-pages bot commented Apr 12, 2024

Deploying chatcraft-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: 848a50c
Status: ✅  Deploy successful!
Preview URL: https://b734ba37.console-overthinker-dev.pages.dev
Branch Preview URL: https://issue-552.console-overthinker-dev.pages.dev

View logs

@rjwignar
Copy link
Collaborator Author

And I think we should probably be using an IconButton now

<IconButton
  variant={"ghost"}
  size={buttonSize}
  icon={show ? <IoMdEyeOff /> : <IoMdEye />}
  onClick={() => setShow(!show)}
  aria-label={show ? "Hide" : "Show"} // This is not needed if we are providing a title, but the linter screams if we don't have this on an IconButton
  title={show ? "Hide" : "Show"}
/>

Thanks for your suggestions, @Amnish04. I recently committed them to this PR. I kept the aria-label for accessibility reasons.
Please let me know if additional changes are required

Copy link
Collaborator

@Amnish04 Amnish04 left a comment

Choose a reason for hiding this comment

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

@rjwignar Thanks for the changes. Looks good now!

@rjwignar
Copy link
Collaborator Author

rjwignar commented Apr 12, 2024

image

Comparison of final changes pre-rebase and post-rebase (and force-push) here for reference.

@rjwignar rjwignar merged commit 1863245 into main Apr 12, 2024
4 checks passed
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.

User settings providers api key field change
4 participants