Skip to content

fix(lark): 修正 Card 2.0 宽度与页脚字号 - #1059

Closed
sensuossss wants to merge 1 commit into
masterfrom
fix/lark-card-v2-fields
Closed

fix(lark): 修正 Card 2.0 宽度与页脚字号#1059
sensuossss wants to merge 1 commit into
masterfrom
fix/lark-card-v2-fields

Conversation

@sensuossss

Copy link
Copy Markdown
Collaborator

改动内容

  • /adopt 选择卡的 Card JSON 2.0 配置从旧版 wide_screen_mode 改为 width_mode: "fill",保留 update_multi: true
  • 将回复卡页脚及语音按钮空占位的字号从无效的 notation_small_v2 改为 Card 2.0 枚举 notation
  • 消息解析继续兼容历史卡片:页脚 text_size 缺省、notationnotation_small_v2 三种形态都能按结构安全剥离;错误 marker 或其它字号不会被误删

原因

上述旧字段属于 Card JSON 1.0 或不在 Card 2.0 的合法枚举中,写入 2.0 卡片时不会产生预期的宽度和字号效果。此改动只校正 2.0 路径,并保留历史消息回读兼容性。

影响面评估

  • 影响飞书 Card 2.0 的 /adopt 选择卡,以及复用统一 footer builder 的回复卡发送、fallback、contextual reply 和自定义品牌页脚
  • 影响 historyquoted 与跨 Agent 消息读取中的内部页脚剥离逻辑,同时兼容新旧已发送卡片
  • 不修改 Card 1.0 流式卡中的 wide_screen_mode / notation_small_v2
  • 不涉及其它 IM、CLI 适配器、PTY/Tmux 后端或会话路由

测试验证

  • ./node_modules/.bin/vitest run --project unit test/card-builder.test.ts test/md-card.test.ts test/message-parser.test.ts
    • 3 个文件、437 条测试全部通过
  • npx -y bun@1.4.0 run build
    • TypeScript、脚本类型检查、Dashboard bundle 与 dist audit 全部通过
  • npx -y bun@1.4.0 run daemon:restart
    • daemon 重启烟测通过;验证后已恢复既有 live checkout
  • npx -y bun@1.4.0 run test
    • 18,724 条通过;7 条现有环境/集成用例失败,集中在端口竞态、root 权限语义、机器级公开 URL 注入及 MCP/DSH 沙箱进程,与本次修改文件和聚焦回归无交集
  • git diff --check
    • 通过

视觉说明

本 PR 不附模拟图片。宽度与字号使用 Card 2.0 官方字段,并由发送 JSON 的精确断言覆盖;历史与新格式的回读兼容由真实归一化形态的解析测试覆盖。

@sensuossss
sensuossss requested a review from deepcoldy as a code owner August 28, 2026 06:37
@sensuossss

Copy link
Copy Markdown
Collaborator Author

按需求并入 #1057

@sensuossss sensuossss closed this Aug 28, 2026
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.

1 participant