Skip to content

Fix comment analytics overview review issues#27758

Draft
jonatansberg wants to merge 7 commits into
comment-analytics-overviewfrom
comment-analytics-overview-review-fixes
Draft

Fix comment analytics overview review issues#27758
jonatansberg wants to merge 7 commits into
comment-analytics-overviewfrom
comment-analytics-overview-review-fixes

Conversation

@jonatansberg
Copy link
Copy Markdown
Member

Summary

Draft PR stacked on top of comment-analytics-overview.

This addresses review follow-ups for the comment analytics overview:

  • refactors the comments page composition so CommentsLayout, CommentsMain, CommentsSidebar, and CommentsAnalytics have clearer layout/content boundaries
  • fixes reported-bar filter updates so date and reported filters are applied atomically
  • fixes year-to-date range handling and hides comparison deltas where the copy would be misleading
  • adds a compact analytics error state with retry
  • buckets comment analytics series by the requested timezone instead of raw SQL DATE(created_at)
  • adds real DB integration coverage and stronger Admin API e2e assertions for analytics totals, previous totals, top posts, top commenters, reports, hidden filtering, and timezone-local buckets

Validation

  • pnpm --filter @tryghost/posts test:unit
  • pnpm --filter @tryghost/posts lint:code (passes with existing unrelated use-post-success-modal.ts warning)
  • pnpm --dir ghost/core test:single test/integration/services/comments-stats-service.test.js
  • pnpm --dir ghost/core test:single test/e2e-api/admin/stats.test.js
  • git diff --check origin/main...HEAD

Notes

gh auth status reports an invalid local token, so this PR was created via the GitHub connector after pushing the branch over SSH.

- moved the sidebar placement out of CommentsLayout so the page composes the optional analytics sidebar explicitly
- kept CommentsLayout as the generic comments page shell and introduced CommentsSidebar for the aside layout classes
- made chart filter clicks apply multiple moderation filters atomically
- corrected year-to-date date bounds and hid deltas for ranges without a meaningful comparison
- rendered an explicit retry state when the analytics query fails
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f24abfcc-8595-4676-bb57-850d79695b99

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch comment-analytics-overview-review-fixes

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.

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.

1 participant