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

web: Improve form input validation and visibility. #12812

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

GirlBossRush
Copy link
Contributor

Details

This PR addresses feedback regarding the visibility of code-like input fields where character differentiation is needed, e.g. tokens, URLs, usernames, protocol arguments.

Additionally, these same input fields no longer trigger browser spell-check or autocomplete, reducing visual noise when completing a form.

Before

Screenshot 2025-01-25 at 03 26 37

After

Screenshot 2025-01-25 at 03 26 18

Before

Screenshot 2025-01-25 at 01 37 04

After

Screenshot 2025-01-25 at 01 36 38

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@GirlBossRush GirlBossRush requested a review from a team as a code owner January 25, 2025 09:03
Copy link

netlify bot commented Jan 25, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit cf507dc
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6794a8e4c48a7f0008fbf49f

Copy link

netlify bot commented Jan 25, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit cf507dc
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/6794a8e47fdf730008667c6d
😎 Deploy Preview https://deploy-preview-12812--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

class="pf-c-form-control pf-m-monospace"
autocomplete="off"
spellcheck="false"
inputmode="url"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opted for inputmode over setting the type to "url". This will hint to the browser that a URL-oriented virtual keyboard is preferred without requiring a valid protocol prefixing the domain.

Copy link
Contributor

Choose a reason for hiding this comment

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

The heck of it is, we don't expect users to be doing Admin stuff on their phones. (Don't change this! It's fine! It's just such a rare use case, I don't know that any admin will ever appreciate it as much as you do.)

Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (3daa390) to head (cf507dc).
Report is 92 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12812      +/-   ##
==========================================
- Coverage   92.75%   92.70%   -0.06%     
==========================================
  Files         769      769              
  Lines       38926    38926              
==========================================
- Hits        36107    36087      -20     
- Misses       2819     2839      +20     
Flag Coverage Δ
e2e 48.53% <ø> (-0.09%) ⬇️
integration 24.60% <ø> (ø)
unit 90.39% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kensternberg-authentik kensternberg-authentik left a comment

Choose a reason for hiding this comment

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

Nothing here looks off. I like the idea and the implementation. Just a few notes that shouldn't stop acceptance.

class="pf-c-form-control pf-m-monospace"
autocomplete="off"
spellcheck="false"
inputmode="url"
Copy link
Contributor

Choose a reason for hiding this comment

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

The heck of it is, we don't expect users to be doing Admin stuff on their phones. (Don't change this! It's fine! It's just such a rare use case, I don't know that any admin will ever appreciate it as much as you do.)

required
/>
<p class="pf-c-form__helper-text">
${msg(
"Can be in the format of 'unix://' when connecting to a local docker daemon, using 'ssh://' to connect via SSH, or 'https://:2376' when connecting to a remote system.",
html`Can be in the format of <code>unix://</code> when connecting to a local
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned that the excess whitespace makes life harder for translators.

@GirlBossRush GirlBossRush merged commit 46a968d into goauthentik:main Feb 14, 2025
70 checks passed
@GirlBossRush GirlBossRush deleted the 24-input-typography branch February 14, 2025 01:11
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.

2 participants