Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0fceeeb
feat: 优化UI组件样式和交互体验
SummerRay160 Apr 29, 2026
bc1f547
Update prose class mapping for font sizes
SummerRay160 Apr 29, 2026
47c3495
Adjust SearchBar tooltip/z-index and copy
SummerRay160 Apr 30, 2026
77f1fb0
feat(store): 添加应用状态水合检测
SummerRay160 Apr 30, 2026
2fc7158
feat(SearchBar): 根据AI配置动态显示搜索模式说明
SummerRay160 Apr 30, 2026
6b056a9
refactor(App): 调整加载状态渲染位置以优化代码结构
SummerRay160 Apr 30, 2026
87a7138
refactor(App): 调整加载状态和认证检查的顺序
SummerRay160 Apr 30, 2026
856cf8e
fix(SearchBar): 更新搜索模式描述文本为回退模式说明
SummerRay160 Apr 30, 2026
e5ba02c
Update src/store/useAppStore.ts
SummerRay160 Apr 30, 2026
f0dc7dc
feat(翻译): 添加Markdown文档翻译功能
SummerRay160 Apr 30, 2026
b3b0a09
Merge branch 'AmintaCCCP:main' into Dev
SummerRay160 Apr 30, 2026
be9f3c1
refactor(ReadmeModal): 重构TOC提取逻辑并优化翻译服务
SummerRay160 Apr 30, 2026
3b7eb05
feat(markdown): 增强 markdown 解析器以支持更多元素类型
SummerRay160 May 1, 2026
3f64033
feat(翻译): 实现双语Markdown渲染器并重构翻译逻辑
SummerRay160 May 3, 2026
a5c8439
fix: 修复翻译服务中的令牌验证和代码块处理问题
SummerRay160 May 3, 2026
fac94e3
refactor: 优化类型守卫并移除未使用的语言属性
SummerRay160 May 3, 2026
f722aab
feat(markdown): 改进翻译功能并添加显示模式切换
SummerRay160 May 3, 2026
fc2b2de
feat: 重构翻译功能并添加DOM文本扫描器
SummerRay160 May 3, 2026
3db1bf8
fix(BilingualMarkdownRenderer): 安全处理内联代码节点的HTML注入
SummerRay160 May 3, 2026
5f7265e
fix: 修复翻译功能中的多个问题
SummerRay160 May 3, 2026
983c5b6
fix(翻译服务): 修复认证过期处理和竞态条件
SummerRay160 May 3, 2026
6a39a2d
feat(翻译): 改进翻译功能并修复滚动问题
SummerRay160 May 3, 2026
57b5855
Update src/services/translateService.ts
SummerRay160 May 3, 2026
5332c75
Merge branch 'AmintaCCCP:main' into Dev
SummerRay160 May 4, 2026
055d64a
feat(翻译): 添加data-translate属性支持以跳过翻译
SummerRay160 May 6, 2026
8d9f5ad
Merge branch 'Dev' of https://github.com/SummerRay160/GithubStarsMana…
SummerRay160 May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/MarkdownRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ const MarkdownImage: React.FC<{ src?: string; alt?: string; baseUrl?: string }>
</div>

{!isLoading && !hasError && (
<div className="text-center mt-2 text-xs text-gray-400 dark:text-text-tertiary opacity-0 group-hover/img:opacity-100 transition-opacity duration-200 flex items-center gap-3">
<div data-translate="false" className="text-center mt-2 text-xs text-gray-400 dark:text-text-tertiary opacity-0 group-hover/img:opacity-100 transition-opacity duration-200 flex items-center gap-3">
<span>
{isInsideLink
? (language === 'zh' ? '单击放大 · Ctrl+点击打开链接' : 'Click to zoom · Ctrl+Click to open link')
Expand All @@ -567,6 +567,7 @@ const MarkdownImage: React.FC<{ src?: string; alt?: string; baseUrl?: string }>

{!isLoading && !hasError && isInsideLink && parentLinkHref && (
<div
data-translate="false"
className="text-center mt-1 text-xs text-brand-violet dark:text-brand-violet opacity-0 group-hover/img:opacity-100 transition-opacity flex items-center justify-center gap-1 cursor-pointer"
onClick={(e) => {
e.stopPropagation();
Expand Down
5 changes: 5 additions & 0 deletions src/utils/domTextScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ function extractTextPreservingInlineCode(element: HTMLElement): ExtractedText {
return;
}

if (el.hasAttribute('data-translate') && el.getAttribute('data-translate') === 'false') {
return;
}

if (tag === 'code' && !el.closest('pre')) {
hasInlineCode = true;
result += `<code>${escapeHtml(el.textContent || '')}</code>`;
Expand Down Expand Up @@ -135,6 +139,7 @@ export function wrapTextNodesWithAttr(element: HTMLElement, attr: string, value:
const parent = node.parentElement;
if (!parent) continue;
if (parent.tagName === 'CODE' || parent.tagName === 'PRE' || parent.closest('pre')) continue;
if (parent.closest('[data-translate="false"]')) continue;
if (!node.textContent?.trim()) continue;
replacements.push({ textNode: node as Text, parent });
}
Expand Down
Loading