Skip to content
Draft
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
Expand Up @@ -3,7 +3,7 @@
import { PanelRightIcon, FileText, Network, RefreshCw, Link2 } from "lucide-react";

import { Button, Tabs, TabsList, TabsTrigger, TabsContent } from "@/lib/components/ui";
import { useTaskContext, useChatContext, useIsProjectIndexingEnabled } from "@/lib/hooks";
import { useTaskContext, useChatContext } from "@/lib/hooks";
import { FlowChartPanel, processTaskForVisualization } from "@/lib/components/activities";
import type { VisualizedTask } from "@/lib/types";
import { hasSourcesWithUrls, hasDocumentSearchResults } from "@/lib/utils";
Expand All @@ -23,7 +23,6 @@
export const ChatSidePanel: React.FC<ChatSidePanelProps> = ({ onCollapsedToggle, isSidePanelCollapsed, setIsSidePanelCollapsed, isSidePanelTransitioning }) => {
const { activeSidePanelTab, setActiveSidePanelTab, setPreviewArtifact, taskIdInSidePanel, ragData, ragEnabled } = useChatContext();
const { isReconnecting, isTaskMonitorConnecting, isTaskMonitorConnected, monitoredTasks, connectTaskMonitorStream, loadTaskFromBackend } = useTaskContext();
const isProjectIndexingEnabled = useIsProjectIndexingEnabled();
const [visualizedTask, setVisualizedTask] = useState<VisualizedTask | null>(null);
const [isLoadingTask, setIsLoadingTask] = useState<boolean>(false);

Expand Down Expand Up @@ -108,7 +107,7 @@
return () => {
// Don't clear immediately - only clear after a delay to allow for state updates
setTimeout(() => {
loadAttemptedRef.current.delete(taskIdInSidePanel);

Check warning on line 110 in client/webui/frontend/src/lib/components/chat/ChatSidePanel.tsx

View workflow job for this annotation

GitHub Actions / Build and Test UI

The ref value 'loadAttemptedRef.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'loadAttemptedRef.current' to a variable inside the effect, and use that variable in the cleanup function
}, 1000);
};
}
Expand Down Expand Up @@ -293,9 +292,7 @@

{hasSourcesInSession && (
<TabsContent value="rag" className="m-0 h-full">
<div className="h-full">
{isProjectIndexingEnabled && hasDocumentSearchResults(ragData) ? <DocumentSourcesPanel ragData={filteredRagData} enabled={ragEnabled} /> : <RAGInfoPanel ragData={filteredRagData} enabled={ragEnabled} />}
</div>
<div className="h-full">{hasDocumentSearchResults(ragData) ? <DocumentSourcesPanel ragData={filteredRagData} enabled={ragEnabled} /> : <RAGInfoPanel ragData={filteredRagData} enabled={ragEnabled} />}</div>
</TabsContent>
)}
</div>
Expand Down
1 change: 0 additions & 1 deletion client/webui/frontend/src/lib/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ export * from "./useTitleGeneration";
export * from "./useTitleAnimation";
export * from "./useIsProjectOwner";
export * from "./useIsProjectSharingEnabled";
export * from "./useIsProjectIndexingEnabled";
export * from "./useSSEContext";
export * from "./useIndexingSSE";
10 changes: 0 additions & 10 deletions client/webui/frontend/src/lib/hooks/useIsProjectIndexingEnabled.ts

This file was deleted.

31 changes: 3 additions & 28 deletions client/webui/frontend/src/stories/chat/ChatSidePanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { documentSearchRagData } from "../mocks/citations";

expect.extend(matchers);

describe("projectIndexing feature flag", () => {
describe("ChatSidePanel document sources", () => {
const chatContextWithRagData = {
activeSidePanelTab: "rag" as const,
ragData: documentSearchRagData,
Expand All @@ -25,35 +25,10 @@ describe("projectIndexing feature flag", () => {
loadTaskFromBackend: vi.fn().mockResolvedValue(null),
};

test("shows RAGInfoPanel when projectIndexing flag is disabled", async () => {
test("shows DocumentSourcesPanel when document search results are present", async () => {
render(
<MemoryRouter>
<StoryProvider
chatContextValues={chatContextWithRagData}
taskContextValues={taskContext}
configContextValues={{
configFeatureEnablement: { projectIndexing: false },
}}
>
<ChatSidePanel onCollapsedToggle={vi.fn()} isSidePanelCollapsed={false} setIsSidePanelCollapsed={vi.fn()} isSidePanelTransitioning={false} />
</StoryProvider>
</MemoryRouter>
);

expect(await screen.findByText(/6 Sources/)).toBeInTheDocument();
expect(screen.queryByText(/3 Documents/)).not.toBeInTheDocument();
});

test("shows DocumentSourcesPanel when projectIndexing flag is enabled", async () => {
render(
<MemoryRouter>
<StoryProvider
chatContextValues={chatContextWithRagData}
taskContextValues={taskContext}
configContextValues={{
configFeatureEnablement: { projectIndexing: true },
}}
>
<StoryProvider chatContextValues={chatContextWithRagData} taskContextValues={taskContext}>
<ChatSidePanel onCollapsedToggle={vi.fn()} isSidePanelCollapsed={false} setIsSidePanelCollapsed={vi.fn()} isSidePanelTransitioning={false} />
</StoryProvider>
</MemoryRouter>
Expand Down
5 changes: 0 additions & 5 deletions examples/gateways/webui_gateway_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ apps:
frontend_feature_enablement:
background_tasks: ${BACKGROUND_TASKS_ENABLED, true} # NOTE: task_logging must also be enabled for background tasks to work
auto_title_generation: ${AUTO_TITLE_GENERATION_ENABLED, true} # Enable automatic chat title generation
projectIndexing: ${PROJECT_FILE_INDEXING, false} # Enable citations

# --- Project File Indexing Configuration ---
project_indexing:
enabled: ${PROJECT_FILE_INDEXING, false}

# --- Background Tasks Configuration ---
background_tasks:
Expand Down
Loading
Loading