Skip to content

fix(plugin-detail): the discussion header shows no count when a feed read was refused - #27844

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-prnv6p
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-prnv6p

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

维护者速读

  • 改了什么:记录页讨论区在评论(或活动)读取被拒时,标题不再显示 (0) 这样的条数,只显示「Discussion」;折叠按钮也不再写 Show Discussion (0)。
  • 为什么改:没有权限看评论的成员看到「Discussion (0)」紧挨着「你没有权限查看评论」,会以为没人讨论过,而服务器只是不给看。
  • 风险与回滚:只影响读取被拒这一种状态;可读的记录条数照旧(包括 0 条)。回滚即 revert 本 PR。
  • 先看:RecordActivityTimeline.tsx 标题里的计数 span;RecordChatterPanel.tsx 的 showLabel;新测试文件。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/RecordChatterPanel.refusedReadCount-27820.test.tsx,预期 7 条全部通过。
  • 需要你做的:无,席位落地。

Fixes #27820

Clause-②: no
Metadata-protocol: none

What changes

  • RecordActivityTimeline draws its heading's (N) count only when neither of the feed's reads was refused. The signal is the existing activityDenied / commentsDenied props, the same ones that draw the refusal line; no second permission check.
  • RecordChatterPanel's collapsed inline toggle reads detail.openDiscussion ("Open discussion panel", an existing key) instead of Show Discussion (N) under the same condition.
  • Changeset: @object-ui/plugin-detail patch.

Tests

ui/packages/plugin-detail/src/__tests__/RecordChatterPanel.refusedReadCount-27820.test.tsx, through the real en pack and the record:chatter block under a host DiscussionContext (the record page's mount):

  • refused comment read, no rows: heading is exactly Discussion, refusal line shows;
  • refused comment read beside a readable activity row: no count, row and refusal line both show;
  • refused activity read: no count;
  • controls: readable with 0 comments shows (0), with 3 shows (3);
  • collapsed toggle: refused shows no count; readable keeps Show Discussion (0).
Readings at head 64fcb00
  • pnpm --dir ui exec vitest run --reporter=verbose packages/plugin-detail/ (under os-verify-lock): VERDICT command-exit 0, Test Files 339 passed / 1 skipped (340), Tests 3085 passed / 18 skipped (3103). Run on the fix commit 97c4beb; the later commit 64fcb00 changes only the new test's item type.
  • pnpm --filter @object-ui/plugin-detail run type-check (both the src and the test tsconfig): VERDICT command-exit 0 at 64fcb00; the new file: Tests 7 passed (7).
  • Ablation (fix committed first): git restore --source=359e935d on RecordActivityTimeline.tsx and RecordChatterPanel.tsx, mutation shown on disk (the count's activity-count marker 1 → 0, showLabel 3 → 0), new file run: VERDICT command-exit 1, Tests 4 failed / 3 passed (7). The four refused cases went red (first one: expected 'Discussion(0)' to be 'Discussion'), the three controls stayed green. Restored with git checkout HEAD --, git diff HEAD empty, git status --porcelain empty.

Acceptance notes

  • Measured repro on main (359e935d): the (0) is drawn by RecordActivityTimeline's heading (({filtered.length})), which RecordChatterPanel mounts with titleLabel={t('detail.discussion')} on both its sidebar and inline paths. DetailView's Discussion tab trigger draws no count. The new refused-read cases go red on main's component (the ablation under Tests).
  • Same-class in-place fix, declared: the card names the comment refusal; a refused activity read leaves the count just as unknown, in the same heading, so it is withheld too. The collapsed toggle's Show Discussion (0) is the same claim in the same panel and uses an existing key, so Clause-②: no holds and no i18n key was added.
  • RecordDetailView.tsx (the apiHandler in fix(console): a declared same-origin type: 'api' click goes through the action door #27793) is untouched.

Verification

Derived gates at head 64fcb00

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 commands, each run and recorded as command :: exit code before any pipe; all 34 exit 0, including node scripts/check-sdui-manifest.mjs. Reconciliation with --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. pnpm check:new-line-citations (under ui/): 0 new citations. Every other family is left to this PR's CI check-runs.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling labels Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh

席位核对

ACCEPT · head 64fcb00fadcfe52ef2c4639506055d2654a26fc9 · 2026-10-30T01:58Z

  • Shape: draft → main, Fixes #27820. Clause-②: no and Metadata-protocol: none. There is no new i18n key: the collapsed toggle reuses detail.openDiscussion, which is present in all ten packs and in the plugin's fallback table. The changeset is a patch on @object-ui/plugin-detail.

  • Change, read:

    • RecordActivityTimeline.tsx: the heading's ({filtered.length}) is drawn only when neither activityDenied nor commentsDenied is set. A refused read leaves the count unknown, not zero.
    • RecordChatterPanel.tsx: on a refused read, the collapsed toggle's label and aria-label read detail.openDiscussion instead of Show Discussion (0).
    • Both reuse the refusal signals the panel already receives. There is no second permission check, and RecordDetailView.tsx is untouched.
    • The refused activity read, the same defect on the same heading, is fixed in place and declared.
  • Evidence (report 6512889500): on main the (0) comes from the timeline heading, and DetailView's tab carries no count. The new RecordChatterPanel.refusedReadCount-27820.test.tsx passes 7 cases:

    • comments refused: no count, and the refusal line stays;
    • activity refused: no count;
    • collapsed toggle: no (0);
    • controls: a readable 0 shows (0) and a readable 3 shows (3).

    The ablation turns 4 red and keeps the 3 controls green. plugin-detail: 3085 tests green. Type-check green.

  • Gates (check-runs on the head): 44 success, 11 skipped, 0 failure. check-governed-merges --pr 27844: NOT governed, 4 files, 160 changed lines.

  • Landing: non-governed, all green, mergeable_state clean, so the seat lands it with pr_ready and automerge_enable.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 01:59
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 01:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit c4cb5ec Oct 30, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-prnv6p branch October 30, 2026 02:14
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record discussion: the header shows a comment count of 0 above "You don't have permission to view comments"

1 participant