-
Notifications
You must be signed in to change notification settings - Fork 984
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
feat: browser input #16039
Conversation
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 |
Jenkins BuildsClick to see older builds (16)
|
Hi @BalogunofAfrica thanks for your PR! Left some minor comments but overall looks good. |
07e6fd1
to
e526d62
Compare
There was a problem hiding this 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
@briansztamfater Thanks for the feedback! I've updated the PR with the requested changes and also included a screenshot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice job.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)] |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
@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))] |
There was a problem hiding this comment.
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 | ||
}])]) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
44c5e70
to
e8dac42
Compare
e8dac42
to
4721034
Compare
4721034
to
74489bb
Compare
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.movBasically, 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! |
Oh, I wasn't aware of that requirement. I would look into it. |
@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 |
hey @BalogunofAfrica sorry for the late response, this requirement is for both platforms. |
feel free to reopen |
@flexsurfer Re-opened in #16487 |
Fixes #15972
Implements the browser input component according to the designs.
The component is added to the quo preview in the profile settings.
status: ready