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

[#17727] Implement Dropdown input component #17927

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Conversation

tumanov-alex
Copy link
Contributor

fixes #17727

Summary

Implement dropdown-input component based on the original dropdown one

Figma
| --- | --- | --- |

@tumanov-alex tumanov-alex self-assigned this Nov 16, 2023
@status-im-auto
Copy link
Member

status-im-auto commented Nov 16, 2023

Jenkins Builds

Click to see older builds (34)
Commit #️⃣ Finished (UTC) Duration Platform Result
4d26261 #1 2023-11-16 13:29:19 ~2 min tests 📄log
✔️ 4d26261 #1 2023-11-16 13:33:20 ~6 min android-e2e 🤖apk 📲
4d26261 #1 2023-11-16 13:33:36 ~7 min ios 📄log
✔️ 4d26261 #1 2023-11-16 13:33:42 ~7 min android 🤖apk 📲
✔️ e23ba5b #3 2023-11-16 14:25:05 ~6 min ios 📱ipa 📲
✔️ e23ba5b #3 2023-11-16 14:26:24 ~7 min android 🤖apk 📲
✔️ e23ba5b #3 2023-11-16 14:26:33 ~7 min android-e2e 🤖apk 📲
✔️ e23ba5b #3 2023-11-16 14:29:18 ~10 min tests 📄log
1c762dc #4 2023-11-18 14:46:33 ~3 min tests 📄log
✔️ 1c762dc #4 2023-11-18 14:48:29 ~5 min ios 📱ipa 📲
✔️ 1c762dc #4 2023-11-18 14:49:04 ~5 min android 🤖apk 📲
✔️ 1c762dc #4 2023-11-18 14:49:10 ~6 min android-e2e 🤖apk 📲
0778032 #5 2023-11-18 19:41:52 ~2 min tests 📄log
✔️ 0778032 #5 2023-11-18 19:44:36 ~5 min android-e2e 🤖apk 📲
✔️ 0778032 #5 2023-11-18 19:45:07 ~6 min android 🤖apk 📲
✔️ 0778032 #5 2023-11-18 19:45:12 ~6 min ios 📱ipa 📲
0778032 #6 2023-11-18 19:55:16 ~2 min tests 📄log
ca8402f #8 2023-11-18 20:24:21 ~2 min tests 📄log
✔️ ca8402f #6 2023-11-18 20:27:17 ~5 min android 🤖apk 📲
✔️ ca8402f #6 2023-11-18 20:27:35 ~6 min android-e2e 🤖apk 📲
✔️ ca8402f #6 2023-11-18 20:33:47 ~12 min ios 📱ipa 📲
✔️ ca8402f #9 2023-11-20 13:33:40 ~11 min tests 📄log
84fe10b #10 2023-11-20 14:52:23 ~2 min tests 📄log
✔️ 84fe10b #7 2023-11-20 14:55:40 ~6 min ios 📱ipa 📲
✔️ 84fe10b #7 2023-11-20 14:55:54 ~6 min android 🤖apk 📲
✔️ 84fe10b #7 2023-11-20 14:56:41 ~7 min android-e2e 🤖apk 📲
a1f7454 #11 2023-11-21 13:20:46 ~2 min tests 📄log
✔️ a1f7454 #8 2023-11-21 13:23:53 ~5 min android-e2e 🤖apk 📲
✔️ a1f7454 #8 2023-11-21 13:24:08 ~6 min android 🤖apk 📲
✔️ a1f7454 #8 2023-11-21 13:24:27 ~6 min ios 📱ipa 📲
3edbb37 #13 2023-11-23 16:34:21 ~6 min tests 📄log
✔️ 3edbb37 #10 2023-11-23 16:36:07 ~8 min android-e2e 🤖apk 📲
✔️ 3edbb37 #10 2023-11-23 16:38:22 ~10 min android 🤖apk 📲
✔️ 3edbb37 #10 2023-11-23 16:39:22 ~11 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
e2e94e2 #14 2023-11-28 14:05:23 ~3 min tests 📄log
✔️ e2e94e2 #11 2023-11-28 14:08:58 ~7 min android-e2e 🤖apk 📲
✔️ e2e94e2 #11 2023-11-28 14:09:09 ~7 min android 🤖apk 📲
✔️ e2e94e2 #11 2023-11-28 14:18:02 ~16 min ios 📱ipa 📲
✔️ cfb224f #12 2023-11-28 15:10:07 ~6 min android-e2e 🤖apk 📲
✔️ cfb224f #12 2023-11-28 15:15:17 ~12 min android 🤖apk 📲
✔️ cfb224f #12 2023-11-28 15:15:40 ~12 min ios 📱ipa 📲
✔️ cfb224f #15 2023-11-28 15:18:39 ~15 min tests 📄log

@flexsurfer
Copy link
Member

just wondering how's it different from quo.components.dropdowns.dropdown.view

:margin-bottom gap})

(def root-container
{:width dropdown-width})
Copy link
Member

Choose a reason for hiding this comment

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

empty line

@tumanov-alex
Copy link
Contributor Author

@flexsurfer i know what you mean — the diff between this component and the original dropdown is thin, it mostly about different use cases. Nevertheless team decided that we should have a separate dropdown-input component for this particular case and that it would be better not to re-use the original dropdown.

is that correct? @mariocnovoa
cc @J-Son89

@tumanov-alex tumanov-alex force-pushed the 17727-dropdown branch 2 times, most recently from 55819f3 to e23ba5b Compare November 16, 2023 14:18
@J-Son89
Copy link
Contributor

J-Son89 commented Nov 16, 2023

Yep, we follow the hierarchy that is set in figma. Otherwise we try to get changes shoehorned into components and especially if the designs change.
This happened previously with the button and drop-down. The button component ended up with a bunch of hacks to make the drop-down ui work with it and the button was difficult to maintain/update/use.

If there is some issues with this approach it's best to discuss with designers to update their usage of the components. The less components we have to support the better 👌

@tumanov-alex
Copy link
Contributor Author

@J-Son89 initially i've had concerns about copy-pasting dropdown code (its not dry i thought) but when you consider how difficult it would be to support a component that's basically 1.5 components, you realize it's better to have two simple modules that one, but complex and bug prone.

Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

@tumanov-alex, @J-Son89, I'm not too concerned about the component duplication because the root of the problem is in the design system (on the Figma layer).

Our design system is full of "almost identical" things, full of one usage components. The dropdown is not the only one (e.g. selectors and tags components). It would be way better for maintainability, especially at MVP stage if designers (and devs in turn) judiciously applied something like the atomic design methodology.

I'm not saying we can't do anything to keep things DRY, of course we can, but I think in the end it's an uphill battle. And changing that landscape would require a complete design shift, both in mindset and in the actual components that would be built as legos.

But having said that, it's unclear to me if we shouldn't at least reuse some parts between both components. I'm approving anyway because I don't think it's worth refactoring to be more DRY if you already have something working.

@J-Son89
Copy link
Contributor

J-Son89 commented Nov 16, 2023

@tumanov-alex, @J-Son89, I'm not too concerned about the component duplication because the root of the problem is in the design system (on the Figma layer).

Our design system is full of "almost identical" things, full of one usage components. The dropdown is not the only one (e.g. selectors and tags components). It would be way better for maintainability, especially at MVP stage if designers (and devs in turn) judiciously applied something like the atomic design methodology.

I'm not saying we can't do anything to keep things DRY, of course we can, but I think in the end it's an uphill battle. And changing that landscape would require a complete design shift, both in mindset and in the actual components that would be built as legos.

But having said that, it's unclear to me if we shouldn't at least reuse some parts between both components. I'm approving anyway because I don't think it's worth refactoring to be more DRY if you already have something working.

@ilmotta, I agree. The issue is at the source (figma). Indeed it is too late to change what is already in place. We should however bring this up with designers as they go to add new components/designs. Let's raise this as a point of discussion with them as I believe browser is currently being designed.

Copy link
Contributor

@J-Son89 J-Son89 left a comment

Choose a reason for hiding this comment

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

Nice one @tumanov-alex! 🚀

[quo.foundations.colors :as colors]))

(def gap 8)
(def dropdown-width 288)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't want to set width. It's better to use flex and then we set margin on the screen where the component is being used.
Usually via a 'container-style' prop which is passed to the outer container

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you mean setting flex 1 to root-container & container, then we'll have an issue with height also being increased as component will grow. I've used width 100% combined with height 40px, if that's ok

label? true
blur? false}
:as props}
label header-label]
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason label and header label aren't passed in the map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be honest i thought we have a convention to pass such info as labels outside of maps to imitate api of core components like rn/text, where you also pass label outside of map

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah that's true, I think I had not seen any component with 2 args like this, i.e [map arg arg] but most components like button, dropdown etc take the form of [map arg].
I don't. think it matters so much, I wonder for consistency is it better to put header-label in the map instead? how does the other dropdown handle it, let's match that if it has a similar header-label?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done 👍

@@ -232,6 +233,7 @@
;;;; Dropdowns
(def dropdown quo.components.dropdowns.dropdown.view/view)
(def network-dropdown quo.components.dropdowns.network-dropdown.view/view)
(def dropdown-input quo.components.dropdowns.dropdown-input.view/view)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we keep this alpha sorted, makes this file easier to keep organised/ check what's there 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for some reason i get no error from lint about this 🤔

@ilmotta
Copy link
Contributor

ilmotta commented Nov 16, 2023

@tumanov-alex, @J-Son89, I'm not too concerned about the component duplication because the root of the problem is in the design system (on the Figma layer).
Our design system is full of "almost identical" things, full of one usage components. The dropdown is not the only one (e.g. selectors and tags components). It would be way better for maintainability, especially at MVP stage if designers (and devs in turn) judiciously applied something like the atomic design methodology.
I'm not saying we can't do anything to keep things DRY, of course we can, but I think in the end it's an uphill battle. And changing that landscape would require a complete design shift, both in mindset and in the actual components that would be built as legos.
But having said that, it's unclear to me if we shouldn't at least reuse some parts between both components. I'm approving anyway because I don't think it's worth refactoring to be more DRY if you already have something working.

@ilmotta, I agree. The issue is at the source (figma). Indeed it is too late to change what is already in place. We should however bring this up with designers as they go to add new components/designs. Let's raise this as a point of discussion with them as I believe browser is currently being designed.

Let's do it 👍🏼 The important part for me is that we (but especially designers) understand the first principles behind this problem and how they propagate to code as inefficiencies and bugs. We just need to make sure the discussion doesn't focus on only one or two particular examples, which is what usually happens.

@J-Son89
Copy link
Contributor

J-Son89 commented Nov 16, 2023

Probably it would help if some developers could review the components before they're "finalised" too

@tumanov-alex tumanov-alex force-pushed the 17727-dropdown branch 4 times, most recently from ca8402f to 84fe10b Compare November 20, 2023 14:49
Copy link
Member

@smohamedjavid smohamedjavid left a comment

Choose a reason for hiding this comment

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

Nice work! @tumanov-alex 🚀

header-label "Label"}
:as props}
label]
(let [icon-size 20
Copy link
Member

Choose a reason for hiding this comment

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

We can move this value to the properties ns/file and use it from there.

Copy link

@Francesca-G Francesca-G left a comment

Choose a reason for hiding this comment

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

Everything looks good besides the label color, please check it 🙏
here's the review

@tumanov-alex tumanov-alex merged commit a9a17aa into develop Nov 28, 2023
6 checks passed
@tumanov-alex tumanov-alex deleted the 17727-dropdown branch November 28, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Quo2 - Implement Dropdown input component
7 participants