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

stream_settings: Restructure stream creation panel. #29433

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

Conversation

sujalshah-bit
Copy link
Collaborator

@sujalshah-bit sujalshah-bit commented Mar 23, 2024

User group section

panel 1 panel 2
image image

Channel creation section

panel 1 panel 2
image image
  • Advance configuration:

img img
image image

Notes

  • The issue description doesn't include a mention of a "Configure Settings" button. While implementing these changes, I realized that users might need to revisit the configuration settings to modify certain details, such as the stream name. Therefore, I added a button for navigating back to the configuration settings when needed.

  • Also the color of the button should be different I guess please provide feedback on both of this.


Fixes part of #29403.

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.

@sujalshah-bit sujalshah-bit force-pushed the issue-29403 branch 2 times, most recently from 93995bd to 0df3503 Compare March 25, 2024 10:53
@timabbott
Copy link
Sponsor Member

Is this ready for review?

@sujalshah-bit
Copy link
Collaborator Author

@timabbott as i have mentioned above last part that is Change how adding users works this is part is still remaining for that part i still not don't know how to implement this

@timabbott
Copy link
Sponsor Member

Let's just move the "Change how adding users work" part to a separate issue; this already has enough going on as it is. @sujalshah-bit can you do a careful pass to make sure you've got the right strings? "Advance configuration" in your screenshot looks like a typo, "Advanced" is the word you want.

@sujalshah-bit
Copy link
Collaborator Author

I will make the update soon.

@sujalshah-bit sujalshah-bit changed the title [WIP]stream_settings: Restructure stream creation panel. stream_settings: Restructure stream creation panel. May 9, 2024
@timabbott
Copy link
Sponsor Member

@sahil839 can you review this one?

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 comment.

A note on commit message, the first commit should have "Fixes part of .." to make sure we do not close the issue if we merge a part of this PR initially. The commit should have "Fixes .." only in the commit which completes the said issue.

web/templates/stream_settings/stream_creation_form.hbs Outdated Show resolved Hide resolved
web/templates/stream_settings/stream_creation_form.hbs Outdated Show resolved Hide resolved
web/src/settings_config.ts Show resolved Hide resolved
web/templates/stream_settings/stream_creation_form.hbs Outdated Show resolved Hide resolved
web/templates/stream_settings/stream_creation_form.hbs Outdated Show resolved Hide resolved
web/templates/stream_settings/stream_creation_form.hbs Outdated Show resolved Hide resolved
web/src/stream_create.js Outdated Show resolved Hide resolved
web/src/user_group_create.js Outdated Show resolved Hide resolved
@sahil839
Copy link
Collaborator

Also, the current changes also results in the "Advanced configuration" expandable view in the stream edit form as same template is used for both the places. The issue does not mention anything about changing it. @alya do we want that change in stream edit UI as well?

@alya
Copy link
Contributor

alya commented May 14, 2024

The section label should be "Advanced configurations", as noted in the issue.

@alya
Copy link
Contributor

alya commented May 14, 2024

Please be sure not to introduce a regression by using "stream" instead of "channel".

Screenshot 2024-05-14 at 16 44 54

@alya
Copy link
Contributor

alya commented May 14, 2024

Currently, I can click "Continue to add subscribers" without filling out required info on the first page (channel name). We should make sure to catch that before the user gets to the next page.

Similarly, it shouldn't be possible to continue to the next page if you use a channel name that's already taken, or there's some other error.

@alya
Copy link
Contributor

alya commented May 14, 2024

The issue description doesn't include a mention of a "Configure Settings" button. While implementing these changes, I realized that users might need to revisit the configuration settings to modify certain details, such as the stream name. Therefore, I added a button for navigating back to the configuration settings when needed.

Good idea! We might want to make it more clear that this is a "back" button, but the current state on this PR is probably OK for now.

@alya
Copy link
Contributor

alya commented May 14, 2024

Also, the current changes also results in the "Advanced configuration" expandable view in the stream edit form as same template is used for both the places. The issue does not mention anything about changing it. @alya do we want that change in stream edit UI as well?

Good question! I wasn't thinking about that, but it feels reasonable to me.

@alya
Copy link
Contributor

alya commented May 14, 2024

Clicking anywhere on the "Advanced configuration" section name should expand/collapse it, with an appropriate pointer cursor.

@alya
Copy link
Contributor

alya commented May 14, 2024

I'm seeing the triangle not rotating down correctly when the section is expanded in the "create channel" UI:

Screenshot 2024-05-14 at 16 58 24

@alya
Copy link
Contributor

alya commented May 15, 2024

That's all I've got for now. I didn't read @sahil839 's feedback carefully, so there may be some duplication.

@sujalshah-bit sujalshah-bit force-pushed the issue-29403 branch 4 times, most recently from e1b0c48 to 77a974d Compare May 17, 2024 03:09
@sujalshah-bit
Copy link
Collaborator Author

Currently, I can click "Continue to add subscribers" without filling out required info on the first page (channel name). We should make sure to catch that before the user gets to the next page.
Similarly, it shouldn't be possible to continue to the next page if you use a channel name that's already taken, or there's some other error.

  • I am not able to reproduce that bug. In my dev env it is working as expected
    image
    image

I'm seeing the triangle not rotating down correctly when the section is expanded in the "create channel" UI:

  • This bug only occurs when the user clicks on a stream and then clicks the create stream button. I'm trying to understand what's causing it, but I haven't figured it out much. @sahil839, can you help?
bandicam.2024-05-17.08-59-18-129.mp4

  • left one comment above for user_group discussion @sahil839 kindly review it.

Other than that I think I have covers all feedbacks kindly review @sahil839 @alya.

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 few comments.

web/src/stream_create.js Outdated Show resolved Hide resolved
web/src/stream_settings_components.js Outdated Show resolved Hide resolved
web/src/user_group_create.js Outdated Show resolved Hide resolved
@sahil839
Copy link
Collaborator

I am not able to reproduce that bug. In my dev env it is working as expected

I can reproduce this. I just opened the stream creation form, did nothing and simply clicked on "Continue to add subscribers" button.

This bug only occurs when the user clicks on a stream and then clicks the create stream button. I'm trying to understand what's causing it, but I haven't figured it out much. @sahil839, can you help?

This is because there are two elements with same ID "toggle-advanced-configurations-icon" once the user clicks on a stream - one for stream creation form and one for the stream settings edit form. The correct solution here would be to use a class for that element and then update the JS code to make sure the class is changed for the correct element.

@sujalshah-bit sujalshah-bit force-pushed the issue-29403 branch 2 times, most recently from 14b8108 to 1f1cd4a Compare May 23, 2024 02:10
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 some comments.

e.stopPropagation();

const stream_name = $("#create_stream_name").val().trim();
const name_ok = stream_name_error.validate_for_submit(stream_name);
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 could be is_stream_name_valid.

if (name_ok) {
stream_settings_components.show_subs_pane.create_stream("subscribers_container");
} else {
stream_settings_components.show_subs_pane.create_stream("configure_channel_settings");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just do nothing in case the name is not valid?

},
};

export function update_footer_buttons(container_name = "configure_channel_settings") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there is no need for a default value as the caller will pass container name always.

},
};

export function update_footer_buttons(container_name = "configure_user_group_settings"): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here also, we can remove the default value.

e.stopPropagation();

const group_name = $("#create_user_group_name").val().trim();
const name_ok = user_group_name_error.validate_for_submit(group_name);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This variable can be named similar to how we would have it for streams.

@sahil839
Copy link
Collaborator

sahil839 commented May 23, 2024

Since we now collapse settings like "Who can post to stream", "Message retention", etc. in the stream edit view as well, do we want to show the "Save changes" button on "Advanced configurations" heading? @alya FYI.

Peek 2024-05-23 12-57

Removed the "Stream permissions" heading to simplify the panel.

Moved the "Announce new stream in {stream}" option just above
"Default stream for new users".

Implement a collapsible "Advanced configurations" section,
collapsed by default, to accommodate less commonly changed settings.
This allows for future expansion of stream permission configurations.

Fixes part of zulip#29403.
Update the descriptions of Web-public, Public, Private, shared history
and Private, protected history.
Changed the title of the first panel to
"Create channel: configure settings" and title of second panel to
"Create channel: add subscribers".

Implement logic in stream_create.js to show and hide both the panels.

Add two buttons to facilitate switching between the tabs or panels.

Added new descriptions to 'stream type descriptions'.
Extract `show_user_group_settings_pane` with related functions and
variable.
Break the current user group creation panel into two panel
"Create user group: configure settings" and
"Create user group: add subscribers".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

5 participants