-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing repost and reply count on Profile #22430
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request involves modifications to the Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
apps/admin-x-activitypub/src/views/Profile/Profile.tsxOops! Something went wrong! :( ESLint: 8.44.0 ESLint couldn't find the plugin "eslint-plugin-react-hooks". (The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "/apps/admin-x-activitypub".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react-hooks" was referenced from the config file in "apps/admin-x-activitypub/.eslintrc.cjs". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/admin-x-activitypub/src/views/Profile/Profile.tsx (1)
159-160
: Display of comment and repost counts implemented.Adding the
commentCount
andrepostCount
props to theFeedItem
component successfully implements the requirement to show repost and reply counts on the Profile. The implementation correctly maps from the activity object's properties.I notice that
commentCount
is mapped fromactivity.object.replyCount
. If these are semantically different terms for the same concept, consider standardizing the naming in future refactoring.Also applies to: 162-163
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/admin-x-activitypub/src/views/Profile/Profile.tsx
(5 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
apps/admin-x-activitypub/src/views/Profile/Profile.tsx
[error] 16-16: Imports should be sorted alphabetically (ghost/sort-imports-es6-autofix/sort-imports-es6)
[error] 26-26: 'TData' is defined but never used (@typescript-eslint/no-unused-vars)
[error] 27-27: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
🔇 Additional comments (3)
apps/admin-x-activitypub/src/views/Profile/Profile.tsx (3)
7-7
: Correct import added for the type changes.The import for
UseInfiniteQueryResult
from@tanstack/react-query
is necessary for the type changes in the hook interface.
49-51
: Appropriate handling for posts data structure added.This code correctly handles the new data structure where pages can contain 'posts', allowing the component to properly extract data from the
useProfilePostsForUser
hook.
129-130
: Profile posts data hook implementation correctly updated.The switch from
useOutboxForUser
touseProfilePostsForUser
aligns with the requirements of showing repost and reply counts on the Profile view. This change ensures the appropriate data is fetched.
Ref https://linear.app/ghost/issue/AP-864