-
- {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