Skip to content

Kingrayhan/fix#96

Merged
kingRayhan merged 8 commits intomainfrom
kingrayhan/fix
Apr 1, 2026
Merged

Kingrayhan/fix#96
kingRayhan merged 8 commits intomainfrom
kingrayhan/fix

Conversation

@kingRayhan
Copy link
Copy Markdown
Member

@kingRayhan kingRayhan commented Apr 1, 2026

Summary by CodeRabbit

  • New Features

    • Profile photos now appear in notification and comment author avatars (structured and legacy URLs handled; placeholder fallback).
    • Optimistic comment creation includes author profile photos.
  • Documentation

    • Contributor note for Next.js docs.
    • Updated architecture: dual file-storage (R2 + Cloudinary), i18n usage, cron-worker schedule/cleanup, and storage presign flow.
  • Bug Fixes

    • Comment API now returns author profile_photo in JSON.

…ge strategy

- Added guidelines for Next.js development, emphasizing the importance of consulting the official documentation before coding.
- Expanded the CLAUDE.md file to include a detailed file storage strategy, outlining the coexistence of Cloudflare R2 and Cloudinary for file uploads.
- Updated the SKILL.md files for WorkOS to improve clarity and consistency in installation instructions.
- Removed obsolete SKILL.md files for new-action, new-component, new-form, new-input, new-page, new-query, new-repository, release-note, and seo-audit, streamlining the skills directory.
- Updated Notification model to include actor's profile photo and URL.
- Modified notification rendering to display actor images alongside names.
- Improved notification structure for better user experience and clarity.

This update enriches the notification system by providing visual context for actors, enhancing user engagement.
- Streamlined the actor property in the Notification interface by removing the optional profile_photo_url field.
- Enhanced clarity and consistency in the Notification model structure.

This change improves the maintainability of the code while preserving the necessary information for notifications.
- Modified the notification rendering logic to use the actor's profile photo directly instead of the previously used profile_photo_url.
- Added a conditional check to ensure the profile photo is only displayed if available, improving the robustness of the notification display.

This change enhances the visual representation of notifications by ensuring accurate profile images are shown.
- Enhanced code readability by adding missing commas and adjusting formatting in the CommentSection and CommentItem components.
- Introduced a debug output for query data in the CommentSection for easier troubleshooting.
- Ensured consistent use of line breaks and indentation for better maintainability.

These changes contribute to a cleaner codebase and facilitate future development efforts.
- Consolidated the function definition for public.get_comments by removing unnecessary line breaks and improving formatting.
- Enhanced readability and maintainability of the SQL function.

This change contributes to a cleaner and more efficient codebase.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1575fe37-1b90-4dd1-8e5c-258c2bcb8c21

📥 Commits

Reviewing files that changed from the base of the PR and between a3d0512 and 9f821b6.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • package.json

📝 Walkthrough

Walkthrough

This changeset surfaces structured profile photos across notifications and comments: DB query and SQL function now include profile_photo, types and session results carry IServerFile references, backend notification/session JSON includes the field, and UI components use getFileUrl() to render actual avatars with fallbacks.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md, CLAUDE.md, CHANGELOG.md
Added Next.js agent guidance, expanded file-storage/R2/Cloudinary and i18n docs, added cron-worker/cleanup details, and appended v1.7.0 changelog entries.
Database function
migrations/sql-functions/get_comments.sql
Recreated/format-adjusted public.get_comments to include profile_photo in user objects returned for comments and replies.
Domain types
src/backend/models/domain-models.ts
Extended CommentPresentation.author and Notification.actor to optionally include `profile_photo: IServerFile
Session & action types
src/backend/services/action-type.ts, src/backend/services/session.actions.ts
Added `profile_photo: IServerFile
Notifications service
src/backend/services/notifications.actions.ts
listMyNotifications now includes profile_photo in the actor JSON payload emitted by the query.
UI — Notifications page
src/app/dashboard/notifications/page.tsx
Refactored notification item layout; NotificationActorAvatar signature updated to accept profilePhoto / profilePhotoUrl; avatar now resolves via getFileUrl() when structured file present.
UI — Comments component
src/components/comment-section.tsx
Comment avatar rendering updated to accept author with profile_photo, optimistic comment/reply creation now includes author.profile_photo, and avatar sources use getFileUrl() with fallback placeholders.
Package
package.json
Bumped package version from 1.6.0 to 1.7.0.

Sequence Diagram

sequenceDiagram
    actor User as User
    participant UI as UI Component
    participant Backend as Backend Service
    participant DB as Database
    participant CDN as CDN/Storage

    User->>UI: Open notifications or comments
    UI->>Backend: Request notifications/session
    Backend->>DB: Query notifications/session including profile_photo
    DB-->>Backend: Return rows with profile_photo references
    Backend-->>UI: Send JSON with profile_photo (IServerFile) present
    UI->>UI: Call getFileUrl(profile_photo)
    UI->>CDN: Fetch image using resolved URL (R2 or Cloudinary)
    CDN-->>UI: Image bytes (or transformed URL response)
    UI-->>User: Render avatar image (or fallback placeholder)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Kingrayhan/fix #90: Modifies the same comment-section component and optimistic update/avatar handling, likely overlapping with these profile-photo changes.

Poem

🐰 I nibble bytes and hop through trees of code,
I fetch a photo down the data road,
From rows to URLs, I stitch the view,
Avatars bloom — a brighter queue! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Kingrayhan/fix' is vague and does not convey any meaningful information about the changeset's purpose or main changes. Replace with a descriptive title that summarizes the main change, such as 'Add profile_photo field to user-related models and components' or 'Support profile photos in notifications and comments'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kingrayhan/fix

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

- Updated the version number in package.json to reflect the new release.
- This change prepares the project for the next set of features and improvements.
@kingRayhan kingRayhan merged commit 7b32e82 into main Apr 1, 2026
@kingRayhan kingRayhan deleted the kingrayhan/fix branch April 4, 2026 16:54
@kingRayhan kingRayhan restored the kingrayhan/fix branch April 4, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant