mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
feat(ui): show prefixed naming disabled outside copy mode
Hiding prefixed unless the draft mode was copy made the option hard to discover, and a user who left copy mode with prefixed drafted kept a naming the server would reject on save. Following the approved design, the naming control now always lists flat, standard and prefixed; prefixed is a disabled segment with a "Needs copy mode" tooltip and an info line saying why. Leaving copy mode resets a drafted prefixed back to the saved naming (or flat when prefixed was saved), and a pending tag marks an unsaved naming change. SegmentedControl gains a per-option disabled flag. Its title no longer replaces a text label's accessible name, so the disabled segment is still announced as "prefixed"; icon-only options keep title as name.
This commit is contained in:
@@ -122,6 +122,7 @@ svg.lucide { flex: none; stroke-width: var(--isw); }
|
||||
.ss-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--sunken); border: var(--bw) solid var(--line); border-radius: 9px; }
|
||||
.ss-seg>* { height: 28px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--f); color: var(--ink-2); border-radius: 7px; }
|
||||
.ss-seg>*.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20,19,18,.12); }
|
||||
.ss-seg>*:disabled { opacity: .45; }
|
||||
:root[data-theme="playful"] .ss-seg { border-radius: var(--r-ctl); background: var(--surface); padding: 3px; }
|
||||
:root[data-theme="playful"] .ss-seg>* { border-radius: var(--r-ctl); }
|
||||
:root[data-theme="playful"] .ss-seg>*.on { background: var(--sel); color: var(--sel-ink); box-shadow: none; outline: 1.5px solid var(--line); }
|
||||
|
||||
@@ -4,8 +4,9 @@ interface Option<T extends string> {
|
||||
value: T;
|
||||
label: ReactNode;
|
||||
count?: number;
|
||||
/** Accessible name for icon-only options. */
|
||||
/** Tooltip; also the accessible name of an icon-only option. */
|
||||
title?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
interface SegmentedControlProps<T extends string> {
|
||||
@@ -31,11 +32,12 @@ export default function SegmentedControl<T extends string>({ value, onChange, op
|
||||
key={opt.value}
|
||||
type="button"
|
||||
onClick={() => onChange(opt.value)}
|
||||
disabled={opt.disabled}
|
||||
className={`whitespace-nowrap ${on ? 'on' : ''}`}
|
||||
style={color ? { color } : undefined}
|
||||
aria-pressed={on}
|
||||
title={opt.title}
|
||||
aria-label={opt.title}
|
||||
aria-label={typeof opt.label === 'string' ? undefined : opt.title}
|
||||
>
|
||||
{opt.label}
|
||||
{opt.count != null && <span className="ss-cnt">{opt.count}</span>}
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "Benennung",
|
||||
"targetDetail.namingFlat": "Verschachtelte Skills bekommen flache, mit __ verbundene Namen.",
|
||||
"targetDetail.namingStandard": "Skills verwenden den Namen aus SKILL.md.",
|
||||
"targetDetail.namingPrefixed": "Skills aus einem getrackten Repo heißen <repo>-<name>. Nur im Kopiermodus.",
|
||||
"targetDetail.namingPrefixed": "Skills aus einem getrackten Repo bekommen den Repo-Namen vorangestellt, etwa mattpocock-skills-prototype. Nur im copy-Modus.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed braucht den copy-Modus, weil es den Namen in jeder Kopie umschreibt.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "Braucht den copy-Modus",
|
||||
"targetDetail.pending": "ausstehend",
|
||||
"targetDetail.skipped.one": "{count} Skill kann die Standardbenennung nicht nutzen und wird übersprungen. Probiere flat.",
|
||||
"targetDetail.skipped.other": "{count} Skills können die Standardbenennung nicht nutzen und werden übersprungen. Probiere flat.",
|
||||
"targetDetail.collect": "Sammeln",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "Naming",
|
||||
"targetDetail.namingFlat": "Nested skills get flat names joined with __.",
|
||||
"targetDetail.namingStandard": "Skills use the name from SKILL.md.",
|
||||
"targetDetail.namingPrefixed": "Skills in a tracked repo are named <repo>-<name>. Copy mode only.",
|
||||
"targetDetail.namingPrefixed": "Skills from a tracked repo get the repo name in front, like mattpocock-skills-prototype. Copy mode only.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed needs copy mode, because it rewrites the name inside each copy.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "Needs copy mode",
|
||||
"targetDetail.pending": "pending",
|
||||
"targetDetail.skipped.one": "{count} skill can't use standard naming and is skipped. Try flat.",
|
||||
"targetDetail.skipped.other": "{count} skills can't use standard naming and are skipped. Try flat.",
|
||||
"targetDetail.collect": "Collect",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "Nombres",
|
||||
"targetDetail.namingFlat": "Los skills anidados reciben nombres planos unidos con __.",
|
||||
"targetDetail.namingStandard": "Los skills usan el nombre de SKILL.md.",
|
||||
"targetDetail.namingPrefixed": "Los skills de un repo rastreado se llaman <repo>-<name>. Solo en modo copia.",
|
||||
"targetDetail.namingPrefixed": "Los skills de un repo rastreado llevan delante el nombre del repo, como mattpocock-skills-prototype. Solo en modo copy.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed necesita el modo copy, porque reescribe el nombre dentro de cada copia.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "Necesita el modo copy",
|
||||
"targetDetail.pending": "pendiente",
|
||||
"targetDetail.skipped.one": "{count} skill no puede usar nombres estándar y se omite. Prueba flat.",
|
||||
"targetDetail.skipped.other": "{count} skills no pueden usar nombres estándar y se omiten. Prueba flat.",
|
||||
"targetDetail.collect": "Recopilar",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "نامگذاری",
|
||||
"targetDetail.namingFlat": "اسکیلهای تودرتو نام تخت با __ میگیرند.",
|
||||
"targetDetail.namingStandard": "اسکیلها از نام داخل SKILL.md استفاده میکنند.",
|
||||
"targetDetail.namingPrefixed": "اسکیلهای یک مخزن ردیابیشده نام <repo>-<name> میگیرند. فقط در حالت copy.",
|
||||
"targetDetail.namingPrefixed": "نام مخزن به ابتدای اسکیلهای یک مخزن ردیابیشده اضافه میشود، مثل mattpocock-skills-prototype. فقط در حالت copy.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed به حالت copy نیاز دارد، چون نام را درون هر کپی بازنویسی میکند.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "به حالت copy نیاز دارد",
|
||||
"targetDetail.pending": "در انتظار",
|
||||
"targetDetail.skipped.one": "{count} اسکیل نمیتواند از نامگذاری standard استفاده کند و نادیده گرفته میشود. flat را امتحان کنید.",
|
||||
"targetDetail.skipped.other": "{count} اسکیل نمیتوانند از نامگذاری standard استفاده کنند و نادیده گرفته میشوند. flat را امتحان کنید.",
|
||||
"targetDetail.collect": "جمعآوری",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "Nommage",
|
||||
"targetDetail.namingFlat": "Les skills imbriqués reçoivent des noms à plat joints par __.",
|
||||
"targetDetail.namingStandard": "Les skills utilisent le nom de SKILL.md.",
|
||||
"targetDetail.namingPrefixed": "Les skills d'un dépôt suivi s'appellent <repo>-<name>. Mode copie uniquement.",
|
||||
"targetDetail.namingPrefixed": "Les skills d'un dépôt suivi prennent le nom du dépôt en préfixe, comme mattpocock-skills-prototype. Mode copy uniquement.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed nécessite le mode copy, car il réécrit le nom dans chaque copie.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "Nécessite le mode copy",
|
||||
"targetDetail.pending": "en attente",
|
||||
"targetDetail.skipped.one": "{count} skill ne peut pas utiliser le nommage standard et est ignoré. Essayez flat.",
|
||||
"targetDetail.skipped.other": "{count} skills ne peuvent pas utiliser le nommage standard et sont ignorés. Essayez flat.",
|
||||
"targetDetail.collect": "Collecter",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "Penamaan",
|
||||
"targetDetail.namingFlat": "Skill bertingkat mendapat nama datar yang digabung dengan __.",
|
||||
"targetDetail.namingStandard": "Skill memakai nama dari SKILL.md.",
|
||||
"targetDetail.namingPrefixed": "Skill dari repo yang dilacak bernama <repo>-<name>. Hanya mode copy.",
|
||||
"targetDetail.namingPrefixed": "Skill dari repo yang dilacak diawali nama repo, seperti mattpocock-skills-prototype. Hanya mode copy.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed butuh mode copy, karena menulis ulang nama di dalam setiap salinan.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "Butuh mode copy",
|
||||
"targetDetail.pending": "tertunda",
|
||||
"targetDetail.skipped.one": "{count} skill tidak bisa memakai penamaan standard dan dilewati. Coba flat.",
|
||||
"targetDetail.skipped.other": "{count} skill tidak bisa memakai penamaan standard dan dilewati. Coba flat.",
|
||||
"targetDetail.collect": "Kumpulkan",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "命名",
|
||||
"targetDetail.namingFlat": "ネストしたスキルは __ でつないだフラット名になります。",
|
||||
"targetDetail.namingStandard": "スキルは SKILL.md の名前を使います。",
|
||||
"targetDetail.namingPrefixed": "追跡リポジトリのスキルは <repo>-<name> という名前になります。copy モードのみ。",
|
||||
"targetDetail.namingPrefixed": "追跡リポジトリのスキルは先頭にリポジトリ名が付きます(例: mattpocock-skills-prototype)。copy モードのみ。",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed は各コピー内の名前を書き換えるため、copy モードが必要です。",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "copy モードが必要です",
|
||||
"targetDetail.pending": "未保存",
|
||||
"targetDetail.skipped.one": "{count} 件のスキルは standard 命名を使えないためスキップされます。flat を試してください。",
|
||||
"targetDetail.skipped.other": "{count} 件のスキルは standard 命名を使えないためスキップされます。flat を試してください。",
|
||||
"targetDetail.collect": "収集",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "이름 지정",
|
||||
"targetDetail.namingFlat": "중첩된 skill은 __로 이은 평면 이름을 받습니다.",
|
||||
"targetDetail.namingStandard": "skill은 SKILL.md의 이름을 사용합니다.",
|
||||
"targetDetail.namingPrefixed": "추적 저장소의 skill은 <repo>-<name> 이름을 받습니다. copy 모드 전용입니다.",
|
||||
"targetDetail.namingPrefixed": "추적 저장소의 skill은 앞에 저장소 이름이 붙습니다(예: mattpocock-skills-prototype). copy 모드 전용입니다.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed는 각 복사본 안의 이름을 다시 쓰기 때문에 copy 모드가 필요합니다.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "copy 모드가 필요합니다",
|
||||
"targetDetail.pending": "저장 전",
|
||||
"targetDetail.skipped.one": "skill {count}개는 standard 이름을 쓸 수 없어 건너뜁니다. flat을 사용해 보세요.",
|
||||
"targetDetail.skipped.other": "skill {count}개는 standard 이름을 쓸 수 없어 건너뜁니다. flat을 사용해 보세요.",
|
||||
"targetDetail.collect": "수집",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "Nomes",
|
||||
"targetDetail.namingFlat": "Skills aninhadas recebem nomes planos unidos por __.",
|
||||
"targetDetail.namingStandard": "Skills usam o nome do SKILL.md.",
|
||||
"targetDetail.namingPrefixed": "Skills de um repo rastreado se chamam <repo>-<name>. Só no modo cópia.",
|
||||
"targetDetail.namingPrefixed": "Skills de um repo rastreado ganham o nome do repo na frente, como mattpocock-skills-prototype. Só no modo copy.",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed precisa do modo copy, porque reescreve o nome dentro de cada cópia.",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "Precisa do modo copy",
|
||||
"targetDetail.pending": "pendente",
|
||||
"targetDetail.skipped.one": "{count} skill não pode usar nomes standard e é ignorada. Tente flat.",
|
||||
"targetDetail.skipped.other": "{count} skills não podem usar nomes standard e são ignoradas. Tente flat.",
|
||||
"targetDetail.collect": "Coletar",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "命名",
|
||||
"targetDetail.namingFlat": "嵌套 Skill 使用以 __ 连接的扁平名称。",
|
||||
"targetDetail.namingStandard": "Skill 使用 SKILL.md 中的名称。",
|
||||
"targetDetail.namingPrefixed": "追踪仓库中的 Skill 命名为 <repo>-<name>。仅限 copy 模式。",
|
||||
"targetDetail.namingPrefixed": "追踪仓库中的 Skill 会在前面加上仓库名,例如 mattpocock-skills-prototype。仅限 copy 模式。",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed 需要 copy 模式,因为它会改写每份副本里的名称。",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "需要 copy 模式",
|
||||
"targetDetail.pending": "未保存",
|
||||
"targetDetail.skipped.one": "{count} 个 Skill 无法使用 standard 命名而被跳过。试试 flat。",
|
||||
"targetDetail.skipped.other": "{count} 个 Skill 无法使用 standard 命名而被跳过。试试 flat。",
|
||||
"targetDetail.collect": "收集",
|
||||
|
||||
@@ -1788,7 +1788,10 @@
|
||||
"targetDetail.naming": "命名",
|
||||
"targetDetail.namingFlat": "巢狀 Skill 使用以 __ 串接的扁平名稱。",
|
||||
"targetDetail.namingStandard": "Skill 使用 SKILL.md 裡的名稱。",
|
||||
"targetDetail.namingPrefixed": "追蹤儲存庫中的 Skill 命名為 <repo>-<name>。僅限 copy 模式。",
|
||||
"targetDetail.namingPrefixed": "追蹤儲存庫中的 Skill 會在前面加上儲存庫名稱,例如 mattpocock-skills-prototype。僅限 copy 模式。",
|
||||
"targetDetail.prefixedNeedsCopy": "prefixed 需要 copy 模式,因為它會改寫每份副本裡的名稱。",
|
||||
"targetDetail.prefixedNeedsCopyTitle": "需要 copy 模式",
|
||||
"targetDetail.pending": "未儲存",
|
||||
"targetDetail.skipped.one": "{count} 個 Skill 無法使用 standard 命名而被略過。試試 flat。",
|
||||
"targetDetail.skipped.other": "{count} 個 Skills 無法使用 standard 命名而被略過。試試 flat。",
|
||||
"targetDetail.collect": "收集",
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { MemoryRouter, Route, Routes } from 'react-router-dom';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { api } from '../api/client';
|
||||
import type { Target } from '../api/client';
|
||||
import { ToastProvider } from '../components/Toast';
|
||||
import { I18nProvider } from '../i18n';
|
||||
import TargetDetailPage from './TargetDetailPage';
|
||||
|
||||
vi.mock('../api/client', async (load) => {
|
||||
const actual = await load<typeof import('../api/client')>();
|
||||
return {
|
||||
...actual,
|
||||
api: {
|
||||
...actual.api,
|
||||
listTargets: vi.fn(), getTargetInstructions: vi.fn(), listTargetFiles: vi.fn(),
|
||||
previewSyncMatrix: vi.fn(), listExtraExtensions: vi.fn(),
|
||||
},
|
||||
};
|
||||
});
|
||||
vi.mock('../hooks/useSharedQueries', () => {
|
||||
const idle = () => ({ data: undefined });
|
||||
return { useAvailableTargetsQuery: idle, useHooksQuery: idle, useMcpQuery: idle };
|
||||
});
|
||||
|
||||
const never = () => new Promise<never>(() => {});
|
||||
|
||||
function renderPage(mode: string, targetNaming: string) {
|
||||
const target = { name: 'claude', path: '/home/dev/.claude/skills', mode, targetNaming, skillsEnabled: true, linkedCount: 0, localCount: 0, include: [], exclude: [] } as unknown as Target;
|
||||
vi.mocked(api.listTargets).mockResolvedValue({ targets: [target] } as Awaited<ReturnType<typeof api.listTargets>>);
|
||||
const client = new QueryClient({ defaultOptions: { queries: { retry: false } } });
|
||||
return render(
|
||||
<MemoryRouter initialEntries={['/targets/claude']}>
|
||||
<QueryClientProvider client={client}><I18nProvider><ToastProvider>
|
||||
<Routes><Route path="/targets/:name" element={<TargetDetailPage />} /></Routes>
|
||||
</ToastProvider></I18nProvider></QueryClientProvider>
|
||||
</MemoryRouter>,
|
||||
);
|
||||
}
|
||||
|
||||
const needsCopy = 'prefixed needs copy mode, because it rewrites the name inside each copy.';
|
||||
|
||||
describe('TargetDetailPage naming', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
for (const fn of [api.getTargetInstructions, api.listTargetFiles, api.previewSyncMatrix, api.listExtraExtensions]) vi.mocked(fn).mockImplementation(never);
|
||||
});
|
||||
|
||||
it('keeps prefixed visible but disabled outside copy mode, and says why', async () => {
|
||||
renderPage('merge', 'flat');
|
||||
|
||||
const prefixed = await screen.findByRole('button', { name: 'prefixed' });
|
||||
expect(prefixed).toBeDisabled();
|
||||
expect(prefixed).toHaveAttribute('title', 'Needs copy mode');
|
||||
expect(screen.getByText(needsCopy)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('enables prefixed in copy mode and marks the unsaved naming as pending', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderPage('copy', 'flat');
|
||||
|
||||
const prefixed = await screen.findByRole('button', { name: 'prefixed' });
|
||||
expect(prefixed).toBeEnabled();
|
||||
expect(screen.queryByText(needsCopy)).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('pending')).not.toBeInTheDocument();
|
||||
|
||||
await user.click(prefixed);
|
||||
expect(prefixed).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.getByText('pending')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('puts the saved naming back when leaving copy mode with prefixed drafted', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderPage('copy', 'standard');
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: 'prefixed' }));
|
||||
await user.click(screen.getByRole('radio', { name: /merge/ }));
|
||||
|
||||
expect(screen.getByRole('button', { name: 'standard' })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.queryByText('pending')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('falls back to flat when leaving copy mode with prefixed already saved', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderPage('copy', 'prefixed');
|
||||
|
||||
await user.click(await screen.findByRole('radio', { name: /merge/ }));
|
||||
|
||||
expect(screen.getByRole('button', { name: 'flat' })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.getByText('pending')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
||||
import { keepPreviousData, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { ArrowDownToLine, CirclePause, Folder, Plus, Target as TargetIcon } from 'lucide-react';
|
||||
import { ArrowDownToLine, CirclePause, Folder, Info, Plus, Target as TargetIcon } from 'lucide-react';
|
||||
import { api, type Target } from '../api/client';
|
||||
import Button from '../components/Button';
|
||||
import CollectDialog from '../components/CollectDialog';
|
||||
@@ -164,6 +164,10 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] }
|
||||
const setFiltersFor = (next: { include: string[]; exclude: string[] }) =>
|
||||
setDraft(agent ? { ...draft, agentInclude: next.include, agentExclude: next.exclude } : { ...draft, ...next });
|
||||
const local = agent ? target.agentLocalCount ?? 0 : target.localCount;
|
||||
// prefixed rewrites name: inside each copy, so it cannot outlive copy mode.
|
||||
const prefixedOff = draft.mode !== 'copy';
|
||||
const setSkillsMode = (m: string) =>
|
||||
setDraft({ ...draft, mode: m, ...(m !== 'copy' && draft.naming === 'prefixed' && { naming: saved.naming === 'prefixed' ? 'flat' : saved.naming }) });
|
||||
|
||||
const tabCount = (k: (typeof tabs)[number]) =>
|
||||
k === 'skill' && !skillsOn ? null : (k === 'mcp' ? mcp.data && serverCount(mcp.data, client)
|
||||
@@ -311,18 +315,24 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] }
|
||||
)}
|
||||
<div className="flex flex-col gap-3">
|
||||
<h2 className="ss-h2">{t('targetDetail.syncMode')}</h2>
|
||||
<ModePicker kind={kind} mode={mode} onChange={(m) => setDraft(agent ? { ...draft, agentMode: m } : { ...draft, mode: m })} disabled={saving || (agent && draft.agentExtension !== '')} />
|
||||
<ModePicker kind={kind} mode={mode} onChange={(m) => (agent ? setDraft({ ...draft, agentMode: m }) : setSkillsMode(m))} disabled={saving || (agent && draft.agentExtension !== '')} />
|
||||
</div>
|
||||
|
||||
{!agent && draft.mode !== 'symlink' && (
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
||||
<span className="text-[13px] font-semibold">{t('targetDetail.naming')}</span>
|
||||
<span className="flex items-center gap-2 text-[13px] font-semibold">
|
||||
{t('targetDetail.naming')}
|
||||
{draft.naming !== saved.naming && <span className="ss-tag inf">{t('targetDetail.pending')}</span>}
|
||||
</span>
|
||||
<span className="text-[13px] text-ink-2">{t(draft.naming === 'standard' ? 'targetDetail.namingStandard' : draft.naming === 'prefixed' ? 'targetDetail.namingPrefixed' : 'targetDetail.namingFlat')}</span>
|
||||
</div>
|
||||
<SegmentedControl value={draft.naming} onChange={(naming) => setDraft({ ...draft, naming })} options={[{ value: 'flat', label: 'flat' }, { value: 'standard', label: 'standard' }, ...(draft.mode === 'copy' || draft.naming === 'prefixed' ? [{ value: 'prefixed', label: 'prefixed' }] : [])]} />
|
||||
<SegmentedControl value={draft.naming} onChange={(naming) => setDraft({ ...draft, naming })} options={[{ value: 'flat', label: 'flat' }, { value: 'standard', label: 'standard' }, { value: 'prefixed', label: 'prefixed', disabled: prefixedOff, title: prefixedOff ? t('targetDetail.prefixedNeedsCopyTitle') : undefined }]} />
|
||||
</div>
|
||||
{prefixedOff && (
|
||||
<span className="flex items-center gap-1.5 text-[13px] text-ink-3"><Info size={14} className="shrink-0" />{t('targetDetail.prefixedNeedsCopy')}</span>
|
||||
)}
|
||||
{saved.naming !== 'flat' && (target.skippedSkillCount ?? 0) > 0 && (
|
||||
<span className="text-[13px] text-warn">{t(plural('targetDetail.skipped', target.skippedSkillCount), { count: target.skippedSkillCount })}</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user