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

feat: Inline price control create alert #8835

Merged
merged 9 commits into from
Jun 20, 2023

Conversation

rajsam003
Copy link
Contributor

@rajsam003 rajsam003 commented Jun 8, 2023

This PR resolves FX-4806

This PR adds Inline price control for Create Alert modal flow

Here is the figma spec

Screen.Recording.2023-06-12.at.15.49.03.mov

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • Inline price control in create/edit alert - Sam

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@rajsam003 rajsam003 requested review from MounirDhahri, gkartalis and a team June 8, 2023 15:12
@rajsam003 rajsam003 self-assigned this Jun 8, 2023
Comment on lines 47 to 48
//@ts-ignore
state.attributes[payload.key] = payload.value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find it hard to fix this type error. Any help is appreciated.

@rajsam003 rajsam003 force-pushed the rajsam003/FX-4806/inline-price-control-create-alert branch from 2e5c201 to 56592d6 Compare June 12, 2023 13:13
@rajsam003 rajsam003 marked this pull request as ready for review June 12, 2023 13:50
@rajsam003 rajsam003 requested a review from damassi June 12, 2023 14:51
Copy link
Member

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

Looking nice! Just one question from me about an unimplemented feature (maybe more of a PM/design question).

Comment on lines 102 to 106
<Flex m={2} p={2} alignItems="center" backgroundColor="black5">
<Text variant="sm-display" color="black60">
Your recent price ranges will show here
</Text>
</Flex>
Copy link
Member

Choose a reason for hiding this comment

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

question: We are not implementing this as part of this PR, correct?

If that's the case I wonder if we can hide this section for now, since it's not really helpful or actionable yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Let me ask this in this channel.

Copy link
Member

Choose a reason for hiding this comment

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

To clarify: the "Recent price ranges" section should be in scope for this ticket so I would expect this component, which includes this empty state text to be ported over here.

Copy link
Member

Choose a reason for hiding this comment

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

Erin's comment around the value of the empty state is a good one. We can make that change within the RecentPriceRanges component so that it applies to any screen rendering it.

@nickskalkin
Copy link
Contributor

@rajsam003 a tiny bug I've discovering while testing the feature:

Monosnap.screencast.2023-06-13.14-48-49.mp4

@nickskalkin
Copy link
Contributor

@rajsam003 "Clear" button is missing in design, but I think we should add it (we discussed it on the refinement session). The button exists on the existing price filter screen:

Screenshot 2023-06-13 at 14 51 52

Comment on lines +37 to +38
// force it to not use react-native-screens, which is broken inside a react-native Modal for some reason
detachInactiveScreens={false}
Copy link
Member

Choose a reason for hiding this comment

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

tell me more 👀 we might need to be more proactive about this in other surfaces maybe, how did you find out?

Copy link
Member

Choose a reason for hiding this comment

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

@gkartalis maybe you and @rajsam003 can find some time to pair on this? Looks like this argument, and the same comment, exists already in a few different screens.

Copy link
Member

Choose a reason for hiding this comment

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

good point, yes def @rajsam003 feel free to drop some time next week on my cal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I said I referred other screens as well ( for eg. here, here. It seemed like its generally the case in lot of places. So I find it safer to use this prop.

Copy link
Member

Choose a reason for hiding this comment

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

We looked into it with @rajsam003, turns out that there is an issue with react native modals as the comment suggests, not sure how we can resolve it and remove it but we confirmed that removing this line it breaks the flow (the set price screen modal cannot open).

so lets leave it as it is (MOPLAT will further investigate when migrating to react-navigation.

<Touchable
accessibilityLabel="Set price range"
accessibilityRole="button"
underlayColor="black5"
Copy link
Member

Choose a reason for hiding this comment

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

I think you can leave this out, no longer needed unless you want a custom color (you can see that removing it has the same behavior while pressing it)

Suggested change
underlayColor="black5"

@gkartalis
Copy link
Member

Looks great generally. I leave the approval though to the @artsy/fx-devs ⚡️ (btw checked the type issue and wasn't able to fix it quickly but might be worth trying out stuff to make it safe to prevent crashes)

MounirDhahri
MounirDhahri previously approved these changes Jun 16, 2023
Copy link
Member

@MounirDhahri MounirDhahri left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@dblandin dblandin left a comment

Choose a reason for hiding this comment

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

Perhaps too big of a refactor for this particular PR but I'd be interested if we could extract some of the components within the PriceRangeOptionsScreen, particularly this section and share that between the artwork grid and create alert flows.

Happy to pair on this sometime to explore!

initialParams={params}
/>
<Stack.Screen name="EmailPreferences" component={EmailPreferencesScreen} />
<Stack.Screen name="AlertPriceRangeScreen" component={AlertPriceRangeScreen} />
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Where is name used here? We should probably be consistent with including or omitting the Screen suffix in the string value.

@rajsam003
Copy link
Contributor Author

rajsam003 commented Jun 16, 2023

Perhaps too big of a refactor for this particular PR but I'd be interested if we could extract some of the components within the PriceRangeOptionsScreen, particularly this section and share that between the artwork grid and create alert flows.

Happy to pair on this sometime to explore!

I like resuing components. In this case, it was too hectic. I felt the current one is easier and understandable. If anything is messed up in one screen it will not effect the other screen. But yes I can give a try again. 👍🏽

@dblandin
Copy link
Member

dblandin commented Jun 16, 2023

I felt the current one is easier and understandable. If anything is messed up in one screen it will not effect the other screen. But yes I can give a try again.

It be a follow-up PR if you like. The other screen has a lot of coupling with artwork filters but I think there might be a useful component to extract/define that wraps all of the input components and takes function props to respond to value changes.

Copy link
Member

@gkartalis gkartalis left a comment

Choose a reason for hiding this comment

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

Looking good, also did a quick QA and played around with some cases and nothing seems to be blocking.

Lets 🛳️ it???? 🚀

Non blocking but for the future:

I remember even back when I was in FX we had this bug that I am not sure if we have ticketed somewhere:

Screenshot 2023-06-20 at 13 05 15

as you see on the screenshot the users are able to create a price range with min price > max price. Let's follow up and create a ticket about that

Comment on lines +37 to +38
// force it to not use react-native-screens, which is broken inside a react-native Modal for some reason
detachInactiveScreens={false}
Copy link
Member

Choose a reason for hiding this comment

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

We looked into it with @rajsam003, turns out that there is an issue with react native modals as the comment suggests, not sure how we can resolve it and remove it but we confirmed that removing this line it breaks the flow (the set price screen modal cannot open).

so lets leave it as it is (MOPLAT will further investigate when migrating to react-navigation.

@rajsam003 rajsam003 merged commit 707a3b4 into main Jun 20, 2023
@rajsam003 rajsam003 deleted the rajsam003/FX-4806/inline-price-control-create-alert branch June 20, 2023 11:11
This pull request was closed.
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.

6 participants