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

[4.0] Sidebar - switch to vertical collapsing #22587

Merged
merged 26 commits into from
Oct 18, 2018
Merged

Conversation

ciar4n
Copy link
Contributor

@ciar4n ciar4n commented Oct 11, 2018

Pull Request for Issue # .

Summary of Changes

Redesign of the sidebar with vertically collapsing/expanding menu.

Testing instructions

Can't be tested with patchtester.

sidebar2

Documentation Changes Required

opacity: 1 !important;
}

}

Choose a reason for hiding this comment

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

Files should end with a trailing newline

visibility: visible !important;
opacity: 1 !important;
}

Choose a reason for hiding this comment

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

Line contains trailing whitespace

transition-delay: 0s !important;
.sidebar-item-title,
.has-arrow::after {
display: none

Choose a reason for hiding this comment

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

Declaration should be terminated by a semicolon

visibility: hidden;
transition-delay: 0s !important;
.sidebar-item-title,
.has-arrow::after {

Choose a reason for hiding this comment

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

Opening curly brace { should be preceded by one space

transform: rotate(-135deg) translate(0, -50%);
}
}

Choose a reason for hiding this comment

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

Line contains trailing whitespace

cursor: text;
background: none;
a {
padding: 4px 5px 4px 2px;

Choose a reason for hiding this comment

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

Properties should be ordered display, padding

}
}

Choose a reason for hiding this comment

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

Line contains trailing whitespace

outline: 0;
box-shadow: inset 0 0 0 1px #78aeda;
&::before {
content: '';

Choose a reason for hiding this comment

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

Properties should be ordered position, top, bottom, left, width, content, background-color
Prefer double-quoted strings

background-color: $sidebar-sub-bg;
}
> a {
padding: 10px 6px;

Choose a reason for hiding this comment

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

Properties should be ordered display, padding

&:first-of-type {
border-top: 1px solid rgba($black, .15);
&:hover {
color: white;

Choose a reason for hiding this comment

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

Color white should be written in hexadecimal form as #ffffff

bottom: 0;
left: 0;
width: 3px;
content: '';

Choose a reason for hiding this comment

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

Prefer double-quoted strings

opacity: 1;

Choose a reason for hiding this comment

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

Line contains trailing whitespace

@brianteeman
Copy link
Contributor

Does this mean the quick link for New Item has been abandoned?

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 11, 2018

I have no idea. I haven't been part of any conversation on the topic. I'm guessing if there is no one to implement, it probably is.

@brianteeman
Copy link
Contributor

So now I am confused because I thought that the only problem with the existing menu was that it didnt support that

@brianteeman
Copy link
Contributor

brianteeman commented Oct 11, 2018

When used with the menu bar toggled to collapsed

  1. menu icons look very small to me (I am not a designer)
  2. menu links that have a submenu do not expand - only the direct menu items eg system
  3. when you select an item eg users->groups then on page load the menu is collapsed and there is no indicator what is the active menu item

From an accessibility perspective

  1. there needs to be greater background colour contrast between the normal and hover states at the top level
  2. there needs to be a background color on the submenu hover state and it looks like there is a subtle text color change on the hover which depending on the background might need tweaking
  3. the font icon needs to be aria-hidden
  4. the parent items have a role of menuitem which iirc is not correct as they are not active links and should have a role=presentation
  5. the parent items should have an aria-haspopup = true

@simbus82
Copy link
Contributor

simbus82 commented Oct 11, 2018

Very nice! But i also feel the lack of "New Item"...
Another consideration on the UX: the switch is too similar to the menu items. It should be smaller or less highlighted.

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 11, 2018

So now I am confused because I thought that the only problem with the existing menu was that it didn't support that

I honestly can't comment on that.. it wasn't from me you heard it. My reasoning for changing this to an accordion is I find the current menu gimmicky at best. Imo accordions work in almost every instance (device, number of items, expected behavior, expandable, industry standard ... ). It is fair to say we have tried everything else.

menu icons look very small to me (I am not a designer)

Personally, I have always found the icons too big in J4. I'll increase the size slightly although I would like to avoid increasing the height of each menu item. A downside to accordions is the need to scroll on larger menus, increased menu item heights would increase this probability.

menu links that have a submenu do not expand - only the direct menu items eg system

I presume you are referring to when an item is opened? The menu should stay open on the 'current' menu item?

I'll update the PR regarding the accessibility issues presuming I get any indication that this is deemed an improvement and might actually get merged.

Regarding the 'new item' option there is no reason why it can't be added to this menu after. There are both a11y and PHP considerations on how best it should be done. Neither of which are areas I am skilled in.

@ciar4n ciar4n closed this Oct 11, 2018
@ciar4n ciar4n reopened this Oct 11, 2018
@brianteeman
Copy link
Contributor

menu icons look very small to me (I am not a designer)

Personally, I have always found the icons too big in J4. I'll increase the size slightly although I would like to avoid increasing the height of each menu item. A downside to accordions is the need to scroll on larger menus, increased menu item heights would increase this probability.

Point taken about the menu item height

menu links that have a submenu do not expand - only the direct menu items eg system

I presume you are referring to when an item is opened? The menu should stay open on the 'current' menu item?

Sorry something got lost as I was editing the report. There are two different issues

  1. The menu should stay open on the 'current' menu item?
  2. The menu doesn't expand when collapsed to icon only

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 12, 2018

Do we really need the option to toggle the menu down to just the icons? It complicates this no end and also bordering on being a bit of a gimmick.

@brianteeman
Copy link
Contributor

Personally it is essential. For me it was the thing that convinced me a vertical menu was a good choice. In all the time I have been working with J4 I have not had it expanded at all. As for it being a gimmick it is a very common design pattern.

text-align: center;
vertical-align: middle;
.menuitem-group {
text-transform: uppercase;

Choose a reason for hiding this comment

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

Properties should be ordered margin-top, font-size, text-transform, letter-spacing, list-style

@ciar4n ciar4n changed the title [4.0] Sidebar redo [4.0] Sidebar - switch to vertical collapsing Oct 12, 2018
@@ -124,9 +126,10 @@ Joomla = window.Joomla || {};
allLinks[i].classList.add('active');
// Auto Expand First Level
if (!allLinks[i].parentNode.classList.contains('parent')) {
mainNav.classList.add('child-open');
mainNav.classList.add('CIARAN');
Copy link
Member

Choose a reason for hiding this comment

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

lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄 Lucky really.. they are usually a lot more offensive

@C-Lodder
Copy link
Member

C-Lodder commented Oct 12, 2018

My thoughts are with you Ciaran. Probably the 6th time you've revisited this and it's now back to square 1 :D

Much better using an accordion:

  • Easier to maintain
  • Less code
  • Works flawlessly on all device sizes
  • Simple
  • No dirty work arounds required when too many items are there
  • Easier to make accessible

One thing I will say it just ensure that when you have an expanded menu item, ensure you can still scroll through the menu if there are too many items.

@brianteeman
Copy link
Contributor

current and toggle now working as expected although I would add some styling to <a active similar to the styling on the active parent

.main-nav>li.active>a {
    background-color: rgba(0,0,0,0.4);
}

there are still a lot of a11y errors

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 12, 2018

@C-Lodder You have said accordions are the way to go from day one... we should have listened 😄

letter-spacing: 1px;
}
.divider {
background-color: $sidebar-text-color;

Choose a reason for hiding this comment

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

Properties should be ordered height, margin, list-style, background-color, opacity


a::before {
display: none;
&::before {

Choose a reason for hiding this comment

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

Nesting should be no greater than 4, but was 5

> span {
color: rgba($white, .4);
&::before {
font-family: 'FontAwesome';

Choose a reason for hiding this comment

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

Properties should be ordered position, top, left, font-family, font-size, color, content
Prefer double-quoted strings


&:hover {
background-color: rgba(0,0,0,.4);

Choose a reason for hiding this comment

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

Properties should be ordered color, background-color

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 12, 2018

@brianteeman

I have amended the styling per your a11y suggestions.

the font icon needs to be aria-hidden

the parent items have a role of menuitem which iirc is not correct as they are not active links and should have a role=presentation

the parent items should have an aria-haspopup = true

The above I am not really sure where/how to change. Could you possibly create issues and hopefully someone with the smarts can fix them. The issues are present regardless of this PR.

@joomla-cms-bot joomla-cms-bot removed the Language Change This is for Translators label Oct 16, 2018
@laoneo
Copy link
Member

laoneo commented Oct 16, 2018

I have tested this item ✅ successfully on c053ed5

The only issue I found was that when clicking on a component subitem, it doesn't expand to it on a page reload. But this can be fixed then in a followup pr.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22587.

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 16, 2018

Second levels will now open if active

@laoneo
Copy link
Member

laoneo commented Oct 16, 2018

I have tested this item ✅ successfully on d69c02c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22587.

@brianteeman
Copy link
Contributor

LGTM lets merge and then I can fix the a11y

@@ -136,10 +137,17 @@
}
}

.divider,
.menuitem-group {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt this be just menuitem not menitem-group

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the separator element as seen under Menus ('Site'). Class name is there since Joomla 3. Shall I change it? Not sure 'menuitem' is suitable.

Copy link
Contributor

Choose a reason for hiding this comment

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

oops commented in the main thread

@brianteeman
Copy link
Contributor

@brianteeman
Copy link
Contributor

ah - ok - missed that. The issue I wanted to resolve was the circle bullet. You successfully used a background image but the list-style is still there

image

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 16, 2018

You can ignore that. Chrome lists default values set by the browser as 'user'. That CSS is not in the template.

@brianteeman
Copy link
Contributor

ok - maybe it is something else causing the error I am hearing with a11y - I will look into that when I do the a11y pr

@C-Lodder
Copy link
Member

Is the screenreader reading something it shouldnt?

@brianteeman
Copy link
Contributor

yes - it is saying white bullet

@zero-24 zero-24 removed their request for review October 16, 2018 18:05
@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on d69c02c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22587.

@brianteeman
Copy link
Contributor

PR ready to submit to address accessibility once this is merged


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22587.

@laoneo laoneo merged commit 294cdb3 into joomla:4.0-dev Oct 18, 2018
@laoneo
Copy link
Member

laoneo commented Oct 18, 2018

Thanks, makes working with components usable.

@laoneo laoneo added this to the Joomla 4.0 milestone Oct 18, 2018
@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 18, 2018

@brianteeman @laoneo @C-Lodder Thanks for the help on this

@ciar4n ciar4n deleted the metismenujs branch October 18, 2018 07:39
@ciar4n ciar4n mentioned this pull request Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants