fix(mobile): 历史任务名优先展示 title,对齐 PC 端展示逻辑 - #1098
Open
weed33834 wants to merge 1 commit into
Open
Conversation
- taskDisplayName 优先级改为 title -> summary -> content,与 Web 端 getTaskDisplayName 一致(此前 summary 优先,导致云端任务名/标题未同步展示) - 内容兜底时先做轻量 Markdown 去除,且不再截断到 60 字符 Fixes chaitin#1016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
手机 App 历史任务列表无法完整展示云端任务名(#1016):PC 端正常,App 端部分任务只显示截断内容,任务多时难以定位。
根因
mobile/src/utils/format.ts的taskDisplayName与 Web 端getTaskDisplayName(frontend/src/utils/common.tsx)逻辑不一致:title,再summary;App 端却优先summary,再title。云端任务的「名称」存在title字段,因此 App 端展示成了summary,导致「任务名无法同步」。content取首行并slice(0, 60),Web 端对content做 Markdown 去除且不截断,因此出现「仅展示截断内容」。修复
title -> summary -> content,与 Web 端一致。numberOfLines={2}视觉截断)。改动
mobile/src/utils/format.ts一个文件。Fixes #1016