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: browser input #16039

Closed

Conversation

BalogunofAfrica
Copy link
Contributor

@BalogunofAfrica BalogunofAfrica commented May 29, 2023

Fixes #15972

Implements the browser input component according to the designs.

The component is added to the quo preview in the profile settings.

Screenshot_20230602-003702 Screenshot_20230602-003850 Screenshot_20230602-003908

status: ready

@status-github-bot
Copy link

Hey @BalogunofAfrica, and thank you so much for making your first pull request in status-mobile! ❤️ Please help us make your experience better by filling out this brief questionnaire https://goo.gl/forms/uWqNcVpVz7OIopXg2

@status-im-auto
Copy link
Member

status-im-auto commented May 29, 2023

Jenkins Builds

Click to see older builds (16)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 07e6fd1 #1 2023-05-29 09:08:12 ~6 min android-e2e 🤖apk 📲
✔️ 07e6fd1 #1 2023-05-29 09:08:35 ~6 min android 🤖apk 📲
✔️ 07e6fd1 #1 2023-05-29 09:10:42 ~8 min tests 📄log
✔️ 07e6fd1 #1 2023-05-29 09:11:41 ~9 min ios 📱ipa 📲
e526d62 #2 2023-05-29 09:50:18 ~3 min tests 📄log
✔️ e526d62 #2 2023-05-29 09:52:35 ~6 min android-e2e 🤖apk 📲
✔️ e526d62 #2 2023-05-29 09:53:16 ~6 min ios 📱ipa 📲
✔️ e526d62 #2 2023-05-29 09:54:28 ~8 min android 🤖apk 📲
44c5e70 #3 2023-06-01 23:27:57 ~4 min tests 📄log
✔️ 44c5e70 #3 2023-06-01 23:29:39 ~5 min android 🤖apk 📲
✔️ 44c5e70 #3 2023-06-01 23:29:49 ~6 min android-e2e 🤖apk 📲
✔️ 44c5e70 #3 2023-06-01 23:30:42 ~6 min ios 📱ipa 📲
✔️ e8dac42 #4 2023-06-02 10:53:11 ~6 min android-e2e 🤖apk 📲
✔️ e8dac42 #4 2023-06-02 10:53:33 ~6 min android 🤖apk 📲
✔️ e8dac42 #4 2023-06-02 10:53:53 ~6 min ios 📱ipa 📲
✔️ e8dac42 #4 2023-06-02 10:57:48 ~10 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4721034 #5 2023-06-02 12:35:17 ~5 min android-e2e 🤖apk 📲
✔️ 4721034 #5 2023-06-02 12:35:59 ~5 min android 🤖apk 📲
✔️ 4721034 #5 2023-06-02 12:36:37 ~6 min ios 📱ipa 📲
✔️ 4721034 #5 2023-06-02 12:39:43 ~9 min tests 📄log
✔️ 74489bb #6 2023-06-05 11:28:10 ~5 min android 🤖apk 📲
✔️ 74489bb #6 2023-06-05 11:28:55 ~6 min android-e2e 🤖apk 📲
✔️ 74489bb #6 2023-06-05 11:29:34 ~6 min ios 📱ipa 📲
✔️ 74489bb #6 2023-06-05 11:31:33 ~8 min tests 📄log

@briansztamfater
Copy link
Member

Hi @BalogunofAfrica thanks for your PR! Left some minor comments but overall looks good.
Also would be good to have some screenshots on the PR description so we can get see a preview of the results.

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.

LGTM, great work and thanks @BalogunofAfrica

@BalogunofAfrica
Copy link
Contributor Author

BalogunofAfrica commented May 29, 2023

@briansztamfater Thanks for the feedback!

I've updated the PR with the requested changes and also included a screenshot.

Copy link
Contributor

@siddarthkay siddarthkay left a comment

Choose a reason for hiding this comment

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

nice job.

Copy link
Member

@flexsurfer flexsurfer left a comment

Choose a reason for hiding this comment

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

thank you for the contribution, left a few comments

set-active #(reset! state :active)
set-default #(reset! state :default)
use-value? (boolean value)]
(fn [{:keys [value disabled? blur? on-change-text customization-color
Copy link
Member

Choose a reason for hiding this comment

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

value shouldn't be used , default-value should be used instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flexsurfer the value prop is not used by default but can be used when we want to implement clearing the input

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, seen the implementation of text-input would change it to an uncontrolled input with ref to clear input when needed

Copy link
Member

Choose a reason for hiding this comment

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

still we shouldn't manage value outside, it should be default-value, and value should be used only for clear-button button but it should be managed by component itself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still we shouldn't manage value outside, it should be default-value, and value should be used only for clear-button button but it should be managed by component itself

That is from the previous commit, I have removed it in the latest push I made to this branch.

See here

Copy link
Member

Choose a reason for hiding this comment

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

i mean there should be no value in params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I get you, would make that fix now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flexsurfer Updated the PR, moved value and the clear functionality into the component.

on-clear on-focus on-blur override-theme]
:or {customization-color :blue}
:as props}]
(let [clean-props (apply dissoc props props-to-remove)]
Copy link
Member

Choose a reason for hiding this comment

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

could you please elaborate on clean-props looks strange why don't just merge them ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The clean-props consist of the props that have not been applied earlier to the text input, merging them would have overwritten the props we have used for the text input. See from line 64 as the beginning of where we pass some of these props to the text input


(defn input-container
[disabled?]
(assoc (text/text-style {:size :paragraph-1
Copy link
Member

Choose a reason for hiding this comment

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

hey @ulisesmac how is this implemented in text-input? also with text/text-style usage?

Copy link
Contributor

Choose a reason for hiding this comment

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

@flexsurfer Yes, also calling this function to get the styles

:on-change-text (fn [new-text]
(when on-change-text
(on-change-text new-text))
(reagent/flush))
Copy link
Member

Choose a reason for hiding this comment

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

could you pls elaborate on reagent/flush usage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was added to trigger an instant update of the UI with the on-change event.

I have updated the PR and removed it, it would no longer be needed as the component is an uncontrolled input now.

Copy link
Contributor

@cammellos cammellos left a comment

Choose a reason for hiding this comment

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

Hi @BalogunofAfrica , thanks for the PR.

One thing I could not see in the preview, is the state where the url is not being edited (not in focus).

With the favicon on the left (if available), and the padlock icon on the right (if ssl is used, so it should be toggled on/off), maybe I am mistaken, is that implemented (first entry in the design on figma)?

Thanks!

cammellos

This comment was marked as duplicate.

cammellos

This comment was marked as duplicate.

@BalogunofAfrica
Copy link
Contributor Author

BalogunofAfrica commented Jun 1, 2023

@flexsurfer @cammellos Thanks for the feedback!

I have updated the PR to address every point stated and also replied to the reviews.

I have also updated the screenshot

:selection-color (when platform/ios?
(cursor-color customization-color override-theme))
:style (style/input disabled?)}
(seq clean-props) (merge clean-props))]
Copy link
Member

Choose a reason for hiding this comment

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

i don't think complexity with clean-props is needed, we could just merge and override with our map

[lock-icon
{:blur? blur?
:override-theme override-theme
}])])
Copy link
Member

Choose a reason for hiding this comment

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

:override-theme override-theme}])])

set-active #(reset! state :active)
set-default #(reset! state :default)
use-value? (boolean value)]
(fn [{:keys [value disabled? blur? on-change-text customization-color
Copy link
Member

Choose a reason for hiding this comment

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

still we shouldn't manage value outside, it should be default-value, and value should be used only for clear-button button but it should be managed by component itself

@cammellos
Copy link
Contributor

Hi @BalogunofAfrica , I just spoke to @pedro-et , our lead designer, to clarify some interactions.

I have noticed that the bar/input are two separate components, but they should be one.

The effect we are looking for is similar to how Safari does it, I have attached a video to better show it

RPReplay_Final1685953709.mov

Basically, once you focus the input, it should make it editable and with the text fully selected, let me know if you have any questions, and thank you for your work!

@BalogunofAfrica
Copy link
Contributor Author

BalogunofAfrica commented Jun 5, 2023

@cammellos

Oh, I wasn't aware of that requirement. I would look into it.

@BalogunofAfrica
Copy link
Contributor Author

BalogunofAfrica commented Jun 6, 2023

@cammellos I would like to confirm if this requirement is for iOS alone or both platforms.

I ask because this particular interaction/feature of attaching input with the soft keyboard is peculiar to iOS, and not so on Android.

cc: @pedro-et

@flexsurfer
Copy link
Member

hey @BalogunofAfrica sorry for the late response, this requirement is for both platforms.

@flexsurfer
Copy link
Member

feel free to reopen

@BalogunofAfrica
Copy link
Contributor Author

@flexsurfer Re-opened in #16487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Browser input - Quo2 Component
8 participants