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(coral): Show info to user when they temp can not edit a topic #1637

Merged

Conversation

programmiri
Copy link
Contributor

@programmiri programmiri commented Aug 16, 2023

About this change - What it does

There are cases where a user is allowed to edit a topic/connector in general, because they are topic owner, but the edit functionality is currently blocked because there is an open request. Before now, we didn't show the button in that case.

In line with e.g. promoting a topic, we don't want to hide the button "Edit topic/connector" anymore, but show it disabled and inform the user why they can't edit at the moment. We're doing that by showing a disabled button with a tooltip.

Notes about implementation

First: I sneaked in an unrelated type fix (really no need to make a new PR for one character 😅 ) -> 309495f

Background

  • "Edit topic" and "Edit connectors" are links, not buttons (they just look like it)
  • <Tooltip /> from DS does not work in strict mode but also without strict mode, it is not really accessible. Screenreader user don't get any information about the tooltip and since we would need to use a Primary.Button with disabled=true, it also does not work for keyboard user.

In order to get the result we want, there is a new (very specific) component DisabledButtonTooltip for this use case. It enables us to have a disabled button or link with accessible tooltips until DS components are updated (and we've disabled strict mode) to cover this use case in a way that it's usable by most users.

Recording

recording-button-disabling.mov

Resolves: #1633

@programmiri programmiri added the Frontend Relates to coral (react app) label Aug 16, 2023
@programmiri programmiri self-assigned this Aug 16, 2023
@programmiri programmiri marked this pull request as ready for review August 16, 2023 12:15
Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
@programmiri programmiri force-pushed the 1633-show-info-to-user-when-they-temp-can-not-edit-a-topic branch from 309495f to 64d9a49 Compare August 16, 2023 15:31
Copy link
Contributor

@roope-kar roope-kar left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +47 to +48
onMouseEnter={toggleTooltip}
onMouseLeave={toggleTooltip}
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember i had issues when working on the DS Tooltip that onMouseLeave would not fire consistently (it was known issue by the internet as well) and had to fallback to tracking onMouseMove and when it leaves the element or something like that.

Though if it works this might be fixed already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I had that too will adding it, but it looked in my case it was because I had a

for tracking the mouse that I had it wrapped around a disabled Button.Primary. After that I did not notice a difference anymore! But I'll do a quick google search and see if that's potential still a problem. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I checked and there's no know issue for that general, it seems to happen in some cases (but not 100% clear when) and seems to be dependent on surrounding elements and reactivity (e.g. one explanation was that it could be caused by child elements of the tracking element being added/removed conditionally).

I've checked the functionality in our UI and I was REALLY fast with the mouse 😅 😅 😅 and it worked all the time.

@roope-kar roope-kar merged commit 95776cd into main Aug 17, 2023
13 checks passed
@roope-kar roope-kar deleted the 1633-show-info-to-user-when-they-temp-can-not-edit-a-topic branch August 17, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Relates to coral (react app)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor(coral): Show info to user when they temp can not edit a topic
2 participants