fix(desktop): drop the installed-skills locale keys the rollback restored

b64069a3 removed the installed-skills overview and its nine
market.installedSkills.* / market.section.installed keys from all five
locales. e9b53f68, its immediate child, reverted the locale files
wholesale -- and because the overview (8061b9b2) predates the shadcn
migration those keys were inside the range being restored, so they came
straight back.

The component that read them is gone, and nothing else references them:
`git grep -E "market\.installedSkills|market\.section\.installed"`
outside the locale files returns nothing. Every locale kept the same
key count, so a parity check has no way to notice.

Re-applies b64069a3's deletion, and adds a test that fails if the keys
reappear -- the previous deletion was undone by a mechanical revert, so
a guard is worth more here than the removal itself.
This commit is contained in:
程序员阿江(Relakkes) 2026-07-25 22:02:10 +08:00
parent 8678e49a4d
commit e04337342f
6 changed files with 19 additions and 45 deletions

View File

@ -2,6 +2,13 @@ import { act, renderHook } from '@testing-library/react'
import { afterEach, describe, expect, it } from 'vitest'
import { useSettingsStore } from '../stores/settingsStore'
import { translate, useTranslation } from '.'
import { en } from './locales/en'
import { zh } from './locales/zh'
import { zh as zhTW } from './locales/zh-TW'
import { jp } from './locales/jp'
import { kr } from './locales/kr'
const locales = { en, zh, 'zh-TW': zhTW, jp, kr }
describe('useTranslation', () => {
afterEach(() => {
@ -58,4 +65,16 @@ describe('useTranslation', () => {
expect(translate('en', 'settings.general.storagePortableTitle')).toContain('custom')
expect(translate('zh', 'settings.general.storagePortableTitle')).toContain('自定义')
})
// The installed-skills overview was dropped in b64069a3, but the UI rollback
// right after it restored the locale files wholesale and carried its keys back
// in. Every locale kept the same key count, so a parity check cannot see this.
it('carries no key for the removed installed-skills overview', () => {
for (const [name, locale] of Object.entries(locales)) {
const resurrected = Object.keys(locale).filter(
key => key.startsWith('market.installedSkills.') || key === 'market.section.installed',
)
expect(resurrected, `${name} still defines removed installed-skills keys`).toEqual([])
}
})
})

View File

@ -2355,15 +2355,6 @@ export const en = {
'sidebar.market': 'Skills Market',
'market.title': 'Skills Market',
'market.subtitle': 'Browse, preview and install skills from ClawHub and SkillHub.',
'market.section.installed': 'Installed',
'market.installedSkills.refresh': 'Refresh installed skills',
'market.installedSkills.searchPlaceholder': 'Search installed skills',
'market.installedSkills.filterLabel': 'Filter installed skills',
'market.installedSkills.filter.all': 'All',
'market.installedSkills.filter.personal': 'Personal',
'market.installedSkills.filter.system': 'System',
'market.installedSkills.showMore': 'View {count} more',
'market.installedSkills.showLess': 'Show less',
'market.searchPlaceholder': 'Search skills by name, keyword…',
'market.clearSearch': 'Clear search',
'market.resultCount': '{count} skills',

View File

@ -2357,15 +2357,6 @@ export const jp: Record<TranslationKey, string> = {
'sidebar.market': 'スキルマーケット',
'market.title': 'スキルマーケット',
'market.subtitle': 'ClawHub と SkillHub のスキルを閲覧・プレビュー・インストールできます。',
'market.section.installed': 'インストール済み',
'market.installedSkills.refresh': 'インストール済みスキルを更新',
'market.installedSkills.searchPlaceholder': 'インストール済みスキルを検索',
'market.installedSkills.filterLabel': 'インストール済みスキルを絞り込む',
'market.installedSkills.filter.all': 'すべて',
'market.installedSkills.filter.personal': '個人',
'market.installedSkills.filter.system': 'システム',
'market.installedSkills.showMore': '他 {count} 件を表示',
'market.installedSkills.showLess': '折りたたむ',
'market.searchPlaceholder': 'スキル名・キーワードで検索…',
'market.clearSearch': '検索をクリア',
'market.resultCount': '{count} 件のスキル',

View File

@ -2357,15 +2357,6 @@ export const kr: Record<TranslationKey, string> = {
'sidebar.market': '스킬 마켓',
'market.title': '스킬 마켓',
'market.subtitle': 'ClawHub와 SkillHub의 스킬을 탐색·미리보기·설치할 수 있습니다.',
'market.section.installed': '설치됨',
'market.installedSkills.refresh': '설치된 스킬 새로고침',
'market.installedSkills.searchPlaceholder': '설치된 스킬 검색',
'market.installedSkills.filterLabel': '설치된 스킬 필터',
'market.installedSkills.filter.all': '전체',
'market.installedSkills.filter.personal': '개인',
'market.installedSkills.filter.system': '시스템',
'market.installedSkills.showMore': '{count}개 더 보기',
'market.installedSkills.showLess': '접기',
'market.searchPlaceholder': '스킬 이름, 키워드로 검색…',
'market.clearSearch': '검색 지우기',
'market.resultCount': '{count}개의 스킬',

View File

@ -2357,15 +2357,6 @@ export const zh: Record<TranslationKey, string> = {
'sidebar.market': '技能市集',
'market.title': '技能市集',
'market.subtitle': '瀏覽、預覽並安裝來自 ClawHub 與 SkillHub 的技能。',
'market.section.installed': '已安裝',
'market.installedSkills.refresh': '重新整理已安裝技能',
'market.installedSkills.searchPlaceholder': '搜尋已安裝技能',
'market.installedSkills.filterLabel': '篩選已安裝技能',
'market.installedSkills.filter.all': '全部',
'market.installedSkills.filter.personal': '個人',
'market.installedSkills.filter.system': '系統',
'market.installedSkills.showMore': '查看另外 {count} 項',
'market.installedSkills.showLess': '收合',
'market.searchPlaceholder': '依名稱、關鍵字搜尋技能…',
'market.clearSearch': '清除搜尋',
'market.resultCount': '{count} 個技能',

View File

@ -2357,15 +2357,6 @@ export const zh: Record<TranslationKey, string> = {
'sidebar.market': '技能市场',
'market.title': '技能市场',
'market.subtitle': '浏览、预览并安装来自 ClawHub 与 SkillHub 的技能。',
'market.section.installed': '已安装',
'market.installedSkills.refresh': '刷新已安装技能',
'market.installedSkills.searchPlaceholder': '搜索已安装技能',
'market.installedSkills.filterLabel': '筛选已安装技能',
'market.installedSkills.filter.all': '全部',
'market.installedSkills.filter.personal': '个人',
'market.installedSkills.filter.system': '系统',
'market.installedSkills.showMore': '查看另外 {count} 项',
'market.installedSkills.showLess': '收起',
'market.searchPlaceholder': '按名称、关键词搜索技能…',
'market.clearSearch': '清除搜索',
'market.resultCount': '{count} 个技能',