docs: 将仓库代码注释统一为中文
CI / docs-check (push) Canceled after 0s
CI / backend-test (push) Canceled after 0s
CI / service-test (push) Canceled after 0s
CI / frontend-test (push) Canceled after 0s
CI / rust-core (push) Canceled after 0s
CI / docs-check (pull_request) Canceled after 0s
CI / backend-test (pull_request) Canceled after 0s
CI / service-test (pull_request) Canceled after 0s
CI / frontend-test (pull_request) Canceled after 0s
CI / rust-core (pull_request) Canceled after 0s

This commit is contained in:
2026-09-10 00:40:56 +08:00
parent 51c592841d
commit d703ab64e3
249 changed files with 707 additions and 900 deletions
@@ -1,7 +1,7 @@
// @vitest-environment happy-dom
import { expect, it, vi } from 'vitest'
import { mount } from '@vue/test-utils'
// Vitest disables CSS by default, including CSS raw imports. Load the real files here.
// Vitest 默认禁用 CSS,包括 CSS 原始导入。在这里加载真实的文件。
vi.mock('@/styles/features.css?raw', async () => ({ default: (await import('node:fs')).readFileSync(process.cwd() + '/src/styles/features.css', 'utf8') }))
vi.mock('@/styles/tokens.css?raw', async () => ({ default: (await import('node:fs')).readFileSync(process.cwd() + '/src/styles/tokens.css', 'utf8') }))
vi.mock('@/styles/callouts.css?raw', async () => ({ default: (await import('node:fs')).readFileSync(process.cwd() + '/src/styles/callouts.css', 'utf8') }))
@@ -29,7 +29,7 @@ it.each(themes)('previews shared component states safely for $theme_id', theme =
expect(doc.querySelector('style')!.textContent).toContain('.button-primary:hover')
expect(doc.querySelector('style')!.textContent).not.toContain('color:white')
const rules = Array.from(doc.styleSheets[0]!.cssRules) as CSSStyleRule[]
// The sandbox cannot inherit MarkdownContent's component stylesheet.
// 沙箱无法继承MarkdownContent的组件样式表。
const codeRule = rules.find(rule => rule.selectorText === '.markdown-content .shiki code')!
const lineRule = rules.find(rule => rule.selectorText === '.markdown-content .shiki .line')!
expect(codeRule.style.getPropertyValue('display')).toBe('block')
@@ -37,7 +37,7 @@ it.each(themes)('previews shared component states safely for $theme_id', theme =
expect(lineRule.style.getPropertyValue('min-height')).toBe('1lh')
const rootRule = rules.filter(rule => rule.selectorText === 'html').pop()!
const bodyRule = rules.filter(rule => rule.selectorText === 'body').pop()!
// The embedded document must override the app-shell overflow lock.
// 嵌入文档必须覆盖应用程序外壳溢出锁定。
expect(rootRule.style.getPropertyValue('overflow-y')).toBe('auto')
expect(rootRule.style.getPropertyPriority('overflow-y')).toBe('important')
expect(bodyRule.style.getPropertyValue('height')).toBe('auto')