-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[WEB-3704] chore: work item store optimization and code refactor #6846
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
Conversation
WalkthroughTwo areas of the code have been modified. The Changes
Sequence Diagram(s)sequenceDiagram
participant IL as IssueList Component
participant IH as useIssueDetail Hook
IL->>IH: Call useIssueDetail(issueServiceType)
IH-->>IL: Return subIssuesByIssueId
sequenceDiagram
participant IS as Issue Store
participant RIS as RootIssueStore
IS->>RIS: Retrieve issue details
alt Issue is Epic
RIS-->>IS: Return epicDetail
else Regular Issue
RIS-->>IS: Return issueDetail
end
IS->>IS: Process issue reactions, links, attachments, etc.
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web/core/components/issues/sub-issues/issues-list.tsx(1 hunks)web/core/store/issue/issue-details/issue.store.ts(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (3)
web/core/store/issue/issue-details/issue.store.ts (2)
304-306: Good refactoring to enhance code maintainability.Creating the
rootWorkItemDetailStorevariable to conditionally select between epic and issue detail stores based on the issue type is a great improvement. This abstraction simplifies the code and makes it more maintainable by removing conditional logic duplication throughout the function.
342-352: Good application of the store abstraction for related data fetching.The use of
rootWorkItemDetailStorefor fetching activities, comments, sub-issues, and relations is well implemented. This makes the code more consistent and easier to maintain as the conditional logic is isolated to a single place.web/core/components/issues/sub-issues/issues-list.tsx (1)
43-43:Details
✅ Verification successful
Updated hook call to support different issue service types.
The
useIssueDetailhook call now includes theissueServiceTypeparameter, which allows the component to retrieve the correct sub-issue details based on the type of service (issues, epics, etc.). This change aligns well with the store refactoring in issue.store.ts.
🏁 Script executed:
#!/bin/bash # Verify the implementation of useIssueDetail hook to ensure it properly handles the issueServiceType parameter # Look for the useIssueDetail hook implementation echo "Searching for useIssueDetail hook implementation..." rg -A 10 "export const useIssueDetail" --type tsx --type tsLength of output: 202
I'll now run a refined shell script that uses glob patterns for searching TypeScript and TSX files, since the previous command failed due to the unrecognized file type "tsx". This will help us verify the implementation of the
useIssueDetailhook correctly.Please run the above script to gather the necessary information for verification.
🏁 Script executed:
#!/bin/bash echo "Searching for useIssueDetail hook implementation using glob patterns (*.ts, *.tsx)..." rg -A 10 "export const useIssueDetail" -g "*.ts" -g "*.tsx"Length of output: 1446
Verified: Hook usage and implementation are correct.
The updated call in
web/core/components/issues/sub-issues/issues-list.tsxnow correctly passes theissueServiceTypeparameter. The implementation inweb/core/hooks/store/use-issue-detail.tsproperly handles this parameter by returningcontext.issue.epicDetailwhenserviceTypeisEIssueServiceType.EPICS, and the defaultcontext.issue.issueDetailotherwise. This aligns well with the recent store refactoring inissue.store.ts.No further changes are needed here.
* chore: work item store optimization and code refactor * chore: code refactor
Description
This PR includes following changes:
Type of Change
References
[WEB-3704]
Summary by CodeRabbit