From 3c84e75350219aeb0089668aed1f910bb0018096 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 27 Nov 2025 20:53:42 +0530 Subject: [PATCH] [WEB-5510] fix: handle null values in context indicator for improved stability (#8190) --- .../power-k/hooks/use-extended-context-indicator.ts | 4 ++-- .../core/components/power-k/hooks/use-context-indicator.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts b/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts index ad5f43860..e92e54e2e 100644 --- a/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts +++ b/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts @@ -1,8 +1,8 @@ // local imports -import type { TPowerKContextTypeExtended } from "../types"; +import type { TPowerKContextType } from "@/components/power-k/core/types"; type TArgs = { - activeContext: TPowerKContextTypeExtended | null; + activeContext: TPowerKContextType | null; }; export const useExtendedContextIndicator = (_args: TArgs): string | null => null; diff --git a/apps/web/core/components/power-k/hooks/use-context-indicator.ts b/apps/web/core/components/power-k/hooks/use-context-indicator.ts index d598181bc..52699135a 100644 --- a/apps/web/core/components/power-k/hooks/use-context-indicator.ts +++ b/apps/web/core/components/power-k/hooks/use-context-indicator.ts @@ -6,7 +6,6 @@ import { useCycle } from "@/hooks/store/use-cycle"; import { useModule } from "@/hooks/store/use-module"; // plane web imports import { useExtendedContextIndicator } from "@/plane-web/components/command-palette/power-k/hooks/use-extended-context-indicator"; -import type { TPowerKContextTypeExtended } from "@/plane-web/components/command-palette/power-k/types"; import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store"; // local imports import type { TPowerKContextType } from "../core/types"; @@ -25,13 +24,13 @@ export const useContextIndicator = (args: TArgs): string | null => { const { getPageById } = usePageStore(EPageStoreType.PROJECT); // extended context indicator const extendedIndicator = useExtendedContextIndicator({ - activeContext: activeContext as TPowerKContextTypeExtended, + activeContext, }); let indicator: string | undefined | null = null; switch (activeContext) { case "work-item": { - indicator = workItemIdentifier.toString(); + indicator = workItemIdentifier ? workItemIdentifier.toString() : null; break; } case "cycle": {