From ca0f8df4fecf49da66ac23d535e337ef2984143e Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:55:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8B=20fix:=20Drop=20the=20Agent=20Icon?= =?UTF-8?q?=20From=20the=20Greeting=20Welcome=20Heading=20(#18535)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Drop the Agent Icon From the Greeting Welcome Heading * docs: Describe the Greeting Heading Without Its Icon in the Example Config * test: Cover the Greeting Heading Without the Agent Icon in E2E Scenarios --- client/src/components/Chat/Landing.tsx | 66 +++++++------- .../__tests__/Landing.agent-contact.spec.tsx | 15 ++++ .../mock/scenarios/landing-greeting.spec.ts | 89 +++++++++++++++++-- librechat.example.yaml | 4 +- packages/data-provider/src/config.ts | 3 +- 5 files changed, 137 insertions(+), 40 deletions(-) diff --git a/client/src/components/Chat/Landing.tsx b/client/src/components/Chat/Landing.tsx index 9168d63d48..bd76744653 100644 --- a/client/src/components/Chat/Landing.tsx +++ b/client/src/components/Chat/Landing.tsx @@ -80,10 +80,10 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding: const brandedSpecLabel = modelSpec?.showOnLanding ? modelSpec.label : ''; const brandedSpecDescription = (modelSpec?.showOnLanding && modelSpec.description) || ''; - const name = - isTemporary || startupConfig?.interface?.landingHeading === 'greeting' - ? '' - : (entity?.name ?? brandedSpecLabel); + const isGreetingHeading = startupConfig?.interface?.landingHeading === 'greeting'; + /** Greeting mode drops the entity icon: the header selector already shows it. */ + const showIcon = isTemporary || !isGreetingHeading; + const name = isTemporary || isGreetingHeading ? '' : (entity?.name ?? brandedSpecLabel); const description = isTemporary ? localize('com_ui_temporary_description') : ((entity?.description || brandedSpecDescription || conversation?.greeting) ?? ''); @@ -169,35 +169,39 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding:
-
-
- {isTemporary ? ( -
-
- ) : ( - + {showIcon && ( +
+
+ {isTemporary ? ( +
+
+ ) : ( + + )} +
+ {startupConfig?.showBirthdayIcon && ( + + + )}
- {startupConfig?.showBirthdayIcon && ( - - - - )} -
+ )} {name ? (
{ expect(screen.getByText('Welcome')).toBeInTheDocument(); expect(screen.queryByText('Data Analyst')).not.toBeInTheDocument(); expect(screen.getByText('Answers SQL questions')).toBeInTheDocument(); + expect(screen.queryByTestId('convo-icon')).not.toBeInTheDocument(); + }); + + it('keeps the icon in the default entity heading', () => { + renderLanding(); + expect(screen.getByTestId('convo-icon')).toBeInTheDocument(); }); + it('keeps the temporary chat icon in greeting mode', () => { + mockInterfaceConfig = { landingHeading: 'greeting' }; + + const { container } = renderLanding({ isTemporary: true }); + + expect(screen.queryByTestId('convo-icon')).not.toBeInTheDocument(); + expect(container.querySelector('.avatar-stroke')).toBeInTheDocument(); + }); + it('uses the configured welcome as the greeting heading', () => { mockInterfaceConfig = { landingHeading: 'greeting', customWelcome: 'Hello there' }; diff --git a/e2e/specs/mock/scenarios/landing-greeting.spec.ts b/e2e/specs/mock/scenarios/landing-greeting.spec.ts index 4ca869e75a..19c8f6fb58 100644 --- a/e2e/specs/mock/scenarios/landing-greeting.spec.ts +++ b/e2e/specs/mock/scenarios/landing-greeting.spec.ts @@ -5,14 +5,19 @@ import { cleanupAgent, uniqueAgentName } from '../agents.helpers'; import { expect, test } from '../fixtures'; /** - * The welcome screen names the selected agent and carries the generic footer - * by default. A deployment can greet the user instead and drop that footer; - * the agent's icon and description stay either way. The footer is hidden + * The welcome screen names the selected agent, draws its icon beside the name, + * and carries the generic footer by default. A deployment can greet the user + * instead and drop that footer; the greeting then stands without the icon, which + * the header selector already shows, and the description stays either way. + * Temporary chat keeps its own mark under both headings. The footer is hidden * below `sm`, so this runs on the desktop viewport it describes. */ const DESCRIPTION = 'Landing heading acceptance fixture.'; const DISCLAIMER = 'Every AI for Everyone.'; +/** The round mark beside the heading, and the badge anchored to it when the birthday icon is on. */ +const HEADING_ICON = '.avatar-stroke'; +const BIRTHDAY_BADGE = "It's my 1st birthday!"; test.use({ viewport: { width: 1280, height: 800 } }); @@ -33,14 +38,19 @@ async function createAgent(page: Page, name: string) { }); } -/** Answers the startup config with the deployment's welcome screen settings. */ -async function serveInterface(page: Page, overrides: Record) { +/** Answers the startup config with the deployment's welcome screen settings, and any + * top-level setting beside them, such as the birthday icon. */ +async function serveInterface( + page: Page, + overrides: Record, + startup: Record = {}, +) { await page.route('**/api/config', async (route) => { const response = await route.fetch(); const config = await response.json(); await route.fulfill({ response, - json: { ...config, interface: { ...config.interface, ...overrides } }, + json: { ...config, ...startup, interface: { ...config.interface, ...overrides } }, }); }); } @@ -135,4 +145,71 @@ test.describe('welcome screen heading and footer', () => { await cleanupAgent(page, agentId); } }); + + test('the default heading keeps the agent icon and its birthday badge beside the name @scenario:landing-default-heading-keeps-the-agent-icon', async ({ + page, + }) => { + test.setTimeout(90000); + const name = uniqueAgentName('E2E Landing Icon Default'); + let agentId: string | undefined; + + try { + agentId = (await createAgent(page, name)).id; + await serveInterface(page, {}, { showBirthdayIcon: true }); + const main = await openAgentLanding(page, agentId); + + await expect(main.getByText(name, { exact: true }).last()).toBeVisible(); + await expect(main.locator(HEADING_ICON)).toHaveCount(1); + await expect(main.getByLabel(BIRTHDAY_BADGE)).toBeVisible(); + } finally { + await cleanupAgent(page, agentId); + } + }); + + test('an opted-in deployment greets the user without the agent icon or its birthday badge @scenario:landing-greeting-drops-the-agent-icon', async ({ + page, + }) => { + test.setTimeout(90000); + const name = uniqueAgentName('E2E Landing Icon Greeting'); + const welcome = 'Hello without the icon'; + let agentId: string | undefined; + + try { + agentId = (await createAgent(page, name)).id; + await serveInterface( + page, + { landingHeading: 'greeting', customWelcome: welcome }, + { showBirthdayIcon: true }, + ); + const main = await openAgentLanding(page, agentId); + + /** The description is already up and the greeting beside it, so the absences below are + * not a screen that has yet to draw. */ + await expect(main.getByText(welcome)).toBeVisible(); + await expect(main.locator(HEADING_ICON)).toHaveCount(0); + await expect(main.getByLabel(BIRTHDAY_BADGE)).toHaveCount(0); + } finally { + await cleanupAgent(page, agentId); + } + }); + + test('temporary chat keeps its incognito icon under the greeting heading @scenario:landing-greeting-keeps-the-temporary-chat-icon', async ({ + page, + }) => { + test.setTimeout(90000); + const welcome = 'Hello before the mode changes'; + await serveInterface(page, { landingHeading: 'greeting', customWelcome: welcome }); + await page.goto(NEW_CHAT_PATH, { timeout: 15000 }); + const main = page.locator('main'); + await expect(main.getByText(welcome)).toBeVisible({ timeout: 30000 }); + await expect(main.locator(HEADING_ICON)).toHaveCount(0); + + /** The chat route resets temporary mode on load, so it is turned on the way a user does. */ + const toggle = page.locator('button[aria-label="Temporary Chat"]'); + await toggle.click(); + await expect(toggle).toHaveAttribute('aria-pressed', 'true'); + + await expect(main.getByText('Temporary Chat', { exact: true }).first()).toBeVisible(); + await expect(main.locator(`${HEADING_ICON} svg.lucide-hat-glasses`)).toBeVisible(); + }); }); diff --git a/librechat.example.yaml b/librechat.example.yaml index b409b44110..93226d9843 100644 --- a/librechat.example.yaml +++ b/librechat.example.yaml @@ -218,8 +218,8 @@ projects: interface: customWelcome: 'Welcome to LibreChat! Enjoy your experience.' # What heads the welcome screen when an agent, assistant or model spec is selected (default: entity). - # 'entity' shows its name; 'greeting' shows the time-of-day greeting (or customWelcome) with the - # user's name, for deployments where the header selector already names the agent. + # 'entity' shows its name and icon; 'greeting' shows the time-of-day greeting (or customWelcome) with + # the user's name and no icon, for deployments where the header selector already shows the agent. # landingHeading: entity # Show the generic disclaimer and policy links on the welcome screen (default: true). # true places them at the bottom of the page, 'composer' directly under the composer, and false diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.ts index c8845ef7df..f0c4c0857b 100644 --- a/packages/data-provider/src/config.ts +++ b/packages/data-provider/src/config.ts @@ -3487,7 +3487,8 @@ export const interfaceSchema = z customWelcome: z.string().optional(), /** What heads the welcome screen when an agent, assistant or branded spec is * selected: its name (`entity`), or the time-of-day greeting with the user's - * name (`greeting`) for deployments whose header selector already names it. */ + * name (`greeting`) for deployments whose header selector already names it. + * Greeting mode also drops the agent or endpoint icon beside the heading. */ landingHeading: z.enum(['entity', 'greeting']).optional(), /** Shows the generic disclaimer and policy links on the welcome screen: at the bottom of the * page (`true`), directly under the composer (`composer`), or not at all (`false`). A