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

Added session relaunch feature #2529

Merged
merged 2 commits into from
Jan 31, 2023
Merged

Conversation

abujeda
Copy link
Contributor

@abujeda abujeda commented Jan 31, 2023

Added session relaunch button to session panel.
This will start a new interactive session based on the user context data available in a previously completed session.

Added as a experimental feature behind a feature toggle: relaunch_session_enabled

Implements #2522

┆Issue is synchronized with this Asana task by Unito

@abujeda
Copy link
Contributor Author

abujeda commented Jan 31, 2023

There is a demo of the look and feel in the main issue:
#2522 (comment)

@@ -50,6 +50,7 @@ def boolean_configs
:disable_bc_shell => false,
:cancel_session_enabled => false,
:hide_app_version => false,
:relaunch_session_enabled => false,
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 think we want the config. Let's just let folks do it, I can't see why folks wouldn't want it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -108,6 +108,8 @@ en:
batch_connect_sessions_delete_title: "Delete"
batch_connect_sessions_cancel_confirm: "Are you sure?"
batch_connect_sessions_cancel_title: "Cancel"
batch_connect_sessions_relaunch_confirm: "Are you sure?"
Copy link
Contributor

Choose a reason for hiding this comment

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

Surely we can reuse an Are you sure? from somewhere else and/or make a generic one.

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 forgot to remove this item. This was from the initial prototype.
The current implementation stars the session without prompting the user to confirm and shows the full page spinner.

Do you prefer the the button to show the Are you sure? confirmation message instead of the full page spinner?
Here is the current demo:
#2522 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, that makes sense. No, they should just boot it up. I think we only need to confirm when something is destructive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

class: %w[btn px-1 py-0 btn-outline-dark relaunch],
form_class: %w[d-inline relaunch],
title: title,
data: { toggle: "tooltip", placement: "left" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
data: { toggle: "tooltip", placement: "left" },
data: { toggle: "tooltip", placement: "left", selector: true },

For whatever reason, we need to add this flag here because jQuery/bootstrap tooltip does something funny with the title and it throws off screen readers.

You can see in the html title is empty, replaced by data-original-title.
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Well one second, that actually breaks the hover-over tooltip.

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 noticed that while testing, the Delete tooltip was broken.
Reading about, the selector is needed when dynamic HTML is used and it should be a String with the locator of the tooltips elements. But I could not make it work locally.

In our case, we would need the selector for the card updates done with AJAX.

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that while testing, the Delete tooltip was broken.

delete tooltip still works for me. Let's see if we can't get aria-labeledby='data-original-title' to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

This'll work for now, I'll create a follow up ticket to track tooltip buttons because I'd really like to use the title, but IDK if bs tooltips is going to let us.

'aria-label': title,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you are happy with the default HTML tooltip, we can remove the whole:
toggle: "tooltip", placement: "bottom", selector: true

This is only needed for Bootstrap tooltip.
By doing this, the default title will be available in the button element.

Screenshot 2023-01-31 at 16 17 27

Copy link
Contributor

Choose a reason for hiding this comment

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

No, let's keep the tooltip because that does tell folks what this button does. I think just adding 'aria-label': title, to that hash will give us both the tooltip for sighted users and the accessibility for screen readers.

      # ...
      title: title,
      'aria-label': title,
      data: { toggle: "tooltip", placement: "left" },
      params: params
    ) do

Copy link
Contributor

Choose a reason for hiding this comment

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

and we can fix the cancel/delete buttons in the same way.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@johrstrom johrstrom left a comment

Choose a reason for hiding this comment

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

This works for me, I just won't be able to merge until node fixes there certificates.

@johrstrom johrstrom merged commit b32c3ac into OSC:master Jan 31, 2023
@abujeda abujeda deleted the 2522_session_relauch branch February 1, 2023 17:33
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.

3 participants