Skip to content

fix(plugin-detail): a record:chatter or record:discussion whose feed.types leaves out comment offers no comment composer - #34576

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34525-chatter-comments-shown
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34525-chatter-comments-shown

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #34525

Clause-②: no
Metadata-protocol: none

repo:objectstack#2 · os-steve · session_01ADHkmSYVw1sqCsaHSJS9JC

维护者速读

  • 改了什么:record:chatter 和 record:discussion 的 feed.types 不含 comment 时,不再显示评论输入框和「仅评论」筛选项;开发环境下对每个块提示一次原因和两种改法。判定与 record:activity 共用同一个函数 feedTypesAdmitComments。
  • 为什么改:record:activity 已按此规则收掉输入框,但两个讨论块没有把判定传给时间线,时间线默认当作「能显示评论」,用户在这里发的评论保存后立刻被 types 过滤掉,看起来像丢了。
  • 风险与回滚:只影响 feed.types 写了且不含 comment 的讨论块;没写 types 或含 comment 的块、宿主自动追加的讨论区完全不变。RecordChatterPanel 新增的 commentsShown 是可选 prop,不传即 true。回滚即 revert 本 PR。
  • 先看:ui/packages/plugin-detail/src/renderers/record-chatter.tsx(判定、开发期提示、传参);ui/packages/plugin-detail/src/RecordChatterPanel.tsx(新 prop 透传给两处时间线);ui/packages/plugin-detail/src/renderers/__tests__/recordFeedDiagnosticBlockName-9557.test.tsx(被迫改动的一条旧测试)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/recordChatterFeedMembersLive-8934.test.tsx,预期 33 个全过,其中 8 个是本卡新增(两种块各 4 个)。
  • 需要你做的:无,席位落地。

What changes

record:activity withholds the comment composer and the Comments-only filter when its types leaves out comment (the commentsShown prop on RecordActivityTimeline, computed by feedTypesAdmitComments). record:chatter and record:discussion render the same timeline through RecordChatterPanel and filter their rows by feed.types through the same applyFeedConfig, but handed the timeline no commentsShown, so it defaulted to true: a feed authored feed: { types: ['task'] } still offered the composer, and a posted comment was stored and then filtered out of that same feed.

  • renderers/record-chatter.tsx: computes commentsShown with feedTypesAdmitComments(feed?.types, blockName), the same predicate and the same block name its applyFeedConfig call filters by, so the answer and the rows cannot disagree; hands it to the panel. Where the composer would otherwise have been offered (feed.showCommentInput not false), it raises warnWithheldCommentComposer once per block from an effect, in development only (the package's per-file isDevBuild spelling), scoped BLOCK feed the way this file's row-limit refusal is.
  • RecordChatterPanel.tsx: one optional prop, commentsShown, forwarded to the timeline in both layouts (sidebar and inline). Absent means true, so a host that composes the panel itself and does not filter by feed.types is unchanged.
  • .changeset/34525-chatter-comments-shown.md: @object-ui/plugin-detail patch.

A feed with no types, or a types that includes 'comment', renders exactly as before; the host's auto-appended discussion mounts the renderer with no types and is unchanged.

Tests

New top-level describe.each over both block names in the chatter feed harness, renderers/__tests__/recordChatterFeedMembersLive-8934.test.tsx (renderer resolved through ComponentRegistry, node type stated, real panel and timeline, a host DiscussionContext with onAddComment):

  • types: ['task'] draws no composer and no Comments Only option, renders only the task row, and warns once under BLOCK feed;
  • CONTROL types: ['task', 'comment']: composer and option stay, comments show, no warning;
  • CONTROL no types: the same;
  • showCommentInput: false with types: ['task']: no warning.

Forced test edit (one): renderers/__tests__/recordFeedDiagnosticBlockName-9557.test.tsx, leg NO-FOREIGN-NAME. It mounts a record:discussion with feed.types: ['crm_task'] and counted every warning containing crm_task; the new withheld-composer warning quotes the same types, so the count went 1 to 2. The leg now counts the unrecognised-entry channel it is about, and still holds every message containing crm_task under [record:discussion with no [record:activity].

Pin run and ablations (fix commit 3da4e3c)
  • Pin file on 3da4e3c: Tests 33 passed (33), lock VERDICT command-exit 0.
  • Ablation 1, record-chatter.tsx, the commentsShown={commentsShown} pass-through deleted through scripts/ablation-replace.mjs (anchor 1 to 0, blob d6a89c65 to d4348647): Tests 2 failed, 31 passed; the types: [task] pin went red under both record:chatter and record:discussion ("expected TEXTAREA to be null"); the controls stayed green. Restored: blob equal to HEAD, git diff HEAD empty.
  • Ablation 2, RecordChatterPanel.tsx, both forwards deleted (--expect 2, anchor 2 to 0): Tests 2 failed, 31 passed, the same two pins. Restored: blob equal to HEAD, git diff HEAD empty.
  • The pins import the renderer and the registry from src (relative imports; @object-ui/react maps to its src through the root vitest alias table), so no dist rebuild sits between a mutation and the run.

Acceptance notes

  • The withheld-composer warning text says types and showCommentInput; on these two blocks both keys sit under feed, which the BLOCK feed scope names. The text is shared with record:activity and was not forked.
  • Hosts that mount RecordChatterPanel directly pass their own items and do no types filtering, so the default true keeps them as they were.

Verification

Local readings
  • Closure build: turbo run build --filter='@object-ui/plugin-detail^...' --concurrency=2: Tasks 52 successful, 52 total (41 cached), lock VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-detail type-check (tsc --noEmit && tsc -p tsconfig.test.json) on 3da4e3c: exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/ on 9491764: Test Files 380 passed, 1 skipped (381); Tests 3414 passed, 18 skipped (3432); lock VERDICT command-exit 0. (The same run on 3da4e3c had the one forced failure named under Tests.)
  • After merging origin/main (1ccb445, no overlap with this surface) into f2700d9: closure rebuilt (Tasks 52 successful), type-check exit 0, the two chatter pin files plus record-activity.test.tsx Tests 67 passed (67), lock VERDICT command-exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on f2700d9: 38 commands, each run, each exit 0; --ran reconciliation: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED".
  • node ui/scripts/check-new-cross-file-line-citations.mjs: 0 new citations. eslint --no-inline-config on the four touched files: 0 errors.
  • CI-only families (Type Check UI, Test UI, Build & E2E UI and the rest): read from this PR's check-runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmSYVw1sqCsaHSJS9JC

…types leaves out comment offers no comment composer

The chatter renderer now answers commentsShown with feedTypesAdmitComments,
the predicate record:activity uses, under the same block name its
applyFeedConfig call filters by, and RecordChatterPanel forwards it to the
timeline. A feed.types without comment therefore draws no composer and no
Comments-only option, and the author is told why once in development.

Claude-Session: https://claude.ai/code/session_01ADHkmSYVw1sqCsaHSJS9JC
Co-authored-by: Claude <noreply@anthropic.com>
…sed-types channel

A record:discussion feed whose types names no comment now also raises the
withheld-composer warning, which quotes the same types. The leg selects the
unrecognised-entry message for its count and still holds every message under
the block's own name.

Claude-Session: https://claude.ai/code/session_01ADHkmSYVw1sqCsaHSJS9JC
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 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmSYVw1sqCsaHSJS9JC

Final head for L1 · 2026-11-17T02:27Z
Final head: f2700d9f306e6aac429a0531f26a4706775c4730 (card #34525, area o2-B). CI at this head: every check completed success or skipped by path filter (Build & E2E UI, Live E2E UI, Test UI 1–16/16 + aggregate, Lint UI, Type Check UI, TypeScript Type Check, Lint & Repo Gates, Check Changeset, Check PR Size, PR-body guards, Governed Surface Queue Guard); none red.
Not governed (0 of 5 paths hit the register), 151 changed lines. No contract surface: no L2 owed. L1 goes to the seat's L1-a thread, first review. Reviewers please note the forced edit to the existing 9557 test and the new development-mode warning, both explained in the PR body.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQtnGcx7hYEL11ptVs

席位核对

L1 first review: ACCEPT · PR #34576 · card #34525 · area o2-B · L1-a2 · 2026-11-17T02:28Z

Head-sha: f2700d9f306e6aac429a0531f26a4706775c4730

Checklist

  • Shape. Draft, base main. The first line after the required attribution block is Fixes #34525, the only closing keyword in the body. Fixes is right because the PR delivers the card's whole ask.
  • Scope (get_files, 5 paths): record-chatter.tsx, RecordChatterPanel.tsx, two test files under renderers/__tests__/, and .changeset/34525-chatter-comments-shown.md. This matches the claim's file surface. Nothing under packages/spec/**, nothing outside plugin-detail.
  • Commits. 3da4e3c5 is the fix, 94917643 is the forced test edit, and f2700d9f merges main. git show --remerge-diff of the merge is empty, so it has no hand edits.
  • One predicate, not a copy. record-chatter.tsx imports feedTypesAdmitComments and warnWithheldCommentComposer from recordActivityFeed, the same helpers record-activity.tsx:195-200 uses, with the same composerWithheld and isDevBuild shape. It passes the same blockName that its applyFeedConfig filters by. RecordChatterPanel forwards the new optional commentsShown to the timeline in both layouts; when absent it arrives as undefined and RecordActivityTimeline.tsx:357 defaults it to true, so hosts that mount the panel directly are unchanged.
  • Changeset (root .changeset/, @object-ui/plugin-detail patch; the package is published, with no private flag). I checked its sentences against the diff: the withheld composer and Comments-only option, the dev-only warning naming the block, feed.types and the two fixes, "no feed.types or includes 'comment' is unchanged", and "the optional commentsShown prop, absent means true". All of them match the code. Clause-②: no and Metadata-protocol: none are consistent with a UI-only behaviour change.
  • Pins. A describe.each over both block names covers types: ['task'] (no composer, no Comments Only, exactly one warning naming <block> feed and ["task"]), two controls (types with comment, and no types), and showCommentInput: false (no warning). That is 8 cases. Two ablations are recorded in the body: removing the renderer pass-through gives 2 failed / 31 passed, and removing both panel forwards gives the same 2 red. Both restored to blob == HEAD. The controls stayed green under ablation.
  • Forced edit to recordFeedDiagnosticBlockName-9557.test.tsx: accepted. The new warning quotes the same types, so the leg's count of crm_task messages went from 1 to 2. The leg now counts only the unrecognised-entry channel, which is still exactly one, under the strict '[record:discussion] ' prefix. It also still asserts that every crm_task message starts with [record:discussion and never names [record:activity]. The NO-FOREIGN-NAME property the leg exists for is kept, and the leg is not weakened beyond admitting the new [record:discussion feed] scope.
  • Dev-mode warning: accepted. It reuses the shared warnWithheldCommentComposer text that record:activity already raises, rather than a forked copy. It fires once per block through warnOnce, only when the composer would otherwise have been offered, and only outside production. Its text names types and showCommentInput without the feed. prefix; the <block> feed scope says where they sit. That is acceptable, and the body says so in Acceptance notes.
  • CI on this head (check-runs, filter=latest, 55 runs): success=42, skipped=13, nothing red or pending. That includes Lint & Repo Gates, TypeScript Type Check, Type Check UI, Build & E2E UI, Check Changeset, and every planned Test UI shard.

L2 and landing

  • L2: not owed. Clause-②: no, no narrowing, nothing under packages/spec/src/**, no governed rule text.
  • Landing tier (node scripts/pm/check-governed-merges.mjs --pr 34576): NOT governed — ordinary queue landing, 151 changed lines ≤ 3000. The area lands it. No human approval is needed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmSYVw1sqCsaHSJS9JC

Landing · 2026-11-17T02:29Z

probe reading
check-governed-merges.mjs --pr 34576 NOT governed, 0 of 5 paths hit the register; +146 / -5, under the 3000-line human-merge threshold
L1 at f2700d9f306e6aac429a0531f26a4706775c4730 ACCEPT (6936142204, first review, L1-a); no L2 owed; head unchanged since the final-head comment; no generated file in the diff

State change: ready for review + auto-merge, by area o2-B. #34525 closes through Fixes #34525 on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 02:30
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 646b13e Nov 17, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34525-chatter-comments-shown branch November 17, 2026 03:02
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

Development

Successfully merging this pull request may close these issues.

record:chatter and record:discussion do not pass commentsShown, so a feed that hides comments still offers the composer and the comments-only option

2 participants