mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
Enhance shortcut rendering in CMD K component
- Updated shortcut rendering logic to conditionally apply styles based on the presence of modifier keys, improving visual clarity. - Refined the display of shortcuts in tooltips for better user experience and accessibility.
This commit is contained in:
@@ -908,7 +908,7 @@
|
||||
(shui/shortcut "/")
|
||||
[:div "to filter search results"]]
|
||||
[:div.flex.flex-row.gap-1.items-center.opacity-50.hover:opacity-100
|
||||
(shui/shortcut ["mod" "enter"])
|
||||
(shui/shortcut ["mod" "enter"] {:style :combo})
|
||||
[:div "to open search in the sidebar"]]]))
|
||||
|
||||
(rum/defcs tip <
|
||||
@@ -936,9 +936,16 @@
|
||||
[[:span.opacity-60 text]
|
||||
;; shortcut
|
||||
(when (not-empty shortcut)
|
||||
(shui/shortcut shortcut {:style :separate
|
||||
:interactive? false
|
||||
:aria-hidden? true}))]))
|
||||
(let [has-modifier? (and (coll? shortcut)
|
||||
(some #(#{"shift" "ctrl" "alt" "cmd" "mod" "⌘" "⌥" "⌃"}
|
||||
(string/lower-case (str %)))
|
||||
shortcut))
|
||||
style (if (and (> (count shortcut) 1) has-modifier?)
|
||||
:combo
|
||||
:auto)]
|
||||
(shui/shortcut shortcut {:style style
|
||||
:interactive? false
|
||||
:aria-hidden? true})))]))
|
||||
|
||||
(rum/defc hints
|
||||
[state]
|
||||
|
||||
Reference in New Issue
Block a user