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: add tooltip to clarify invalid Jitsi URL #27594

Closed
wants to merge 2 commits into from

Conversation

peterssonlinn
Copy link
Collaborator

@peterssonlinn peterssonlinn commented Nov 7, 2023

Added tooltip to clearify why save button is disabled when invalid Jitsi URL.
Co-authored-by: Angelica Ferlin angelica.ferlin@gmail.com

Fixes #27511.

Screenshots and screen captures:
Gif belows shows the new tooltip.

chrome-capture-2023-11-8

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.

@alya
Copy link
Contributor

alya commented Nov 7, 2023

Thanks! However, you need to implement a tooltip that is exactly as specified in the issue description.

Also, please update your commit message to match the commit style guidelines?

@peterssonlinn
Copy link
Collaborator Author

Hi @alya!

So you mean that the tooltip should have the text "Cannot save invalid Jitsi server URL."?
I did not know how that would be when the page was translated, and because of that I used "Invalid URL". Thanks in advance!

@alya
Copy link
Contributor

alya commented Nov 7, 2023

Yes, that's why that phrase was used in the issue. I don't see a problem with the translation.

If it was an intentional change, note that you checked off this item in the PR checklist without implementing it. The PR checklist is there for a good reason, as not following it wastes time and requires more review round-trips. ;)

Explains differences from previous plans (e.g., issue description).

@peterssonlinn
Copy link
Collaborator Author

Yes, that's why that phrase was used in the issue. I don't see a problem with the translation.

If it was an intentional change, note that you checked off this item in the PR checklist without implementing it. The PR checklist is there for a good reason, as not following it wastes time and requires more review round-trips. ;)

Explains differences from previous plans (e.g., issue description).

We have now solved the issue and updated the tests so it includes "Jitsi". Thank you for the tip about the checklist, will look more carefully in the future. It is now ready for review.

@alya
Copy link
Contributor

alya commented Nov 8, 2023

Your PR is not ready for review, as you have not addressed half of my feedback:

Also, please update your commit message to match the commit style guidelines.

@angelicaferlin
Copy link
Collaborator

Your PR is not ready for review, as you have not addressed half of my feedback:

Also, please update your commit message to match the commit style guidelines.

Hi, so sorry we missed that part but now it should be updated according to the guidelines now :)

@alya
Copy link
Contributor

alya commented Nov 14, 2023

Thanks!

@sayamsamal could you please review this one? I have not tested it.

@alya alya added the maintainer review PR is ready for review by Zulip maintainers. label Nov 14, 2023
@@ -1,7 +1,7 @@
{{#unless show_only_indicator}}
<div class="save-button-controls hide">
<div class="inline-block subsection-changes-save">
<button class="save-discard-widget-button button primary save-button" data-status="save">
<button class="save-discard-widget-button button primary save-button" data-status="save" id="save-discard-widget-id">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not add an extra ID when we can use the preexisting .save-button class for the same purpose,

onShow(instance) {
const $elem = $(instance.reference);
if ($($elem).find("#save-discard-widget-id").is(":disabled")) {
const content = $t({defaultMessage: "Cannot save invalid Jitsi server URL"});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the issue description asks for a period . at the end of the line, let's include that.

@@ -161,14 +162,17 @@
SPLIT_BOUNDARY = "?.!" # Used to split string into sentences.
SPLIT_BOUNDARY_REGEX = re.compile(rf"[{SPLIT_BOUNDARY}]")

# Regexes which check capitalization in sentences.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is repeated twice, please recheck your code for simple errors as such to make it easier for the reviewers.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, the only change that should have been part of this commit in the current file is the addition of Jitsi in the ignored phrases. If you want to do additional cleanup, please include it as an additional commit with a commit message that explains those changes.

Comment on lines 170 to 174
# Checks if an upper case character exists
r"^[A-Z][a-z]+[\sa-z0-9]+[A-Z]",
# after a lower case character when the first character is in upper case.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the comments are actually part of a single comment.

@sayamsamal
Copy link
Collaborator

Thank you @peterssonlinn and @angelicaferlin. I have left you some feedback which should be rather quick to fix and will make the code a bit cleaner. That being said, the PR does work as intended and you have approached it in the right way, so good job on that.

@sayamsamal
Copy link
Collaborator

Also please provide the Co-authored-by line at the end of the commit message, to accurately credit the contributor.

Commit title

Commit message

Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>

@angelicaferlin
Copy link
Collaborator

Thank you @peterssonlinn and @angelicaferlin. I have left you some feedback which should be rather quick to fix and will make the code a bit cleaner. That being said, the PR does work as intended and you have approached it in the right way, so good job on that.

Thank you for the feedback and the kind words! We have now updated the PR with your suggestions :)

@peterssonlinn
Copy link
Collaborator Author

Hi @timabbott and @alya, I and Angelica would really appreciate some answers to the question that we have posted regarding how we can proceed. Could you please answer and give us some guidance?

@timabbott
Copy link
Sponsor Member

@sahil839 can you review this one? I'm not at all caught up on it.

This commit moves the function
initialize_disable_btn_hint_popover from
stream_ui_updates.js to settings_components.js
due to circular dependencies.

Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
const $button_wrapper = $subsection_elem.find(".subsection-changes-save");
const is_tippy = $button_wrapper.get(0)._tippy;
if (disable_save_btn) {
if (!is_tippy) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this is_tippy condition? I don't think we do this check at other places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We added a clarifying comment that explains why we need this. In short, we need to check that there is not already a tippy in place since this function runs every time a letter is entered in the URL box.

$t({defaultMessage: "Cannot save invalid Jitsi server URL."}),
);
$button_wrapper.get(0)._tippy.setProps({
placement: "top",
Copy link
Collaborator

Choose a reason for hiding this comment

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

To do this in a better way, we can pass opts object to initialize_disable_btn_hint_popover and then update the code there to be something like -

const tippy_opts = {
    animation: false,
    hideOnClick: false,
    placement: "bottom",
    ...opts,
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We updated to your suggestion

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.

Thanks for updating the PR. Posted a couple of comments, looks good otherwise.

This commit adds a tooltip in organization settings,
when the save button is disabled due to invalid
Jitsi URL.

Fixes zulip#27511.

Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
@peterssonlinn
Copy link
Collaborator Author

Thanks for updating the PR. Posted a couple of comments, looks good otherwise.

@sahil839 we have updated the PR according to your suggestions. Thanks for the fast feedback. Let us know if there is anything else that needs to be updated. :)

@@ -681,22 +681,40 @@ function enable_or_disable_save_button($subsection_elem) {
disable_save_btn = should_disable_save_button_for_time_limit_settings(time_limit_settings);
} else if ($subsection_elem.attr("id") === "org-other-settings") {
disable_save_btn = should_disable_save_button_for_jitsi_server_url_setting();
const $button_wrapper = $subsection_elem.find(".subsection-changes-save");
const is_tippy = $button_wrapper.get(0)._tippy;
Copy link
Collaborator

Choose a reason for hiding this comment

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

A better variable name here might be tippy or tippy_instance since it is not a boolean and is actually a tippy instance.

Also, would be good to update this to be $button_wrapper[0]._tippy just so that we have it consistent with other places in the codebase.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good otherwise. Will mark it ready for "integration review" once these changes are done

@alya
Copy link
Contributor

alya commented Jan 5, 2024

@peterssonlinn Do you plan to address @sahil839 's feedback above, or should we take over and finish this PR?

@timabbott timabbott added the completion candidate PRs with reviews that may unblock merging label Feb 13, 2024
@zulipbot
Copy link
Member

Heads up @peterssonlinn, 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
Copy link
Sponsor Member

Closing in favor of #29386, thanks for your effort on this @peterssonlinn and @angelicaferlin!

@timabbott timabbott closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion candidate PRs with reviews that may unblock merging has conflicts size: L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add clarification tooltip when settings can't be saved due to invalid Jitsi URL
7 participants