fix(chat): remove redundant proposal state-write copy - #4756
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewed exact head 72b0a668247147ee7bac246a602a2a9e293fbc99. I found no blocking issue.
动机
这个 PR 解决的是一个真实且高频的首屏注意力问题:普通 proposal 已经通过标题、字段、review-plan explainer、状态块和操作按钮表达“发生什么/下一步做什么”,但时间线和抽屉仍一律追加“确认后会调用规范 LoopX 服务写入状态”这一实现性描述。它没有增加决策信息,反而与真正重要的 lifecycle、protected action、team plan、operation result 和 retry 解释争夺注意力。
我对照了旧行为、PR body、workspaceProposal 的完整分支顺序以及两个真实消费者。这个切片是完整的:只移除无法提供额外决策价值的 generic fallback,同时保留所有有具体后果或恢复语义的 impact 文案。
改动思路
改动继续复用现有单一 presentation owner,没有把展示策略下沉到 backend,也没有引入第二套 proposal 分类:
workspaceProposal仍按既有顺序处理 retry、operation、team plan、goal.create、goal.lifecycle 和 protected action;只有最终 unmatched fallback 从通用句子变为空字符串。ChannelTimeline和ContextDrawer仅在 impact 非空时生成<p>,因此不会留下空白 DOM,同时不会影响 title、fields、review explainer、gate/status block 或操作按钮。- 删除已经没有 caller 的中英文
proposal.impact.default,并从同一 source checkout 重建 packaged Chat 资源。
正向路径是 ordinary proposal 不再显示冗余句子;反向路径是任何有具体风险、生命周期、外部确认或恢复含义的 proposal 都先命中特化分支,仍显示原文案。
具体改动
关键代码讲解
workspaceProposal(personal-workspace-page.tsx:547):这是 proposal →WorkspaceActionPreview的既有统一映射点。关键不只是把 fallback 改成"",而是确认所有高价值分支都位于它之前;因此变更不会误删 protected/lifecycle/operation/team/retry 的语义。- proposal row(
channel-timeline.tsx:80):仅把 impact paragraph 变为条件节点,compact row 的 action kind、status、title 和 primary label 保持不变。 - proposal card(
context-drawer.tsx:1013):同样只省略空 impact;review-plan explainer、字段、applied/error/rejected/deferred/gated 状态和操作区继续由原有 owner 渲染。 - packaged Chat:
npm run build:chat在 exact head 上重现了index-7uKjmaHx.js和 retention/index 引用,没有 source/bundle 漂移。
对主干的风险
最高风险是 fallback 过宽,导致本应保留的安全或恢复信息一起消失。我沿着 exact-head 分支逐项检查了 retry、operation、team plan、goal create、三个 lifecycle 分支和 protected classification,它们都在 empty fallback 前返回具体文案;两个 renderer 也只条件化 impact paragraph,而不是整个 proposal card。
验证结果:
npm run build:chat:通过,重建资源与提交一致;只有既有的 bundle-size warning。personal-workspace-contract.test.mjs:通过。- packaged
typed-actionsbrowser scenario:通过,真实/chat/bundle 可交互。 git diff --check:通过。- current
origin/main+ exact head merge tree:无冲突,合并结果仍引用新 bundle。 - GitHub exact-head checks:30 个 success;release upload/publish/deploy 是符合 PR 语境的 intended skips。
残余风险很低:未来若新增一种需要具体 impact 的 action kind,仍需在 final fallback 前增加显式 typed 分支。本次没有新增协议、状态、authority、quota 或执行行为。PR body 记录了提交前的 owner first-screen preview approval;本次复审没有重复做 pixel diff,但已实际跑 packaged browser 路径。
我的整体评价
这是一个比例合适、可逆且在正确 owner 上完成的 presentation 精简。它删掉重复注意力成本,同时没有把“更少文案”误做成“更少安全语义”。代码量主要是必要的 packaged asset regeneration,源逻辑只有四处紧密相关的小改动;没有发现值得在本 PR 中追加的新抽象或邻近重构。
English verdict: APPROVE (author-owned fallback: COMMENTED). The exact head removes only the redundant generic impact sentence, preserves every action-specific safety/recovery branch, reproduces the packaged Chat bundle, passes the drawer and packaged typed-action validations, and merges cleanly with current main.
Exact head: 72b0a668247147ee7bac246a602a2a9e293fbc99
Proposal cards repeated an implementation detail beneath ordinary state changes. Remove that default sentence and omit empty impact paragraphs in the timeline and detail drawer. Meaningful lifecycle, protected-action, team-plan and retry explanations remain visible. Includes the regenerated packaged Chat assets.
Validation: Chat build, packaged typed-action browser scenario and context-drawer contract passed. Desktop and 390px presentation checked; owner approved the first-screen preview before commit. Exact-diff change-quality qualification passed. No authority or execution behavior changed; no additional abstraction was needed.