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

Add contact code/topic validation #4752

Merged
merged 2 commits into from
Jul 10, 2018
Merged

Conversation

vitvly
Copy link
Contributor

@vitvly vitvly commented Jun 13, 2018

Fix #4250, #4281, #4434

This PR adds contact code/topic validation, and design changes to add contact screen and chat list. Also add contact and tab selection buttons have been updated to look according to the design.

There are some design issues:

Design links: zpl.io/2ZgvMKw, https://zpl.io/aRqj4dv

@vitvly vitvly added the desktop label Jun 13, 2018
@vitvly vitvly self-assigned this Jun 13, 2018
@vitvly vitvly changed the title [WIP] Add contact code/topic validation Add contact code/topic validation Jun 18, 2018
@vitvly vitvly requested review from rcullito, cammellos and vkjr June 18, 2018 10:54
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.

We tend to keep styling in styles.cljs files, instead of inlining, but otherwise shared codebase looks ok

(fn [topic]
(when-not (spec/valid? ::db/topic topic)
"Group topic error")))

Copy link
Contributor

Choose a reason for hiding this comment

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

extra line at the end-of-file

Copy link
Contributor

@rcullito rcullito left a comment

Choose a reason for hiding this comment

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

nice PR vitaliy! changes look good. in response to your comment about the popups not working, were you trying with the one in status-im.utils.utils or somewhere else? That one was able to work locally for me but I'm not sure if that would address your needs in this PR.

[cljs.spec.alpha :as spec]))

(re-frame/reg-sub
:new-topic-error-message
Copy link
Contributor

Choose a reason for hiding this comment

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

this is an interesting use of a subscription, to check a schema against the actual data 🤔 cool stuff!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rcullito thanks for the pointer to show-popup in utils.utils! Unfortunately this is an alert-based popup, and we'd want to have multi-item clickable popups, more like proper context menus.

(for [c contacts]
^{:key (:whisper-identity c)}
[react/touchable-highlight {:on-press #(do
(re-frame/dispatch [:set :contacts/new-identity (:whisper-identity c)])
Copy link
Contributor

Choose a reason for hiding this comment

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

might this PR also fix #4276? these remind me of the updated handlers that Andrea was mentioning.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes that's one of the handlers you can use

Copy link
Contributor

Choose a reason for hiding this comment

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

nice, thanks

@cammellos cammellos requested review from rcullito and flexsurfer June 18, 2018 11:16
@vitvly
Copy link
Contributor Author

vitvly commented Jun 18, 2018

Added separate styles ns.

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.

please use our clojure style guide , for example maps values should be aligned , etc, all styles maps should be moved to styles ns, use i18n for labels

:<- [:get :public-group-topic]
(fn [topic]
(when-not (spec/valid? ::db/topic topic)
"Group topic error")))
Copy link
Member

Choose a reason for hiding this comment

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

i18n

@@ -0,0 +1,58 @@
(ns status-im.ui.screens.desktop.main.add-new.styles)

Copy link
Member

Choose a reason for hiding this comment

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

wrong file formatting

[react/view {:style {:height 90 :margin-horizontal 16 :margin-bottom 16 :background-color :white :border-radius 12}}
;:box-shadow "0 0.5px 4.5px 0 rgba(0, 0, 0, 0.04)"}}
[react/view {:style {:flex-direction :row :margin-horizontal 16 :margin-top 16}}
contacts [:all-added-people-contacts]
Copy link
Member

Choose a reason for hiding this comment

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

wrong formatting

^{:key "newcontact"}
[react/view {:style styles/new-contact-title}
[react/text {:style styles/new-contact-title-text}
"New Chat"]]
Copy link
Member

Choose a reason for hiding this comment

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

i18n

@@ -70,4 +75,16 @@
[react/touchable-highlight {:on-press #(when-not topic-error (re-frame/dispatch [:create-new-public-chat topic]))}
[react/view {:style (merge styles/add-contact-button {:background-color (if topic-error "#eef2f5" "#4360df") })}

[react/text {:style (merge styles/add-contact-button-text {:color (if topic-error "#939ba1" :white)})} "Join public chat"]]]]]]))
[react/text {:style (merge styles/add-contact-button-text {:color (if topic-error "#939ba1" :white)})} "Join public chat"]]]]
Copy link
Contributor

Choose a reason for hiding this comment

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

topic-error here and above can be passed as an argument to style to make all color decision in styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, great point, fixed!

@churik
Copy link
Member

churik commented Jun 19, 2018

  • 1) No "#" in "Join public chat"
    expected (green) - actual (red):
    differenc
    If you start typing on the field "Join public chat" focus should appear right after "#" char.
    Now "#" is displayed only as a placeholder

  • 2) Public chats in chat lists look different in mobile and desktop versions
    mobile (green) - desktop (red):
    kdfsksdf
    Expected - like in mobile(color icons with #, but this can be subject to discuss).

  • 3) "Join public chat" or "Start chat" buttons are active after you already joined the chat
    Steps:

  • click on +

  • select "status" from list (or insert valid contact code)

  • click on + again
    Expected result: "Join public chat"( or "Start chat") button is not active
    Actual result: "Join public chat" (or "Start chat")button is active
    Video: http://take.ms/yc1g6

  • 4) Long messages/names should be displayed with ... (issue in react-native)
    long

  • 5) If time of the last message contains more 7 chars (i.e. '10:31 AM') it is overlapping with chat area
    10-23

  • 6) Chat list is unresponsive after several scrolls up/down (randomly)
    Prerequisites:
    1-1 chats, public chats are started
    Steps (not exact):

  • switch between chats

  • scroll up/down several times
    Expected result: app is always responsive
    Actual result: app is hanging
    Video: http://take.ms/ItYiT

  • 7) "No messages yet" is missing
    when chat is empty,
    expected (green) - actual (red):
    no messages

@EugeOrtiz
Copy link

EugeOrtiz commented Jun 19, 2018

@siphiuel I can still see the old styles in the latest jenkins bundle https://jenkins.status.im/job/status-react/job/desktop/job/pull-requests/job/PR-4822/11/#
Should I download it from somewhere else?

@churik
Copy link
Member

churik commented Jun 20, 2018

@EugeOrtiz yes, you should download it from particular PR build, in this case https://jenkins.status.im/job/status-react/job/desktop/job/pull-requests/view/change-requests/job/PR-4752/

@vitvly
Copy link
Contributor Author

vitvly commented Jun 20, 2018

Used labels from i18n, aligned maps properly.

@@ -26,7 +27,7 @@
[react/view {:style tabs.styles/tab-container}
(let [icon (if active? icon-active icon-inactive)]
[react/view
[icons/icon icon {:color (:color (tabs.styles/tab-icon active?))}]])
[icons/icon icon {:style {:tint-color (if active? "#4360df" "#6e777e")}}]])
Copy link
Contributor

Choose a reason for hiding this comment

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

@siphiuel, probably here we also should use colors namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vkjr I thought you wouldn't notice :) Fixed.

@@ -5,11 +5,12 @@
[clojure.string :as string]))

(defn- validate-pub-key [whisper-identity {:keys [address public-key]}]
Copy link
Member

Choose a reason for hiding this comment

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

i'm not sure about this change, how it affects mobile version

@EugeOrtiz
Copy link

EugeOrtiz commented Jun 20, 2018

List of UI/UX bug/fixes regarding this issue:

GENERAL

  • Disabled main button should not be clickable, or change color. (High prio)
  • There is an extra grey line below the input fields titles. (Mid prio)

captura de pantalla 2018-06-21 a la s 9 28 15 a m

  • Review color of “0x…” placeholder (it has low contrast now). (Mid prio)
  • Enabled main button should have a hand cursor. (Mid prio)
  • Distance between input field label and input field should be 8px. (Low prio)
  • Distance between input field and contact list title should be 32px. (Low prio)
  • Distance between contact list title and first contact avatar should be 12px. (Low prio)
  • Avatar size in contact list should be 46x46. (Low prio)

NEW 1:1 CHAT

  • Focus should be on input field when I choose “Start new chat” from + button when separate screens will be implemented. (Mid prio)

NEW PUBLIC CHAT

  • "#" symbol shouldn't disappear when I type the topic, it should be part of the topic (zpl.io/aBE71Xe) (High prio)
    • from @chu: enabled as duplicate, it was reported as (1)
  • If topic has an invalid character or capital letter, we should show an input field error explaining that there is an invalid character (zpl.io/aB5mnom, message TBD). (High prio)
  • Focus should be on input field when I choose “Join public chat” from + button when separate screens will be implemented. (Mid prio)
  • Review length of input field (it’s too long now). (Mid prio)
  • Main button needs more space to the sides (left and right padding). (Low prio)

@vitvly
Copy link
Contributor Author

vitvly commented Jul 4, 2018

@Maxris much fewer you must have meant, not much more :)

@maxhora
Copy link
Contributor

maxhora commented Jul 4, 2018

OMG, yes! :) Sorry

@vitvly vitvly force-pushed the fix/4250-add-contact-code-validation branch from 0169e29 to c15cf73 Compare July 5, 2018 10:01
@vitvly
Copy link
Contributor Author

vitvly commented Jul 5, 2018

Issues 1, 5, 8, 9 resolved.
Issue 10 - must be related to RN-desktop internals.
Issue 11 - list of default public chats has been updated in develop branch, after the recent merge of develop into desktop.

@churik
Copy link
Member

churik commented Jul 5, 2018

diff_2

So, only 2 small things and I'll move it to ready!

Vitaliy Vlasov added 2 commits July 9, 2018 15:18
Some styling changes

Add topic validation

Wrap add-contact screen into scroll-view

Improve chat list according to design

Add color to tab icons

Add color to add-contact icon

Missing paren added

Add background color to inputs in add-new screen

Fix timestamp styling

Remove extra empty line

Move styles to separate ns

Add styles for New Contact screen

Add selected topics; improve chat item display

Use colors from colors ns; style fns

Fix formatting, add styles

Use colors ns for tab selection buttons

Use setNativeProps to force hash as first symbol in topic name

Add :no-messages-yet label

Alignment fixes in chat list

Add timestamp style, disable 'add chat' buttons if no valid data

Use color from chat-item map

Formatting

Use generic default-public-chats value

Use proper last-message timestamp

Fix '#' placeholder issues in public chat name field

Fix timestamp sizing in chat list

Add unviewed messages indicator

Use proper chat name

Fix double hash in public chat name

Fix separator margin
@vitvly vitvly force-pushed the fix/4250-add-contact-code-validation branch from 571985e to 9af908b Compare July 9, 2018 13:48
@vitvly
Copy link
Contributor Author

vitvly commented Jul 9, 2018

Issues 5 and 14 are related to #5104

@vitvly
Copy link
Contributor Author

vitvly commented Jul 9, 2018

Item 12 and corresponding issue #5070 fixed

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

Successfully merging this pull request may close these issues.

9 participants