Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidbermudez-tsl
Copy link
Collaborator

@davidbermudez-tsl davidbermudez-tsl commented Apr 18, 2025

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

    • Introduced a Content Feed Posts list with support for images and reactions.
    • Added components for creating, displaying, and interacting with posts, including image carousels and reaction buttons.
    • Enhanced post forms with image upload, validation, and reaction toggling.
    • Added new icons for post interactions (reply, share, pill).
  • Improvements

    • Updated content feed to support paginated post loading and detailed post views.
    • Improved type safety and structure for post-related data and forms.
  • Removals

    • Removed deprecated components and types related to the previous post creation UI.
  • Chores

    • Updated dependencies and build configurations to support new features.

Copy link

changeset-bot bot commented Apr 18, 2025

⚠️ No Changeset found

Latest commit: 176e41d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

coderabbitai bot commented Apr 18, 2025

Walkthrough

This 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

Files/Group Change Summary
.../graphql/fragments/ContentPost.ts, ContentPostImage.ts, ContentPosts.ts Added new GraphQL fragments for posts, post images, and paginated posts; exported hooks and fragment queries.
.../graphql/mutations/ContentPostCreate.ts Updated mutation to use new post fragment.
.../graphql/queries/ContentPostDetail.ts, ContentPosts.ts Added new GraphQL queries for post detail and paginated post lists.
.../common/index.ts, .../common/types.ts Re-exported new fragments/queries/types; added type aliases for posts, edges, and nodes.
.../web/ContentFeed/index.tsx, types.ts Updated ContentFeed to accept preloadedQuery; expanded props and types for post data.
.../web/PostCreate/index.tsx, types.ts Added new PostCreate component and empty props interface.
.../web/PostFooter/index.tsx, types.ts Added PostFooter component and props interface.
.../web/PostForm/constants.ts, index.tsx, types.ts Added PostForm component, constants, validation schemas, and types.
.../web/PostHeader/index.tsx, types.ts Added PostHeader component and props interface.
.../web/PostImageDropzone/index.tsx, types.ts Renamed and refactored image dropzone component and its props interface.
.../web/PostImageSlide/index.tsx, styled.tsx, types.tsx Added PostImageSlide component, styled image, and props interface.
.../web/PostItem/index.tsx, types.ts Added PostItem component and props interface.
.../web/PostItemImages/index.tsx, styled.tsx, types.ts Added PostItemImages carousel component, styled container, and props interface.
.../web/PostList/index.tsx, styled.tsx Added virtualized PostList component and styled container.
.../web/PostReactionButton/index.tsx, types.ts Added PostReactionButton component and props interface.
.../web/index.ts Removed old exports; added new post-related component exports.
.../web/ContentFeedImage/types.ts, NewContentPost/* (all), .../web/NewContentPost/styled.tsx Deleted obsolete post creation/image files, types, and styled components.
.../package.json, pnpm-workspace.yaml, tsup.config.ts Added react-multi-carousel dependency; updated build config for externals and minify option.
.../CHANGELOG.md (components, design-system, wagtail), wagtail/package.json Updated changelogs and bumped wagtail package version.
.../schema.graphql Removed obsolete contentPosts query field from GraphQL schema.
.../web/icons/PillIcon, ReplyIcon, SharePostIcon/index.tsx, icons/index.ts Added new icon components and exported them.
.../tsup.config.ts (design-system) Made build config static, removed minify-on-watch logic.

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
Loading
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
Loading

Possibly related PRs

  • silverlogic/baseapp-frontend#209: Refactors and extends GraphQL fragments and mutations for ContentPost, directly related to fragment/query/mutation changes in this PR.

Suggested labels

approved

Suggested reviewers

  • deboracosilveira
  • priscilladeroode
  • anicioalexandre

Poem

In a meadow of code where the content feeds grow,
Posts now bloom with images in a carousel row.
Reactions abound, with a hop and a cheer,
New icons and queries bring freshness this year.
With every commit, the feed comes alive—
A rabbit’s delight as new features arrive!
🥕✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/components/modules/content-feed/common/graphql/fragments/ContentPost.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1405:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Module._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
packages/components/modules/content-feed/common/graphql/fragments/ContentPostImage.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1405:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Module._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
packages/components/modules/content-feed/common/graphql/fragments/ContentPosts.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1405:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Module._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
  • 37 others
✨ Finishing Touches
  • 📝 Generate Docstrings

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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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:

  1. Disabling minification (minify: false) will result in larger bundle sizes that might impact loading times in production.
  2. 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 -10

Length 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 explicit splitting 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
    • No splitting option set (defaults to false)

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 enable splitting: true for production.

packages/design-system/components/web/icons/PillIcon/index.tsx (1)

6-9: Consider accessibility improvements for the icon.

For better accessibility:

  1. Add a descriptive titleAccess prop value to provide screen reader information
  2. 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–coding width: '600px' may limit usability on smaller viewports. You could use a percent‐based width with a maxWidth 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.ts
packages/design-system/components/web/icons/index.ts (1)

35-37: Maintain export ordering consistency

The new icons PillIcon, ReplyIcon, and SharePostIcon 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 before PinIcon
  • ReplyIcon after CommentReplyIcon
  • SharePostIcon after ShareIcon

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 handling

The carousel container centers content horizontally but lacks vertical centering and overflow clipping. Consider adding alignItems: 'center' and overflow: '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 definitions

These 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 failures

The 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 size

The 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 performance

In 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 failures

The 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 interface

While 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 in PostCreate/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 styling

The 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 operations

Currently, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 25921df and 66e996f.

⛔ 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 cat

Length 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 and image, which are the only fields available for image retrieval. There are currently no width/height, alt text or caption/description fields on ContentPostImage. 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, or caption 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 cat

Length 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 generated ReactionButton_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 the PostForm styled file, HeaderContainer included a marginBottom. Here it’s missing. Please confirm if additional bottom margin is needed for consistency.


18-24: Double‑check justifyContent on ButtonContainer
Using justifyContent: 'space-between' with width: 'fit-content' might not space controls as expected. Verify against design or consider justifyContent: 'center' plus the existing gap.


26-31: Good use of themed divider for list items
Leveraging theme.palette.divider for the border ensures visual consistency across the app.


33-35: Approve padding for post header
Using theme.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 version 2.8.6 is published and correct:

Expected output: 2.8.6


🏁 Script executed:

#!/bin/bash
npm view [email protected] version

Length of output: 51


Confirmed: [email protected] is published
npm view [email protected] version returned 2.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 generated ContentPostImageFragment$key and the import path is accurate.

packages/components/modules/content-feed/web/PostItemImages/types.ts (1)

1-5: Approve PostItemImagesProps definition.

The post prop is correctly typed as ContentPost_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 imports graphql from react-relay and spreads the ContentPost_post fragment. Ensure this query is re-exported in the module’s public API (e.g., in common/index.ts) so that downstream components can access it.

packages/components/modules/content-feed/web/PostItem/types.ts (1)

1-5: Approve PostItemProps interface.

The postRef prop is properly typed as ContentPost_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: Approve ContentPostsQuery definition.

The paginated query parameters (count, cursor, orderBy) and the fragment argument spread are correctly specified. Confirm that ContentPostsQuery 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-feed

Re-exporting ContentPosts fragments and queries along with ContentPostDetail 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-safe

The PostImageDropzoneProps interface correctly types the form prop as a UseFormReturn<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 definitions

These 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 selection

This 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 planned

The 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 external

Correctly 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 and splitting: 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 and packages/design-system/tsup.config.ts have minify: false and splitting: false. These settings affect bundle size and loading performance in production.

• packages/components/tsup.config.ts
• packages/design-system/tsup.config.ts

Please 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:


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 hierarchy

The 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 types

The 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 of display. 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 calling form.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 pagination

The ContentPostsFragmentQuery is well designed, following Relay best practices with proper pagination support, sensible defaults, and modular fragment composition.


33-37: LGTM - Clean hook implementation

The 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 interfaces

The 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 new PostImageDropzone component and its types are correctly re‑exported for downstream consumers.


9-10: Exports for PostCreate look good
The PostCreate component and its type definitions are properly surfaced in the module’s public API.


12-13: Exports for PostItem look good
Adding PostItem 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 for PostList?
All other components have matching export type * from lines. If PostList/types exists, please add a export 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 nested images field design on ContentPost
You’ve added images(offset, before, after, first, last, id, post). In a nested context, the parent post’s ID is already in scope—requiring a post 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 querying ContentPost.images.


484-487: Approve reaction interface implementation
The addition of created, modified, and isReactionsEnabled fields aligns with the ReactionsInterface extension.


511-515: Approve new ContentPostCreateInput
Introducing isReactionsEnabled: Boolean! in the create input ensures clients explicitly opt in to reactions.


525-529: Approve ContentPostDeleteInput
The delete mutation input is well‑formed.


530-536: Approve ContentPostDeletePayload
The delete payload correctly returns deletedId and mutation metadata.


575-580: Approve ContentPostUpdateInput
Including isReactionsEnabled in the update input mirrors the create API, which is consistent.


582-588: Approve ContentPostUpdatePayload
The update payload properly returns the updated contentPost node.


849-852: Approve mutation additions
contentPostUpdate and contentPostDelete mutations are correctly wired into the Mutation type.


1534-1537: Approve contentPost query
Single‑post fetch by ID is in place and matches the new type.


1539-1547: Approve contentPosts root query
Batch post querying with pagination and orderBy is consistent with the schema conventions.


1548-1553: Approve image queries
The contentPostImage and contentPostImages queries allow clients to fetch images independently and with filters.


1304-1313: Approve Profile.contentPosts field
Exposing a paginated contentPosts connection on Profile is consistent with other collections on the type.

@davidbermudez-tsl davidbermudez-tsl force-pushed the BA-2452-ba-content-feed-viewing-image-posts branch 2 times, most recently from 7b35c12 to bd24ee6 Compare April 18, 2025 22:33
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/components/modules/content-feed/web/PostForm/styled.tsx (1)

4-4: Fix the typo in the CSS property

There's a typo in the display property: dispaly should be corrected to display.

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
The ContentPost type now implements ReactionsInterface and exposes reactionsCount, reactions, and myReaction. 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
The images field now accepts both id and post args, yet it’s already scoped to a specific ContentPost. Consider removing the redundant id argument or renaming post to postId for clarity.


1274-1283: Expose contentPosts on Profile
A new contentPosts connection with pagination and orderBy 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-level contentPost queries
You introduced contentPost(id: ID!): ContentPost and contentPosts(...) 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 hierarchical ReportType
A new ReportType object with parentType and subTypes replaces the flat enum. Ensure:

  • Recursive resolution is performant (add caching or depth limits).
  • The targetObjectId filter on subTypes is documented and type-correct (should it be ID instead of String?).
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b35c12 and bd24ee6.

⛔ 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: Add isReactionsEnabled to ContentPostCreateInput
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: Update Profile to implement ReportsInterface
Profile now implements ReportsInterface and exposes reportsCount: GenericScalar (replacing the old JSONString!). 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: Add reports and myReports to Profile
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: Migrate reportType to object type
Swapping reportType from an enum to ReportType allows richer metadata, but breaks existing fragments. Update all client fragments and document this change.


1732-1732: Use reportTypeId in ReportCreateInput
Replacing the enum field with reportTypeId: ID! requires updating client-side mutation calls and payload validation.


1758-1758: Add reportsCount to ReportsInterface
The interface now exposes a generic scalar count. Confirm all implementing types return this field and consider standardizing on Int if you don’t need non-integer counts.

@davidbermudez-tsl davidbermudez-tsl force-pushed the BA-2452-ba-content-feed-viewing-image-posts branch from bd24ee6 to 840291c Compare April 22, 2025 13:28
@davidbermudez-tsl davidbermudez-tsl force-pushed the BA-2452-ba-content-feed-viewing-image-posts branch from 840291c to cf767df Compare April 23, 2025 20:17
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
packages/components/modules/content-feed/web/PostCreate/types.ts (1)

1-1: Intentionally empty interface for future extension
The empty PostCreateFormProps is reserved for props that the PostCreate component will accept in upcoming PRs (similar to ContentFeedProps). 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: Verify images argument redundancy and naming
The ContentPost type now implements ReactionsInterface and adds isReactionsEnabled, reactionsCount, reactions, and myReaction fields, which align with the interface. However, the images field signature includes a post: ID argument that may be redundant since it is already scoped to the parent post. Consider removing or renaming this argument (e.g., to postId) to avoid confusion.


1763-1771: Introduce ReportType object type
The new ReportType type defines a hierarchical reporting taxonomy. Ensure that the subTypes 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

📥 Commits

Reviewing files that changed from the base of the PR and between 840291c and cf767df.

⛔ 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 of image field to File
The image field in ContentPostImage now returns a File type with mandatory width and height args instead of a simple String. Ensure resolvers return the correct File object, and that downstream components handle this change.


1223-1232: Profile type: Normalize reportsCount field type
Profile now implements ReportsInterface and exposes reportsCount: GenericScalar. Other count fields (e.g., followersCount, commentsCount) use Int. Confirm whether GenericScalar is necessary here or if Int would better enforce type safety.


1274-1283: Profile.contentPosts: New paginated post list
The contentPosts field on Profile returns a ContentPostConnection with pagination and ordering parameters. This aligns with the root contentPosts query. Ensure the resolver supports seamless integration with the carousel UI and respects the orderBy parameter.


1314-1315: Profile reporting fields: Verify myReports return type
Profile now includes reports: ReportConnection and myReports: Report. Confirm that myReports is intended to return a single Report (the current user's report) rather than a connection, and consider renaming it to myReport if singular.


1506-1519: Query: Add contentPost and contentPosts endpoints
The root Query type now exposes contentPost(id: ID!): ContentPost and contentPosts(...): ContentPostConnection. Ensure these queries are wired to the correct resolvers and that pagination args match those on Profile.contentPosts.


1714-1714: Report type: Switch reportType to object relation
The Report type now uses reportType: 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: Use reportTypeId instead of enum
The mutation input now requires reportTypeId: ID! rather than ReportTypes. Ensure the mutation resolvers validate the ID and that client code passes the correct identifier.


1758-1758: ReportsInterface: Align reportsCount with Profile implementation
The ReportsInterface uses reportsCount: GenericScalar. Verify that all implementors (e.g., Profile, ContentPost) adopt this change and handle any JSON decoding, or consider switching back to Int for consistency.


1773-1781: Define Relay ReportTypeConnection
Standard connection pattern for ReportType. Confirm that pagination logic and pageInfo support work correctly for subtype listings.


1783-1790: Define Relay ReportTypeEdge
The ReportTypeEdge pairs each ReportType node with a cursor for pagination. This follows Relay conventions and looks correct.

@davidbermudez-tsl davidbermudez-tsl force-pushed the BA-2452-ba-content-feed-viewing-image-posts branch from cf767df to e9b37e9 Compare April 23, 2025 22:12
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/components/schema.graphql (1)

511-515: 🛠️ Refactor suggestion

Ensure backward compatibility for isReactionsEnabled
The new required isReactionsEnabled field in ContentPostCreateInput could break existing post-creation clients. Align with the established pattern (e.g., ChatRoomCreateInput) by making this field optional with a default of false.

 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 interface

The PostCreateFormProps interface is currently empty, which the static analysis tool flags as equivalent to {}. While this follows the team's pattern (as seen with ContentFeedProps in other files), it would be helpful to either:

  1. Add JSDoc comments explaining the future purpose of this interface and that it will be populated later, or
  2. Add the properties needed for the PostCreate component if they're already known

If 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: Refine images field arguments on ContentPost
The images field on ContentPost takes both id (image ID) and post (post ID) arguments, but because this resolver is nested under a specific ContentPost, the post argument is redundant. Consider removing post and renaming id to imageId for clarity.


1763-1771: Review targetObjectId argument type on ReportType.subTypes
The subTypes field uses targetObjectId: String to filter by target object, but GraphQL IDs are typically represented with the ID scalar. Consider updating targetObjectId: 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

📥 Commits

Reviewing files that changed from the base of the PR and between cf767df and e9b37e9.

⛔ 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
The ContentPost type now correctly implements all fields from ReactionsInterface (reactionsCount, reactions, and myReaction), matching the interface contract.


535-535: Verify client compatibility for changed image field
The image field on ContentPostImage now returns a File object instead of a plain String, requiring clients to select the .url property and supply width/height arguments. Ensure all existing queries and front-end components have been updated accordingly to avoid breaking changes.


1232-1232: Update reportsCount to use GenericScalar
Switching reportsCount from JSONString! to GenericScalar aligns with the new ReportsInterface definition and provides more flexible scalar typing.


1274-1283: Add contentPosts connection to Profile
Introducing the contentPosts field on Profile enables fetching a paginated list of posts per user, which complements the new ContentPost queries. The pagination arguments align with existing patterns.


1314-1315: Implement reporting fields on Profile
Adding the reports connection and myReports field aligns Profile with ReportsInterface, enabling both paginated access and the current user's report object.


1506-1509: Introduce contentPost query for fetching a single post
Adding the contentPost(id: ID!) root field provides direct access to a specific ContentPost by its ID. The nullable return type is consistent with other singular query patterns.


1510-1519: Add contentPosts root query for paginated posts
The contentPosts field provides a paginated connection of ContentPost 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 for reportType
reportType was changed from the ReportTypes enum to the ReportType object, which could be a breaking change for existing clients. Ensure that the ReportTypes enum has been removed and all queries/mutations have been updated to use the new ReportType type.


1732-1732: Ensure clients update to use reportTypeId
The ReportCreateInput no longer accepts a reportType enum value but requires reportTypeId: ID!. Confirm that all client mutation definitions and generated TypeScript types have been updated accordingly.


1758-1758: Update ReportsInterface.reportsCount to GenericScalar
Changing reportsCount from JSONString! to GenericScalar aligns the interface with the schema-wide GenericScalar usage and simplifies serialization.


1773-1781: Add ReportTypeConnection to support pagination
The ReportTypeConnection type follows the Relay pagination pattern consistently with other connection types, providing pageInfo, edges, and counts.


1783-1790: Add ReportTypeEdge for Relay pagination
The ReportTypeEdge properly defines the node and cursor, completing the Relay connection contract for ReportType.

@davidbermudez-tsl davidbermudez-tsl force-pushed the BA-2452-ba-content-feed-viewing-image-posts branch from e9b37e9 to d60eaf3 Compare April 24, 2025 21:06
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
packages/components/schema.graphql (1)

1708-1717: ⚠️ Potential issue

Breaking change: reportType switched from enum to object type.

Converting Report.reportType from an enum to a ReportType 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 issue

Backward compatibility break: isReactionsEnabled is now required.

Making isReactionsEnabled non-nullable in ContentPostCreateInput 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 updated ContentPost fields.

The ContentPost type now explicitly includes the ReactionsInterface fields (isReactionsEnabled, reactionsCount, reactions, myReaction) and introduces an images connection with a new post argument. Please verify that:

  • The resolver for images correctly handles filtering by post.
  • All UI components and GraphQL fragments request images with proper pagination arguments.
  • Argument naming is consistent—consider renaming post to postId to match other ID conventions in the schema.

1274-1283: Implement and document the new contentPosts connection on Profile.

You’ve added contentPosts returning ContentPostConnection. 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 on ReportType definitions.

The new ReportType, ReportTypeConnection, and ReportTypeEdge types need:

  • Field descriptions for key, label, and parentType.
  • Documentation for subTypes arguments (topLevelOnly, targetObjectId).
  • A resolver for subTypes that filters by targetObjectId.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9b37e9 and d60eaf3.

⛔ 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 for reportsCount on Profile.

The reportsCount field on Profile was updated to GenericScalar. 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 new contentPost and contentPosts queries.

The root Query now includes:

contentPost(id: ID!): ContentPost
contentPosts(...): ContentPostConnection

Verify that:

  • Corresponding resolver implementations exist and enforce authorization.
  • Pagination and ordering parameters are respected.
  • Automated tests cover both singular and list queries.

1755-1761: Ensure ReportsInterface changes align with the new model.

The interface now uses a GenericScalar for reportsCount and adds myReports. 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 requires width and height 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.ts

Length 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 both width and height.
  • Server resolvers for ContentPostImage.image correctly handle the new width and height arguments and return the expected variants.

Comment on lines 1730 to 1745
input ReportCreateInput {
targetObjectId: ID!
reportType: ReportTypes = null
reportTypeId: ID!
reportSubject: String
clientMutationId: String
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

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.

Suggested change
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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

and here?

Copy link
Collaborator Author

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.
Screenshot 2025-04-29 at 7 14 27 PM
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.
Screenshot 2025-04-29 at 7 19 31 PM
https://blog.logrocket.com/tsup/

],
format: ['esm', 'cjs'],
minify: !options.watch,
minify: false,
Copy link
Collaborator

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 ?

@davidbermudez-tsl davidbermudez-tsl force-pushed the BA-2452-ba-content-feed-viewing-image-posts branch from d60eaf3 to 176e41d Compare June 11, 2025 14:02
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d60eaf3 and 176e41d.

⛔ 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 {}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants