From f68059afec879d08d9a1b40ff1067d8c0ebaa3f4 Mon Sep 17 00:00:00 2001 From: itsRevela Date: Fri, 17 Apr 2026 14:58:57 -0500 Subject: [PATCH] fix(ui): clear button hover highlight when mouse leaves Views set focus state on onMouseEnter but had no matching onMouseLeave, so the last-hovered button stayed highlighted until the mouse entered a different one or keyboard navigation moved focus. Add onMouseLeave handlers across VersionsView rows and action buttons, SettingsView / ThemesView / SkinsView menu items, and the Import Fork / Import Instance modals. For the views with nullable focusIndex (number | null) the leave handler sets null; for VersionsView and the modals (plain number) it uses -1 as a no-focus sentinel that never matches a valid index. For VersionsView specifically: - Row-level onMouseLeave clears both focusRow and focusCol to -1; per-button onMouseLeave inside a row resets focusCol to 0 so the row stays highlighted while the mouse is over it but outside any action button. - Guard the Enter key handler with focusRow >= 0 so a cleared focus state doesn't crash editions[-1] lookups. --- src/components/modals/CustomTUModal.tsx | 2 ++ src/components/modals/ImportInstanceModal.tsx | 2 ++ src/components/views/SettingsView.tsx | 3 +++ src/components/views/SkinsView.tsx | 7 +++++- src/components/views/ThemesView.tsx | 3 +++ src/components/views/VersionsView.tsx | 25 ++++++++++++++++++- 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/components/modals/CustomTUModal.tsx b/src/components/modals/CustomTUModal.tsx index 0b520e1..09adc29 100644 --- a/src/components/modals/CustomTUModal.tsx +++ b/src/components/modals/CustomTUModal.tsx @@ -151,6 +151,7 @@ export default function CustomTUModal({