🪡 fix: Align the Subagent Panel With the Conversation's Footer

The panel's bottom band states that it matches the main composer's clearance so
the two surfaces end on one line beside each other. That clearance became
footer-dependent in the previous commit, and the panel kept a fixed `pb-4`, so a
deployment with a configured footer ended them 24px apart.

The panel reads the same answer the composer reads — `useConfiguredFooter` — and
clears the bar when there is one. Three consumers now share one source for the
question "does a footer render beneath this surface": `ChatView`, `ChatForm`
through `footerBelow`, and this panel.

The panel's own alignment has no browser scenario: reaching this surface needs
an agent with subagents, a dispatched task and an open control footer, which is
a fixture of its own. The shared cause is covered by
`configured-footer-clears-the-composer` on the main composer.

Reported by Codex on PR #15838:
https://github.com/danny-avila/LibreChat/pull/15838#discussion_r3993177163
This commit is contained in:
Marco Beretta 2026-09-11 22:48:12 +02:00
parent 1cd1942de7
commit 55106cd400
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
2 changed files with 12 additions and 6 deletions

View file

@ -70,6 +70,9 @@ jest.mock('librechat-data-provider', () => {
jest.mock('~/data-provider', () => ({ jest.mock('~/data-provider', () => ({
ACTIVE_THREAD_REFRESH_MS: 2000, ACTIVE_THREAD_REFRESH_MS: 2000,
/** The panel's bottom clearance follows the conversation's configured footer
* (`useConfiguredFooter`), so the panel now reads the startup config. */
useGetStartupConfig: () => ({ data: undefined }),
useSubagentThreadQuery: (...args: unknown[]) => mockUseSubagentThreadQuery(...args), useSubagentThreadQuery: (...args: unknown[]) => mockUseSubagentThreadQuery(...args),
subagentThreadHasTaskEvidence: (view: SubagentThreadView | undefined, taskId: string): boolean => subagentThreadHasTaskEvidence: (view: SubagentThreadView | undefined, taskId: string): boolean =>
view?.messages.some( view?.messages.some(

View file

@ -48,13 +48,14 @@ import SubagentActivity, { SubagentActivityScrollSurface } from './SubagentActiv
import ApprovalProvider from '~/components/Chat/Messages/Content/ApprovalContext'; import ApprovalProvider from '~/components/Chat/Messages/Content/ApprovalContext';
import { isMacPlatform, resolveComposerKeyDown } from '~/utils/shortcuts'; import { isMacPlatform, resolveComposerKeyDown } from '~/utils/shortcuts';
import { useFocusTrap, useLocalize, useNavigateToConvo } from '~/hooks'; import { useFocusTrap, useLocalize, useNavigateToConvo } from '~/hooks';
import { useConfiguredFooter } from '~/components/Chat/Footer';
import { useParentSubagents } from './ParentSubagentsProvider'; import { useParentSubagents } from './ParentSubagentsProvider';
import SubagentConversation from './SubagentConversation'; import SubagentConversation from './SubagentConversation';
import { eventSubagentSelection } from './eventSelection'; import { eventSubagentSelection } from './eventSelection';
import { resolveSubagentAgentId } from './identity'; import { resolveSubagentAgentId } from './identity';
import { useAgentsMapContext } from '~/Providers'; import { useAgentsMapContext } from '~/Providers';
import { isLiveSubagentStatus } from './status'; import { isLiveSubagentStatus } from './status';
import { renderAgentAvatar } from '~/utils'; import { cn, renderAgentAvatar } from '~/utils';
import { useChatSurface } from './surface'; import { useChatSurface } from './surface';
const EVENT_TASK_PAGE_SIZE = 3; const EVENT_TASK_PAGE_SIZE = 3;
@ -109,6 +110,7 @@ const failedControlLocaleKey = (reason?: string) => {
}; };
export default function SubagentThreadPanel({ selection }: { selection: ActiveSubagentPanel }) { export default function SubagentThreadPanel({ selection }: { selection: ActiveSubagentPanel }) {
const hasConfiguredFooter = useConfiguredFooter();
const localize = useLocalize(); const localize = useLocalize();
const panelStore = useStore(); const panelStore = useStore();
const { showToast } = useToastContext(); const { showToast } = useToastContext();
@ -1460,11 +1462,12 @@ export default function SubagentThreadPanel({ selection }: { selection: ActiveSu
{activityPanel} {activityPanel}
</ApprovalProvider> </ApprovalProvider>
{(showControlFooter || composerMode != null) && ( {(showControlFooter || composerMode != null) && (
/* The main chat form's own bottom rhythm: a started conversation carries /* The main chat form's own bottom rhythm, read from the same answer it
no disclaimer, so its composer keeps only enough clearance to show its reads (`useConfiguredFooter`): a conversation clears the footer bar
shadow, and this one keeps the same, so the two surfaces end on one when the deployment configured one and otherwise keeps only enough to
line when the panel is open beside the thread. */ show the composer's shadow, and this surface keeps the same, so the
<div className="shrink-0 px-3 pb-4 pt-2"> two end on one line when the panel is open beside the thread. */
<div className={cn('shrink-0 px-3 pt-2', hasConfiguredFooter ? 'pb-10' : 'pb-4')}>
{transientControl?.status === 'failed' && ( {transientControl?.status === 'failed' && (
<Alert variant="error" className="mb-2 flex items-center gap-2"> <Alert variant="error" className="mb-2 flex items-center gap-2">
<span className="min-w-0 flex-1"> <span className="min-w-0 flex-1">