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

Backport of ui: Confirmation on exit from exec as long as socket has been opened into release/1.7.x #20002

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #19985 to be assessed for backporting due to the inclusion of the label backport/1.7.x.

The below text is copied from the body of the original PR.


Resolves #19849

In an exec window context, navigating away from the page is not possible by in-page links, as there are none (besides Documentation, which opens in a new tab). Otherwise, closing the window by clicking exit, or using a keyboard shortcut like ctrl+w, ctrl+q, etc. is the most common method.

Unfortunately, some of those keyboard shortcuts are also used for in-terminal activity (like ctrl+w to delete a word in bash, or split a terminal in vim), and users' muscle memory may cause them to close a window, losing time and context along the way.

This PR adds a beforeunload handler to the exec terminal component, triggered whenever a socket is open and the user does an action that would close the parent tab/window. It will add a prompt asking the user if they meant to close it, and if they hit cancel or escape, it will bring their context back to the cursor in the terminal. Otherwise, the window will be closed.


Overview of commits

Copy link

Ember Test Audit comparison

release/1.7.x ad76e4a change
passes 1548 1548 0
failures 0 0 0
flaky 0 0 0
duration 11m 09s 646ms 11m 04s 377ms -05s 269ms

@tgross tgross added the stage/needs-rebase This PR needs to be rebased on main before it can be backported to pick up new BPA workflows label May 17, 2024
@philrenaud philrenaud removed the stage/needs-rebase This PR needs to be rebased on main before it can be backported to pick up new BPA workflows label May 17, 2024
@philrenaud philrenaud closed this May 17, 2024
Copy link

github-actions bot commented Jan 8, 2025

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants