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

feat(ui5-breadcrumbs): Initial implementation #3489

Merged
merged 53 commits into from
Aug 3, 2021

Conversation

kineticjs
Copy link
Contributor

Fixes #3166

packages/main/src/Label.js Outdated Show resolved Hide resolved
@@ -241,6 +254,9 @@ class Link extends UI5Element {
}

get tabIndex() {
if (this._tabIndex.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it will be undefined, -1 (valid and will be set) or 0 (valid and will be set) so we don't need to check length here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -77,3 +77,9 @@ bdi {
margin-right: .125rem;
margin-left: 0;
}

.ui5-label-root:focus {
Copy link
Contributor

Choose a reason for hiding this comment

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

:host([focused]) .ui5-label-root since the focused attribute is updated on focusin/focusout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the label does not have a "focused" property... do you think we should add one, for consistency with other similar cases?

btw I checked that some components e.g. Carousel also do not define a "focused" property and use the :focus instead

.ui5-label-root:focus {
outline-offset: -1px;
outline: 1px dotted var(--sapContent_FocusColor);
text-decoration: underline;
Copy link
Contributor

@nnaydenow nnaydenow Jul 5, 2021

Choose a reason for hiding this comment

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

should be set to ui5-label-text-wrapper otherwise it doesn't affect the text. Also I think we should skip this or to add shadow part to the the text wrapper and to style it from styles of breadcrumbs since it is ui5-breadcrumbs specific @ilhan007

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the rule for "text-decoration" was added by me by mistake, I removed it as it is not needed at all

so I just tried to move this css to Breadcrumbs.css, but I do not seem to be allowed to target ui5-label-root from there

I need to target ui5-label-root as this is the element that has the tabIndex attribute (the inner ui5-label-text-wrapper is not focusable, sorry for overlooking the confusing "text-decoration" rule)

@@ -0,0 +1,29 @@
<ui5-responsive-popover
no-arrow
Copy link
Contributor

Choose a reason for hiding this comment

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

hide-arrow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@kineticjs kineticjs force-pushed the breadcrumbs3 branch 3 times, most recently from 86306b8 to 4c8772b Compare July 7, 2021 07:20
* @lends sap.ui.webcomponents.main.types.BreadcrumbsDesign.prototype
* @public
*/
const BreadcrumbsTypes = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw here the 2 types are defined in accordance with the UX spec at:
https://ux.wdf.sap.corp/fiori-design-web/breadcrumb/#types

Copy link
Contributor

@dobrinyonkov dobrinyonkov left a comment

Choose a reason for hiding this comment

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

Overall, it works and looks great. Just some minor comments about the names of the aria properties, CSS selectors and JSDocs.
Also I don't see a playground sample. Is it intentionally posponed to be added later?

packages/main/src/BreadcrumbsItem.js Outdated Show resolved Hide resolved
packages/main/src/BreadcrumbsItem.js Outdated Show resolved Hide resolved
packages/main/src/BreadcrumbsItem.js Show resolved Hide resolved
packages/main/src/themes/Breadcrumbs.css Outdated Show resolved Hide resolved
packages/main/test/specs/Breadcrumbs.spec.js Show resolved Hide resolved
packages/main/src/types/BreadcrumbsDesign.js Show resolved Hide resolved
@kineticjs kineticjs force-pushed the breadcrumbs3 branch 7 times, most recently from c2152b2 to 57243a0 Compare July 14, 2021 19:00
kineticjs and others added 2 commits July 20, 2021 12:37
The role presentation on the icon SVG is ignored in some cases:
*The element is focusable, e.g. it is natively focusable like an HTML link or input, or it has a tabindex attribute.
*The element has any of the twenty-one global ARIA states and properties, e.g., aria-label.

With this change we introduce ariaHidden property on ui5-icon to be able to completly hide it from accessibility tree mapping.
Also, change the default value of effectiveAccessibleName to undefined as a value of "" will still set the aria-label attribute and the presentation role will be ignroed.

Fixes SAP#3433
dobrinyonkov and others added 2 commits July 20, 2021 14:37
The role presentation on the icon SVG is ignored in some cases:
*The element is focusable, e.g. it is natively focusable like an HTML link or input, or it has a tabindex attribute.
*The element has any of the twenty-one global ARIA states and properties, e.g., aria-label.

With this change we introduce ariaHidden property on ui5-icon to be able to completly hide it from accessibility tree mapping.
Also, change the default value of effectiveAccessibleName to undefined as a value of "" will still set the aria-label attribute and the presentation role will be ignroed.

Fixes SAP#3433
* @private
* @since 1.0.0-rc.15
*/
role: {
Copy link
Contributor

Choose a reason for hiding this comment

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

The text "More button menu" is read out twice upon focusing the ui5-link with overflowed items.
This is because of this attribute being named role. The screen reader reads the role and the label twice. Once from the custom element and once from the internal shadow dom element. If we rename this property to accRole the announcment is correct.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe accessibleRole, to be consistent with the List and Panel components, where this is how it is named.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to "accessibleRole"


/**
* Determines the visual style of the separator between the breadcrumb items.
*
Copy link
Member

Choose a reason for hiding this comment

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

List the options in the description in this way:

* <br><br>
* Available options are:
* <ul>
* <li><code>TopStart</code></li>
* <li><code>BottomCenter</code></li>
* <li><code>BottomEnd</code></li>
* </ul>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

* @class
*
* <h3 class="comment-api-title">Overview</h3>
* Enables users to navigate between items by providing a list of links to previous steps in the user's navigation path. The last three steps can be accessed as links directly, while the remaining links prior to them are available in a drop-down menu.
Copy link
Member

Choose a reason for hiding this comment

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

If you have a KM, perhaps you can involve him/her to review or add more information if necessary.

* @param {HTMLElement} link The clicked link.
* @public
*/
"link-click": {
Copy link
Member

Choose a reason for hiding this comment

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

item-click might be also a candidate, as the child component is BreadcrumbsItem and the Breadcrumbs slot is referred as "items" (although default), maybe you can consider that.

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, I pondered earlier about the event name!
The name "item-click" is consistent with the slot name, but I named it "link-click" because currently no event is fired if the clicked item is the one that stands for the "current-location" label. For now I see two options:

  1. fire the event even when the "current-location" label is pressed - but if we want to keep the label as non-interactive, then I discard this option
    OR
  2. rename the event from "link-click" to "item-click" nevertheless, for consistence with the slot name

What do you think?
Thnx!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eventually refactored to "item-click" that fires on click on any item, as it makes most sense

*/
const metadata = {
tag: "ui5-breadcrumbs-item",
managedSlots: true,
Copy link
Member

Choose a reason for hiding this comment

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

I think you don't need "managedSlots: true," here, probably copied.

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 added "managedSlots: true" to be able to react (recalculate the number of overflowing links) whenever the text of the link changes.

Do you have a better idea in mind?

Btw earlier I used a ResizeHandler on a content wrapper, but seemed like the less efficient solution, especially to monitor changes in the size of links that are currently in the overflow.

@kineticjs
Copy link
Contributor Author

Hi @gmkv,

I agree to not set focus on the label itself but on a wrapper element. Done.

georgimkv
georgimkv previously approved these changes Jul 29, 2021
@CLAassistant
Copy link

CLAassistant commented Jul 31, 2021

CLA assistant check
All committers have signed the CLA.

@kineticjs
Copy link
Contributor Author

all requested changes of @xtatica are integrated

* <h3 class="comment-api-title">Overview</h3>
*
* The <code>ui5-breadcrumbs-item</code> component defines the content of an item in <code>ui5-breadcumbs</code>.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add a <h3>Keyboard Handling</h3> section somewhere here with supported key shortcuts . Similar to other components, see ui5-select for example :)

Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

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

The code looks good to me, @SAP/ui5-webcomponents-topic-p it's up to you to finish the review.

@kineticjs kineticjs requested review from dobrinyonkov and removed request for georgimkv August 2, 2021 18:45
@ilhan007 ilhan007 dismissed xtatica’s stale review August 3, 2021 06:52

outdated - Documentation Review addressed

@kineticjs
Copy link
Contributor Author

Thanks to all involved for the code review of this big change...! Waiting for @nnaydenow for final vote.

Copy link
Contributor

@nnaydenow nnaydenow left a comment

Choose a reason for hiding this comment

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

@kineticjs looks good to me. @ilhan007 could you please confirm which version we should use in JSDoc? I'm not sure if the rc-15 is already released and in which version we will release that component.

* @type String
* @defaultvalue undefined
* @private
* @since 1.0.0-rc.16
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about this version. @ilhan007 could you check please?

@ilhan007
Copy link
Member

ilhan007 commented Aug 3, 2021

Let's keep it RC.16, we can update that any time if needed. We are about to release RC.15 including IllustratedMessage and BarcodeScannerDialog (thanks for these two as well) and we plan to leave the Breadcrumbs for the next stable version.

@ilhan007 ilhan007 merged commit 6dbc2a0 into SAP:master Aug 3, 2021
ilhan007 pushed a commit that referenced this pull request Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Component: ui5-breadcrumbs
7 participants