From 7192aed71c7b7be58a3a1551933202da3ed03f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B8=D0=BC=D0=B8=D0=BD?= Date: Tue, 12 May 2026 08:57:44 +0000 Subject: [PATCH] =?UTF-8?q?fix(history):=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D0=BA=D0=B0=20=D0=B8=20Button-=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20=D1=83=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=201=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/record/RecordHistoryDrawer.tsx | 24 +++++++++++++++---- ordinis-admin-ui/src/i18n.ts | 2 ++ 2 files changed, 22 insertions(+), 4 deletions(-) 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',