From 3d55f4cb1adfbceebe2f9e3aacabe2f2fa2797fa Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 02:23:46 +0800 Subject: [PATCH] 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. --- ui/src/components.css | 1 + ui/src/components/SegmentedControl.tsx | 6 +- ui/src/i18n/locales/de.json | 5 +- ui/src/i18n/locales/en.json | 5 +- ui/src/i18n/locales/es.json | 5 +- ui/src/i18n/locales/fa.json | 5 +- ui/src/i18n/locales/fr.json | 5 +- ui/src/i18n/locales/id.json | 5 +- ui/src/i18n/locales/ja.json | 5 +- ui/src/i18n/locales/ko.json | 5 +- ui/src/i18n/locales/pt-BR.json | 5 +- ui/src/i18n/locales/zh-CN.json | 5 +- ui/src/i18n/locales/zh-TW.json | 5 +- ui/src/pages/TargetDetailPage.test.tsx | 94 ++++++++++++++++++++++++++ ui/src/pages/TargetDetailPage.tsx | 18 +++-- 15 files changed, 157 insertions(+), 17 deletions(-) create mode 100644 ui/src/pages/TargetDetailPage.test.tsx diff --git a/ui/src/components.css b/ui/src/components.css index 49dd2b97e..752ed0c39 100644 --- a/ui/src/components.css +++ b/ui/src/components.css @@ -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); } diff --git a/ui/src/components/SegmentedControl.tsx b/ui/src/components/SegmentedControl.tsx index 8e42a4775..fc733269f 100644 --- a/ui/src/components/SegmentedControl.tsx +++ b/ui/src/components/SegmentedControl.tsx @@ -4,8 +4,9 @@ interface Option { 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 { @@ -31,11 +32,12 @@ export default function SegmentedControl({ 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 && {opt.count}} diff --git a/ui/src/i18n/locales/de.json b/ui/src/i18n/locales/de.json index 007f2aa7e..5d4b4f246 100644 --- a/ui/src/i18n/locales/de.json +++ b/ui/src/i18n/locales/de.json @@ -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 -. 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", diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index c9b7dc592..8d9d1e45b 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -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 -. 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", diff --git a/ui/src/i18n/locales/es.json b/ui/src/i18n/locales/es.json index dce63127c..b5e4831be 100644 --- a/ui/src/i18n/locales/es.json +++ b/ui/src/i18n/locales/es.json @@ -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 -. 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", diff --git a/ui/src/i18n/locales/fa.json b/ui/src/i18n/locales/fa.json index 40d99d43d..e6d92b696 100644 --- a/ui/src/i18n/locales/fa.json +++ b/ui/src/i18n/locales/fa.json @@ -1788,7 +1788,10 @@ "targetDetail.naming": "نام‌گذاری", "targetDetail.namingFlat": "اسکیل‌های تودرتو نام تخت با __ می‌گیرند.", "targetDetail.namingStandard": "اسکیل‌ها از نام داخل SKILL.md استفاده می‌کنند.", - "targetDetail.namingPrefixed": "اسکیل‌های یک مخزن ردیابی‌شده نام - می‌گیرند. فقط در حالت 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": "جمع‌آوری", diff --git a/ui/src/i18n/locales/fr.json b/ui/src/i18n/locales/fr.json index a8b6d6504..b4ce5d4cb 100644 --- a/ui/src/i18n/locales/fr.json +++ b/ui/src/i18n/locales/fr.json @@ -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 -. 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", diff --git a/ui/src/i18n/locales/id.json b/ui/src/i18n/locales/id.json index c399b38fb..1e1354cb1 100644 --- a/ui/src/i18n/locales/id.json +++ b/ui/src/i18n/locales/id.json @@ -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 -. 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", diff --git a/ui/src/i18n/locales/ja.json b/ui/src/i18n/locales/ja.json index 88096b057..b626b09d8 100644 --- a/ui/src/i18n/locales/ja.json +++ b/ui/src/i18n/locales/ja.json @@ -1788,7 +1788,10 @@ "targetDetail.naming": "命名", "targetDetail.namingFlat": "ネストしたスキルは __ でつないだフラット名になります。", "targetDetail.namingStandard": "スキルは SKILL.md の名前を使います。", - "targetDetail.namingPrefixed": "追跡リポジトリのスキルは - という名前になります。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": "収集", diff --git a/ui/src/i18n/locales/ko.json b/ui/src/i18n/locales/ko.json index a35ecca92..f94e7901a 100644 --- a/ui/src/i18n/locales/ko.json +++ b/ui/src/i18n/locales/ko.json @@ -1788,7 +1788,10 @@ "targetDetail.naming": "이름 지정", "targetDetail.namingFlat": "중첩된 skill은 __로 이은 평면 이름을 받습니다.", "targetDetail.namingStandard": "skill은 SKILL.md의 이름을 사용합니다.", - "targetDetail.namingPrefixed": "추적 저장소의 skill은 - 이름을 받습니다. 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": "수집", diff --git a/ui/src/i18n/locales/pt-BR.json b/ui/src/i18n/locales/pt-BR.json index 8c693b435..564000136 100644 --- a/ui/src/i18n/locales/pt-BR.json +++ b/ui/src/i18n/locales/pt-BR.json @@ -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 -. 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", diff --git a/ui/src/i18n/locales/zh-CN.json b/ui/src/i18n/locales/zh-CN.json index 658f4f909..8a9243e7d 100644 --- a/ui/src/i18n/locales/zh-CN.json +++ b/ui/src/i18n/locales/zh-CN.json @@ -1788,7 +1788,10 @@ "targetDetail.naming": "命名", "targetDetail.namingFlat": "嵌套 Skill 使用以 __ 连接的扁平名称。", "targetDetail.namingStandard": "Skill 使用 SKILL.md 中的名称。", - "targetDetail.namingPrefixed": "追踪仓库中的 Skill 命名为 -。仅限 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": "收集", diff --git a/ui/src/i18n/locales/zh-TW.json b/ui/src/i18n/locales/zh-TW.json index 916155d38..5e247813e 100644 --- a/ui/src/i18n/locales/zh-TW.json +++ b/ui/src/i18n/locales/zh-TW.json @@ -1788,7 +1788,10 @@ "targetDetail.naming": "命名", "targetDetail.namingFlat": "巢狀 Skill 使用以 __ 串接的扁平名稱。", "targetDetail.namingStandard": "Skill 使用 SKILL.md 裡的名稱。", - "targetDetail.namingPrefixed": "追蹤儲存庫中的 Skill 命名為 -。僅限 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": "收集", diff --git a/ui/src/pages/TargetDetailPage.test.tsx b/ui/src/pages/TargetDetailPage.test.tsx new file mode 100644 index 000000000..06993ffff --- /dev/null +++ b/ui/src/pages/TargetDetailPage.test.tsx @@ -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(); + 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(() => {}); + +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>); + const client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + return render( + + + } /> + + , + ); +} + +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(); + }); +}); diff --git a/ui/src/pages/TargetDetailPage.tsx b/ui/src/pages/TargetDetailPage.tsx index 30833cec3..5e9e1694e 100644 --- a/ui/src/pages/TargetDetailPage.tsx +++ b/ui/src/pages/TargetDetailPage.tsx @@ -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[] } )}

{t('targetDetail.syncMode')}

- setDraft(agent ? { ...draft, agentMode: m } : { ...draft, mode: m })} disabled={saving || (agent && draft.agentExtension !== '')} /> + (agent ? setDraft({ ...draft, agentMode: m }) : setSkillsMode(m))} disabled={saving || (agent && draft.agentExtension !== '')} />
{!agent && draft.mode !== 'symlink' && (
- {t('targetDetail.naming')} + + {t('targetDetail.naming')} + {draft.naming !== saved.naming && {t('targetDetail.pending')}} + {t(draft.naming === 'standard' ? 'targetDetail.namingStandard' : draft.naming === 'prefixed' ? 'targetDetail.namingPrefixed' : 'targetDetail.namingFlat')}
- setDraft({ ...draft, naming })} options={[{ value: 'flat', label: 'flat' }, { value: 'standard', label: 'standard' }, ...(draft.mode === 'copy' || draft.naming === 'prefixed' ? [{ value: 'prefixed', label: 'prefixed' }] : [])]} /> + setDraft({ ...draft, naming })} options={[{ value: 'flat', label: 'flat' }, { value: 'standard', label: 'standard' }, { value: 'prefixed', label: 'prefixed', disabled: prefixedOff, title: prefixedOff ? t('targetDetail.prefixedNeedsCopyTitle') : undefined }]} />
+ {prefixedOff && ( + {t('targetDetail.prefixedNeedsCopy')} + )} {saved.naming !== 'flat' && (target.skippedSkillCount ?? 0) > 0 && ( {t(plural('targetDetail.skipped', target.skippedSkillCount), { count: target.skippedSkillCount })} )}