diff --git a/.codex/screenshots/earth-i18n-current-page.png b/.codex/screenshots/earth-i18n-current-page.png new file mode 100644 index 00000000..a9802312 Binary files /dev/null and b/.codex/screenshots/earth-i18n-current-page.png differ diff --git a/.codex/screenshots/earth-i18n-hd-texture-status.png b/.codex/screenshots/earth-i18n-hd-texture-status.png new file mode 100644 index 00000000..5dc60fd1 Binary files /dev/null and b/.codex/screenshots/earth-i18n-hd-texture-status.png differ diff --git a/.codex/screenshots/i18n-admin-data-sidebar.png b/.codex/screenshots/i18n-admin-data-sidebar.png new file mode 100644 index 00000000..4eb6b6ef Binary files /dev/null and b/.codex/screenshots/i18n-admin-data-sidebar.png differ diff --git a/.codex/screenshots/i18n-ai-tool-calls.png b/.codex/screenshots/i18n-ai-tool-calls.png new file mode 100644 index 00000000..16fef4bb Binary files /dev/null and b/.codex/screenshots/i18n-ai-tool-calls.png differ diff --git a/.codex/screenshots/i18n-earth-brand-config.png b/.codex/screenshots/i18n-earth-brand-config.png new file mode 100644 index 00000000..3808e77a Binary files /dev/null and b/.codex/screenshots/i18n-earth-brand-config.png differ diff --git a/.codex/screenshots/i18n-earth-hud-brand.png b/.codex/screenshots/i18n-earth-hud-brand.png new file mode 100644 index 00000000..c8d8571c Binary files /dev/null and b/.codex/screenshots/i18n-earth-hud-brand.png differ diff --git a/.codex/screenshots/i18n-settings-notifications.png b/.codex/screenshots/i18n-settings-notifications.png new file mode 100644 index 00000000..795bbe45 Binary files /dev/null and b/.codex/screenshots/i18n-settings-notifications.png differ diff --git a/.codex/screenshots/i18n-settings-system.png b/.codex/screenshots/i18n-settings-system.png new file mode 100644 index 00000000..4ff47b13 Binary files /dev/null and b/.codex/screenshots/i18n-settings-system.png differ diff --git a/.codex/screenshots/sidebar-left-align.png b/.codex/screenshots/sidebar-left-align.png new file mode 100644 index 00000000..13d019f7 Binary files /dev/null and b/.codex/screenshots/sidebar-left-align.png differ diff --git a/AGENTS.md b/AGENTS.md index dd94c86f..52f79506 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,6 +45,11 @@ git diff --name-only HEAD git diff --unified=0 HEAD -- ``` +When the user provides screenshots or images, inspect the actual image before +making visual claims. If the referenced path is missing, search alternate +attachment/worktree/local locations or ask for the file; never guess the image +content from text, filenames, or memory. + Preserve user changes already present in the worktree. ### Validation diff --git a/VERSION b/VERSION index 31b648bd..b7c0622b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.73.0 +0.74.0 diff --git a/backend/app/services/earth_news.py b/backend/app/services/earth_news.py index 5e46d959..9de927b7 100644 --- a/backend/app/services/earth_news.py +++ b/backend/app/services/earth_news.py @@ -865,9 +865,9 @@ def _get_locale_text( if isinstance(fallback, dict): value = _coerce_str(fallback.get(key)) if value: + if locale == "en-US" and _contains_cjk_text(value): + return "" return value - if locale == "en-US" and _is_chinese_language(item.content_language): - return item.title if key == "title" else item.summary return "" diff --git a/backend/tests/test_earth_news.py b/backend/tests/test_earth_news.py index 24e68032..8bbfc868 100644 --- a/backend/tests/test_earth_news.py +++ b/backend/tests/test_earth_news.py @@ -384,7 +384,14 @@ def test_parse_chinese_rss_marks_source_language_and_keeps_zh_localization(): assert items[0].content_language == "zh-CN" assert items[0].localizations["zh-CN"]["title"] == "中国电商平台发布季度增长数据" assert payload_zh["display_title"] == "中国电商平台发布季度增长数据" - assert payload_en["display_title"] == "中国电商平台发布季度增长数据" + assert payload_en["display_title"] == "" + + items[0].localizations["en-US"] = { + "title": "Chinese e-commerce platform reports quarterly growth", + "summary": "The platform said cross-border orders rose year over year.", + } + payload_en_ready = _serialize_item(items[0], active_region="global", locale="en-US") + assert payload_en_ready["display_title"] == "Chinese e-commerce platform reports quarterly growth" def test_default_news_sources_include_business_and_ecommerce_sources(): diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index fdde7b1c..6da71cdb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,6 +8,24 @@ This project follows the repository versioning rule: - `improvement` -> `+0.0.1`(bugfix + 小功能混合) - `bugfix` -> `+0.0.1` +## [0.74.0] — 2026-06-30 + +Released: 2026-06-30 + +### Highlights +- 扩展统一 i18n 到 Web Earth、控制台、认证页和公开 Docs 的更多动态入口,减少英文界面中文残留。 +- 强化 Earth HUD 的通知胶囊、品牌栏、语言 switch、图例、tooltip、详情卡、新闻和 TV 文案展示,避免英文态裁切或错位。 +- 将容易遗漏的 i18n 入口和视觉回归加入 harness,让 smoke 覆盖通知位置、内容宽度、语言切换状态和动态文案。 + +### Added / Fixed / Improved +- 新增 Earth runtime i18n 入口,统一高清材质、启动状态、错误提示和图层状态文案来源。 +- 补齐国家名、属性名、卫星 legend、详情页 tooltip、新闻/TV 默认文案和 API 错误提示的英文翻译与回退。 +- 更新控制台与 Earth 布局规则,保留 brand 尺寸语义,同时让标题、副标题和通知胶囊按内容完整显示。 +- 扩展 frontend smoke 与 harness 文档,固化一屏高度链、i18n 动态入口、胶囊/tag overflow 和截图证据要求。 +- 更新 Earth 新闻本地化服务与测试,确保英文界面新闻内容不再回退中文 UI 文案。 + +--- + ## [0.73.0] — 2026-06-29 Released: 2026-06-29 diff --git a/docs/HARNESS.md b/docs/HARNESS.md index e68fbe35..ab37ed98 100644 --- a/docs/HARNESS.md +++ b/docs/HARNESS.md @@ -84,7 +84,7 @@ git diff --unified=0 HEAD -- | Doctor | `scripts/harness/doctor.sh` | Checks required files, required tools, optional delivery tools, and forbidden frontend lockfiles. | | Security | `scripts/harness/security-check.sh` | Checks that environment/private-key files are not tracked and scans for high-confidence committed secret tokens. | | Backend Rules | `scripts/harness/backend-rules-check.sh` | Checks backend app Python for direct `print()`, `breakpoint()`, and `pdb.set_trace()` debug calls so service code uses structured logging. | -| Frontend Rules | `scripts/harness/frontend-rules-check.sh` | Checks Bun-only scripts, admin route manifest coherence, literal internal route links, admin search route targets, frontend debug output, native button safety, icon-button accessibility, no nested Cards, no AntD/Space layout primitives, ConnectionTestInput usage, admin/docs shell height-chain sizing, viewport-scaled font sizes, zero letter spacing, and high-signal UI rule warnings. | +| Frontend Rules | `scripts/harness/frontend-rules-check.sh` | Checks Bun-only scripts, admin route manifest coherence, literal internal route links, admin search route targets, frontend debug output, native button safety, icon-button accessibility, no nested Cards, no AntD/Space layout primitives, ConnectionTestInput usage, admin/docs shell height-chain sizing, same-category style owner warnings, viewport-scaled font sizes, zero letter spacing, and high-signal UI rule warnings. | | Docs Consistency | `scripts/harness/docs-consistency-check.sh` | Checks frontend Docs metadata against backend Gatekeeper metadata, public Docs registration, full technical-doc bilingual file pairs, public doc links, readable link titles, language-scoped technical links, README/project-context admin stack drift, supported credential collector contracts, manual console route coverage against the actual admin manifest, documented UI route drift, documented `?section=` deep-link validity against the actual admin section config in technical docs and active plan docs, and the harness rules-coverage notes. | | Quick | `scripts/harness/quick-check.sh` | Runs doctor, whitespace diff check, shell syntax checks, security scan, backend/frontend/doc consistency checks, and CI backend smoke tests. | | Full | `scripts/harness/validate.sh` | Runs quick check, frontend Bun install/build, Playwright route smoke, optional Helm checks, and opt-in Docker image smoke builds. | @@ -130,6 +130,64 @@ PLANET_HARNESS_FRONTEND_SMOKE=0 scripts/harness/validate.sh PLANET_HARNESS_FRONTEND_SMOKE_PORT=4174 scripts/harness/validate.sh ``` +### Visual Evidence And Style Consistency + +- Treat user-provided screenshots and images as primary visual evidence. If a + screenshot contradicts written text, inspect the image first and explicitly + call out the mismatch before deciding what to change. +- If a referenced screenshot path cannot be opened, do not infer image content + from the filename, alt text, surrounding prose, or memory. Search the current + thread attachments, repository, and obvious local attachment/download + locations; if the image still cannot be found, ask for the file or report the + blocker instead of guessing. +- Same-category UI surfaces must use one visual system per product area. Badges, + chips, pills, tags, status labels, small buttons, cards, panels, and toolbar + controls should reuse the shared component, shared token, or established CSS + owner for that area instead of introducing a page-local lookalike. +- `scripts/harness/frontend-rules-check.sh` warns when semantic + `badge` / `chip` / `pill` / `tag` / `status` selectors appear outside the + approved React and Earth CSS owner files. A warning means the reviewer should + either move the style into the shared owner or document why this is a genuinely + new visual family. + +### Earth I18n Harness Rules + +Earth i18n work must validate rendered behavior, not only static text lookup. +Agents often miss dynamic strings that are created after initial page load, so +the smoke treats these as first-class i18n surfaces: + +- **Visible text and attributes**: translated checks must include `innerText` + plus `title`, `aria-label`, `placeholder`, and `alt`. Tooltips and icon-only + buttons are user-facing copy, not implementation details. +- **Dynamic detail cards**: info cards opened from Earth markers, cruise cards, + BGP markers, compute centers, vessels, and news must render field labels, + status values, source tags, action buttons, and disabled/tooltips in the active + language. +- **English content safety**: English mode must not fall back to Chinese news + titles, summaries, feed names, measure words, or generic status labels. If no + English localization exists, hide the item or use a neutral English fallback. +- **Brand assets**: locale switching must update both text and image assets. + The default Earth HUD brand uses `title-zh.png` for Chinese and `title-en.png` + for English while keeping the same top-left layout and logo position. +- **Controls and state**: switch/segmented-control visuals must follow the real + checked/pressed state after both direct clicks and programmatic panel changes. + A control is not valid if the state changes but the thumb, active pill, or + `aria-*` state stays stale. +- **Runtime copy entrypoints**: dynamic status, loading, startup, and error copy + must enter through `earthMessage(...)` plus the centralized + `EARTH_MESSAGE_TEMPLATES` map. Do not hide direct strings behind + `showStatusMessage`, `queueStatusMessage`, `showGestureStatusMessage`, + `showError`, `setLoadingMessage`, `resolveStartupMessage`, `startupMessage`, + or `earth:status` events. +- **Capsules and tags**: pills, tags, chips, badges, and small buttons must not + overflow their panel. Prefer a slightly wider owning panel for important + status information; otherwise use `min-width: 0`, wrapping, or ellipsis with a + translated tooltip. + +Current frontend smoke explicitly covers the Earth English locale flow: brand +image swap, settings language controls, panel switch visual sync, English news +filtering, English detail-card text and tooltips, and TV default/source labels. + ## Environment Requirements Required for normal development: diff --git a/docs/harness-audit.md b/docs/harness-audit.md index 02bc1595..e1f592e9 100644 --- a/docs/harness-audit.md +++ b/docs/harness-audit.md @@ -102,6 +102,8 @@ The repository uses `.gitea/workflows/`, not `.github/workflows/`. | Admin/docs shell layouts can reintroduce brittle viewport sizing after a responsive fix. | Changed the admin and Docs route shells to use the existing `html/body/#root` 100% height chain, and added a frontend rules failure for exact `100vh` / `100vw` shell sizing in those CSS files. | | Compact workspaces can drift back into card-in-card layouts or implicit AntD `Space` wrappers. | Added frontend rules failures for nested `Card` components, AntD imports, and `` layout primitives in active frontend source. | | Connection-test controls can drift back into detached toolbar buttons. | Added a shared `ConnectionTestInput` suffix pattern for AI Provider and WebSearch Base URL fields, disabled WebSearch configuration/test controls when the tool is off, and made the frontend rules check fail detached AI/WebSearch connection-test buttons. | +| Same-category UI styles can fragment into page-local lookalikes. | Added same-category style owner warnings for semantic `badge`, `chip`, `pill`, `tag`, and `status` CSS selectors outside the approved shared React and Earth CSS owner files. | +| Visual fixes can go wrong when agents guess from missing screenshot paths. | Documented screenshots and images as primary visual evidence: if the path is not available, agents must search alternate attachment/local locations or report the blocker instead of inferring image content. | | Public docs can reference stale admin section URLs. | Added docs consistency validation for documented `?section=` links and rendered smoke coverage for documented AI / collector deep links. | | Active plan docs can preserve old admin deep-link assumptions after the technical docs are corrected. | Extended docs consistency checks to active `docs/plans/*.md` files for stale admin tab-query terms and actual `?section=` validity; corrected the docs audience split plan to current section routes. | | Top-level README can drift from the actual frontend stack while technical docs stay current. | Updated README from Ant Design Pro to Tactile UI / Radix primitives / lucide-react and added README stale admin-stack terms to docs consistency checks. | @@ -135,6 +137,7 @@ index is the routing layer; this table is the coverage/evidence layer. | `docs` | User manuals must match real console routes and deep links. | `docs-consistency-check.sh` compares manual console tables with `frontend/src/admin/routes/manifest.tsx` and validates documented `?section=` links from actual `AdminRoutes.tsx` plus `PlainResourcePages.tsx` section config. | Screenshots and UI-copy nuance are not exhaustively validated. | | `uiux` | Admin pages are compact single-screen workspaces with explicit overflow ownership. | `frontend-rules-check.sh` fails missing admin shell height-chain declarations (`.admin-theme-root`, `.admin`, `.admin__sider`, `.admin__nav-scroll`, `.admin__account`, `.admin__content`, `.admin__content-inner`), warns on suspicious `overflow: hidden`, and blocks exact `100vh` / `100vw` shell sizing in admin/Docs CSS. `frontend-smoke.mjs` checks every admin route at desktop/mobile and verifies `.admin` equals viewport height, `#root`/document/body have no vertical overflow, and desktop sidebar account/preferences stay in the first viewport. Zoom passes still cover 125% / 150% rendering. | Visual density, hierarchy, and whether a scroll owner feels ergonomic remain manual QA. | | `uiux` | Controls use expected patterns and accessible icon buttons. | `frontend-rules-check.sh` blocks icon `Button` without `aria-label` and `title`, native ` + + +
打开控制台 @@ -1769,6 +1779,16 @@