diff --git a/ordinis-admin-ui/src/components/record/RecordHistoryDrawer.tsx b/ordinis-admin-ui/src/components/record/RecordHistoryDrawer.tsx index 61f72b3..8481f62 100644 --- a/ordinis-admin-ui/src/components/record/RecordHistoryDrawer.tsx +++ b/ordinis-admin-ui/src/components/record/RecordHistoryDrawer.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { useTranslation } from 'react-i18next' import { Alert, Badge, Button, Drawer, LoadingBlock } from '@/ui' -import { ArrowsLeftRightIcon, ArrowCounterClockwiseIcon } from '@phosphor-icons/react' +import { ArrowsLeftRightIcon, ArrowCounterClockwiseIcon, BracketsCurlyIcon, InfoIcon } from '@phosphor-icons/react' import { useRecordHistory } from '@/api/queries' import { RecordDependentsPanel } from '@/components/lineage/RecordDependentsPanel' @@ -120,18 +120,23 @@ export const RecordHistoryDrawer = ({ * с самим собой). Revert тоже только для старых (на текущей * uno-op). Wrap чтобы планшетный portrait делал stack. */}
- + {!isLatest && onCompare && (
+ {/* Single-version hint: объясняем, почему Compare/Revert + * отсутствуют. Раньше пользователь видел только JSON-ссылку + * и спрашивал «где кнопки?». Показываем только когда есть + * вообще что показать (canMutate с обоими callback'ами), + * иначе read-only viewer и подсказка не нужна. */} + {isLatest && data.length === 1 && (onCompare || onRevert) && ( +
+ + {t('history.singleVersionHint')} +
+ )} {expanded.has(rec.id) && (
                       {JSON.stringify(rec.data, null, 2)}
diff --git a/ordinis-admin-ui/src/i18n.ts b/ordinis-admin-ui/src/i18n.ts
index 1aa922a..19b0f2f 100644
--- a/ordinis-admin-ui/src/i18n.ts
+++ b/ordinis-admin-ui/src/i18n.ts
@@ -397,6 +397,7 @@ i18n
           'history.compare': 'Сравнить с текущим',
           'history.revert': 'Откатить к v{{v}}',
           'history.revertConfirm': 'Откатить к v{{v}}? Создастся новая активная версия.',
+          'history.singleVersionHint': 'Это единственная версия. Кнопки «Сравнить» и «Откатить» появятся, когда у записи будет более одной версии.',
           // === Lineage (dict-relationships-v2 Phase 1) ===
           'lineage.usedBy.title': 'На этот словарь ссылаются',
           'lineage.usedBy.count_one': '{{count}} связь',
@@ -911,6 +912,7 @@ i18n
           'history.compare': 'Compare with current',
           'history.revert': 'Revert to v{{v}}',
           'history.revertConfirm': 'Revert to v{{v}}? A new active version will be created.',
+          'history.singleVersionHint': 'This is the only version. Compare and Revert actions will appear once the record has more than one version.',
           // === Lineage (dict-relationships-v2 Phase 1) ===
           'lineage.usedBy.title': 'Used by',
           'lineage.usedBy.count_one': '{{count}} reference',