From 1cd1942de7a29f81060cb24be23b09338d9d8d45 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Fri, 11 Sep 2026 22:27:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B7=20fix:=20Clear=20the=20Configured?= =?UTF-8?q?=20Footer=20and=20Remeasure=20the=20Band=20on=20Contrast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two findings from the round on d942b7c, one invariant each. Keeping a configured footer in conversations left the composer reserving 16px above an absolutely positioned bar about 32px tall, so the bar painted over the composer's action row and would have taken its clicks. The clearance follows what actually renders beneath the composer now, not which page it is: `ChatView` reads `useConfiguredFooter` once and both decisions — whether to render the footer, and how much room to leave for it — come from that same answer. `ChatForm` takes `footerBelow` and keeps the welcome screen's rhythm for the welcome screen. The band is not a constant of the platform either: the contrast modes widen the app's own scrollbar to 0.75rem, and a reader can turn contrast on — or have the OS turn it on — while the welcome screen is the only thing mounted, with no message column to republish. The seed remeasures when `ThemeProvider` flips a class on the document element, which is the thing that changed the band. Two scenarios, both failing before the fixes: - `configured-footer-clears-the-composer`: with `customFooter` configured, the bar sits at or below the composer's bottom edge and the composer still takes a click at its own bottom row. - `composer-holds-position-across-a-contrast-switch`: contrast turned on while the welcome screen is up, then a conversation opened; the composer keeps its left edge and width. Findings: https://github.com/danny-avila/LibreChat/pull/15838#discussion_r3992984510 https://github.com/danny-avila/LibreChat/pull/15838#discussion_r3992984517 --- client/src/components/Chat/ChatView.tsx | 9 +- client/src/components/Chat/Footer.tsx | 17 +++ client/src/components/Chat/Input/ChatForm.tsx | 23 +++- .../__tests__/ChatForm.attachments.spec.tsx | 2 +- .../__tests__/ChatForm.pasteUpload.spec.tsx | 2 +- .../Chat/__tests__/ChatView.spec.tsx | 6 +- .../Chat/__tests__/ChatView.subagent.spec.tsx | 6 +- .../src/hooks/Messages/useScrollbarGutter.ts | 49 +++++--- .../configured-footer-clearance.spec.ts | 68 ++++++++++++ .../contrast-switch-position.spec.ts | 105 ++++++++++++++++++ 10 files changed, 264 insertions(+), 23 deletions(-) create mode 100644 e2e/specs/mock/scenarios/configured-footer-clearance.spec.ts create mode 100644 e2e/specs/mock/scenarios/contrast-switch-position.spec.ts diff --git a/client/src/components/Chat/ChatView.tsx b/client/src/components/Chat/ChatView.tsx index a96c5bae2a..140bdcd6dd 100644 --- a/client/src/components/Chat/ChatView.tsx +++ b/client/src/components/Chat/ChatView.tsx @@ -21,13 +21,13 @@ import ApprovalProvider from './Messages/Content/ApprovalContext'; import ConversationStarters from './Input/ConversationStarters'; import { pendingApprovalActionFamily } from './approval/state'; import { useGetMessagesByConvoId } from '~/data-provider'; +import Footer, { useConfiguredFooter } from './Footer'; import { AskAnswerHostProvider } from './ask/state'; import MessagesView from './Messages/MessagesView'; import Presentation from './Presentation'; import ChatForm from './Input/ChatForm'; import Landing from './Landing'; import Header from './Header'; -import Footer from './Footer'; import { cn } from '~/utils'; import store from '~/store'; @@ -56,6 +56,10 @@ function ChatView({ index = 0, project }: { index?: number; project?: TChatProje * column exists to measure it (see the column's class list below). */ useScrollbarGutterSeed(); + /** A conversation carries a footer only for configured content, and the + * composer's clearance has to account for the bar when it does. */ + const hasConfiguredFooter = useConfiguredFooter(); + const methods = useForm({ defaultValues: { text: '' }, }); @@ -195,12 +199,13 @@ function ChatView({ index = 0, project }: { index?: number; project?: TChatProje placeholder={chatFormPlaceholder} project={isProjectLandingPage ? project : undefined} isLandingPage={isLandingPage} + footerBelow={isLandingPage || hasConfiguredFooter} /> )} {/* The generic disclaimer is the welcome screen's; a deployment's own footer, privacy policy and terms stay with the conversation that always showed them. */} - {!isLandingPage &&