Skip to content

fix(plugin-detail): a record:activity whose types leaves out comment offers no comment composer - #34388

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jc1o6w
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jc1o6w

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #34371

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:活动块(record:activity)的 types 不含 comment 时,不再显示评论输入框和「仅评论」筛选项;开发环境下对每个块提示一次原因和两种改法。
  • 为什么改:HotCRM 线索页的活动块写了 types: ['task'],评论被这个白名单过滤掉,但输入框照常显示,用户发的评论保存了却永远看不到。
  • 风险与回滚:只影响 types 写了且不含 comment 的活动块;没写 types 或含 comment 的块完全不变。回滚即 revert 本 PR。
  • 先看:ui/packages/plugin-detail/src/renderers/record-activity.tsx(新增 commentsShown 判定与告警);ui/packages/plugin-detail/src/RecordActivityTimeline.tsx(新 prop 收掉输入框与「仅评论」);ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts(判定与告警文案)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-activity.test.tsx,预期 27 个全过,其中 5 个是本卡新增。
  • 需要你做的:无,席位落地。

What changes

Measured drop point. The comments are not lost by the host. Reproduced through RecordDetailView rendering an authored record page (real page:tabs opened on its Activity tab, real record:activity) with HotCRM lead_detail's lead_activity properties verbatim (types: ['task'], limit: 20, showCompleted: true, objectstack-ai/hotcrm main 07d5d9f). The host reads sys_comment and sys_activity and builds the comment items with type: 'comment'; the block then runs them through applyFeedConfig (recordActivityFeed.ts), whose types allow-list step (kept = kept.filter((i) => allowed.has(i.type))) drops every comment, because 'comment' is not in ['task']. That is what the spec declares (RecordActivityProps.types: "Feed item kinds to show (default: all)"). The defect is that the same block still offered the composer (showCommentInput defaults to true) and the Comments only option, so a posted comment was stored and then filtered out of view.

Ruling. Seat ruling 6915056720 on the dev report 6915007777 picked option C for this card: refusing the contradiction at authoring is spec-lane card #34383, and the producer fix ('comment' added to lead_activity's types) is carried to hotcrm. Option B (making types skip comments) was declined.

This PR (option C, Metadata-protocol: none).

  • recordActivityFeed.ts: feedTypesAdmitComments(types, block) answers whether the authored types can show a comment, through the same normalizeFeedTypes reading applyFeedConfig filters by, so the answer and the rows cannot disagree. warnWithheldCommentComposer names the block (and its node id), its types and both fixes, once per block and types (the warnOnce channel the file's other diagnostics use).
  • record-activity.tsx: computes commentsShown and hands it to the timeline; where the composer would otherwise have been offered (showCommentInput not false), it warns from an effect, in development only (the package's isDevBuild spelling).
  • RecordActivityTimeline.tsx: one optional prop, commentsShown (default true). false withholds the composer and the comments_only filter option; an authored filterMode: 'comments_only' then reads as all under the existing "a filter the dropdown does not offer filters nothing" rule. RecordChatterPanel passes nothing and is unchanged.

A block with no types, or a types that includes 'comment', renders exactly as before.

Tests

New top-level describe in the block's existing harness, renderers/__tests__/record-activity.test.tsx (real renderer, real timeline, a host DiscussionContext with an onAddComment):

  • the HotCRM shape (types: ['task']) draws no composer and no Comments Only option (and the comment is not shown);
  • CONTROL types: ['task', 'comment']: the composer and the option stay, the comment shows, no warning;
  • CONTROL no types: the same;
  • the warning fires once across a re-render and a remount, naming the block, its types and both fixes;
  • a block with showCommentInput: false is told nothing.

No forced test edits: no existing test changed.

Pin run and ablations (fix commit 76ea4fd)
  • pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-activity.test.tsx: Tests 27 passed (27).
  • Ablation 1, record-activity.tsx, commentsShown forced true through scripts/ablation-replace.mjs (anchor 1 to 0, blob moved): Tests 2 failed, 25 passed; the HotCRM-shape pin and the warn-once pin went red; restored, blob equal to HEAD, git diff HEAD empty.
  • Ablation 2, RecordActivityTimeline.tsx, the comments_only option gate forced open: Tests 1 failed, 26 passed ("expected [ 'All Activity', …(3) ] to not include 'Comments Only'"); restored, blob equal to HEAD.
  • The pins import the block from src (relative imports), so no dist rebuild sits between a mutation and the run.

Acceptance notes

  • HotCRM lead_detail keeps hiding its comments until the producer adds 'comment' to types (carried to hotcrm by the seat ruling); this PR removes the composer that posted into the void. The same page's comment saying scheduled rows are dropped is stale (they map to event now), and types: ['task'] hides those too.
  • The probe that measured the drop point through RecordDetailView was a one-off and is not committed.

Verification

All local runs on the final head 879d3661 unless named.

  • pnpm --filter @object-ui/plugin-detail type-check (tsc --noEmit && tsc -p tsconfig.test.json): lock VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/: Test Files 379 passed, 1 skipped (380); Tests 3402 passed, 18 skipped (3420); lock VERDICT command-exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 38 commands derived, each run, each exit 0; --ran reconciliation: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED". The record is in the project files as ui-seat2/34371-gates-ran.txt.
  • CI-only families (Type Check UI, Test UI shards, Build & E2E UI and the rest): read from this PR's check-runs.

Generated by Claude Code

…offers no comment composer

A types allow-list without 'comment' filters every comment out of the
block, the ones posted on it included. The block now offers no composer
and no Comments-only filter there, and tells the author why once in
development, naming both fixes.

Claude-Session: https://claude.ai/code/session_01ADHkmQL9UYenrqC6NTLq3h
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi

维护者速读

  • 卡:Record Activity tab: a posted comment is saved and read back (200) but never rendered in the timeline — 仅评论 shows (0), the author can't see their own comment #34371(p1)。HotCRM 线索页「活动」里发表的评论保存成功,读回也是 200,但时间线里看不到,「仅评论」显示 (0)。
  • 定位:不是宿主丢的。HotCRM 的 lead_detail 页面给 record:activity 块写了 types: ['task'],applyFeedConfig 按这个白名单把 comment 过滤掉了,这与 spec 的定义一致。真正的缺陷是:同一个块仍然显示评论输入框和「仅评论」选项,发出去的评论随即被自己的过滤器隐藏。
  • 改了什么(席位裁决 C):
    • 当 types 不含 comment 时,块不显示评论输入框,也不提供「仅评论」。
    • 开发环境下,每个块告警一次,点名块 id、types,并给出两种改法。
    • 没写 types,或 types 含 comment 时,行为不变。
    • RecordActivityTimeline 新增一个可选的 commentsShown 属性,默认 true。
  • 后续:编写期拒收这种组合,交给 spec 车道卡 record:activity: refuse at authoring a types list that leaves out 'comment' while the comment composer is on #34383。HotCRM 侧把 'comment' 加进 types 后,线索页的评论即可恢复,已转交。
  • 钉子:HotCRM 形状下没有输入框、没有「仅评论」;两个对照(含 comment,以及不写 types)保持原样;告警只发一次;作者显式关掉输入框时不告警。两处消融都变红后已还原。plugin-detail 全包 3402 个测试通过。
  • CI:head a61c736(已合入最新 main),success 42 · skipped 13 · 无失败。非 governed。Clause-② no,Metadata-protocol none。

席位意见

平台不再提供一个发出去就看不见的输入框,并在开发态把原因说清楚。契约层面的收紧放在 spec 车道。同意落地。

席位核对 — ACCEPT · domain:ui#2 · head a61c736 · 2026-11-16T21:31Z

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43961102540 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/install-local-no-active-organization.dogfood.test.ts > dogfood: install-local under an organization wall, with a session that has no active organizati
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected { mode: 'inline', inserted: +0, …(5) } to match object { mode: 'inline', inserted: 28 }
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 32 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi

Merge-queue triage: re-queue once · head a61c736 · 2026-11-16T21:52Z

The queue build failed on test/install-local-no-active-organization.dogfood.test.ts (inserted: 0 where 28 was expected). That assertion reads install-local seeding. This PR touches only ui files, none on that path.

Re-queued once on the same head. If it fails again without #34429 in the group, the seat triages it as this PR's.

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

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants