-
Notifications
You must be signed in to change notification settings - Fork 3.6k
chore: code refactor #5952
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
chore: code refactor #5952
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| "use client"; | ||
| import React, { FC } from "react"; | ||
| // local components | ||
|
|
||
| type TDeDupeButtonRoot = { | ||
| workspaceSlug: string; | ||
| isDuplicateModalOpen: boolean; | ||
| handleOnClick: () => void; | ||
| label: string; | ||
| }; | ||
|
|
||
| export const DeDupeButtonRoot: FC<TDeDupeButtonRoot> = (props) => { | ||
| const { workspaceSlug, isDuplicateModalOpen, label, handleOnClick } = props; | ||
| return <></>; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from "./de-dupe-button"; | ||
| export * from "./duplicate-modal"; | ||
| export * from "./duplicate-popover"; | ||
| export * from "./issue-block"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ import { useAppRouter } from "@/hooks/use-app-router"; | |
| import useKeypress from "@/hooks/use-keypress"; | ||
| import { usePlatformOS } from "@/hooks/use-platform-os"; | ||
| // services | ||
| import { DeDupeIssueButtonLabel, DuplicateModalRoot } from "@/plane-web/components/de-dupe"; | ||
| import { DeDupeButtonRoot, DuplicateModalRoot } from "@/plane-web/components/de-dupe"; | ||
| import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Debounce implementation is missing in the duplicate issues hook The current implementation of
This needs to be addressed to:
🔗 Analysis chainVerify the debounce timing for duplicate detection. The code uses Also applies to: 213-218 Let me gather more information about the debounce implementation. Let me try searching in a different location since the previous path wasn't found. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check the implementation of useDebouncedDuplicateIssues hook
# Expected: Find the debounce timing configuration and any rate limiting
# Search for the hook implementation
ast-grep --pattern 'export const useDebouncedDuplicateIssues = $_'
# Search for debounce timing configuration
rg -A 5 'useDebouncedDuplicateIssues'
Length of output: 7051 Script: #!/bin/bash
# Search for the actual implementation file and any debounce logic
rg -g '*.ts*' -A 10 'useDebouncedDuplicateIssues.*=' web/plane-web/hooks/
# Check for any debounce utility or hook being used
rg -g '*.ts*' 'useDebounce|debounce' web/plane-web/hooks/
Length of output: 257 Script: #!/bin/bash
# Search for the actual implementation in the web directory
rg -g '*.ts*' -A 10 'useDebouncedDuplicateIssues.*=' web/
# Check for any debounce utility or hook being used
rg -g '*.ts*' 'useDebounce|debounce' web/
# Find the correct path for the hook implementation
fd -e tsx -e ts use-debounced-duplicate-issues
Length of output: 8345 |
||
| import { FileService } from "@/services/file.service"; | ||
|
|
||
|
|
@@ -210,18 +210,12 @@ export const InboxIssueCreateRoot: FC<TInboxIssueCreateRoot> = observer((props) | |
| <div className="flex items-center justify-between gap-2"> | ||
| <h3 className="text-xl font-medium text-custom-text-200">Create intake issue</h3> | ||
| {duplicateIssues?.length > 0 && ( | ||
| <button | ||
| onClick={(e) => { | ||
| e.stopPropagation(); | ||
| e.preventDefault(); | ||
| handleDuplicateIssueModal(!isDuplicateModalOpen); | ||
| }} | ||
| > | ||
| <DeDupeIssueButtonLabel | ||
| isOpen={isDuplicateModalOpen} | ||
| buttonLabel={`${duplicateIssues.length} duplicate issue${duplicateIssues.length > 1 ? "s" : ""} found!`} | ||
| /> | ||
| </button> | ||
| <DeDupeButtonRoot | ||
| workspaceSlug={workspaceSlug} | ||
| isDuplicateModalOpen={isDuplicateModalOpen} | ||
| label={`${duplicateIssues.length} duplicate issue${duplicateIssues.length > 1 ? "s" : ""} found!`} | ||
| handleOnClick={() => handleDuplicateIssueModal(!isDuplicateModalOpen)} | ||
| /> | ||
| )} | ||
| </div> | ||
| <div className="space-y-3"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from "ce/components/de-dupe"; |
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.
Component implementation is incomplete
The component currently returns an empty fragment and doesn't utilize any of its props. Based on the PR objectives and AI summary, this component is meant to replace an existing implementation for handling duplicate issues, but the functionality is missing.
Consider implementing:
labelprophandleOnClickisDuplicateModalOpenHere's a suggested implementation:
export const DeDupeButtonRoot: FC<TDeDupeButtonRoot> = (props) => { const { workspaceSlug, isDuplicateModalOpen, label, handleOnClick } = props; - return <></>; + return ( + <button + type="button" + className="w-full text-custom-text-200 hover:text-custom-text-100" + onClick={handleOnClick} + > + {label} + </button> + ); };📝 Committable suggestion
🧰 Tools
🪛 GitHub Check: lint-web
[warning] 13-13:
'workspaceSlug' is assigned a value but never used
[warning] 13-13:
'isDuplicateModalOpen' is assigned a value but never used
[warning] 13-13:
'label' is assigned a value but never used
[warning] 13-13:
'handleOnClick' is assigned a value but never used
💡 Codebase verification
Component integration needs to be updated
The component is actively used in two locations with consistent prop usage:
web/core/components/inbox/modals/create-modal/create-root.tsxweb/core/components/issues/issue-modal/form.tsxBoth files import and use
DeDupeButtonRootwith the same props that are being removed in the empty implementation (workspaceSlug,isDuplicateModalOpen,label,handleOnClick). This will cause runtime errors.🔗 Analysis chain
Verify component integration
Let's verify how this component is integrated in the mentioned files to ensure proper implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 3270
🧰 Tools
🪛 GitHub Check: lint-web
[warning] 13-13:
'workspaceSlug' is assigned a value but never used
[warning] 13-13:
'isDuplicateModalOpen' is assigned a value but never used
[warning] 13-13:
'label' is assigned a value but never used
[warning] 13-13:
'handleOnClick' is assigned a value but never used