-
Notifications
You must be signed in to change notification settings - Fork 2
BA-2452-ba-content-feed-viewing-image-posts #255
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
base: master
Are you sure you want to change the base?
BA-2452-ba-content-feed-viewing-image-posts #255
Conversation
|
WalkthroughThis update introduces a comprehensive content feed posts list feature with support for images and reactions. It adds new GraphQL fragments, queries, and mutations, as well as React components for post creation, display, and interaction. Several new icons and styled components are included, and obsolete post creation files are removed. TypeScript types and validation schemas are updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ContentFeed
participant PostList
participant PostItem
participant GraphQLAPI
User->>ContentFeed: Loads ContentFeed (with preloadedQuery)
ContentFeed->>PostList: Passes preloadedQuery
PostList->>GraphQLAPI: Fetch paginated ContentPostsFragment
GraphQLAPI-->>PostList: Returns posts data
PostList->>PostItem: Renders each post
PostItem->>GraphQLAPI: Refetches ContentPost_post fragment as needed
PostItem->>User: Renders PostHeader, PostItemImages, PostFooter
User->>PostReactionButton: Clicks Like
PostReactionButton->>GraphQLAPI: Mutate Reaction
GraphQLAPI-->>PostReactionButton: Returns updated reaction state
sequenceDiagram
participant User
participant PostCreate
participant GraphQLAPI
participant Toast
User->>PostCreate: Fills form and submits
PostCreate->>GraphQLAPI: Submits ContentPostCreateMutation (with images)
GraphQLAPI-->>PostCreate: Returns success/errors
alt Success
PostCreate->>Toast: Show success
PostCreate->>User: Redirect to new post
else Error
PostCreate->>Toast: Show error
PostCreate->>User: Display form errors
end
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
packages/components/modules/content-feed/common/graphql/fragments/ContentPost.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /packages/components/.eslintrc.js
packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /packages/components/.eslintrc.js
packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /packages/components/.eslintrc.js
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 15
🧹 Nitpick comments (28)
packages/design-system/tsup.config.ts (1)
6-6
:❓ Verification inconclusive
Simplified build configuration removes dynamic behavior.
The changes to the configuration file make the build options static by removing conditional behavior that likely depended on watch mode. While this simplifies the configuration, be aware of the following implications:
- Disabling minification (
minify: false
) will result in larger bundle sizes that might impact loading times in production.- Disabling code splitting (
splitting: false
) may affect selective loading and caching opportunities.Ensure these changes align with the performance expectations for the design system in production environments.
Also applies to: 28-28, 31-31
🏁 Script executed:
#!/bin/bash # Check bundle sizes before and after this change echo "Checking if there's a significant bundle size impact from disabling minification and code splitting" find dist -type f -name "*.js" -exec du -h {} \; | sort -hr | head -10Length of output: 327
🏁 Script executed:
#!/bin/bash # Locate tsup config file CONFIG=$(fd tsup.config.ts | head -n1) echo "Found tsup config: $CONFIG" # Show the defineConfig call context echo -e "\nContext around defineConfig:" rg -n "export default defineConfig" -A5 -B5 "$CONFIG" # Show minify and splitting flags echo -e "\nContext for minify and splitting flags:" rg -n "minify" -n "splitting" "$CONFIG"Length of output: 942
Review build configuration in packages/components/tsup.config.ts
The update removes dynamic behavior and now explicitly disables minification (
minify: false
). This will increase your bundle sizes and may impact production load times. Additionally, there is no explicitsplitting
setting in the config—so tsup’s default (splitting: false
) still applies. Consider whether you need code‑splitting for better caching and selective loading.Key locations:
- packages/components/tsup.config.ts around the
defineConfig
call
• Line 33:minify: false
• Nosplitting
option set (defaults tofalse
)Please measure bundle sizes in your
dist/
output before and after this change to ensure it meets your performance targets, and verify if you should enablesplitting: true
for production.packages/design-system/components/web/icons/PillIcon/index.tsx (1)
6-9
: Consider accessibility improvements for the icon.For better accessibility:
- Add a descriptive
titleAccess
prop value to provide screen reader information- Ensure adequate color contrast when using the default color (
action.active
)- <SvgIcon sx={{ fontSize: 18, color: 'action.active', ...sx }} {...props}> + <SvgIcon + titleAccess="Indicator dot" + sx={{ fontSize: 18, color: 'action.active', ...sx }} + {...props} + >packages/components/modules/content-feed/web/PostList/styled.tsx (1)
3-8
: Consider responsive width instead of fixed 600px
Hard–codingwidth: '600px'
may limit usability on smaller viewports. You could use a percent‐based width with amaxWidth
and add padding at breakpoints:-export const RootContainer = styled(Box)(() => ({ - display: 'flex', - width: '600px', - alignSelf: 'center', - flexDirection: 'column', -})) +export const RootContainer = styled(Box)(({ theme }) => ({ + display: 'flex', + width: '100%', + maxWidth: '600px', + margin: '0 auto', + flexDirection: 'column', + [theme.breakpoints.down('sm')]: { + padding: theme.spacing(0, 2), + }, +}))packages/components/package.json (1)
109-112
: Dependency addition looks good; don’t forget the CSS import
Referencing"react-multi-carousel": "catalog:"
aligns with the workspace catalog. Remember to import its stylesheet in your component, for example:// In PostItemImages/index.tsx import 'react-multi-carousel/lib/styles.css';packages/components/modules/content-feed/web/PostImageSlide/styled.tsx (1)
1-6
: Consider preventing image dragging.The styling correctly sets the height and prevents user selection, but you might want to also prevent image dragging for a better carousel experience.
export const ImageSlide = styled('img')(() => ({ height: '100%', userSelect: 'none', + draggable: 'false', + WebkitUserDrag: 'none' }))packages/components/modules/content-feed/web/PostHeader/types.ts (1)
1-5
: LGTM - Clean type definition.The interface correctly uses the generated GraphQL type for post data, ensuring type safety for the PostHeader component.
Consider a shared interface.
Since PostHeaderProps and PostFooterProps are identical, you might consider creating a shared interface like
PostComponentProps
to reduce duplication.packages/components/modules/content-feed/web/PostImageSlide/types.tsx (1)
1-5
: Consider renaming file extension to.ts
.This file only exports type definitions and contains no JSX. Renaming it to
.ts
would better reflect its contents.- packages/components/modules/content-feed/web/PostImageSlide/types.tsx + packages/components/modules/content-feed/web/PostImageSlide/types.tspackages/design-system/components/web/icons/index.ts (1)
35-37
: Maintain export ordering consistencyThe new icons
PillIcon
,ReplyIcon
, andSharePostIcon
are appended at the end, which breaks the existing alphabetical/grouped ordering of exports. For better readability and maintainability, please insert them in their correct positions:
PillIcon
beforePinIcon
ReplyIcon
afterCommentReplyIcon
SharePostIcon
afterShareIcon
Suggested diff:
-export { default as UsernameIcon } from './UsernameIcon' -export { default as PillIcon } from './PillIcon' -export { default as ReplyIcon } from './ReplyIcon' -export { default as SharePostIcon } from './SharePostIcon' +export { default as PillIcon } from './PillIcon' +export { default as PinIcon } from './PinIcon' ... +export { default as CommentReplyIcon } from './CommentReplyIcon' +export { default as ReplyIcon } from './ReplyIcon' ... +export { default as ShareIcon } from './ShareIcon' +export { default as SharePostIcon } from './SharePostIcon' +export { default as UsernameIcon } from './UsernameIcon'packages/components/modules/content-feed/web/PostItemImages/styled.tsx (1)
3-9
: Add vertical centering and overflow handlingThe carousel container centers content horizontally but lacks vertical centering and overflow clipping. Consider adding
alignItems: 'center'
andoverflow: 'hidden'
:export const ImageCarouselContainer = styled(Box)(() => ({ background: '#000', width: 600, height: '100%', - justifyContent: 'center', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + overflow: 'hidden', }))This ensures carousel slides are fully centered and prevents visual spillover.
packages/components/modules/content-feed/web/ContentFeed/types.ts (1)
10-12
: Consider consolidating duplicate type definitionsThese type definitions are duplicated with identical definitions in
packages/components/modules/content-feed/common/types.ts
. To avoid potential maintenance issues, consider importing these types from the common location instead of duplicating them.- export type ContentPosts = NonNullable<ContentPostsFragment$data['contentPosts']> - export type ContentPostEdges = ContentPosts['edges'] - export type ContentPostNode = NonNullable<ContentPostEdges[number]>['node'] + import { ContentPosts, ContentPostEdges, ContentPostNode } from '../../common/types' + export { ContentPosts, ContentPostEdges, ContentPostNode }packages/components/modules/content-feed/web/PostImageSlide/index.tsx (1)
14-16
: Consider adding error handling for image loading failuresThe component currently doesn't handle cases where the image fails to load. Adding an onError handler would improve user experience.
- return <ImageSlide draggable={false} src={target.image} /> + return ( + <ImageSlide + draggable={false} + src={target.image} + alt="Post image" + onError={(e) => { + e.currentTarget.style.display = 'none' + }} + /> + )packages/components/tsup.config.ts (1)
9-9
: Consider impact of keepNames on bundle sizeThe
keepNames: true
setting preserves function and class names during bundling, which is helpful for debugging but increases bundle size. This is a good choice for development builds but might want to be conditional for production.packages/components/modules/content-feed/web/PostItem/index.tsx (2)
16-33
: Consider memoization to optimize rendering performanceIn a list context, the
PostItem
component could benefit from memoization to prevent unnecessary re-renders when props haven't changed.-const PostItem: FC<PostItemProps> = ({ postRef }) => { +const PostItem: FC<PostItemProps> = React.memo(({ postRef }) => { const [post] = useRefetchableFragment<ContentPostRefetchQuery, ContentPost_post$key>( ContentPostFragmentQuery, postRef, ) if (!post) return null return ( <Stack> <PostHeader post={post} /> <PostItemImages post={post} /> <Stack px={1.5} gap={1}> <Typography variant="body2">{post.content}</Typography> </Stack> <PostFooter post={post} /> </Stack> ) -} +})
17-20
: Add error handling for GraphQL query failuresThe component doesn't currently handle potential GraphQL query failures. Consider adding error handling to improve user experience.
- const [post] = useRefetchableFragment<ContentPostRefetchQuery, ContentPost_post$key>( + const [post, refetch] = useRefetchableFragment<ContentPostRefetchQuery, ContentPost_post$key>( ContentPostFragmentQuery, postRef, ) + + const handleRefetch = useCallback(() => { + refetch({}, { onError: (error) => console.error('Failed to refetch post:', error) }); + }, [refetch]);packages/components/modules/content-feed/web/PostCreate/types.ts (1)
1-5
: Consider adding validation constraints to the form interfaceWhile the types provide good structure, they don't enforce validation constraints like minimum/maximum content length or maximum number of images allowed.
If you have validation constraints, consider documenting them as JSDoc comments:
export interface ContentPostCreateForm { + /** Content text (1-1000 characters) */ content: string + /** Up to 10 image files, each max 5MB */ images?: File[] | Blob[] isReactionsEnabled: boolean }packages/components/modules/content-feed/web/PostFooter/index.tsx (1)
28-30
: Consider timezone handling for displayed dates.The date/time formatting doesn't explicitly handle timezone differences, which might lead to inconsistent time displays depending on the user's locale. Consider specifying a consistent timezone or using the user's local timezone.
- {created.toFormat('hh:mm a')} <CircleIcon color="disabled" sx={{ fontSize: 4 }} />{' '} - {created.toFormat('DDD')} + {created.setZone('local').toFormat('hh:mm a')} <CircleIcon color="disabled" sx={{ fontSize: 4 }} />{' '} + {created.setZone('local').toFormat('DDD')}packages/components/modules/content-feed/web/PostForm/index.tsx (1)
22-23
: Add aria-label for better form accessibility.The form lacks an explicit aria-label which would improve accessibility for screen readers.
- <RootContainer> - <form onSubmit={onSubmit}> + <RootContainer> + <form onSubmit={onSubmit} aria-label="Create new post">packages/components/modules/content-feed/web/PostHeader/index.tsx (4)
16-16
: Add loading state handling.The component currently returns null if profile is not available, but doesn't handle explicit loading states. This may result in an abrupt UI transition.
- if (!profile) return null + if (!profile) { + return <Stack p={1.5} gap={1} direction="row" justifyContent="space-between"> + <Stack direction="row" gap={1}> + <Avatar sizes="small" sx={{ p: 0 }} /> + <Stack> + <Typography variant="subtitle2"><Skeleton width={100} /></Typography> + <Typography variant="caption" color="text.secondary"><Skeleton width={60} /></Typography> + </Stack> + </Stack> + </Stack> + }
22-22
: Add fallback for missing Avatar image.The Avatar component doesn't have a fallback for missing images which may result in a broken image if the profile image is unavailable.
- <Avatar sizes="small" sx={{ p: 0 }} src={image?.url} /> + <Avatar sizes="small" sx={{ p: 0 }} src={image?.url}> + {name ? name.charAt(0).toUpperCase() : '?'} + </Avatar>
26-26
: Extract path handling logic to a utility function.The path replacement logic in the JSX makes the component less readable. Consider extracting this to a utility function.
+ const getHandleFromPath = (path?: string): string => { + if (!path) return ''; + return path.replace('/', ''); + } + return ( <Stack p={1.5} gap={1} direction="row" justifyContent="space-between"> <Stack direction="row" gap={1}> <Avatar sizes="small" sx={{ p: 0 }} src={image?.url} /> <Stack> <Typography variant="subtitle2">{name}</Typography> <Typography variant="caption" color="text.secondary"> - {urlPath?.path && <>@{urlPath.path.replace('/', '')}</>} + {urlPath?.path && <>@{getHandleFromPath(urlPath.path)}</>} </Typography> </Stack> </Stack>
30-30
: Use theme spacing instead of hardcoded pixel values.The hardcoded
translateX(16px)
transform might not scale well with different theme densities. Consider using MUI's theme spacing.- <IconButton aria-label="Post Options" sx={{ transform: `translateX(16px)` }}> + <IconButton aria-label="Post Options" sx={{ transform: `translateX(${theme.spacing(2)})` }}>packages/components/modules/content-feed/web/PostImageDropzone/index.tsx (1)
63-66
: Add keyboard accessibility for file selection.The file selection is only triggered by clicks, making it inaccessible to keyboard users. Consider adding keyboard handling.
onFileClick={(selectedFile, index) => { setSelectedPreview(selectedFile as File) setSelectedPreviewIndex(index) }} + onKeyDown={(e, selectedFile, index) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + setSelectedPreview(selectedFile as File) + setSelectedPreviewIndex(index) + } + }}packages/components/modules/content-feed/web/PostForm/constants.ts (1)
5-9
: Consider type annotations for default form values.The
images
array lacks a type annotation compared to the implementation inPostCreate/constants.ts
where it's explicitly typed as[] as File[]
. For consistency and to prevent potential type issues, add type annotations.export const DEFAULT_CONTENT_POST_CREATE_FORM_VALUES = { content: '', - images: [], + images: [] as File[], isReactionsEnabled: true, }packages/components/modules/content-feed/web/PostCreate/index.tsx (1)
61-67
: Consider adding form reset on cancel.When a user cancels, you might want to reset the form to prevent stale data if they return to the form later.
const onCancel = useCallback(() => { + form.reset(DEFAULT_CONTENT_POST_CREATE_FORM_VALUES) router.push('/posts') }, [router, form])
packages/components/modules/content-feed/web/PostList/index.tsx (2)
15-19
: Missing component name in forwardRef.The
Scroller
component uses React.forwardRef but doesn't provide a display name, which can make debugging more difficult with React DevTools.const Scroller: Components['List'] = React.forwardRef(({ style, children }, ref) => ( <PostsListContainer style={style} ref={ref}> {children} </PostsListContainer> )) +Scroller.displayName = 'Scroller';
29-32
: Consider memoizing the renderPostItem function.Since this function is passed to virtualized rendering, memoizing it with useCallback can prevent unnecessary re-renders.
-const renderPostItem = (post: ContentPostEdges[number]) => { +const renderPostItem = React.useCallback((post: ContentPostEdges[number]) => { if (!post?.node) return null return <PostItem postRef={post.node} /> -} +}, [])packages/components/modules/content-feed/web/PostItemImages/index.tsx (1)
34-34
: Fix redundant conditional in opacity stylingThe opacity conditional makes no sense in the inactive state since
active
will always be false.- <CircleIcon sx={{ color: '#fff', fontSize: 8, opacity: active ? 1 : 0.5 }} /> + <CircleIcon sx={{ color: '#fff', fontSize: 8, opacity: 0.5 }} />packages/components/modules/content-feed/web/PostForm/types.ts (1)
20-25
: Consider making PostFormProps more flexible for both create and update operationsCurrently,
PostFormProps
only supports the create form type. Consider making it generic to support both create and update operations for better reusability.export interface PostFormProps { - form: UseFormReturn<ContentPostCreateForm> + form: UseFormReturn<ContentPostCreateForm | ContentPostUpdateForm> onSubmit: () => void isSaving: boolean onCancel: () => void }Or use a generic type parameter:
export interface PostFormProps<T = ContentPostCreateForm> { form: UseFormReturn<T> onSubmit: () => void isSaving: boolean onCancel: () => void }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (45)
packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/index.ts
(1 hunks)packages/components/modules/content-feed/common/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeed/index.tsx
(2 hunks)packages/components/modules/content-feed/web/ContentFeed/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostCreate/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostCreate/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostCreate/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostFooter/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostFooter/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostHeader/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostHeader/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/types.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostList/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostList/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/types.ts
(1 hunks)packages/components/modules/content-feed/web/index.ts
(1 hunks)packages/components/package.json
(1 hunks)packages/components/schema.graphql
(7 hunks)packages/components/tsup.config.ts
(2 hunks)packages/design-system/components/web/icons/PillIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/ReplyIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/SharePostIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/index.ts
(1 hunks)packages/design-system/tsup.config.ts
(2 hunks)pnpm-workspace.yaml
(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
packages/components/modules/content-feed/web/PostFooter/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
packages/components/modules/content-feed/web/PostHeader/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
packages/components/modules/content-feed/web/PostItem/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
packages/components/modules/content-feed/web/ContentFeed/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
🧬 Code Graph Analysis (19)
packages/components/modules/content-feed/web/PostItem/index.tsx (2)
packages/components/modules/content-feed/web/PostItem/types.ts (1)
PostItemProps
(3-5)packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts (1)
ContentPostFragmentQuery
(3-24)
packages/components/modules/content-feed/web/PostCreate/constants.ts (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
ContentPostCreateForm
(1-5)
packages/components/tsup.config.ts (1)
packages/design-system/tsup.config.ts (1)
esbuildOptions
(12-17)
packages/components/modules/content-feed/web/PostImageSlide/index.tsx (3)
packages/components/modules/content-feed/web/PostImageSlide/types.tsx (1)
PostImageSlideProps
(3-5)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts (1)
ContentPostImageFragment
(3-8)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx (1)
ImageSlide
(3-6)
packages/components/modules/content-feed/web/PostItemImages/index.tsx (2)
packages/components/modules/content-feed/web/PostItemImages/types.ts (1)
PostItemImagesProps
(3-5)packages/components/modules/content-feed/web/PostItemImages/styled.tsx (1)
ImageCarouselContainer
(3-9)
packages/components/modules/content-feed/web/PostImageDropzone/types.ts (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
ContentPostCreateForm
(1-5)
packages/components/modules/content-feed/common/types.ts (1)
packages/components/modules/content-feed/web/ContentFeed/types.ts (3)
ContentPosts
(10-10)ContentPostEdges
(11-11)ContentPostNode
(12-12)
packages/components/modules/content-feed/web/ContentFeed/types.ts (1)
packages/components/modules/content-feed/common/types.ts (3)
ContentPosts
(3-3)ContentPostEdges
(4-4)ContentPostNode
(5-5)
packages/components/modules/content-feed/web/PostFooter/index.tsx (1)
packages/components/modules/content-feed/web/PostFooter/types.ts (1)
PostFooterProps
(3-5)
packages/components/modules/content-feed/web/PostList/styled.tsx (1)
packages/components/modules/content-feed/web/PostForm/styled.tsx (3)
RootContainer
(3-8)HeaderContainer
(10-17)ButtonContainer
(19-24)
packages/components/modules/content-feed/web/PostForm/index.tsx (2)
packages/components/modules/content-feed/web/PostForm/types.ts (1)
PostFormProps
(20-25)packages/components/modules/content-feed/web/PostForm/styled.tsx (3)
RootContainer
(3-8)HeaderContainer
(10-17)ButtonContainer
(19-24)
packages/components/modules/content-feed/web/PostForm/constants.ts (2)
packages/components/modules/content-feed/web/PostCreate/constants.ts (2)
DEFAULT_CONTENT_POST_CREATE_FORM_VALUES
(5-9)CONTENT_POST_CREATE_FORM_VALIDATION
(11-15)packages/components/modules/content-feed/web/PostForm/types.ts (2)
ContentPostCreateForm
(3-7)ContentPostUpdateForm
(9-14)
packages/components/modules/content-feed/web/PostImageDropzone/index.tsx (1)
packages/components/modules/content-feed/web/PostImageDropzone/types.ts (1)
PostImageDropzoneProps
(5-7)
packages/components/modules/content-feed/web/PostCreate/index.tsx (6)
packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts (1)
useContentPostCreateMutation
(22-23)packages/components/modules/content-feed/web/PostCreate/types.ts (2)
ContentPostCreateForm
(1-5)UploadableContentPostFiles
(7-9)packages/components/modules/content-feed/web/PostForm/types.ts (2)
ContentPostCreateForm
(3-7)UploadableContentPostFiles
(16-18)packages/components/modules/content-feed/web/PostCreate/constants.ts (2)
DEFAULT_CONTENT_POST_CREATE_FORM_VALUES
(5-9)CONTENT_POST_CREATE_FORM_VALIDATION
(11-15)packages/components/modules/content-feed/web/PostForm/constants.ts (2)
DEFAULT_CONTENT_POST_CREATE_FORM_VALUES
(5-9)CONTENT_POST_CREATE_FORM_VALIDATION
(11-15)packages/utils/functions/form/setFormRelayErrors/index.ts (1)
setFormRelayErrors
(17-32)
packages/components/modules/content-feed/web/PostHeader/index.tsx (2)
packages/components/modules/content-feed/web/PostHeader/types.ts (1)
PostHeaderProps
(3-5)packages/components/modules/profiles/common/graphql/fragments/ProfileItem.ts (1)
ProfileItemFragment
(3-15)
packages/components/modules/content-feed/web/PostForm/styled.tsx (1)
packages/components/modules/content-feed/web/PostList/styled.tsx (3)
RootContainer
(3-8)HeaderContainer
(10-16)ButtonContainer
(18-24)
packages/components/modules/content-feed/web/PostReactionButton/index.tsx (1)
packages/components/modules/content-feed/web/PostReactionButton/types.ts (1)
PostReactionButtonProps
(3-5)
packages/components/modules/content-feed/web/PostForm/types.ts (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (2)
ContentPostCreateForm
(1-5)UploadableContentPostFiles
(7-9)
packages/components/modules/content-feed/web/ContentFeed/index.tsx (1)
packages/components/modules/content-feed/web/ContentFeed/types.ts (1)
ContentFeedProps
(6-8)
🔇 Additional comments (59)
packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts (1)
3-8
:✅ Verification successful
GraphQL fragment looks good for image retrieval.
The fragment correctly defines the essential fields needed for displaying content post images. The structure follows Relay best practices by keeping the fragment focused on specific data needs.
However, consider whether any additional image metadata fields might be useful for the UI, such as:
- Image dimensions (width/height)
- Alt text for accessibility
- Caption or description
🏁 Script executed:
#!/bin/bash # Check if the ContentPostImage type has additional fields that might be useful echo "Checking ContentPostImage type definition for additional useful fields" fd -t f -e ts -e tsx -e graphql | xargs grep -l "type ContentPostImage" | xargs catLength of output: 45405
Verified ContentPostImageFragment – all available fields included
I checked the
ContentPostImage
GraphQL type and it only exposes:
image: String
post: ContentPost!
id: ID!
(Relay global ID)pk: Int!
Your fragment already pulls in both
pk
andimage
, which are the only fields available for image retrieval. There are currently no width/height, alt text or caption/description fields onContentPostImage
. If you anticipate needing that metadata in the UI, you’ll need to extend the GraphQL schema accordingly.
- ContentPostImage fields:
id
,pk
,image
- No
width
/height
,altText
, orcaption
present- Schema extension required for any additional metadata
packages/components/modules/content-feed/web/PostReactionButton/types.ts (1)
1-5
:❓ Verification inconclusive
Props interface follows type-safe patterns.
The interface correctly implements a type-safe approach using GraphQL fragment references, which is the recommended pattern for Relay components.
For completeness, consider whether the reaction button might need additional props for customization, such as:
- Size variant
- Disabled state
- Custom styling options
- Callback for reactions
🏁 Script executed:
#!/bin/bash # Check how the PostReactionButton component uses these props echo "Checking implementation of PostReactionButton" fd -t f -e tsx "PostReactionButton/index.tsx" | xargs catLength of output: 158
Confirm PostReactionButton Props Usage and Customization
I agree that the
PostReactionButtonProps
interface is type‑safe and follows best practices by relying on the generatedReactionButton_target$key
fragment. For improved flexibility, consider whether you’ll need to support additional customization options:
- Size variants (e.g., “small” | “medium” | “large”)
- Disabled state
- Custom styling overrides (className, style)
- Reaction callback handlers (onReact)
I wasn’t able to locate
PostReactionButton/index.tsx
in the codebase—please verify that the component exists at the expected path, that these props are properly forwarded, and that any new customization options are implemented and typed accordingly.packages/design-system/components/web/icons/PillIcon/index.tsx (1)
5-11
: Icon implementation follows design system patterns.The PillIcon component correctly implements the design system's icon patterns using MUI's SvgIcon component with appropriate default styling.
packages/components/modules/content-feed/web/PostList/styled.tsx (4)
10-16
: Review vertical spacing on header container
In thePostForm
styled file,HeaderContainer
included amarginBottom
. Here it’s missing. Please confirm if additional bottom margin is needed for consistency.
18-24
: Double‑checkjustifyContent
on ButtonContainer
UsingjustifyContent: 'space-between'
withwidth: 'fit-content'
might not space controls as expected. Verify against design or considerjustifyContent: 'center'
plus the existinggap
.
26-31
: Good use of themed divider for list items
Leveragingtheme.palette.divider
for the border ensures visual consistency across the app.
33-35
: Approve padding for post header
Usingtheme.spacing(1, 5)
aligns with MUI best practices and provides consistent padding.pnpm-workspace.yaml (1)
25-25
:✅ Verification successful
Verify
react-multi-carousel
catalog entry
Ensure version2.8.6
is published and correct:Expected output:
2.8.6
🏁 Script executed:
#!/bin/bash npm view [email protected] versionLength of output: 51
Confirmed: [email protected] is published
npm view [email protected] version
returned2.8.6
, so the entry in pnpm-workspace.yaml (line 25) is correct.packages/components/modules/content-feed/web/ContentFeed/index.tsx (2)
8-8
: LGTM - Clean import of the new PostList component.The import aligns with the rest of the module structure and supports the implementation of the image viewing functionality.
12-12
: Correctly implementing the preloaded query pattern.The component now properly accepts and passes the preloaded query data to the PostList component, enabling the rendering of content posts with images as specified in the PR objectives.
Also applies to: 36-36
packages/components/modules/content-feed/web/PostFooter/types.ts (1)
1-5
: LGTM - Clean type definition.The interface correctly uses the generated GraphQL type for post data, ensuring type safety for the PostFooter component.
packages/components/modules/content-feed/web/PostImageSlide/types.tsx (1)
1-5
: Correct typing and imports for PostImageSlideProps.The new
PostImageSlideProps
interface properly references the generatedContentPostImageFragment$key
and the import path is accurate.packages/components/modules/content-feed/web/PostItemImages/types.ts (1)
1-5
: ApprovePostItemImagesProps
definition.The
post
prop is correctly typed asContentPost_post$data
and the import path aligns with the generated GraphQL types.packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts (1)
1-9
: Validate GraphQL query setup.The
ContentPostDetailFragmentQuery
correctly importsgraphql
fromreact-relay
and spreads theContentPost_post
fragment. Ensure this query is re-exported in the module’s public API (e.g., incommon/index.ts
) so that downstream components can access it.packages/components/modules/content-feed/web/PostItem/types.ts (1)
1-5
: ApprovePostItemProps
interface.The
postRef
prop is properly typed asContentPost_post$key
for use with Relay’s fragment hooks, and the import path is correct.packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts (1)
1-8
: ApproveContentPostsQuery
definition.The paginated query parameters (
count
,cursor
,orderBy
) and the fragment argument spread are correctly specified. Confirm thatContentPostsQuery
is exposed via the module’s public API as intended.packages/components/modules/content-feed/common/index.ts (1)
4-6
: Expose new GraphQL operations for content-feedRe-exporting
ContentPosts
fragments and queries along withContentPostDetail
aligns the common API surface with the newly introduced content-feed GraphQL modules, simplifying imports in your web components.packages/components/modules/content-feed/web/PostImageDropzone/types.ts (1)
1-7
: Props interface is clear and type-safeThe
PostImageDropzoneProps
interface correctly types theform
prop as aUseFormReturn<ContentPostCreateForm>
, ensuring strong typing for form operations in the dropzone component.packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts (1)
10-11
: Good approach using fragment spread!Replacing explicit field selection with the
ContentPost_post
fragment spread is a best practice. This promotes reusability, maintains consistency across queries/mutations, and simplifies future maintenance—when the fragment is updated, all mutations using it will automatically reflect those changes.packages/components/modules/content-feed/common/types.ts (1)
1-5
: Well-structured type definitionsThese type definitions provide strong typing for working with content post data structures. The use of
NonNullable
and proper type narrowing through the GraphQL connection pattern (root → edges → nodes) shows good TypeScript practices.packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts (1)
3-24
: Well-designed fragment with comprehensive field selectionThis fragment is well-structured with complete field selection for content posts:
- The
@refetchable
directive properly enables data refreshing- Includes nested connections for images with fragment spreads
- Contains profile information and reaction functionality
- Timestamps for proper content ordering and display
The fragment's comprehensiveness ensures consistent data fetching across components that use content posts.
packages/components/modules/content-feed/web/ContentFeed/types.ts (1)
6-8
: ContentFeedProps populated as plannedThe interface has been populated with the
preloadedQuery
property as indicated in the retrieved learnings. This correctly implements the Relay preloaded query pattern for better performance.packages/components/tsup.config.ts (3)
16-16
: Good practice marking carousel dependencies as externalCorrectly marking
react-multi-carousel
and its CSS as external dependencies ensures they won't be bundled with your code, preventing duplication across packages.Also applies to: 28-29
32-36
:❓ Verification inconclusive
Verify build configuration choices for production use
Setting
minify: false
andsplitting: false
might impact production performance. Disabling minification increases bundle size, while disabling code splitting prevents loading optimizations.Are these settings intentionally set for development purposes, or should they be conditional based on the environment?
🏁 Script executed:
#!/bin/bash # Check if these settings are consistent with other production configs grep -r "minify:" --include="*.ts" --include="*.js" packages/*/tsup.config.* grep -r "splitting:" --include="*.ts" --include="*.js" packages/*/tsup.config.*Length of output: 472
Review consistency of production build optimizations
Both
packages/components/tsup.config.ts
andpackages/design-system/tsup.config.ts
haveminify: false
andsplitting: false
. These settings affect bundle size and loading performance in production.• packages/components/tsup.config.ts
• packages/design-system/tsup.config.tsPlease confirm whether disabling minification and code‑splitting across all environments is intentional. If you need production optimizations, consider making these flags conditional, for example:
minify: process.env.NODE_ENV === 'production', splitting: process.env.NODE_ENV === 'production',
32-32
:✅ Verification successful
Verify browser compatibility with ES2024 target
Setting the target to 'es2024' enables newer JavaScript features but might limit compatibility with older browsers. Ensure this aligns with your browser support requirements.
🌐 Web query:
What browsers support ES2024 features?
💡 Result:
Browser Support for ES2024 Features
Multiple sources confirm that the main ES2024 (ECMAScript 2024/ES15) features are already supported in all modern, stable browsers:
- Google Chrome: 117 and above
- Mozilla Firefox: 119 and above
- Microsoft Edge: 117 and above
- Apple Safari: 17.4 and above[1]
These versions cover the latest releases as of late 2024 and early 2025, which means almost all users with up-to-date browsers can utilize ES2024 features without additional configuration.
Summary Table
Feature Chrome 117+ Firefox 119+ Edge 117+ Safari 17.4+ ES2024 (ECMAScript 15) ✔️ ✔️ ✔️ ✔️ Notable ES2024 Features with Browser Support
- Promise.withResolvers: Manage external resolution and rejection of Promises.
- Object.groupBy / Map.groupBy: Group collections by key properties.
- Atomics.waitAsync: Safe asynchronous thread communication.
- String.isWellFormed / String.toWellFormed: String validation and normalization tools.
These features are already available in browsers and Node.js, so you can use them today in production environments[8].
"The newest version of the spec, ECMAScript 2024, includes seven new JavaScript features... All of these features are supported for JavaScript in browsers and server-side environments, so you can start using them today."[8]
Additional Compatibility Notes
- Most users running Chrome, Firefox, Edge, or Safari from mid-2024 onwards will have full ES2024 support.
- For older browsers or non-mainstream browsers, polyfills or transpilers (such as Babel) can provide fallback support[7].
- Testing in the latest stable versions of each browser is recommended to ensure full compatibility[5][7].
Conclusion
ES2024 (ECMAScript 2024) features are now natively supported in Chrome 117+, Firefox 119+, Edge 117+, and Safari 17.4+. This coverage ensures broad compatibility for new JavaScript features across the vast majority of devices and platforms in use today[1][4][8].
Citations:
- 1: https://dev.to/techelopment/ecmascript-a-collection-of-the-main-new-features-of-each-version-8n5
- 2: https://gist.github.com/Julien-Marcou/156b19aea4704e1d2f48adafc6e2acbf
- 3: https://caniuse.com/?search=es20
- 4: https://dev.to/delia_code/exploring-the-newest-features-in-javascript-es2024-jie
- 5: https://www.actionrocket.co/blog/browser-support-in-2024
- 6: https://web.dev/blog/web-platform-09-2024
- 7: https://blog.pixelfreestudio.com/ultimate-guide-to-cross-browser-compatibility-in-2024/
- 8: https://www.infoworld.com/article/2336858/ecmascript-2024-features-you-can-use-now.html
ES2024 target is broadly supported by modern browsers
All major, up‑to‑date browsers now support ES2024 (ECMAScript 15) features natively:
- Chrome 117+
- Firefox 119+
- Edge 117+
- Safari 17.4+
If your minimum supported browsers meet these versions, targeting
es2024
is safe. For environments that must run in older or non‑mainstream browsers, continue using a lower target or ship polyfills/transpiled fallbacks.packages/components/modules/content-feed/web/PostItem/index.tsx (1)
24-31
: Well-structured component with clear hierarchyThe component structure is clean and follows a logical layout with header, images, content, and footer. The MUI Stack component is appropriately used for layout.
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
7-9
: Excellent use of TypeScript template literal typesThe
UploadableContentPostFiles
type cleverly uses template literal types to ensure only valid image keys can be used. This pattern enforces type safety and prevents typos.packages/components/modules/content-feed/web/PostFooter/index.tsx (1)
20-25
: Implement handlers for Reply and Share buttons.The Reply and Share buttons are currently visual-only with no handlers implemented. These buttons should trigger appropriate actions based on the PR objective of enhancing user experience in the content feed.
Consider implementing these handlers or disabling the buttons if the functionality is planned for a future PR.
packages/components/modules/content-feed/web/PostForm/index.tsx (1)
12-12
: Check the RootContainer styling in the imported component.According to the relevant code snippets, the
RootContainer
styled component has a typo in its style property:dispaly
instead ofdisplay
. This might affect the layout rendering.Please verify the styling in the
PostForm/styled.tsx
file and fix the typo if present.packages/components/modules/content-feed/web/PostImageDropzone/index.tsx (1)
56-57
:❓ Verification inconclusive
Ensure file size restrictions match backend capabilities.
The component allows multiple images with a 15MB size limit per file, but there's no check for total upload size. This might lead to issues if the backend has restrictions on the total upload size.
🏁 Script executed:
#!/bin/bash # Check if there are any backend constraints on total upload size rg -i --type=ts "upload.*size|size.*upload|max.*size|size.*limit" --glob "**/*.{ts,tsx,js,jsx}" | grep -v "maxFileSize"Length of output: 3379
🏁 Script executed:
#!/bin/bash # Locate and display the contents around the Dropzone implementation in PostImageDropzone FILE=$(fd -t f -p "PostImageDropzone/index.tsx") echo "File: $FILE" sed -n '1,200p' "$FILE"Length of output: 2634
Verify total upload payload size against backend
I didn’t find any code-level constraint on the combined size of all images in a post upload (we only enforce
maxFileSize={15}
MB per file). To avoid runtime errors if your server imposes a limit on the total request payload, please:
- Confirm what maximum aggregate upload size the content‑feed API will accept.
- If there is a cap, add client‑side validation in PostImageDropzone (e.g. sum
files[].size
) to enforce that total before callingform.setValue
.packages/components/modules/content-feed/web/PostReactionButton/index.tsx (2)
1-13
: LGTM! Good use of React patterns and component structure.The imports are well-organized and the component correctly leverages the design system components.
14-35
: Well-implemented reaction button with proper accessibility.The component is implemented well with:
- Effective use of the render prop pattern to access reaction functionality
- Conditional rendering of the appropriate icon based on reaction state
- Good accessibility with aria-labels for both the button and the count
- Clean grid layout for positioning elements
packages/components/modules/content-feed/web/PostCreate/index.tsx (2)
19-28
: LGTM! Good form setup with Zod validation.The form setup uses React Hook Form with Zod validation appropriately, and the mode is set to validate onBlur for a good user experience.
30-59
: Well-structured form submission handler with proper error handling.The submission logic correctly:
- Prepares uploadable files from the form data
- Commits the mutation with the right variables
- Handles both success and error responses
- Provides user feedback via toast notifications
- Resets the form and navigates to the new post on success
packages/components/modules/content-feed/web/PostList/index.tsx (1)
52-68
: LGTM! Well-implemented virtualized list with optimizations.The Virtuoso configuration is well done with:
- Window scrolling for seamless UX
- Appropriate overscan for performance
- Clean component composition
- Efficient end-reached handling for pagination
packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts (2)
6-31
: LGTM - Well-structured GraphQL fragment for content posts paginationThe
ContentPostsFragmentQuery
is well designed, following Relay best practices with proper pagination support, sensible defaults, and modular fragment composition.
33-37
: LGTM - Clean hook implementationThe
useContentPosts
hook provides a clean wrapper around Relay's pagination functionality with proper typing.packages/components/modules/content-feed/web/PostForm/types.ts (1)
3-18
: LGTM - Well-structured form interfacesThe interfaces for content post creation and updates are well-defined with appropriate optional fields and type unions for image handling.
packages/components/modules/content-feed/web/index.ts (9)
6-7
: Exports for PostImageDropzone look good
The newPostImageDropzone
component and its types are correctly re‑exported for downstream consumers.
9-10
: Exports for PostCreate look good
ThePostCreate
component and its type definitions are properly surfaced in the module’s public API.
12-13
: Exports for PostItem look good
AddingPostItem
and its types aligns with the new feed‑item rendering logic.
15-16
: Exports for PostHeader look good
PostHeader
and its types are correctly made available.
18-19
: Exports for PostFooter look good
PostFooter
and its type exports are correctly added.
21-22
: Exports for PostItemImages look good
PostItemImages
and its types are appropriately re‑exported.
24-25
: Exports for PostImageSlide look good
PostImageSlide
and its type definitions are correctly included.
27-27
: Missing type export forPostList
?
All other components have matchingexport type * from
lines. IfPostList/types
exists, please add aexport type * from './PostList/types'
to maintain consistency.
29-30
: Exports for PostReactionButton look good
PostReactionButton
and its types are correctly re‑exported.packages/components/schema.graphql (12)
484-498
: Review nestedimages
field design onContentPost
You’ve addedimages(offset, before, after, first, last, id, post)
. In a nested context, the parent post’s ID is already in scope—requiring apost
argument could be redundant. Please confirm that the resolver signature expects this argument and that clients will not need to manually pass the post ID when queryingContentPost.images
.
484-487
: Approve reaction interface implementation
The addition ofcreated
,modified
, andisReactionsEnabled
fields aligns with theReactionsInterface
extension.
511-515
: Approve newContentPostCreateInput
IntroducingisReactionsEnabled: Boolean!
in the create input ensures clients explicitly opt in to reactions.
525-529
: ApproveContentPostDeleteInput
The delete mutation input is well‑formed.
530-536
: ApproveContentPostDeletePayload
The delete payload correctly returnsdeletedId
and mutation metadata.
575-580
: ApproveContentPostUpdateInput
IncludingisReactionsEnabled
in the update input mirrors the create API, which is consistent.
582-588
: ApproveContentPostUpdatePayload
The update payload properly returns the updatedcontentPost
node.
849-852
: Approve mutation additions
contentPostUpdate
andcontentPostDelete
mutations are correctly wired into theMutation
type.
1534-1537
: ApprovecontentPost
query
Single‑post fetch by ID is in place and matches the new type.
1539-1547
: ApprovecontentPosts
root query
Batch post querying with pagination andorderBy
is consistent with the schema conventions.
1548-1553
: Approve image queries
ThecontentPostImage
andcontentPostImages
queries allow clients to fetch images independently and with filters.
1304-1313
: ApproveProfile.contentPosts
field
Exposing a paginatedcontentPosts
connection onProfile
is consistent with other collections on the type.
packages/design-system/components/web/icons/SharePostIcon/index.tsx
Outdated
Show resolved
Hide resolved
packages/design-system/components/web/icons/ReplyIcon/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/modules/content-feed/web/PostCreate/constants.ts
Outdated
Show resolved
Hide resolved
packages/components/modules/content-feed/web/PostImageSlide/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/modules/content-feed/web/PostForm/constants.ts
Outdated
Show resolved
Hide resolved
packages/components/modules/content-feed/web/PostForm/styled.tsx
Outdated
Show resolved
Hide resolved
packages/components/modules/content-feed/web/PostItemImages/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/modules/content-feed/web/PostItemImages/index.tsx
Outdated
Show resolved
Hide resolved
7b35c12
to
bd24ee6
Compare
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: 0
♻️ Duplicate comments (1)
packages/components/modules/content-feed/web/PostForm/styled.tsx (1)
4-4
: Fix the typo in the CSS propertyThere's a typo in the
display
property:dispaly
should be corrected todisplay
.export const RootContainer = styled(Box)(() => ({ - dispaly: 'flex', + display: 'flex', width: '600px', alignSelf: 'center', flexDirection: 'column', }))
🧹 Nitpick comments (5)
packages/components/schema.graphql (5)
484-487
: Ensure ReactionsInterface compliance
TheContentPost
type now implementsReactionsInterface
and exposesreactionsCount
,reactions
, andmyReaction
. Please verify that:
- The underlying resolvers supply these fields consistently.
reactionsCount
is populated (consider making it non-nullable if it’s always returned).- Fragments and UI queries have been updated to fetch the new reaction fields.
Also applies to: 495-497
491-491
: Simplify image connection arguments
Theimages
field now accepts bothid
andpost
args, yet it’s already scoped to a specificContentPost
. Consider removing the redundantid
argument or renamingpost
topostId
for clarity.
1274-1283
: ExposecontentPosts
onProfile
A newcontentPosts
connection with pagination andorderBy
was added. Verify that:
- The resolver supports all pagination args and ordering logic.
- Client queries (e.g., the profile feed) use this field instead of legacy endpoints.
1506-1519
: New root-levelcontentPost
queries
You introducedcontentPost(id: ID!): ContentPost
andcontentPosts(...)
at the root. Please:
- Wire these to the correct resolvers and security/access checks.
- Consider replacing the raw
orderBy: String
with a typed enum for better schema safety.
1763-1790
: Introduce hierarchicalReportType
A newReportType
object withparentType
andsubTypes
replaces the flat enum. Ensure:
- Recursive resolution is performant (add caching or depth limits).
- The
targetObjectId
filter onsubTypes
is documented and type-correct (should it beID
instead ofString
?).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (47)
packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/index.ts
(1 hunks)packages/components/modules/content-feed/common/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeed/index.tsx
(2 hunks)packages/components/modules/content-feed/web/ContentFeed/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeedImage/types.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/index.tsx
(0 hunks)packages/components/modules/content-feed/web/PostCreate/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostCreate/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostCreate/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostFooter/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostFooter/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/styled.tsx
(2 hunks)packages/components/modules/content-feed/web/PostForm/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostHeader/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostHeader/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
(3 hunks)packages/components/modules/content-feed/web/PostImageDropzone/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/types.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostList/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostList/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/types.ts
(1 hunks)packages/components/modules/content-feed/web/index.ts
(1 hunks)packages/components/package.json
(1 hunks)packages/components/schema.graphql
(10 hunks)packages/components/tsup.config.ts
(3 hunks)packages/design-system/components/web/icons/PillIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/ReplyIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/SharePostIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/index.ts
(1 hunks)packages/design-system/tsup.config.ts
(2 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (2)
- packages/components/modules/content-feed/web/ContentFeedImage/types.ts
- packages/components/modules/content-feed/web/NewContentPost/index.tsx
✅ Files skipped from review due to trivial changes (5)
- pnpm-workspace.yaml
- packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
- packages/design-system/components/web/icons/index.ts
- packages/components/modules/content-feed/web/PostItemImages/index.tsx
- packages/components/modules/content-feed/web/PostList/styled.tsx
🚧 Files skipped from review as they are similar to previous changes (38)
- packages/components/package.json
- packages/components/modules/content-feed/web/PostCreate/constants.ts
- packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
- packages/components/modules/content-feed/web/PostHeader/types.ts
- packages/components/modules/content-feed/common/index.ts
- packages/components/modules/content-feed/web/PostItemImages/styled.tsx
- packages/components/modules/content-feed/web/ContentFeed/index.tsx
- packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
- packages/components/modules/content-feed/web/PostImageSlide/types.tsx
- packages/components/modules/content-feed/web/PostItemImages/types.ts
- packages/design-system/tsup.config.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
- packages/components/tsup.config.ts
- packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
- packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
- packages/design-system/components/web/icons/ReplyIcon/index.tsx
- packages/design-system/components/web/icons/SharePostIcon/index.tsx
- packages/components/modules/content-feed/web/PostReactionButton/types.ts
- packages/design-system/components/web/icons/PillIcon/index.tsx
- packages/components/modules/content-feed/common/types.ts
- packages/components/modules/content-feed/web/PostFooter/types.ts
- packages/components/modules/content-feed/web/PostItem/types.ts
- packages/components/modules/content-feed/web/PostList/index.tsx
- packages/components/modules/content-feed/web/PostImageDropzone/types.ts
- packages/components/modules/content-feed/web/PostItem/index.tsx
- packages/components/modules/content-feed/web/PostForm/constants.ts
- packages/components/modules/content-feed/web/PostImageSlide/index.tsx
- packages/components/modules/content-feed/web/ContentFeed/types.ts
- packages/components/modules/content-feed/web/PostForm/index.tsx
- packages/components/modules/content-feed/web/PostFooter/index.tsx
- packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
- packages/components/modules/content-feed/web/PostHeader/index.tsx
- packages/components/modules/content-feed/web/PostCreate/types.ts
- packages/components/modules/content-feed/web/PostForm/types.ts
- packages/components/modules/content-feed/web/index.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
- packages/components/modules/content-feed/web/PostReactionButton/index.tsx
- packages/components/modules/content-feed/web/PostCreate/index.tsx
🔇 Additional comments (7)
packages/components/modules/content-feed/web/PostForm/styled.tsx (1)
26-29
: Looks good! SlideImage component added for carousel functionality.The new
SlideImage
component properly supports the image carousel functionality required by the PR, with appropriate styling to ensure images display correctly and prevent unwanted text selection.packages/components/schema.graphql (6)
511-514
: AddisReactionsEnabled
toContentPostCreateInput
Introducing a required Boolean flag at creation time is critical, but make sure:
- Your server-side mutation resolver defaults
isReactionsEnabled
appropriately.- Client-side forms and validation schemas include this new field.
1223-1232
: UpdateProfile
to implementReportsInterface
Profile
now implementsReportsInterface
and exposesreportsCount: GenericScalar
(replacing the oldJSONString!
). Please confirm that:
- Resolvers have been updated to return a numeric count.
- Any existing client code or tests referring to the old JSON string format have been adjusted.
1314-1316
: Addreports
andmyReports
toProfile
These fields allow fetching all reports and the current user’s report on a profile. Ensure that:
- Permissions are enforced so
myReports
only returns a node for the authenticated user.- Connection edges honor pagination arguments.
1714-1714
: MigratereportType
to object type
SwappingreportType
from an enum toReportType
allows richer metadata, but breaks existing fragments. Update all client fragments and document this change.
1732-1732
: UsereportTypeId
inReportCreateInput
Replacing the enum field withreportTypeId: ID!
requires updating client-side mutation calls and payload validation.
1758-1758
: AddreportsCount
toReportsInterface
The interface now exposes a generic scalar count. Confirm all implementing types return this field and consider standardizing onInt
if you don’t need non-integer counts.
bd24ee6
to
840291c
Compare
840291c
to
cf767df
Compare
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: 1
🧹 Nitpick comments (3)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
1-1
: Intentionally empty interface for future extension
The emptyPostCreateFormProps
is reserved for props that thePostCreate
component will accept in upcoming PRs (similar toContentFeedProps
). To prevent the linter from flagging this (noEmptyInterface
), consider adding a brief comment or disabling the rule on this line:// Will be populated with props in subsequent PRs /* eslint-disable-next-line @typescript-eslint/no-empty-interface */ export interface PostCreateFormProps {}🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
packages/components/schema.graphql (2)
484-497
: ContentPost type extension: Verifyimages
argument redundancy and naming
TheContentPost
type now implementsReactionsInterface
and addsisReactionsEnabled
,reactionsCount
,reactions
, andmyReaction
fields, which align with the interface. However, theimages
field signature includes apost: ID
argument that may be redundant since it is already scoped to the parent post. Consider removing or renaming this argument (e.g., topostId
) to avoid confusion.
1763-1771
: IntroduceReportType
object type
The newReportType
type defines a hierarchical reporting taxonomy. Ensure that thesubTypes
field resolver efficiently handles large hierarchies and consider adding depth or filter args if performance becomes an issue.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (48)
packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/index.ts
(1 hunks)packages/components/modules/content-feed/common/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeed/index.tsx
(2 hunks)packages/components/modules/content-feed/web/ContentFeed/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeedImage/types.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/constants.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/index.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/types.ts
(0 hunks)packages/components/modules/content-feed/web/PostCreate/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostCreate/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostFooter/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostFooter/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostHeader/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostHeader/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
(4 hunks)packages/components/modules/content-feed/web/PostImageDropzone/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/types.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostList/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostList/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/types.ts
(1 hunks)packages/components/modules/content-feed/web/index.ts
(1 hunks)packages/components/package.json
(1 hunks)packages/components/schema.graphql
(11 hunks)packages/components/tsup.config.ts
(3 hunks)packages/design-system/components/web/icons/PillIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/ReplyIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/SharePostIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/index.ts
(1 hunks)packages/design-system/tsup.config.ts
(2 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (4)
- packages/components/modules/content-feed/web/ContentFeedImage/types.ts
- packages/components/modules/content-feed/web/NewContentPost/types.ts
- packages/components/modules/content-feed/web/NewContentPost/constants.ts
- packages/components/modules/content-feed/web/NewContentPost/index.tsx
✅ Files skipped from review due to trivial changes (2)
- packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
- packages/components/modules/content-feed/web/PostItemImages/index.tsx
🚧 Files skipped from review as they are similar to previous changes (40)
- packages/components/modules/content-feed/web/PostForm/styled.tsx
- pnpm-workspace.yaml
- packages/components/package.json
- packages/components/modules/content-feed/web/PostFooter/types.ts
- packages/components/modules/content-feed/web/ContentFeed/index.tsx
- packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
- packages/components/modules/content-feed/web/PostItem/types.ts
- packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
- packages/design-system/components/web/icons/index.ts
- packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
- packages/components/modules/content-feed/common/index.ts
- packages/components/modules/content-feed/common/types.ts
- packages/components/modules/content-feed/web/PostHeader/types.ts
- packages/components/modules/content-feed/web/PostItemImages/styled.tsx
- packages/components/modules/content-feed/web/PostItemImages/types.ts
- packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
- packages/components/modules/content-feed/web/PostReactionButton/index.tsx
- packages/design-system/components/web/icons/SharePostIcon/index.tsx
- packages/components/modules/content-feed/web/PostImageDropzone/types.ts
- packages/components/modules/content-feed/web/PostForm/index.tsx
- packages/components/modules/content-feed/web/PostReactionButton/types.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
- packages/components/modules/content-feed/web/PostImageSlide/types.tsx
- packages/components/modules/content-feed/web/PostFooter/index.tsx
- packages/components/tsup.config.ts
- packages/components/modules/content-feed/web/PostHeader/index.tsx
- packages/components/modules/content-feed/web/PostImageSlide/index.tsx
- packages/design-system/tsup.config.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
- packages/components/modules/content-feed/web/PostItem/index.tsx
- packages/components/modules/content-feed/web/PostCreate/index.tsx
- packages/components/modules/content-feed/web/PostForm/constants.ts
- packages/design-system/components/web/icons/ReplyIcon/index.tsx
- packages/components/modules/content-feed/web/index.ts
- packages/components/modules/content-feed/web/PostList/styled.tsx
- packages/components/modules/content-feed/web/ContentFeed/types.ts
- packages/components/modules/content-feed/web/PostForm/types.ts
- packages/design-system/components/web/icons/PillIcon/index.tsx
- packages/components/modules/content-feed/web/PostList/index.tsx
🧰 Additional context used
🧠 Learnings (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
🪛 Biome (1.9.4)
packages/components/modules/content-feed/web/PostCreate/types.ts
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build and Lint Packages
- GitHub Check: Component Test Packages
🔇 Additional comments (10)
packages/components/schema.graphql (10)
534-536
: ContentPostImage: Confirm migration ofimage
field toFile
Theimage
field inContentPostImage
now returns aFile
type with mandatorywidth
andheight
args instead of a simpleString
. Ensure resolvers return the correctFile
object, and that downstream components handle this change.
1223-1232
: Profile type: NormalizereportsCount
field type
Profile
now implementsReportsInterface
and exposesreportsCount: GenericScalar
. Other count fields (e.g.,followersCount
,commentsCount
) useInt
. Confirm whetherGenericScalar
is necessary here or ifInt
would better enforce type safety.
1274-1283
: Profile.contentPosts: New paginated post list
ThecontentPosts
field onProfile
returns aContentPostConnection
with pagination and ordering parameters. This aligns with the rootcontentPosts
query. Ensure the resolver supports seamless integration with the carousel UI and respects theorderBy
parameter.
1314-1315
: Profile reporting fields: VerifymyReports
return type
Profile
now includesreports: ReportConnection
andmyReports: Report
. Confirm thatmyReports
is intended to return a singleReport
(the current user's report) rather than a connection, and consider renaming it tomyReport
if singular.
1506-1519
: Query: AddcontentPost
andcontentPosts
endpoints
The rootQuery
type now exposescontentPost(id: ID!): ContentPost
andcontentPosts(...): ContentPostConnection
. Ensure these queries are wired to the correct resolvers and that pagination args match those onProfile.contentPosts
.
1714-1714
: Report type: SwitchreportType
to object relation
TheReport
type now usesreportType: ReportType
instead of an enum. Confirm that migrations and resolvers populate this field correctly, and update client code to consume the object instead of enum values.
1732-1732
: ReportCreateInput: UsereportTypeId
instead of enum
The mutation input now requiresreportTypeId: ID!
rather thanReportTypes
. Ensure the mutation resolvers validate the ID and that client code passes the correct identifier.
1758-1758
: ReportsInterface: AlignreportsCount
with Profile implementation
TheReportsInterface
usesreportsCount: GenericScalar
. Verify that all implementors (e.g.,Profile
,ContentPost
) adopt this change and handle any JSON decoding, or consider switching back toInt
for consistency.
1773-1781
: Define RelayReportTypeConnection
Standard connection pattern forReportType
. Confirm that pagination logic andpageInfo
support work correctly for subtype listings.
1783-1790
: Define RelayReportTypeEdge
TheReportTypeEdge
pairs eachReportType
node with a cursor for pagination. This follows Relay conventions and looks correct.
cf767df
to
e9b37e9
Compare
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: 0
♻️ Duplicate comments (1)
packages/components/schema.graphql (1)
511-515
: 🛠️ Refactor suggestionEnsure backward compatibility for
isReactionsEnabled
The new requiredisReactionsEnabled
field inContentPostCreateInput
could break existing post-creation clients. Align with the established pattern (e.g.,ChatRoomCreateInput
) by making this field optional with a default offalse
.input ContentPostCreateInput { content: String! - isReactionsEnabled: Boolean! + isReactionsEnabled: Boolean = false clientMutationId: String }
🧹 Nitpick comments (3)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
1-1
: Consider adding documentation or properties to the empty interfaceThe
PostCreateFormProps
interface is currently empty, which the static analysis tool flags as equivalent to{}
. While this follows the team's pattern (as seen withContentFeedProps
in other files), it would be helpful to either:
- Add JSDoc comments explaining the future purpose of this interface and that it will be populated later, or
- Add the properties needed for the
PostCreate
component if they're already knownIf keeping it empty is intentional (to be populated in a future PR), you might want to add a TODO comment.
+/** + * Props for the PostCreate form component. + * @todo Add properties in a future PR + */ export interface PostCreateFormProps {}🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
packages/components/schema.graphql (2)
484-491
: Refineimages
field arguments on ContentPost
Theimages
field onContentPost
takes bothid
(image ID) andpost
(post ID) arguments, but because this resolver is nested under a specificContentPost
, thepost
argument is redundant. Consider removingpost
and renamingid
toimageId
for clarity.
1763-1771
: ReviewtargetObjectId
argument type onReportType.subTypes
ThesubTypes
field usestargetObjectId: String
to filter by target object, but GraphQL IDs are typically represented with theID
scalar. Consider updatingtargetObjectId: ID
for consistency and type safety.- subTypes(..., topLevelOnly: Boolean, targetObjectId: String): ReportTypeConnection! + subTypes(..., topLevelOnly: Boolean, targetObjectId: ID): ReportTypeConnection!
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (48)
packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/index.ts
(1 hunks)packages/components/modules/content-feed/common/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeed/index.tsx
(2 hunks)packages/components/modules/content-feed/web/ContentFeed/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeedImage/types.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/constants.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/index.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/styled.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/types.ts
(0 hunks)packages/components/modules/content-feed/web/PostCreate/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostCreate/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostFooter/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostFooter/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostHeader/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostHeader/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
(4 hunks)packages/components/modules/content-feed/web/PostImageDropzone/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/types.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostList/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostList/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/types.ts
(1 hunks)packages/components/modules/content-feed/web/index.ts
(1 hunks)packages/components/package.json
(1 hunks)packages/components/schema.graphql
(11 hunks)packages/components/tsup.config.ts
(3 hunks)packages/design-system/components/web/icons/PillIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/ReplyIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/SharePostIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/index.ts
(1 hunks)packages/design-system/tsup.config.ts
(2 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (5)
- packages/components/modules/content-feed/web/NewContentPost/styled.tsx
- packages/components/modules/content-feed/web/ContentFeedImage/types.ts
- packages/components/modules/content-feed/web/NewContentPost/constants.ts
- packages/components/modules/content-feed/web/NewContentPost/index.tsx
- packages/components/modules/content-feed/web/NewContentPost/types.ts
✅ Files skipped from review due to trivial changes (1)
- packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
🚧 Files skipped from review as they are similar to previous changes (40)
- pnpm-workspace.yaml
- packages/components/modules/content-feed/web/PostItemImages/types.ts
- packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
- packages/components/modules/content-feed/web/PostHeader/types.ts
- packages/design-system/tsup.config.ts
- packages/components/modules/content-feed/web/PostImageSlide/types.tsx
- packages/components/modules/content-feed/web/PostList/styled.tsx
- packages/components/modules/content-feed/web/PostFooter/types.ts
- packages/components/modules/content-feed/web/PostReactionButton/types.ts
- packages/components/package.json
- packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
- packages/components/modules/content-feed/common/index.ts
- packages/components/modules/content-feed/web/PostImageDropzone/types.ts
- packages/components/tsup.config.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
- packages/components/modules/content-feed/common/types.ts
- packages/components/modules/content-feed/web/PostFooter/index.tsx
- packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
- packages/components/modules/content-feed/web/PostForm/index.tsx
- packages/design-system/components/web/icons/index.ts
- packages/components/modules/content-feed/web/PostItem/types.ts
- packages/components/modules/content-feed/web/PostCreate/index.tsx
- packages/components/modules/content-feed/web/PostImageSlide/index.tsx
- packages/components/modules/content-feed/web/PostItem/index.tsx
- packages/components/modules/content-feed/web/PostItemImages/styled.tsx
- packages/components/modules/content-feed/web/PostForm/constants.ts
- packages/components/modules/content-feed/web/ContentFeed/index.tsx
- packages/design-system/components/web/icons/ReplyIcon/index.tsx
- packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
- packages/design-system/components/web/icons/SharePostIcon/index.tsx
- packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
- packages/components/modules/content-feed/web/PostList/index.tsx
- packages/design-system/components/web/icons/PillIcon/index.tsx
- packages/components/modules/content-feed/web/ContentFeed/types.ts
- packages/components/modules/content-feed/web/PostReactionButton/index.tsx
- packages/components/modules/content-feed/web/index.ts
- packages/components/modules/content-feed/web/PostHeader/index.tsx
- packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
- packages/components/modules/content-feed/web/PostForm/types.ts
- packages/components/modules/content-feed/web/PostItemImages/index.tsx
🧰 Additional context used
🧠 Learnings (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
🪛 Biome (1.9.4)
packages/components/modules/content-feed/web/PostCreate/types.ts
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
🔇 Additional comments (12)
packages/components/schema.graphql (12)
495-497
: Consistent implementation of ReactionsInterface
TheContentPost
type now correctly implements all fields fromReactionsInterface
(reactionsCount
,reactions
, andmyReaction
), matching the interface contract.
535-535
: Verify client compatibility for changedimage
field
Theimage
field onContentPostImage
now returns aFile
object instead of a plainString
, requiring clients to select the.url
property and supplywidth
/height
arguments. Ensure all existing queries and front-end components have been updated accordingly to avoid breaking changes.
1232-1232
: UpdatereportsCount
to useGenericScalar
SwitchingreportsCount
fromJSONString!
toGenericScalar
aligns with the newReportsInterface
definition and provides more flexible scalar typing.
1274-1283
: AddcontentPosts
connection toProfile
Introducing thecontentPosts
field onProfile
enables fetching a paginated list of posts per user, which complements the newContentPost
queries. The pagination arguments align with existing patterns.
1314-1315
: Implement reporting fields onProfile
Adding thereports
connection andmyReports
field alignsProfile
withReportsInterface
, enabling both paginated access and the current user's report object.
1506-1509
: IntroducecontentPost
query for fetching a single post
Adding thecontentPost(id: ID!)
root field provides direct access to a specificContentPost
by its ID. The nullable return type is consistent with other singular query patterns.
1510-1519
: AddcontentPosts
root query for paginated posts
ThecontentPosts
field provides a paginated connection ofContentPost
items, supporting both cursor and offset-based pagination, along with optional ordering. This aligns with existing query patterns.
1713-1713
: Verify migration from enum to object forreportType
reportType
was changed from theReportTypes
enum to theReportType
object, which could be a breaking change for existing clients. Ensure that theReportTypes
enum has been removed and all queries/mutations have been updated to use the newReportType
type.
1732-1732
: Ensure clients update to usereportTypeId
TheReportCreateInput
no longer accepts areportType
enum value but requiresreportTypeId: ID!
. Confirm that all client mutation definitions and generated TypeScript types have been updated accordingly.
1758-1758
: UpdateReportsInterface.reportsCount
toGenericScalar
ChangingreportsCount
fromJSONString!
toGenericScalar
aligns the interface with the schema-wideGenericScalar
usage and simplifies serialization.
1773-1781
: AddReportTypeConnection
to support pagination
TheReportTypeConnection
type follows the Relay pagination pattern consistently with other connection types, providingpageInfo
,edges
, and counts.
1783-1790
: AddReportTypeEdge
for Relay pagination
TheReportTypeEdge
properly defines thenode
andcursor
, completing the Relay connection contract forReportType
.
e9b37e9
to
d60eaf3
Compare
|
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: 1
🔭 Outside diff range comments (1)
packages/components/schema.graphql (1)
1708-1717
:⚠️ Potential issueBreaking change:
reportType
switched from enum to object type.Converting
Report.reportType
from anenum
to aReportType
object will break clients expecting a string. To ease migration, consider adding a deprecated helper:type Report implements Node { - reportType: ReportType + reportType: ReportType + reportTypeKey: String! @deprecated(reason: "Use `reportType.key` instead.")
♻️ Duplicate comments (1)
packages/components/schema.graphql (1)
511-515
:⚠️ Potential issueBackward compatibility break:
isReactionsEnabled
is now required.Making
isReactionsEnabled
non-nullable inContentPostCreateInput
will break existing clients omitting this field. To preserve backward compatibility, consider providing a default:-input ContentPostCreateInput { - content: String! - isReactionsEnabled: Boolean! - clientMutationId: String -} +input ContentPostCreateInput { + content: String! + isReactionsEnabled: Boolean = false + clientMutationId: String +}
🧹 Nitpick comments (4)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
1-1
: Consider your approach for empty interfaces.The static analysis tool suggests using a type alias since this interface is currently empty. However, based on retrieved feedback, if you're planning to add properties to this interface in future PRs (similar to
ContentFeedProps
), keeping it as an interface is appropriate.If you intend to populate this interface later:
// This is fine as is for future extension export interface PostCreateFormProps {}If not, consider following the static analysis recommendation:
export type PostCreateFormProps = {};🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
packages/components/schema.graphql (3)
484-497
: Ensure GraphQL resolvers align with updatedContentPost
fields.The
ContentPost
type now explicitly includes theReactionsInterface
fields (isReactionsEnabled
,reactionsCount
,reactions
,myReaction
) and introduces animages
connection with a newpost
argument. Please verify that:
- The resolver for
images
correctly handles filtering bypost
.- All UI components and GraphQL fragments request
images
with proper pagination arguments.- Argument naming is consistent—consider renaming
post
topostId
to match other ID conventions in the schema.
1274-1283
: Implement and document the newcontentPosts
connection onProfile
.You’ve added
contentPosts
returningContentPostConnection
. Please ensure:
- Resolver pagination (
first
,last
,before
,after
,orderBy
) is in place.- Schema or code comments describe valid
orderBy
values.- Client code consuming
profile.contentPosts
is updated to handle the connection.
1763-1790
: Add descriptions and refine pagination onReportType
definitions.The new
ReportType
,ReportTypeConnection
, andReportTypeEdge
types need:
- Field descriptions for
key
,label
, andparentType
.- Documentation for
subTypes
arguments (topLevelOnly
,targetObjectId
).- A resolver for
subTypes
that filters bytargetObjectId
.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (53)
packages/components/CHANGELOG.md
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/index.ts
(1 hunks)packages/components/modules/content-feed/common/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeed/index.tsx
(2 hunks)packages/components/modules/content-feed/web/ContentFeed/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeedImage/types.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/constants.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/index.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/styled.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/types.ts
(0 hunks)packages/components/modules/content-feed/web/PostCreate/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostCreate/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostFooter/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostFooter/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostHeader/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostHeader/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
(4 hunks)packages/components/modules/content-feed/web/PostImageDropzone/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/types.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostList/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostList/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/types.ts
(1 hunks)packages/components/modules/content-feed/web/index.ts
(1 hunks)packages/components/package.json
(2 hunks)packages/components/schema.graphql
(11 hunks)packages/components/tsup.config.ts
(3 hunks)packages/design-system/CHANGELOG.md
(1 hunks)packages/design-system/components/web/icons/PillIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/ReplyIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/SharePostIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/index.ts
(1 hunks)packages/design-system/package.json
(1 hunks)packages/design-system/tsup.config.ts
(2 hunks)packages/wagtail/CHANGELOG.md
(1 hunks)packages/wagtail/package.json
(1 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (5)
- packages/components/modules/content-feed/web/ContentFeedImage/types.ts
- packages/components/modules/content-feed/web/NewContentPost/constants.ts
- packages/components/modules/content-feed/web/NewContentPost/styled.tsx
- packages/components/modules/content-feed/web/NewContentPost/index.tsx
- packages/components/modules/content-feed/web/NewContentPost/types.ts
✅ Files skipped from review due to trivial changes (7)
- packages/wagtail/package.json
- packages/components/CHANGELOG.md
- packages/design-system/package.json
- packages/design-system/CHANGELOG.md
- packages/wagtail/CHANGELOG.md
- packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
- packages/components/modules/content-feed/web/PostItemImages/index.tsx
🚧 Files skipped from review as they are similar to previous changes (39)
- packages/components/modules/content-feed/web/PostHeader/types.ts
- pnpm-workspace.yaml
- packages/components/modules/content-feed/web/PostItemImages/types.ts
- packages/components/modules/content-feed/web/PostImageSlide/types.tsx
- packages/components/modules/content-feed/web/PostItem/types.ts
- packages/components/modules/content-feed/common/index.ts
- packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
- packages/components/modules/content-feed/web/PostImageDropzone/types.ts
- packages/components/modules/content-feed/web/PostFooter/types.ts
- packages/components/modules/content-feed/web/PostReactionButton/types.ts
- packages/components/modules/content-feed/web/PostItemImages/styled.tsx
- packages/components/package.json
- packages/design-system/components/web/icons/PillIcon/index.tsx
- packages/design-system/components/web/icons/ReplyIcon/index.tsx
- packages/components/modules/content-feed/web/PostList/styled.tsx
- packages/design-system/components/web/icons/index.ts
- packages/components/modules/content-feed/web/ContentFeed/index.tsx
- packages/design-system/tsup.config.ts
- packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
- packages/components/modules/content-feed/web/PostCreate/index.tsx
- packages/components/tsup.config.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
- packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
- packages/components/modules/content-feed/web/PostList/index.tsx
- packages/design-system/components/web/icons/SharePostIcon/index.tsx
- packages/components/modules/content-feed/web/PostImageSlide/index.tsx
- packages/components/modules/content-feed/web/ContentFeed/types.ts
- packages/components/modules/content-feed/web/PostForm/index.tsx
- packages/components/modules/content-feed/web/PostReactionButton/index.tsx
- packages/components/modules/content-feed/web/PostForm/types.ts
- packages/components/modules/content-feed/web/PostFooter/index.tsx
- packages/components/modules/content-feed/common/types.ts
- packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
- packages/components/modules/content-feed/web/PostItem/index.tsx
- packages/components/modules/content-feed/web/PostHeader/index.tsx
- packages/components/modules/content-feed/web/index.ts
- packages/components/modules/content-feed/web/PostForm/constants.ts
- packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
🧰 Additional context used
🧠 Learnings (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
🪛 Biome (1.9.4)
packages/components/modules/content-feed/web/PostCreate/types.ts
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Component Test Packages
- GitHub Check: Build and Lint Packages
🔇 Additional comments (4)
packages/components/schema.graphql (4)
1232-1232
: Validate type change forreportsCount
onProfile
.The
reportsCount
field onProfile
was updated toGenericScalar
. Confirm that backend resolvers return a compatible scalar (e.g.,Int
encoded as JSON) and regenerate client-side type definitions accordingly.
1506-1519
: Add resolvers for newcontentPost
andcontentPosts
queries.The root
Query
now includes:contentPost(id: ID!): ContentPost contentPosts(...): ContentPostConnectionVerify that:
- Corresponding resolver implementations exist and enforce authorization.
- Pagination and ordering parameters are respected.
- Automated tests cover both singular and list queries.
1755-1761
: EnsureReportsInterface
changes align with the new model.The interface now uses a
GenericScalar
forreportsCount
and addsmyReports
. Verify that:
- All types implementing
ReportsInterface
supply the updated fields.- Client-side schemas/TypeScript types are regenerated to match.
535-537
:❓ Verification inconclusive
Verify usage of required dimensions in
ContentPostImage.image
.The
image
field now requireswidth
andheight
arguments. Ensure that:
- All GraphQL fragments (e.g.,
ContentPostImageFragment
) specify these arguments.- Client components call
image(width:…, height:…)
.- Server resolvers correctly surface image variants at the requested dimensions.
Use this script to find fragment definitions missing dimensions:
🏁 Script executed:
#!/bin/bash set -e rg -n "ContentPostImageFragment" -A3 --glob "*ContentPostImage*"Length of output: 733
🏁 Script executed:
#!/bin/bash set -e # Show the full ContentPostImageFragment definition (20 lines after the fragment declaration) rg -n "fragment ContentPostImageFragment" -A20 packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.tsLength of output: 420
ContentPostImageFragment already defines required dimensions
The fragment in
packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
includes:
@argumentDefinitions(width: { type: "Int", defaultValue: 600 }, height: { type: "Int", defaultValue: 0 })
image(width: $width, height: $height) { url }
No missing dimensions in that fragment.
Please also verify manually:
- All client‐side GraphQL queries that spread
...ContentPostImageFragment
supply@arguments(width:…, height:…)
.- Any other fragments or inline
image(...)
calls include bothwidth
andheight
.- Server resolvers for
ContentPostImage.image
correctly handle the newwidth
andheight
arguments and return the expected variants.
packages/components/schema.graphql
Outdated
input ReportCreateInput { | ||
targetObjectId: ID! | ||
reportType: ReportTypes = null | ||
reportTypeId: ID! | ||
reportSubject: String | ||
clientMutationId: String | ||
} |
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.
Breaking change: reportTypeId
replaces enum field.
ReportCreateInput
now requires reportTypeId: ID!
instead of an enum. Existing mutation calls must be updated. For a smoother rollout, you could temporarily support both:
input ReportCreateInput {
targetObjectId: ID!
+ reportType: ReportTypeEnum
reportTypeId: ID!
reportSubject: String
clientMutationId: String
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
input ReportCreateInput { | |
targetObjectId: ID! | |
reportType: ReportTypes = null | |
reportTypeId: ID! | |
reportSubject: String | |
clientMutationId: String | |
} | |
input ReportCreateInput { | |
targetObjectId: ID! | |
reportType: ReportTypeEnum | |
reportTypeId: ID! | |
reportSubject: String | |
clientMutationId: String | |
} |
@@ -25,7 +25,7 @@ export default defineConfig((options) => ({ | |||
'@emotion/*', | |||
], | |||
format: ['esm', 'cjs'], | |||
minify: !options.watch, | |||
minify: false, |
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.
and here?
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.
I am not sure why this is needed here. I also thought you said you were fine with not minimizing.
Setting it to true causes the code to be an unreadable version difficult to debug, plus it will still be minified by the consumer app.
https://blog.logrocket.com/tsup/
], | ||
format: ['esm', 'cjs'], | ||
minify: !options.watch, | ||
minify: false, |
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.
are we reverting this @davidbermudez-tsl ?
d60eaf3
to
176e41d
Compare
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (52)
packages/components/CHANGELOG.md
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
(1 hunks)packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
(1 hunks)packages/components/modules/content-feed/common/index.ts
(1 hunks)packages/components/modules/content-feed/common/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeed/index.tsx
(2 hunks)packages/components/modules/content-feed/web/ContentFeed/types.ts
(1 hunks)packages/components/modules/content-feed/web/ContentFeedImage/types.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/constants.ts
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/index.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/styled.tsx
(0 hunks)packages/components/modules/content-feed/web/NewContentPost/types.ts
(0 hunks)packages/components/modules/content-feed/web/PostCreate/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostCreate/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostFooter/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostFooter/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/constants.ts
(1 hunks)packages/components/modules/content-feed/web/PostForm/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostForm/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostHeader/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostHeader/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
(4 hunks)packages/components/modules/content-feed/web/PostImageDropzone/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostImageSlide/types.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItem/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostItemImages/types.ts
(1 hunks)packages/components/modules/content-feed/web/PostList/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostList/styled.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/index.tsx
(1 hunks)packages/components/modules/content-feed/web/PostReactionButton/types.ts
(1 hunks)packages/components/modules/content-feed/web/index.ts
(1 hunks)packages/components/package.json
(1 hunks)packages/components/schema.graphql
(0 hunks)packages/components/tsup.config.ts
(3 hunks)packages/design-system/CHANGELOG.md
(1 hunks)packages/design-system/components/web/icons/PillIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/ReplyIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/SharePostIcon/index.tsx
(1 hunks)packages/design-system/components/web/icons/index.ts
(1 hunks)packages/design-system/tsup.config.ts
(2 hunks)packages/wagtail/CHANGELOG.md
(1 hunks)packages/wagtail/package.json
(1 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (6)
- packages/components/schema.graphql
- packages/components/modules/content-feed/web/ContentFeedImage/types.ts
- packages/components/modules/content-feed/web/NewContentPost/styled.tsx
- packages/components/modules/content-feed/web/NewContentPost/types.ts
- packages/components/modules/content-feed/web/NewContentPost/constants.ts
- packages/components/modules/content-feed/web/NewContentPost/index.tsx
✅ Files skipped from review due to trivial changes (2)
- packages/design-system/components/web/icons/PillIcon/index.tsx
- packages/components/modules/content-feed/common/graphql/queries/ContentPostDetail.ts
🚧 Files skipped from review as they are similar to previous changes (43)
- packages/components/package.json
- packages/components/CHANGELOG.md
- packages/design-system/CHANGELOG.md
- packages/wagtail/package.json
- packages/design-system/tsup.config.ts
- packages/components/modules/content-feed/web/PostImageSlide/types.tsx
- packages/wagtail/CHANGELOG.md
- packages/components/modules/content-feed/web/PostImageSlide/styled.tsx
- packages/design-system/components/web/icons/index.ts
- packages/components/modules/content-feed/web/PostFooter/types.ts
- packages/components/modules/content-feed/web/PostHeader/types.ts
- pnpm-workspace.yaml
- packages/components/modules/content-feed/web/PostList/styled.tsx
- packages/components/modules/content-feed/web/PostItem/types.ts
- packages/components/modules/content-feed/common/index.ts
- packages/components/modules/content-feed/web/PostReactionButton/types.ts
- packages/components/modules/content-feed/web/PostItemImages/styled.tsx
- packages/components/modules/content-feed/web/ContentFeed/index.tsx
- packages/components/modules/content-feed/common/graphql/queries/ContentPosts.ts
- packages/components/modules/content-feed/common/graphql/mutations/ContentPostCreate.ts
- packages/components/modules/content-feed/web/PostImageDropzone/types.ts
- packages/components/tsup.config.ts
- packages/components/modules/content-feed/web/ContentFeed/types.ts
- packages/components/modules/content-feed/web/PostImageDropzone/index.tsx
- packages/components/modules/content-feed/web/PostFooter/index.tsx
- packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts
- packages/design-system/components/web/icons/SharePostIcon/index.tsx
- packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts
- packages/design-system/components/web/icons/ReplyIcon/index.tsx
- packages/components/modules/content-feed/web/PostImageSlide/index.tsx
- packages/components/modules/content-feed/web/PostForm/index.tsx
- packages/components/modules/content-feed/web/PostCreate/index.tsx
- packages/components/modules/content-feed/web/PostItemImages/types.ts
- packages/components/modules/content-feed/web/PostItemImages/index.tsx
- packages/components/modules/content-feed/web/PostItem/index.tsx
- packages/components/modules/content-feed/common/types.ts
- packages/components/modules/content-feed/web/PostList/index.tsx
- packages/components/modules/content-feed/web/PostHeader/index.tsx
- packages/components/modules/content-feed/web/PostReactionButton/index.tsx
- packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts
- packages/components/modules/content-feed/web/PostForm/constants.ts
- packages/components/modules/content-feed/web/PostForm/types.ts
- packages/components/modules/content-feed/web/index.ts
🧰 Additional context used
🧠 Learnings (1)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)
Learnt from: davidbermudez-tsl
PR: silverlogic/baseapp-frontend#209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.
🪛 Biome (1.9.4)
packages/components/modules/content-feed/web/PostCreate/types.ts
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
@@ -0,0 +1 @@ | |||
export interface PostCreateFormProps {} |
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.
Empty interface violates Biome’s noEmptyInterface
rule—CI will fail
Biome reports this as an error, so the build will break.
Either convert to a type alias or intentionally silence the rule with context.
-export interface PostCreateFormProps {}
+/* eslint-disable @typescript-eslint/no-empty-interface -- placeholder, will be populated in follow-up PR */
+export interface PostCreateFormProps {
+ // Intentionally left blank for future extension via declaration merging
+}
If you don’t need declaration-merging semantics, the simpler/cleaner fix is:
-export interface PostCreateFormProps {}
+export type PostCreateFormProps = Record<string, never>;
Pick one to keep the pipeline green.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export interface PostCreateFormProps {} | |
-export interface PostCreateFormProps {} | |
+export type PostCreateFormProps = Record<string, never>; |
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
🤖 Prompt for AI Agents
In packages/components/modules/content-feed/web/PostCreate/types.ts at line 1,
the empty interface PostCreateFormProps violates the noEmptyInterface rule and
causes CI to fail. To fix this, replace the empty interface with a type alias or
add a comment to explicitly disable the rule for this line if you need to keep
the interface. Choose one approach to resolve the error and keep the build
passing.
As a user, on the Baseapp Content Feed,I would like to View the images in a post that has images attached to it, In order to see images and any additional text shared by users..
Acceptance Criteria
Context
In this story we will implement the basic behaviors of a post that has an image in it. From being able to view images to scrolling the carrousel.
Business Rules
Given I am on the content feed page and a user has created a post with images, when I scroll through the content feed, then I should see the post with images displayed.
I should see the text content associated with the post as well.
Given I am viewing a post with multiple images in the content feed when I view the post then the images should be displayed in a carousel format.*
When I view the image carousel in the post, then the images should be displayed with the following behavior.
I should see a "Previous" arrow button on the left side of the carousel
I should see a "Next" arrow button on the right side of the carousel
Clicking the "Next" arrow should display the next image in the order
Clicking the "Previous" arrow should display the previous image in the order
The carousel should loop back to the first image after the last one is displayed
I should be able to navigate through all images in the post using these arrow buttons.
The image should be able to open in another tab, by right clicking and selecting "open in another tab".
Design Link: https://www.figma.com/design/XRD6wSl1m8Kz6XUcAy5CLp/BaseApp---WEB?node-id=2429-44307&node-type=frame&t=5TN6cVoKe9HL2Mvf-0
Approvd
https://app.approvd.io/projects/BA/stories/35375
Summary by CodeRabbit
New Features
Improvements
Removals
Chores