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

settings: Replace extraneous pointer cursors on text with text cursor. #25071

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

Conversation

palashb01
Copy link
Collaborator

@palashb01 palashb01 commented Apr 11, 2023

  • Replace extraneous pointer cursors on text with text cursor, where the label is not associated with any input element.
  • Fix interaction between label and input element to focus on input/select fields on clicking on label.

Fixes: #21769


Screenshots and screen captures:

Before After
before interaction
text-before text

Comment for reviewer:

  • In the Personal Settings > Profile section, we have multiple input and select elements with a single label for all of them. With the new approach of fixing the for and id attributes, everything works fine and as expected, except for the birthday and mentor inputs. These inputs have a div element that doesn't show any interaction with the label.

birthday


Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

@zulipbot
Copy link
Member

Hello @zulip/server-settings, @zulip/server-streams members, this pull request was labeled with the "area: settings (user)", "area: stream settings", "area: settings (admin/org)" labels, so you may want to check it out!

@palashb01
Copy link
Collaborator Author

Hey @alya , I have opened a new pull request for #24623 after the review by @timabbott , with a new approach. Could you please review the pull request? Thanks :)

@alya
Copy link
Contributor

alya commented Apr 13, 2023

Looks good to me in manual testing! @sahil839 could you please take a look?

Copy link
Collaborator

@sahil839 sahil839 left a comment

Choose a reason for hiding this comment

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

Posted a couple of comments.

A couple of points to confirm from @alya

  • We open the "Change email" and "Change password" modal on clicking the labels after changes in this PR. I don't have any strong opinion on this, but just wanted to point it out in case you missed it while testing. Also, we should probably mention about this change in the commit message as well.
  • Do we want a regular cursor or text cursor? By regular cursor, I mean the arrow which is shown by default.

@@ -1,5 +1,5 @@
<div class="custom_user_field" name="{{ field.name }}" data-field-id="{{ field.id }}">
<label class="inline-block" for="{{ field.name }}" class="title">{{ field.name }}</label>
<label for="{{field.name}}" class="inline-block title">{{ field.name }}</label>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can avoid removing the space before and after field.name in this commt.

<label for="realm_move_messages_within_stream_limit_seconds" class="dropdown-title">{{t "Time limit for editing topics" }} <i>({{t "does not apply to moderators and administrators" }})</i></label>
<select name="realm_move_messages_within_stream_limit_seconds" id="id_realm_move_messages_within_stream_limit_seconds" class="prop-element settings_select" data-setting-widget-type="time-limit">
<label for="id_realm_move_messages_within_stream_limit_seconds" class="dropdown-title">{{t "Time limit for editing topics" }} <i>({{t "does not apply to moderators and administrators" }})</i></label>
<select name="realm_move_messages_within_stream_limit_seconds" id="id_realm_move_messages_within_stream_limit_seconds" class="prop-element bootstrap-focus-style settings_select" data-setting-widget-type="time-limit">
Copy link
Collaborator

Choose a reason for hiding this comment

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

bootstrap-focus-style can be added in a separate prep commit.

@alya
Copy link
Contributor

alya commented Apr 18, 2023

Do we want a regular cursor or text cursor? By regular cursor, I mean the arrow which is shown by default.

Is this when things aren't clickable? Based on the CZO discussion, we decided to go with the browser default cursor.

@_Sahil Batra|10242 said:

The browser default (atleast for Chrome and Firefox) value of cursor property is default for label elements, which is typically an arrow but can be platform dependent.

@alya
Copy link
Contributor

alya commented Apr 18, 2023

We open the "Change email" and "Change password" modal on clicking the labels after changes in this PR. I don't have any strong opinion on this, but just wanted to point it out in case you missed it while testing. Also, we should probably mention about this change in the commit message as well.

Ah, I hadn't noticed -- thanks for the callout!

I don't have a strong opinion either. Having clicking on the label open the modal seems fine, so let's just update the commit message.

@palashb01
Copy link
Collaborator Author

palashb01 commented Apr 21, 2023

Update: There has been a minor update in this PR after the discussion on the CZO, I am currently working on release goals PRs and will continue working on this after 4-5 days.

@zulipbot
Copy link
Member

Heads up @palashb01, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

This commit changes the incorrect 'for' attribute values to the
correct ones in order to fix the interaction between label, select/
button elements.
This commit adds or removes 'id' and 'for' attribute values to fix
the interaction between label and input elements, so that clicking
on the label will focus the corresponding input element.

For labels that are not associated with any input element, the 'for'
attribute has been removed.

To fix the issue of extraneous pointer cursors on labels, a CSS rule
has been added so that a default text cursor will be displayed when
there is no 'for' attribute.

Fixes: zulip#21769
@palashb01
Copy link
Collaborator Author

@zulipbot remove "has conflicts"

@zulipbot
Copy link
Member

Heads up @palashb01, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

@timabbott timabbott added the completion candidate PRs with reviews that may unblock merging label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove extraneous pointer cursors on text in settings
5 participants