fix(lark): 修正 Card 2.0 宽度与页脚字号 - #1059
Closed
sensuossss wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
按需求并入 #1057。 |
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.
改动内容
/adopt选择卡的 Card JSON 2.0 配置从旧版wide_screen_mode改为width_mode: "fill",保留update_multi: truenotation_small_v2改为 Card 2.0 枚举notationtext_size缺省、notation、notation_small_v2三种形态都能按结构安全剥离;错误 marker 或其它字号不会被误删原因
上述旧字段属于 Card JSON 1.0 或不在 Card 2.0 的合法枚举中,写入 2.0 卡片时不会产生预期的宽度和字号效果。此改动只校正 2.0 路径,并保留历史消息回读兼容性。
影响面评估
/adopt选择卡,以及复用统一 footer builder 的回复卡发送、fallback、contextual reply 和自定义品牌页脚history、quoted与跨 Agent 消息读取中的内部页脚剥离逻辑,同时兼容新旧已发送卡片wide_screen_mode/notation_small_v2测试验证
./node_modules/.bin/vitest run --project unit test/card-builder.test.ts test/md-card.test.ts test/message-parser.test.tsnpx -y bun@1.4.0 run buildnpx -y bun@1.4.0 run daemon:restartnpx -y bun@1.4.0 run testgit diff --check视觉说明
本 PR 不附模拟图片。宽度与字号使用 Card 2.0 官方字段,并由发送 JSON 的精确断言覆盖;历史与新格式的回读兼容由真实归一化形态的解析测试覆盖。