fix(mobile): open managed Markdown video links - #4219
Conversation
Signed-off-by: Dante <duanjl.china@gmail.com>
…own-video-link Signed-off-by: Dante <duanjl.china@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
| Filename | Overview |
|---|---|
| apps/mobile/src/session/messageMarkdown.ts | 增加 canonical 受管视频 Markdown 链接识别;格式约束与桌面 blob store 一致。 |
| apps/mobile/src/session/MessageRenderer.tsx | 将受管视频链接接入媒体查看器,但缺少 payload handler 的待发送路径仍会获得无效点击处理器。 |
| apps/mobile/src/tests/messageMarkdown.test.ts | 覆盖三种受支持视频扩展以及非视频、非法 SHA 和错误 host/path 的解析行为。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[显式 Markdown 视频链接] --> B{是否匹配 canonical URL}
B -- 否 --> C[保留为普通文本]
B -- 是 --> D[标记 managedMediaKind: video]
D --> E[渲染可点击 SpanText]
E --> F{是否具有 onOpenPayload}
F -- 是 --> G[构造 media payload]
G --> H[device-link 远端取件]
H --> I[MIME 校验与视频播放器]
F -- 否:待发送气泡 --> J[当前点击静默返回]
Prompt To Fix All With AI
### Issue 1
apps/mobile/src/session/MessageRenderer.tsx:5018-5020
**待发送链接点击无效**
待发送气泡创建 `MarkdownBody` 时没有传入 `onOpenPayload`,但 `openMarkdownMedia` 仍作为有效回调传给渲染层,因此受管视频链接会显示可点击样式并获得 `onPress`。用户点击后,该回调会因为缺少 `onOpenPayload` 而直接返回,造成链接看似可点却没有任何响应。建议在缺少 payload handler 时不要传递媒体回调,或为待发送路径接通 payload viewer。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e61fdccd5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dante <duanjl.china@gmail.com>
|
这个 PR 现在在等维护者确认(产品 / UI):mobile 把规范 请维护者直接在本 PR 上 Approve;需要作者修改则 Request Changes。讨论 issue:#4234 |
|
命中 UI 路径(apps/mobile/src/session/MessageRenderer.tsx / apps/mobile/src/session/messageMarkdown.ts)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。 这是非阻断提醒,不阻止本轮审查与合并。 |
MagicLizi
left a comment
There was a problem hiding this comment.
PR #4219 review report
Findings
- 无 P0/P1。
Rule coverage
AGENTS.md/docs/dev-rules/development-workflow.md/.github/PULL_REQUEST_TEMPLATE.md:单一 bugfix,模板三段齐全,DCO trailer 与 author 一致,风险勾选跨平台差异。描述与 diff 吻合,无夹带。docs/dev-rules/mobile-development.md:仅 JS 会话 Markdown 解析/渲染,不改原生配置或 fingerprint。docs/dev-rules/media-storage-and-protocols.md:只识别cindy-media://blobs/<sha256>.(mp4|webm|mov),与 blobStore 指纹形状及视频后缀白名单一致;不把私有 scheme 交给Linking.openURL,走既有buildMediaPayload+ payload viewer / device-link 取件。docs/dev-rules/remote-and-mobile-adaptation.md:复用现有 remote media resolver,不新增 IPC/协议。docs/design-rules/DESIGN.md§14.5:onPress与clickableInlineStyle同源;无onOpenPayload时openMarkdownMedia为undefined,待发送气泡不加可点样式。文件阅读器 HTML 路径仍只放行 http(s),受管视频链接在该面保持纯文本,符合该面既有规则。docs/product-rules/core-product-principles.md:补齐手机正文入口,不另建播放能力。- 讨论 issue #4234:范围是显式规范受管视频 Markdown 链接打开现有查看器;无查看器不加虚假可点信号;不扩大裸私有地址或系统打开。当前 diff 落实这些要求。先前 Greptile/Codex 关于 pending 死链的 thread 已在
936f80f3修复并 resolve。
Product-gate fallback
命中 UI 路径,但语义是补齐已有媒体查看器对已发送消息 Markdown 标签的缺失点击路径(#4171),无新布局/文案/组件。按 product 语义 fallback 继续审查,已 signoff-release --labels-only 摘掉 awaiting-discussion。
Verification
git diff --check origin/main...HEAD:exit 0(verify-pr-4219-diffcheck.log)pnpm --filter mobile exec vitest run src/__tests__/messageMarkdown.test.ts src/__tests__/messageMediaThumbnailWiring.test.ts:125 tests passed,exit 0(verify-pr-4219-vitest.log)pnpm --filter mobile run --if-present typecheck:本审查 worktree 无独立node_modules,借用主仓依赖后失败于无关的maker-sharedexport 漂移(verify-pr-4219-typecheck.log)。不能当作本 PR 失败。GitHubclient-ci/pr-design-basis已对当前 head 全绿。作者声称 typecheck 通过,CI 与之相符。- 未执行 Android/iOS 实机点击播放;GitHub CI 覆盖解析与接线单测。UI 证据缺失为非阻断提醒。
- botSettle 超时放行:
copilot-pull-request-reviewer/chatgpt-codex-connector可能在合并后才到。
Overall
pass — 没有 P0/P1。
这次改了什么
摘要
Mobile now recognizes canonical
cindy-media://blobs/<sha256>.(mp4|webm|mov)destinations in explicit Markdown links and opens them through the existing media payload viewer. This lets the viewer use the established device-link fetch, MIME validation, and video player path instead of leaving the Markdown literal or passing a private scheme to the OS.变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
No layout or copy changes. This adds the missing tap behavior to an existing Markdown label and reuses the existing media viewer.
docs/design-rules/DESIGN.md§14.5; the label receives link styling only when anonPresshandler exists, preserving the existing clickable-signal rule.怎么验证的
自动验证
风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)