{/* Header */}
diff --git a/frontend/src/app/knowledge/page.tsx b/frontend/src/app/knowledge/page.tsx
index 1b8b60ef..d5ef211c 100644
--- a/frontend/src/app/knowledge/page.tsx
+++ b/frontend/src/app/knowledge/page.tsx
@@ -11,6 +11,7 @@ import { KnowledgeDropdown } from "@/components/knowledge-dropdown";
import { ProtectedRoute } from "@/components/protected-route";
import { Button } from "@/components/ui/button";
import { useKnowledgeFilter } from "@/contexts/knowledge-filter-context";
+import { useLayout } from "@/contexts/layout-context";
import { useTask } from "@/contexts/task-context";
import { type File, useGetSearchQuery } from "../api/queries/useGetSearchQuery";
import "@/components/AgGrid/registerAgGridModules";
@@ -47,6 +48,7 @@ function getSourceIcon(connectorType?: string) {
function SearchPage() {
const router = useRouter();
const { isMenuOpen, files: taskFiles } = useTask();
+ const { totalTopOffset } = useLayout();
const { selectedFilter, setSelectedFilter, parsedFilterData, isPanelOpen } =
useKnowledgeFilter();
const [selectedRows, setSelectedRows] = useState
([]);
@@ -230,7 +232,7 @@ function SearchPage() {
return (
diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx
index 7a444a02..a6e22ffd 100644
--- a/frontend/src/app/settings/page.tsx
+++ b/frontend/src/app/settings/page.tsx
@@ -149,7 +149,7 @@ function KnowledgeSourcesPage() {
const [systemPrompt, setSystemPrompt] = useState
("");
const [chunkSize, setChunkSize] = useState(1024);
const [chunkOverlap, setChunkOverlap] = useState(50);
- const [tableStructure, setTableStructure] = useState(false);
+ const [tableStructure, setTableStructure] = useState(true);
const [ocr, setOcr] = useState(false);
const [pictureDescriptions, setPictureDescriptions] =
useState(false);
diff --git a/frontend/src/components/layout-wrapper.tsx b/frontend/src/components/layout-wrapper.tsx
index cb0794e0..79417654 100644
--- a/frontend/src/components/layout-wrapper.tsx
+++ b/frontend/src/components/layout-wrapper.tsx
@@ -7,6 +7,7 @@ import {
type ChatConversation,
} from "@/app/api/queries/useGetConversationsQuery";
import { useGetSettingsQuery } from "@/app/api/queries/useGetSettingsQuery";
+import { DoclingHealthBanner } from "@/components/docling-health-banner";
import { KnowledgeFilterPanel } from "@/components/knowledge-filter-panel";
import Logo from "@/components/logo/logo";
import { Navigation } from "@/components/navigation";
@@ -16,9 +17,11 @@ import { UserNav } from "@/components/user-nav";
import { useAuth } from "@/contexts/auth-context";
import { useChat } from "@/contexts/chat-context";
import { useKnowledgeFilter } from "@/contexts/knowledge-filter-context";
+import { LayoutProvider } from "@/contexts/layout-context";
// import { GitHubStarButton } from "@/components/github-star-button"
// import { DiscordLink } from "@/components/discord-link"
import { useTask } from "@/contexts/task-context";
+import { useDoclingHealthQuery } from "@/src/app/api/queries/useDoclingHealthQuery";
import { cn } from "@/lib/utils";
export function LayoutWrapper({ children }: { children: React.ReactNode }) {
@@ -35,6 +38,11 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
const { isLoading: isSettingsLoading, data: settings } = useGetSettingsQuery({
enabled: isAuthenticated || isNoAuthMode,
});
+ const {
+ data: health,
+ isLoading: isHealthLoading,
+ isError,
+ } = useDoclingHealthQuery();
// Only fetch conversations on chat page
const isOnChatPage = pathname === "/" || pathname === "/chat";
@@ -64,6 +72,17 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
task.status === "processing"
);
+ const isUnhealthy = health?.status === "unhealthy" || isError;
+ const isBannerVisible = !isHealthLoading && isUnhealthy;
+
+ // Dynamic height calculations based on banner visibility
+ const headerHeight = 53;
+ const bannerHeight = 52; // Approximate banner height
+ const totalTopOffset = isBannerVisible
+ ? headerHeight + bannerHeight
+ : headerHeight;
+ const mainContentHeight = `calc(100vh - ${totalTopOffset}px)`;
+
// Show loading state when backend isn't ready
if (isLoading || isSettingsLoading) {
return (
@@ -76,7 +95,7 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
);
}
- if (isAuthPage || (settings && !settings.edited)) {
+ if (isAuthPage) {
// For auth pages, render without navigation
return {children}
;
}
@@ -84,6 +103,7 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
// For all other pages, render with Langflow-styled navigation and task menu
return (
+
{/* Logo/Title */}
@@ -124,7 +144,10 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
-
+
-
- {children}
-
+
+ {children}
+
+
diff --git a/frontend/src/contexts/layout-context.tsx b/frontend/src/contexts/layout-context.tsx
new file mode 100644
index 00000000..f40ea28c
--- /dev/null
+++ b/frontend/src/contexts/layout-context.tsx
@@ -0,0 +1,34 @@
+"use client";
+
+import { createContext, useContext } from "react";
+
+interface LayoutContextType {
+ headerHeight: number;
+ totalTopOffset: number;
+}
+
+const LayoutContext = createContext
(undefined);
+
+export function useLayout() {
+ const context = useContext(LayoutContext);
+ if (context === undefined) {
+ throw new Error("useLayout must be used within a LayoutProvider");
+ }
+ return context;
+}
+
+export function LayoutProvider({
+ children,
+ headerHeight,
+ totalTopOffset
+}: {
+ children: React.ReactNode;
+ headerHeight: number;
+ totalTopOffset: number;
+}) {
+ return (
+
+ {children}
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/lib/constants.ts b/frontend/src/lib/constants.ts
index 8e7770fb..9ce34634 100644
--- a/frontend/src/lib/constants.ts
+++ b/frontend/src/lib/constants.ts
@@ -12,7 +12,7 @@ export const DEFAULT_AGENT_SETTINGS = {
export const DEFAULT_KNOWLEDGE_SETTINGS = {
chunk_size: 1000,
chunk_overlap: 200,
- table_structure: false,
+ table_structure: true,
ocr: false,
picture_descriptions: false
} as const;
diff --git a/src/config/config_manager.py b/src/config/config_manager.py
index da059d0d..93fb86c5 100644
--- a/src/config/config_manager.py
+++ b/src/config/config_manager.py
@@ -27,7 +27,7 @@ class KnowledgeConfig:
embedding_model: str = "text-embedding-3-small"
chunk_size: int = 1000
chunk_overlap: int = 200
- table_structure: bool = False
+ table_structure: bool = True
ocr: bool = False
picture_descriptions: bool = False