Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions web/core/components/issues/parent-issues-list-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Combobox, Dialog, Transition } from "@headlessui/react";
// types
import { ISearchIssueResponse } from "@plane/types";
// ui
import { Loader, ToggleSwitch, Tooltip } from "@plane/ui";
import { Loader } from "@plane/ui";
// components
import { IssueSearchModalEmptyState } from "@/components/core";
// helpers
Expand Down Expand Up @@ -48,7 +48,6 @@ export const ParentIssuesListModal: React.FC<Props> = ({
const [searchTerm, setSearchTerm] = useState("");
const [issues, setIssues] = useState<ISearchIssueResponse[]>([]);
const [isSearching, setIsSearching] = useState(false);
const [isWorkspaceLevel, setIsWorkspaceLevel] = useState(false);
const { isMobile } = usePlatformOS();
const debouncedSearchTerm: string = useDebounce(searchTerm, 500);

Expand All @@ -59,7 +58,6 @@ export const ParentIssuesListModal: React.FC<Props> = ({
const handleClose = () => {
onClose();
setSearchTerm("");
setIsWorkspaceLevel(false);
};

useEffect(() => {
Expand All @@ -73,15 +71,15 @@ export const ParentIssuesListModal: React.FC<Props> = ({
search: debouncedSearchTerm,
parent: true,
issue_id: issueId,
workspace_search: isWorkspaceLevel,
workspace_search: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Hardcoding workspace_search: false requires additional changes

The verification reveals that other components still maintain workspace-level search functionality:

  • command-modal.tsx has an active workspace toggle and uses workspace_search: !projectId ? true : isWorkspaceLevel
  • existing-issues-list-modal.tsx has a workspace toggle UI and uses workspace_search: isWorkspaceLevel

While hardcoding workspace_search: false in parent-issues-list-modal.tsx aligns with other modals like select-duplicate.tsx and bulk-delete-issues-modal.tsx, it creates inconsistency with components that still support workspace-level search. This change should be part of a broader refactoring effort to remove workspace search functionality across all components.

🔗 Analysis chain

Verify impact of removing workspace-level search

The hardcoding of workspace_search: false aligns with the PR objective to remove workspace-level toggle. This ensures parent issue search is always project-scoped.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other components that might be affected by workspace_search parameter
rg -l "workspace_search" --type ts --type tsx

# Check for any remaining workspace-level toggle UI elements
ast-grep --pattern 'workspace_search = true' 

Length of output: 120


Script:

#!/bin/bash
# Search for workspace_search usage with proper file extension patterns
rg -l "workspace_search" --type typescript --type-add 'typescript:*.{ts,tsx}'

# Check for any workspace search related UI or logic
rg -A 3 "workspace.*search" --type typescript --type-add 'typescript:*.{ts,tsx}'

Length of output: 5548

epic: searchEpic ? true : undefined,
})
.then((res) => setIssues(res))
.finally(() => {
setIsSearching(false);
setIsLoading(false);
});
}, [debouncedSearchTerm, isOpen, issueId, isWorkspaceLevel, projectId, workspaceSlug]);
}, [debouncedSearchTerm, isOpen, issueId, projectId, workspaceSlug]);

return (
<>
Expand Down Expand Up @@ -131,28 +129,6 @@ export const ParentIssuesListModal: React.FC<Props> = ({
tabIndex={baseTabIndex}
/>
</div>
<div className="flex p-2 sm:justify-end">
<Tooltip tooltipContent="Toggle workspace level search" isMobile={isMobile}>
<div
className={`flex flex-shrink-0 cursor-pointer items-center gap-1 text-xs ${
isWorkspaceLevel ? "text-custom-text-100" : "text-custom-text-200"
}`}
>
<ToggleSwitch
value={isWorkspaceLevel}
onChange={() => setIsWorkspaceLevel((prevData) => !prevData)}
label="Workspace level"
/>
<button
type="button"
onClick={() => setIsWorkspaceLevel((prevData) => !prevData)}
className="flex-shrink-0"
>
Workspace Level
</button>
</div>
</Tooltip>
</div>
<Combobox.Options
static
className="max-h-80 scroll-py-2 overflow-y-auto vertical-scrollbar scrollbar-md"
Expand Down
Loading