Fix row highlight for keymap shortcut press animation

highlight-row! was looking for .shui-shortcut-row but keymap rows use
.shortcut-row, so the row highlight silently failed. Widen the selector
and add a visible background style for keymap rows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
scheinriese
2026-03-11 12:12:53 +01:00
committed by Tienson Qin
parent 3359396c3d
commit f6668aef37
2 changed files with 7 additions and 2 deletions

View File

@@ -159,9 +159,9 @@
(def ^:private press-animation-ms 160)
(defn- highlight-row!
"Add or remove the row highlight class on the closest .shui-shortcut-row ancestor."
"Add or remove the row highlight class on the closest shortcut row ancestor."
[^js container add?]
(when-let [^js row (or (.closest container ".shui-shortcut-row")
(when-let [^js row (or (.closest container ".shui-shortcut-row, .shortcut-row")
(.-parentElement container))]
(if add?
(.add (.-classList row) "shui-shortcut-row--pressed")

View File

@@ -214,6 +214,11 @@ button.shortcut-feedback-action {
&.active {
background-color: var(--lx-gray-05-alpha, var(--rx-gray-05-alpha));
}
/* Shortcut keypress highlight — briefly flashes the row when the user presses a shortcut */
&.shui-shortcut-row--pressed {
background-color: var(--lx-gray-05-alpha, var(--rx-gray-05-alpha));
}
}
&.th {