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

Put the options of the title bar in a menu #95

Merged
merged 5 commits into from
Jun 7, 2021
Merged

Put the options of the title bar in a menu #95

merged 5 commits into from
Jun 7, 2021

Conversation

miloparra
Copy link
Collaborator

Ticket #76 : Put the different options of the title bar in a drop-down menu.

@miloparra
Copy link
Collaborator Author

I think the borders around the icon menu are making the menu bar too busy.

Copy link
Member

@Jogo27 Jogo27 left a comment

Choose a reason for hiding this comment

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

We'll keep the borders for now. There is a bug on them: they're too tall. I think that once the bug is fixed, borders will be ok. But we'll wait until the fontsize ticket is merged before fixing it, if possible.

Apart from that and the comments below, the only thing I don't like is that the icon for the list of poll and the icon for the public poll are the same. These are very different pages that deserve different icons.

app/src/app/navtitle/navtitle.component.html Outdated Show resolved Hide resolved
app/src/app/navtitle/navtitle.component.html Outdated Show resolved Hide resolved
app/src/app/navtitle/navtitle.component.sass Outdated Show resolved Hide resolved
@@ -63,3 +79,11 @@ nav
background-color: color.adjust($maincolor, $lightness: 10%)
a.active:hover
background-color: $nav-hover-bg

hr
Copy link
Member

Choose a reason for hiding this comment

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

Please be more precise. Say at least "hr in mat-menu".

Copy link
Member

Choose a reason for hiding this comment

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

I propose #menubutton hr.

app/src/app/navtitle/navtitle.component.sass Outdated Show resolved Hide resolved
Comment on lines 30 to 33
<button *ngIf="(demoIsActive$ | async) && !(session.state$ | async).logged" mat-menu-item class="nav-link"><mat-icon>play_circle_outline</mat-icon>
<a [routerLink]="(demoPath$ | async)" routerLinkActive="active">
<span class="navitem" i18n>Try it</span>
</a>
Copy link
Member

Choose a reason for hiding this comment

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

Both the <a> and the <span> elements are useless here. You could move the routerLink directives into the button element. Of course, this applies to the other two menu items.

Comment on lines 47 to 49
mat-menu .nav-link
@media (min-width: $breakpoint-tablet)
display: none
Copy link
Member

Choose a reason for hiding this comment

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

This does not work. The content of the menu is moved from the mat-menu to the overlay (out of reach) when the user opens the menu. Hence it is not possible to have CSS selectors that "cross" the menu limit. From my experiment, the solution here is to add a div in the menu with an id, and to use this id to detect that the .nav-link is in the menu.

Comment on lines 205 to 206
@media (min-width: $breakpoint-tablet)
display: none
Copy link
Member

Choose a reason for hiding this comment

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

This must not be here, in the global style file. We do want all the hr in all menus to look the same. But we do not want all the hr in all menus to disappear when the screen is wide. This has to be moved in navtitle.component.sass.

@miloparra
Copy link
Collaborator Author

PTAL

Copy link
Member

@Jogo27 Jogo27 left a comment

Choose a reason for hiding this comment

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

Almost done. What remain are only very minor issues.

</button>
<button mat-menu-item (click)="logoff()"><mat-icon>logout</mat-icon> Log off</button>
<div id="menubutton">
<button *ngIf="(demoIsActive$ | async) && !(session.state$ | async).logged" mat-menu-item class="nav-link" [routerLink]="(demoPath$ | async)" routerLinkActive="active">
Copy link
Member

Choose a reason for hiding this comment

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

This line is much too long (172 characters). I try to respect a soft limit of 100 and a hard limit of 120. Considering this hard limit, lines 12, 15, 35, 39, 43 and 47 are too long too.

Suggested change
<button *ngIf="(demoIsActive$ | async) && !(session.state$ | async).logged" mat-menu-item class="nav-link" [routerLink]="(demoPath$ | async)" routerLinkActive="active">
<button *ngIf="(demoIsActive$ | async) && !(session.state$ | async).logged" mat-menu-item class="nav-link"
[routerLink]="(demoPath$ | async)" routerLinkActive="active">

<span class="navitem">Create</span>
</a>
<a *ngIf="(session.state$ | async).logged" [matMenuTriggerFor]="profileMenu">
<a [matMenuTriggerFor]="profileMenu" id="naviconmenu">
Copy link
Member

Choose a reason for hiding this comment

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

Names are easier to read and remember if the words are separated. With CSS, the usage is to separate words using -. Hence naviconmenu would be more readable if it was nav-icon-menu. Same for nav-icon-person below. I haven't done that for all class and id names and I regret it. Notice too that the elements on which these id are applied are not icons, which can be misleading.

</ng-container> Notifications
</button>
<button mat-menu-item (click)="logoff()"><mat-icon>logout</mat-icon> Log off</button>
<div id="menubutton">
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 not a button. Perhaps menu-buttons (mind the plural). You could also reuse mat-menu here, because classes and ids have different namespaces.

@@ -63,3 +79,11 @@ nav
background-color: color.adjust($maincolor, $lightness: 10%)
a.active:hover
background-color: $nav-hover-bg

hr
Copy link
Member

Choose a reason for hiding this comment

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

I propose #menubutton hr.

@miloparra
Copy link
Collaborator Author

PTAL

@Jogo27 Jogo27 merged commit cfb9fb9 into main Jun 7, 2021
@Jogo27 Jogo27 deleted the mp_titlebuttons branch June 7, 2021 13:04
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.

2 participants