diff --git a/src/components/ecosystem/miniapp-capsule-info-sheet.test.tsx b/src/components/ecosystem/miniapp-capsule-info-sheet.test.tsx
new file mode 100644
index 000000000..9a0f3ded6
--- /dev/null
+++ b/src/components/ecosystem/miniapp-capsule-info-sheet.test.tsx
@@ -0,0 +1,89 @@
+import { describe, expect, it, vi } from 'vitest';
+import { render, screen } from '@testing-library/react';
+import { TestI18nProvider } from '@/test/i18n-mock';
+import { MiniappCapsuleInfoSheet } from './miniapp-capsule-info-sheet';
+
+describe('MiniappCapsuleInfoSheet', () => {
+ it('shows info state when only query params differ', () => {
+ render(
+
+ {t('capsule.infoUrlQueryAdjustedHint')}
+
+ {t('capsule.infoUrlMismatchHint')}
+
+ {url} +
+ + +{errorText ?? t('patternLock.error')}
diff --git a/src/i18n/locales/ar/ecosystem.json b/src/i18n/locales/ar/ecosystem.json index da26aa060..347a20049 100644 --- a/src/i18n/locales/ar/ecosystem.json +++ b/src/i18n/locales/ar/ecosystem.json @@ -111,7 +111,26 @@ }, "capsule": { "more": "المزيد من الخيارات", - "close": "إغلاق التطبيق" + "close": "إغلاق التطبيق", + "infoTitle": "تفاصيل التطبيق", + "infoApp": "التطبيق", + "infoAppId": "معرّف التطبيق", + "infoVersion": "الإصدار", + "infoAuthor": "المطور", + "infoSourceName": "المصدر", + "infoSourceUnknown": "مصدر غير معروف", + "infoRuntime": "بيئة التشغيل", + "infoStrictUrl": "رابط URL صارم", + "infoStrictEnabled": "مفعّل", + "infoStrictDisabled": "غير مفعّل", + "infoEntryUrl": "رابط الدخول المُعدّ", + "infoCurrentUrl": "الرابط الحالي", + "infoUrlQueryAdjustedTitle": "تمت إضافة معاملات إلى رابط التشغيل", + "infoUrlQueryAdjustedHint": "تم تغيير معاملات الاستعلام فقط (للإصدار/التخزين المؤقت)، وهذا غالبًا سلوك متوقع.", + "infoUrlMismatchTitle": "رابط الدخول يختلف عن رابط التشغيل", + "infoUrlMismatchHint": "قد يكون السبب حقن معاملات أو إعادة توجيه أو اختلاف في التخزين المؤقت. يرجى التحقق من توافق التطبيق.", + "infoSourceUrl": "رابط المصدر", + "infoUrlUnavailable": "الرابط غير متاح" }, "detail": { "notFound": "التطبيق غير موجود", diff --git a/src/i18n/locales/en-US/ecosystem.json b/src/i18n/locales/en-US/ecosystem.json index 70148cca4..07a86eac9 100644 --- a/src/i18n/locales/en-US/ecosystem.json +++ b/src/i18n/locales/en-US/ecosystem.json @@ -34,6 +34,29 @@ "description": "Write text to your clipboard" } }, + "capsule": { + "more": "More Options", + "close": "Close App", + "infoTitle": "App Details", + "infoApp": "App", + "infoAppId": "App ID", + "infoVersion": "Version", + "infoAuthor": "Developer", + "infoSourceName": "Source", + "infoSourceUnknown": "Unknown source", + "infoRuntime": "Runtime", + "infoStrictUrl": "Strict URL", + "infoStrictEnabled": "Enabled", + "infoStrictDisabled": "Disabled", + "infoEntryUrl": "Configured Entry URL", + "infoCurrentUrl": "Current URL", + "infoUrlQueryAdjustedTitle": "Runtime URL has extra query parameters", + "infoUrlQueryAdjustedHint": "Only query parameters changed (for version/cache control); this is usually expected.", + "infoUrlMismatchTitle": "Entry URL differs from runtime URL", + "infoUrlMismatchHint": "This may come from query injection, redirects, or cache differences. Please verify app compatibility.", + "infoSourceUrl": "Source URL", + "infoUrlUnavailable": "URL unavailable" + }, "detail": { "permissions": "App Permissions" } diff --git a/src/i18n/locales/en/ecosystem.json b/src/i18n/locales/en/ecosystem.json index 0e702d690..09cada004 100644 --- a/src/i18n/locales/en/ecosystem.json +++ b/src/i18n/locales/en/ecosystem.json @@ -111,7 +111,26 @@ }, "capsule": { "more": "More Options", - "close": "Close App" + "close": "Close App", + "infoTitle": "App Details", + "infoApp": "App", + "infoAppId": "App ID", + "infoVersion": "Version", + "infoAuthor": "Developer", + "infoSourceName": "Source", + "infoSourceUnknown": "Unknown source", + "infoRuntime": "Runtime", + "infoStrictUrl": "Strict URL", + "infoStrictEnabled": "Enabled", + "infoStrictDisabled": "Disabled", + "infoEntryUrl": "Configured Entry URL", + "infoCurrentUrl": "Current URL", + "infoUrlQueryAdjustedTitle": "Runtime URL has extra query parameters", + "infoUrlQueryAdjustedHint": "Only query parameters changed (for version/cache control); this is usually expected.", + "infoUrlMismatchTitle": "Entry URL differs from runtime URL", + "infoUrlMismatchHint": "This may come from query injection, redirects, or cache differences. Please verify app compatibility.", + "infoSourceUrl": "Source URL", + "infoUrlUnavailable": "URL unavailable" }, "detail": { "notFound": "App not found", diff --git a/src/i18n/locales/zh-CN/ecosystem.json b/src/i18n/locales/zh-CN/ecosystem.json index 21adb5cef..db56d867c 100644 --- a/src/i18n/locales/zh-CN/ecosystem.json +++ b/src/i18n/locales/zh-CN/ecosystem.json @@ -111,7 +111,26 @@ }, "capsule": { "more": "更多操作", - "close": "关闭应用" + "close": "关闭应用", + "infoTitle": "应用详情", + "infoApp": "应用", + "infoAppId": "应用 ID", + "infoVersion": "版本", + "infoAuthor": "开发者", + "infoSourceName": "来源", + "infoSourceUnknown": "未知来源", + "infoRuntime": "运行时", + "infoStrictUrl": "严格 URL", + "infoStrictEnabled": "已启用", + "infoStrictDisabled": "未启用", + "infoEntryUrl": "配置入口 URL", + "infoCurrentUrl": "当前 URL", + "infoUrlQueryAdjustedTitle": "运行 URL 已附加参数", + "infoUrlQueryAdjustedHint": "仅附加查询参数(如版本/缓存参数),通常属于正常行为。", + "infoUrlMismatchTitle": "入口 URL 与运行 URL 不一致", + "infoUrlMismatchHint": "可能存在参数注入、重定向或缓存差异,请确认该应用可兼容该运行 URL。", + "infoSourceUrl": "订阅源 URL", + "infoUrlUnavailable": "暂无可用 URL" }, "detail": { "notFound": "应用不存在", diff --git a/src/i18n/locales/zh-TW/ecosystem.json b/src/i18n/locales/zh-TW/ecosystem.json index e1df80389..7a088faff 100644 --- a/src/i18n/locales/zh-TW/ecosystem.json +++ b/src/i18n/locales/zh-TW/ecosystem.json @@ -111,7 +111,26 @@ }, "capsule": { "more": "更多操作", - "close": "關閉應用" + "close": "關閉應用", + "infoTitle": "應用詳情", + "infoApp": "應用", + "infoAppId": "應用 ID", + "infoVersion": "版本", + "infoAuthor": "開發者", + "infoSourceName": "來源", + "infoSourceUnknown": "未知來源", + "infoRuntime": "運行時", + "infoStrictUrl": "嚴格 URL", + "infoStrictEnabled": "已啟用", + "infoStrictDisabled": "未啟用", + "infoEntryUrl": "配置入口 URL", + "infoCurrentUrl": "當前 URL", + "infoUrlQueryAdjustedTitle": "運行 URL 已附加參數", + "infoUrlQueryAdjustedHint": "僅附加查詢參數(如版本/快取參數),通常屬於正常行為。", + "infoUrlMismatchTitle": "入口 URL 與運行 URL 不一致", + "infoUrlMismatchHint": "可能存在參數注入、重導向或快取差異,請確認該應用可相容該運行 URL。", + "infoSourceUrl": "訂閱源 URL", + "infoUrlUnavailable": "暫無可用 URL" }, "detail": { "notFound": "應用不存在", diff --git a/src/test/i18n-mock.tsx b/src/test/i18n-mock.tsx index 7ff249910..79a9852be 100644 --- a/src/test/i18n-mock.tsx +++ b/src/test/i18n-mock.tsx @@ -9,6 +9,7 @@ import zhCNTransaction from '@/i18n/locales/zh-CN/transaction.json' import zhCNNotification from '@/i18n/locales/zh-CN/notification.json' import zhCNWallet from '@/i18n/locales/zh-CN/wallet.json' import zhCNSecurity from '@/i18n/locales/zh-CN/security.json' +import zhCNEcosystem from '@/i18n/locales/zh-CN/ecosystem.json' // 创建测试用的 i18n 实例 const testI18n = i18n.createInstance() @@ -16,7 +17,7 @@ const testI18n = i18n.createInstance() testI18n.use(initReactI18next).init({ lng: 'zh-CN', fallbackLng: 'zh-CN', - ns: ['translation', 'authorize', 'common', 'settings', 'onboarding', 'transaction', 'notification', 'wallet', 'security'], + ns: ['translation', 'authorize', 'common', 'settings', 'onboarding', 'transaction', 'notification', 'wallet', 'security', 'ecosystem'], defaultNS: 'translation', resources: { 'zh-CN': { @@ -124,6 +125,7 @@ testI18n.use(initReactI18next).init({ notification: zhCNNotification, wallet: zhCNWallet, security: zhCNSecurity, + ecosystem: zhCNEcosystem, }, }, interpolation: {