Page MenuHomePhabricator

[native] Create a new screen that will show the role change information
ClosedPublic

Authored by rohan on Jun 9 2023, 11:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 4:03 AM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Thu, Nov 7, 10:30 PM
Unknown Object (File)
Thu, Nov 7, 7:32 PM

Details

Summary

This is the screen that contains the information (user avatar, username, role change description and role change options) to allow admins to change roles for a specific user. The navigation and the
header left/right buttons will come in the subsequent diffs to make this one easier to review.

Depends on D8155

Test Plan

Please see below what the screen looks like for a given user

Simulator Screen Shot - iPhone 14 Pro - 2023-06-09 at 14.24.00.png (2×1 px, 143 KB)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

rohan requested review of this revision.Jun 9 2023, 11:46 AM
atul requested changes to this revision.Jun 12 2023, 1:06 PM
atul added 1 blocking reviewer(s): ginsu.
atul added a subscriber: ted.

Requesting changes for letterSpacing justification. Also adding @ginsu as blocking to take a look at showActionSheet(...), specifically how it behaves "across platforms."

native/roles/change-roles-screen.react.js
73 ↗(On Diff #27585)

It's weird that we need to grab activeTheme here, we should just be able to use the design system. But it looks like showActionSheetWithOptions(...) takes userInterfaceStyle, so I guess we have to?

82 ↗(On Diff #27585)

CC @ginsu

Is there anything iOS/Android specific we need to take into account here with indices? Or is that handled at a "lower" level of abstraction automatically for us?

102 ↗(On Diff #27585)

Wonder if we should use size="profile" for consistency w/ the other places we use avatar in settings screens? It looks like of sparse as is, and profile would "fill out the view" a bit better imo?

CC @ted

125 ↗(On Diff #27585)

Hm, why are we setting letterSpacing to 0.3 here? Are we sure that this was intentional? Messing w/ kerning is a pretty "extreme" decision, so wondering what the justification is

This revision now requires changes to proceed.Jun 12 2023, 1:06 PM
native/roles/change-roles-screen.react.js
73 ↗(On Diff #27585)

Yeah I thought so as well, but didn't see an option otherwise to specify userInterfaceStyle. I used invite-links-button.react.js as an action sheet reference

102 ↗(On Diff #27585)

Reference for what profile looks like for ted. If the consensus is to change here, I'll also change on web to keep it consistent

Simulator Screen Shot - iPhone 14 Pro - 2023-06-12 at 17.09.18.png (2×1 px, 189 KB)

125 ↗(On Diff #27585)

No you're right, this was unintentional

native/roles/change-roles-screen.react.js
102 ↗(On Diff #27585)

We can use size="profile" for consistency.

@rohan Can you check the username text styling? It looks a bit thin here in the screenshot

native/roles/change-roles-screen.react.js
102 ↗(On Diff #27585)

I forgot the fontWeight specified in the Figma! I'll add it now

Remove letterSpacing, add fontWeight, set avatar size to profile

ginsu requested changes to this revision.Jun 13 2023, 11:37 AM

Requesting changes for Android action/bottom sheet implementation. Here is the doc for android action/bottom sheet best practices

native/roles/change-roles-screen.react.js
82 ↗(On Diff #27585)

We should only make the cancel button show for iOS. We also should display icons in for android bottom sheet. I would recommend taking a look at useShowAvatarActionSheet in native/avatars/avatar-hooks for inspiration

This revision now requires changes to proceed.Jun 13 2023, 11:37 AM
native/roles/change-roles-screen.react.js
82 ↗(On Diff #27585)

Since the role names are not predefined and can be any variety of roles, I don't know if there's a practical way to use icons in the action sheet

In D8156#242184, @ginsu wrote:

Requesting changes for Android action/bottom sheet implementation. Here is the doc for android action/bottom sheet best practices

Thanks for the doc, it's really helpful! I'll make the changes for the cancel button, just had one question about the icons above (accidentally submitted the comment too early)

Screenshot 2023-06-13 at 3.21.53 PM.png (1×1 px, 480 KB)

native/roles/change-roles-screen.react.js
82 ↗(On Diff #27585)

Hmmm that's a good point... I think it might be fine to deviate from the "standard" practice here, but if I think of any other solutions, I'll let you know also gonna cc @ted if he has any ideas for this

Address action sheet feedback

Thanks for addressing feedback

Requesting changes for Android action/bottom sheet implementation. Here is the doc for android action/bottom sheet best practices

@ginsu, I think it could be good if we could "abstract away" these platform-specific quirks

@ginsu, I think it could be good if we could "abstract away" these platform-specific quirks

I agree, there is already task to create our own native bottomsheet/actionsheet component, abstracting away these platform specific quirks would be a good first step to this task

This revision is now accepted and ready to land.Jun 14 2023, 9:52 AM
This revision was landed with ongoing or failed builds.Jun 21 2023, 8:42 AM
This revision was automatically updated to reflect the committed changes.