Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🪄 feat: Adopt the Continue Icon, Artifact Timing, Avatar Border and Dropdown Intents Tailwind 3 Never Rendered (#16941)
Marco Berettab77b4cff1986
diff --git a/client/src/components/Artifacts/Artifacts.tsx b/client/src/components/Artifacts/Artifacts.tsxindex 39c6b94391..b0a46a0fec 100644--- a/client/src/components/Artifacts/Artifacts.tsx+++ b/client/src/components/Artifacts/Artifacts.tsx@@ -481,13 +481,14 @@ export default function Artifacts() {isFullscreen ? 'inset-0 rounded-none' : 'inset-x-0 bottom-0 rounded-t-[20px]',isVisible && !isClosing? 'translate-y-0 opacity-100'- : 'translate-y-full opacity-0 transition-all',- isDragging ? '' : 'transition-all duration-300',+ : 'translate-y-full opacity-0',+ !isDragging && 'transition-all',+ !isDragging && (isClosing ? 'duration-250' : 'duration-300'),): cn('h-full overflow-hidden shadow-2xl',isVisible && !isClosing- ? 'translate-x-0 opacity-100 transition-all duration-150'+ ? 'translate-x-0 opacity-100 transition-all duration-350': 'translate-x-5 opacity-0 transition-all duration-300',),)}diff --git a/client/src/components/Chat/Messages/HoverButtons.tsx b/client/src/components/Chat/Messages/HoverButtons.tsxindex 225daa9bf3..48f2291461 100644--- a/client/src/components/Chat/Messages/HoverButtons.tsx+++ b/client/src/components/Chat/Messages/HoverButtons.tsx@@ -284,7 +284,7 @@ const HoverButtons = ({<HoverButtononClick={(e) => e && handleContinue(e)}title={localize('com_ui_continue')}- icon={<ContinueIcon className="-rotate-180" />}+ icon={<ContinueIcon className="size-4.75" />}isLast={isLast}dataTestId={isLast ? 'continue-generation-button' : undefined}className="active"diff --git a/client/src/utils/agents.tsx b/client/src/utils/agents.tsxindex d15ad1013e..aff9d73bbf 100644--- a/client/src/utils/agents.tsx+++ b/client/src/utils/agents.tsx@@ -95,8 +95,7 @@ export const renderAgentAvatar = (xl: 'h-10 w-10',};- // Tailwind v3 never generated border-1, so avatars have never painted a border; deliberate width belongs in a follow-up.- const borderClasses = showBorder ? 'border-border-medium' : '';+ const borderClasses = showBorder ? 'border border-border-medium' : '';if (avatarUrl) {return (diff --git a/e2e/specs/mock/scenarios/adopted-intents.spec.ts b/e2e/specs/mock/scenarios/adopted-intents.spec.tsnew file mode 100644index 0000000000..c7b37adff7--- /dev/null+++ b/e2e/specs/mock/scenarios/adopted-intents.spec.ts@@ -0,0 +1,222 @@+import { randomUUID } from 'node:crypto';+import { expect, test } from '@playwright/test';+import type { Page } from '@playwright/test';+import { getE2EUser } from '../../../setup/user';+import {+ deleteConversations,+ deleteMessagesByConversation,+ seedConversations,+ seedMessages,+} from '../db';+import type { SeedMessage } from '../db';+import type { AgentDetail } from '../agents.helpers';+import { uniqueAgentName } from '../agents.helpers';+import { MOCK_ENDPOINTS, fetchJson, getAccessToken, messagesView, requestJson } from '../helpers';++/**+ * Classes Tailwind 3 never generated, adopted now that Tailwind 4 renders them: the continue+ * action's 19px glyph, the artifact panel's open and close timings, and the agent avatar's ring.+ */+const userEmail = getE2EUser().email;+const ROOT_PARENT = '00000000-0000-0000-0000-000000000000';+const ARTIFACT_TEXT = [+ ':::artifact{identifier="e2e-timing" type="text/html" title="timing.html"}',+ '<main><h1>Timing</h1></main>',+ ':::',+].join('\n');++async function seedThread(title: string, messages: SeedMessage[]) {+ const conversationId = randomUUID();+ await seedConversations(userEmail, [{ conversationId, title, updatedAt: new Date() }]);+ await seedMessages(userEmail, conversationId, messages);+ return conversationId;+}++async function cleanup(conversationId: string) {+ await deleteMessagesByConversation([conversationId]);+ await deleteConversations([conversationId]);+}++async function openArtifact(page: Page, title: string) {+ const conversationId = await seedThread(title, [+ {+ messageId: randomUUID(),+ parentMessageId: ROOT_PARENT,+ text: ARTIFACT_TEXT,+ isCreatedByUser: false,+ sender: 'Assistant',+ model: 'mock-model-a',+ },+ ]);+ await page.goto(`/c/${conversationId}`, { timeout: 15000 });+ const trigger = messagesView(page).locator('[data-artifact-trigger]').first();+ await expect(trigger).toBeVisible();+ await trigger.click();+ const panel = page.locator('#artifact-viewer');+ await expect(panel).toBeVisible();+ return { conversationId, panel };+}++test.describe('continue action', () => {+ test.use({ viewport: { width: 1280, height: 800 }, isMobile: false, hasTouch: false });++ test('the continue action draws its glyph at the size of the actions beside it @scenario:continue-icon-matches-hover-row', async ({+ page,+ }) => {+ const userMessageId = randomUUID();+ const answerId = randomUUID();+ const conversationId = await seedThread('Continue icon', [+ {+ messageId: userMessageId,+ parentMessageId: ROOT_PARENT,+ text: 'Write a long answer',+ isCreatedByUser: true,+ sender: 'User',+ },+ {+ messageId: answerId,+ parentMessageId: userMessageId,+ text: 'A long answer that stopped at the token limit',+ isCreatedByUser: false,+ sender: 'OpenAI',+ finish_reason: 'length',+ },+ ]);+ try {+ await page.goto(`/c/${conversationId}`, { timeout: 15000 });+ const row = page.locator(`[id="${answerId}"]`);+ await expect(row).toBeVisible();+ await row.hover();++ const glyph = page.getByTestId('continue-generation-button').locator('svg');+ const copy = row.getByTestId('copy-response-button').locator('svg').first();+ await expect(glyph).toBeVisible();+ await expect(copy).toBeVisible();+ const [glyphBox, copyBox] = await Promise.all([glyph.boundingBox(), copy.boundingBox()]);+ expect(glyphBox?.width).toBeCloseTo(19, 0);+ expect(glyphBox?.height).toBeCloseTo(19, 0);+ expect(glyphBox?.width).toBeCloseTo(copyBox?.width ?? 0, 0);+ } finally {+ await cleanup(conversationId);+ }+ });+});++test.describe('artifact panel on desktop', () => {+ test.use({ viewport: { width: 1280, height: 800 }, isMobile: false, hasTouch: false });++ test('the docked artifact panel slides in over 350ms @scenario:artifact-panel-desktop-open-timing', async ({+ page,+ }) => {+ const { conversationId, panel } = await openArtifact(page, 'Artifact desktop timing');+ try {+ await expect(panel).toHaveAttribute('role', 'region');+ await expect+ .poll(() => panel.evaluate((node) => getComputedStyle(node).transitionDuration))+ .toBe('0.35s');+ } finally {+ await cleanup(conversationId);+ }+ });+});++test.describe('artifact sheet on mobile', () => {+ test.use({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true });++ test('the artifact sheet slides away within the 250ms its close waits for @scenario:artifact-sheet-mobile-close-timing', async ({+ page,+ }) => {+ const { conversationId, panel } = await openArtifact(page, 'Artifact mobile timing');+ try {+ await expect(panel).toHaveAttribute('role', 'dialog');+ await expect+ .poll(() => panel.evaluate((node) => getComputedStyle(node).transitionDuration))+ .toBe('0.3s');++ await panel.evaluate((node) => {+ const record = window as unknown as { closingDuration?: string };+ const observer = new MutationObserver(() => {+ if (node.className.includes('translate-y-full') && record.closingDuration == null) {+ record.closingDuration = getComputedStyle(node).transitionDuration;+ observer.disconnect();+ }+ });+ observer.observe(node, { attributes: true, attributeFilter: ['class'] });+ });+ await panel.getByRole('button', { name: 'Close', exact: true }).click();+ await expect(panel).toBeHidden();+ expect(+ await page.evaluate(+ () => (window as unknown as { closingDuration?: string }).closingDuration,+ ),+ ).toBe('0.25s');+ } finally {+ await cleanup(conversationId);+ }+ });+});++test.describe('agent avatar', () => {+ test.use({ viewport: { width: 1280, height: 800 }, isMobile: false, hasTouch: false });++ test('a favorite agent with a picture is framed by a 1px medium border @scenario:agent-avatar-border', async ({+ page,+ }) => {+ await page.goto('/c/new', { timeout: 15000 });+ const token = await getAccessToken(page);+ const avatar =+ 'data:image/svg+xml;utf8,' ++ encodeURIComponent(+ '<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><rect width="40" height="40" fill="#ffffff"/></svg>',+ );+ const agent = await requestJson<AgentDetail>(page, {+ path: '/api/agents',+ token,+ method: 'POST',+ body: {+ name: uniqueAgentName('Avatar border'),+ instructions: 'Avatar border scenario.',+ provider: MOCK_ENDPOINTS[0].label,+ model: MOCK_ENDPOINTS[0].model,+ model_parameters: {},+ avatar: { filepath: avatar, source: 'local' },+ },+ });+ const original = await fetchJson<Array<Record<string, unknown>>>(+ page,+ '/api/user/settings/favorites',+ token,+ );+ try {+ await requestJson(page, {+ path: '/api/user/settings/favorites',+ token,+ method: 'POST',+ body: { favorites: [{ agentId: agent.id }, ...original].slice(0, 50) },+ });+ await page.reload();++ const image = page.getByRole('img', { name: `${agent.name} avatar` }).first();+ await expect(image).toBeVisible({ timeout: 15000 });+ const style = await image.evaluate((node) => {+ const computed = getComputedStyle(node);+ const probe = document.createElement('div');+ probe.className = 'border-border-medium border';+ document.body.appendChild(probe);+ const expected = getComputedStyle(probe).borderTopColor;+ probe.remove();+ return { width: computed.borderTopWidth, color: computed.borderTopColor, expected };+ });+ expect(style.width).toBe('1px');+ expect(style.color).toBe(style.expected);+ } finally {+ await requestJson(page, {+ path: '/api/user/settings/favorites',+ token,+ method: 'POST',+ body: { favorites: original },+ });+ await requestJson(page, { path: `/api/agents/${agent.id}`, token, method: 'DELETE' });+ }+ });+});diff --git a/e2e/specs/mock/scenarios/v4-rendering.spec.ts b/e2e/specs/mock/scenarios/v4-rendering.spec.tsindex e121359bef..003f992e21 100644--- a/e2e/specs/mock/scenarios/v4-rendering.spec.ts+++ b/e2e/specs/mock/scenarios/v4-rendering.spec.ts@@ -341,16 +341,8 @@ test.describe('Tailwind v4 rendering', () => {try {await openArtifactPanel(page, conversationId);- const panel = await computedStyles(page.locator('#artifact-viewer'), ['transitionDuration']);- const transitionMs = panel.transitionDuration.endsWith('ms')- ? Number.parseFloat(panel.transitionDuration)- : Number.parseFloat(panel.transitionDuration) * 1000;- expect(transitionMs).toBe(150);-const forbidden = await page.evaluate(() => {const tokens = [- 'duration-250',- 'duration-350','h-19','w-19','w-30',diff --git a/packages/client/src/components/DropdownMenu.tsx b/packages/client/src/components/DropdownMenu.tsxindex 4bcf059e1b..e77f3e2a10 100644--- a/packages/client/src/components/DropdownMenu.tsx+++ b/packages/client/src/components/DropdownMenu.tsx@@ -37,7 +37,7 @@ function DropdownMenuContent({sideOffset={sideOffset}style={{ zIndex, ...style }}className={cn(- 'border-border-medium bg-surface-primary text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',+ 'border-border-medium bg-surface-primary text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',className,)}{...props}@@ -67,7 +67,7 @@ function DropdownMenuItem({data-inset={inset}data-variant={variant}className={cn(- "focus:bg-surface-hover focus:text-text-primary data-[variant=destructive]:text-text-destructive data-[variant=destructive]:focus:bg-status-error-subtle data-[variant=destructive]:focus:text-text-destructive [&_svg:not([class*='text-'])]:text-text-secondary relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "focus:bg-surface-hover focus:text-text-primary data-[variant=destructive]:text-text-destructive data-[variant=destructive]:focus:bg-status-error-subtle data-[variant=destructive]:focus:text-text-destructive [&_svg:not([class*='text-'])]:text-text-secondary data-[variant=destructive]:*:[svg]:text-text-destructive! relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",disabledInkClasses,className,)}@@ -215,7 +215,7 @@ function DropdownMenuSubContent({data-slot="dropdown-menu-sub-content"style={{ zIndex, ...style }}className={cn(- 'border-border-medium bg-surface-primary text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg',+ 'border-border-medium bg-surface-primary text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg',className,)}{...props}