-
-
-
-
- {
- setSearchTerm(e.target.value)
- setSelectedIndex(0)
- }}
- />
-
+
+ {/* Search input */}
+
+
+
+
+
+ {
+ setSearchTerm(e.target.value)
+ setSelectedIndex(0)
+ }}
+ />
+
- {/* Commands list */}
-
- {filteredCommands.length === 0 ? (
-
- Команды не найдены
-
- ) : (
-
- {filteredCommands.map((cmd, index) => {
- const Icon = cmd.icon
- return (
-
- )
- })}
-
- )}
-
-
- {/* Footer with hints */}
-
-
-
↑ ↓ навигация
-
↵ выбрать
-
Esc закрыть
+ {/* Commands list */}
+
+ {filteredCommands.length === 0 ? (
+
+ ) : (
+
+ {filteredCommands.map((cmd, index) => {
+ const Icon = cmd.icon
+ return (
+
+ )
+ })}
+
+ )}
+
+
+ {/* Footer with hint */}
+
+
+
+
+ ↑ ↓ навигация • Enter выбрать • ESC закрыть
+
- >
+
)
}
-/**
- * Кнопка для показа shortcuts
- */
-export function KeyboardShortcutsButton({ className = '' }) {
- const [showModal, setShowModal] = useState(false)
-
- const shortcuts = [
- { keys: ['Ctrl', 'K'], description: 'Открыть поиск команд' },
- { keys: ['Ctrl', 'N'], description: 'Добавить новую запись' },
- { keys: ['Ctrl', 'S'], description: 'Сохранить изменения' },
- { keys: ['Ctrl', 'F'], description: 'Поиск по таблице' },
- { keys: ['Esc'], description: 'Закрыть модалку / Отменить' },
- { keys: ['↑', '↓'], description: 'Навигация по списку' },
- { keys: ['Enter'], description: 'Подтвердить / Выбрать' },
- ]
-
- // Если className содержит nav-link, используем ссылку вместо кнопки
- const isNavLink = className.includes('nav-link')
-
- return (
- <>
- {isNavLink ? (
-
{ e.preventDefault(); setShowModal(true); }}
- title="Горячие клавиши (Ctrl+/)"
- >
-
-
- ) : (
-
- )}
-
- {showModal && (
- <>
-
setShowModal(false)}
- >
-
-
-
-
-
Горячие клавиши
-
-
-
-
- {shortcuts.map((shortcut, index) => (
-
-
{shortcut.description}
-
- {shortcut.keys.map((key, i) => (
- {key}
- ))}
-
-
- ))}
-
-
-
-
-
- >
- )}
- >
- )
-}
-
-export default CommandPalette
\ No newline at end of file
+export default CommandPalette
diff --git a/frontend/src/components/ConfirmDialog.jsx b/frontend/src/components/ConfirmDialog.jsx
index a60b7bb..f46cf10 100644
--- a/frontend/src/components/ConfirmDialog.jsx
+++ b/frontend/src/components/ConfirmDialog.jsx
@@ -1,9 +1,8 @@
-import { SmallModal } from './Modal';
-import { IconAlertTriangle, IconCheck, IconX } from '@tabler/icons-react';
+import { IconAlertTriangle } from '@tabler/icons-react';
/**
- * ConfirmDialog - упрощённая версия ConfirmModal для быстрых подтверждений
- * Алиас для ConfirmModal с другим API (для обратной совместимости)
+ * ConfirmDialog - упрощённая версия для быстрых подтверждений
+ * Простой подход со встроенным backdrop (как в HistoryModal)
*/
export default function ConfirmDialog({
open,
@@ -17,47 +16,78 @@ export default function ConfirmDialog({
size = 'sm',
loading = false
}) {
+ if (!open) return null;
+
return (
-
- {destructive && (
-
- )}
- {title}
- { if (e.key === 'Escape') onCancel?.(); }}
>
-
-
{message}
+
+
{
+ if (e.key === 'Tab') {
+ const c = e.currentTarget;
+ const focusable = c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
+ if (!focusable || focusable.length === 0) return;
+ const first = focusable[0];
+ const last = focusable[focusable.length - 1];
+ if (e.shiftKey && document.activeElement === first) {
+ e.preventDefault();
+ last.focus();
+ } else if (!e.shiftKey && document.activeElement === last) {
+ e.preventDefault();
+ first.focus();
+ }
+ }
+ }}
+ >
+
+
{title}
+
+
+
+
+
+ {destructive && (
+
+
+
+ )}
+
+
+
+
+
+
+
+
+
-
+
);
}
diff --git a/frontend/src/components/ConfirmDiffModal.jsx b/frontend/src/components/ConfirmDiffModal.jsx
index c17c8a9..9bee46d 100644
--- a/frontend/src/components/ConfirmDiffModal.jsx
+++ b/frontend/src/components/ConfirmDiffModal.jsx
@@ -1,101 +1,103 @@
-import { SmallModal } from './Modal';
import { IconCheck, IconX, IconRefresh } from '@tabler/icons-react';
/**
* ConfirmDiffModal - модальное окно для подтверждения изменений с отображением статистики
- * Использует готовый пресет SmallModal для компактного отображения
+ * Простой подход со встроенным backdrop (как в HistoryModal)
*/
function ConfirmDiffModal({ show, diff, onConfirm, onClose, loading = false }) {
const added = diff?.added?.length || 0;
const removed = diff?.removed?.length || 0;
const changed = diff?.changed?.length || 0;
+ if (!show) return null;
+
return (
-
-
- Подтвердить сохранение
-