Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use client";

import { useCallback, useState } from "react";
import { useCallback, useRef, useState } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
import { useParams } from "next/navigation";
// icons
import { ArrowRight, PanelRight } from "lucide-react";
import { PanelRight } from "lucide-react";
// plane constants
import {
EIssueLayoutTypes,
Expand All @@ -23,15 +23,15 @@ import {
IIssueFilterOptions,
} from "@plane/types";
// ui
import { Breadcrumbs, Button, CustomMenu, DiceIcon, Tooltip, Header, CustomSearchSelect } from "@plane/ui";
import { Breadcrumbs, Button, DiceIcon, Tooltip, Header, CustomSearchSelect } from "@plane/ui";
// components
import { ProjectAnalyticsModal } from "@/components/analytics";
import { BreadcrumbLink, SwitcherLabel } from "@/components/common";
import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "@/components/issues";
// helpers
import { ModuleQuickActions } from "@/components/modules";
import { cn } from "@/helpers/common.helper";
import { isIssueFilterActive } from "@/helpers/filter.helper";
import { truncateText } from "@/helpers/string.helper";
// hooks
import {
useEventTracker,
Expand All @@ -51,30 +51,9 @@ import { usePlatformOS } from "@/hooks/use-platform-os";
// plane web
import { ProjectBreadcrumb } from "@/plane-web/components/breadcrumbs";

const ModuleDropdownOption: React.FC<{ moduleId: string }> = ({ moduleId }) => {
// router
const { workspaceSlug, projectId } = useParams();
// store hooks
const { getModuleById } = useModule();
// derived values
const moduleDetail = getModuleById(moduleId);

if (!moduleDetail) return null;

return (
<CustomMenu.MenuItem key={moduleDetail.id}>
<Link
href={`/${workspaceSlug}/projects/${projectId}/modules/${moduleDetail.id}`}
className="flex items-center gap-1.5"
>
<DiceIcon className="h-3 w-3" />
{truncateText(moduleDetail.name, 40)}
</Link>
</CustomMenu.MenuItem>
);
};

export const ModuleIssuesHeader: React.FC = observer(() => {
// refs
const parentRef = useRef<HTMLDivElement>(null);
// states
const [analyticsModal, setAnalyticsModal] = useState(false);
// router
Expand Down Expand Up @@ -320,14 +299,18 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
)}
<button
type="button"
className="grid h-7 w-7 place-items-center rounded p-1 outline-none hover:bg-custom-sidebar-background-80"
className="p-1 rounded outline-none hover:bg-custom-sidebar-background-80 bg-custom-background-80/70"
onClick={toggleSidebar}
>
<ArrowRight className={`hidden h-4 w-4 duration-300 md:block ${isSidebarCollapsed ? "-rotate-180" : ""}`} />
<PanelRight
className={cn("block h-4 w-4 md:hidden", !isSidebarCollapsed ? "text-[#3E63DD]" : "text-custom-text-200")}
/>
<PanelRight className={cn("h-4 w-4", !isSidebarCollapsed ? "text-[#3E63DD]" : "text-custom-text-200")} />
</button>
<ModuleQuickActions
parentRef={parentRef}
moduleId={moduleId?.toString()}
projectId={projectId.toString()}
workspaceSlug={workspaceSlug.toString()}
customClassName="flex-shrink-0 flex items-center justify-center size-6 bg-custom-background-80/70 rounded"
/>
Comment on lines +307 to +313
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify whether parentRef is being correctly applied.

The ModuleQuickActions component is correctly implemented, but I don't see where the parentRef is attached to a DOM element in the component.


🏁 Script executed:

#!/bin/bash
# Check if parentRef is used elsewhere in the component

# First, let's look for any div with ref={parentRef} in this file
rg -A 2 -B 2 "ref={parentRef}" "web/app/\[workspaceSlug\]/(projects)/projects/(detail)/\[projectId\]/modules/(detail)/header.tsx" || echo "No explicit ref assignment found"

# Let's also check how ModuleQuickActions uses parentRef in the component implementation
rg -A 5 "const { parentRef" "web/core/components/modules/quick-actions.tsx" || echo "parentRef usage not found in quick-actions.tsx"

Length of output: 596


Action Required: Attach the Parent Reference

After verifying the code in both the header file and the ModuleQuickActions component, it appears that the parentRef prop is passed correctly to the ModuleQuickActions component but is not being attached to any DOM element—neither in the header file nor within the component implementation.

  • Header File (web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx):
    The parentRef is passed as a prop but no DOM element has a ref={parentRef} assignment.

  • ModuleQuickActions Component (web/core/components/modules/quick-actions.tsx):
    A search for a parentRef assignment in the component did not reveal any explicit usage, indicating that the ref is not attached to any DOM element within this component.

Recommendation:
Either update the ModuleQuickActions component to assign parentRef to a relevant DOM element (e.g., a top-level <div ref={parentRef}>) if it is needed for functionality, or remove it from the props if it is no longer required.

</Header.RightItem>
</Header>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import { observer } from "mobx-react";
import Link from "next/link";
import { useParams } from "next/navigation";
import { FileText, Layers } from "lucide-react";
import { ArchiveIcon, Earth, FileText, Lock } from "lucide-react";
// types
import { ICustomSearchSelectOption } from "@plane/types";
import { EPageAccess } from "@plane/constants";
import { ICustomSearchSelectOption, TPage } from "@plane/types";
// ui
import { Breadcrumbs, Header, CustomSearchSelect } from "@plane/ui";
// components
Expand All @@ -19,6 +20,18 @@ import { PageDetailsHeaderExtraActions } from "@/plane-web/components/pages";
// plane web hooks
import { EPageStoreType, usePage, usePageStore } from "@/plane-web/hooks/store";

const PageAccessIcon = (page: TPage) => (
<div>
{page.archived_at ? (
<ArchiveIcon className="h-2.5 w-2.5 text-custom-text-300" />
) : page.access === EPageAccess.PUBLIC ? (
<Earth className="h-2.5 w-2.5 text-custom-text-300" />
) : (
<Lock className="h-2.5 w-2.5 text-custom-text-300" />
)}
</div>
);

export interface IPagesHeaderProps {
showButton?: boolean;
}
Expand Down Expand Up @@ -46,9 +59,12 @@ export const PageDetailsHeader = observer(() => {
value: _page.id,
query: _page.name,
content: (
<Link href={pageLink} className="flex gap-2 items-center justify-between">
<SwitcherLabel logo_props={_page.logo_props} name={_page.name} LabelIcon={Layers} />
</Link>
<div className="flex gap-2 items-center justify-between">
<Link href={pageLink} className="flex gap-2 items-center justify-between w-full">
<SwitcherLabel logo_props={_page.logo_props} name={_page.name} LabelIcon={FileText} />
</Link>
<PageAccessIcon {..._page} />
</div>
),
};
})
Expand Down Expand Up @@ -94,7 +110,7 @@ export const PageDetailsHeader = observer(() => {
<CustomSearchSelect
value={pageId}
options={switcherOptions}
label={<SwitcherLabel logo_props={page.logo_props} name={page.name} LabelIcon={Layers} />}
label={<SwitcherLabel logo_props={page.logo_props} name={page.name} LabelIcon={FileText} />}
onChange={() => {}}
/>
}
Expand Down