Skip to content

Kingrayhan/fix#90

Merged
kingRayhan merged 7 commits intomainfrom
kingrayhan/fix
Mar 29, 2026
Merged

Kingrayhan/fix#90
kingRayhan merged 7 commits intomainfrom
kingrayhan/fix

Conversation

@kingRayhan
Copy link
Copy Markdown
Member

@kingRayhan kingRayhan commented Mar 29, 2026

Summary by CodeRabbit

  • New Features

    • New Tags page with browsable tags and article counts
    • Comment authors can now edit and delete their own comments
    • Comments and reactions now supported on GIST resources
    • Added "All tags" navigation link in sidebar
  • Enhancements

    • Improved comment section with loading states and refined layout
    • Enhanced excerpt handling for articles
    • Refined component layouts and styling across the interface
  • Version

    • Updated to v1.4.0

…nCard components

- Updated the layout of the ArticleCard to use 'shrink-0' for the avatar container.
- Modified UserInformationCard to improve alignment and responsiveness by changing 'items-center' to 'items-start' and adjusting flex properties for better layout control.
- Enhanced the avatar and name sections for consistent styling and improved visual hierarchy.
…ndling

- Added a new utility function `resolveArticleExcerpt` to prioritize stored excerpts over derived ones from article bodies.
- Updated article processing in `userArticleFeed` and `articlesByTag` to utilize the new excerpt resolution logic, enhancing content presentation.
- Implemented updateMyComment function to allow users to edit their comments, including validation for ownership and authorization.
- Added deleteMyComment function to enable users to delete their comments along with nested replies, ensuring proper authorization checks.
- Updated CommentActionInput schema to increase the maximum body length for comments.
- Enhanced the CommentSection component to support editing and deleting comments with appropriate user feedback.
- Introduced a skeleton loader for comments while data is being fetched, enhancing user experience during loading.
- Updated the layout of the CommentSection to improve accessibility and visual hierarchy, including a more responsive design.
- Added error handling for comment loading failures, providing user feedback when comments cannot be retrieved.
- Enhanced the CommentEditor with a new compact variant and improved button styling for better usability.
- Enhanced the CommentItem component by refining the collapse/expand functionality with smoother transitions and improved accessibility.
- Updated button styling for better visual feedback during interactions.
- Streamlined the rendering logic for editing comments, ensuring a more responsive and user-friendly experience.
…d reactions

- Updated interfaces and input schemas to include "GIST" as a valid resource type for comments and reactions.
- Enhanced the createMyComment action to validate the existence of GIST resources.
- Modified components to accommodate the new resource type, ensuring consistent handling in the UI.
- Improved type safety and user experience by integrating GIST support in relevant sections of the application.
- Updated CHANGELOG.md to document new features, bug fixes, and other changes for version 1.4.0.
- Bumped version number in package.json to 1.4.0.
- Extended resource type support to include GIST across comments and reactions.
- Enhanced CommentSection with loading states and improved layout.
- Implemented resolveArticleExcerpt utility for better excerpt handling.
- Improved comment functionality with update and delete actions.
- Refactored comment item layout and transition effects, and adjusted layout in ArticleCard and UserInformationCard components.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This release (v1.4.0) extends the platform with GIST resource support for comments and reactions, introduces a new tags index page with article counts, adds comment update and delete actions with improved UI, implements excerpt resolution utilities, and refines layouts and navigation across multiple components.

Changes

Cohort / File(s) Summary
Version & Release Notes
CHANGELOG.md, package.json
Bumped version to v1.4.0 and documented new features including GIST support, comment enhancements, and improved layouts.
Tags Index Page & Backend
src/app/tags/page.tsx, src/backend/services/tag.action.ts
Added new /tags page displaying tags with article counts; implemented getTagsWithArticleCounts() action with SQL joins and cache invalidation.
GIST Resource Type Support
src/backend/models/domain-models.ts, src/backend/services/inputs/comment.input.ts, src/backend/services/inputs/reaction.input.ts, src/components/ResourceReaction.tsx, src/components/render-props/ResourceReactionable.tsx
Extended domain model and input validation schemas to accept "GIST" as a valid resource type for comments and reactions; updated component type definitions accordingly.
Comment Actions
src/backend/services/comment.action.ts
Replaced deleteComment with updateMyComment and deleteMyComment actions featuring ownership validation, recursive deletion with CTEs, and optimized typing; extended GIST resource validation.
Article & Excerpt Utilities
src/backend/services/article.actions.ts, src/lib/utils.ts
Introduced resolveArticleExcerpt() utility for centralized excerpt fallback logic; added cache invalidation on article delete/publish operations.
Comment Section Refactor
src/components/comment-section.tsx
Major enhancement with loading skeletons, error/empty states, update/delete mutations, ownership-based edit actions, improved avatar rendering, and compact editor variant; refined list layout with grid-based animations.
GistViewer Integration
src/components/Gist/GistViewer.tsx
Added ResourceReaction and CommentSection areas to gist viewer for interactive reactions and comments tied to GIST resource type.
Navigation & Layout Improvements
src/app/(home)/_components/HomeLeftSidebar.tsx, src/app/[username]/[articleHandle]/page.tsx, src/components/ArticleCard.tsx, src/components/UserInformationCard.tsx
Added "All tags" navigation link with type safety; refined optional chaining and formatting in article page; adjusted flex layouts in cards to prevent squashing and improve alignment.

Sequence Diagrams

sequenceDiagram
    participant User
    participant CommentUI as Comment<br/>Section
    participant API as updateMyComment/<br/>deleteMyComment
    participant DB as Database

    User->>CommentUI: Click Edit/Delete
    CommentUI->>CommentUI: Validate ownership &<br/>parse input
    CommentUI->>API: Send mutation request
    API->>API: Authorize session &<br/>verify ownership
    API->>DB: Update/Delete comment &<br/>relations
    DB->>API: Return success
    API->>CommentUI: Return result
    CommentUI->>CommentUI: Invalidate queries &<br/>show toast
    CommentUI->>User: Update UI state
Loading
sequenceDiagram
    participant User
    participant Page as Tags Index<br/>Page
    participant API as getTagsWithArticleCounts
    participant DB as Database

    User->>Page: Navigate to /tags
    Page->>API: Fetch tags with counts
    API->>DB: Execute JOIN query on<br/>tags, articles, article_tag
    DB->>API: Return aggregated results
    API->>Page: Return TagWithArticleCount[]
    Page->>Page: Render grid of<br/>tag links
    Page->>User: Display tags page
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 With GIST now in sight, comments dance in the light,
Tags gather in rows, each with article flows,
Delete and update bloom, no more in the gloom,
Layouts refined, and layouts aligned—
Version four's flight, hoppity-right! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% 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 PR title 'Kingrayhan/fix' is vague and non-descriptive. It uses generic terms that don't convey meaningful information about the changeset, making it difficult to understand the primary changes from the git history. Replace the title with a clear, specific summary of the main changes, such as 'Add v1.4.0 release with GIST support, tags page, and comment updates' or similar that reflects the primary objectives.
✅ 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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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.

@kingRayhan kingRayhan merged commit 6558192 into main Mar 29, 2026
1 check was pending
@coderabbitai coderabbitai Bot mentioned this pull request Apr 1, 2026
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