Skip to content

[#3114] 长文档卡片:气泡出卡,对话旁读全文,或就地展开 #3182

Closed

Description

@Birfy

第九刀的收口单(umbrella #3114 保持 open;切片 PR 写 Fixes #<本单> + Part of #3114,不写 Fixes #3114)。

范围

长文档卡片与对话旁阅读栏:超过 standard 档(12 行 / 800 字)且(≥2 个 # 标题 或 ≥3 个 --- 节)的消息,不再画长气泡,而是在气泡里给一张卡片(标题 + {n} sections + Open beside the conversation);点卡片在右侧 pane 里读全文并可关闭;卡下另有 Show message text 就地展开。折叠档为 none 时不出卡、全文可见。

依据

完整规格见 #3114 的第九刀评论 issuecomment-6988166511。基准 main 275ed73bcae514f7a0bad4f2cc360b0b7135cd0e(v0.2.37 的 merge commit)。

  • 17 个文件(手写 11 + 生成 6)、手写 +218/−25 = 243 行,预期 T1(全落在 core/src/client/**/core/test/**/patches/**/changelog.d/** 与 docs/**)→ 不需要 PASS,tip 上 tests-ok 绿即可入队。
  • 不新增 host 端点、不碰 authz.js、不新建 core/src/shared/**:卡片与 pane 都在客户端,复用现有右侧 BotPanel 槽位(新增 view: 'document')。
  • 不做 documentCards 开关键(那要改 channel.js 的 set-prefs,T3):本刀采用 #3112 的默认行为——长文档即出卡,none 不出卡;「在 General 里关掉卡片」留作下一刀。
  • 红先(实测):core/test/message-fold.test.js 从 5/5 变 9 / 6 / 3,三红为 the bubble carries a document card → 0 !== 1、there is a card to open → 0 !== 1、+ 'Show more' / - 'Show message text';接上 foldBody 文档分支与两处 actions/sessionId 后 9/9。
  • 回归:tool-cells 19/19、empty-message-cell 3/3、palette-preview 15/15、client-bundle 2/2、settings-readonly-pages 14/14、bot-browsers 14/14、earlier-message-actions 6/6。

明确不做

documentCards 偏好与 General 开关(T3,下一刀)、历史搜索旧 part 跳转(14 文件)、社交冻结人话(T3,源头在 bot-social)、文档的编辑/保存/导出、多 pane、分栏与滚动位置记忆、附件当文档;折叠阈值/预览/FoldedContent/foldingOf 既有行为一行不改;任何 gate 文件。

验收

从仓库根、在已提交 client.js 的树上 build-client --check + git diff --exit-code -- core/client.js;ds-bot-patches check/canonical;arch-docs;TZ=UTC TMPDIR=/data/flybot-tmp npm run verify exit 0。新增行不许出现 fence/sanitiz/displayName/eval(/new Function( 等升档关键字(代码块一律叫 code block)。

Written-by: Chief

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions