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

[Login] Show password in login/sign up form #210

Merged
merged 17 commits into from
Feb 13, 2025
Merged

Conversation

cavasinf
Copy link
Collaborator

@cavasinf cavasinf commented Jan 24, 2025

Description

Fix #209

Login

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I updated the documentation (see here)
  • I agree that this code will be published under the MIT license

@cavasinf cavasinf added the Status: Needs Review Not under investigation label Jan 24, 2025
@cavasinf
Copy link
Collaborator Author

A new translation, Show password, has been added.
The feature has been implemented within a block instead of as an option, to simplify the structure.

@cavasinf cavasinf added Status: Needs Work Need to be reworked and removed Status: Needs Review Not under investigation labels Jan 24, 2025
@cavasinf cavasinf requested a review from kevinpapst January 24, 2025 16:12
@cavasinf cavasinf requested a review from kevinpapst January 27, 2025 15:39
@cavasinf
Copy link
Collaborator Author

Wait.. should we add at least the en trans for "Show password" or weblate will find it magically?

@cavasinf cavasinf added Status: Reviewed Has staff reply/investigation Feature Feature requested and removed Status: Needs Work Need to be reworked labels Jan 27, 2025
@kevinpapst
Copy link
Owner

Yes, good catch! We need the translation in the base language, so Weblate can pick it up.

@cavasinf
Copy link
Collaborator Author

Hey, busy weeks lately, but we have basic trans now (+ fr)

kevinpapst
kevinpapst previously approved these changes Feb 10, 2025
@kevinpapst
Copy link
Owner

Thanks 👍

I gave it a quick test and have one question:
To me the open eye says "I can see the password" and the strikethrough eye means "password cannot be seen".
Don't you think the eyes are in the wrong order?
Bildschirmfoto 2025-02-10 um 11 06 16
Bildschirmfoto 2025-02-10 um 11 06 24

@cavasinf
Copy link
Collaborator Author

To me the open eye says "I can see the password" and the strikethrough eye means "password cannot be seen".
Don't you think the eyes are in the wrong order?

I understand your vision of the button.
The button is not meant to indicate the current state of the input but rather the consequence of clicking it.

After looking at some references, here are a few examples:

Considering your perspective, I believe we should add a new label: "Hide password".
This emphasizes the action rather than the state.

@kevinpapst
Copy link
Owner

Ok, if these platforms have it this way, I am fine with it as well.
But regarding the translation, you are right.
Having "Show password" there, no matter which state, is misleading/wrong. Shall we remove it altogether or do you want to add a second translation?

@cavasinf
Copy link
Collaborator Author

cavasinf commented Feb 11, 2025

Shall we remove it altogether or do you want to add a second translation?

I'll add the second translation, and the js will only hide/show the a element, which will be doubled with the two different titles. (no need to target the svgs anymore)

Do we keep the raw SVG or do we use tabler_icon ? I don't really know what to do because that means we are forcing devs to use fontAwesome.

@kevinpapst
Copy link
Owner

I like the SVG solution in this case.

@cavasinf
Copy link
Collaborator Author

Ok, a little complication with this simple feature. Since the tooltip is a document level element, we cannot simply hide/show the a element with the title, because if the tooltip is already displayed, nothing will change.
Instead, we need to change the ariaLabel + data-bs-original-title attribute + the currently displayed tooltip.

hide-show

@kevinpapst
Copy link
Owner

Hahaha, and that's why customer tend to say "but its only" ... without understanding all the problems that can arise from "only a link" 😁

Its is ready now from your end?

@cavasinf
Copy link
Collaborator Author

Hahaha, and that's why customer tend to say "but its only" ... without understanding all the problems that can arise from "only a link" 😁

Yeah, every time I open a PR, we always exchange with 15+ comments on it 😭
So I get the felling 😉

Its is ready now from your end?

  • You can maybe add the de trans
  • How do you generate the id prop for the trans? I saw you did it in your commit.

@kevinpapst
Copy link
Owner

The title attribute was still missing, I added the translations and the ids, which I generate with this command:
https://github.com/kimai/kimai/blob/main/src/Command/TranslationCommand.php

The command has many features which I need to manage translation files.

If you have no objections, I will merge and release

@cavasinf
Copy link
Collaborator Author

The title attribute was still missing

Yeah, I thought as long as the bootstrap tooltip is init, title is not really mandatory anymore since bootstrap will never read title again when initialized. aria-label was more important as it is used by screen readers.
But useful if one day bootstrap doesn't work anymore, the native browser tooltip will works.

The command has many features which I need to manage translation files.

Nice 👍

If you have no objections, I will merge and release

No objections 🫡

@kevinpapst
Copy link
Owner

I don't see the bootstrap title, as I use data-toggle instead of data-bs-toggle, which is obviously my own problem 😁 but that's why I immediately saw it.

@kevinpapst kevinpapst merged commit c35f75b into main Feb 13, 2025
4 checks passed
@kevinpapst kevinpapst deleted the cavasinf-patch-1 branch February 13, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature requested Status: Reviewed Has staff reply/investigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Login] Show password in login/sign up form
2 participants