diff --git a/api/server/experimental.js b/api/server/experimental.js index b17cd2e350..4807103983 100644 --- a/api/server/experimental.js +++ b/api/server/experimental.js @@ -543,6 +543,7 @@ if (cluster.isMaster) { so the answer is the deployment's base configuration, like index.js. */ indexHTML = injectConfiguredFooterBootstrap(indexHTML, { customFooter: process.env.CUSTOM_FOOTER, + landingFooter: baseAppConfig?.interfaceConfig?.landingFooter, }); indexHTML = injectColorModeHandoff(indexHTML, baseAppConfig?.interfaceConfig?.colorModeFromUrl); diff --git a/api/server/index.js b/api/server/index.js index fe1e723e4e..324d1ed4e9 100644 --- a/api/server/index.js +++ b/api/server/index.js @@ -301,6 +301,7 @@ const startServer = async () => { caller's and the client prefers it. */ indexHTML = injectConfiguredFooterBootstrap(indexHTML, { customFooter: process.env.CUSTOM_FOOTER, + landingFooter: appConfig?.interfaceConfig?.landingFooter, }); indexHTML = injectColorModeHandoff(indexHTML, appConfig.interfaceConfig?.colorModeFromUrl); diff --git a/client/src/common/types.ts b/client/src/common/types.ts index 8ddd11b6e7..5d44eb600a 100644 --- a/client/src/common/types.ts +++ b/client/src/common/types.ts @@ -692,6 +692,9 @@ declare global { /** Whether this deployment configured footer content of its own, so the * composer reserves the footer bar's band on its first frame. */ hasConfiguredFooter?: boolean; + /** The deployment's `interface.landingFooter`, so the welcome screen does + * not paint a footer the config is about to remove. */ + landingFooter?: boolean; }; } } diff --git a/client/src/components/Chat/ChatView.tsx b/client/src/components/Chat/ChatView.tsx index ead33f83d1..e867175bd5 100644 --- a/client/src/components/Chat/ChatView.tsx +++ b/client/src/components/Chat/ChatView.tsx @@ -24,6 +24,7 @@ import { useFileMapContext, ComposerRestoreProvider, } from '~/Providers'; +import Footer, { useLandingFooter, useConfiguredFooter } from './Footer'; import { QueuedTurnPortalProvider } from './Steering/QueuedTurnPortal'; import { useChatSettings } from '~/Providers/ChatSettingsContext'; import ApprovalProvider from './Messages/Content/ApprovalContext'; @@ -33,7 +34,6 @@ import ProjectBadge from '~/components/Projects/ProjectBadge'; import { composerLiftFamily } from './Input/Composer/state'; import { OwnerTextProvider } from './Messages/PrivateText'; import { useGetMessagesByConvoId } from '~/data-provider'; -import Footer, { useConfiguredFooter } from './Footer'; import { AskAnswerHostProvider } from './ask/state'; import MessagesView from './Messages/MessagesView'; import Presentation from './Presentation'; @@ -86,6 +86,7 @@ function ChatView({ * composer's clearance has to account for the bar when it does — including * before the config answers, so a cold load does not jump. */ const configuredFooter = useConfiguredFooter(); + const landingFooter = useLandingFooter(); /** Room an open composer popover needs below the composer; see the atom. */ const composerLift = useAtomValue(composerLiftFamily(index)); @@ -149,11 +150,10 @@ function ChatView({ (!messagesTree || messagesTree.length === 0) && (conversationId === Constants.NEW_CONVO || !conversationId); - /** A footer bar renders beneath the composer on the welcome screen always, and - * in a conversation when the deployment configured one. The shell already - * carried that answer, so this is the same value before and after the config - * resolves. */ - const footerBelow = isLandingPage || configuredFooter; + /** The welcome screen carries the full footer unless the deployment turned it + * off; otherwise a footer bar renders only for configured content. */ + const fullFooter = isLandingPage && landingFooter; + const footerBelow = fullFooter || configuredFooter; const isNavigating = (!messagesTree || messagesTree.length === 0) && conversationId != null; const isProjectLandingPage = isLandingPage && project != null; @@ -280,7 +280,7 @@ function ChatView({ {/* The generic disclaimer and the policy links are the welcome screen's; a deployment's own footer stays with the conversation that always showed it. */} - {!isLandingPage && configuredFooter &&