From 59493c94cba102fddd6248eeb39abe9ee95f069f Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Thu, 21 Nov 2024 06:43:49 +1000 Subject: [PATCH] Fix keyboard shortcuts settings display (#11467) - Add border to keyboard shortcuts to make them more distinct from each other - Move scrollbar to table so the header becomes sticky # Important Notes None --- .../components/dashboard/KeyboardShortcut.tsx | 7 +++- .../KeyboardShortcutsSettingsSection.tsx | 33 ++++++++----------- .../layouts/Settings/MembersTable.tsx | 2 +- .../dashboard/layouts/Settings/Section.tsx | 2 +- .../src/dashboard/layouts/Settings/Tab.tsx | 5 ++- .../src/dashboard/layouts/Settings/data.tsx | 1 + app/gui/src/dashboard/tailwind.css | 8 ----- app/gui/tailwind.config.js | 7 ---- 8 files changed, 26 insertions(+), 39 deletions(-) diff --git a/app/gui/src/dashboard/components/dashboard/KeyboardShortcut.tsx b/app/gui/src/dashboard/components/dashboard/KeyboardShortcut.tsx index 807614828cf..264bb1ef6a7 100644 --- a/app/gui/src/dashboard/components/dashboard/KeyboardShortcut.tsx +++ b/app/gui/src/dashboard/components/dashboard/KeyboardShortcut.tsx @@ -100,11 +100,13 @@ const MODIFIER_TO_TEXT_ID: Readonly> = { /** Props for a {@link KeyboardShortcut}, specifying the keyboard action. */ export interface KeyboardShortcutActionProps { readonly action: DashboardBindingKey + readonly className?: string } /** Props for a {@link KeyboardShortcut}, specifying the shortcut string. */ export interface KeyboardShortcutShortcutProps { readonly shortcut: string + readonly className?: string } /** Props for a {@link KeyboardShortcut}. */ @@ -112,10 +114,12 @@ export type KeyboardShortcutProps = KeyboardShortcutActionProps | KeyboardShortc /** A visual representation of a keyboard shortcut. */ export default function KeyboardShortcut(props: KeyboardShortcutProps) { + const { className } = props const { getText } = useText() const inputBindings = useInputBindings() const shortcutString = 'shortcut' in props ? props.shortcut : inputBindings.metadata[props.action].bindings[0] + if (shortcutString == null) { return null } else { @@ -125,7 +129,8 @@ export default function KeyboardShortcut(props: KeyboardShortcutProps) {
{modifiers.map( diff --git a/app/gui/src/dashboard/layouts/Settings/KeyboardShortcutsSettingsSection.tsx b/app/gui/src/dashboard/layouts/Settings/KeyboardShortcutsSettingsSection.tsx index 76017e25aa9..d34a69d4ed2 100644 --- a/app/gui/src/dashboard/layouts/Settings/KeyboardShortcutsSettingsSection.tsx +++ b/app/gui/src/dashboard/layouts/Settings/KeyboardShortcutsSettingsSection.tsx @@ -45,7 +45,7 @@ export default function KeyboardShortcutsSettingsSection() { return ( <> - +