Skip to content

[WEB-3838]feat:sub work items sorting#6967

Merged
sriramveeraghanta merged 8 commits intopreviewfrom
feat-sub_work_items_sorting
Apr 29, 2025
Merged

[WEB-3838]feat:sub work items sorting#6967
sriramveeraghanta merged 8 commits intopreviewfrom
feat-sub_work_items_sorting

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Apr 24, 2025

Description

Refactored sub-work items components.
Added sort and display filters toggle for sub work items

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

WEB-3838

Summary by CodeRabbit

  • New Features

    • Introduced advanced filtering, sorting, and grouping for sub-issues, including grouping by assignee and other fields.
    • Added display filter controls and customizable display properties for sub-issues in the issue detail view.
    • Implemented a new icon for display property customization.
    • Added a new sub-work items page type with tailored display filters and properties.
  • Improvements

    • Enhanced sub-issue list components with improved layouts and editable property fields.
    • Streamlined sub-issue operations with improved link copying and simplified method signatures.
    • Expanded API support to accept query parameters for flexible sub-issue retrieval.
  • Bug Fixes

    • Improved state safety and error handling in sub-issue management.
  • Chores

    • Refactored and reorganized sub-issue components, removing deprecated files and updating exports.
    • Cleaned up imports and updated memoization dependencies for better performance.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Walkthrough

This change set implements a comprehensive refactor and enhancement of the sub-issues functionality within an issue tracking system. Key updates include the introduction of dynamic ordering and grouping for sub-issues retrieval on the backend, the addition of new constants and types for sub-issue display properties, and significant frontend changes. The frontend now features new and restructured React components for sub-issue lists, display filters, and property editing, with MobX stores managing filter and grouping state. Several obsolete files and components were removed, and new hooks and utilities were introduced for improved clipboard operations and filter management. The API and store layers were updated to support flexible query parameters, grouping, and filtering of sub-issues.

Changes

File(s) Change Summary
apiserver/plane/app/views/issue/sub_issue.py Added support for dynamic ordering and grouping of sub-issues in the API, with new query parameters and response structures.
packages/constants/src/issue/common.ts Introduced SUB_ISSUES_DISPLAY_PROPERTIES_KEYS constant for sub-issue display properties.
packages/constants/src/issue/filter.ts Reformatted arrays and added a new sub_work_items page type using the new display properties constant.
packages/types/src/issues/issue_sub_issues.d.ts Updated types for sub-issue responses and operations; added TSubIssueResponse and TSubIssueOperations.
packages/ui/src/icons/display-properties.tsx, packages/ui/src/icons/index.ts Added new DisplayPropertiesIcon component and exported it in the icons index.
web/core/components/issues/issue-detail-widgets/relations/helper.tsx Refactored clipboard copy logic, renamed copyText to copyLink, and updated internal method signatures.
web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx Switched to using SubIssuesListRoot for sub-issue rendering and refactored handlers.
web/core/components/issues/issue-detail-widgets/sub-issues/display-filters.tsx Added new SubIssueDisplayFilters component for managing sub-issue display filters.
web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts Refactored hook, renamed copyText to copyLink, simplified parameter typing, and updated imports.
web/core/components/issues/issue-detail-widgets/sub-issues/index.ts Exported display-filters module.
web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/list-item.tsx Renamed and refactored component to SubIssuesListItem, updated props, and integrated display properties.
web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/properties.tsx Added new SubIssuesListItemProperties component for editing sub-issue properties.
web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/root.tsx Introduced SubIssuesListRoot component for rendering lists of sub-issues.
web/core/components/issues/issue-detail-widgets/sub-issues/root.tsx Minor prop and comment updates; switched to new action component.
web/core/components/issues/issue-detail-widgets/sub-issues/title-actions.tsx Added SubWorkItemTitleActions component for sub-issue actions and filters.
web/core/components/issues/issue-detail-widgets/sub-issues/title.tsx Updated props and action rendering for SubIssuesCollapsibleTitle.
web/core/components/issues/relations/issue-list-item.tsx Updated to use copyLink instead of copyText for copying issue links.
web/core/services/issue/issue.service.ts Extended subIssues method to accept optional query parameters for flexible API requests.
web/core/store/issue/issue-details/sub_issues.store.ts Enhanced store to support grouped sub-issues, new filters, and loader state; updated fetch logic.
web/core/store/issue/issue-details/sub_issues_filter.store.ts Introduced WorkItemSubIssueFiltersStore for managing sub-issue filters and grouping.
web/core/components/issues/sub-issues/index.ts
web/core/components/issues/sub-issues/issues-list.tsx
web/core/components/issues/sub-issues/progressbar.tsx
web/core/components/issues/sub-issues/properties.tsx
web/core/components/issues/sub-issues/root.tsx
Deleted obsolete sub-issues components and related exports.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant SubIssuesEndpoint (API)
    participant IssueService
    participant SubIssuesStore
    participant FiltersStore

    Client->>SubIssuesEndpoint: GET /sub-issues?order_by=...&group_by=...
    SubIssuesEndpoint->>IssueService: Fetch sub-issues with order/group params
    IssueService->>SubIssuesEndpoint: Return ordered/grouped sub-issues
    SubIssuesEndpoint-->>Client: Respond with list or grouped dict

    Client->>SubIssuesStore: fetchSubIssues(parentId)
    SubIssuesStore->>FiltersStore: Get filter params for parentId
    SubIssuesStore->>IssueService: subIssues(..., queries)
    IssueService-->>SubIssuesStore: sub-issues response
    SubIssuesStore->>FiltersStore: processSubIssueResponse(response)
    FiltersStore-->>SubIssuesStore: { issueList, groupedIssues }
    SubIssuesStore-->>Client: Update observable sub-issues/grouped state
Loading

Possibly related PRs

  • [WEB-3859] fix: work item links #6930: Modifies the useSubIssueOperations hook similarly by requiring an explicit issueServiceType parameter and adjusting internal logic and dependencies.

Suggested labels

🌐frontend, 🌟improvement

Suggested reviewers

  • sriramveeraghanta
  • prateekshourya29

Poem

A bunny hopped through fields of code,
Grouping, sorting, lightening the load.
With filters fresh and icons bright,
Sub-issues now are such a sight!
Old roots replaced, the list refined—
In every line, new features shine.
🐇✨ Hooray for progress, neatly aligned!


📜 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 4efbd57 and 540b73f.

📒 Files selected for processing (1)
  • web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/list-item.tsx (9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/list-item.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
✨ 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 generate sequence diagram to generate a sequence diagram of the changes in 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 24, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@sriramveeraghanta sriramveeraghanta marked this pull request as ready for review April 29, 2025 09:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🔭 Outside diff range comments (4)
web/core/store/issue/issue-details/sub_issues.store.ts (2)

91-103: 🛠️ Refactor suggestion

MobX annotation mismatch for groupedSubIssuesByIssueId

groupedSubIssuesByIssueId is a getter that does not mutate state.
Annotating it as an action prevents MobX from memoising the value and causes
unnecessary re-executions. Prefer computed, or drop the annotation entirely:

 makeObservable(this, {
   …
-  groupedSubIssuesByIssueId: action,
+  groupedSubIssuesByIssueId: computed,
 });

Also consider turning groupedSubIssuesMap into an observable.ref if the map
is replaced wholesale, or an observable.shallow if only its keys change.


140-175: 🛠️ Refactor suggestion

⚠️ Potential issue

Loader & grouped-count state never updated – UX regressions

  1. this.loader is declared (observable.ref) but never set to "loading" | "success" | "error". The UI will no longer show spinners or error states.

  2. groupedSubIssuesCount is declared but never populated; any badge/summary
    that relies on it will always show 0.

  3. issueList can be undefined when processSubIssueResponse returns only
    grouped data, yet it is passed directly to addIssue. Guard against this
    to prevent a runtime exception.

Quick fix:

- const { issueList, groupedIssues } = this.filters.processSubIssueResponse(response.sub_issues);
+ const { issueList = [], groupedIssues, groupedCount } =
+     this.filters.processSubIssueResponse(response.sub_issues);

  // set grouped issues count
  set(this.groupedSubIssuesMap, [parentIssueId], groupedIssues);
+ set(this.groupedSubIssuesCount, [parentIssueId], groupedCount);

- this.rootIssueDetailStore.rootIssueStore.issues.addIssue(issueList);
+ if (issueList.length) {
+   this.rootIssueDetailStore.rootIssueStore.issues.addIssue(issueList);
+ }

+ this.loader = "success";

…and remember to set this.loader = "loading" before the API call and
"error" inside catch.

web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts (2)

196-211: 🛠️ Refactor suggestion

Loader never cleared on failed “remove sub-issue”

Inside the catch clause the helper flag set with
setSubIssueHelpers(parentIssueId, "issue_loader", issueId) is not reset, leaving the UI stuck in a loading state after an error.

        } catch {
+          // clear loader so UI doesn’t remain in a busy state
+          setSubIssueHelpers(parentIssueId, "issue_loader", issueId);

224-235: 🛠️ Refactor suggestion

Same loader-reset issue in deleteSubIssue

Replicate the fix suggested above to keep behaviour consistent.

🧹 Nitpick comments (3)
web/core/components/issues/issue-detail-widgets/sub-issues/display-filters.tsx (1)

17-70: Component implementation is well-structured

The component follows React best practices with proper props destructuring and conditional rendering based on the available display filters and properties. The dropdown menu implementation with stopping event propagation is a good approach.

One suggestion: The className string is quite long - consider extracting it to a constant or using a utility like cn() for better readability.

-            className="vertical-scrollbar scrollbar-sm relative h-full w-full divide-y divide-custom-border-200 overflow-hidden overflow-y-auto px-2.5 max-h-[25rem] text-left"
+            className={cn(
+              "vertical-scrollbar scrollbar-sm relative",
+              "h-full w-full max-h-[25rem]",
+              "divide-y divide-custom-border-200",
+              "overflow-hidden overflow-y-auto",
+              "px-2.5 text-left"
+            )}
web/core/components/issues/issue-detail-widgets/relations/helper.tsx (1)

57-57: Consider adding specific error handling.

The error handling has been simplified by removing the explicit error capture. While this works, you might want to consider capturing and logging specific error types for better debugging.

-        } catch {
+        } catch (error) {
+          console.error("Failed to update issue:", error);

Also applies to: 83-83

web/core/components/issues/issue-detail-widgets/sub-issues/title-actions.tsx (1)

40-52: Similar guard pattern in handleDisplayPropertiesUpdate.

The handleDisplayPropertiesUpdate function has the same guard pattern as handleDisplayFilters. Consider applying the same recommendation for consistency.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6df8323 and 4efbd57.

📒 Files selected for processing (26)
  • apiserver/plane/app/views/issue/sub_issue.py (3 hunks)
  • packages/constants/src/issue/common.ts (1 hunks)
  • packages/constants/src/issue/filter.ts (11 hunks)
  • packages/types/src/issues/issue_sub_issues.d.ts (1 hunks)
  • packages/ui/src/icons/display-properties.tsx (1 hunks)
  • packages/ui/src/icons/index.ts (1 hunks)
  • web/core/components/issues/issue-detail-widgets/relations/helper.tsx (6 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx (4 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/display-filters.tsx (1 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts (8 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/index.ts (1 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/list-item.tsx (9 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/properties.tsx (1 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/root.tsx (1 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/root.tsx (2 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/title-actions.tsx (1 hunks)
  • web/core/components/issues/issue-detail-widgets/sub-issues/title.tsx (2 hunks)
  • web/core/components/issues/relations/issue-list-item.tsx (1 hunks)
  • web/core/components/issues/sub-issues/index.ts (0 hunks)
  • web/core/components/issues/sub-issues/issues-list.tsx (0 hunks)
  • web/core/components/issues/sub-issues/progressbar.tsx (0 hunks)
  • web/core/components/issues/sub-issues/properties.tsx (0 hunks)
  • web/core/components/issues/sub-issues/root.tsx (0 hunks)
  • web/core/services/issue/issue.service.ts (1 hunks)
  • web/core/store/issue/issue-details/sub_issues.store.ts (9 hunks)
  • web/core/store/issue/issue-details/sub_issues_filter.store.ts (1 hunks)
💤 Files with no reviewable changes (5)
  • web/core/components/issues/sub-issues/index.ts
  • web/core/components/issues/sub-issues/issues-list.tsx
  • web/core/components/issues/sub-issues/properties.tsx
  • web/core/components/issues/sub-issues/progressbar.tsx
  • web/core/components/issues/sub-issues/root.tsx
🧰 Additional context used
🧬 Code Graph Analysis (8)
web/core/components/issues/issue-detail-widgets/sub-issues/root.tsx (1)
web/core/store/router.store.ts (2)
  • projectId (85-87)
  • workspaceSlug (69-71)
packages/constants/src/issue/common.ts (1)
packages/types/src/view-props.d.ts (1)
  • IIssueDisplayProperties (114-131)
web/core/components/issues/issue-detail-widgets/sub-issues/display-filters.tsx (4)
packages/types/src/view-props.d.ts (2)
  • IIssueDisplayProperties (114-131)
  • IIssueDisplayFilterOptions (101-113)
packages/types/src/issues.d.ts (1)
  • ILayoutDisplayFiltersOptions (245-258)
packages/ui/src/icons/display-properties.tsx (1)
  • DisplayPropertiesIcon (5-14)
web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx (1)
  • FilterDisplayProperties (24-94)
web/core/services/issue/issue.service.ts (2)
packages/types/src/view-props.d.ts (1)
  • TIssueParams (54-79)
packages/types/src/issues/issue_sub_issues.d.ts (1)
  • TIssueSubIssues (11-14)
packages/constants/src/issue/filter.ts (1)
packages/constants/src/issue/common.ts (2)
  • ISSUE_DISPLAY_PROPERTIES_KEYS (149-166)
  • SUB_ISSUES_DISPLAY_PROPERTIES_KEYS (168-175)
packages/ui/src/icons/display-properties.tsx (1)
packages/ui/src/icons/index.ts (1)
  • ISvgIcons (1-1)
web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts (4)
packages/types/src/issues/issue.d.ts (1)
  • TIssueServiceType (123-123)
packages/types/src/issues/issue_sub_issues.d.ts (1)
  • TSubIssueOperations (26-41)
packages/utils/src/string.ts (1)
  • copyUrlToClipboard (81-87)
web/core/store/router.store.ts (4)
  • workspaceSlug (69-71)
  • projectId (85-87)
  • issueId (149-151)
  • epicId (173-175)
web/core/store/issue/issue-details/sub_issues_filter.store.ts (6)
packages/types/src/view-props.d.ts (4)
  • IIssueFilters (138-143)
  • IIssueDisplayFilterOptions (101-113)
  • IIssueDisplayProperties (114-131)
  • TIssueParams (54-79)
packages/types/src/issues/issue_sub_issues.d.ts (1)
  • TSubIssueResponse (16-16)
packages/types/src/issues/issue.d.ts (1)
  • TIssue (54-67)
packages/types/src/issues/base.d.ts (4)
  • TIssues (29-29)
  • TGroupedIssueCount (41-43)
  • TGroupedIssues (21-23)
  • TSubGroupedIssues (25-27)
web/core/store/issue/issue-details/sub_issues.store.ts (1)
  • IIssueSubIssuesStore (50-67)
packages/constants/src/issue/common.ts (1)
  • ALL_ISSUES (3-3)
🔇 Additional comments (42)
packages/constants/src/issue/common.ts (1)

168-175: Great addition for sub-issues display properties

This addition clearly defines which display properties are relevant for sub-issues - a good subset of the full issue properties that makes sense for the sub-items context. The typing is correct, using the keyof IIssueDisplayProperties to ensure type safety.

packages/ui/src/icons/index.ts (1)

54-54: LGTM! New icon export for display properties

This export addition aligns with the PR objective of adding display filter toggles for sub-work items, making the icon available throughout the application.

web/core/components/issues/issue-detail-widgets/sub-issues/index.ts (1)

5-5: LGTM! Exporting new display filters component

Adding the export for display filters is consistent with the PR objective of adding display filter toggles for sub-work items.

web/core/components/issues/relations/issue-list-item.tsx (1)

112-112: Method name updated for better semantics

Changed from copyText to copyLink which more accurately describes the operation being performed and aligns with the refactored clipboard operations in the codebase.

web/core/components/issues/issue-detail-widgets/sub-issues/root.tsx (2)

24-24: Improved comment clarity for isCollapsibleOpen

The comment change from "derived state" to "derived values" provides a more accurate description of what isCollapsibleOpen represents, as it's not actually managing state but extracting a value from the store.


36-37: Props update for SubIssuesCollapsibleTitle component

Appropriate addition of projectId and workspaceSlug props to support the new sub-work items sorting functionality. These props are required by the updated SubWorkItemTitleActions component that handles filtering and sorting options.

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

11-13: Updated imports to use new component structure

Good refactoring to use the new SubIssuesListRoot component. This aligns with the broader refactoring of sub-issues components to support new filtering and sorting capabilities.


57-59: Improved destructuring of useIssueDetail hooks

Consolidating the destructured modal toggle functions improves code readability.


67-79: Function optimization with useCallback

Converting handleIssueCrudState to use useCallback is a good optimization. This prevents unnecessary re-creation of the function on each render, improving performance particularly if this function is passed down to child components.


119-130: Updated component usage for sub-issues list

Replaced the previous implementation with the new SubIssuesListRoot component, which provides the enhanced sorting and filtering functionality required by the feature.

web/core/services/issue/issue.service.ts (2)

270-275: Enhanced subIssues method with flexible query parameters

The addition of the optional queries parameter to the subIssues method is a key enhancement that enables the new sorting and filtering functionality. This allows clients to specify sort order, grouping, and other filter parameters when fetching sub-issues.


277-279: Updated API request to include query parameters

The request now properly forwards the queries to the API endpoint, enabling server-side filtering and sorting of sub-issues based on the provided parameters.

web/core/components/issues/issue-detail-widgets/sub-issues/title.tsx (5)

3-12: Updated imports and added SubWorkItemTitleActions component

Replaced SubIssuesActionButton with the new SubWorkItemTitleActions component, which provides the enhanced filtering and sorting functionality for sub-work items.


19-21: Added required props for sub-issue filtering

The addition of projectId and workspaceSlug props is necessary for the new sub-work items sorting functionality. These props are needed by the SubWorkItemTitleActions component to make API calls with the correct context.


24-31: Improved destructuring of props

Reorganized the props destructuring for better readability and to accommodate the new props.


36-40: Updated store access for sub-issues

Simplified the destructuring of store values, maintaining only the required properties.


65-72: Replaced action button with enhanced SubWorkItemTitleActions

The replacement of the previous action button with SubWorkItemTitleActions implements the new sorting and filtering functionality for sub-work items. The component now receives the necessary props to function correctly within the context of the parent issue.

packages/ui/src/icons/display-properties.tsx (1)

1-14: Well-structured SVG icon component implementation

This component is correctly implemented according to React best practices, with proper props handling, default className, and SVG attributes. The icon represents a display properties control, visually showing three adjustable sliders.

apiserver/plane/app/views/issue/sub_issue.py (2)

26-26: Good addition of utility import

The import of order_issue_queryset aligns with the new ordering functionality being implemented.


106-114: Ordering implementation looks good

The implementation of order_by functionality is well structured, getting the parameter from request.GET with a sensible default value and using the imported utility function.

web/core/components/issues/issue-detail-widgets/sub-issues/display-filters.tsx (2)

1-7: Dependencies and imports look good

The imports are well-organized, properly separating React core, third-party libraries, and application components with appropriate type imports.


8-15: Well-defined type interface

The props interface is comprehensive and properly typed, which enhances type safety and makes the component's requirements clear to consumers.

web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/list-item.tsx (6)

5-13: Import organization is improved

The reorganized imports with the "plane imports" comment make the code more maintainable by clearly separating different types of imports.


25-40: Type definition is clear

The type definition provides a clear contract for the component props, making it easier for other developers to understand the component's requirements.


156-168: Good use of HOC for conditional rendering

The component correctly uses the WithDisplayPropertiesHOC to conditionally render the issue identifier based on the display properties. This approach keeps the rendering logic clean and reusable.


181-189: Improved props passing to SubIssuesListItemProperties

The component now passes more specific props to the SubIssuesListItemProperties component, including the whole issue object for better control and rendering.


214-214: Updated method name for better clarity

Renaming from copyText to copyLink more accurately reflects the action being performed, making the code more maintainable and understandable.


267-267: Updated component for nested sub-issues

The component now correctly uses the new SubIssuesListRoot component for rendering nested sub-issues, which ensures consistency with the new sub-issues implementation.

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

9-9: Import refactoring looks good.

The new import of copyUrlToClipboard from @plane/utils replaces a previous clipboard helper import, simplifying clipboard operations with a standardized utility.


14-14: Method renaming improves consistency.

Renaming from copyText to copyLink better reflects the method's purpose and aligns with similar changes in sub-issues operations.


31-39: Simplified clipboard implementation.

The clipboard implementation has been simplified using the copyUrlToClipboard utility, removing manual URL concatenation and making the code more maintainable.


92-92: Fixed useMemo dependency array.

The dependency array has been properly expanded to include captureIssueEvent, entityName, and t, which prevents potential stale closure issues and improves memoization correctness.

web/core/components/issues/issue-detail-widgets/sub-issues/issues-list/root.tsx (3)

1-8: Imports look good.

The imports are well-organized with clear separation between external libraries, plane imports, hooks, and local imports.


10-24: Well-structured props interface.

The props interface is comprehensive and well-typed, providing all necessary information for the component to function properly.


26-42: Clean component implementation with appropriate store access.

The component implementation is clean and follows good practices for accessing store data. The destructuring of props and store values improves readability.

packages/types/src/issues/issue_sub_issues.d.ts (2)

13-13: Good type enhancement for grouped sub-issues.

The type of sub_issues has been updated from a simple array to a union type TSubIssueResponse, which can handle both flat arrays and grouped objects. This change supports the new grouping functionality in the sub-issues feature.

Also applies to: 16-16


26-41: Well-defined operations interface.

The new TSubIssueOperations type provides a comprehensive interface for sub-issue management operations, including copying links, fetching, adding, updating, removing, and deleting sub-issues. This standardizes the API for interacting with sub-issues across components.

web/core/components/issues/issue-detail-widgets/sub-issues/title-actions.tsx (5)

1-8: Clean imports with appropriate dependencies.

The imports are well-organized and include all necessary dependencies for the component.


9-15: Well-typed component props.

The props interface is well-defined with appropriate types for all properties.


17-26: Good store integration with MobX observer pattern.

The component correctly uses the observer pattern and accesses the store to get sub-issue filters for the parent issue.


32-38: Ensure workspaceSlug and projectId guard against early returns.

The handleDisplayFilters function correctly guards against undefined workspaceSlug or projectId before updating filters. However, this might hide potential errors in component usage if these props are expected to be defined.

Consider logging a warning or throwing an error in development mode when these required values are missing:

  if (!workspaceSlug || !projectId) return;
+  if (process.env.NODE_ENV === 'development') {
+    console.warn('Missing workspaceSlug or projectId in handleDisplayFilters');
+  }

54-68: Clean and concise render method.

The render method is clean and conditionally renders the SubIssuesActionButton only when not disabled. The component effectively passes all necessary props to its children.

@sriramveeraghanta sriramveeraghanta merged commit 14dc6a5 into preview Apr 29, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat-sub_work_items_sorting branch April 29, 2025 09:53
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* refactor: sub-work items components, hooks and types

* feat: added orderby and display properties toggle for sub work items

* fix: build errors

* chore: removed issue type from filters

* chore: added null check

* fix: added null check

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants