feat(editor): scope-colored InfoPanel badge + Time-travel label

Per redesign (4) prototype.

- InfoPanel scope badge: было `<Badge variant="info">` (generic light bg).
  Стало scope-color filled chip: PUBLIC→accent-bg, INTERNAL→warn-bg,
  RESTRICTED→pink-bg. Matches table SCOPE col + filter pills.
- i18n: timeTravel.button RU "Просмотр на дату" → "Time-travel…"; EN
  "View as of date" → "Time-travel…". User confirmed: "Time-travel label
  оставь" — единый label везде, без локализации (бренд-слово как редизайн).
This commit is contained in:
Zimin A.N.
2026-05-11 19:46:33 +03:00
parent ac1ca8d035
commit e580a04007
2 changed files with 18 additions and 5 deletions
@@ -2,11 +2,17 @@ import { useMemo } from 'react'
import { Link } from '@tanstack/react-router'
import { useTranslation } from 'react-i18next'
import { ClockCounterClockwiseIcon, MapTrifoldIcon, DownloadSimpleIcon, ArrowRightIcon } from '@phosphor-icons/react'
import { Badge } from '@/ui'
import { useDictionaryDependents } from '@/api/queries'
import type { DictionaryDetail, OnCloseAction, SchemaDependent } from '@/api/client'
import type { DataScope, DictionaryDetail, OnCloseAction, SchemaDependent } from '@/api/client'
import { cn } from '@/lib/utils'
/** Scope badge — solid scope-color bg per redesign prototype. */
const SCOPE_BADGE_CLASS: Record<DataScope, string> = {
PUBLIC: 'bg-accent-bg text-accent',
INTERNAL: 'bg-warn-bg text-warn',
RESTRICTED: 'bg-pink-bg text-pink',
}
/**
* EditorInfoPanel — left rail с dict metadata per handoff prototype Screen 2.
*
@@ -47,7 +53,14 @@ export function EditorInfoPanel({ detail, recordCount, actions }: EditorInfoPane
return (
<aside className="lg:sticky lg:top-2 self-start space-y-4 lg:max-h-[calc(100vh-7rem)] lg:overflow-y-auto pr-2">
{/* Scope badge — top of panel */}
<Badge variant="info">{detail.scope}</Badge>
<span
className={cn(
'inline-flex items-center px-2.5 py-1 rounded-md text-cap tracking-[0.16em] font-semibold uppercase',
SCOPE_BADGE_CLASS[detail.scope],
)}
>
{detail.scope}
</span>
{/* Description */}
{detail.description && (
+2 -2
View File
@@ -411,7 +411,7 @@ i18n
'lineage.refs.stale': 'обновлено {{minutes}} мин назад',
'lineage.refs.staleHint': 'Данные из materialized view; обновляются раз в минуту. Закрытые между обновлениями записи отфильтрованы по valid_to.',
// === Time-travel (CEO plan v1 stretch) ===
'timeTravel.button': 'Просмотр на дату',
'timeTravel.button': 'Time-travel…',
'timeTravel.label': 'Активная версия на момент',
'timeTravel.viewing': 'Просмотр на момент: {{date}}',
'timeTravel.clear': 'Сбросить',
@@ -911,7 +911,7 @@ i18n
'lineage.refs.stale': 'refreshed {{minutes}} min ago',
'lineage.refs.staleHint': 'Data from materialized view, refreshed once per minute. Records closed between refreshes are filtered by valid_to.',
// === Time-travel (CEO plan v1 stretch) ===
'timeTravel.button': 'View as of date',
'timeTravel.button': 'Time-travel…',
'timeTravel.label': 'Active version as of',
'timeTravel.viewing': 'Viewing as of: {{date}}',
'timeTravel.clear': 'Reset',