Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Improve working-set context menu UI/UX #6107

Merged
merged 8 commits into from
Mar 5, 2014

Conversation

artoale
Copy link
Contributor

@artoale artoale commented Nov 25, 2013

This commit refers to issue #6012
It rearrange items whitin the working sets and move all those related
to "sorting" to a new drop down menu accessible through a new cog
button in the working set header

@artoale
Copy link
Contributor Author

artoale commented Nov 25, 2013

@cocoa-coder, what do you think? I've used the cog, as suggested by @larz0 and a position absolute pushed to the right to have a consistent UI when the bar is resized and small...seems reasonable?
Let me know

@artoale
Copy link
Contributor Author

artoale commented Nov 25, 2013

A couple of screenshot to show the UI
Note: the hovered cog icon has the same "silent" styling as the recent-project drop-down button
schermata 2013-11-25 alle 21 49 04
schermata 2013-11-25 alle 23 25 35

@larz0
Copy link
Member

larz0 commented Nov 25, 2013

Wow nice. Could you try and make the cog smaller (try 13px) so that it's not larger than the "Working Files" text. Hope that makes sense. Thanks @artoale ~

@artoale
Copy link
Contributor Author

artoale commented Nov 25, 2013

Here we go :)

border: 1px solid transparent;
padding: 4px 6px;
.sprite-icon(0, 0, 13px, 13px, "images/topcoat-settings-13.svg");
background-position:center;

Choose a reason for hiding this comment

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

opacity: 0.8;

@artoale
Copy link
Contributor Author

artoale commented Nov 25, 2013

@cocoa-coder thanks for the comments! I've just pushed the updated code...since I'm not particularly good in UI/design/CSS any correction is much appreciated!

@MentalGear
Copy link

Looking good !

  • Only the icon needs to be aligned with the Working Files text.
  • Also I would change opacity when hovered/active vs. normal.
  • I think the context menu should have an arrow, else it seems too much disconnected
  • As I suggested earlier, the 3 line menu icon might be a better fit. At least I do see a cog for deeper settings then ordering. Also it's more subtile.

I do the CSS corrections myself in a few hours (once I am free).
Good Job ! Glad you joined to help ! :)

Btw: Can you explain what you mean with: silent styling as the recent-project drop-down button ?

@artoale
Copy link
Contributor Author

artoale commented Nov 25, 2013

"silent" was intended to mean "quiet" in topcoat terminology (there's no
border until the item is hovered)
For the icon alignment, if you can help me a little on that would be great
:)
Opacity is done as said :)
For the arrow and icon element, I did it like this because one of last
comment of @larz0 on issue #6012 (which, for some reason, I cannot open
anymore, I get a 404). I personally don't like the arrow much, mostly
because it breaks the look&feel across the app (no arrow anywhere), but
that's just my idea, we can add it if required! For the cog/hamburger
icon...well, the latter is typically used for app-wise menus and this one
is not...but again, small work to change it if we want!

2013/11/26 Cocoa-Coder notifications@github.com

Looking good !

  • Only the icon needs to be aligned with the Working Files text.
  • Also I would change opacity when hovered/active vs. normal.
  • I think the context menu should have an arrow, else it seems too
    much deconnected
  • As I suggested earlier, the 3 line menu icon might be a better fit.
    At least I do see a cog for deeper settings then ordering. Also it's more
    subtile.

I do the CSS corrections myself in a few hours (once I am free).
Good Job ! Glad you joined to help ! :)

Btw: Can you explain what you mean with: silent styling as the
recent-project drop-down button ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107#issuecomment-29252599
.

Alessandro Artoni

artoale.com

#working-set-option-btn {
position: absolute;
right: 4px;
top: 2px;
Copy link
Member

Choose a reason for hiding this comment

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

Let's change this to 7px so it lines up with the text on the left.

@artoale
Copy link
Contributor Author

artoale commented Nov 26, 2013

Thanks, I'll fix these as soon as I get home

@ghost ghost assigned JeffryBooher Nov 26, 2013
@pthiess
Copy link
Contributor

pthiess commented Nov 26, 2013

@JeffryBooher to track

@peterflynn
Copy link
Member

Re #6012 disappearing: I have no idea what happened to it either, so fwiw I've pinged GitHub support. Once or twice in the past we've hit some sort of "stale cache" GH bug that lead to missing query results, but this seems different...

working_set_settings_cmenu.open({
pageX: buttonOffset.left,
pageY: buttonOffset.top + buttonHeight
});
Copy link
Member

Choose a reason for hiding this comment

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

This is an interesting way to do it -- totally different from the Recent Projects dropdown, but it actually seems cleaner. I think when @njx wrote the Recent Projects dropdown we didn't even have a context menu API yet, so that may be the only reason it doesn't also use this approach... But we should probably test a little to make sure the behavior is consistent since they are presented so similarly in the UI.

Copy link
Contributor

Choose a reason for hiding this comment

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

This could easily become a context menu utility function where you just pass a menu and a dom query string and it can handle the rest for any menu that opens under a button/element. So the same implementation could be used for the Recent Projects menu.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not convinced: of course, having a shared implementation would be much better, but the change @TomMalbran is proposing may not be sufficient. The Recent Project plugin offer a "close" button that doesn't close the menu and, of course, remove the project. I don't think this kind of feature is general enough to be implemented directly in the ContextMenu, but we should come up with a redefined API (which would involve Menu too)

Copy link
Contributor

Choose a reason for hiding this comment

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

That close button is to remove the projects from the menu, and not to close the menu, so it is a particular feature of the Recent projects menu, which doesn't even need to work with this code, and should stay where is implemented. This would be just to open and close both menus when clicking on the button/link.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course... What I'm saying is that the Recent Project menu cannot be
refactored to use Context Menu with this feature only
On Nov 28, 2013 8:17 PM, "Tomás Malbrán" notifications@github.com wrote:

In src/command/DefaultMenus.js:

  •     */
    
  •    $("#working-set-option-btn").on("click", function (e) {
    
  •        var buttonOffset,
    
  •            buttonHeight;
    
  •        e.stopPropagation();
    
  •        if (working_set_settings_cmenu.isOpen()) {
    
  •            working_set_settings_cmenu.close();
    
  •        } else {
    
  •            buttonOffset = $(this).offset();
    
  •            buttonHeight = $(this).outerHeight();
    
  •            working_set_settings_cmenu.open({
    
  •                pageX: buttonOffset.left,
    
  •                pageY: buttonOffset.top + buttonHeight
    
  •            });
    

That close button is to remove the projects from the menu, and not to
close the menu, so it is a particular feature of the Recent projects menu,
which doesn't even need to work with this code, and should stay where is
implemented. This would be just to open and close both menus when clicking
on the button/link.


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107/files#r7991026
.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am referring just to refactor, the open/close action when clicking on the project title.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, but how can we refactor the Recent Project menu to use a shared
implementation if the implementation is inside Context Menu, which is not
used by the extension itself? Sorry, I'm probably missing something :-)
On Nov 28, 2013 8:27 PM, "Tomás Malbrán" notifications@github.com wrote:

In src/command/DefaultMenus.js:

  •     */
    
  •    $("#working-set-option-btn").on("click", function (e) {
    
  •        var buttonOffset,
    
  •            buttonHeight;
    
  •        e.stopPropagation();
    
  •        if (working_set_settings_cmenu.isOpen()) {
    
  •            working_set_settings_cmenu.close();
    
  •        } else {
    
  •            buttonOffset = $(this).offset();
    
  •            buttonHeight = $(this).outerHeight();
    
  •            working_set_settings_cmenu.open({
    
  •                pageX: buttonOffset.left,
    
  •                pageY: buttonOffset.top + buttonHeight
    
  •            });
    

I am referring just to refactor, the open/close action when clicking on
the project title.


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107/files#r7991133
.

Copy link
Contributor

Choose a reason for hiding this comment

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

The utility function would be moved to the Menus file and made as a function that it exports. Then from the Default Menus and from the Recent Projects main file, that function can be called through the Menu module to create the required on click event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm... Ok, I read "context menu" and got stuck with that idea :-) as soon
as I get back to my pc I'll try to refactor it out :-)
On Nov 28, 2013 8:44 PM, "Tomás Malbrán" notifications@github.com wrote:

In src/command/DefaultMenus.js:

  •     */
    
  •    $("#working-set-option-btn").on("click", function (e) {
    
  •        var buttonOffset,
    
  •            buttonHeight;
    
  •        e.stopPropagation();
    
  •        if (working_set_settings_cmenu.isOpen()) {
    
  •            working_set_settings_cmenu.close();
    
  •        } else {
    
  •            buttonOffset = $(this).offset();
    
  •            buttonHeight = $(this).outerHeight();
    
  •            working_set_settings_cmenu.open({
    
  •                pageX: buttonOffset.left,
    
  •                pageY: buttonOffset.top + buttonHeight
    
  •            });
    

The utility function would be moved to the Menus file and made as a
function that it exports. Then from the Default Menus and from the Recent
Projects main file, that function can be called through the Menu module to
create the required on click event.


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107/files#r7991328
.

@artoale
Copy link
Contributor Author

artoale commented Nov 27, 2013

@peterflynn, I've added tests for the new ContextMenu.prototype.isOpen method, but I'm quite sure you mean to test something else too...can you please specify what (and, if possible, in which spec file I should put them?)
Cheers

@peterflynn
Copy link
Member

@artoale I meant more hand-testing the UI to make sure the behavior of Recent Projects vs. this new dropdown don't feel too inconsistent with each other. Given that the implementations are very different, there could easily be some subtle differences in behavior. As long as they're subtle that seems ok.

I would look at things like the rollover state and popup styling, how they behave as the sidebar is resized smaller, which actions close vs. don't close the popup, how the menu items are styled and formatted (including on rollover), etc.

One difference worth noting: I know a bunch of work went into making the Recent Projects dropdown keyboard-accessible. But most of our other popup menus are not keyboard-accessible (in fact they generally don't even take focus), so I wouldn't worry about replicating that behavior here...

@artoale
Copy link
Contributor Author

artoale commented Nov 28, 2013

Definitely make sense... I'll try to test this as much as I can and
fix/discuss/document eventual inconsistence.
Cheers
On Nov 28, 2013 1:11 AM, "Peter Flynn" notifications@github.com wrote:

@artoale https://github.com/artoale I meant more hand-testing the UI to
make sure the behavior of Recent Projects vs. this new dropdown don't feel
too inconsistent with each other. Given that the implementations are very
different, there could easily be some subtle differences in behavior. As
long as they're subtle that seems ok.

I would look at things like the rollover state and popup styling, how they
behave as the sidebar is resized smaller, which actions close vs. don't
close the popup, how the menu items are styled and formatted (including on
rollover), etc.

One difference worth noting: I know a bunch of work went into making the
Recent Projects dropdown keyboard-accessible. But most of our other popup
menus are not keyboard-accessible (in fact they generally don't even
take focus), so I wouldn't worry about replicating that behavior here...


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107#issuecomment-29430721
.

@peterflynn
Copy link
Member

No need to go overboard with the fixes, it's just a good idea to test and make note of anything... if it's just little things they probably don't need to get addressed yet.

@artoale
Copy link
Contributor Author

artoale commented Nov 28, 2013

Even better :-)
On Nov 28, 2013 1:19 AM, "Peter Flynn" notifications@github.com wrote:

No need to go overboard with the fixes, it's just a good idea to test and
make note of anything... if it's just little things they probably don't
need to get addressed yet.


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107#issuecomment-29431073
.

@artoale
Copy link
Contributor Author

artoale commented Nov 28, 2013

I've testing this feature for a while...and it seems to me that the only behavioral difference w.r.t the Recent Project extension is the key binding behavior. The context menu doesn't get focus therefore it's not keyboard-accessible.

Apart from that, they both close much on every click (with a small exception being that the X for closing a recent project doesn't close the dropdown. Moreover, they both close when ESC is pressed.

@MentalGear
Copy link

Some people expressed reservations about the new "Arrange Menu" because it would be a different style than the "Recent Projects" Menu.

So for standardizing menus, here's a version of the recent files menu, with the new style applied.
newrecentfiles
Other visual "connections" between icon and menu are also possible as seen in #6012 (comment)

But I have to say, imo, no matter which one you favor, there should be a connection. ( or it may look like a context menu from windows 98 )

@artoale
Copy link
Contributor Author

artoale commented Nov 29, 2013

In my opinion the triangle is very oldish, while the plain dropdown is much
cleaner... I kinda like the second version you proposed (second on the left
in the big screenshot) but, to be completely honest...I don't see what's
wrong with the no-triangle no-anything-else that we have now... Again,
that's only my vision and I'm definitely not strong with that :-)
For the recent project style consistency, well... It looks fine... But at
the same time the current UI seems more logical: in recent project we want
to "change" the project itself, not configure something... So it make sense
for the project name to be the button. Is it this bad for the UI to be
different? They target different kind of action and as long as the look and
feel is still maintained I think we don't need to make them identical.
That said, let me know what to do with the PR... Should I try to modify the
Recent Project according to @cocoa-coder mockup? Add the triangle?
Something else :-)
On Nov 29, 2013 12:19 AM, "Cocoa-Coder" notifications@github.com wrote:

Some people expressed reservations about the new "Arrange Menu" because it
would be a different style than the "Recent Projects" Menu.
So for standardizing menus, here's a version of the recent files menu,
with the new style applied.
[image: recent-files]https://f.cloud.github.com/assets/2837147/1641892/eaf44fd0-5868-11e3-9ab7-e9019d3ee74c.png

Other visual "connections" between icon and menu are also possible as seen
in #6012 (comment)#6012 (comment)

But I have to say, imo, no matter which one you favor, there should be a
connection. ( or it may look like a context menu from windows 98 )


Reply to this email directly or view it on GitHubhttps://github.com//pull/6107#issuecomment-29489038
.

@larz0
Copy link
Member

larz0 commented Nov 29, 2013

@cocoa-coder we don't use triangles for drop-down menus but we do use it for popovers and tooltips. I don't think we need to change how recent project drop-down works because it's more elegant right now.

@artoale
Copy link
Contributor Author

artoale commented Dec 2, 2013

@TomMalbran, just to be sure I've got what you meant :) 8eb67f4 is a super-basic refactoring of the event handling registration. Does it look reasonable?

@TomMalbran
Copy link
Contributor

@artoale Yes, something as simple as that is what I was thinking about. We could then see if that new function works for the Recent Projects menu.

@artoale
Copy link
Contributor Author

artoale commented Dec 2, 2013

I was considering this more in details...well, it's not super straightforward: I think that, if we really want to refactor the recent project plugin to use this helper, we should consider a more in depth refactoring because:

  1. Context menu are shown/hidden while recent project menu gets destroyed/recreated every time (this implies that, in the current code, there's quite some code for registering/deregistering event handlers)
  2. The currently, the whole open/close logic for Context Menus is handled by context menu specific method and scenarios (e.g., in Menu.js, the closeAll method removes the "open" class for every ".dropdown" elements - which depends on ContextMenu template and is not compatible with the Recent Project template. (which, besides, has still to register different event listener)

long story short...it seems to me that refactoring Recent Project with this simple function creates more confusion and doesn't actually reduce code duplication: it requires in fact an adapter that provides a ContextMenu-compatible interface for RecentProject and we should still do a lot of manual event handling registration/registration. Moreover, since we don' t share neither the markup nor the hide/show logic, it will all results in a hackish solution rather than a more clean code.

@TomMalbran
Copy link
Contributor

I am not talking about refactoring the entire code in the Recent Projects initialization, just use this function for the part that creates the menu and places it under the project name.

@artoale
Copy link
Contributor Author

artoale commented Dec 2, 2013

Yes, I know...what I'm saying is that, by trying to do that, it looks more like a hack than a good reuse practice :) I' push soon a basic implementation and let you see what I mean :)

@artoale
Copy link
Contributor Author

artoale commented Dec 12, 2013

ping :)

@TomMalbran
Copy link
Contributor

Oh, sorry. We don't get mails when a new commit is done, so is better to add a reply after you add a comit and want feedback.

That looks great, and was what I thought that we could refactor, just the opening and cloing using the mouse. If we find other stuff later that both codes share, we can refactor those later too.

@artoale
Copy link
Contributor Author

artoale commented Dec 12, 2013

Here we go :)

@artoale
Copy link
Contributor Author

artoale commented Feb 6, 2014

ping!

@JeffryBooher
Copy link
Contributor

@artoale can you merge master into this branch so I can look at this and merge it this week? Thanks!

@artoale
Copy link
Contributor Author

artoale commented Feb 28, 2014

Yup, sure! I'll try to rebase it tomorrow night! @peterflynn, do you need it to be squashed too?

@JeffryBooher
Copy link
Contributor

@artoale you can squash if you want but we don't require external contributors to squash.

@artoale
Copy link
Contributor Author

artoale commented Mar 1, 2014

@JeffryBooher , just completed the rebase...sry, but I didn't have time before now...cheers!

@JeffryBooher
Copy link
Contributor

Looks good...merging

JeffryBooher added a commit that referenced this pull request Mar 5, 2014
Improve working-set context menu UI/UX
@JeffryBooher JeffryBooher merged commit c59c542 into adobe:master Mar 5, 2014
@artoale
Copy link
Contributor Author

artoale commented Mar 5, 2014

🍻 Cheers!

@larz0
Copy link
Member

larz0 commented Mar 5, 2014

barney-yes

ingorichter added a commit that referenced this pull request Mar 5, 2014
@@ -1036,6 +1054,25 @@ define(function (require, exports, module) {
$menus = testWindow.$(".dropdown.open");
expect($menus.length).toBe(0);
});

it("check for context menu to have the right status", function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as previous nit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants