2025-12-25 11:19:43 +00:00
|
|
|
import { Dialog } from '@/components/ui/dialog';
|
|
|
|
|
import { useTranslation } from '@/hooks/useTranslation';
|
|
|
|
|
import { KEYBOARD_SHORTCUTS } from '@/config/constants';
|
|
|
|
|
|
|
|
|
|
interface KeyboardShortcutsHelpProps {
|
|
|
|
|
open: boolean;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function KeyboardShortcutsHelp({
|
|
|
|
|
open,
|
|
|
|
|
onClose,
|
|
|
|
|
}: KeyboardShortcutsHelpProps) {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
const shortcuts = [
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.SEARCH,
|
2026-01-13 18:47:57 +00:00
|
|
|
description: t(
|
|
|
|
|
'keyboard.shortcuts.search',
|
|
|
|
|
'Focus search or navigate to search page',
|
|
|
|
|
),
|
2025-12-25 11:19:43 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.NEW_MESSAGE,
|
|
|
|
|
description: t('keyboard.shortcuts.newMessage', 'Open new chat/message'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.PLAY_PAUSE,
|
2026-01-13 18:47:57 +00:00
|
|
|
description: t(
|
|
|
|
|
'keyboard.shortcuts.playPause',
|
|
|
|
|
'Play or pause current track',
|
|
|
|
|
),
|
2025-12-25 11:19:43 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.NEXT_TRACK,
|
|
|
|
|
description: t('keyboard.shortcuts.nextTrack', 'Play next track'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.PREVIOUS_TRACK,
|
|
|
|
|
description: t('keyboard.shortcuts.previousTrack', 'Play previous track'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.VOLUME_UP,
|
|
|
|
|
description: t('keyboard.shortcuts.volumeUp', 'Increase volume'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.VOLUME_DOWN,
|
|
|
|
|
description: t('keyboard.shortcuts.volumeDown', 'Decrease volume'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.MUTE,
|
|
|
|
|
description: t('keyboard.shortcuts.mute', 'Toggle mute'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Ctrl+B / Cmd+B',
|
|
|
|
|
description: t('keyboard.shortcuts.toggleSidebar', 'Toggle sidebar'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.ESCAPE,
|
|
|
|
|
description: t('keyboard.shortcuts.escape', 'Close modals or go back'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KEYBOARD_SHORTCUTS.HELP,
|
|
|
|
|
description: t('keyboard.shortcuts.help', 'Show this help dialog'),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Dialog
|
|
|
|
|
open={open}
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
title={t('keyboard.shortcuts.title', 'Keyboard Shortcuts')}
|
|
|
|
|
size="lg"
|
|
|
|
|
>
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="space-y-4">
|
2025-12-25 11:19:43 +00:00
|
|
|
{shortcuts.map((shortcut, index) => (
|
|
|
|
|
<div
|
|
|
|
|
key={index}
|
2026-01-16 00:59:31 +00:00
|
|
|
className="flex items-center justify-between border-b border-kodo-steel dark:border-kodo-steel pb-2 last:border-0"
|
2025-12-25 11:19:43 +00:00
|
|
|
>
|
2026-01-16 00:59:31 +00:00
|
|
|
<span className="text-sm text-kodo-content-dim dark:text-kodo-content-dim">
|
2025-12-25 11:19:43 +00:00
|
|
|
{shortcut.description}
|
|
|
|
|
</span>
|
2026-01-16 00:59:31 +00:00
|
|
|
<kbd className="px-2 py-1 text-xs font-semibold text-kodo-text-main dark:text-kodo-text-main bg-kodo-void dark:bg-kodo-graphite border border-kodo-steel dark:border-kodo-steel rounded">
|
2025-12-25 11:19:43 +00:00
|
|
|
{shortcut.key}
|
|
|
|
|
</kbd>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
}
|