Skip to content

Added hide comments checkbox to disable commenting dialog#25907

Merged
rob-ghost merged 1 commit intomainfrom
feat/comment-moderation-disable-comments-ui-hide-comments
Feb 3, 2026
Merged

Added hide comments checkbox to disable commenting dialog#25907
rob-ghost merged 1 commit intomainfrom
feat/comment-moderation-disable-comments-ui-hide-comments

Conversation

@rob-ghost
Copy link
Contributor

@rob-ghost rob-ghost commented Jan 20, 2026

Summary

When disabling a member from commenting, staff may also want to hide all the member's previous comments. This adds an optional "Hide all previous comments" checkbox to the disable commenting confirmation dialog.

The checkbox is gated behind a separate disableMemberCommentingHideComments labs flag since the backend support for the hide_comments API parameter will be deployed separately from the frontend.

ref https://linear.app/ghost/issue/BER-3184

Requires #25906


Note

Medium Risk
Moderate risk because it changes comment-moderation behavior and request payloads (new hide_comments parameter) behind a feature flag; failures could incorrectly hide or not hide comments when disabling members.

Overview
Adds a labs-gated “Hide all previous comments” checkbox to the disable-commenting confirmation dialog in Comments; when enabled it passes a new hide_comments parameter when calling POST /members/:id/commenting/disable.

Introduces the new disableMemberCommentingHideComments labs flag (surfaced in Labs settings), threads hideCommentsEnabled through the comments UI, and extends the members API hook/types to support the optional hideComments field. Updates Playwright page objects and adds e2e coverage for checkbox visibility and hide-vs-keep behavior.

Written by Cursor Bugbot for commit b091c8b. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added member commenting management—disable or enable commenting for individual members.
    • Added optional "Hide all previous comments" feature when disabling member commenting.
    • New private lab feature "Hide Comments When Disabling" to control the hide comments option.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

This pull request adds functionality to hide all previous comments when disabling a member's commenting ability. It introduces a new lab feature flag to gate the "Hide all previous comments" UI option, updates the member API with related mutations, and adds corresponding test coverage.

Changes

Cohort / File(s) Summary
API Mutations
apps/admin-x-framework/src/api/members.ts
Added commenting field to Member type with disable metadata. Expanded useDisableMemberCommenting to accept optional hideComments parameter. Added new useEnableMemberCommenting mutation for re-enabling member commenting.
Comments UI Components
apps/posts/src/views/comments/comments.tsx, apps/posts/src/views/comments/components/comments-list.tsx
Introduced hideCommentsEnabled flag from lab config and passed to CommentsList. Added internal state and checkbox UI to CommentsList for "Hide all previous comments" option, gated by feature flag. Updated mutation payload to include hide flag when applicable.
E2E Test Support
e2e/helpers/pages/admin/comments/comments-page.ts
Added hideCommentsCheckbox locator property to CommentsPage class for test interaction.
E2E Test Coverage
e2e/tests/admin/comments/disable-commenting.test.ts
Added new test group validating hide comments checkbox visibility and behavior when feature is enabled, including scenarios with and without the checkbox selected.
Feature Flag Configuration
apps/admin-x-settings/src/components/settings/advanced/labs/private-features.tsx
Registered new "Hide Comments When Disabling" lab feature flag (disableMemberCommentingHideComments) in private features list.

Poem

🐰 A hop, a skip, to hide the words,
When members speak no more,
Their comments vanish, clean as birds,
Behind a lab-flag door!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a hide comments checkbox to the disable commenting dialog, which is the central feature of this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/comment-moderation-disable-comments-ui-hide-comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

React E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 21171924876 -n playwright-report-react -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui branch 5 times, most recently from bb7993d to 5226956 Compare January 26, 2026 10:25
@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui branch 5 times, most recently from 6d7c27c to 21807f7 Compare January 28, 2026 13:41
Base automatically changed from feat/comment-moderation-disable-comments-ui to main January 28, 2026 15:47
@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui-hide-comments branch from d0f2f02 to 3821507 Compare February 2, 2026 14:28
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 21593990831 -n playwright-report -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 21593990831 -n playwright-report -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui-hide-comments branch from 3821507 to 95683a5 Compare February 2, 2026 14:59
@rob-ghost rob-ghost self-assigned this Feb 3, 2026
@rob-ghost rob-ghost marked this pull request as ready for review February 3, 2026 10:21
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@e2e/tests/admin/comments/disable-commenting.test.ts`:
- Around line 98-165: Update the three test titles in disable-commenting.test.ts
to follow the required "what is tested - expected outcome" lowercase format with
a " - " separator by changing the first argument strings passed to test():
rename 'hide comments checkbox appears in modal' to e.g. 'disable commenting
modal - shows hide comments checkbox', 'disabling with hide comments checked
marks comments as hidden' to 'disable commenting action - marks comments hidden
when hide checked', and 'disabling without hide comments checked keeps comments
visible' to 'disable commenting action - keeps comments visible when hide
unchecked'; leave test bodies and references to CommentsPage methods
(getCommentRowByText, openMoreMenu, clickDisableCommenting,
confirmDisableCommenting, hideCommentsCheckbox, commentingDisabledIndicator)
unchanged.

Copy link
Contributor

@weylandswart weylandswart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and works.

I thought the checkbox should probably use the same checkbox styles we use elsewhere (I found an example under Portal settings) but it looks like that comes from the old Admin X design system. Shade doesn't seem to have a checkbox for now. I'll make a note for design to add it.

@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui-hide-comments branch from 95683a5 to a1df70a Compare February 3, 2026 14:17
@rob-ghost rob-ghost changed the base branch from main to chore/shade-add-checkbox February 3, 2026 14:26
@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui-hide-comments branch from a1df70a to c7ddace Compare February 3, 2026 14:32
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui-hide-comments branch from c7ddace to 9966028 Compare February 3, 2026 14:44
Base automatically changed from chore/shade-add-checkbox to main February 3, 2026 14:45
ref https://linear.app/ghost/issue/BER-3184

Adds a checkbox to the disable commenting dialog that allows hiding
all previous comments from a member when disabling their commenting.
@rob-ghost rob-ghost force-pushed the feat/comment-moderation-disable-comments-ui-hide-comments branch from 9966028 to b091c8b Compare February 3, 2026 14:47
@rob-ghost rob-ghost enabled auto-merge (rebase) February 3, 2026 14:48
@rob-ghost rob-ghost merged commit f080dc8 into main Feb 3, 2026
35 checks passed
@rob-ghost rob-ghost deleted the feat/comment-moderation-disable-comments-ui-hide-comments branch February 3, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants