Skip to content

Conversation

@Abijeet
Copy link
Member

@Abijeet Abijeet commented Jan 11, 2018

Greetings,

I've made the following changes in the comments section,

  1. Increased the size of the delete button to take up 44x44px.
  2. Now showing the delete button at all times when editing to avoid usability issues with touch screens.
  3. Edit icon is also shown only at all times, rather than only on hover, which fixes usability issues.
  4. Edit icon has been made 44x44px.
  5. Submit icon has been made 44x44px.
  6. Fixed div being added placed directly under ul during editing of comments.
  7. Saving a non-modified comment now reverts the edit window.
  8. Reduced the gap between comments a wee bit.
  9. Fixed issues with focus event now working properly for edit and delete.

Please let me know if any modifications need to be made.

Images

Comment section

screenshot-2018-1-12 files - nextcloud 1

Editing a comment

screenshot-2018-1-12 files - nextcloud

Closes #7281

Signed-off-by: Abijeet abijeetpatro@gmail.com

/cc @nextcloud/designers

@Abijeet
Copy link
Member Author

Abijeet commented Jan 11, 2018

Also, while checking the code I could not find why we needed this - _onClickComment -

_onClickComment: function(ev) {
var $row = $(ev.target);
if (!$row.is('.comment')) {
$row = $row.closest('.comment');
}
$row.removeClass('collapsed');
},

@MorrisJobke MorrisJobke added design Design, UI, UX, etc. 3. to review Waiting for reviews labels Jan 11, 2018
@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Jan 11, 2018
@codecov
Copy link

codecov bot commented Jan 11, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@fa09e0e). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #7800   +/-   ##
=========================================
  Coverage          ?   53.58%           
  Complexity        ?    23981           
=========================================
  Files             ?     1442           
  Lines             ?    80300           
  Branches          ?        0           
=========================================
  Hits              ?    43028           
  Misses            ?    37272           
  Partials          ?        0

@danxuliu
Copy link
Member

why we needed this - _onClickComment -

Long messages are initially created with the collapsed CSS class, which sets a maximum size for the comment and fades its contents; clicking on the comment removes the collapsed class and fully shows it (or at least it should, I have not checked it ;-) ).

@Abijeet
Copy link
Member Author

Abijeet commented Jan 12, 2018

@danxuliu - Thanks, it does work as intended.

@Abijeet Abijeet changed the title Fixes the usability issues with the comment section delete and edit, Fixes the usability issues with the comment section delete and edit Jan 15, 2018
@rullzer
Copy link
Member

rullzer commented Jan 17, 2018

Summoning reviewers :)

@blizzz
Copy link
Member

blizzz commented Jan 17, 2018

Would be happy to have feedback from the design team

@pixelipo
Copy link
Contributor

it would be much easier to review if the source branch would be in nextcloud/server

Copy link
Contributor

@pixelipo pixelipo left a comment

Choose a reason for hiding this comment

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

  1. tooltip is now too high:
    image
  2. Delete icon seems to jump around: before hover:
    image
    after hover:
    image
  3. I find this to be a big pile of mess:
    image
  • why are these 3 actions placed in a column instead of inline, like everywhere else in NC?
  • if the should stay vertical, why are they not vertically aligned?
  • why is cancel not an icon, too? "x" is the classic solution used across NC apps


#commentsTabView .newCommentForm .message {
width: calc(100% - 81px); /* 36 (left margin) + 30 (right padding) + 15 (right padding of surrounding box) */
width: calc(100% - 88px);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Abijeet can you please leave a comment regarding where this number comes from?

#commentsTabView .newCommentForm .message {
width: calc(100% - 81px); /* 36 (left margin) + 30 (right padding) + 15 (right padding of surrounding box) */
width: calc(100% - 88px);
margin-left: 36px;
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, it's the parent div (newCommentForm) that should be moved 36px to the left

Copy link
Contributor

Choose a reason for hiding this comment

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

If you make this margin 1 or 2 px smaller, then the .submit icon can fit without any absolute positioning

width: calc(100% - 88px);
margin-left: 36px;
padding-right: 30px;
display: block;
Copy link
Contributor

Choose a reason for hiding this comment

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

should be inline-block

}

#commentsTabView .newCommentForm .submit {
position: absolute;
Copy link
Contributor

Choose a reason for hiding this comment

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

lines 27-30 unnecessary (see my comments above)

#commentsTabView .comment {
position: relative;
margin-bottom: 30px;
margin-bottom: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: add something like border-top: 1px solid $color-border; to have a better separation. In fact, if you add that, it becomes obvious that this line should really be padding: 10px 0;.

I also noticed that the .comment class is applied twice - once to the div.newCommentRow element and then again to it's li.comment children. This doesn't sound right....
image

Copy link
Member

Choose a reason for hiding this comment

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

I also noticed that the .comment class is applied twice - once to the div.newCommentRow element and then again to it's li.comment children. This doesn't sound right....

In your screenshot the li is not a child of the div; the li is a child of the ul, which is a sibling of the div. If I am not mistaken the .comment class is fine that way, as it is applied to each comment in the list, and also to the "New comment" area.

@danxuliu
Copy link
Member

@pixelipo

  • why are these 3 actions placed in a column instead of inline, like everywhere else in NC?
  • if the should stay vertical, why are they not vertically aligned?
  • why is cancel not an icon, too? "x" is the classic solution used across NC apps

I guess that the answer to those three questions is "because it was already that way before this pull request" ;-)

Having said that, yes, I too think that those buttons could be improved. Maybe something like what @jancborchardt said would be good enough:

Maybe it makes more sense to put the cancel button above, in the same line as the avatar / delete button for uniformity.

More specifically, I would replace the Edit button by the Cancel button with the classic "x". I think that makes sense from a behavioural point of view (same place for enter edition and exit edition), and this way it would be far enough from the delete button too to press it by mistake (although the delete button would still be near the confirm button...).

@Abijeet
Copy link
Member Author

Abijeet commented Jan 17, 2018

@pixelipo - Thanks for the review on this one, I should have been a little more careful and thorough with my changes. I was unsure of making too many modifications.

it would be much easier to review if the source branch would be in nextcloud/server

Will do this from next time onwards. I'll also take care of the comments you've left on the code.

Regarding re-adjusting the layout, what do you guys think of the following that I made after reviewing comments left by @jancborchardt and @danxuliu ,

comments changes

@danxuliu
Copy link
Member

@Abijeet Thanks a lot for taking care of all this! :-)

Just a little note (for the future ;-) ) regarding the commits. When possible please try to use different commits for changes not related between them (for example, increasing the touch area of the icons and exiting the edition mode when saving a comment that was not modified). This makes easier to review the commits before merging them and, maybe more important, in some time in the future when someone needs to understand the code and how it evolved ;-) But do not worry too much about that; it is just one of my little nitpicks, most people do not seem to care about those things :-P

Regarding re-adjusting the layout, what do you guys think of the following that I made

I would not change the send button in order to keep a consistent UI between sending a new comment and editing an existing one.

I was thinking on something like this instead:
comment-edit-delete-icon

However I have no special preference for that approach; it is just an additional idea.

By the way, regarding

Delete icon seems to jump around

I have noticed that in Firefox, although it seems to be working fine in Chromium. I do not know if there is something wrong with the CSS or if it is a browser bug.

@Abijeet
Copy link
Member Author

Abijeet commented Jan 18, 2018

Hi @danxuliu and @pixelipo, I've been a little more thorough with my changes this time and have taken some liberties. Here's a full set of issues that have been fixed,

  1. Increased the size of the delete, edit, close and submit buttons to take up 44x44px.
  2. Now showing the delete button at all times when editing to avoid usability issues with touch screens.
  3. Edit icon is also shown at all times, rather than only on hover.
  4. Reduced the gap between comments a wee bit.
  5. Fixed issues with focus event now working properly for edit and delete.
  6. Removed absolute positioning of elements for alignment.
  7. Fixed issue with tooltips becoming too high due to padding around actions. Occurred due to my changes.
  8. Changed the position of the submit and close icons.
  9. Fixed issue with jumping of the delete icon in Firefox. Occurred due to my changes.
  10. Fixed issue with wrapping of content due to long author names. Occurred due to my changes.
  11. Fixed issue with longer comments not appearing properly. This might have occurred due to my changes.
  12. Converts the .css file to .scss file, and adds border-top to comments.
  13. Fixes div being directly under ul during editing of comments.
  14. Fixes issue where saving a non-modified comment kept the edit window open.

Tests

  • I've tested to ensure that the loading symbols appear properly.
  • I've tested to ensure that comments look fine with longer author names.

Response to comments

Just a little note (for the future ;-) ) regarding the commits. When possible please try to use different commits for changes not related between them (for example, increasing the touch area of the icons and exiting the edition mode when saving a comment that was not modified).

I've undone my previous commits and tried to do this as much as I could for this pull request, but I'll be more careful from next time on wards.

  • why are these 3 actions placed in a column instead of inline, like everywhere else in NC?
  • if the should stay vertical, why are they not vertically aligned?
  • why is cancel not an icon, too? "x" is the classic solution used across NC apps

This has been changed. Please check the images below.

@Abijeet can you please leave a comment regarding where this number comes from?

Added comments

IMO, it's the parent div (newCommentForm) that should be moved 36px to the left

Done.

If you make this margin 1 or 2 px smaller, then the .submit icon can fit without any absolute positioning
should be inline-block
lines 27-30 unnecessary (see my comments above)

Removed and implemented without absolute positioning.

suggestion: add something like border-top: 1px solid $color-border; to have a better separation. In fact, if you add that, it becomes obvious that this line should really be padding: 10px 0;.

Changed to use padding. Added border-top but not for the new comment. Please check screenshot.

Please let me know if there are any other changes, or anything else is not up-to the mark.

Screenshots

Normal mode

screenshot-2018-1-19 files - nextcloud 1

Edit mode

screenshot-2018-1-19 files - nextcloud 2

Long usernames

screenshot-2018-1-19 files - nextcloud 3

@Abijeet Abijeet requested a review from pixelipo January 19, 2018 21:45
@jancborchardt
Copy link
Member

There are 3 icons without label, and especially the x and delete next to each other are confusing. Hence I'd put the Cancel and Delete into a 3-dot-menu, with labels.

Otherwise great! :)

@pixelipo
Copy link
Contributor

Cancel shouldn't be hidden behind a 3-dot IMO because it's non-destructive, a default "get me out of here" action and should be the alternative to a simple "ESC" keyboard button action.

On the other hand, delete button should not be visible while editing a comment. Instead it should be on the same level as the Edit button

@Abijeet
Copy link
Member Author

Abijeet commented Jan 23, 2018

@jancborchardt - I agree with @pixelipo, I don't think the cancel button should go under a dropdown. Not sure where to put the delete button though, next to the edit?

Would what @danxuliu suggested make more sense?

comment-edit-delete-icon

@juliusknorr
Copy link
Member

I see no real need for the delete button while editing the text. How about adding a 3-dots-menu for the default view and add edit/delete to it. On the editing view we could just show the submit/cancel buttons then.

@Abijeet Abijeet self-assigned this Jan 23, 2018
@Abijeet
Copy link
Member Author

Abijeet commented Jan 23, 2018

I like the approach suggested by @juliushaertl, I'll go ahead with that.

@Abijeet
Copy link
Member Author

Abijeet commented Feb 3, 2018

Hey all,

I've made the changes. I've added a new View that is the dropdown for the edit and delete options under a menu.

I've slight reservations about the code here. I figured keeping it simple and the modification to the minimum was the right way to go about it.

Please let me know if you'd like me to change that or anything else.

cc @nextcloud/designers

Screenshots

Dropdown visible

comment-open-menu

Dropdown in case of large username

comment-menu-open-right

Editing a comment

comment-edit

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Mar 18, 2018
@skjnldsv
Copy link
Member

skjnldsv commented Mar 18, 2018

JSunit test are failing @Abijeet :)
Still a bit work to do ;)

https://drone.nextcloud.com/nextcloud/server/5701/215

@Abijeet
Copy link
Member Author

Abijeet commented Mar 18, 2018

Thank you @skjnldsv. Sorry, I should have checked rather than assuming their failure was unrelated. Unfortunately it is the end of Sunday already. I will review and fix these this week.

@Abijeet
Copy link
Member Author

Abijeet commented Mar 25, 2018

I think I've fixed the issues with the comments related test cases failing. Going to close and reopen the issue to force the test cases to run again.

@Abijeet Abijeet closed this Mar 25, 2018
@Abijeet Abijeet reopened this Mar 25, 2018
@Abijeet
Copy link
Member Author

Abijeet commented Mar 25, 2018

Hmph, the reopening did not retrigger the CI. @skjnldsv - Any ideas on how to proceed from here? It seems that the docker connection failed.

@skjnldsv
Copy link
Member

@Abijeet you need to rebase to master and force push your work :)

Abijeet added 9 commits March 27, 2018 00:49
…open.

Now irrespective of the whether the comment has been modified we are going to go back to the view mode.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
…ents.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
1. Increased the size of the delete, edit, close and submit buttons to take up 44x44px.
2. Now showing the delete button at all times when editing to avoid usability issues with touch screens.
3. Edit icon is also shown at all times, rather than only on hover.
4. Reduced the gap between comments a wee bit.
5. Fixed issues with focus event now working properly for edit and delete.
6. Removed absolute positioning of elements for alignment.
7. Fixed issue with tooltips becoming too high due to padding around actions. Occurred due to my changes.
8. Changed the position of the submit and close icons.
9. Fixed issue with jumping of the delete icon in Firefox. Occurred due to my changes.
10. Fixed issue with wrapping of content due to long author names. Occurred due to my changes.
11. Fixed issue with longer comments not appearing properly. This might have occurred due to my changes.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Fixes #7281

- Added a new View to render the dropdown.
- Modified the existing code.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Towards #7281

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Towards #7281

Also hiding the menu before triggering click action.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Also fixes scrutinizer warnings.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
@Abijeet
Copy link
Member Author

Abijeet commented Mar 27, 2018

@skjnldsv - Done, but that doesn't seem to have helped.

@skjnldsv
Copy link
Member

@Abijeet yes it did, but our drone have a little issue! :)
We'll restart it today ;)

@Abijeet Abijeet added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 28, 2018
@Abijeet
Copy link
Member Author

Abijeet commented Apr 2, 2018

@skjnldsv - How do I get the CI to trigger again?

@skjnldsv
Copy link
Member

skjnldsv commented Apr 2, 2018

@skjnldsv - How do I get the CI to trigger again?

Login on drone, right menu, restart.
I just restarted it! :) https://drone.nextcloud.com/nextcloud/server/6234

@MorrisJobke
Copy link
Member

@skjnldsv - How do I get the CI to trigger again?
Login on drone, right menu, restart.
I just restarted it! :) https://drone.nextcloud.com/nextcloud/server/6234

Failures are unrelated.

display: block;
/* width = 100% - (width of submit button (44px) + margin (3px) + inline-block gap) */
width: calc(100% - 52px);
display: inline-block;
Copy link
Member

Choose a reason for hiding this comment

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

This causes the empty input to have a too big cursor in Safari:

bildschirmfoto 2018-04-03 um 17 47 53

See also this thread https://stackoverflow.com/a/9132362

I could also not figure out how to enforce this without the display: block;, font-size, line-heightand height all didn't worked out :/

Copy link
Member

Choose a reason for hiding this comment

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

Once the first character is typed all is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

@MorrisJobke - I'll check this over the weekend.

Copy link
Member

Choose a reason for hiding this comment

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

Merged this and we should fix this little issue in #9150

Copy link
Member Author

Choose a reason for hiding this comment

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

Got a new laptop and was setting it up. :) This kind of took a back seat.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Beside my little problem it looks good 👍 Would be still nice to get this resolved as well before we merge this.

@MorrisJobke MorrisJobke merged commit a18a853 into nextcloud:master Apr 11, 2018
@Abijeet Abijeet deleted the bug-7281 branch April 14, 2018 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews design Design, UI, UX, etc. enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some issues with cancel button and delete icon when comments are edited

10 participants