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
🟣 style: Show Merged Pull Requests in Purple (#16882)
Marco Berettad6be46f59156
diff --git a/client/src/components/Chat/PullRequest/Card.tsx b/client/src/components/Chat/PullRequest/Card.tsxindex 08f2d3e799..5d45279a9e 100644--- a/client/src/components/Chat/PullRequest/Card.tsx+++ b/client/src/components/Chat/PullRequest/Card.tsx@@ -26,7 +26,7 @@ function PullRequestCard({return (<div className="flex flex-col gap-3 p-3" data-testid="pull-request-card">- <div className="flex items-center gap-2">+ <div className="flex items-center gap-2.25"><PullRequestIcon icon={view.icon} tone={view.iconTone} className="size-4 shrink-0" /><span className="text-text-primary text-sm font-medium">{localize('com_ui_pr_label', { 0: pullRequest.number })}diff --git a/client/src/components/Chat/PullRequest/Chip.tsx b/client/src/components/Chat/PullRequest/Chip.tsxindex ca0de7ebf7..3096da1301 100644--- a/client/src/components/Chat/PullRequest/Chip.tsx+++ b/client/src/components/Chat/PullRequest/Chip.tsx@@ -42,7 +42,7 @@ function PullRequestChip({ conversationId }: { conversationId: string }) {aria-expanded={open}data-testid="header-pull-request-button"onFocus={() => hovercard.show()}- className="border-border-light bg-presentation text-text-primary hover:bg-surface-tertiary aria-expanded:bg-surface-tertiary inline-flex h-9 max-w-[14rem] min-w-0 flex-shrink items-center gap-1.5 rounded-xl border px-2 text-sm transition-all ease-in-out"+ className="border-border-light bg-presentation text-text-primary hover:bg-surface-tertiary aria-expanded:bg-surface-tertiary inline-flex h-9 max-w-[14rem] min-w-0 flex-shrink items-center gap-1.75 rounded-xl border px-2 text-sm transition-all ease-in-out"><span className="relative flex shrink-0 items-center"><PullRequestIcon icon={view.icon} tone={view.iconTone} className="size-4 shrink-0" />diff --git a/client/src/components/Chat/PullRequest/__tests__/status.test.ts b/client/src/components/Chat/PullRequest/__tests__/status.test.tsindex ea613cf5ee..c037d79f3c 100644--- a/client/src/components/Chat/PullRequest/__tests__/status.test.ts+++ b/client/src/components/Chat/PullRequest/__tests__/status.test.ts@@ -54,18 +54,24 @@ describe('presentPullRequest', () => {});});- it.each([- ['merged', 'merged', 'com_ui_pr_state_merged'],- ['closed', 'closed', 'com_ui_pr_state_closed'],- ] as const)('shows a %s pull request with its own icon', (state, icon, stateKey) => {- expect(presentPullRequest(make({ state, mergeable: 'unknown' }))).toMatchObject({- icon,+ it('shows a closed pull request with its own icon', () => {+ expect(presentPullRequest(make({ state: 'closed', mergeable: 'unknown' }))).toMatchObject({+ icon: 'closed',iconTone: 'neutral',- stateKey,+ stateKey: 'com_ui_pr_state_closed',stateTone: 'neutral',});});+ it('shows a merged pull request with the merged icon in the purple tone', () => {+ expect(presentPullRequest(make({ state: 'merged', mergeable: 'unknown' }))).toMatchObject({+ icon: 'merged',+ iconTone: 'merged',+ stateKey: 'com_ui_pr_state_merged',+ stateTone: 'merged',+ });+ });+it.each([['passing', 'success', 'success'],['failing', 'error', 'error'],diff --git a/client/src/components/Chat/PullRequest/status.ts b/client/src/components/Chat/PullRequest/status.tsindex c8eccb1fcc..9205b20bf8 100644--- a/client/src/components/Chat/PullRequest/status.ts+++ b/client/src/components/Chat/PullRequest/status.ts@@ -1,7 +1,7 @@import type { TConversationPullRequest } from 'librechat-data-provider';import type { TranslationKeys } from '~/hooks/useLocalize';-export type PullRequestTone = 'success' | 'error' | 'warning' | 'neutral';+export type PullRequestTone = 'success' | 'error' | 'warning' | 'neutral' | 'merged';export type PullRequestIcon = 'open' | 'draft' | 'merged' | 'closed';@@ -33,9 +33,9 @@ function stateOf(if (pr.state === 'merged') {return {icon: 'merged',- iconTone: 'neutral',+ iconTone: 'merged',stateKey: 'com_ui_pr_state_merged',- stateTone: 'neutral',+ stateTone: 'merged',};}if (pr.state === 'closed') {@@ -86,6 +86,7 @@ export const TONE_ICON_CLASS: Record<PullRequestTone, string> = {error: 'text-status-error',warning: 'text-status-warning',neutral: 'text-text-secondary',+ merged: 'text-brand-purple',};export const TONE_DOT_CLASS: Record<PullRequestTone, string> = {@@ -93,4 +94,5 @@ export const TONE_DOT_CLASS: Record<PullRequestTone, string> = {error: 'bg-status-error',warning: 'bg-status-warning',neutral: 'bg-status-neutral',+ merged: 'bg-brand-purple',};diff --git a/packages/client/src/components/Chip.spec.tsx b/packages/client/src/components/Chip.spec.tsxindex efde0a64ed..3484d9dcd6 100644--- a/packages/client/src/components/Chip.spec.tsx+++ b/packages/client/src/components/Chip.spec.tsx@@ -22,6 +22,19 @@ describe('Chip', () => {);});+ it('renders the merged tone as purple text on the plain surface', () => {+ render(<Chip tone="merged">Merged</Chip>);++ const chip = screen.getByText('Merged').parentElement;+ expect(chip).toHaveClass('text-brand-purple', 'bg-transparent');+ });++ it('does not tint the merged tone, which would drop its dark-theme text contrast below 4.5:1', () => {+ render(<Chip tone="merged">Merged</Chip>);++ expect(screen.getByText('Merged').parentElement?.className).not.toMatch(/bg-brand-purple/);+ });+it('stops propagation and calls the remove handler', () => {const onRemove = jest.fn();const onParentClick = jest.fn();diff --git a/packages/client/src/components/Chip.tsx b/packages/client/src/components/Chip.tsxindex 1b0b566d4e..cf649c183c 100644--- a/packages/client/src/components/Chip.tsx+++ b/packages/client/src/components/Chip.tsx@@ -6,7 +6,7 @@ import { IconButton } from './IconButton';import { cn } from '~/utils';type ChipVariantProps = {- tone?: 'surface' | 'neutral' | 'info' | 'success' | 'warning' | 'error' | null;+ tone?: 'surface' | 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'merged' | null;size?: 'sm' | 'md' | 'theme' | null;shape?: 'round' | 'theme' | null;};@@ -22,6 +22,7 @@ const chipVariants: (props?: ChipVariantProps & ClassProp) => string = cva(success: 'border-status-success-border bg-status-success-subtle text-status-success',warning: 'border-status-warning-border bg-status-warning-subtle text-status-warning',error: 'border-status-error-border bg-status-error-subtle text-status-error',+ merged: 'border-brand-purple/40 bg-transparent text-brand-purple',},size: {sm: 'min-h-6 px-2 py-0.5',