You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(api): migrate ThreadedComments from Flow to TypeScript - #4988
Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.
Queue this pull request once it meets the queue conditions
No actionable comments were generated in the recent review.
Walkthrough
The PR adds a ThreadedComments API class with methods to create, update, delete, and retrieve comments and replies. The methods build request URLs, check permissions, pass request options, and format successful responses.
Changes
Threaded comments API
Layer / File(s)
Summary
API setup and response formatting src/api/ThreadedComments.ts, src/api/__tests__/ThreadedComments.test.ts
Adds the API subclass, URL builders, and response formatting. The test setup casts constructor options to APIOptions.
Comment and reply mutations src/api/ThreadedComments.ts
Adds permission-checked methods to create, update, and delete comments, and to create replies.
Comment and reply retrieval src/api/ThreadedComments.ts
Adds permission-checked methods to fetch a comment, list comments with pagination options, and fetch replies.
This change converts the threaded comments API to TypeScript and keeps a Flow declaration file for existing Flow consumers. No actionable merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the refactor ("migrate ThreadedComments from Flow to TypeScript") and the scope (api). The changeset converts ThreadedComments.js to ThreadedComments.ts, renames its test to TypeScript…
Description check
The description follows the required structure in its own way. It gives a summary heading, a Changes list, and a Contract section. The repository template is a merge-queue checklist with no fields to …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the refactor ("migrate ThreadedComments from Flow to TypeScript") and the scope (api). The changeset converts ThreadedComments.js to ThreadedComments.ts, renames its test to TypeScript, and adds a Flow declaration file. The title covers the main change, so it passes.
Full details: Description check
Explanation
The description follows the required structure in its own way. It gives a summary heading, a Changes list, and a Contract section. The repository template is a merge-queue checklist with no fields to fill in. The description states the conversion, the renamed test, and the added Flow file. It does not state how the changes were verified, such as which tests ran. That gap is minor, so the check passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks the comment trail, Then sends a note along the way. Replies gather, threads take shape, Rich text joins the message flow. The rabbit hops contentedly.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 125f226b-d497-4d6e-9362-ce7933483c2e
Commits
Reviewing files that changed from the base of the PR and between fcd5d5b and c9a185b.
Files selected for processing: 3
src/api/ThreadedComments.js.flow
src/api/ThreadedComments.ts
src/api/__tests__/ThreadedComments.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert
ThreadedCommentsAPI to TypeScriptThis PR converts
src/api/ThreadedCommentsfrom JavaScript with Flow to TypeScript.Changes
ThreadedComments.jstoThreadedComments.ts__tests__/ThreadedComments.test.jstoThreadedComments.test.ts(typed the constructor options asAPIOptions)ThreadedComments.js.flowwith the original Flow source for backward compatibility with Flow consumers (APIFactory,Feed,useRepliesAPI)Contract
Summary by CodeRabbit