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-timeline-item): introduce status property #10277

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

hinzzx
Copy link
Contributor

@hinzzx hinzzx commented Nov 29, 2024

Introducing status property into the <ui5-timeline-item> web component.

The status property allows you to set the semantic state of the icon using the following values: Information, Positive, Critical, Negative or None.
Each status automatically changes the icon's color to visually represent the corresponding state, improving clarity and consistency.
The status is also accessible. Screen readers will read the status, ensuring that users with assistive technologies can understand the semantic meaning.

Sample usecases with and without status property

With

image

Without

image

Fixes: #9806

Copy link
Contributor

@unazko unazko left a comment

Choose a reason for hiding this comment

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

  • From the commit description - the semantic meaning gets set over the ui5-timeline-item and not only over the icon.
  • You could add a test, in order to check whether the accessible-description property results into aria-description over the inner element.

Tested with NVDA and JAWS. The announcements are as expected.

packages/fiori/src/themes/TimelineItem.css Outdated Show resolved Hide resolved
packages/fiori/src/TimelineItem.ts Outdated Show resolved Hide resolved
packages/fiori/src/TimelineItem.ts Outdated Show resolved Hide resolved
packages/fiori/src/types/TimelineItemStatus.ts Outdated Show resolved Hide resolved
packages/fiori/src/types/TimelineItemStatus.ts Outdated Show resolved Hide resolved
packages/fiori/src/types/TimelineItemStatus.ts Outdated Show resolved Hide resolved
packages/fiori/src/types/TimelineItemStatus.ts Outdated Show resolved Hide resolved
packages/fiori/src/types/TimelineItemStatus.ts Outdated Show resolved Hide resolved
@@ -1,13 +1,25 @@
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
import event from "@ui5/webcomponents-base/dist/decorators/event.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you change this?

Copy link
Contributor Author

@hinzzx hinzzx Jan 8, 2025

Choose a reason for hiding this comment

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

hm, probably happened when merging conflicts, reverting it

@@ -6,7 +6,10 @@ import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
import TimelineLayout from "./types/TimelineLayout.js";
import type { ITimelineItem } from "./Timeline.js";

import "@ui5/webcomponents-icons/dist/slim-arrow-left.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see where you use these 4 icons, they are only imported, but no template uses them.

Is this a bug fix?

Icons are now imported in the template where they are used, not in the component file

Copy link
Contributor Author

@hinzzx hinzzx Jan 8, 2025

Choose a reason for hiding this comment

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

I added them, because previously without them in the Playground samples, when having ui5-timeline-group-item, the arrows in the buttons
image
weren't present, until imported explicitly.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I found the code:

get _groupItemIcon() {
		if (this.layout === TimelineLayout.Vertical) {
			return this.collapsed ? "slim-arrow-left" : "slim-arrow-down";
		}

		return this.collapsed ? "slim-arrow-up" : "slim-arrow-right";
	}

These icons were used, but were not imported, so it's a bugfix. After the TSX rework we recommend moving this to the template, and importing the icons from the template as named imports.

Please see packages/main/src/MessageStripTemplate.tsx for an example

* Available status types of a timeline item.
* @public
*/
enum TimelineItemStatus {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you consider using valueState? It seems exactly the same. And also calling the property valueState instead of status. I'm not sure this would be right, but maybe it's worth thinking about

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the suggestions, I will communicate it with the team, and will follow up

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

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

See Dialog, NotificationListItem:

@property() state: ${ValueState}= "None" (edited)

In short:

  • change the name to state to be consistent
  • use the existing enum

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.

[Timeline]: [No text alternative for the icons]
4 participants