Skip to content

fix(mobile): 历史任务名优先展示 title,对齐 PC 端展示逻辑 - #1098

Open
weed33834 wants to merge 1 commit into
chaitin:mainfrom
weed33834:fix/1016-task-name-sync
Open

fix(mobile): 历史任务名优先展示 title,对齐 PC 端展示逻辑#1098
weed33834 wants to merge 1 commit into
chaitin:mainfrom
weed33834:fix/1016-task-name-sync

Conversation

@weed33834

Copy link
Copy Markdown

问题

手机 App 历史任务列表无法完整展示云端任务名(#1016):PC 端正常,App 端部分任务只显示截断内容,任务多时难以定位。

根因

mobile/src/utils/format.tstaskDisplayName 与 Web 端 getTaskDisplayNamefrontend/src/utils/common.tsx)逻辑不一致:

  1. 优先级相反:Web 端优先 title,再 summary;App 端却优先 summary,再 title。云端任务的「名称」存在 title 字段,因此 App 端展示成了 summary,导致「任务名无法同步」。
  2. 内容兜底被硬截断:App 端对 content 取首行并 slice(0, 60),Web 端对 content 做 Markdown 去除且不截断,因此出现「仅展示截断内容」。

修复

  • 将优先级改为 title -> summary -> content,与 Web 端一致。
  • 内容兜底时先做轻量 Markdown 去除(代码块/行内代码/链接/图片/标题/引用/加粗/斜体/列表),并去掉 60 字符硬截断(卡片本身有 numberOfLines={2} 视觉截断)。

改动

  • mobile/src/utils/format.ts 一个文件。

Fixes #1016

- taskDisplayName 优先级改为 title -> summary -> content,与 Web 端 getTaskDisplayName 一致(此前 summary 优先,导致云端任务名/标题未同步展示)
- 内容兜底时先做轻量 Markdown 去除,且不再截断到 60 字符

Fixes chaitin#1016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug:云端历史任务名称无法同步至手机App,PC客户端同步正常,任务较多时查找困难

1 participant