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

fix(core): address Avatar Group issues #12530

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

khotcholava
Copy link
Contributor

fix(core): Resolve focus retention & rendering issues, add feature enhancements

Closes #12369

Description

  • Fixed focus bug where focus remained on the first avatar group control after interacting with the second one.
  • Fixed rendering issue where only "+n more" button displayed after switching tabs instead of the full avatar group row.
  • Added feature to open group popover from the center of the avatar group.
  • Added configuration option to make "+n more" button circular to match avatars typically being in circle shapes.
  • Introduced property to set the number of visible avatars before displaying the "+n more" button.

khotcholava and others added 5 commits September 25, 2024 17:55
closes (#12369)[#12369]

## Description
- Implemented avatar details placement feature
- Implemented avatar overflow button circle state
closes (#12369)[#12369]

## Description
- Add maxVisibleItems input to limit the number of visible avatars in AvatarGroupHostComponent, retaining default behavior when unset
- Fixed focus on avatar group
…hancements

Closes [#12369](#12369)

## Description
- Fixed focus bug where focus remained on the first avatar group control after interacting with the second one.
- Fixed rendering issue where only "+n more" button displayed after switching tabs instead of the full avatar group row.
- Added feature to open group popover from the center of the avatar group.
- Added configuration option to make "+n more" button circular to match avatars typically being in circle shapes.
- Introduced property to set the number of visible avatars before displaying the "+n more" button.
@khotcholava khotcholava self-assigned this Oct 10, 2024
Copy link

netlify bot commented Oct 10, 2024

Check the deploy log for errors here: https://app.netlify.com/sites/fundamental-ngx/deploys

Name Link
🔨 Latest commit 3420564
🔍 Latest deploy log https://app.netlify.com/sites/fundamental-ngx/deploys/6776d3def1388300088ec47e

Copy link

github-actions bot commented Oct 10, 2024

Visit the preview URL for this PR (updated for commit 3420564):

https://fundamental-ngx-gh--pr12530-fix-core-avatar-gro-0buuy2zc.web.app

(expires Sun, 05 Jan 2025 18:03:28 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 41b993ee8e451bd7c6770b342ce142dc886eacff

@InnaAtanasova InnaAtanasova changed the title Fix(core) avatar group bugs fix(core): address Avatar Group issues Oct 11, 2024
@InnaAtanasova InnaAtanasova requested a review from a team October 11, 2024 14:55
@InnaAtanasova InnaAtanasova added the bug Something isn't working label Oct 11, 2024
<fd-avatar-group-default-example></fd-avatar-group-default-example>
</component-example>
<code-example [exampleFiles]="avatarGroupDefaultExample"></code-example>
<!--<fd-docs-section-title id="default" componentName="AvatarGroup"> Avatar Group Standard Usage </fd-docs-section-title>-->
Copy link
Member

Choose a reason for hiding this comment

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

Accidental commit?

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, it's not ready yet for review. I converted this PR as a draft. @mikerodonnell89

@khotcholava khotcholava marked this pull request as draft October 14, 2024 16:15
Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

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

Looks good but what is going on with all of the commented out html?

closes [#12369](#12369)

- Fixed avatar overflow body focus issue
@khotcholava khotcholava marked this pull request as ready for review October 15, 2024 08:58
@droshev droshev requested a review from a team October 15, 2024 14:02
Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

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

In the "group type standard usage" examples, after opening the popover, i can not navigate through the avatars with the arrow keys or tab key. Because each avatar in the popover is clickable, we do need this functionality with keyboard control as well

@khotcholava
Copy link
Contributor Author

@mikerodonnell89 In this example, the web components avatar group features tab navigation but lacks arrow navigation.

I'm currently working on implementing tab navigation.

…hancements

closes [#12369](#12369)

## Description
Remove unused event handlers and update focus behavior
@khotcholava
Copy link
Contributor Author

@mikerodonnell89 Implemented arrow navigation.

@droshev droshev requested a review from a team October 29, 2024 22:48
closes [#12530](#12530)

- Fixing tab indexes
**/
avatars = input<AvatarGroupItemRendererDirective[]>([]);

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

missing declaration or wrong place for this jsDoc.

@droshev
Copy link
Contributor

droshev commented Nov 20, 2024

@mikerodonnell89 @dpavlenishvili Can you review it again?

@droshev
Copy link
Contributor

droshev commented Nov 25, 2024

@dpavlenishvili any update?

Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

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

Does not look like the first issue (regarding the focus staying on the first avatar group after interacting with a second) was fixed. In this example I've used the mouse to click both, then the escape key to close the second group

Screen.Recording.2024-11-25.at.2.45.53.PM.mov

 closes [#12530](#12530)

Fixed first item auto focus on popover open
@droshev
Copy link
Contributor

droshev commented Nov 27, 2024

@khotcholava Can you check the e2e?

@khotcholava khotcholava marked this pull request as draft December 2, 2024 12:19
@@ -88,6 +94,10 @@ export class AvatarGroupComponent implements AvatarGroupHostConfig {
@Input()
size: AvatarGroupHostConfig['size'] = 'l';

/** Popover placement */
@Input()
popoverPlacement: Placement | null = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

use Nullable type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PopoverPlacement type is Placement | null. It's not Nullable. If I change it I'm afraid it will broke already existing functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

add or update relevant unit tests for maxVisibleItems

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is not e2e test for avatar group host

@@ -127,6 +131,13 @@ export class PopoverService extends BasePopoverClass {
this._removeOverlay(this._modalBodyClass, this._modalTriggerClass);
}
});

// Add keydown listener for space key
this._renderer.listen('document', 'keydown', (event: KeyboardEvent) => {
Copy link
Contributor

@dpavlenishvili dpavlenishvili Dec 2, 2024

Choose a reason for hiding this comment

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

Listening for keydown events globally on the document level can lead some performance issues, if it is possible scope the event listener to the popover element directly.
for example:
`
const popoverElement = this._elementRef.nativeElement;

this._renderer.listen(popoverElement, 'keydown', (event: KeyboardEvent) => {
if (event.code === 'Space' && this.isOpen) {
this._storeAndFocusFirstTabbable();
}
});
`

khotcholava and others added 4 commits December 2, 2024 22:29
…o fix(core)-avatar-group-bugs

# Conflicts:
#	libs/core/popover/popover-body/popover-body.component.ts
@droshev
Copy link
Contributor

droshev commented Dec 18, 2024

@khotcholava needs to update with the comments from UX, check e2e/unit and make it as PR. Needs to be reviewed afterwards

1 similar comment
@droshev
Copy link
Contributor

droshev commented Dec 19, 2024

@khotcholava needs to update with the comments from UX, check e2e/unit and make it as PR. Needs to be reviewed afterwards

@droshev
Copy link
Contributor

droshev commented Dec 20, 2024

@khotcholava Can you summarize what you did and what needs to be implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] fd-avatar-group focus, overflow bugs
6 participants