From da7d2272e091e5cf989b8ad5284141a6f587ea79 Mon Sep 17 00:00:00 2001 From: CodeXWeb Date: Wed, 10 Jun 2026 18:00:33 +0000 Subject: [PATCH 1/2] fix: clarify initial token state label --- WORKSPACE.md | 39 +++++++++++++++++++ static/js/features/groups.js | 2 +- static/js/i18n.js | 1 + ...t_type_and_refresh_suggestions_contract.py | 2 + 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/WORKSPACE.md b/WORKSPACE.md index 3aec1c2..8a06681 100644 --- a/WORKSPACE.md +++ b/WORKSPACE.md @@ -4,6 +4,45 @@ --- +## 2026-06-10 + +### 操作记录 + +#### 277. Issue #78 导入邮箱初始状态显示“未知”修复 + +**时间**:2026-06-10 + +**操作背景**: +CodeXWeb 自动巡检在最近活跃的 `ZeroPointSix/EnsoAI`、`ZeroPointSix/outlookEmailPlus`、`ZeroPointSix/Cliprompt` 中只认领并处理 `outlookEmailPlus` Issue #78(“导入了邮箱,显示未知?”)。认领评论:https://github.com/ZeroPointSix/outlookEmailPlus/issues/78#issuecomment-4672692172 + +**设计与范围确认**: + +1. 已核对 Issue #60 号池管理 FD/TD/TDD/TODO 与现有 `pool_admin` 实现。 +2. “移出号池”按设计只清空 `pool_status`,账号仍保留在账号管理中;因此“20 个号池移出 2 个,账号管理仍显示 20 个”属于既有设计,不在本次改动范围。 +3. 本轮只修复普通账号卡片中可刷新 Outlook 账号在尚未有 token 状态时显示“未知”的文案问题,避免用户误解为导入账号类型未知或导入异常。 + +**修改内容**: + +1. `static/js/features/groups.js`:将可刷新 Outlook 账号的默认 token 状态徽标从“未知”改为“未刷新”。 +2. `static/js/i18n.js`:新增英文翻译 `未刷新 -> Not refreshed`。 +3. `tests/test_frontend_account_type_and_refresh_suggestions_contract.py`:补充前端合约断言,确保默认状态使用“未刷新”且不回退到旧的“未知”。 + +**验证**: + +1. 针对性测试通过:`.venv/bin/python -m pytest tests/test_frontend_account_type_and_refresh_suggestions_contract.py tests/test_auto_import.py tests/test_pool_admin_service.py` → 40 passed。 +2. 完整测试已在远程沙箱运行:`.venv/bin/python -m pytest` → 1523 passed, 7 skipped, 4 failed。4 个失败均来自 `tests/test_pool_cf_real_e2e.py`,错误为真实 CF Worker 上游创建邮箱返回 HTTP 400 / `UPSTREAM_BAD_PAYLOAD`;仓库历史记录中同文件已作为外部真实 E2E 已知失败出现,本次未改动 CF Worker、外部池或删除逻辑。 +3. 运行完整测试前补齐了 Playwright、Chromium 与浏览器系统依赖;浏览器流程测试已执行并通过。 + +**后续记录**: + +- 分支:`codexweb/issue-78-import-token-state-label` +- Draft PR:待分支推送后补充 +- 不自动合并。 + +**是否改动代码**:是(前端状态文案、i18n 与前端合约测试) + +--- + ## 2026-05-19 ### 操作记录 diff --git a/static/js/features/groups.js b/static/js/features/groups.js index 55a2053..fc5e08b 100644 --- a/static/js/features/groups.js +++ b/static/js/features/groups.js @@ -289,7 +289,7 @@ let tokenBadge = `IMAP`; if (supportsTokenRefresh) { - tokenBadge = `– ${translateAppTextLocal('未知')}`; + tokenBadge = `– ${translateAppTextLocal('未刷新')}`; if (acc.token_status === 'valid') { tokenBadge = `✓ ${translateAppTextLocal('有效')}`; } else if (acc.token_status === 'invalid' || acc.token_status === 'expired') { diff --git a/static/js/i18n.js b/static/js/i18n.js index dbf4761..29c5ff0 100644 --- a/static/js/i18n.js +++ b/static/js/i18n.js @@ -861,6 +861,7 @@ '收件箱为空': 'Inbox is empty', '暂无邮件': 'No messages yet', '未知': 'Unknown', + '未刷新': 'Not refreshed', '未知错误': 'Unknown error', '未知发件人': 'Unknown sender', '有效': 'Valid', diff --git a/tests/test_frontend_account_type_and_refresh_suggestions_contract.py b/tests/test_frontend_account_type_and_refresh_suggestions_contract.py index 836d5e5..5173af6 100644 --- a/tests/test_frontend_account_type_and_refresh_suggestions_contract.py +++ b/tests/test_frontend_account_type_and_refresh_suggestions_contract.py @@ -52,6 +52,8 @@ def test_group_cards_split_outlook_and_imap_status_rendering(self): ) self.assertIn('let tokenBadge = `IMAP`;', groups_js) self.assertIn("if (supportsTokenRefresh) {", groups_js) + self.assertIn("translateAppTextLocal('未刷新')", groups_js) + self.assertNotIn("– ${translateAppTextLocal('未知')}", groups_js) self.assertIn( '${acc.method || defaultMethodLabel}', groups_js, From fee5848e2d53ca8051dab213fbe73c0fc59a7d58 Mon Sep 17 00:00:00 2001 From: CodeXWeb Date: Wed, 10 Jun 2026 18:11:08 +0000 Subject: [PATCH 2/2] docs: record issue 78 draft pr --- WORKSPACE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WORKSPACE.md b/WORKSPACE.md index 8a06681..e0025ab 100644 --- a/WORKSPACE.md +++ b/WORKSPACE.md @@ -36,7 +36,7 @@ CodeXWeb 自动巡检在最近活跃的 `ZeroPointSix/EnsoAI`、`ZeroPointSix/ou **后续记录**: - 分支:`codexweb/issue-78-import-token-state-label` -- Draft PR:待分支推送后补充 +- Draft PR:https://github.com/ZeroPointSix/outlookEmailPlus/pull/82 - 不自动合并。 **是否改动代码**:是(前端状态文案、i18n 与前端合约测试)