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

[Breadcrumbs]: Created breadcrumbs component #167

Merged
merged 2 commits into from
Oct 24, 2023
Merged

[Breadcrumbs]: Created breadcrumbs component #167

merged 2 commits into from
Oct 24, 2023

Conversation

tommi-miettinen
Copy link
Contributor

Hey, fixed the suggested changes with linting.

The breadcrumbs component needed a way to render last link as disabled so i added a disabled class to the link component.

I added motion tokens from the google material design 3 guidelines
https://m3.material.io/styles/motion/easing-and-duration/tokens-specs

Saw that expandable components closing doesnt have animation so i added a rotation reset class to icon.

@Tsallanmaa
Copy link
Member

We'll get back to you regarding a CLA as well, which we need to get sorting before we are able to merge code. 👍

Copy link
Contributor

@RiinaKuu RiinaKuu left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution, nice work!

Here are some review comments.
Note that we are still not able to merge your changes to our codebase so until then no need to do any changes unless you wish.

We will keep you posted on the issue.

[routerLinkUrl]="link.url"
*ngIf="link.url"
[linkTitle]="link.label"></fudis-link>
<span *ngIf="!last" class="fudis-separator">/</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

The current design for breadcrumb component is as follows:

Screenshot 2023-08-30 at 12 58 14

Change the separator span to fudis-icon with chevron.

align-items: center;
}

.fudis-separator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unnecessary class due to span --> fudis-icon change.
If the class is still needed, it should follow BEM, .fudis-breadcrumbs__separator

@@ -0,0 +1,16 @@
@use '../../foundations/colors/mixins.scss' as colors;
@use '../../foundations/spacing/tokens.scss';
Copy link
Contributor

Choose a reason for hiding this comment

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

Follow the same convention in all @use cases, add as spacing;

@@ -0,0 +1,11 @@
<nav aria-label="Breadcrumb navigation" class="fudis-breadcrumbs" *ngIf="links.length > 0">
<ng-container *ngFor="let link of links; let last = last">
<fudis-link
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the semantic structure, links should be wrapped inside list

<ul><li><fudis-link /></li></ul>

Also, current page should be communicated for screen readers with aria-current="page".

[color]="last ? 'default' : 'primary'"
[routerLinkUrl]="link.url"
*ngIf="link.url"
[linkTitle]="link.label"></fudis-link>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use self-closing tags for fudis-link.

$duration-long1: 450ms;
$duration-long2: 500ms;
$duration-long3: 550ms;
$duration-long4: 600ms;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice addition for motion tokens but for now let's not clutter the codebase until these have gone through our designers. Leave just that one token which is in use in icon component.

Change the naming of the token for something more intuitive, e.g $duration-600

styleUrls: ['./breadcrumbs.component.scss'],
})
export class BreadcrumbsComponent {
@Input() links: { label: string; url: string }[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Separate and make new type FudisBreadcrumb to types/miscellaneous.ts and use it here.

@@ -0,0 +1,11 @@
<nav aria-label="Breadcrumb navigation" class="fudis-breadcrumbs" *ngIf="links.length > 0">
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this aria-label to be required Input instead of hard-coded value.
We want to be able to modify the label in order to tell the screen reader which breadcrumb is being navigated e.g in different sections of the page and that the breadcrumbs are in correct user language.

@tommi-miettinen
Copy link
Contributor Author

Thanks for the feedback, will fix.

@Tsallanmaa
Copy link
Member

Sorry about the delay, we're working on the CLA and hopefully it's ready soon.

@joonashak
Copy link
Contributor

recheck

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Tsallanmaa
Copy link
Member

Sorry for the delay @tommi-miettinen, our CLA system is now ready if you're still willing to resolve the remarks in the review we can get this merged. :)

@Tsallanmaa
Copy link
Member

@tommi-miettinen: Are you still interested in this PR? We need to move forward with a breadcrumb implementation and we'd rather not implement one from scratch if you're still willing to improve on this (or sign our CLA from above and we'll continue on from this PR).

@tommi-miettinen
Copy link
Contributor Author

@Tsallanmaa Sorry i had forgotten about this, i will do it during the weekend.

@tommi-miettinen
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@RiinaKuu
Copy link
Contributor

Let's merge as is and fix tests and other necessary stuff in other PR

@RiinaKuu RiinaKuu merged commit 1894bf8 into funidata:main Oct 24, 2023
2 of 3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2023
@RiinaKuu RiinaKuu changed the title Created breadcrumbs component, added motion tokens. [Breadcrumbs]: Created breadcrumbs component Oct 24, 2023
@RiinaKuu RiinaKuu added the feature New feature that is presented for the first time label Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature that is presented for the first time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants