Skip to content

[WEB-3859] fix: work item links#6930

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix/epic-links
Apr 15, 2025
Merged

[WEB-3859] fix: work item links#6930
sriramveeraghanta merged 1 commit intopreviewfrom
fix/epic-links

Conversation

@aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Apr 15, 2025

Description

This PR fixes work item link components.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Refactor
    • Improved consistency by requiring explicit service type parameters in issue-related operations.
    • Enhanced memoization and dependency tracking for more accurate updates in sub-issue and link operations.
    • Simplified error handling in asynchronous operations for a cleaner user experience.

@aaryan610 aaryan610 added 🐛bug Something isn't working 🌐frontend labels Apr 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 15, 2025

Walkthrough

This change updates several hooks and their usages within the issue detail widget components to require an explicit issueServiceType parameter, removing any default values previously set. The affected hooks include useIssueDetail, useSubIssueOperations, and useLinkOperations. Their invocation sites are updated accordingly to pass the required parameter. Additionally, error handling in async operations is streamlined by removing unused error parameters from catch blocks, and memoization dependencies are expanded for more accurate recalculations. No exported or public entity signatures are modified beyond parameter requirements.

Changes

File(s) Change Summary
web/core/components/issues/issue-detail-widgets/issue-detail-widget-modals.tsx Updated calls to useIssueDetail, useSubIssueOperations, and useLinkOperations to require and pass the issueServiceType argument.
web/core/components/issues/issue-detail-widgets/links/helper.tsx Made issueServiceType a required parameter for useLinkOperations (removed default), adjusted import statements, removed unused error parameter from catch, and updated useMemo dependencies.
web/core/components/issues/issue-detail-widgets/sub-issues/helper.tsx Made issueServiceType a required parameter for useSubIssueOperations (removed default), updated calls to useIssueDetail, streamlined catch blocks, and expanded useMemo dependency array for more precise memoization.

Sequence Diagram(s)

sequenceDiagram
    participant Component
    participant useIssueDetail
    participant useSubIssueOperations
    participant useLinkOperations

    Component->>useIssueDetail: call with issueServiceType
    Component->>useSubIssueOperations: call with issueServiceType
    Component->>useLinkOperations: call with workspaceSlug, projectId, issueId, issueServiceType
    useSubIssueOperations->>useIssueDetail: call with issueServiceType
Loading

Possibly related PRs

  • makeplane/plane#6902: Both PRs modify the handling and propagation of the issueServiceType prop within issue detail widget components, indicating a direct and strong code-level connection.
  • makeplane/plane#6891: Both PRs update the usage of the useIssueDetail hook to accept an issueServiceType parameter, changing how issue service types are passed and handled.

Suggested reviewers

  • prateekshourya29

Poem

A hop and a skip, with types in the air,
ServiceType now required, no defaults to spare!
Hooks call each other, dependencies grow,
Memoization sharper, as functions now know.
Errors caught quietly, no need for a name—
This rabbit approves the refactor game! 🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2489988 and 00321ec.

📒 Files selected for processing (3)
  • web/core/components/issues/issue-detail-widgets/issue-detail-widget-modals.tsx (1 hunks)
  • web/core/components/issues/issue-detail-widgets/links/helper.tsx (3 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/helper.tsx (8 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
🔇 Additional comments (9)
web/core/components/issues/issue-detail-widgets/issue-detail-widget-modals.tsx (2)

42-42: Properly propagates service type context to hook.

The explicit passing of issueServiceType to the useIssueDetail hook ensures consistent issue service type handling across the component hierarchy.


45-46: Good synchronization of service type across hooks.

The consistent passing of issueServiceType to both operation hooks ensures that operations are performed with the correct service context.

web/core/components/issues/issue-detail-widgets/links/helper.tsx (3)

16-16: Improved API consistency by requiring explicit service type.

This change ensures the hook correctly requires an explicit issueServiceType parameter, preventing potential issues from implicitly defaulting to a specific service type.


69-69: Good simplification of error handling.

Removing the unused error parameter in the catch block improves code clarity without losing functionality.


78-78: Fixed dependency array to include translation function.

Adding t to the dependency array ensures proper memoization when the translation context changes, preventing potential stale translations.

web/core/components/issues/issue-detail-widgets/sub-issues/helper.tsx (4)

23-23: Improved API consistency by requiring explicit service type.

This change ensures the hook correctly requires an explicit issueServiceType parameter, preventing potential issues from implicitly defaulting to a specific service type.


33-37: Good restructuring of hook dependencies.

The code now destructures fetchSubIssues and removeSubIssue directly from the useIssueDetail hook, which is a cleaner approach.


67-67: Good simplification of error handling.

Removing the unused error parameters in catch blocks improves code clarity without losing functionality.

Also applies to: 93-93, 158-158, 204-204, 232-232


246-261: Fixed dependency array to include all used values.

The expanded dependency array now properly includes all values used within the memoized functions, preventing potential issues with stale closures. This is a critical fix that ensures the hook behaves correctly when any of its dependencies change.

✨ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@makeplane
Copy link

makeplane bot commented Apr 15, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@sriramveeraghanta sriramveeraghanta merged commit a4bca0c into preview Apr 15, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/epic-links branch April 15, 2025 08:16
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 🌐frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants