Skip to content

stream settings: Prep for radio-button UI, to handle more than two privacy options#5360

Merged
chrisbobbe merged 9 commits intozulip:mainfrom
chrisbobbe:pr-stream-settings-prep
May 10, 2022
Merged

stream settings: Prep for radio-button UI, to handle more than two privacy options#5360
chrisbobbe merged 9 commits intozulip:mainfrom
chrisbobbe:pr-stream-settings-prep

Conversation

@chrisbobbe
Copy link
Copy Markdown
Contributor

@chrisbobbe chrisbobbe commented Apr 26, 2022

I've got a draft for an input component that lets the user choose from more than two options, radio-button style, for #5250. These are some small improvements I've noticed while working on that draft.

Comment on lines +102 to +109
// TODO: Group all the stream's attributes together (name,
// description, policies, etc.), with an associated "Edit"
// button that gives a UI for changing those attributes. For the
// grouping, try react-native-paper's `Card`, with a
// ZulipTextButton in its `Card.Actions`. See
// https://callstack.github.io/react-native-paper/card-actions.html
// Or their `Surface`:
// https://callstack.github.io/react-native-paper/surface.html
Copy link
Copy Markdown
Contributor Author

@chrisbobbe chrisbobbe Apr 26, 2022

Choose a reason for hiding this comment

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

It seemed like it might take a while to get react-native-paper set up just right, so this stuff isn't in my plan for getting #5250 out the door. But I wanted to write it down.

@chrisbobbe chrisbobbe force-pushed the pr-stream-settings-prep branch from 58fe7b9 to 13c584b Compare April 27, 2022 01:39
@alya
Copy link
Copy Markdown
Collaborator

alya commented Apr 27, 2022

If it would be helpful to review the UI, a screenshot would be great. :)

@gnprice
Copy link
Copy Markdown
Member

gnprice commented Apr 27, 2022

Thanks! These code changes all look good.

I see there are some small UI changes. I think it's a good practice for us to try to always have at least a quick review of UI changes too -- so either a screenshot posted, or look together in the office. Let's perhaps do the latter this afternoon.

@chrisbobbe
Copy link
Copy Markdown
Contributor Author

chrisbobbe commented Apr 28, 2022

Sure, makes sense! I'll post screenshots in two separate comments, coming up.

@chrisbobbe
Copy link
Copy Markdown
Contributor Author

chrisbobbe commented Apr 28, 2022

abe083a

SelectableOptionRow: Use our standard icon size of 24 for the checkmark

439865c

SelectableOptionRow: Reserve a space for the checkbox even when unselected

So that the word wrapping of the subtitle, when long, doesn't change
when `selected` changes. That'd be distracting.

A list of SelectableOptionRow components before these changes, then after, with the same title/subtitle in both cases (but longer than I think we've yet used in the app). We currently use SelectableOptionRow in the language picker and the set-user-status screen.

Apr-28-2022.11-38-55.mp4
Apr-28-2022.11-43-10.mp4

@chrisbobbe
Copy link
Copy Markdown
Contributor Author

chrisbobbe commented Apr 28, 2022

fef1ae7

StreamSettingsScreen: Make it a bit clearer what the "Edit" button does

And leave a TODO for something better.

The screen currently gives a jumbled collection of

- attributes about the stream and a button to change them

- a subscribe/unsubscribe button, and, if the user is subscribed,
  details about the subscription and switches to change the details

- a way to change who else is subscribed (but only by adding
  subscribers, and with no way to see the state before or after a
  change)

Each of these bullet points should be given its own coherent section
in the UI. Probably we should experiment with react-native-paper's
`Card`, as mentioned in the comment. This would be similar to what
Slack on iOS does.

Before/after (it just changes the button's text from "Edit" to "Edit stream"):

@alya
Copy link
Copy Markdown
Collaborator

alya commented May 4, 2022

The wording change in the stream settings looks good to me. For a bigger reorg in the future, we should think about lining it up better with the organization/terminology in the web UI:
Screen Shot 2022-05-04 at 11 18 37 AM

@alya
Copy link
Copy Markdown
Collaborator

alya commented May 4, 2022

I'm having a hard time visualizing precisely how status and language picker will be affected, but having the checkmark be a standard size and reserving the space for it sounds great.

@chrisbobbe
Copy link
Copy Markdown
Contributor Author

chrisbobbe commented May 4, 2022

I'm having a hard time visualizing precisely how status and language picker will be affected

Good point, I forgot to screenshot those! Here we are:

Status suggestions before/after:

The "reserve-space" change means that all rows have enough height for the checkmark, not just the row(s) with a checkmark. That's another way the layout won't change distractingly when a row's selected state changes. I guess this change becomes noticeable with the icon's size increase from 16 to 24, for rows that have just one line of text, with the standard font size.

Language picker before/after:

@chrisbobbe chrisbobbe force-pushed the pr-stream-settings-prep branch from 02b603c to 062815d Compare May 4, 2022 20:15
Copy link
Copy Markdown
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Catching up after my vacation. One code comment on the new revision, below. Now reading the thread above…

Comment thread src/streams/CreateStreamScreen.js Outdated

try {
await api.createStream(auth, { name, description, invite_only });
api.createStream(auth, { name, description, invite_only: privacy === 'private' });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This lost the await, which means the try/catch will have no effect. Perhaps unintentional from the rebase?

Copy link
Copy Markdown
Contributor Author

@chrisbobbe chrisbobbe May 10, 2022

Choose a reason for hiding this comment

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

Yep, thanks for the catch!

@gnprice
Copy link
Copy Markdown
Member

gnprice commented May 10, 2022

OK, all looks good modulo that code comment. Thanks for the screenshots!

chrisbobbe added 9 commits May 9, 2022 21:08
…ected

So that the word wrapping of the subtitle, when long, doesn't change
when `selected` changes. That'd be distracting.
And leave a TODO for something better.

The screen currently gives a jumbled collection of

- attributes about the stream and a button to change them

- a subscribe/unsubscribe button, and, if the user is subscribed,
  details about the subscription and switches to change the details

- a way to change who else is subscribed (but only by adding
  subscribers, and with no way to see the state before or after a
  change)

Each of these bullet points should be given its own coherent section
in the UI. Probably we should experiment with react-native-paper's
`Card`, as mentioned in the comment. This would be similar to what
Slack on iOS does.
We'd like to add more stream-privacy options soon.
@chrisbobbe chrisbobbe force-pushed the pr-stream-settings-prep branch from 062815d to f82defe Compare May 10, 2022 04:13
@chrisbobbe chrisbobbe merged commit f82defe into zulip:main May 10, 2022
@chrisbobbe
Copy link
Copy Markdown
Contributor Author

Thanks for the review! Merged.

@chrisbobbe chrisbobbe deleted the pr-stream-settings-prep branch May 10, 2022 04:14
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.

3 participants