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: Give Media Overlays Their Own Theme Roles (#16596)
Marco Beretta8b9c9a7728ad
diff --git a/client/src/components/Chat/Input/Files/DragDropOverlay.tsx b/client/src/components/Chat/Input/Files/DragDropOverlay.tsxindex 43700206c3..6b568857c5 100644--- a/client/src/components/Chat/Input/Files/DragDropOverlay.tsx+++ b/client/src/components/Chat/Input/Files/DragDropOverlay.tsx@@ -9,22 +9,18 @@ const DragDropOverlay = memo(({ isActive }: DragDropOverlayProps) => {const localize = useLocalize();return (<>- {/** Modal backdrop overlay */}+ {/** Modal backdrop overlay: black at 40% in both modes, so the media role, not the page scrim */}<div- className={`fixed inset-0 z-[9998] transition-opacity duration-200 ease-in-out ${+ className={`bg-surface-media-overlay/40 fixed inset-0 z-[9998] transition-opacity duration-200 ease-in-out ${isActive? 'pointer-events-auto visible opacity-100': 'pointer-events-none invisible opacity-0'} `}- style={{- /** Semi-transparent black overlay that works in both themes */- backgroundColor: 'rgba(0, 0, 0, 0.4)',- willChange: 'opacity',- }}+ style={{ willChange: 'opacity' }}/>{/** Main content overlay */}<div- className={`fixed inset-0 z-[9999] flex flex-col items-center justify-center gap-2 text-text-primary transition-all duration-200 ease-in-out ${+ className={`text-text-primary fixed inset-0 z-[9999] flex flex-col items-center justify-center gap-2 transition-all duration-200 ease-in-out ${isActive? 'pointer-events-auto visible opacity-100': 'pointer-events-none invisible opacity-0'@@ -36,7 +32,7 @@ const DragDropOverlay = memo(({ isActive }: DragDropOverlayProps) => {}}>{/** Content area with subtle background */}- <div className="flex flex-col items-center rounded-lg bg-surface-primary p-8 shadow-xl">+ <div className="bg-surface-primary flex flex-col items-center rounded-lg p-8 shadow-xl"><svgxmlns="http://www.w3.org/2000/svg"viewBox="0 0 132 108"@@ -90,7 +86,7 @@ const DragDropOverlay = memo(({ isActive }: DragDropOverlayProps) => {</defs></svg><h3 className="mt-4 text-lg font-semibold">{localize('com_ui_upload_files')}</h3>- <h4 className="text-sm text-text-secondary">{localize('com_ui_drag_drop')}</h4>+ <h4 className="text-text-secondary text-sm">{localize('com_ui_drag_drop')}</h4></div></div></>diff --git a/client/src/components/Chat/Input/Files/ImagePreview.tsx b/client/src/components/Chat/Input/Files/ImagePreview.tsxindex 8a3c947330..5241048242 100644--- a/client/src/components/Chat/Input/Files/ImagePreview.tsx+++ b/client/src/components/Chat/Input/Files/ImagePreview.tsx@@ -148,13 +148,13 @@ const ImagePreview = ({<divclassName={cn('absolute inset-0 flex transform-gpu cursor-pointer items-center justify-center rounded-xl transition-opacity duration-200 ease-in-out',- showExpandAffordance ? 'bg-black/20 opacity-100' : 'opacity-0',+ showExpandAffordance ? 'bg-surface-media-overlay/20 opacity-100' : 'opacity-0',)}aria-hidden="true"><Maximize2className={cn(- 'size-5 transform-gpu text-white drop-shadow-lg transition-all duration-200',+ 'text-text-on-media size-5 transform-gpu drop-shadow-lg transition-all duration-200',showExpandAffordance ? 'scale-110' : '',)}/>@@ -166,7 +166,7 @@ const ImagePreview = ({<DialogPrimitive.Root open={isModalOpen} onOpenChange={handleOpenChange}><DialogPrimitive.Portal><DialogPrimitive.Overlay- className="fixed inset-0 z-[250] bg-black/90"+ className="bg-surface-media-overlay/90 fixed inset-0 z-[250]"onClick={handleBackgroundClick}/><DialogPrimitive.Content@@ -186,9 +186,9 @@ const ImagePreview = ({<Buttonref={closeButtonRef}onClick={() => handleOpenChange(false)}- variant="ghost"+ variant="media"size="icon"- className="absolute top-4 right-4 z-20 text-white hover:bg-white/10"+ className="absolute top-4 right-4 z-20"aria-label={localize('com_ui_close')}><X className="size-5" aria-hidden="true" />diff --git a/client/src/components/Chat/Input/Files/ProgressCircle.tsx b/client/src/components/Chat/Input/Files/ProgressCircle.tsxindex 934bf06fbc..ac7e70e0e8 100644--- a/client/src/components/Chat/Input/Files/ProgressCircle.tsx+++ b/client/src/components/Chat/Input/Files/ProgressCircle.tsx@@ -8,10 +8,10 @@ export default function ProgressCircle({circleCSSProperties: React.CSSProperties;}) {return (- <div className="absolute inset-0 flex items-center justify-center bg-black/5 text-white">+ <div className="bg-surface-media-overlay/5 text-text-on-media absolute inset-0 flex items-center justify-center"><svg width="120" height="120" viewBox="0 0 120 120" className="h-6 w-6"><circle- className="origin-[50%_50%] -rotate-90 stroke-border-heavy"+ className="stroke-border-heavy origin-[50%_50%] -rotate-90"strokeWidth="10"fill="transparent"r="55"diff --git a/client/src/components/Chat/Input/Files/SourceIcon.tsx b/client/src/components/Chat/Input/Files/SourceIcon.tsxindex 63a8ef790b..b8ce8a1033 100644--- a/client/src/components/Chat/Input/Files/SourceIcon.tsx+++ b/client/src/components/Chat/Input/Files/SourceIcon.tsx@@ -12,7 +12,7 @@ const sourceToClassname = {[FileSources.openai]: 'bg-white/75 dark:bg-black/65',[FileSources.azure]: 'azure-bg-color',[FileSources.azure_blob]: 'azure-bg-color',- [FileSources.execute_code]: 'bg-black text-white opacity-85',+ [FileSources.execute_code]: 'bg-surface-media-overlay text-text-on-media opacity-85',/** Categorical rather than status: a source is an identity, so it takes a* series slot and the label ink that pairs with one. No alpha here, which* composited the fill back into the preview the badge sits on. */diff --git a/client/src/components/Chat/Messages/Content/DialogImage.tsx b/client/src/components/Chat/Messages/Content/DialogImage.tsxindex 2a9c69abf6..889b583ee7 100644--- a/client/src/components/Chat/Messages/Content/DialogImage.tsx+++ b/client/src/components/Chat/Messages/Content/DialogImage.tsx@@ -260,7 +260,7 @@ export default function DialogImage({<DialogPrimitive.Root open={isOpen} onOpenChange={onOpenChange}><DialogPrimitive.Portal><DialogPrimitive.Overlay- className="fixed inset-0 z-[250] bg-black/90"+ className="bg-surface-media-overlay/90 fixed inset-0 z-[250]"onClick={handleBackgroundClick}/><DialogPrimitive.Content@@ -287,8 +287,8 @@ export default function DialogImage({<Buttonref={closeButtonRef}onClick={() => onOpenChange(false)}- variant="ghost"- className="h-10 w-10 p-0 text-white hover:bg-white/10"+ variant="media"+ className="h-10 w-10 p-0"aria-label={localize('com_ui_close')}><X className="size-6" aria-hidden="true" />@@ -307,8 +307,8 @@ export default function DialogImage({render={<ButtononClick={resetZoom}- variant="ghost"- className="h-10 w-10 p-0 text-white hover:bg-white/10"+ variant="media"+ className="h-10 w-10 p-0"aria-label={localize('com_ui_reset_zoom')}><RotateCcw className="size-5" aria-hidden="true" />@@ -321,8 +321,8 @@ export default function DialogImage({render={<ButtononClick={() => downloadImage()}- variant="ghost"- className="h-10 w-10 p-0 text-white hover:bg-white/10"+ variant="media"+ className="h-10 w-10 p-0"aria-label={localize('com_ui_download')}><ArrowDownToLine className="size-5" aria-hidden="true" />@@ -335,8 +335,8 @@ export default function DialogImage({render={<ButtononClick={() => setIsPromptOpen(!isPromptOpen)}- variant="ghost"- className="h-10 w-10 p-0 text-white hover:bg-white/10"+ variant="media"+ className="h-10 w-10 p-0"aria-label={imageDetailsLabel}><MorphIcon@@ -391,7 +391,7 @@ export default function DialogImage({{showDetails && (<divdata-side-panel- className={`bg-surface-primary fixed top-0 right-0 z-30 h-full w-80 transform border-l border-white/10 shadow-2xl transition-transform duration-300 ${+ className={`bg-surface-primary border-text-on-media/10 fixed top-0 right-0 z-30 h-full w-80 transform border-l shadow-2xl transition-transform duration-300 ${isPromptOpen ? 'translate-x-0' : 'translate-x-full'}`}onClick={(e) => e.stopPropagation()}diff --git a/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx b/client/src/components/Chat/Messages/Content/Parts/BashCall.tsxindex 2d703317f5..3206feb18b 100644--- a/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx@@ -213,7 +213,7 @@ export default function BashCall({{command && (// The command is a code surface, so it takes the role every other one takes// (`DiffView`, the user-turn code bars) instead of a palette shade a theme- // cannot reach: the previous `dark:bg-gray-950` was Tailwind's blue-black,+ // cannot reach: the previous dark-only gray-950 fill was Tailwind's blue-black,// outside this palette entirely.<div className="bg-surface-code relative"><CopyButtondiff --git a/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx b/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsxindex 03a2393cee..5bb04238d6 100644--- a/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx@@ -200,7 +200,9 @@ export default function ExecuteCode({{hasOutput && backgroundHandle == null && (<divclassName={cn(- 'bg-surface-primary-alt p-4 text-xs dark:bg-transparent',+ /* No fill of its own: the output shows the panel's surface-secondary in both+ * modes, which is the surface-primary-alt it was painted in light. */+ 'p-4 text-xs',code && 'border-border-light border-t',)}>diff --git a/client/src/components/Chat/Messages/MinimalMessages.tsx b/client/src/components/Chat/Messages/MinimalMessages.tsxindex 11bd739881..059f0eaff6 100644--- a/client/src/components/Chat/Messages/MinimalMessages.tsx+++ b/client/src/components/Chat/Messages/MinimalMessages.tsx@@ -27,7 +27,7 @@ const MinimalMessages = React.forwardRef(><div className="flex flex-col pb-9 text-sm">{props.children}- <div className="group h-0 w-full shrink-0 dark:border-gray-800/50" />+ <div className="group h-0 w-full shrink-0" /></div></div></div>diff --git a/client/src/components/Insights/InsightsView.tsx b/client/src/components/Insights/InsightsView.tsxindex de4c230b12..19c82384d2 100644--- a/client/src/components/Insights/InsightsView.tsx+++ b/client/src/components/Insights/InsightsView.tsx@@ -113,11 +113,9 @@ function Panel({ children, className }: { children: React.ReactNode; className?:return (<sectionclassName={cn(- 'border-border-light bg-surface-primary min-w-0 rounded-lg border p-5',- /** Dark mode only: Click UI gives dashboard widgets their own surface and- * stroke, a step lighter than the page behind them. Light mode keeps the- * shared surface/border tokens. */- 'dark:border-chart-widget-stroke dark:bg-chart-widget-surface',+ /** Click UI gives dashboard widgets their own surface and stroke, a step lighter+ * than the page in dark mode; in light they match the page surface and light rule. */+ 'border-chart-widget-stroke bg-chart-widget-surface min-w-0 rounded-lg border p-5',className,)}>diff --git a/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx b/client/src/components/Nav/SettingsTabs/Account/Avatar.tsxindex 91a34f5a19..f9dc2b7362 100644--- a/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx+++ b/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx@@ -231,8 +231,8 @@ function Avatar() {/>{!isDragging && (<div className="pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity hover:opacity-100">- <div className="rounded-full bg-black/50 p-2">- <Move className="h-6 w-6 text-white" aria-hidden="true" />+ <div className="bg-surface-media-overlay/50 rounded-full p-2">+ <Move className="text-text-on-media h-6 w-6" aria-hidden="true" /></div></div>)}diff --git a/client/src/components/Share/MessagesView.tsx b/client/src/components/Share/MessagesView.tsxindex 2ccb002bf3..26edd760bc 100644--- a/client/src/components/Share/MessagesView.tsx+++ b/client/src/components/Share/MessagesView.tsx@@ -40,7 +40,7 @@ export default function MessagesView({</div></>)}- <div className="group h-0 w-full shrink-0 dark:border-gray-800/50" />+ <div className="group h-0 w-full shrink-0" /></div></div></div>diff --git a/client/src/components/SidePanel/Agents/Tools/ToolCard.tsx b/client/src/components/SidePanel/Agents/Tools/ToolCard.tsxindex 10a0273e69..2cc82e077f 100644--- a/client/src/components/SidePanel/Agents/Tools/ToolCard.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ToolCard.tsx@@ -56,7 +56,7 @@ function ItemIconView({ item, size }: ItemIconProps) {return (<spanclassName={cn(- 'flex shrink-0 items-center justify-center overflow-hidden bg-white',+ 'bg-surface-fixed flex shrink-0 items-center justify-center overflow-hidden',tileClasses,)}aria-hidden="true"diff --git a/client/src/components/SidePanel/Builder/AssistantAvatar.tsx b/client/src/components/SidePanel/Builder/AssistantAvatar.tsxindex 5441f34d95..69b8fc2bf3 100644--- a/client/src/components/SidePanel/Builder/AssistantAvatar.tsx+++ b/client/src/components/SidePanel/Builder/AssistantAvatar.tsx@@ -1,5 +1,4 @@import { useState, useEffect, useRef, useMemo } from 'react';-import * as Popover from '@radix-ui/react-popover';import { useToastContext } from '@librechat/client';import { useQueryClient } from '@tanstack/react-query';import {@@ -17,12 +16,16 @@ import type {} from 'librechat-data-provider';import type { UseMutationResult } from '@tanstack/react-query';import { useUploadAssistantAvatarMutation, useGetFileConfig } from '~/data-provider';-import { AssistantAvatar, NoImage, AvatarMenu } from './Images';+import { AvatarMenu } from '~/components/SidePanel/Agents/Images';import { useAssistantsMapContext } from '~/Providers';+import { AssistantAvatar, NoImage } from './Images';// import { Spinner } from '@librechat/client';import { useLocalize } from '~/hooks';import { formatBytes } from '~/utils';+/** Assistants have no avatar reset, so the shared menu only offers the upload. */+const noReset = () => undefined;+function Avatar({endpoint,version,@@ -39,7 +42,6 @@ function Avatar({// console.log('Avatar', assistant_id, metadata, createMutation);const queryClient = useQueryClient();const assistantsMap = useAssistantsMapContext();- const [menuOpen, setMenuOpen] = useState(false);const [progress, setProgress] = useState<number>(1);const [input, setInput] = useState<File | null>(null);const [previewUrl, setPreviewUrl] = useState<string | null>(null);@@ -179,7 +181,6 @@ function Avatar({}setInput(file);- setMenuOpen(false);if (!assistant_id) {// wait for successful form submission before uploading avatar@@ -205,14 +206,12 @@ function Avatar({status: 'error',});}-- setMenuOpen(false);};return (- <Popover.Root open={menuOpen} onOpenChange={setMenuOpen}>- <div className="flex w-full items-center justify-center gap-4">- <Popover.Trigger asChild>+ <div className="flex w-full items-center justify-center gap-4">+ <AvatarMenu+ trigger={<buttontype="button"className="h-20 w-20"@@ -220,10 +219,12 @@ function Avatar({>{previewUrl ? <AssistantAvatar url={previewUrl} progress={progress} /> : <NoImage />}</button>- </Popover.Trigger>- </div>- {<AvatarMenu handleFileChange={handleFileChange} />}- </Popover.Root>+ }+ handleFileChange={handleFileChange}+ onReset={noReset}+ canReset={false}+ />+ </div>);}diff --git a/client/src/components/SidePanel/Builder/Images.tsx b/client/src/components/SidePanel/Builder/Images.tsxindex 715cad5ae6..c81e1e14f6 100644--- a/client/src/components/SidePanel/Builder/Images.tsx+++ b/client/src/components/SidePanel/Builder/Images.tsx@@ -1,6 +1,4 @@-import { useRef } from 'react';-import * as Popover from '@radix-ui/react-popover';-import useLocalize from '~/hooks/useLocalize';+import ProgressCircle from '~/components/Chat/Input/Files/ProgressCircle';export function NoImage() {return (@@ -52,84 +50,13 @@ export const AssistantAvatar = ({style={{ opacity: progress < 1 ? 0.4 : 1 }}/>{progress < 1 && (- <div className="absolute inset-0 flex items-center justify-center bg-black/5 text-white">- <svg width="120" height="120" viewBox="0 0 120 120" className="h-6 w-6">- <circle- className="origin-[50%_50%] -rotate-90 stroke-gray-400"- strokeWidth="10"- fill="transparent"- r="55"- cx="60"- cy="60"- />- <circle- className="origin-[50%_50%] -rotate-90 transition-[stroke-dashoffset]"- stroke="currentColor"- strokeWidth="10"- strokeDasharray={`${circumference} ${circumference}`}- strokeDashoffset={offset}- fill="transparent"- r="55"- cx="60"- cy="60"- style={circleCSSProperties}- />- </svg>- </div>+ <ProgressCircle+ circumference={circumference}+ offset={offset}+ circleCSSProperties={circleCSSProperties}+ />)}</div></div>);};--export function AvatarMenu({- handleFileChange,-}: {- handleFileChange: (event: React.ChangeEvent<HTMLInputElement>) => void;-}) {- const fileInputRef = useRef<HTMLInputElement>(null);- const localize = useLocalize();-- const onItemClick = () => {- if (fileInputRef.current) {- fileInputRef.current.value = '';- }- fileInputRef.current?.click();- };-- return (- <Popover.Portal>- <Popover.Content- className="dark:bg-gray-850 flex max-w-xs min-w-[100px] flex-col rounded-xl border border-gray-400 bg-white shadow-lg dark:border-gray-700 dark:text-white"- sideOffset={5}- >- <div- role="menuitem"- className="group m-1.5 flex cursor-pointer gap-2 rounded p-2.5 text-sm hover:bg-gray-100 focus:ring-0 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:hover:bg-gray-800 dark:hover:bg-white/5"- tabIndex={-1}- data-orientation="vertical"- onClick={onItemClick}- >- {localize('com_ui_upload_image')}- </div>- {/* <Popover.Close- role="menuitem"- className="group m-1.5 flex cursor-pointer gap-2 rounded p-2.5 text-sm hover:bg-black/5 focus:ring-0 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:hover:bg-white/5"- tabIndex={-1}- data-orientation="vertical"- >- Use DALL·E- </Popover.Close> */}- <input- accept="image/png,.png,image/jpeg,.jpg,.jpeg,image/gif,.gif,image/webp,.webp"- multiple={false}- type="file"- style={{ display: 'none' }}- onChange={handleFileChange}- ref={fileInputRef}- tabIndex={-1}- />- </Popover.Content>- </Popover.Portal>- );-}diff --git a/e2e/specs/mock/db.ts b/e2e/specs/mock/db.tsindex ddf3819a9b..80516da780 100644--- a/e2e/specs/mock/db.ts+++ b/e2e/specs/mock/db.ts@@ -93,6 +93,8 @@ export interface SeedMessage {/** Why the turn stopped; the hover Continue is offered only for some values. */finish_reason?: string;model?: string;+ /** Attachments on the turn, as the client renders them (an image opens the lightbox). */+ files?: Record<string, unknown>[];}/**diff --git a/e2e/specs/mock/scenarios/media-overlay-theme.spec.ts b/e2e/specs/mock/scenarios/media-overlay-theme.spec.tsnew file mode 100644index 0000000000..3e67a0a24a--- /dev/null+++ b/e2e/specs/mock/scenarios/media-overlay-theme.spec.ts@@ -0,0 +1,268 @@+import { randomUUID } from 'crypto';+import { expect, test } from '@playwright/test';+import type { Locator, Page } from '@playwright/test';+import { clickHouseTheme } from '../../../../packages/client/src/theme/themes/clickhouse';+import { deleteConversations, seedConversations, seedMessages } from '../db';+import { getE2EUser } from '../../../setup/user';+import { NEW_CHAT_PATH } from '../helpers';++/**+ * Scrims and controls drawn over the user's own media read `surface-media-overlay` and+ * `text-on-media`. Every bundled theme keeps them black and white in both modes, so the+ * lightbox, the composer image preview and the file-drop backdrop paint what they did+ * before the roles existed, and a theme that sets the roles reaches all of them.+ */++type Mode = 'light' | 'dark';++const MODES: Mode[] = ['light', 'dark'];+const THEME_PARAM = 'e2eThemeMode';+const IMAGE_URL = 'https://media.e2e.invalid/media.png';+const IMAGE_NAME = 'media.png';+const PNG_BASE64 =+ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAAHUlEQVQ4jWNwaDjwnxLMMGrA/9EwODAaBg3DIgwACY9/HwbtciYAAAAASUVORK5CYII=';+const WHITE_INK = 'rgb(255, 255, 255)';++/** A theme that moves both media roles off black and white, to prove they are reachable. */+const MEDIA_THEME = {+ version: 1,+ name: 'media-reference',+ modes: {+ light: {+ colors: { 'rgb-surface-media-overlay': '20 30 40', 'rgb-text-on-media': '250 240 200' },+ },+ dark: {+ colors: { 'rgb-surface-media-overlay': '40 20 30', 'rgb-text-on-media': '200 240 250' },+ },+ },+};++test.use({ viewport: { width: 1280, height: 800 } });++/** The mode rides in the URL so one init script can serve every navigation. */+async function installThemeBridge(page: Page, definition: unknown) {+ await page.addInitScript((stored) => {+ const mode = new URL(location.href).searchParams.get('e2eThemeMode');+ if (mode) {+ localStorage.setItem('color-theme', mode);+ }+ localStorage.removeItem('theme-colors');+ localStorage.removeItem('theme-name');+ if (stored) {+ localStorage.setItem('theme-definition', JSON.stringify(stored));+ localStorage.setItem('theme-source', 'definition');+ } else {+ localStorage.removeItem('theme-definition');+ localStorage.removeItem('theme-source');+ }+ }, definition ?? null);+}++async function serveImage(page: Page) {+ await page.route(`${IMAGE_URL}*`, (route) =>+ route.fulfill({ contentType: 'image/png', body: Buffer.from(PNG_BASE64, 'base64') }),+ );+}++/** A conversation whose user turn carries one image, the lightbox's entry point. */+async function seedImageChat(title: string): Promise<string> {+ const conversationId = randomUUID();+ const { email } = getE2EUser();+ await seedConversations(email, [{ conversationId, title, updatedAt: new Date() }]);+ const userMessageId = randomUUID();+ await seedMessages(email, conversationId, [+ {+ messageId: userMessageId,+ parentMessageId: '00000000-0000-0000-0000-000000000000',+ text: 'Here is the image.',+ isCreatedByUser: true,+ sender: 'User',+ files: [+ {+ file_id: randomUUID(),+ filename: IMAGE_NAME,+ filepath: IMAGE_URL,+ type: 'image/png',+ width: 16,+ height: 16,+ },+ ],+ },+ {+ messageId: randomUUID(),+ parentMessageId: userMessageId,+ text: 'A small test image.',+ isCreatedByUser: false,+ sender: 'Mock Provider A',+ },+ ]);+ return conversationId;+}++/** The lightbox's scrim is the overlay rendered just before its dialog content. */+const scrimColor = (dialog: Locator) =>+ dialog.evaluate((node) => {+ const scrim = node.previousElementSibling;+ return scrim ? getComputedStyle(scrim).backgroundColor : '';+ });++const inkOf = (control: Locator) => control.evaluate((node) => getComputedStyle(node).color);++/**+ * The RGBA a colour paints, whatever syntax the browser serialises it in: an alpha utility+ * computes to `oklab(0 0 0 / 0.9)` where the same colour written by hand reads `rgba(...)`.+ */+const painted = (page: Page, color: string): Promise<number[]> =>+ page.evaluate((value) => {+ const canvas = document.createElement('canvas');+ canvas.width = 1;+ canvas.height = 1;+ const context = canvas.getContext('2d');+ if (!context) {+ return [];+ }+ context.fillStyle = value;+ context.fillRect(0, 0, 1, 1);+ return Array.from(context.getImageData(0, 0, 1, 1).data);+ }, color);++/** Both colours paint the same pixel, within the one-step rounding of an oklab round trip. */+async function expectSamePaint(page: Page, actual: string, expected: string) {+ const [got, want] = await Promise.all([painted(page, actual), painted(page, expected)]);+ expect(got).toHaveLength(4);+ got.forEach((channel, index) => expect(Math.abs(channel - want[index])).toBeLessThanOrEqual(1));+}++/** Attaches what the page shows to the report, for the pull request's screenshots. */+async function capture(page: Page, name: string) {+ await test.info().attach(name, { body: await page.screenshot(), contentType: 'image/png' });+}++/** Opens the message image lightbox and reads its scrim and close control at rest and on hover. */+async function lightboxPaint(page: Page, conversationId: string, mode: Mode, theme = 'default') {+ await page.goto(`/c/${conversationId}?${THEME_PARAM}=${mode}`);+ const trigger = page.getByRole('button', { name: `View ${IMAGE_NAME} in dialog` });+ await expect(trigger).toBeVisible({ timeout: 20000 });+ await trigger.click();++ const dialog = page+ .getByRole('dialog')+ .filter({ has: page.getByRole('button', { name: 'Download', exact: true }) });+ await expect(dialog).toBeVisible();+ const close = dialog.getByRole('button', { name: 'Close', exact: true }).first();+ await expect(close).toBeVisible();++ const scrim = await scrimColor(dialog);+ expect(scrim).not.toBe('');+ await capture(page, `lightbox-${theme}-${mode}`);+ const ink = await inkOf(close);+ await close.hover();+ const hoverInk = await inkOf(close);+ await page.keyboard.press('Escape');+ await expect(dialog).toBeHidden();+ return { scrim, ink, hoverInk };+}++test.describe('media overlay roles', () => {+ test('the image lightbox keeps a black scrim and white controls in both modes @scenario:media-lightbox-keeps-black-scrim-and-white-ink', async ({+ page,+ }) => {+ test.setTimeout(90000);+ const conversationId = await seedImageChat('Media lightbox');+ await installThemeBridge(page, null);+ await serveImage(page);++ try {+ for (const mode of MODES) {+ const { scrim, ...controls } = await lightboxPaint(page, conversationId, mode);+ await expectSamePaint(page, scrim, 'rgb(0 0 0 / 0.9)');+ expect(controls).toEqual({ ink: WHITE_INK, hoverInk: WHITE_INK });+ }+ } finally {+ await deleteConversations([conversationId]);+ }+ });++ test('the ClickHouse definition keeps the lightbox black and white @scenario:clickhouse-media-lightbox-keeps-black-and-white', async ({+ page,+ }) => {+ test.setTimeout(90000);+ const conversationId = await seedImageChat('ClickHouse media lightbox');+ await installThemeBridge(page, clickHouseTheme);+ await serveImage(page);++ try {+ for (const mode of MODES) {+ const { scrim, ...controls } = await lightboxPaint(+ page,+ conversationId,+ mode,+ 'clickhouse',+ );+ await expect(page.locator('html')).toHaveAttribute('data-theme', 'clickhouse');+ await expectSamePaint(page, scrim, 'rgb(0 0 0 / 0.9)');+ expect(controls).toEqual({ ink: WHITE_INK, hoverInk: WHITE_INK });+ }+ } finally {+ await deleteConversations([conversationId]);+ }+ });++ test('a theme that sets the media roles repaints the lightbox @scenario:media-overlay-follows-a-theme', async ({+ page,+ }) => {+ test.setTimeout(90000);+ const conversationId = await seedImageChat('Themed media lightbox');+ await installThemeBridge(page, MEDIA_THEME);+ await serveImage(page);++ try {+ for (const [mode, expectedScrim, ink] of [+ ['light', 'rgb(20 30 40 / 0.9)', 'rgb(250, 240, 200)'],+ ['dark', 'rgb(40 20 30 / 0.9)', 'rgb(200, 240, 250)'],+ ] as const) {+ const { scrim, ...controls } = await lightboxPaint(page, conversationId, mode, 'custom');+ await expectSamePaint(page, scrim, expectedScrim);+ expect(controls).toEqual({ ink, hoverInk: ink });+ }+ } finally {+ await deleteConversations([conversationId]);+ }+ });++ test('dragging a file over the chat dims the page with the media scrim @scenario:file-drop-backdrop-dims-in-both-modes', async ({+ page,+ }) => {+ test.setTimeout(60000);+ await installThemeBridge(page, null);++ for (const mode of MODES) {+ await page.goto(`${NEW_CHAT_PATH}?${THEME_PARAM}=${mode}`);+ const input = page.getByRole('textbox', { name: 'Message input' });+ await expect(input).toBeVisible({ timeout: 20000 });++ const dataTransfer = await page.evaluateHandle(() => {+ const transfer = new DataTransfer();+ transfer.items.add(new File(['notes'], 'notes.txt', { type: 'text/plain' }));+ return transfer;+ });+ await input.dispatchEvent('dragenter', { dataTransfer });+ await input.dispatchEvent('dragover', { dataTransfer });++ const prompt = page.getByText('Drop any file here to add it to the conversation', {+ exact: true,+ });+ await expect(prompt).toBeVisible();+ await capture(page, `drop-backdrop-${mode}`);+ /* The backdrop is the fixed layer beneath the prompt's own overlay. */+ const backdrop = await prompt.evaluate((node) => {+ const overlay = node.closest('.fixed');+ const layer = overlay?.previousElementSibling;+ return layer ? getComputedStyle(layer).backgroundColor : '';+ });+ await expectSamePaint(page, backdrop, 'rgb(0 0 0 / 0.4)');++ await input.dispatchEvent('dragleave', { dataTransfer });+ }+ });+});diff --git a/eslint-suppressions.json b/eslint-suppressions.jsonindex 38cb7cfbbc..b7183016a9 100644--- a/eslint-suppressions.json+++ b/eslint-suppressions.json@@ -192,7 +192,7 @@},"client/src/components/Chat/Input/Files/DragDropOverlay.tsx": {"shadcn/no-inline-styles": {- "count": 4+ "count": 3},"shadcn/no-raw-colors": {"count": 5@@ -214,9 +214,6 @@"client/src/components/Chat/Input/Files/ImagePreview.tsx": {"shadcn/no-inline-styles": {"count": 3- },- "shadcn/no-restyle": {- "count": 2}},"client/src/components/Chat/Input/Files/MyFilesModal.tsx": {@@ -438,7 +435,7 @@"count": 1},"shadcn/no-restyle": {- "count": 13+ "count": 5}},"client/src/components/Chat/Messages/Content/EditContentParts.tsx": {@@ -782,9 +779,6 @@"client/src/components/Chat/Messages/MinimalMessages.tsx": {"shadcn/no-inline-styles": {"count": 1- },- "shadcn/no-raw-colors": {- "count": 1}},"client/src/components/Chat/Messages/PendingTurn.tsx": {@@ -1467,9 +1461,6 @@"client/src/components/Share/MessagesView.tsx": {"shadcn/no-inline-styles": {"count": 1- },- "shadcn/no-raw-colors": {- "count": 1}},"client/src/components/Share/ShareArtifacts.tsx": {@@ -1837,14 +1828,8 @@}},"client/src/components/SidePanel/Builder/Images.tsx": {- "shadcn/no-arbitrary-values": {- "count": 1- },"shadcn/no-inline-styles": {- "count": 3- },- "shadcn/no-raw-colors": {- "count": 6+ "count": 1}},"client/src/components/SidePanel/Builder/Knowledge.tsx": {diff --git a/packages/client/src/components/Button.tsx b/packages/client/src/components/Button.tsxindex 513bd202d1..53c8297f93 100644--- a/packages/client/src/components/Button.tsx+++ b/packages/client/src/components/Button.tsx@@ -18,6 +18,7 @@ type ButtonVariantOptions =| 'destructive'| 'secondary'| 'ghost'+ | 'media'| 'row-action'| 'row-action-reveal'| 'section-header'@@ -79,6 +80,12 @@ const buttonVariantRecipe = cva(secondary:'bg-surface-secondary text-text-primary hover:bg-surface-hover hover:active:bg-surface-pressed',ghost: 'hover:bg-surface-hover hover:active:bg-surface-pressed hover:text-text-primary',+ /**+ * A control drawn over the user's own media (a lightbox toolbar, an image preview's close):+ * ghost-shaped, with the media ink and a tint of it on hover, so it stays legible on the+ * black media scrim whatever the page theme paints.+ */+ media: 'text-text-on-media hover:bg-text-on-media/10',/*** A compact action living inside a list row — a pinned row's unpin* badge, a conversation's overflow trigger, a table row's controls. Thediff --git a/packages/client/src/theme/README.md b/packages/client/src/theme/README.mdindex e5bbcecce3..fecddc0c83 100644--- a/packages/client/src/theme/README.md+++ b/packages/client/src/theme/README.md@@ -295,6 +295,7 @@ function MyComponent() {- `bg-surface-destructive` - Destructive action background- `bg-surface-dialog` - Dialog/modal background- `bg-surface-overlay` - Dialog/modal scrim, adapted per theme+- `bg-surface-media-overlay` - Scrim, chip or progress drawn over the user's own media (lightbox, image preview, upload); `text-text-on-media` is its ink. Black and white in every bundled theme, since they frame the image rather than the page- `bg-surface-chat` - Chat interface background- `bg-surface-code` - Code block chrome: toolbar, output and result switcher- `bg-surface-code-body` - Code block pane behind the highlighted codediff --git a/packages/client/src/theme/allowlist.md b/packages/client/src/theme/allowlist.mdindex b137fe1e73..673157f535 100644--- a/packages/client/src/theme/allowlist.md+++ b/packages/client/src/theme/allowlist.md@@ -1,6 +1,6 @@# Colours outside the theme-Every colour in `client/src` and `packages/client/src` that the theme-leakage sweep reached comes from a semantic theme role, except the ones below. Each is a colour that must not follow the theme: a brand mark, artwork, media overlays, a third party's surface, a document that leaves the app, or the theme definitions themselves. An entry names the file, what the literal paints and why the theme does not own it.+Every colour in `client/src` and `packages/client/src` that the theme-leakage sweep reached comes from a semantic theme role, except the ones below. Each is a colour that must not follow the theme: a brand mark, artwork, a third party's surface, a document that leaves the app, or the theme definitions themselves. Scrims, chips and progress drawn over the user's own media are not exceptions: they read `surface-media-overlay` and `text-on-media`, which every bundled theme keeps black and white. An entry names the file, what the literal paints and why the theme does not own it.The sweep skipped files an open pull request was editing; those, with their counts, are listed in berry-13/LibreChat#195, and the avatar colours that still need roles in berry-13/LibreChat#194. Until those land, a file absent from this list is not evidence that it holds no literal colour.@@ -43,21 +43,18 @@ is a role, not an exception.## Chat: media, artwork and documents that leave the app-| File | Why |-| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| `client/src/components/Chat/Input/Files/DragDropOverlay.tsx` | The drop-zone illustration's fills are artwork. Its backdrop is black at 40% in both modes; the theme scrim is gray-500 in default light, so it moves to `surface-overlay` once a theme can set scrim opacity per mode (berry-13/LibreChat#181). |-| `client/src/components/Chat/Input/Files/SourceIcon.tsx` | The OpenAI chip (white/75, black/65 in dark) and the code-execution badge (a black terminal mark with white ink) sit over the file's own preview: media overlays, like the upload progress. |-| `client/src/components/Chat/Input/Files/ProgressCircle.tsx` | Upload progress drawn over the user's own image: a media scrim, so it stays black and white whatever the theme paints around the image. |-| `client/src/components/Chat/Input/Files/ImagePreview.tsx` | The expand hint over the thumbnail (black/20 with white ink) and the full-screen lightbox (black/90 with a white close control) frame the user's own image, so they stay black and white whatever the theme paints around it. |-| `client/src/utils/markdown.ts` | The downloaded HTML document's GitHub Primer stylesheet; it is read outside the app, where no theme variables exist. Its high-contrast branch already reads the roles. |-| `client/src/utils/mermaid.ts` | The mermaid artifact document and its zoom controls render in a sandboxed iframe without theme variables; the token reads' fallbacks and the luminance repair ink are literals by necessity. |-| `client/src/utils/richtext.ts` | Inline styles on HTML copied to the clipboard for pasting into other apps, which must not carry the sender's theme. |-| `client/src/utils/artifacts.ts` | The scrollbar thumb inside the sandboxed artifact document, which renders in its own iframe and never reads the app's theme. |-| `client/src/utils/officePreview.ts`, `client/src/hooks/ScreenshotContext.tsx` | Fallbacks for a theme role read at runtime, used only when the variable is unset. |+| File | Why |+| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `client/src/components/Chat/Input/Files/DragDropOverlay.tsx` | The drop-zone illustration's fills are artwork. Its backdrop is on `surface-media-overlay`. |+| `client/src/components/Chat/Input/Files/SourceIcon.tsx` | The OpenAI file-source chip (white/75, black/65 in dark) behind OpenAI's mark, like the Azure chip in `mobile.css`. The code-execution badge is on `surface-media-overlay`. |+| `client/src/utils/markdown.ts` | The downloaded HTML document's GitHub Primer stylesheet; it is read outside the app, where no theme variables exist. Its high-contrast branch already reads the roles. |+| `client/src/utils/mermaid.ts` | The mermaid artifact document and its zoom controls render in a sandboxed iframe without theme variables; the token reads' fallbacks and the luminance repair ink are literals by necessity. |+| `client/src/utils/richtext.ts` | Inline styles on HTML copied to the clipboard for pasting into other apps, which must not carry the sender's theme. |+| `client/src/utils/artifacts.ts` | The scrollbar thumb inside the sandboxed artifact document, which renders in its own iframe and never reads the app's theme. |+| `client/src/utils/officePreview.ts`, `client/src/hooks/ScreenshotContext.tsx` | Fallbacks for a theme role read at runtime, used only when the variable is unset. |## Panels: media and third-party surfaces-| File | Why |-| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |-| `client/src/components/Nav/SettingsTabs/Account/Avatar.tsx` | The move hint drawn over the user's photo in the avatar cropper: a media scrim with white ink, independent of the theme around the image. |-| `client/src/hooks/Files/useSharePointPicker.ts` | Background of Microsoft's SharePoint file picker iframe, matched to that third party's own surface. |+| File | Why |+| ----------------------------------------------- | --------------------------------------------------------------------------------------------------- |+| `client/src/hooks/Files/useSharePointPicker.ts` | Background of Microsoft's SharePoint file picker iframe, matched to that third party's own surface. |diff --git a/packages/client/src/theme/defaults.css b/packages/client/src/theme/defaults.cssindex 90c4695089..5bff62e109 100644--- a/packages/client/src/theme/defaults.css+++ b/packages/client/src/theme/defaults.css@@ -108,8 +108,9 @@ html {--surface-pressed: var(--gray-200);--surface-composer-hover: var(--gray-200);--surface-primary: var(--white);- --chart-widget-surface: 255 255 255; /* Click UI dashboards.chartWidget.color.background.default #ffffff */- --chart-widget-stroke: 230 231 233; /* Click UI dashboards.chartWidget.color.stroke.default #e6e7e9 */+ /* Light widgets sit on the page surface and its light rule; dark mode lifts them (below). */+ --chart-widget-surface: var(--surface-primary);+ --chart-widget-stroke: var(--border-light);--surface-primary-alt: var(--gray-50);--surface-primary-contrast: var(--gray-100);--surface-secondary: var(--gray-50);@@ -119,6 +120,8 @@ html {--surface-dialog: var(--white);--dialog-title: var(--text-primary);--surface-overlay: var(--gray-500);+ --surface-media-overlay: 0 0 0;+ --text-on-media: var(--white);--surface-submit: var(--green-700);--surface-submit-hover: var(--green-800);--surface-destructive: var(--red-700);@@ -336,6 +339,8 @@ html {--surface-dialog: var(--gray-875);--dialog-title: var(--text-primary);--surface-overlay: 0 0 0;+ --surface-media-overlay: 0 0 0;+ --text-on-media: var(--white);--surface-submit: var(--green-700);--surface-submit-hover: var(--green-800);--surface-destructive: var(--red-800);diff --git a/packages/client/src/theme/defaults.spec.ts b/packages/client/src/theme/defaults.spec.tsindex 3427b7c98e..04e12aa753 100644--- a/packages/client/src/theme/defaults.spec.ts+++ b/packages/client/src/theme/defaults.spec.ts@@ -68,7 +68,7 @@ describe.each([const tokens = Object.keys(theme) as Array<keyof IThemeRGB>;it('covers every registry color', () => {- expect(tokens).toHaveLength(114);+ expect(tokens).toHaveLength(116);});it('resolves every registry color to the runtime theme value', () => {diff --git a/packages/client/src/theme/themes/clickhouse.ts b/packages/client/src/theme/themes/clickhouse.tsindex f3a44e2506..09e13aa9e6 100644--- a/packages/client/src/theme/themes/clickhouse.ts+++ b/packages/client/src/theme/themes/clickhouse.ts@@ -79,6 +79,8 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-surface-dialog': '255 255 255', // #ffffff (background.default)'rgb-dialog-title': '30 29 31', // #1e1d1f (dialog.color.title.default, lch(11.126 1.374 305.43))'rgb-surface-overlay': '21 21 21', // #151515 (dialog.color.opaqueBackground, lch(6.7738 0 none))+ 'rgb-surface-media-overlay': '0 0 0', // #000000 (no Click UI media scrim)+ 'rgb-text-on-media': '255 255 255', // #ffffff (palette.neutral.0)'rgb-surface-submit': '21 21 21', // #151515 (accent.default)'rgb-surface-submit-hover': '50 50 50', // #323232 (palette.neutral.712)'rgb-surface-destructive': '193 0 0', // #c10000 (palette.danger.600)@@ -225,6 +227,8 @@ export const clickHouseDarkTheme: IThemeRGB = {* #606060 gray that lifts the page instead of dimming it. A bundled scrim never lifts the page* (`semanticTokens.spec.ts`), so black keeps the dark scrim; the 0.75 alpha is Click UI's. */'rgb-surface-overlay': '0 0 0', // #000000+ 'rgb-surface-media-overlay': '0 0 0', // #000000 (no Click UI media scrim)+ 'rgb-text-on-media': '255 255 255', // #ffffff (palette.neutral.0)'rgb-surface-submit': '250 255 105', // #faff69 (accent.default)'rgb-surface-submit-hover': '253 255 163', // #fdffa3 (palette.brand.200)'rgb-surface-destructive': '255 117 117', // #ff7575 (palette.danger.300)diff --git a/packages/client/src/theme/themes/clickui.spec.ts b/packages/client/src/theme/themes/clickui.spec.tsindex 5f8f476607..377f3d9e22 100644--- a/packages/client/src/theme/themes/clickui.spec.ts+++ b/packages/client/src/theme/themes/clickui.spec.ts@@ -103,6 +103,7 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-code': 'click.codeblock.lightMode.color.background.default','rgb-surface-code-body': 'click.codeblock.lightMode.color.background.default','rgb-surface-qr': 'palette.neutral.0',+ 'rgb-text-on-media': 'palette.neutral.0','rgb-surface-inverted': 'palette.neutral.900','rgb-surface-inverted-hover': 'palette.neutral.712','rgb-surface-inverted-pressed': 'click.button.basic.color.primary.background.active',@@ -218,6 +219,7 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-code': 'click.codeblock.darkMode.color.background.default','rgb-surface-code-body': 'click.codeblock.darkMode.color.background.default','rgb-surface-qr': 'palette.neutral.0',+ 'rgb-text-on-media': 'palette.neutral.0','rgb-surface-inverted': 'click.button.basic.color.primary.background.default','rgb-surface-inverted-hover': 'click.button.basic.color.primary.background.hover','rgb-surface-inverted-pressed': 'click.button.basic.color.primary.background.active',@@ -287,12 +289,21 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>},};+/** Click UI has no scrim for media; a lightbox or preview frames the user's image in black. */+const MEDIA_OVERLAY_REASON =+ 'Click UI has no media scrim; the image frame stays black in both modes';+const MEDIA_SCRIM_DEPARTURE =+ 'the dialog scrim is the nearest Click UI job; a lightbox frames the user image in black instead';+/** Values the theme sets on purpose without a Click UI source, and why. */const unsourcedColors: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>> = {- light: {},+ light: {+ 'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON,+ },dark: {'rgb-surface-overlay':'Click UI dark dialog.color.opaqueBackground is a gray that leaves the dialog under 3:1',+ 'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON,},};@@ -316,6 +327,11 @@ interface Departure {*/const departures: Record<ThemeMode, Partial<Record<keyof IThemeRGB, Departure>>> = {light: {+ 'rgb-surface-media-overlay': {+ counterpart: 'click.dialog.color.opaqueBackground.default',+ status: 'near',+ reason: MEDIA_SCRIM_DEPARTURE,+ },'rgb-text-secondary': {counterpart: 'global.color.text.muted',status: 'mismatch',@@ -408,6 +424,11 @@ const departures: Record<ThemeMode, Partial<Record<keyof IThemeRGB, Departure>>>status: 'mismatch',reason: 'the dark scrim is a #606060 gray that lifts the page instead of dimming it',},+ 'rgb-surface-media-overlay': {+ counterpart: 'click.dialog.color.opaqueBackground.default',+ status: 'mismatch',+ reason: MEDIA_SCRIM_DEPARTURE,+ },},};diff --git a/packages/client/src/theme/themes/dark.ts b/packages/client/src/theme/themes/dark.tsindex 950fd5c328..4514d41ced 100644--- a/packages/client/src/theme/themes/dark.ts+++ b/packages/client/src/theme/themes/dark.ts@@ -54,6 +54,8 @@ export const darkTheme: IThemeRGB = {'rgb-surface-dialog': '18 18 18', // #121212 (legacy dark dialog)'rgb-dialog-title': '236 236 236', // #ececec (gray-100, matching text-primary)'rgb-surface-overlay': '0 0 0', // #000 (black)+ 'rgb-surface-media-overlay': '0 0 0', // #000 (black, over the user's media in both modes)+ 'rgb-text-on-media': '255 255 255', // #fff (white)'rgb-surface-submit': '4 120 87', // #047857 (green-700)'rgb-surface-submit-hover': '6 95 70', // #065f46 (green-800)'rgb-surface-destructive': '153 27 27', // #991b1b (red-800)diff --git a/packages/client/src/theme/themes/default.ts b/packages/client/src/theme/themes/default.tsindex 870b1a6475..aab5e683d2 100644--- a/packages/client/src/theme/themes/default.ts+++ b/packages/client/src/theme/themes/default.ts@@ -43,8 +43,8 @@ export const defaultTheme: IThemeRGB = {'rgb-surface-pressed': '227 227 227', // #e3e3e3 (gray-200), the hover fill'rgb-surface-composer-hover': '227 227 227', // #e3e3e3 (gray-200)'rgb-surface-primary': '255 255 255', // #fff (white)- 'rgb-chart-widget-surface': '255 255 255', // #fff (Click UI chart widget)- 'rgb-chart-widget-stroke': '230 231 233', // #e6e7e9 (Click UI chart widget)+ 'rgb-chart-widget-surface': '255 255 255', // #fff (matching surface-primary)+ 'rgb-chart-widget-stroke': '227 227 227', // #e3e3e3 (gray-200, matching border-light)'rgb-surface-primary-alt': '247 247 248', // #f7f7f8 (gray-50)'rgb-surface-primary-contrast': '236 236 236', // #ececec (gray-100)'rgb-surface-secondary': '247 247 248', // #f7f7f8 (gray-50)@@ -54,6 +54,8 @@ export const defaultTheme: IThemeRGB = {'rgb-surface-dialog': '255 255 255', // #fff (white)'rgb-dialog-title': '33 33 33', // #212121 (gray-800, matching text-primary)'rgb-surface-overlay': '89 89 89', // #595959 (gray-500)+ 'rgb-surface-media-overlay': '0 0 0', // #000 (black, over the user's media in both modes)+ 'rgb-text-on-media': '255 255 255', // #fff (white)'rgb-surface-submit': '4 120 87', // #047857 (green-700)'rgb-surface-submit-hover': '6 95 70', // #065f46 (green-800)'rgb-surface-destructive': '185 28 28', // #b91c1c (red-700)diff --git a/packages/client/src/theme/themes/highContrast.ts b/packages/client/src/theme/themes/highContrast.tsindex e78734e4a1..0fec39e8e4 100644--- a/packages/client/src/theme/themes/highContrast.ts+++ b/packages/client/src/theme/themes/highContrast.ts@@ -90,6 +90,8 @@ export const highContrastLightTheme: IThemeRGB = {'rgb-surface-dialog': '255 255 255', // #ffffff'rgb-dialog-title': '0 0 0', // #000000 (matching text-primary)'rgb-surface-overlay': '0 0 0', // #000000+ 'rgb-surface-media-overlay': '0 0 0', // #000000+ 'rgb-text-on-media': '255 255 255', // #ffffff'rgb-surface-submit': '0 92 46', // #005c2e'rgb-surface-submit-hover': '0 61 30', // #003d1e'rgb-surface-destructive': '161 0 0', // #a10000@@ -252,6 +254,8 @@ export const highContrastDarkTheme: IThemeRGB = {'rgb-surface-dialog': '0 0 0', // #000000'rgb-dialog-title': '255 255 255', // #ffffff (matching text-primary)'rgb-surface-overlay': '0 0 0', // #000000+ 'rgb-surface-media-overlay': '0 0 0', // #000000+ 'rgb-text-on-media': '255 255 255', // #ffffff'rgb-surface-submit': '127 240 179', // #7ff0b3'rgb-surface-submit-hover': '163 245 204', // #a3f5cc'rgb-surface-destructive': '255 143 143', // #ff8f8fdiff --git a/packages/client/src/theme/tokens.css b/packages/client/src/theme/tokens.cssindex 544f5ef651..89c6e19b82 100644--- a/packages/client/src/theme/tokens.css+++ b/packages/client/src/theme/tokens.css@@ -51,6 +51,8 @@/* Falls back to the ink dialog titles were set in, for a stylesheet that predates it. */--color-dialog-title: rgb(var(--dialog-title, var(--text-primary)));--color-surface-overlay: rgb(var(--surface-overlay));+ --color-surface-media-overlay: rgb(var(--surface-media-overlay));+ --color-text-on-media: rgb(var(--text-on-media));/* The dialog scrims: the overlay at the opacity each dialog family's appearance* role sets (OGDialog, AlertDialog, Dialog), defaulting to the 80%, 90% and 65%* the families have always drawn. */diff --git a/packages/client/src/theme/types/index.ts b/packages/client/src/theme/types/index.tsindex 9e350125f7..c1956440ec 100644--- a/packages/client/src/theme/types/index.ts+++ b/packages/client/src/theme/types/index.ts@@ -60,6 +60,11 @@ export interface IThemeRGB {/** An OGDialog title's ink; follows `rgb-text-primary` when a theme omits it. */'rgb-dialog-title'?: string;'rgb-surface-overlay'?: string;+ /** Scrims, chips and progress drawn over the user's own media (a lightbox, an image preview,+ * an upload in progress), and the ink and hover tint on them. They frame the image rather+ * than the page, so every bundled theme keeps them black and white in both modes. */+ 'rgb-surface-media-overlay'?: string;+ 'rgb-text-on-media'?: string;'rgb-surface-submit'?: string;'rgb-surface-submit-hover'?: string;'rgb-surface-destructive'?: string;@@ -236,6 +241,8 @@ export interface IThemeVariables {'--surface-dialog': string;'--dialog-title': string;'--surface-overlay': string;+ '--surface-media-overlay': string;+ '--text-on-media': string;'--surface-submit': string;'--surface-submit-hover': string;'--surface-destructive': string;@@ -362,6 +369,8 @@ export interface IThemeColors {'surface-dialog'?: string;'dialog-title'?: string;'surface-overlay'?: string;+ 'surface-media-overlay'?: string;+ 'text-on-media'?: string;'surface-submit'?: string;'surface-submit-hover'?: string;'surface-destructive'?: string;diff --git a/packages/data-provider/src/theme.ts b/packages/data-provider/src/theme.tsindex f964a5d717..f23d8920c5 100644--- a/packages/data-provider/src/theme.ts+++ b/packages/data-provider/src/theme.ts@@ -54,6 +54,8 @@ export const themeColorTokens = Object.freeze(['rgb-surface-dialog','rgb-dialog-title','rgb-surface-overlay',+ 'rgb-surface-media-overlay',+ 'rgb-text-on-media','rgb-surface-submit','rgb-surface-submit-hover','rgb-surface-destructive',