Skip to content

Conversation

luannmoreira
Copy link
Member

Summary

This PR refactors the TerminalDialog.vue component to enhance the user experience when interacting with the ESC key and improves dialog behavior under specific conditions.

What's Changed?

ESC Key Handling:
    Replaced the default @keyup.esc listener with a custom handleEscKey function.
    Implemented double-tap ESC functionality: pressing ESC twice within 400ms will close the terminal when the login form is hidden.
Dialog Behavior Fixes:
    Fixed an issue where the login form did not reset correctly after closing the terminal.
    Adjusted conditions related to showLoginForm when toggling the terminal visibility.
Code Cleanup:
    Removed the onKeyStroke import as it’s no longer used.
    Simplified conditional rendering for better readability.

How to Test

Open the terminal dialog.
ESC Key Test:
    When the login form is hidden, press ESC twice quickly (<400ms apart) — the dialog should close.
    Press ESC slowly — the dialog should remain open.
    If the login form is visible, ESC should have no effect.
Dialog Behavior Test:
    Navigate between pages to trigger the terminal opening automatically.
    Close the terminal and verify the login form resets as expected.

@luannmoreira luannmoreira added kind/bug Something isn't working area/ui javascript Pull requests that update Javascript code status/good-to-merge labels Feb 5, 2025
@luannmoreira luannmoreira self-assigned this Feb 5, 2025
@luannmoreira luannmoreira requested a review from a team as a code owner February 5, 2025 19:00
Refactored TerminalDialog to enhance ESC key functionality. Double-tap ESC
within 400ms now closes the dialog when the login form is hidden. Replaced
@keyup.esc listener with a custom handler for precise control. Also fixed
an issue where the login form didn't reset correctly when closing the dialog.
@luannmoreira luannmoreira force-pushed the feat/terminal-dialog-esc-handling branch from b91ce10 to 77ae748 Compare February 5, 2025 19:01
@gustavosbarreto gustavosbarreto merged commit ba23d40 into master Feb 5, 2025
8 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/terminal-dialog-esc-handling branch February 5, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui javascript Pull requests that update Javascript code kind/bug Something isn't working status/good-to-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants