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: App-Wide UI Scale Setting (#14903)
Marco Beretta7e575c047fa9
diff --git a/client/index.html b/client/index.htmlindex 4757942db6..246d4cc3a3 100644--- a/client/index.html+++ b/client/index.html@@ -29,6 +29,24 @@</style><script>(function () {+ /* Applied before first paint so the app does not flash at the wrong scale.+ * A stored value outside the supported range is clamped rather than ignored,+ * so the rendered scale cannot disagree with the value the setting shows. */+ let uiScale = 1;+ try {+ const storedScale = JSON.parse(localStorage.getItem('uiScale'));+ if (typeof storedScale === 'number' && Number.isFinite(storedScale)) {+ uiScale = Math.min(1.5, Math.max(0.5, storedScale));+ }+ } catch (e) {+ /* Web Storage denied or unparsable: the default scale applies. */+ }+ /* The stylesheet's :root already declares 1, so the default leaves the+ * root's inline style untouched. */+ if (uiScale !== 1) {+ document.documentElement.style.setProperty('--ui-scale', String(uiScale));+ }+let theme = null;try {theme = localStorage.getItem('color-theme');diff --git a/client/src/App.jsx b/client/src/App.jsxindex 28b47cf04d..762c8f40f5 100644--- a/client/src/App.jsx+++ b/client/src/App.jsx@@ -11,6 +11,7 @@ import WakeLockManager from '~/components/System/WakeLockManager';import QueryDevtoolsGate from '~/components/QueryDevtoolsGate';import LanguageSync from '~/components/System/LanguageSync';import DeploymentTheme from '~/Providers/DeploymentTheme';+import UiScaleSync from '~/components/System/UiScaleSync';import { initializeFontSize } from '~/store/fontSize';import { LiveAnnouncer } from '~/a11y';import { router } from './routes';@@ -47,6 +48,7 @@ const App = () => {<QueryClientProvider client={queryClient}><RecoilRoot><LanguageSync />+ <UiScaleSync /><LiveAnnouncer><DeploymentTheme><RadixToast.Provider>diff --git a/client/src/components/Agents/CategoryTabs.tsx b/client/src/components/Agents/CategoryTabs.tsxindex db7b502154..98fee14ed1 100644--- a/client/src/components/Agents/CategoryTabs.tsx+++ b/client/src/components/Agents/CategoryTabs.tsx@@ -49,7 +49,7 @@ const CategoryTabs: React.FC<CategoryTabsProps> = ({<div className="w-full"><div className="flex flex-wrap justify-start gap-1.5">{[...Array(6)].map((_, i) => (- <div key={i} className="bg-surface-tertiary h-8 min-w-[80px] rounded-full" />+ <div key={i} className="bg-surface-tertiary h-8 min-w-[5rem] rounded-full" />))}</div></div>diff --git a/client/src/components/Agents/Marketplace.tsx b/client/src/components/Agents/Marketplace.tsxindex 727a0c13f6..23a884b787 100644--- a/client/src/components/Agents/Marketplace.tsx+++ b/client/src/components/Agents/Marketplace.tsx@@ -1,5 +1,4 @@import React, { useEffect, useMemo, useRef } from 'react';-import { useMediaQuery } from '@librechat/client';import { PermissionTypes, Permissions } from 'librechat-data-provider';import { useSearchParams, useParams, useNavigate } from 'react-router-dom';import type t from 'librechat-data-provider';@@ -8,6 +7,7 @@ import SortDropdown, { SORT_OPTIONS, DEFAULT_SORT_OPTION } from './SortDropdown'import { useDocumentTitle, useHasAccess, useLocalize } from '~/hooks';import MarketplaceAdminSettings from './MarketplaceAdminSettings';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { SidePanelGroup } from '~/components/SidePanel';import MineFilterToggle from './MineFilterToggle';import CategoryTabs from './CategoryTabs';@@ -23,7 +23,7 @@ const AgentMarketplace: React.FC<AgentMarketplaceProps> = ({ className = '' }) =const navigate = useNavigate();const { category } = useParams();const [searchParams, setSearchParams] = useSearchParams();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const scrollContainerRef = useRef<HTMLDivElement>(null);const searchQuery = searchParams.get('q') || '';const sort = useMemo<t.AgentSortOption>(() => {diff --git a/client/src/components/Appearance/Selectors.tsx b/client/src/components/Appearance/Selectors.tsxindex beea8cde86..ab98a3e4f8 100644--- a/client/src/components/Appearance/Selectors.tsx+++ b/client/src/components/Appearance/Selectors.tsx@@ -32,14 +32,14 @@ export const ThemeSelector = ({const labelId = 'theme-selector-label';return (- <div className="flex items-center justify-between">+ <div className="flex flex-wrap items-center justify-between gap-2"><div id={labelId}>{localize('com_nav_theme')}</div><Dropdownvalue={theme}onChange={onChange}options={themeOptions}- sizeClasses={cn('z-50 w-[180px]', popoverClassName)}+ sizeClasses={cn('z-50 w-[min(11.25rem,90vw)]', popoverClassName)}testId="theme-selector"aria-labelledby={labelId}portal={portal}@@ -113,15 +113,15 @@ export const LangSelector = ({const labelId = 'language-selector-label';return (- <div className="flex items-center justify-between">+ <div className="flex flex-wrap items-center justify-between gap-2"><div id={labelId}>{localize('com_nav_language')}</div>- <div className="flex items-center gap-2">+ <div className="flex max-w-full min-w-0 items-center gap-2">{isLanguageLoading && (<spanrole="status"aria-label={localize('com_ui_loading')}- className="flex size-5 items-center justify-center text-text-secondary"+ className="text-text-secondary flex size-5 items-center justify-center"><Spinner className="size-4" /></span>@@ -129,7 +129,7 @@ export const LangSelector = ({<Dropdownvalue={langcode}onChange={onChange}- sizeClasses={cn('z-50 w-[220px]', popoverClassName)}+ sizeClasses={cn('z-50 w-[min(13.75rem,90vw)]', popoverClassName)}options={languageOptions}aria-labelledby={labelId}portal={portal}diff --git a/client/src/components/Artifacts/ArtifactCodeEditor.tsx b/client/src/components/Artifacts/ArtifactCodeEditor.tsxindex a077d9599c..c758ac4413 100644--- a/client/src/components/Artifacts/ArtifactCodeEditor.tsx+++ b/client/src/components/Artifacts/ArtifactCodeEditor.tsx@@ -1,7 +1,12 @@import React, { useMemo, useState, useEffect, useRef, useCallback, useContext } from 'react';import debounce from 'lodash/debounce';import MonacoEditor from '@monaco-editor/react';-import { ThemeContext, highContrastDarkTheme, highContrastLightTheme } from '@librechat/client';+import {+ ThemeContext,+ highContrastDarkTheme,+ highContrastLightTheme,+ useRemScale,+} from '@librechat/client';import type { Monaco } from '@monaco-editor/react';import type { IThemeRGB } from '@librechat/client';import type { editor } from 'monaco-editor';@@ -17,6 +22,9 @@ import { getResponseStatus } from '~/utils/errors';import { useArtifactsContext } from '~/Providers';import { useEditArtifact } from '~/data-provider';+/** Monaco's font size, in baseline pixels. */+const EDITOR_FONT_SIZE = 13;+const LANG_MAP: Record<string, string> = {javascript: 'javascript',typescript: 'typescript',@@ -755,13 +763,17 @@ export const ArtifactCodeEditor = function ArtifactCodeEditor({: highContrastLightEditorAppearance;}+ /* Monaco renders into a canvas rather than inheriting the root font size, so the+ one size the app cannot scale through CSS has to be computed. Changing the options+ object is enough: the wrapper calls editor.updateOptions when it changes. */+ const remScale = useRemScale();const editorOptions = useMemo<editor.IStandaloneEditorConstructionOptions>(() => ({readOnly,minimap: { enabled: false },lineNumbers: 'on',scrollBeyondLastLine: false,- fontSize: 13,+ fontSize: Math.round(EDITOR_FONT_SIZE * remScale),tabSize: 2,wordWrap: 'on',automaticLayout: true,@@ -791,7 +803,7 @@ export const ArtifactCodeEditor = function ArtifactCodeEditor({hover: { enabled: readOnly ? 'off' : 'on' },matchBrackets: readOnly ? 'never' : 'always',}),- [readOnly],+ [readOnly, remScale],);if (!artifact.content) {diff --git a/client/src/components/Artifacts/Artifacts.tsx b/client/src/components/Artifacts/Artifacts.tsxindex 679cdcbda3..db9e901852 100644--- a/client/src/components/Artifacts/Artifacts.tsx+++ b/client/src/components/Artifacts/Artifacts.tsx@@ -22,7 +22,9 @@ import { artifactsOpenedArtifactId, artifactsPaneFocusRequest, undockedArtifactsimport { displayFilename } from '~/components/Chat/Messages/Content/Parts/attachmentTypes';import { useArtifactsContext, useShareContext, useMutationState } from '~/Providers';import CopyButton from '~/components/Messages/Content/CopyButton';+import { ARTIFACTS_SHEET_MAX_WIDTH } from '~/utils/breakpoints';import useArtifacts from '~/hooks/Artifacts/useArtifacts';+import useScaledMaxWidth from '~/hooks/useScaledMaxWidth';import { useFocusTrap, useLocalize } from '~/hooks';import DownloadArtifact from './DownloadArtifact';import ArtifactVersion from './ArtifactVersion';@@ -48,7 +50,7 @@ export default function Artifacts() {/* The undocked window is its own viewport: the host's width says nothing* about it, and a bottom sheet — backdrop, drag handle, no dock action — is* not what a window wants to be. */- const isMobile = useMediaQuery('(max-width: 868px)') && !isUndocked;+ const isMobile = useScaledMaxWidth(ARTIFACTS_SHEET_MAX_WIDTH) && !isUndocked;const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');const previewRef = useRef<SandpackPreviewRef>();const artifactContainerRef = useRef<HTMLDivElement>(null);@@ -514,7 +516,7 @@ export default function Artifacts() {{/* Header */}<divclassName={cn(- 'border-border-light bg-surface-primary-alt flex h-[52px] shrink-0 items-center justify-between gap-2 border-b p-2 transition-all duration-300 motion-reduce:transition-none',+ 'border-border-light bg-surface-primary-alt flex h-[3.25rem] shrink-0 items-center justify-between gap-2 border-b p-2 transition-all duration-300 motion-reduce:transition-none',isMobile ? 'justify-center' : 'overflow-hidden',)}>@@ -557,11 +559,10 @@ export default function Artifacts() {aria-label={localize('com_ui_refresh')}>{isRefreshing ? (- <Spinner size={16} />+ <Spinner className="m-auto size-4" />) : (<RefreshCw- size={16}- className="transition-transform duration-200 motion-reduce:transition-none"+ className="size-4 transition-transform duration-200 motion-reduce:transition-none"aria-hidden="true"/>)}@@ -578,14 +579,14 @@ export default function Artifacts() {)}>{isFullscreen ? (- <Minimize2 size={16} aria-hidden="true" />+ <Minimize2 className="size-4" aria-hidden="true" />) : (- <Maximize2 size={16} aria-hidden="true" />+ <Maximize2 className="size-4" aria-hidden="true" />)}</Button>)}{displayedTab !== 'preview' && isMutating && (- <RefreshCw size={16} className="text-text-secondary animate-spin" />+ <RefreshCw className="text-text-secondary size-4 animate-spin" />)}{orderedArtifactIds.length > 1 && (<ArtifactVersion@@ -633,9 +634,9 @@ export default function Artifacts() {)}>{isUndocked ? (- <PanelRight size={16} aria-hidden="true" />+ <PanelRight className="size-4" aria-hidden="true" />) : (- <PictureInPicture2 size={16} aria-hidden="true" />+ <PictureInPicture2 className="size-4" aria-hidden="true" />)}</Button>)}@@ -646,7 +647,7 @@ export default function Artifacts() {onClick={closeArtifacts}aria-label={localize('com_ui_close')}>- <X size={16} aria-hidden="true" />+ <X className="size-4" aria-hidden="true" /></Button></div></div>@@ -675,7 +676,7 @@ export default function Artifacts() {isRefreshing ? 'scale-100' : 'scale-95',)}>- <Spinner size={24} />+ <Spinner className="m-auto size-6" /></div></div></div>diff --git a/client/src/components/Audio/TTS.tsx b/client/src/components/Audio/TTS.tsxindex 28d35244bc..51b0706b32 100644--- a/client/src/components/Audio/TTS.tsx+++ b/client/src/components/Audio/TTS.tsx@@ -27,14 +27,14 @@ export function BrowserTTS({const renderIcon = () => {if (isLoading === true) {- return <Spinner className="icon-md-heavy h-[18px] w-[18px]" />;+ return <Spinner className="icon-md-heavy h-[1.125rem] w-[1.125rem]" />;}if (isSpeaking === true) {- return <VolumeMuteIcon className="icon-md-heavy h-[18px] w-[18px]" />;+ return <VolumeMuteIcon className="icon-md-heavy h-[1.125rem] w-[1.125rem]" />;}- return <VolumeIcon className="icon-md-heavy h-[18px] w-[18px]" />;+ return <VolumeIcon className="icon-md-heavy h-[1.125rem] w-[1.125rem]" />;};useEffect(() => {@@ -120,14 +120,14 @@ export function ExternalTTS({const renderIcon = () => {if (isLoading === true) {- return <Spinner className="icon-md-heavy h-[18px] w-[18px]" />;+ return <Spinner className="icon-md-heavy h-[1.125rem] w-[1.125rem]" />;}if (isSpeaking === true) {- return <VolumeMuteIcon className="icon-md-heavy h-[18px] w-[18px]" />;+ return <VolumeMuteIcon className="icon-md-heavy h-[1.125rem] w-[1.125rem]" />;}- return <VolumeIcon className="icon-md-heavy h-[18px] w-[18px]" />;+ return <VolumeIcon className="icon-md-heavy h-[1.125rem] w-[1.125rem]" />;};useEffect(() => {diff --git a/client/src/components/Audio/Voices.tsx b/client/src/components/Audio/Voices.tsxindex a7246b42f8..d62a72b215 100644--- a/client/src/components/Audio/Voices.tsx+++ b/client/src/components/Audio/Voices.tsx@@ -29,7 +29,7 @@ export function BrowserVoiceDropdown({ disabled = false }: { disabled?: booleanvalue={voice ?? ''}options={voices}onChange={handleVoiceChange}- sizeClasses="z-50 min-w-[200px] max-w-[400px]"+ sizeClasses="z-50 min-w-[min(12.5rem,90vw)] max-w-[min(25rem,90vw)]"testId="BrowserVoiceDropdown"className="z-50"aria-labelledby={labelId}@@ -62,7 +62,7 @@ export function ExternalVoiceDropdown({ disabled = false }: { disabled?: booleanvalue={voice ?? ''}options={voices}onChange={handleVoiceChange}- sizeClasses="z-50 min-w-[200px] max-w-[400px]"+ sizeClasses="z-50 min-w-[min(12.5rem,90vw)] max-w-[min(25rem,90vw)]"testId="ExternalVoiceDropdown"className="z-50"aria-labelledby={labelId}diff --git a/client/src/components/Bookmarks/BookmarkForm.tsx b/client/src/components/Bookmarks/BookmarkForm.tsxindex 319e1bc234..e065554158 100644--- a/client/src/components/Bookmarks/BookmarkForm.tsx+++ b/client/src/components/Bookmarks/BookmarkForm.tsx@@ -139,7 +139,7 @@ const BookmarkForm = ({disabled={false}placeholder={localize('com_ui_enter_description')}className={cn(- 'border-border-light min-h-[100px] w-full resize-none rounded-lg border',+ 'border-border-light min-h-[6.25rem] w-full resize-none rounded-lg border','text-text-primary bg-transparent px-3 py-2 text-sm','placeholder:text-text-tertiary','focus-visible:ring-border-heavy focus-visible:ring-1',diff --git a/client/src/components/Chat/Footer.tsx b/client/src/components/Chat/Footer.tsxindex aedea26caa..30bd1cc20c 100644--- a/client/src/components/Chat/Footer.tsx+++ b/client/src/components/Chat/Footer.tsx@@ -146,7 +146,7 @@ function Footer({ className, startupConfig, configuredOnly = false }: FooterProprather than the brighter `text-secondary`: the underline carries theaffordance, and a link that outshines its own sentence puts theemphasis back where this change takes it from. */- 'text-text-muted absolute right-0 bottom-0 left-0 hidden items-center justify-center gap-2 px-2 py-2 text-center text-xs sm:flex md:px-[60px]'+ 'text-text-muted absolute right-0 bottom-0 left-0 hidden items-center justify-center gap-2 px-2 py-2 text-center text-xs sm:flex md:px-15'}>{footerElements.map((contentRender, index) => {diff --git a/client/src/components/Chat/Header.tsx b/client/src/components/Chat/Header.tsxindex d30496d8ef..2af0a0e094 100644--- a/client/src/components/Chat/Header.tsx+++ b/client/src/components/Chat/Header.tsx@@ -10,6 +10,7 @@ import {} from 'librechat-data-provider';import { OpenSidebar, PresetsMenu, NewChat, HeaderMenu } from './Menus';import { TemporaryChat, TemporaryChatIndicator } from './TemporaryChat';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import ModelSelector from './Menus/Endpoints/ModelSelector';import { BackgroundTasksButton } from './BackgroundTasks';import { TraceButton, useTraceControl } from './Trace';@@ -24,12 +25,7 @@ import store from '~/store';const defaultInterface = getConfigDefaults().interface;-/**- * Three zones in a single DOM order that serves both layouts: hidden items- * generate no flex gap, so each breakpoint collapses to the right row without- * reordering. Branching is CSS-only — `useMediaQuery` resolves after paint and- * would pop the row a frame late on every mount.- */+/** Keep one DOM order while sharing the sidebar's scaled drawer breakpoint. */function Header({parentConversationId,readOnly = false,@@ -40,6 +36,7 @@ function Header({const { data: startupConfig } = useGetStartupConfig();const navVisible = useRecoilValue(store.sidebarExpanded);const isSubmitting = useRecoilValue(store.isSubmittingFamily(0));+ const isSmallScreen = useDrawerViewport();/** The mobile row only offers a new chat when there is one to leave. Read* from the route rather than the context conversation, which still holds the@@ -81,19 +78,20 @@ function Header({});/** The drawer covers the header on mobile; keep its controls out of the tab order. */- const hiddenBehindNav = navVisible === true && 'max-md:hidden';+ const hiddenBehindNav = navVisible === true && isSmallScreen && 'hidden';return (/* The composer review is in a z-10 stacking context. Keep header controlsabove it when a tall review reaches the top of a short viewport. */- <div className="from-surface-primary-alt via-surface-primary-alt/70 text-text-primary md:from-surface-primary-alt/80 md:via-surface-primary-alt/50 2xl:from-surface-primary-alt/0 absolute top-0 z-20 flex h-[52px] w-full items-center gap-2 bg-gradient-to-b to-transparent p-2 font-semibold 2xl:via-transparent">- <div className="flex flex-shrink-0 items-center md:hidden">+ <div className="from-surface-primary-alt via-surface-primary-alt/70 text-text-primary md:from-surface-primary-alt/80 md:via-surface-primary-alt/50 2xl:from-surface-primary-alt/0 absolute top-0 z-20 flex h-[3.25rem] w-full items-center gap-2 bg-gradient-to-b to-transparent p-2 font-semibold 2xl:via-transparent">+ <div className={cn('flex-shrink-0 items-center', isSmallScreen ? 'flex' : 'hidden')}><OpenSidebar testId="header-open-sidebar-button" /></div><divclassName={cn(- 'flex min-w-0 flex-1 items-center gap-2 md:pl-3 md:transition-all md:duration-200 md:ease-in-out',+ 'flex min-w-0 flex-1 items-center gap-2',+ !isSmallScreen && 'pl-3 transition-all duration-200 ease-in-out',hiddenBehindNav,)}>@@ -105,12 +103,12 @@ function Header({<PresetsMenu />)}{hasAccessToBookmarks === true && (- <div className="hidden items-center md:flex">+ <div className={cn('items-center', isSmallScreen ? 'hidden' : 'flex')}><BookmarkMenu /></div>)}{hasAccessToMultiConvo === true && (- <div className="hidden items-center md:flex">+ <div className={cn('items-center', isSmallScreen ? 'hidden' : 'flex')}><AddMultiConvo /></div>)}@@ -118,7 +116,7 @@ function Header({<div className={cn('flex shrink-0 items-center gap-2', hiddenBehindNav)}>{showTemporaryChat && <TemporaryChatIndicator />}- {!isNewChat && <NewChat className="md:hidden" />}+ {!isNewChat && <NewChat className={isSmallScreen ? undefined : 'hidden'} />}{!isNewChat && parentConversationId == null && (<BackgroundTasksButtonkey={routeConversationId}@@ -126,8 +124,12 @@ function Header({isSubmitting={isSubmitting}/>)}- <HeaderMenu startupConfig={startupConfig} trace={trace} className="md:hidden" />- <div className="hidden items-center gap-2 md:flex">+ <HeaderMenu+ startupConfig={startupConfig}+ trace={trace}+ className={isSmallScreen ? undefined : 'hidden'}+ />+ <div className={cn('items-center gap-2', isSmallScreen ? 'hidden' : 'flex')}>{trace.show && <TraceButton onClick={trace.open} />}<ExportAndShareMenu isSharedButtonEnabled={startupConfig?.sharedLinksEnabled ?? false} />{showTemporaryChat && <TemporaryChat />}diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsxindex e3788e4ab2..f522314eeb 100644--- a/client/src/components/Chat/Input/ChatForm.tsx+++ b/client/src/components/Chat/Input/ChatForm.tsx@@ -2,7 +2,12 @@ import { memo, useRef, useMemo, useEffect, useState, useCallback } from 'react';import { useWatch } from 'react-hook-form';import { useNavigate } from 'react-router-dom';import { useRecoilState, useRecoilValue } from 'recoil';-import { composerSurfaceClasses, composerSurfaceShadow, TextareaAutosize } from '@librechat/client';+import {+ composerSurfaceClasses,+ composerSurfaceShadow,+ TextareaAutosize,+ useRemScale,+} from '@librechat/client';import {Constants,Permissions,@@ -157,6 +162,8 @@ const focusOwningTargetSelector = ['[role="dialog"]','[role="alertdialog"]',].join(', ');+/** Matches the composer's one-line height; scaled so it tracks its rem padding. */+const INITIAL_TEXTAREA_HEIGHT = 44;const ChatForm = memo(function ChatForm({index,@@ -186,6 +193,7 @@ const ChatForm = memo(function ChatForm({const composerBoxRef = useRef<HTMLDivElement>(null);useFocusChatEffect(textAreaRef);const localize = useLocalize();+ const remScale = useRemScale();const [isCollapsed, setIsCollapsed] = useState(false);const [, setIsScrollable] = useState(false);@@ -524,7 +532,7 @@ const ChatForm = memo(function ChatForm({}measuredRowCountRef.current = nextRowCount;setVisualRowCount(nextRowCount);- }, [textValue]);+ }, [textValue, remScale]);const isMoreThanThreeRows = visualRowCount > 3;@@ -696,8 +704,8 @@ const ChatForm = memo(function ChatForm({const baseClasses = useMemo(() =>cn(- 'md:py-3.5 m-0 w-full resize-none py-[13px] placeholder:text-text-tertiary bg-transparent [&:has(textarea:focus)]:shadow-[0_2px_6px_rgba(0,0,0,.05)]',- isCollapsed ? 'max-h-[52px]' : 'max-h-[45vh] md:max-h-[55vh]',+ 'md:py-3.5 m-0 w-full resize-none py-3.25 placeholder:text-text-tertiary bg-transparent [&:has(textarea:focus)]:shadow-[0_2px_6px_rgba(0,0,0,.05)]',+ isCollapsed ? 'max-h-[3.25rem]' : 'max-h-[45vh] md:max-h-[55vh]','px-5',),[isCollapsed],@@ -935,7 +943,7 @@ const ChatForm = memo(function ChatForm({`code-workspace-hint-${index}`,)}onClick={handleFocusOrClick}- style={{ height: 44, overflowY: 'auto' }}+ style={{ height: INITIAL_TEXTAREA_HEIGHT * remScale, overflowY: 'auto' }}className={cn(baseClasses,removeFocusRings,diff --git a/client/src/components/Chat/Input/DuringRunSendButton.tsx b/client/src/components/Chat/Input/DuringRunSendButton.tsxindex e9c2db3cc0..a3865f7983 100644--- a/client/src/components/Chat/Input/DuringRunSendButton.tsx+++ b/client/src/components/Chat/Input/DuringRunSendButton.tsx@@ -187,7 +187,7 @@ const DuringRunSendButton = React.memo(type="submit"><span data-state="closed">- <SendIcon size={24} />+ <SendIcon className="size-6" /></span></button>}diff --git a/client/src/components/Chat/Input/Files/DragDropModal.tsx b/client/src/components/Chat/Input/Files/DragDropModal.tsxindex 618ab20a15..5ebbfd1dd3 100644--- a/client/src/components/Chat/Input/Files/DragDropModal.tsx+++ b/client/src/components/Chat/Input/Files/DragDropModal.tsx@@ -91,7 +91,7 @@ const DragDropModal = () => {<OGDialog open={isVisible} onOpenChange={(open) => !open && closeModal()}><OGDialogTemplatetitle={localize('com_ui_upload_type')}- className="w-11/12 sm:w-[440px] md:w-[400px] lg:w-[360px]"+ className="w-11/12 sm:w-[min(27.5rem,90vw)] md:w-[min(25rem,90vw)] lg:w-[min(22.5rem,90vw)]"main={<div className="flex flex-col gap-2">{options.map((value) => {@@ -103,7 +103,7 @@ const DragDropModal = () => {routeFiles(files, value);closeModal();}}- className="flex items-center gap-2 rounded-lg p-2 hover:bg-surface-active-alt"+ className="hover:bg-surface-active-alt flex items-center gap-2 rounded-lg p-2">{icon}<span>{label}</span>diff --git a/client/src/components/Chat/Input/Files/FileUpload.tsx b/client/src/components/Chat/Input/Files/FileUpload.tsxindex ce89ae0828..a59323c7a2 100644--- a/client/src/components/Chat/Input/Files/FileUpload.tsx+++ b/client/src/components/Chat/Input/Files/FileUpload.tsx@@ -78,13 +78,13 @@ const FileUpload: React.FC<FileUploadProps> = ({size="sm"onClick={handleClick}className={cn(- 'mr-1 flex h-auto cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-normal text-text-secondary transition-colors hover:bg-surface-hover hover:text-status-success focus:ring-text-primary',+ 'text-text-secondary hover:bg-surface-hover hover:text-status-success focus:ring-text-primary mr-1 flex h-auto cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-normal transition-colors',statusColor,containerClassName,)}aria-label={statusText}>- <FileUp className="mr-1 flex w-[22px] items-center stroke-1" aria-hidden="true" />+ <FileUp className="mr-1 flex size-5.5 items-center stroke-1" aria-hidden="true" /><span className="flex text-xs">{statusText}</span></Button><inputdiff --git a/client/src/components/Chat/Input/Files/Table/ColumnVisibilityDropdown.tsx b/client/src/components/Chat/Input/Files/Table/ColumnVisibilityDropdown.tsxindex 1103924962..d528758a38 100644--- a/client/src/components/Chat/Input/Files/Table/ColumnVisibilityDropdown.tsx+++ b/client/src/components/Chat/Input/Files/Table/ColumnVisibilityDropdown.tsx@@ -53,7 +53,7 @@ export function ColumnVisibilityDropdown<TData>({}items={dropdownItems}menuId={menuId}- className="z-50 max-h-[300px] overflow-y-auto"+ className="z-50 max-h-[18.75rem] overflow-y-auto"/>);}diff --git a/client/src/components/Chat/Input/Files/Table/DataTable.tsx b/client/src/components/Chat/Input/Files/Table/DataTable.tsxindex c2e8a8c2b6..f8b33f483b 100644--- a/client/src/components/Chat/Input/Files/Table/DataTable.tsx+++ b/client/src/components/Chat/Input/Files/Table/DataTable.tsx@@ -132,7 +132,7 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTableProsetRowSelection({});}}disabled={!table.getFilteredSelectedRowModel().rows.length || isDeleting}- className={cn('min-w-[40px] transition-all duration-200', isSmallScreen && 'px-2 py-1')}+ className={cn('min-w-[2.5rem] transition-all duration-200', isSmallScreen && 'px-2 py-1')}>{isDeleting ? (<Spinner className="size-3.5 sm:size-4" />@@ -166,7 +166,7 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro<Tableunwrappedaria-rowcount={rows.length > 0 ? rows.length + 1 : undefined}- className="w-full min-w-[300px] border-separate border-spacing-0"+ className="w-full min-w-[18.75rem] border-separate border-spacing-0"><TableHeader sticky>{table.getHeaderGroups().map((headerGroup) => (diff --git a/client/src/components/Chat/Input/Mention.tsx b/client/src/components/Chat/Input/Mention.tsxindex 94de4e17d2..19ff8a437b 100644--- a/client/src/components/Chat/Input/Mention.tsx+++ b/client/src/components/Chat/Input/Mention.tsx@@ -2,7 +2,7 @@ import { memo, useState, useRef, useEffect } from 'react';import { AutoSizer, List } from 'react-virtualized';import { EModelEndpoint } from 'librechat-data-provider';import { useRecoilValue, useSetRecoilState } from 'recoil';-import { Input, Spinner, useCombobox } from '@librechat/client';+import { Input, Spinner, useCombobox, useRemScale } from '@librechat/client';import type { RecoilState } from 'recoil';import type { MentionOption, ConvoGenerator } from '~/common';import { useGetConversation, useLocalize, TranslationKeys } from '~/hooks';@@ -34,6 +34,7 @@ function MentionContent({includeAssistants = true,}: Omit<MentionProps, 'index'>) {const localize = useLocalize();+ const remScale = useRemScale();const getConversation = useGetConversation(0);const assistantsMap = useAssistantsMapContext();const setShowPopover = useSetRecoilState(popoverAtom);@@ -246,11 +247,11 @@ function MentionContent({<Listwidth={width}overscanRowCount={5}- rowHeight={ROW_HEIGHT}+ rowHeight={ROW_HEIGHT * remScale}rowCount={matches.length}rowRenderer={rowRenderer}scrollToIndex={activeIndex}- height={Math.min(matches.length * ROW_HEIGHT, 160)}+ height={Math.min(matches.length * ROW_HEIGHT, 160) * remScale}/>)}</AutoSizer>diff --git a/client/src/components/Chat/Input/MentionItem.tsx b/client/src/components/Chat/Input/MentionItem.tsxindex e89c046de4..88900bda23 100644--- a/client/src/components/Chat/Input/MentionItem.tsx+++ b/client/src/components/Chat/Input/MentionItem.tsx@@ -34,7 +34,7 @@ export default function MentionItem({><divclassName={cn(- 'text-text-primary group hover:bg-surface-secondary active:bg-surface-active flex min-h-[44px] items-center gap-2 rounded-lg px-2 text-sm font-medium',+ 'text-text-primary group hover:bg-surface-secondary active:bg-surface-active flex min-h-[2.75rem] items-center gap-2 rounded-lg px-2 text-sm font-medium',isActive === true ? 'bg-surface-active' : 'bg-transparent',)}>diff --git a/client/src/components/Chat/Input/OptionsPopover.tsx b/client/src/components/Chat/Input/OptionsPopover.tsxindex 698a40b57d..8aac76f3f2 100644--- a/client/src/components/Chat/Input/OptionsPopover.tsx+++ b/client/src/components/Chat/Input/OptionsPopover.tsx@@ -44,7 +44,7 @@ export default function OptionsPopover({const localize = useLocalize();const cardStyle =- 'shadow-xl rounded-md min-w-[75px] font-normal bg-surface-secondary border-border-light border text-text-primary';+ 'shadow-xl rounded-md min-w-[4.6875rem] font-normal bg-surface-secondary border-border-light border text-text-primary';if (!visible) {return null;@@ -57,18 +57,18 @@ export default function OptionsPopover({<divclassName={cn(cardStyle,- 'flex w-full flex-col overflow-hidden rounded-none border-s-0 border-t bg-surface-secondary px-0 pb-[10px] md:rounded-md md:border lg:w-[736px]',+ 'bg-surface-secondary flex w-full flex-col overflow-hidden rounded-none border-s-0 border-t px-0 pb-2.5 md:rounded-md md:border lg:w-[46rem] lg:max-w-[calc(100vw-2rem)]',)}>- <div className="flex w-full items-center bg-surface-tertiary px-2 py-2">+ <div className="bg-surface-tertiary flex w-full items-center px-2 py-2">{presetsDisabled ? null : (<Buttonvariant="default"type="button"- className="h-8 w-[150px] justify-start rounded-md px-2 text-xs font-normal"+ className="h-8 w-[9.375rem] justify-start rounded-md px-2 text-xs font-normal"onClick={saveAsPreset}>- <Save className="mr-1 w-[14px]" aria-hidden="true" />+ <Save className="mr-1 w-[0.875rem]" aria-hidden="true" />{localize('com_endpoint_save_as_preset')}</Button>)}@@ -77,7 +77,7 @@ export default function OptionsPopover({variant="ghost"size="icon"type="button"- className="ml-auto size-8 text-text-primary"+ className="text-text-primary ml-auto size-8"onClick={closePopover}aria-label={localize('com_ui_close')}>diff --git a/client/src/components/Chat/Input/PopoverButtons.tsx b/client/src/components/Chat/Input/PopoverButtons.tsxindex 2fdab285d1..2059603982 100644--- a/client/src/components/Chat/Input/PopoverButtons.tsx+++ b/client/src/components/Chat/Input/PopoverButtons.tsx@@ -55,7 +55,7 @@ export default function PopoverButtons({label: localize(showExamples === true ? 'com_hide_examples' : 'com_show_examples'),buttonClass: isGenerativeModel === true || isTextModel ? 'disabled' : '',handler: triggerExamples,- icon: <MessagesSquared className={cn('mr-1 w-[14px]', iconClass)} />,+ icon: <MessagesSquared className={cn('mr-1 w-[0.875rem]', iconClass)} />,},],};@@ -75,7 +75,7 @@ export default function PopoverButtons({buttonClass: '',type: 'alternative',handler: () => setSettingsView(SettingsViews.advanced),- icon: <DataIcon className={cn('mr-1 h-6 w-[14px]', iconClass)} />,+ icon: <DataIcon className={cn('mr-1 h-6 w-[0.875rem]', iconClass)} />,},],[SettingsViews.advanced]: [@@ -84,7 +84,7 @@ export default function PopoverButtons({buttonClass: '',type: 'alternative',handler: () => setSettingsView(SettingsViews.default),- icon: <AssistantIcon className={cn('mr-1 h-6 w-[14px]', iconClass)} />,+ icon: <AssistantIcon className={cn('mr-1 h-6 w-[0.875rem]', iconClass)} />,},],};@@ -102,8 +102,8 @@ export default function PopoverButtons({type="button"className={cn(button.buttonClass,- 'border border-border-medium focus:ring-1 focus:ring-ring-primary',- 'ml-1 h-full bg-transparent px-2 py-1 text-xs font-normal text-text-primary hover:bg-surface-hover',+ 'border-border-medium focus:ring-ring-primary border focus:ring-1',+ 'text-text-primary hover:bg-surface-hover ml-1 h-full bg-transparent px-2 py-1 text-xs font-normal',buttonClass ?? '',)}onClick={button.handler}@@ -114,15 +114,15 @@ export default function PopoverButtons({))}</div>{disabled ? null : (- <div className="flex w-[150px] items-center justify-end">+ <div className="flex w-[9.375rem] items-center justify-end">{additionalButtons[settingsView].map((button, index) => (<Buttonkey={`button-${index}`}type="button"className={cn(button.buttonClass,- 'flex justify-center border border-border-medium focus:ring-1 focus:ring-ring-primary',- 'h-full w-full bg-transparent px-2 py-1 text-xs font-normal text-text-primary hover:bg-surface-hover',+ 'border-border-medium focus:ring-ring-primary flex justify-center border focus:ring-1',+ 'text-text-primary hover:bg-surface-hover h-full w-full bg-transparent px-2 py-1 text-xs font-normal',buttonClass ?? '',)}onClick={button.handler}diff --git a/client/src/components/Chat/Input/PromptsCommand.tsx b/client/src/components/Chat/Input/PromptsCommand.tsxindex f4a52534c3..ac43b82813 100644--- a/client/src/components/Chat/Input/PromptsCommand.tsx+++ b/client/src/components/Chat/Input/PromptsCommand.tsx@@ -1,7 +1,7 @@import { useState, useRef, useEffect, useMemo, memo, useCallback } from 'react';import { AutoSizer, List } from 'react-virtualized';import { useSetRecoilState, useRecoilValue } from 'recoil';-import { Input, Spinner, useCombobox } from '@librechat/client';+import { Input, Spinner, useCombobox, useRemScale } from '@librechat/client';import type { TPromptGroup } from 'librechat-data-provider';import type { PromptOption } from '~/common';import useInitPopoverInput from '~/hooks/Input/useInitPopoverInput';@@ -63,6 +63,7 @@ function PromptsCommand({submitPrompt: (textPrompt: string) => void;}) {const localize = useLocalize();+ const remScale = useRemScale();const { mutate: recordUsage } = useRecordPromptUsage();const promptGroupsContext = usePromptGroupsContext();const { allPromptGroups, hasAccess, requestAllPromptGroups } = promptGroupsContext ?? {};@@ -278,11 +279,11 @@ function PromptsCommand({<Listwidth={width}overscanRowCount={5}- rowHeight={ROW_HEIGHT}+ rowHeight={ROW_HEIGHT * remScale}rowCount={matches.length}rowRenderer={rowRenderer}scrollToIndex={activeIndex}- height={Math.min(matches.length * ROW_HEIGHT, 160)}+ height={Math.min(matches.length * ROW_HEIGHT, 160) * remScale}/>)}</AutoSizer>diff --git a/client/src/components/Chat/Input/SendButton.tsx b/client/src/components/Chat/Input/SendButton.tsxindex 98c447a84a..75eb89a4a9 100644--- a/client/src/components/Chat/Input/SendButton.tsx+++ b/client/src/components/Chat/Input/SendButton.tsx@@ -30,7 +30,7 @@ const SubmitButton = React.memo(type="submit"><span className="" data-state="closed">- <SendIcon size={24} />+ <SendIcon className="size-6" /></span></IconButton>}diff --git a/client/src/components/Chat/Input/SkillsCommand.tsx b/client/src/components/Chat/Input/SkillsCommand.tsxindex e9b7a23ca3..74c3969341 100644--- a/client/src/components/Chat/Input/SkillsCommand.tsx+++ b/client/src/components/Chat/Input/SkillsCommand.tsx@@ -1,9 +1,9 @@import { memo, useState, useRef, useEffect, useMemo, useCallback } from 'react';import { ScrollText } from 'lucide-react';import { useSetRecoilState } from 'recoil';-import { useAtomValue, useSetAtom } from 'jotai';+import { useSetAtom, useAtomValue } from 'jotai';import { AutoSizer, List } from 'react-virtualized';-import { Input, Spinner, useCombobox } from '@librechat/client';+import { Input, Spinner, useCombobox, useRemScale } from '@librechat/client';import { SkillsScope, resolveAgentSkillsScope } from 'librechat-data-provider';import type { TSkillSummary } from 'librechat-data-provider';import type { MentionOption } from '~/common';@@ -89,6 +89,7 @@ function SkillsCommandContent({agentId?: string | null;}) {const localize = useLocalize();+ const remScale = useRemScale();const setShowSkillsPopover = useSetAtom(showSkillsPopoverFamily(index));const setEphemeralAgent = useSetRecoilState(ephemeralAgentByConvoId(conversationId));const setPendingManualSkills = useSetRecoilState(@@ -358,11 +359,11 @@ function SkillsCommandContent({<Listwidth={width}overscanRowCount={5}- rowHeight={ROW_HEIGHT}+ rowHeight={ROW_HEIGHT * remScale}rowCount={matches.length}rowRenderer={rowRenderer}scrollToIndex={activeIndex}- height={Math.min(matches.length * ROW_HEIGHT, 160)}+ height={Math.min(matches.length * ROW_HEIGHT, 160) * remScale}/>)}</AutoSizer>diff --git a/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx b/client/src/components/Chat/Input/TokenUsage/Breakdown.tsxindex 55fca18cbe..760c0711a0 100644--- a/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx+++ b/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx@@ -351,17 +351,17 @@ export default function Breakdown({hoveredSegment != null && hoverIsValid(hoveredSegment) ? hoveredSegment : null;return (- <div className="w-72" role="region" aria-label={localize('com_ui_context_usage')}>+ <div className="w-full" role="region" aria-label={localize('com_ui_context_usage')}><Collapsible open={expanded} onOpenChange={setExpanded}><CollapsibleTriggerfocusOutline="hidden"- className="group focus-visible:ring-text-primary flex w-full items-center justify-between gap-2 rounded-sm focus-visible:ring-2"+ className="group focus-visible:ring-text-primary flex w-full flex-wrap items-center justify-between gap-2 rounded-sm focus-visible:ring-2"data-testid="context-breakdown-toggle">- <span className="text-text-primary text-sm font-medium whitespace-nowrap">+ <span className="text-text-primary min-w-0 text-left text-sm font-medium">{localize('com_ui_context_window')}</span>- <span className="text-text-secondary flex items-center gap-1 text-xs font-medium whitespace-nowrap">+ <span className="text-text-secondary flex min-w-0 items-center gap-1 text-xs font-medium">{maxTokens != null? `${formatTokens(usedTokens)} / ${formatTokens(maxTokens)} (${Math.round(percent)}%)`: formatTokens(usedTokens)}diff --git a/client/src/components/Chat/Input/TokenUsage/Gauge.tsx b/client/src/components/Chat/Input/TokenUsage/Gauge.tsxindex 8a763fdf79..a61151cc23 100644--- a/client/src/components/Chat/Input/TokenUsage/Gauge.tsx+++ b/client/src/components/Chat/Input/TokenUsage/Gauge.tsx@@ -33,7 +33,7 @@ export default function Gauge({ percent, indeterminate }: GaugeProps) {width={SIZE}height={SIZE}viewBox={`0 0 ${SIZE} ${SIZE}`}- className="-rotate-90"+ className="size-5 -rotate-90"aria-hidden="true"focusable="false">diff --git a/client/src/components/Chat/Input/TokenUsage/index.tsx b/client/src/components/Chat/Input/TokenUsage/index.tsxindex a6d2f80369..14b4270f45 100644--- a/client/src/components/Chat/Input/TokenUsage/index.tsx+++ b/client/src/components/Chat/Input/TokenUsage/index.tsx@@ -236,7 +236,7 @@ function TokenUsageIndicator({}}}className={cn(- 'border-border-medium bg-surface-secondary text-text-primary z-[200] max-h-[calc(100dvh-1rem)] overflow-y-auto overscroll-contain rounded-xl border p-3 shadow-lg focus:outline-hidden',+ 'border-border-medium bg-surface-secondary text-text-primary z-[200] max-h-[calc(100dvh-1rem)] max-w-[calc(100vw-1rem)] overflow-y-auto overscroll-contain rounded-xl border p-3 shadow-lg focus:outline-hidden','origin-bottom translate-y-1 scale-95 opacity-0 transition-[opacity,transform] duration-150 ease-out motion-reduce:transition-none','data-[enter]:translate-y-0 data-[enter]:scale-100 data-[enter]:opacity-100','data-[leave]:translate-y-1 data-[leave]:scale-95 data-[leave]:opacity-0',@@ -244,7 +244,7 @@ function TokenUsageIndicator({>{/* The popover owns its width, which the breakdown held only while itwas the sole child of a shrink-to-fit box. */}- <div className="w-72 space-y-3">+ <div className="w-72 max-w-full space-y-3"><Breakdownview={view}showCost={showCost}diff --git a/client/src/components/Chat/Landing.tsx b/client/src/components/Chat/Landing.tsxindex 6abba8947a..e3dd66d63c 100644--- a/client/src/components/Chat/Landing.tsx+++ b/client/src/components/Chat/Landing.tsx@@ -2,7 +2,7 @@ import { useMemo, useCallback, useState, useEffect, useRef } from 'react';import { HatGlasses } from 'lucide-react';import { easings } from '@react-spring/web';import { EModelEndpoint } from 'librechat-data-provider';-import { BirthdayIcon, TooltipAnchor, SplitText } from '@librechat/client';+import { BirthdayIcon, TooltipAnchor, SplitText, useRemScale } from '@librechat/client';import { useChatContext, useAgentsMapContext, useAssistantsMapContext } from '~/Providers';import Description, { isHtmlDescription } from '~/components/ui/Description';import { useGetEndpointsQuery, useGetStartupConfig } from '~/data-provider';@@ -44,6 +44,7 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding:const { data: endpointsConfig } = useGetEndpointsQuery();const { user } = useAuthContext();const localize = useLocalize();+ const remScale = useRemScale();const { isTemporary } = useChatSettings();const [textHasMultipleLines, setTextHasMultipleLines] = useState(false);@@ -102,7 +103,7 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding:if (contentRef.current) {setContentHeight(contentRef.current.offsetHeight);}- }, [lineCount, description, selectedAgent]);+ }, [lineCount, description, selectedAgent, remScale]);const getDynamicMargin = useMemo(() => {let margin = 'mb-0';@@ -160,7 +161,7 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding:)}{startupConfig?.showBirthdayIcon && (<TooltipAnchor- className="absolute right-2 bottom-[27px]"+ className="absolute right-2 bottom-[1.6875rem]"description={localize('com_ui_happy_birthday')}aria-label={localize('com_ui_happy_birthday')}>diff --git a/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsx b/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsxindex 56a89056f0..99517edc35 100644--- a/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsx+++ b/client/src/components/Chat/Menus/Endpoints/CustomMenu.tsx@@ -73,11 +73,11 @@ export const CustomMenu = React.forwardRef<HTMLDivElement, CustomMenuProps>(funcgutter={parent ? -4 : 4}className={cn(parent ? 'animate-popover-left ml-3' : 'animate-popover',- 'z-40 flex max-h-[min(450px,var(--popover-available-height))] w-full outline-hidden!',- 'border-border-light w-[var(--menu-width,auto)] min-w-[300px] flex-col overflow-auto rounded-xl border',+ 'z-40 flex max-h-[min(28.125rem,var(--popover-available-height))] w-full outline-hidden!',+ 'border-border-light w-[var(--menu-width,auto)] min-w-[min(18.75rem,90vw)] flex-col overflow-auto rounded-xl border','bg-presentation text-text-primary text-sm shadow-lg',parent ? 'px-0.5 py-0.5' : 'px-3 py-2',- 'max-w-[calc(100vw-4rem)] sm:max-h-[calc(65vh)] sm:max-w-[400px]',+ 'max-w-[calc(100vw-4rem)] sm:max-h-[calc(65vh)] sm:max-w-[25rem]',searchable && 'p-0',)}>@@ -179,7 +179,7 @@ export const CustomMenuItem = React.forwardRef<HTMLDivElement, CustomMenuItemPro* bg-presentation, which resolves to the same value as* surface-secondary in dark and within 3/255 of it in light, so an* active item styled that way cannot render against its own popover. */- 'relative flex w-full min-w-0 cursor-default scroll-m-1 scroll-mt-[calc(var(--combobox-height,0px)+var(--label-height,4px))] items-center gap-2 rounded-lg px-2 py-1 outline-hidden! hover:bg-surface-hover aria-disabled:opacity-25 aria-selected:bg-surface-hover data-[active-item]:bg-surface-hover data-[active-item]:text-text-primary sm:text-sm before:absolute before:bottom-1 before:left-0 before:top-1 before:w-0.5 before:rounded-full before:bg-transparent data-[active-item]:before:bg-text-primary',+ 'relative flex w-full min-w-0 cursor-default scroll-m-1 scroll-mt-[calc(var(--combobox-height,0px)+var(--label-height,0.25rem))] items-center gap-2 rounded-lg px-2 py-1 outline-hidden! hover:bg-surface-hover aria-disabled:opacity-25 aria-selected:bg-surface-hover data-[active-item]:bg-surface-hover data-[active-item]:text-text-primary sm:text-sm before:absolute before:bottom-1 before:left-0 before:top-1 before:w-0.5 before:rounded-full before:bg-transparent data-[active-item]:before:bg-text-primary',props.className,),};diff --git a/client/src/components/Chat/Menus/Endpoints/components/GroupIcon.tsx b/client/src/components/Chat/Menus/Endpoints/components/GroupIcon.tsxindex f169a1baa9..015335e69a 100644--- a/client/src/components/Chat/Menus/Endpoints/components/GroupIcon.tsx+++ b/client/src/components/Chat/Menus/Endpoints/components/GroupIcon.tsx@@ -1,6 +1,6 @@import React, { memo, useState } from 'react';import { AlertCircle } from 'lucide-react';-import { ProviderIcon } from '@librechat/client';+import { pxToRem, ProviderIcon } from '@librechat/client';import { resolveProviderId } from 'librechat-data-provider';import { EntityEndpointMark, isEntityEndpoint } from '~/components/Endpoints/EntityEndpointMark';import CustomIcon from '~/components/ui/CustomIcon';@@ -21,7 +21,11 @@ const GroupIcon: React.FC<GroupIconProps> = ({ iconURL, groupName }) => {if (isEntityEndpoint(iconURL)) {return (- <div className="relative" style={{ width: 20, height: 20, margin: '2px' }} title={groupName}>+ <div+ className="relative"+ style={{ width: pxToRem(20), height: pxToRem(20), margin: pxToRem(2) }}+ title={groupName}+ ><EntityEndpointMark endpoint={iconURL} /></div>);@@ -29,14 +33,17 @@ const GroupIcon: React.FC<GroupIconProps> = ({ iconURL, groupName }) => {if (provider || !isImageURL(iconURL) || imageError) {return (- <div className="relative" style={{ width: 20, height: 20, margin: '2px' }}>+ <div+ className="relative"+ style={{ width: pxToRem(20), height: pxToRem(20), margin: pxToRem(2) }}+ ><ProviderIcon provider={provider} size={20} className="icon-md shrink-0" />{imageError && (<div- className="absolute flex items-center justify-center rounded-full bg-surface-destructive"- style={{ width: '14px', height: '14px', top: 0, right: 0 }}+ className="bg-surface-destructive absolute flex items-center justify-center rounded-full"+ style={{ width: pxToRem(14), height: pxToRem(14), top: 0, right: 0 }}>- <AlertCircle size={10} className="text-text-on-status" />+ <AlertCircle className="text-text-on-status size-2.5" /></div>)}</div>@@ -45,8 +52,8 @@ const GroupIcon: React.FC<GroupIconProps> = ({ iconURL, groupName }) => {return (<div- className="icon-md shrink-0 overflow-hidden rounded-full text-text-primary"- style={{ width: 20, height: 20 }}+ className="icon-md text-text-primary shrink-0 overflow-hidden rounded-full"+ style={{ width: pxToRem(20), height: pxToRem(20) }}><CustomIconsrc={iconURL}diff --git a/client/src/components/Chat/Menus/Endpoints/components/SpecIcon.tsx b/client/src/components/Chat/Menus/Endpoints/components/SpecIcon.tsxindex fc225e99df..ee8362b297 100644--- a/client/src/components/Chat/Menus/Endpoints/components/SpecIcon.tsx+++ b/client/src/components/Chat/Menus/Endpoints/components/SpecIcon.tsx@@ -1,5 +1,5 @@import React, { memo } from 'react';-import { ProviderIcon } from '@librechat/client';+import { pxToRem, ProviderIcon } from '@librechat/client';import type { TModelSpec, TEndpointsConfig } from 'librechat-data-provider';import { EntityEndpointMark, isEntityEndpoint } from '~/components/Endpoints/EntityEndpointMark';import { URLIcon } from '~/components/Endpoints/URLIcon';@@ -24,7 +24,7 @@ const SpecIcon: React.FC<SpecIconProps> = ({ currentSpec, endpointsConfig, agent<URLIconiconURL={imageURL}altName={currentSpec.name}- containerStyle={{ width: 20, height: 20 }}+ containerStyle={{ width: pxToRem(20), height: pxToRem(20) }}className="icon-md shrink-0 overflow-hidden rounded-full"provider={fallbackProvider}/>diff --git a/client/src/components/Chat/Menus/Endpoints/components/VirtualizedModelList.tsx b/client/src/components/Chat/Menus/Endpoints/components/VirtualizedModelList.tsxindex 678f8f6c51..19e926b105 100644--- a/client/src/components/Chat/Menus/Endpoints/components/VirtualizedModelList.tsx+++ b/client/src/components/Chat/Menus/Endpoints/components/VirtualizedModelList.tsx@@ -1,5 +1,6 @@import { useCallback, useEffect, useMemo, useRef } from 'react';import * as Ariakit from '@ariakit/react';+import { useRemScale } from '@librechat/client';import { AutoSizer, List } from 'react-virtualized';import type { ListRowProps } from 'react-virtualized';import type { Endpoint } from '~/common';@@ -50,6 +51,7 @@ export default function VirtualizedModelList({const listRef = useRef<List>(null);const containerRef = useRef<HTMLDivElement>(null);const combobox = Ariakit.useComboboxContext();+ const remScale = useRemScale();const indexSuffix = endpointIndex != null ? `-${endpointIndex}` : '';const rowCount = modelIds.length;@@ -119,9 +121,10 @@ export default function VirtualizedModelList({return () => document.removeEventListener('keydown', handleBoundaryNavigation, true);}, [combobox, precedingOptionCount, rowCount, rowAt]);+ const rowHeight = ROW_HEIGHT * remScale;const height = useMemo(- () => Math.min(MAX_LIST_HEIGHT, Math.max(ROW_HEIGHT, rowCount * ROW_HEIGHT)),- [rowCount],+ () => Math.min(MAX_LIST_HEIGHT * remScale, Math.max(rowHeight, rowCount * rowHeight)),+ [rowCount, rowHeight, remScale],);const rowRenderer = useCallback(@@ -166,7 +169,7 @@ export default function VirtualizedModelList({width={width}height={height}rowCount={rowCount}- rowHeight={ROW_HEIGHT}+ rowHeight={rowHeight}overscanRowCount={OVERSCAN}rowRenderer={rowRenderer}className="outline-hidden!"diff --git a/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx b/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsxindex c717d340e1..694ea6b9c1 100644--- a/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx+++ b/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx@@ -143,7 +143,7 @@ const EditPresetDialog = ({return (<OGDialog open={presetModalVisible} onOpenChange={handleOpenChange} triggerRef={triggerRef}>- <OGDialogContent className="flex h-[100dvh] max-h-[100dvh] w-full max-w-full flex-col overflow-y-visible bg-surface-dialog md:h-auto md:max-h-[90vh] md:max-w-[75vw] md:rounded-theme-surface lg:max-w-[950px]">+ <OGDialogContent className="bg-surface-dialog md:rounded-theme-surface flex h-[100dvh] max-h-[100dvh] w-full max-w-full flex-col overflow-y-visible md:h-auto md:max-h-[90vh] md:max-w-[75vw] lg:max-w-[59.375rem]"><OGDialogTitle className="shrink-0">{localize('com_ui_edit_preset_title', { title: preset?.title })}</OGDialogTitle>@@ -163,7 +163,7 @@ const EditPresetDialog = ({value={(title as string | undefined) ?? ''}onChange={onTitleChange}placeholder={localize('com_endpoint_set_custom_name')}- className="h-9 w-full rounded-theme-control border-border-medium px-3 py-2"+ className="rounded-theme-control border-border-medium h-9 w-full px-3 py-2"/></div><div className="flex w-full flex-col">@@ -191,7 +191,7 @@ const EditPresetDialog = ({{/* PopoverButtons section */}<div className="flex w-full"><PopoverButtons- buttonClass="ml-0 w-full border border-border-medium p-2 h-[40px] justify-center mt-0"+ buttonClass="ml-0 w-full border border-border-medium p-2 h-[2.5rem] justify-center mt-0"iconClass="hidden lg:block w-4"endpoint={endpoint}endpointType={endpointType}@@ -200,7 +200,7 @@ const EditPresetDialog = ({</div>{/* Separator */}- <div className="w-full border-t border-border-medium" />+ <div className="border-border-medium w-full border-t" />{/* Settings section. The shared component ships a fixed-height scrollbox; overriding it to auto lets the dialog own the single scroll@@ -210,13 +210,13 @@ const EditPresetDialog = ({conversation={preset}setOption={setOption}isPreset={true}- className="h-auto overflow-visible text-text-primary md:h-auto"+ className="text-text-primary h-auto overflow-visible md:h-auto"/></div></div>{/* Action buttons */}- <div className="flex shrink-0 justify-end gap-2 border-t border-border-medium pt-3">+ <div className="border-border-medium flex shrink-0 justify-end gap-2 border-t pt-3"><Button variant="outline" onClick={exportPreset}>{localize('com_endpoint_export')}</Button>diff --git a/client/src/components/Chat/Menus/Presets/PresetItems.tsx b/client/src/components/Chat/Menus/Presets/PresetItems.tsxindex 2a83a7f4fb..bfee89adac 100644--- a/client/src/components/Chat/Menus/Presets/PresetItems.tsx+++ b/client/src/components/Chat/Menus/Presets/PresetItems.tsx@@ -109,7 +109,7 @@ const PresetItems: FC<{return (<>- <div className="border-border-light bg-surface-secondary flex min-w-[300px] items-center gap-3 border-b px-3 py-2 md:min-w-[400px]">+ <div className="border-border-light bg-surface-secondary flex min-w-[min(18.75rem,90vw)] items-center gap-3 border-b px-3 py-2 md:min-w-[min(25rem,90vw)]"><div className="min-w-0 flex-1"><p className="text-text-primary text-sm font-medium">{localize('com_endpoint_examples')}diff --git a/client/src/components/Chat/Menus/PresetsMenu.tsx b/client/src/components/Chat/Menus/PresetsMenu.tsxindex 855e3ba08f..36b6cf894e 100644--- a/client/src/components/Chat/Menus/PresetsMenu.tsx+++ b/client/src/components/Chat/Menus/PresetsMenu.tsx@@ -90,7 +90,7 @@ const PresetsMenu: FC = () => {sideOffset={8}collisionPadding={16}aria-label={localize('com_endpoint_examples')}- className="rounded-theme-surface border-border-light bg-presentation text-text-primary z-50 max-h-[495px] overflow-x-hidden border shadow-lg md:min-w-[400px]"+ className="rounded-theme-surface border-border-light bg-presentation text-text-primary z-50 max-h-[min(30.9375rem,80vh)] overflow-x-hidden border shadow-lg md:min-w-[min(25rem,90vw)]"><PresetItemspresets={presetsQuery.data}diff --git a/client/src/components/Chat/Menus/UI/MenuItem.tsx b/client/src/components/Chat/Menus/UI/MenuItem.tsxindex ab4cdfbd3d..0b3d134107 100644--- a/client/src/components/Chat/Menus/UI/MenuItem.tsx+++ b/client/src/components/Chat/Menus/UI/MenuItem.tsx@@ -38,7 +38,7 @@ const MenuItem: FC<MenuItemProps> = ({aria-label={title}data-testid="chat-menu-item"className={cn(- 'group hover:bg-surface-hover m-1.5 flex cursor-pointer gap-2 rounded px-5 py-2.5 !pr-3 text-sm !opacity-100 focus:ring-0 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 md:min-w-[240px]',+ 'group hover:bg-surface-hover m-1.5 flex cursor-pointer gap-2 rounded px-5 py-2.5 !pr-3 text-sm !opacity-100 focus:ring-0 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 md:min-w-[15rem]',className || '',)}tabIndex={0} // Change to 0 to make it focusablediff --git a/client/src/components/Chat/Messages/Content/Container.tsx b/client/src/components/Chat/Messages/Content/Container.tsxindex 042dc68c2f..7542feee84 100644--- a/client/src/components/Chat/Messages/Content/Container.tsx+++ b/client/src/components/Chat/Messages/Content/Container.tsx@@ -5,7 +5,7 @@ import Files from './Files';const Container = ({ children, message }: { children: React.ReactNode; message?: TMessage }) => (<div- className="text-message flex min-h-[20px] flex-col items-start gap-3 overflow-visible [.text-message+&]:mt-5"+ className="text-message flex min-h-[1.25rem] flex-col items-start gap-3 overflow-visible [.text-message+&]:mt-5"dir="auto">{message?.isCreatedByUser === true && (diff --git a/client/src/components/Chat/Messages/Content/DialogImage.tsx b/client/src/components/Chat/Messages/Content/DialogImage.tsxindex 889b583ee7..7d735ffd6f 100644--- a/client/src/components/Chat/Messages/Content/DialogImage.tsx+++ b/client/src/components/Chat/Messages/Content/DialogImage.tsx@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback, useRef } from 'react';import { PanelLeftOpen, PanelLeftClose } from 'lucide';import * as DialogPrimitive from '@radix-ui/react-dialog';import { X, ArrowDownToLine, RotateCcw } from 'lucide-react';-import { Button, MorphIcon, TooltipAnchor } from '@librechat/client';+import { Button, MorphIcon, TooltipAnchor, useMediaQuery, useRemScale } from '@librechat/client';import { useLocalize } from '~/hooks';const imageSizeCache = new Map<string, string>();@@ -245,16 +245,16 @@ export default function DialogImage({? localize('com_ui_hide_image_details'): localize('com_ui_show_image_details');- // Calculate image max dimensions accounting for side panel (w-80 = 320px)- const getImageMaxWidth = () => {- if (isPromptOpen) {- // On mobile, panel overlays so use full width; on desktop, subtract panel width- return typeof window !== 'undefined' && window.innerWidth >= 640- ? 'calc(90vw - 320px)'- : '90vw';- }- return '90vw';- };+ /* The details panel is 20rem wide, so the viewport it has to fit beside has to be+ measured in the same units: a fixed 640px breakpoint puts the panel beside the+ image at scales where 20rem leaves almost nothing for the image and pushes the+ action controls offscreen. Below it the panel overlays instead, as on mobile. */+ const remScale = useRemScale();+ const detailsFitBesideImage = useMediaQuery(`(min-width: ${640 * remScale}px)`);+ const detailsBeside = isPromptOpen && detailsFitBesideImage;++ // Reserve the side panel's width (w-80 = 20rem) only when it sits beside the image+ const getImageMaxWidth = () => (detailsBeside ? 'calc(90vw - 20rem)' : '90vw');return (<DialogPrimitive.Root open={isOpen} onOpenChange={onOpenChange}>@@ -297,9 +297,9 @@ export default function DialogImage({/></div>- {/* Action buttons - top right (336px = 320px panel + 16px gap) */}+ {/* Action buttons - top right (21rem = 20rem panel + 1rem gap) */}<div- className={`absolute top-4 z-20 flex items-center gap-2 transition-[right] duration-300 ${isPromptOpen ? 'right-[336px]' : 'right-4'}`}+ className={`absolute top-4 z-20 flex items-center gap-2 transition-[right] duration-300 ${detailsBeside ? 'right-[21rem]' : 'right-4'}`}>{zoom > 1 && (<TooltipAnchor@@ -351,7 +351,7 @@ export default function DialogImage({{/* Image container - centered */}<div- className={`transition-[margin] duration-300 ${isPromptOpen ? 'mr-80' : ''}`}+ className={`transition-[margin] duration-300 ${detailsBeside ? 'mr-80' : ''}`}onClick={(e) => e.stopPropagation()}><div@@ -391,7 +391,7 @@ export default function DialogImage({{showDetails && (<divdata-side-panel- 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 ${+ className={`bg-surface-primary border-text-on-media/10 fixed top-0 right-0 z-30 h-full w-80 max-w-full transform border-l shadow-2xl transition-transform duration-300 ${isPromptOpen ? 'translate-x-0' : 'translate-x-full'}`}onClick={(e) => e.stopPropagation()}@@ -404,7 +404,8 @@ export default function DialogImage({<ButtononClick={() => setIsPromptOpen(false)}variant="ghost"- className="h-10 w-10 p-0 sm:hidden"+ className={detailsBeside ? 'hidden' : 'h-10 w-10 p-0'}+ aria-label={localize('com_ui_hide_image_details')}><X className="size-5" aria-hidden="true" /></Button>diff --git a/client/src/components/Chat/Messages/Content/MemoryArtifacts.tsx b/client/src/components/Chat/Messages/Content/MemoryArtifacts.tsxindex d1538d313d..cd7bb6d039 100644--- a/client/src/components/Chat/Messages/Content/MemoryArtifacts.tsx+++ b/client/src/components/Chat/Messages/Content/MemoryArtifacts.tsx@@ -90,7 +90,7 @@ export default function MemoryArtifacts({ attachments }: { attachments?: TAttachfill="currentColor"/><path- d="M11.3512 15.5297L9.73505 15.8529C9.38519 15.9229 9.07673 15.6144 9.14671 15.2646L9.46993 13.6484C9.48929 13.5517 9.53687 13.4628 9.60667 13.393L12.9996 10C13.5519 9.44771 14.4473 9.44771 14.9996 10C15.5519 10.5523 15.5519 11.4477 14.9996 12L11.6067 15.393C11.5369 15.4628 11.448 15.5103 11.3512 15.5297Z"+ d="M11.3512 15.5297L9.73505 15.8529C9.38519 15.9229 9.07673 15.6144 9.14671 15.2646L9.46993 13.6484C9.48929 13.5517 9.53687 13.4628 9.60667 13.393L12.9996 10C13.5519 9.44771 14.4473 9.44771 14.9996 10C15.5519 10.5523 15.5519 11.4477 14.9996 12L11.6067 15.393C11.5369 15.4629 11.448 15.5103 11.3512 15.5297Z"fill="currentColor"/></svg>@@ -100,7 +100,7 @@ export default function MemoryArtifacts({ attachments }: { attachments?: TAttach<ChevronDownclassName={cn(disclosureChevronVariants({ expanded: showInfo }),- 'size-4 translate-y-[1px]',+ 'size-4 translate-y-[0.0625rem]',)}aria-hidden="true"/>@@ -117,7 +117,7 @@ export default function MemoryArtifacts({ attachments }: { attachments?: TAttach<divclassName={cn(toolPanelSpacingClassName,- 'overflow-hidden rounded-lg border border-border-light bg-surface-secondary',+ 'border-border-light bg-surface-secondary overflow-hidden rounded-lg border',)}>{showInfo && <MemoryInfo key="memory-info" memoryArtifacts={memoryArtifacts} />}diff --git a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsxindex 56046f7c48..efe3216244 100644--- a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx@@ -1,6 +1,6 @@import { memo, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';-import { Button } from '@librechat/client';import { Tools } from 'librechat-data-provider';+import { Button, useRemScale } from '@librechat/client';import { Loader2, AlertCircle, Download, ChevronDown, Files as FilesIcon } from 'lucide-react';import type { TAttachment, TFile, TAttachmentMetadata } from 'librechat-data-provider';import type { ToolArtifactType } from '~/utils/artifacts';@@ -25,6 +25,7 @@ import { useAttachmentLink } from './LogLink';import { cn } from '~/utils';const COLLAPSED_MAX_HEIGHT = 320;+const OVERFLOW_TOLERANCE = 1;/*** Row placeholder for a code-execution office file whose inline preview@@ -294,13 +295,13 @@ const TextAttachment = memo(showFileChip?: boolean;}) => {const localize = useLocalize();+ const remScale = useRemScale();+ const collapsedMaxHeight = COLLAPSED_MAX_HEIGHT * remScale;+ const overflowTolerance = OVERFLOW_TOLERANCE * remScale;const preId = useId();const preRef = useRef<HTMLPreElement>(null);const [isVisible, setIsVisible] = useState(false);const [expanded, setExpanded] = useState(false);- // Decided once after layout: does the text actually overflow the collapsed- // height? Char count is a poor proxy (a 100-char file with many newlines can- // overflow; 800 chars of dense single-line text may not), so we measure.const [overflowed, setOverflowed] = useState(false);const file = attachment as TFile & TAttachmentMetadata;const { handleDownload } = useAttachmentLink({@@ -324,8 +325,8 @@ const TextAttachment = memo(if (!el) {return;}- setOverflowed(el.scrollHeight > COLLAPSED_MAX_HEIGHT + 1);- }, [text]);+ setOverflowed(el.scrollHeight > collapsedMaxHeight + overflowTolerance);+ }, [text, collapsedMaxHeight, overflowTolerance]);const isClamped = overflowed && !expanded;@@ -379,7 +380,7 @@ const TextAttachment = memo('text-text-primary font-mono text-sm leading-6 break-words whitespace-pre-wrap',isClamped ? 'overflow-hidden' : 'overflow-auto',)}- style={isClamped ? { maxHeight: COLLAPSED_MAX_HEIGHT } : undefined}+ style={isClamped ? { maxHeight: collapsedMaxHeight } : undefined}>{text}</pre>diff --git a/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx b/client/src/components/Chat/Messages/Content/Parts/BashCall.tsxindex 860d97480a..9c158a0978 100644--- a/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx@@ -226,7 +226,7 @@ export default function BashCall({<divref={commandPaneRef}onScroll={onCommandPaneScroll}- className="max-h-[300px] overflow-auto"+ className="max-h-[18.75rem] overflow-auto"><pre className="px-3 py-2.5 font-mono text-xs break-words whitespace-pre-wrap"><span className="text-text-tertiary select-none" aria-hidden="true">diff --git a/client/src/components/Chat/Messages/Content/Parts/CollapsibleText.tsx b/client/src/components/Chat/Messages/Content/Parts/CollapsibleText.tsxindex 7935ddccde..0ef2a43445 100644--- a/client/src/components/Chat/Messages/Content/Parts/CollapsibleText.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/CollapsibleText.tsx@@ -1,11 +1,11 @@import { useLayoutEffect, memo, useId, useRef, useState } from 'react';-import { Button } from '@librechat/client';import { ChevronDown, ChevronUp } from 'lucide-react';+import { Button, useRemScale } from '@librechat/client';import type { ReactNode } from 'react';import { useLocalize } from '~/hooks';import { cn } from '~/utils';-/** Collapsed preview height (px) for a long message before "Show more". The+/** Collapsed preview height (baseline px) for a long message before "Show more". The* tolerance below only decides whether the toggle appears: it absorbs the* trailing markdown margin so content that fits but for its own bottom margin* does not trip a pointless toggle. The clamp itself is applied only once the@@ -29,6 +29,9 @@ const CollapsibleText = memo(function CollapsibleText({children: ReactNode;}) {const localize = useLocalize();+ const remScale = useRemScale();+ const collapsedMaxHeight = COLLAPSED_MAX_HEIGHT * remScale;+ const overflowTolerance = OVERFLOW_TOLERANCE * remScale;const contentRef = useRef<HTMLDivElement>(null);const contentId = useId();const [expanded, setExpanded] = useState(false);@@ -55,8 +58,7 @@ const CollapsibleText = memo(function CollapsibleText({if (el == null) {return;}- const measure = () =>- setOverflowing(el.scrollHeight - COLLAPSED_MAX_HEIGHT > OVERFLOW_TOLERANCE);+ const measure = () => setOverflowing(el.scrollHeight - collapsedMaxHeight > overflowTolerance);measure();if (typeof ResizeObserver === 'undefined') {return;@@ -64,7 +66,7 @@ const CollapsibleText = memo(function CollapsibleText({const observer = new ResizeObserver(measure);observer.observe(el);return () => observer.disconnect();- }, [enabled]);+ }, [enabled, collapsedMaxHeight, overflowTolerance]);if (!enabled) {return <>{children}</>;@@ -83,7 +85,7 @@ const CollapsibleText = memo(function CollapsibleText({return;}const target = event.target as HTMLElement;- const boundary = event.currentTarget.getBoundingClientRect().top + COLLAPSED_MAX_HEIGHT;+ const boundary = event.currentTarget.getBoundingClientRect().top + collapsedMaxHeight;if (target.getBoundingClientRect().bottom > boundary) {setExpanded(true);}@@ -94,7 +96,7 @@ const CollapsibleText = memo(function CollapsibleText({<divid={contentId}className={cn('relative w-full', clamped && 'overflow-hidden')}- style={clamped ? { maxHeight: COLLAPSED_MAX_HEIGHT } : undefined}+ style={clamped ? { maxHeight: collapsedMaxHeight } : undefined}onFocus={revealIfClipped}><div ref={contentRef} className="w-full">@@ -102,7 +104,7 @@ const CollapsibleText = memo(function CollapsibleText({</div>{clamped && (<div- className="pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-surface-tertiary to-transparent"+ className="from-surface-tertiary pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent"aria-hidden="true"/>)}diff --git a/client/src/components/Chat/Messages/Content/Parts/EmptyText.tsx b/client/src/components/Chat/Messages/Content/Parts/EmptyText.tsxindex 8ae7d16cfd..ef2599a1e5 100644--- a/client/src/components/Chat/Messages/Content/Parts/EmptyText.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/EmptyText.tsx@@ -16,7 +16,7 @@ type EmptyTextPartProps = {/** Streaming cursor placeholder — no bottom margin to match Container's structure and prevent CLS */const EmptyTextPart = memo(({ underHeaderIcon = false }: EmptyTextPartProps) => {return (- <div className="text-message flex min-h-[20px] flex-col items-start gap-3 overflow-visible">+ <div className="text-message flex min-h-[1.25rem] flex-col items-start gap-3 overflow-visible"><div className="markdown prose dark:prose-invert light w-full break-words"><div className={cn('absolute', underHeaderIcon && 'ps-1.5')}><p className="submitting relative">diff --git a/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx b/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsxindex d3cfa66cf8..693660f148 100644--- a/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx@@ -185,7 +185,7 @@ export default function ExecuteCode({<preref={codePaneRef}onScroll={onCodePaneScroll}- className="bg-surface-code-body max-h-[300px] overflow-auto p-4 font-mono text-xs"+ className="bg-surface-code-body max-h-[18.75rem] overflow-auto p-4 font-mono text-xs"><code className={`hljs language-${lang} !whitespace-pre`}>{highlighted ?? code}@@ -211,7 +211,7 @@ export default function ExecuteCode({</div><divclassName={cn(- 'max-h-[200px] overflow-auto',+ 'max-h-[12.5rem] overflow-auto',outputHasError ? 'text-status-error' : 'text-text-primary',)}>diff --git a/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx b/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsxindex 72b33dae48..c488018b77 100644--- a/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/FileAuthoringCall.tsx@@ -249,7 +249,7 @@ export default function FileAuthoringCall({<preref={previewPaneRef}onScroll={onPreviewPaneScroll}- className="bg-surface-code-body max-h-[300px] overflow-auto p-4 font-mono text-xs"+ className="bg-surface-code-body max-h-[18.75rem] overflow-auto p-4 font-mono text-xs"><code className={`hljs language-${previewLang} !whitespace-pre`}>{highlighted ?? preview}@@ -259,7 +259,7 @@ export default function FileAuthoringCall({{showOutputSection && (<preclassName={cn(- 'border-border-light max-h-[300px] overflow-auto border-t px-3 py-2 font-mono text-xs break-words whitespace-pre-wrap',+ 'border-border-light max-h-[18.75rem] overflow-auto border-t px-3 py-2 font-mono text-xs break-words whitespace-pre-wrap',phase === 'failed' ? 'text-status-error' : 'text-text-secondary',)}>diff --git a/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx b/client/src/components/Chat/Messages/Content/Parts/LogContent.tsxindex 8cd0077938..589635b70d 100644--- a/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/LogContent.tsx@@ -207,10 +207,10 @@ const LogContent: React.FC<LogContentProps> = ({ output = '', renderImages, atta{textAttachments.map((file, index) => (<divkey={renderAttachmentKey('text', file, index)}- className="rounded-lg bg-surface-secondary p-3"+ className="bg-surface-secondary rounded-lg p-3">{file.filename && (- <div className="mb-1 truncate text-[10px] font-medium uppercase tracking-wide text-text-secondary">+ <div className="text-text-secondary mb-1 truncate text-[10px] font-medium tracking-wide uppercase">{file.filepath ? (<LogLinkhref={file.filepath}@@ -226,7 +226,7 @@ const LogContent: React.FC<LogContentProps> = ({ output = '', renderImages, atta)}</div>)}- <pre className="max-h-80 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-5 text-text-primary">+ <pre className="text-text-primary max-h-80 overflow-auto font-mono text-xs leading-5 break-words whitespace-pre-wrap">{file.text}</pre></div>diff --git a/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsx b/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsxindex cd7cf6a0f4..a6d5d4b1ae 100644--- a/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsx@@ -35,7 +35,7 @@ export default function PendingSkillCall({return (<div className={TOOL_ROW_CLASSES}>- <div className="progress-text-wrapper text-text-secondary relative -mt-[0.75px] h-5 w-full leading-5">+ <div className="progress-text-wrapper text-text-secondary relative -mt-[0.046875rem] h-5 w-full leading-5"><divclassName="progress-text-content absolute top-0 right-0 left-0 max-w-full overflow-visible whitespace-nowrap"style={{ opacity: 1, transform: 'none' }}diff --git a/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx b/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsxindex 70a8ed104d..1955d445d7 100644--- a/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/ReadFileCall.tsx@@ -141,7 +141,7 @@ export default function ReadFileCall({)}><CodeWindowHeader language={fileName} code={output} />- <pre className="bg-surface-code-body max-h-[300px] overflow-auto p-4 font-mono text-xs">+ <pre className="bg-surface-code-body max-h-[18.75rem] overflow-auto p-4 font-mono text-xs"><code className={`hljs language-${lang} !whitespace-pre`}>{highlighted ?? output}</code>diff --git a/client/src/components/Chat/Messages/Content/Parts/SkillCall.tsx b/client/src/components/Chat/Messages/Content/Parts/SkillCall.tsxindex 0e95897bf9..635c2050b1 100644--- a/client/src/components/Chat/Messages/Content/Parts/SkillCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/SkillCall.tsx@@ -86,7 +86,7 @@ export default function SkillCall({<div className="text-text-secondary mb-1.5 text-[10px] font-medium tracking-wide uppercase">{localize('com_ui_output')}</div>- <div className="text-text-primary max-h-[200px] overflow-auto">+ <div className="text-text-primary max-h-[12.5rem] overflow-auto"><Stdout output={output} /></div></div>diff --git a/client/src/components/Chat/Messages/Content/Parts/Summary.tsx b/client/src/components/Chat/Messages/Content/Parts/Summary.tsxindex f29f8e7078..a2e01ad9f7 100644--- a/client/src/components/Chat/Messages/Content/Parts/Summary.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/Summary.tsx@@ -45,7 +45,7 @@ const SummaryContent = memo(({ children, meta }: { children: React.ReactNode; mereturn (<div className="border-border-medium bg-surface-tertiary text-text-secondary relative rounded-3xl border p-4 pb-10">{meta && <span className="text-text-secondary mb-1 block text-xs">{meta}</span>}- <p className={cn('leading-[26px] whitespace-pre-wrap', fontSize)}>{children}</p>+ <p className={cn('leading-6.5 whitespace-pre-wrap', fontSize)}>{children}</p></div>);});@@ -86,7 +86,7 @@ const SummaryButton = memo(fontSize,)}>- <span className="relative mr-1.5 inline-flex h-[18px] w-[18px] items-center justify-center">+ <span className="relative mr-1.5 inline-flex h-[1.125rem] w-[1.125rem] items-center justify-center"><ScrollTextclassName="icon-sm text-text-secondary absolute opacity-100 transition-opacity group-hover/button:opacity-0"aria-hidden="true"@@ -121,7 +121,7 @@ const SummaryButton = memo(<span className="sr-only">{isCopied ? localize('com_ui_copied_to_clipboard') : localize('com_ui_copy_summary')}</span>- <MorphIcon icon={isCopied ? Check : Copy} size={18} />+ <MorphIcon icon={isCopied ? Check : Copy} className="h-[1.125rem] w-[1.125rem]" /></Button>)}</div>@@ -174,7 +174,7 @@ const FloatingSummaryBar = memo('focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',)}>- <ChevronUp className="h-[18px] w-[18px]" aria-hidden="true" />+ <ChevronUp className="h-[1.125rem] w-[1.125rem]" aria-hidden="true" /></button>}/>@@ -193,7 +193,7 @@ const FloatingSummaryBar = memo('focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',)}>- <MorphIcon icon={isCopied ? Check : Copy} size={18} />+ <MorphIcon icon={isCopied ? Check : Copy} className="h-[1.125rem] w-[1.125rem]" /></button>}/>diff --git a/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx b/client/src/components/Chat/Messages/Content/Parts/Thinking.tsxindex 29df89581e..c37aaffff6 100644--- a/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx@@ -93,7 +93,7 @@ export const ThinkingContent: FC<{return (<div className="border-border-light bg-surface-secondary text-text-secondary relative rounded-lg border p-3">- <p className={cn('leading-[26px] whitespace-pre-wrap', fontSize)}>{content}</p>+ <p className={cn('leading-6.5 whitespace-pre-wrap', fontSize)}>{content}</p></div>);});@@ -295,7 +295,7 @@ export const FloatingThinkingBar = memo(><MorphIconicon={isExpanded ? ChevronUpNode : ChevronDownNode}- className="h-[18px] w-[18px]"+ className="h-[1.125rem] w-[1.125rem]"/></Button>}diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/CollapsibleText.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/CollapsibleText.test.tsxindex 7cb8933eb8..09802e9655 100644--- a/client/src/components/Chat/Messages/Content/Parts/__tests__/CollapsibleText.test.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/CollapsibleText.test.tsx@@ -2,6 +2,12 @@ import React from 'react';import { render, screen, fireEvent } from '@testing-library/react';import CollapsibleText from '../CollapsibleText';+let mockRemScale = 1;+jest.mock('@librechat/client', () => ({+ ...jest.requireActual('@librechat/client'),+ useRemScale: () => mockRemScale,+}));+jest.mock('~/hooks', () => ({useLocalize: () => (key: string) => key,}));@@ -17,6 +23,10 @@ const linkLabel = 'focusable link';const stubScrollHeight = (height: number) =>jest.spyOn(HTMLElement.prototype, 'scrollHeight', 'get').mockReturnValue(height);+beforeEach(() => {+ mockRemScale = 1;+});+describe('CollapsibleText', () => {it('renders children untouched while the preference is off', () => {const scrollHeight = stubScrollHeight(5000);@@ -168,6 +178,89 @@ describe('CollapsibleText', () => {}});+ it.each([+ [0.5, 128, 131],+ [1.5, 384, 395],+ ])(+ 'scales the collapsed boundary and tolerance with the root at %s',+ (scale, collapsedMaxHeight, scrollHeight) => {+ mockRemScale = scale;+ const scroll = stubScrollHeight(scrollHeight);+ try {+ render(+ <CollapsibleText enabled={true}>+ <p>{plainMessage}</p>+ </CollapsibleText>,+ );+ expect(screen.queryByRole('button')).toBeNull();+ const region = screen.getByText(plainMessage).closest('[id]');+ expect(region).not.toHaveStyle({ maxHeight: `${collapsedMaxHeight}px` });+ } finally {+ scroll.mockRestore();+ }+ },+ );++ it.each([+ [0.5, 128],+ [1.5, 384],+ ])('uses the scaled boundary when revealing focused content at %s', (scale, boundary) => {+ mockRemScale = scale;+ const scroll = stubScrollHeight(boundary * 2);+ try {+ render(+ <CollapsibleText enabled={true}>+ <p>+ <a href="#target">{linkLabel}</a>+ </p>+ </CollapsibleText>,+ );+ const link = screen.getByRole('link');+ link.getBoundingClientRect = () =>+ ({+ top: boundary + 1,+ bottom: boundary + 2,+ height: 1,+ width: 40,+ left: 0,+ right: 40,+ }) as DOMRect;+ fireEvent(link, new FocusEvent('focusin', { bubbles: true }));+ expect(screen.getByRole('button', { name: 'com_ui_show_less' })).toHaveAttribute(+ 'aria-expanded',+ 'true',+ );+ } finally {+ scroll.mockRestore();+ }+ });++ it('re-measures overflow when the root scale changes', () => {+ mockRemScale = 1.5;+ const scroll = stubScrollHeight(390);+ try {+ const { rerender } = render(+ <CollapsibleText enabled={true}>+ <p>{plainMessage}</p>+ </CollapsibleText>,+ );+ expect(screen.queryByRole('button')).toBeNull();++ mockRemScale = 0.5;+ rerender(+ <CollapsibleText enabled={true}>+ <p>{plainMessage}</p>+ </CollapsibleText>,+ );+ expect(screen.getByRole('button', { name: 'com_ui_show_more' })).toHaveAttribute(+ 'aria-expanded',+ 'false',+ );+ } finally {+ scroll.mockRestore();+ }+ });+it('expands in place and offers show less', () => {const scrollHeight = stubScrollHeight(500);try {diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsxindex aaf388b080..f33704e8a1 100644--- a/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx@@ -1,6 +1,11 @@import React from 'react';import { render, screen, fireEvent, act } from '@testing-library/react';import type { TAttachment } from 'librechat-data-provider';++let mockRemScale = 1;+jest.mock('@librechat/client', () => ({+ useRemScale: () => mockRemScale,+}));import Attachment, { AttachmentGroup } from '../Attachment';jest.mock('~/hooks', () => ({@@ -101,11 +106,13 @@ const restoreScrollHeight = () => {};afterAll(() => {+ mockRemScale = 1;restoreScrollHeight();});describe('TextAttachment (via Attachment default export)', () => {beforeEach(() => {+ mockRemScale = 1;mockHandleDownload.mockReset();setScrollHeight(0);});@@ -152,6 +159,26 @@ describe('TextAttachment (via Attachment default export)', () => {expect(expanded).toHaveAttribute('aria-expanded', 'true');});+ it('recalculates the text preview when the root scale changes', () => {+ setScrollHeight(300);+ mockRemScale = 1.5;+ const { container, rerender } = render(<Attachment attachment={textAttachment()} />);+ expect(screen.queryByRole('button', { name: 'Show all' })).not.toBeInTheDocument();++ mockRemScale = 0.5;+ rerender(<Attachment attachment={textAttachment()} />);+ expect(screen.getByRole('button', { name: 'Show all' })).toHaveAttribute(+ 'aria-expanded',+ 'false',+ );+ expect(container.querySelector('pre')).toHaveStyle({ maxHeight: '160px' });++ mockRemScale = 1.5;+ rerender(<Attachment attachment={textAttachment()} />);+ expect(screen.queryByRole('button', { name: 'Show all' })).not.toBeInTheDocument();+ expect(container.querySelector('pre')?.style.maxHeight).toBe('');+ });+it('falls through to FileAttachment when text is missing', () => {const noText = textAttachment({ text: undefined as unknown as string });render(<Attachment attachment={noText} />);@@ -171,6 +198,7 @@ describe('TextAttachment (via Attachment default export)', () => {describe('AttachmentGroup', () => {beforeEach(() => {+ mockRemScale = 1;setScrollHeight(0);});diff --git a/client/src/components/Chat/Messages/Content/ProgressText.tsx b/client/src/components/Chat/Messages/Content/ProgressText.tsxindex 4e35713fe0..1806744d1d 100644--- a/client/src/components/Chat/Messages/Content/ProgressText.tsx+++ b/client/src/components/Chat/Messages/Content/ProgressText.tsx@@ -14,7 +14,7 @@ import { ROW_GLYPH_SLOT } from './rows';import { useLocalize } from '~/hooks';const wrapperClass =- 'progress-text-wrapper text-text-secondary relative -mt-[0.75px] h-5 w-full leading-5';+ 'progress-text-wrapper text-text-secondary relative -mt-[0.046875rem] h-5 w-full leading-5';/** `right-0` and `max-w-full` cap the absolutely-positioned line at the message* column; the label span truncates itself, so overflow stays visible for the@@ -263,7 +263,7 @@ export default function ProgressText({<ChevronDownclassName={cn(disclosureChevronVariants({ expanded: isExpanded }),- 'size-4 shrink-0 translate-y-[1px]',+ 'size-4 shrink-0 translate-y-[0.0625rem]',)}aria-hidden="true"/>diff --git a/client/src/components/Chat/Messages/Content/ToolCallInfo.tsx b/client/src/components/Chat/Messages/Content/ToolCallInfo.tsxindex 826192285b..abb1636218 100644--- a/client/src/components/Chat/Messages/Content/ToolCallInfo.tsx+++ b/client/src/components/Chat/Messages/Content/ToolCallInfo.tsx@@ -53,7 +53,7 @@ function ComplexInput({ data }: { data: Record<string, unknown> }) {{Object.entries(data).map(([key, value]) => (<div key={key} className="flex items-baseline gap-1.5"><span className="text-text-secondary font-medium">{key}</span>- <span className="bg-surface-tertiary text-text-primary max-w-[300px] truncate overflow-hidden rounded px-1.5 py-0.5 font-mono">+ <span className="bg-surface-tertiary text-text-primary max-w-[18.75rem] truncate overflow-hidden rounded px-1.5 py-0.5 font-mono">{formatParamValue(value)}</span></div>diff --git a/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx b/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsxindex bd7df54659..f93cf9d02b 100644--- a/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx+++ b/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx@@ -168,7 +168,7 @@ export default function OutputRenderer({<div><div className="group/copy relative">{isJson ? (- <pre className="max-h-[300px] overflow-auto rounded text-xs">+ <pre className="max-h-[18.75rem] overflow-auto rounded text-xs"><code className="hljs language-json !break-words !whitespace-pre-wrap">{displayText}</code>@@ -178,7 +178,7 @@ export default function OutputRenderer({ref={outputRef}onScroll={terminal ? handleOutputScroll : undefined}className={cn(- 'max-h-[300px] overflow-auto text-xs break-words whitespace-pre-wrap',+ 'max-h-[18.75rem] overflow-auto text-xs break-words whitespace-pre-wrap',error && 'text-status-error font-mono',!error && structured && 'font-mono',!error && structured && (terminal ? 'text-text-primary' : 'text-text-secondary'),@@ -215,7 +215,7 @@ export default function OutputRenderer({</Button>)}{showErrorDetails && rawError && (- <pre className="text-status-error mt-2 max-h-[200px] overflow-auto font-mono text-xs break-words whitespace-pre-wrap">+ <pre className="text-status-error mt-2 max-h-[12.5rem] overflow-auto font-mono text-xs break-words whitespace-pre-wrap">{rawError}</pre>)}diff --git a/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx b/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsxindex 25e92d044a..af79fee79d 100644--- a/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx+++ b/client/src/components/Chat/Messages/Content/ToolOutput/StackedToolIcons.tsx@@ -83,7 +83,7 @@ export default function StackedToolIcons({key={icon.key}className={cn('border-border-medium bg-surface-secondary relative flex items-center justify-center rounded-full border',- 'h-[22px] w-[22px]',+ 'h-[1.375rem] w-[1.375rem]',index > 0 && '-ml-2.5',)}style={{ zIndex: visibleIcons.length - index }}@@ -104,7 +104,7 @@ export default function StackedToolIcons({<divclassName={cn('border-border-medium bg-surface-tertiary relative flex items-center justify-center rounded-full border',- 'text-text-secondary -ml-2.5 h-[22px] w-[22px] text-xs font-medium',+ 'text-text-secondary -ml-2.5 h-[1.375rem] w-[1.375rem] text-xs font-medium',)}style={{ zIndex: 0 }}>diff --git a/client/src/components/Chat/Messages/Content/ToolOutput/__tests__/OutputRenderer.test.tsx b/client/src/components/Chat/Messages/Content/ToolOutput/__tests__/OutputRenderer.test.tsxindex cccc760926..ad211a05e1 100644--- a/client/src/components/Chat/Messages/Content/ToolOutput/__tests__/OutputRenderer.test.tsx+++ b/client/src/components/Chat/Messages/Content/ToolOutput/__tests__/OutputRenderer.test.tsx@@ -44,7 +44,7 @@ describe('OutputRenderer', () => {render(<OutputRenderer text={text} variant="terminal" />);const pre = screen.getByText(/line 30/);expect(pre.textContent).toBe(text);- expect(pre).toHaveClass('max-h-[300px]', 'overflow-auto');+ expect(pre).toHaveClass('max-h-[18.75rem]', 'overflow-auto');expect(screen.queryByText('com_ui_show_more')).not.toBeInTheDocument();});diff --git a/client/src/components/Chat/Messages/Content/WebSearch.tsx b/client/src/components/Chat/Messages/Content/WebSearch.tsxindex 1a79a83a37..b72157061f 100644--- a/client/src/components/Chat/Messages/Content/WebSearch.tsx+++ b/client/src/components/Chat/Messages/Content/WebSearch.tsx@@ -48,7 +48,7 @@ function SourceFaviconStack({ sources }: { sources: ValidSource[] }) {key={source.link}className={cn('border-border-medium bg-surface-secondary relative flex items-center justify-center rounded-full border',- 'h-[22px] w-[22px]',+ 'h-[1.375rem] w-[1.375rem]',i > 0 && '-ml-2.5',)}style={{ zIndex: MAX_VISIBLE_FAVICONS - i }}@@ -351,7 +351,7 @@ export default function WebSearch({<divclassName={cn(toolPanelSpacingClassName,- 'border-border-light mt-1.5 max-h-[280px] overflow-y-auto rounded-lg border',+ 'border-border-light mt-1.5 max-h-[17.5rem] overflow-y-auto rounded-lg border',)}>{allSources.map((source, i) => {diff --git a/client/src/components/Chat/Messages/Feedback.tsx b/client/src/components/Chat/Messages/Feedback.tsxindex 9950b02459..d4ae41f7d0 100644--- a/client/src/components/Chat/Messages/Feedback.tsx+++ b/client/src/components/Chat/Messages/Feedback.tsx@@ -68,7 +68,7 @@ function FeedbackOptionButton({aria-label={label}aria-pressed={active}>- <Icon size="19" bold={active} aria-hidden="true" />+ <Icon size="1.1875rem" bold={active} aria-hidden="true" /><span>{label}</span></Button>);@@ -158,7 +158,7 @@ function FeedbackButtons({aria-pressed={feedback?.rating === 'thumbsUp'}aria-haspopup="menu">- <ThumbUpIcon size="19" bold={feedback?.rating === 'thumbsUp'} />+ <ThumbUpIcon size="1.1875rem" bold={feedback?.rating === 'thumbsUp'} /></Button>}/>@@ -193,7 +193,7 @@ function FeedbackButtons({aria-pressed={feedback?.rating === 'thumbsDown'}aria-haspopup="menu">- <ThumbDownIcon size="19" bold={feedback?.rating === 'thumbsDown'} />+ <ThumbDownIcon size="1.1875rem" bold={feedback?.rating === 'thumbsDown'} /></Button>}/>@@ -293,7 +293,7 @@ function Feedback({ isLast = false, handleFeedback, feedback: initialFeedback }:aria-label={label}aria-pressed="true">- <Icon size="19" bold />+ <Icon size="1.1875rem" bold /></Button>}/>diff --git a/client/src/components/Chat/Messages/Fork.tsx b/client/src/components/Chat/Messages/Fork.tsxindex 23a4605cf9..3a0c6b39b5 100644--- a/client/src/components/Chat/Messages/Fork.tsx+++ b/client/src/components/Chat/Messages/Fork.tsx@@ -111,7 +111,7 @@ const PopoverButton: React.FC<PopoverButtonProps> = ({gutter={16}shift={40}flip={false}- className="border-border-medium bg-surface-secondary text-text-primary z-[999] w-80 rounded-2xl border p-4 shadow-md"+ className="border-border-medium bg-surface-secondary text-text-primary z-[999] w-[min(20rem,90vw)] rounded-2xl border p-4 shadow-md"portal={true}unmountOnHide={true}>@@ -187,7 +187,7 @@ const CheckboxOption: React.FC<CheckboxOptionProps> = ({gutter={14}shift={40}flip={false}- className="border-border-medium bg-surface-secondary text-text-primary z-[999] w-80 rounded-2xl border p-4 shadow-md"+ className="border-border-medium bg-surface-secondary text-text-primary z-[999] w-[min(20rem,90vw)] rounded-2xl border p-4 shadow-md"portal={true}unmountOnHide={true}>@@ -347,14 +347,14 @@ function Fork({type="button"aria-label={localize('com_ui_fork_open_menu')}>- <GitFork size="19" aria-hidden="true" />+ <GitFork className="size-[1.1875rem]" aria-hidden="true" /></Button>}/><Ariakit.Popoverstore={popoverStore}gutter={10}- className={`popover-animate ${isActive ? 'open' : ''} border-border-medium bg-surface-secondary flex w-60 flex-col gap-3 overflow-hidden rounded-2xl border p-2 px-4 shadow-lg`}+ className={`popover-animate ${isActive ? 'open' : ''} border-border-medium bg-surface-secondary flex w-[min(15rem,90vw)] flex-col gap-3 overflow-hidden rounded-2xl border p-2 px-4 shadow-lg`}style={{outline: 'none',pointerEvents: 'auto',@@ -386,7 +386,7 @@ function Fork({gutter={19}shift={40}flip={false}- className="border-border-medium bg-surface-secondary text-text-primary z-[999] w-80 rounded-2xl border p-4 shadow-md"+ className="border-border-medium bg-surface-secondary text-text-primary z-[999] w-[min(20rem,90vw)] rounded-2xl border p-4 shadow-md"portal={true}unmountOnHide={true}>diff --git a/client/src/components/Chat/Messages/HoverButtons.tsx b/client/src/components/Chat/Messages/HoverButtons.tsxindex ff62355c7b..d608ea7747 100644--- a/client/src/components/Chat/Messages/HoverButtons.tsx+++ b/client/src/components/Chat/Messages/HoverButtons.tsx@@ -256,7 +256,7 @@ const HoverButtons = ({title={isCopied ? localize('com_ui_copied_to_clipboard') : localize('com_ui_copy_to_clipboard')}- icon={<MorphIcon icon={isCopied ? Check : Copy} size={19} />}+ icon={<MorphIcon icon={isCopied ? Check : Copy} size="1.1875rem" />}isLast={isLast}disabled={!canCopy}className={cn(diff --git a/client/src/components/Chat/Messages/MessageNav.tsx b/client/src/components/Chat/Messages/MessageNav.tsxindex 55e1ea995b..7d6ca3c6a0 100644--- a/client/src/components/Chat/Messages/MessageNav.tsx+++ b/client/src/components/Chat/Messages/MessageNav.tsx@@ -2,6 +2,7 @@ import { memo, useState, useEffect, useCallback, useRef, useMemo } from 'react';import { createPortal } from 'react-dom';import { ChevronUp, ChevronDown } from 'lucide-react';import { ContentTypes } from 'librechat-data-provider';+import { pxToRem, useRemScale } from '@librechat/client';import type { TMessage, TMessageContentParts } from 'librechat-data-provider';import { useMessagesConversation, useMessagesSubmission } from '~/Providers';import { useGetMessagesByConvoId } from '~/data-provider';@@ -253,14 +254,14 @@ const RIB_MESSAGE: RibDims = { baseW: 12, baseH: 3, peakW: 39, peakH: 6 };* from length alone — the only axis a 3px line has left once colour is spent* on the in-view band. */const RIB_CURRENT: RibDims = { baseW: 21, baseH: 3, peakW: 39, peakH: 6 };-/** Row height in px. `peakH` may reach it but never exceed it: the magnifier+/** Row height in baseline px. `peakH` may reach it but never exceed it: the magnifier* writes into normal flow, and a rib taller than its row would reflow every* rib below the pointer — moving the rail out from under the pointer and* leaving the measured centres (and so the preview and the click target)* pointing at the wrong message. */const RIB_ROW_HEIGHT = 6;-/** Vertical falloff radius (content-space px) over which neighbouring ribs magnify. */+/** Vertical falloff radius, in baseline px, over which neighbouring ribs magnify. */const MAG_INFLUENCE = 50;/** Delay before the shared preview first opens; subsequent moves reposition instantly. */const TOOLTIP_OPEN_DELAY = 60;@@ -331,7 +332,7 @@ const MessageIndicator = memo(function MessageIndicator({indicatorButtonClasses,isEmphasized || isInView ? 'opacity-100' : dimIndicatorClasses,)}- style={{ height: RIB_ROW_HEIGHT }}+ style={{ height: pxToRem(RIB_ROW_HEIGHT) }}aria-label={label}aria-current={isCurrent ? 'true' : undefined}tabIndex={tabIndex}@@ -340,10 +341,10 @@ const MessageIndicator = memo(function MessageIndicator({<spanclassName={cn('block rounded-full',- entry.isEnd === true || entry.isStart === true ? 'mr-[4.5px]' : '',+ entry.isEnd === true || entry.isStart === true ? 'mr-[0.28125rem]' : '',tone,)}- style={{ width: dims.baseW, height: dims.baseH }}+ style={{ width: pxToRem(dims.baseW), height: pxToRem(dims.baseH) }}/></button>);@@ -417,6 +418,11 @@ function MessageNav({ scrollableRef }: { scrollableRef: React.RefObject<HTMLDivEconst pointerClientYRef = useRef<number | null>(null);const magRafRef = useRef<number | null>(null);const reducedMotionRef = useRef(false);+ /** The resting ribs are sized in rem while magnification writes inline pixels, so+ * both the peak dimensions and the reach have to be read into the same units. */+ const remScale = useRemScale();+ const remScaleRef = useRef(remScale);+ remScaleRef.current = remScale;const focusedIdRef = useRef<string | null>(null);const tipShownRef = useRef(false);const tipTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);@@ -976,6 +982,8 @@ function MessageNav({ scrollableRef }: { scrollableRef: React.RefObject<HTMLDivEreturn;}const reduce = reducedMotionRef.current;+ const scale = remScaleRef.current;+ const influence = MAG_INFLUENCE * scale;const colRect = col.getBoundingClientRect();const scrollTop = col.scrollTop;const py = clientY - colRect.top + scrollTop;@@ -993,13 +1001,13 @@ function MessageNav({ scrollableRef }: { scrollableRef: React.RefObject<HTMLDivEif (reduce) {continue;}- const t = magnifyFalloff(d, MAG_INFLUENCE);+ const t = magnifyFalloff(d, influence);const dims = rib.dims;rib.line.style.transition = 'none';- rib.line.style.width = `${(dims.baseW + (dims.peakW - dims.baseW) * t).toFixed(2)}px`;- rib.line.style.height = `${(dims.baseH + (dims.peakH - dims.baseH) * t).toFixed(2)}px`;+ rib.line.style.width = pxToRem(dims.baseW + (dims.peakW - dims.baseW) * t);+ rib.line.style.height = pxToRem(dims.baseH + (dims.peakH - dims.baseH) * t);}- if (nearestId != null && nearestD <= MAG_INFLUENCE && !isDraggingRef.current) {+ if (nearestId != null && nearestD <= influence && !isDraggingRef.current) {const top = colRect.top - scrollTop + nearestCenter;const right = window.innerWidth - colRect.left + 8;focusTooltip(nearestId, top, right);@@ -1017,8 +1025,8 @@ function MessageNav({ scrollableRef }: { scrollableRef: React.RefObject<HTMLDivEfor (let i = 0; i < layout.length; i++) {const rib = layout[i];rib.line.style.transition = 'width 140ms ease-out, height 140ms ease-out';- rib.line.style.width = `${rib.dims.baseW}px`;- rib.line.style.height = `${rib.dims.baseH}px`;+ rib.line.style.width = pxToRem(rib.dims.baseW);+ rib.line.style.height = pxToRem(rib.dims.baseH);}}, [ensureRibLayout]);@@ -1709,7 +1717,7 @@ function MessageNav({ scrollableRef }: { scrollableRef: React.RefObject<HTMLDivEtransform: 'translateY(-50%)',zIndex: 999,}}- className="border-border-light bg-surface-secondary text-text-secondary pointer-events-none max-w-[280px] rounded-xl border px-3 py-2 shadow-lg"+ className="border-border-light bg-surface-secondary text-text-secondary pointer-events-none max-w-[17.5rem] rounded-xl border px-3 py-2 shadow-lg"><p className="line-clamp-3 text-xs">{tipText}</p></div>,diff --git a/client/src/components/Chat/Messages/MinimalHoverButtons.tsx b/client/src/components/Chat/Messages/MinimalHoverButtons.tsxindex d3d29edd58..ef5e6a73f9 100644--- a/client/src/components/Chat/Messages/MinimalHoverButtons.tsx+++ b/client/src/components/Chat/Messages/MinimalHoverButtons.tsx@@ -54,7 +54,7 @@ export default function MinimalHoverButtons({ message, searchResults, variant }:disabled={!canCopy}onClick={() => copyToClipboard(setIsCopied)}>- <MorphIcon icon={isCopied ? Check : Copy} size={19} />+ <MorphIcon icon={isCopied ? Check : Copy} size="1.1875rem" /></Button>}/>diff --git a/client/src/components/Chat/Messages/__tests__/HoverActions.streaming.spec.tsx b/client/src/components/Chat/Messages/__tests__/HoverActions.streaming.spec.tsxindex 3bbe1b48fc..c2cbae8e11 100644--- a/client/src/components/Chat/Messages/__tests__/HoverActions.streaming.spec.tsx+++ b/client/src/components/Chat/Messages/__tests__/HoverActions.streaming.spec.tsx@@ -326,7 +326,7 @@ describe('streaming hover actions', () => {])('holds the footer height while %s response streams', (_label, structured) => {renderStreamingRow(structured);- expect(screen.getByTestId('hover-buttons').parentElement).toHaveClass('min-h-[31px]');+ expect(screen.getByTestId('hover-buttons').parentElement).toHaveClass('min-h-[1.9375rem]');});/**diff --git a/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx b/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsxindex 5ae0fcb7db..2c37bb2ef3 100644--- a/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx+++ b/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx@@ -21,6 +21,7 @@ type TestMessage = {const mockUseGetMessagesByConvoId = jest.fn();const mockUseMessagesConversation = jest.fn();const mockUseMessagesSubmission = jest.fn();+let mockRemScale = 1;jest.mock('~/data-provider', () => ({useGetMessagesByConvoId: (...args: unknown[]) => mockUseGetMessagesByConvoId(...args),@@ -47,6 +48,8 @@ jest.mock('@librechat/client', () => ({asChild ? children : <div>{children}</div>,HoverCardPortal: ({ children }: { children: ReactNode }) => <>{children}</>,HoverCardContent: ({ children }: { children: ReactNode }) => <div>{children}</div>,+ pxToRem: jest.requireActual('../../../../../../packages/client/src/utils/theme').pxToRem,+ useRemScale: () => mockRemScale,}));if (typeof window.matchMedia !== 'function') {@@ -243,6 +246,7 @@ function clearDom() {}beforeEach(() => {+ mockRemScale = 1;MockIntersectionObserver.reset();(global as unknown as { IntersectionObserver: typeof MockIntersectionObserver }@@ -336,20 +340,6 @@ describe('MessageNav', () => {});describe('indicator styling', () => {- it('gives every message rib the same short resting width regardless of role', () => {- const messages = [- buildMessage({ messageId: 'u', text: 'user msg', isCreatedByUser: true }),- buildMessage({ messageId: 'a', text: 'assistant msg' }),- buildMessage({ messageId: 'u2', text: 'more user', isCreatedByUser: true }),- ];- const { container } = renderNav(messages);- const [, assistantInd, userInd] = messageRibs(container);- const userLine = assistantInd.querySelector('span') as HTMLElement;- const assistantLine = userInd.querySelector('span') as HTMLElement;- expect(userLine.style.width).toBe('12px');- expect(assistantLine.style.width).toBe('12px');- });-it('gives the current rib a longer resting width than its neighbours', () => {const messages = [buildMessage({ messageId: 'u', text: 'user msg', isCreatedByUser: true }),@@ -364,17 +354,6 @@ describe('MessageNav', () => {expect(currentWidth).toBeGreaterThan(nextWidth);});- it('holds every rib row at a fixed height so the column cannot compress them', () => {- const messages = Array.from({ length: 6 }, (_, i) =>- buildMessage({ messageId: `m-${i}`, text: `message ${i}` }),- );- const { container } = renderNav(messages);- for (const rib of messageRibs(container)) {- expect(rib.className).toContain('shrink-0');- expect(rib.style.height).toBe('6px');- }- });-it('lights up only the in-viewport ribs at rest (no hover)', () => {const messages = [buildMessage({ messageId: 'a', text: 'alpha', isCreatedByUser: true }),@@ -1891,6 +1870,41 @@ describe('MessageNav', () => {restoreLayout();});+ it.each([0.5, 1.5])('keeps magnified ribs inside their rows at scale %s', (scale) => {+ mockRemScale = scale;+ const messages = Array.from({ length: 6 }, (_, i) =>+ buildMessage({ messageId: `m-${i}`, text: `message ${i}` }),+ );+ const restoreLayout = stubRibLayout(+ messages.map((message) => message.messageId),+ 12 * scale,+ 6 * scale,+ );+ const { container } = renderNavWithEnd(messages);+ const column = getColumn(container);+ column.getBoundingClientRect = () =>+ ({ top: 0, bottom: 72 * scale, height: 72 * scale, left: 0, right: 0 }) as DOMRect;+ const row = messageRibs(container)[3];+ const line = row.querySelector('span') as HTMLElement;+ const pixels = (length: string) =>+ parseFloat(length) * (length.endsWith('rem') ? 16 * scale : 1);+ const restingHeight = pixels(line.style.height);++ act(() => {+ fireEvent.pointerMove(column, { pointerId: 1, clientY: 39 * scale });+ jest.advanceTimersByTime(80);+ });++ expect(pixels(line.style.height)).toBeGreaterThan(restingHeight);+ expect(pixels(line.style.height)).toBeLessThanOrEqual(pixels(row.style.height));++ act(() => {+ fireEvent.pointerLeave(column, { pointerId: 1 });+ });+ expect(pixels(line.style.height)).toBe(restingHeight);+ restoreLayout();+ });+it('peaks the fisheye and preview on the rib under the pointer', () => {const messages = Array.from({ length: 6 }, (_, i) =>buildMessage({ messageId: `m-${i}`, text: `message ${i}` }),diff --git a/client/src/components/Chat/Messages/__tests__/styles.spec.ts b/client/src/components/Chat/Messages/__tests__/styles.spec.tsindex 922761539c..e9c1685544 100644--- a/client/src/components/Chat/Messages/__tests__/styles.spec.ts+++ b/client/src/components/Chat/Messages/__tests__/styles.spec.ts@@ -1,4 +1,4 @@-import { hoverButtonClasses, messageFooterClasses, revealOnRowHoverClasses } from '../styles';+import { hoverButtonClasses, revealOnRowHoverClasses } from '../styles';const FADE = '[@media(hover:hover)]:opacity-0';@@ -92,11 +92,3 @@ describe('hoverButtonClasses', () => {expect(hoverButtonClasses({ className: 'ml-0' })).toContain('ml-0');});});--describe('messageFooterClasses', () => {- /** A hover button is a 19px icon with p-1.5 either side, so the row it forms is- * 31px. The footer holds that height even while it has nothing to show. */- it('reserves the height of the action row', () => {- expect(messageFooterClasses).toContain('min-h-[31px]');- });-});diff --git a/client/src/components/Chat/Messages/styles.ts b/client/src/components/Chat/Messages/styles.tsindex a9cb45a544..81ba5027c3 100644--- a/client/src/components/Chat/Messages/styles.ts+++ b/client/src/components/Chat/Messages/styles.ts@@ -48,7 +48,7 @@ export const revealOnRowHoverClasses =* completes. The value is the height of a hover button, `p-1.5` either side of a* 19px icon.*/-export const messageFooterClasses = 'min-h-[31px] text-xs';+export const messageFooterClasses = 'min-h-[1.9375rem] text-xs';type HoverButtonStyleOptions = {isActive?: boolean;diff --git a/client/src/components/Chat/Messages/ui/MessageRow.tsx b/client/src/components/Chat/Messages/ui/MessageRow.tsxindex 9c16e462bc..3ea142bf43 100644--- a/client/src/components/Chat/Messages/ui/MessageRow.tsx+++ b/client/src/components/Chat/Messages/ui/MessageRow.tsx@@ -119,7 +119,7 @@ export default function MessageRow({<div className={cn('flex w-full flex-col gap-1', isUserSide && 'items-end')}><divclassName={cn(- 'flex min-h-[20px] max-w-full grow flex-col gap-0',+ 'flex min-h-[1.25rem] max-w-full grow flex-col gap-0',isUserSide && !isEditing? cn('rounded-theme-surface rounded-br-theme-control px-theme-normal w-fit',diff --git a/client/src/components/Chat/ProjectLandingChip.tsx b/client/src/components/Chat/ProjectLandingChip.tsxindex 83d28b817b..b343783a0a 100644--- a/client/src/components/Chat/ProjectLandingChip.tsx+++ b/client/src/components/Chat/ProjectLandingChip.tsx@@ -74,7 +74,7 @@ export default function ProjectLandingChip({ project }: { project: TChatProjectmatchTriggerWidth={false}containerClassName="w-auto min-w-0 px-0"className="text-text-secondary hover:bg-surface-hover hover:text-text-primary h-8 w-auto max-w-[14rem] min-w-[7.5rem] gap-1.5 rounded-full border-0 bg-transparent px-2.5 text-sm font-medium"- popoverClassName="animate-popover-bottom min-w-64 rounded-2xl shadow-xl"+ popoverClassName="animate-popover-bottom min-w-[min(16rem,90vw)] rounded-2xl shadow-xl"/><TooltipAnchordescription={localize('com_ui_remove_from_project')}diff --git a/client/src/components/Chat/Subagents/SubagentActivity.test.tsx b/client/src/components/Chat/Subagents/SubagentActivity.test.tsxindex 287dcd5ba3..b3050ed5cb 100644--- a/client/src/components/Chat/Subagents/SubagentActivity.test.tsx+++ b/client/src/components/Chat/Subagents/SubagentActivity.test.tsx@@ -225,7 +225,7 @@ it('keeps a host notice inside the floating-header clearance', () => {notice={<div role="status">{String(19)}</div>}/>,);- const inset = container.querySelector('[class*="pt-[52px]"]');+ const inset = container.querySelector('[class~="pt-13"]');expect(inset).toContainElement(screen.getByRole('status'));});diff --git a/client/src/components/Chat/Subagents/SubagentActivity.tsx b/client/src/components/Chat/Subagents/SubagentActivity.tsxindex 9382559d75..c8dcf9625f 100644--- a/client/src/components/Chat/Subagents/SubagentActivity.tsx+++ b/client/src/components/Chat/Subagents/SubagentActivity.tsx@@ -179,7 +179,7 @@ export function SubagentActivityScrollSurface({className={cn('min-h-0 flex-1 overflow-y-auto', padded && 'px-4 py-4')}data-subagent-activity-scroll-surface>- <div ref={contentRef} className={cn(headerInset && 'pt-[52px]')}>+ <div ref={contentRef} className={cn(headerInset && 'pt-13')}>{children}</div></div>diff --git a/client/src/components/Chat/Subagents/SubagentThreadPanel.test.tsx b/client/src/components/Chat/Subagents/SubagentThreadPanel.test.tsxindex 9a895f17fc..ed45802e70 100644--- a/client/src/components/Chat/Subagents/SubagentThreadPanel.test.tsx+++ b/client/src/components/Chat/Subagents/SubagentThreadPanel.test.tsx@@ -26,6 +26,8 @@ const mockApprovalProviderMounted = jest.fn();const mockApprovalProviderUnmounted = jest.fn();let mockIsMobile = false;let mockCoarsePointer = false;+let mockViewportWidth: number | null = null;+let mockRemScale = 1;let mockParentChildrenByMessage = new Map<string, ParentSubagentSummary[]>();let mockParentChildrenByThread = new Map<string, ParentSubagentSummary>();const mockRefreshParentChildren = jest.fn().mockResolvedValue(undefined);@@ -388,7 +390,12 @@ jest.mock('@librechat/client', () => ({)}</div>),- useMediaQuery: (query: string) => (query.includes('hover') ? mockCoarsePointer : mockIsMobile),+ useRemScale: () => mockRemScale,+ useMediaQuery: (query: string) => {+ if (query.includes('hover')) return mockCoarsePointer;+ if (mockViewportWidth == null) return mockIsMobile;+ return mockViewportWidth <= Number(/max-width:\s*([\d.]+)/.exec(query)?.[1]);+ },useToastContext: () => ({ showToast: mockShowToast }),}));@@ -453,6 +460,8 @@ describe('SubagentThreadPanel', () => {window.sessionStorage.clear();mockIsMobile = false;mockCoarsePointer = false;+ mockViewportWidth = null;+ mockRemScale = 1;mockEnterToSend = true;mockClaimForeground.mockClear();mockHandOffComposerText.mockClear();@@ -2095,8 +2104,9 @@ describe('SubagentThreadPanel', () => {expect(screen.queryByTestId('shared-activity')).not.toBeInTheDocument();});- it('exposes the focus-trapped mobile overlay as a modal dialog', () => {- mockIsMobile = true;+ it('exposes the scaled overlay as a modal above the fixed mobile breakpoint', () => {+ mockViewportWidth = 800;+ mockRemScale = 1.5;mockUseSubagentThreadQuery.mockReturnValue({data: completedView,isLoading: false,diff --git a/client/src/components/Chat/Subagents/SubagentThreadPanel.tsx b/client/src/components/Chat/Subagents/SubagentThreadPanel.tsxindex 6858babb96..1f774d8b0b 100644--- a/client/src/components/Chat/Subagents/SubagentThreadPanel.tsx+++ b/client/src/components/Chat/Subagents/SubagentThreadPanel.tsx@@ -48,8 +48,10 @@ import SubagentActivity, { SubagentActivityScrollSurface } from './SubagentActivimport ApprovalProvider from '~/components/Chat/Messages/Content/ApprovalContext';import { isMacPlatform, resolveComposerKeyDown } from '~/utils/shortcuts';import { useFocusTrap, useLocalize, useNavigateToConvo } from '~/hooks';+import { ARTIFACTS_SHEET_MAX_WIDTH } from '~/utils/breakpoints';import { useConfiguredFooter } from '~/components/Chat/Footer';import { useParentSubagents } from './ParentSubagentsProvider';+import useScaledMaxWidth from '~/hooks/useScaledMaxWidth';import SubagentConversation from './SubagentConversation';import { eventSubagentSelection } from './eventSelection';import { resolveSubagentAgentId } from './identity';@@ -118,7 +120,7 @@ export default function SubagentThreadPanel({ selection }: { selection: ActiveSuconst { showToast } = useToastContext();const { navigateToConvo } = useNavigateToConvo();const panelRef = useRef<HTMLDivElement>(null);- const isMobile = useMediaQuery('(max-width: 767px)');+ const isMobile = useScaledMaxWidth(ARTIFACTS_SHEET_MAX_WIDTH);/** Two reasons the send control's action list cannot be used where it hangs.* Without hover, a tap on its anchor submits instead of opening it. And* while the panel is a focus-trapped modal, the list is portaled outside the@@ -1406,11 +1408,11 @@ export default function SubagentThreadPanel({ selection }: { selection: ActiveSuonKeyDown={handlePanelKeyDown}className="bg-surface-primary-alt text-text-primary relative flex h-full w-full flex-col overflow-hidden">- {/* The main chat header's own shape: a 52px bar that floats over the+ {/* The main chat header's own shape: a 3.25rem bar that floats over thethread and fades into it, so the conversation scrolls under it andmore of it is on screen. Gradient stops track THIS surface ratherthan the chat's, since the panel sits on its own background. */}- <header className="from-surface-primary-alt via-surface-primary-alt/70 text-text-primary absolute top-0 z-10 flex h-[52px] w-full items-center gap-2 bg-gradient-to-b to-transparent p-2 font-semibold">+ <header className="from-surface-primary-alt via-surface-primary-alt/70 text-text-primary absolute top-0 z-10 flex h-[3.25rem] w-full items-center gap-2 bg-gradient-to-b to-transparent p-2 font-semibold">{actorOptions.length > 1 ? (/* The agent builder's picker, so switching actors here reads as thesame control as every other agent selection in the app — avatar,@@ -1467,7 +1469,7 @@ export default function SubagentThreadPanel({ selection }: { selection: ActiveSuaria-label={localize('com_ui_close')}className="h-8 w-8 shrink-0">- <X size={17} aria-hidden="true" />+ <X className="size-[1.0625rem]" aria-hidden="true" /></Button></header>diff --git a/client/src/components/Chat/__tests__/Header.stacking.spec.tsx b/client/src/components/Chat/__tests__/Header.stacking.spec.tsxindex dbcf6d63f7..3908754bd6 100644--- a/client/src/components/Chat/__tests__/Header.stacking.spec.tsx+++ b/client/src/components/Chat/__tests__/Header.stacking.spec.tsx@@ -23,6 +23,7 @@ jest.mock('librechat-data-provider', () => ({}));jest.mock('~/data-provider', () => ({ useGetStartupConfig: () => ({ data: undefined }) }));jest.mock('~/hooks', () => ({ useHasAccess: () => false }));+jest.mock('~/hooks/Nav/useDrawerViewport', () => () => false);jest.mock('~/store', () => ({__esModule: true,default: {diff --git a/client/src/components/Chat/__tests__/Landing.agent-contact.spec.tsx b/client/src/components/Chat/__tests__/Landing.agent-contact.spec.tsxindex fdc4bda71d..108e1a4bba 100644--- a/client/src/components/Chat/__tests__/Landing.agent-contact.spec.tsx+++ b/client/src/components/Chat/__tests__/Landing.agent-contact.spec.tsx@@ -26,6 +26,7 @@ jest.mock('@librechat/client', () => ({BirthdayIcon: () => <span data-testid="birthday-icon" />,TooltipAnchor: ({ children }: { children: React.ReactNode }) => <span>{children}</span>,SplitText: ({ text }: { text: string }) => <span>{text}</span>,+ useRemScale: () => 1,}));jest.mock('~/Providers', () => ({diff --git a/client/src/components/Conversations/Conversations.tsx b/client/src/components/Conversations/Conversations.tsxindex f910f672d5..d8c148d4d9 100644--- a/client/src/components/Conversations/Conversations.tsx+++ b/client/src/components/Conversations/Conversations.tsx@@ -4,7 +4,7 @@ import throttle from 'lodash/throttle';import { useRecoilValue } from 'recoil';import { useAtomValue, useSetAtom } from 'jotai';import { List, CellMeasurer, CellMeasurerCache } from 'react-virtualized';-import { Button, EmptyState, Spinner, useMediaQuery, buttonVariants } from '@librechat/client';+import { Button, EmptyState, Spinner, useRemScale, buttonVariants } from '@librechat/client';import {Archive,ChevronDown,@@ -42,6 +42,7 @@ import {import { useLocalize, TranslationKeys, useElementSize, useOuterScrollWindow } from '~/hooks';import { useActiveJobs, useRunningConversationsQuery } from '~/data-provider';import { facetFilterCountAtom, resetFacetsAtom } from './facets';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { groupConversations, cn } from '~/utils';import Convo from './Convo';import store from '~/store';@@ -258,7 +259,7 @@ const Conversations: FC<ConversationsProps> = ({resetFilters();resetFacets();}, [resetFilters, resetFacets]);- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();/* Dropping a chat on the Chats section makes it an ordinary chat: out of its* project, and unpinned. A root-list chat that is not pinned already is one,* so it is rejected rather than given a drop that would do nothing. */@@ -295,6 +296,7 @@ const Conversations: FC<ConversationsProps> = ({});dropRef(chatsRegionRef);const convoHeight = isSmallScreen ? 44 : 34;+ const remScale = useRemScale();const { ref: listContainerRef, width: listWidth } = useElementSize<HTMLDivElement>();/** The list does not scroll: the sidebar's one scroll container does, and the* list virtualizes against the slice of it the rows currently occupy. */@@ -448,7 +450,7 @@ const Conversations: FC<ConversationsProps> = ({() =>new CellMeasurerCache({fixedWidth: true,- defaultHeight: convoHeight,+ defaultHeight: Math.round(convoHeight * remScale),keyMapper: (index) => {const item = flattenedItemsRef.current[index];if (!item) {@@ -466,9 +468,12 @@ const Conversations: FC<ConversationsProps> = ({return `unknown-${index}`;},}),- [convoHeight],+ [convoHeight, remScale],);+ /** Rows are sized in rem, so a UI scale change resizes them without changing the+ * sidebar's physical width: pinned at its cap, the width effect below never fires+ * and every cached height stays stale. */useEffect(() => {const frameId = requestAnimationFrame(() => {cache.clearAll();@@ -477,7 +482,7 @@ const Conversations: FC<ConversationsProps> = ({}});return () => cancelAnimationFrame(frameId);- }, [search.query, cache, containerRef]);+ }, [search.query, remScale, cache, containerRef]);/** Grid only re-derives row offsets when the row count changes; reorders that* keep the count (e.g. a convo bumped across date groups) need an explicit recompute. */diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsxindex c2615c4362..982f8fa997 100644--- a/client/src/components/Conversations/Convo.tsx+++ b/client/src/components/Conversations/Convo.tsx@@ -15,6 +15,7 @@ import {import { cn, logger, setDocumentTitle, isConversationUnseen, hasRealTitle } from '~/utils';import { useNavigateToConvo, useLocalize, useShiftKey } from '~/hooks';import ConversationEndpointIcon from './ConversationEndpointIcon';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { focusableInRow, resolveRowBeside } from './focus';import { areConversationRenderPropsEqual } from './utils';import { NotificationSeverity } from '~/common';@@ -62,7 +63,7 @@ function Conversation({const updateConvoMutation = useUpdateConversationMutation(currentConvoId ?? '');const unpinMutation = usePinConversationMutation();const activeConversationId = useRecoilValue(store.conversationIdByIndex(0));- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();/* A deployment with shared links off leaves existing links in the database but stopsserving them, so the row must not advertise one that no longer resolves. */const { data: startupConfig } = useGetStartupConfig();@@ -312,7 +313,7 @@ function Conversation({actionVisibilityClassName = 'pointer-events-auto scale-x-100 opacity-100';/** Shift over the active row swaps the menu for archive and delete. */if (!isPopoverActive && isActiveConvo && isShiftHeld) {- actionWidthClassName = 'w-[60px]';+ actionWidthClassName = 'w-[3.75rem]';} else {actionWidthClassName = isSmallScreen ? 'w-9' : 'w-7';}diff --git a/client/src/components/Conversations/ConvoActions.tsx b/client/src/components/Conversations/ConvoActions.tsxindex c7619b7fb5..a65a68b640 100644--- a/client/src/components/Conversations/ConvoActions.tsx+++ b/client/src/components/Conversations/ConvoActions.tsx@@ -1,7 +1,8 @@import { memo, useState, useEffect } from 'react';import { Ellipsis } from 'lucide-react';-import { Button, useMediaQuery } from '@librechat/client';+import { Button } from '@librechat/client';import type { MouseEvent } from 'react';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { ConvoOptions } from './ConvoOptions';import { useLocalize } from '~/hooks';@@ -61,7 +62,7 @@ function ConvoActions({...options}: ConvoActionsProps) {const localize = useLocalize();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const [hasOpenedMenu, setHasOpenedMenu] = useState(false);useEffect(() => {diff --git a/client/src/components/Conversations/ConvoOptions/ConvoOptions.tsx b/client/src/components/Conversations/ConvoOptions/ConvoOptions.tsxindex dda9660f31..09692f8529 100644--- a/client/src/components/Conversations/ConvoOptions/ConvoOptions.tsx+++ b/client/src/components/Conversations/ConvoOptions/ConvoOptions.tsx@@ -2,8 +2,8 @@ import { useState, useId, useRef, memo, useCallback, useMemo } from 'react';import * as Ariakit from '@ariakit/react';import { useQueryClient } from '@tanstack/react-query';import { useParams, useNavigate } from 'react-router-dom';+import { DropdownPopup, Spinner, useToastContext } from '@librechat/client';import { QueryKeys, PermissionTypes, Permissions } from 'librechat-data-provider';-import { DropdownPopup, Spinner, useToastContext, useMediaQuery } from '@librechat/client';import {Ellipsis,Share2,@@ -30,6 +30,7 @@ import {} from '~/data-provider';import { useHasAccess, useLocalize, useNavigateToConvo, useNewConvo } from '~/hooks';import { useChatContext, useLiveAnnouncer } from '~/Providers';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { NotificationSeverity } from '~/common';import { cn, rowActionClasses } from '~/utils';import ProjectButton from './ProjectButton';@@ -83,7 +84,7 @@ function ConvoOptions({}) {const localize = useLocalize();const queryClient = useQueryClient();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const { index, setConversation } = useChatContext();const { data: startupConfig } = useGetStartupConfig();const { navigateToConvo } = useNavigateToConvo(index);diff --git a/client/src/components/Conversations/ConvoOptions/ShareButton.tsx b/client/src/components/Conversations/ConvoOptions/ShareButton.tsxindex c382452f1f..7bb8f3d966 100644--- a/client/src/components/Conversations/ConvoOptions/ShareButton.tsx+++ b/client/src/components/Conversations/ConvoOptions/ShareButton.tsx@@ -190,10 +190,13 @@ export default function ShareButton({{showQR && shareId && (<div className="flex min-h-56 items-center justify-center py-1">- <div className="bg-surface-qr rounded-2xl p-3 shadow-xs">+ <div className="bg-surface-qr min-w-0 rounded-2xl p-3 shadow-xs">+ {/* size is only the no-CSS fallback; the rem width is what renders,+ so the code follows the dialog instead of staying at 200px. */}<QRCodeSVGvalue={sharedLink}size={200}+ className="h-auto w-[12.5rem] max-w-full"marginSize={1}title={localize('com_ui_share_qr_code_description')}/>diff --git a/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx b/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsxindex 0c1687e04a..6995bfd1ff 100644--- a/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx+++ b/client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx@@ -340,7 +340,7 @@ export default function SharedLinkButton({key={refreshAnimationId}className={refreshAnimationId > 0- ? 'size-4 animate-refresh-link-spin motion-reduce:animate-none'+ ? 'animate-refresh-link-spin size-4 motion-reduce:animate-none': 'size-4'}aria-hidden="true"@@ -424,7 +424,7 @@ export default function SharedLinkButton({><OGDialogContentrole="alertdialog"- className="w-11/12 max-w-[450px]"+ className="w-11/12 max-w-[28.125rem]"showCloseButton={false}><OGDialogHeader>diff --git a/client/src/components/Conversations/ConvoOptions/__tests__/ConvoOptions.archive.test.tsx b/client/src/components/Conversations/ConvoOptions/__tests__/ConvoOptions.archive.test.tsxindex 2a120f66db..da1d891947 100644--- a/client/src/components/Conversations/ConvoOptions/__tests__/ConvoOptions.archive.test.tsx+++ b/client/src/components/Conversations/ConvoOptions/__tests__/ConvoOptions.archive.test.tsx@@ -59,6 +59,7 @@ jest.mock('@librechat/client', () => ({buttonVariants: () => '',useToastContext: () => ({ showToast: jest.fn() }),useMediaQuery: () => false,+ useRemScale: () => 1,}));jest.mock('~/data-provider', () => ({diff --git a/client/src/components/Conversations/ProjectsSection.tsx b/client/src/components/Conversations/ProjectsSection.tsxindex 3730ca9b4b..ff1591849e 100644--- a/client/src/components/Conversations/ProjectsSection.tsx+++ b/client/src/components/Conversations/ProjectsSection.tsx@@ -354,7 +354,8 @@ const ProjectItem = memo(menuId={menuId}isOpen={isMenuOpen}setIsOpen={setIsMenuOpen}- className="z-[125] min-w-44"+ className="z-[125]"+ minWidth="11rem"iconClassName="mr-2 text-text-secondary"trigger={<Ariakit.MenuButtondiff --git a/client/src/components/Conversations/__tests__/Conversations.test.tsx b/client/src/components/Conversations/__tests__/Conversations.test.tsxindex fb22670b70..d380c9e037 100644--- a/client/src/components/Conversations/__tests__/Conversations.test.tsx+++ b/client/src/components/Conversations/__tests__/Conversations.test.tsx@@ -105,6 +105,7 @@ jest.mock('@librechat/client', () => ({Spinner: () => <div data-testid="spinner" />,useMediaQuery: () => false,useToastContext: () => ({ showToast: jest.fn() }),+ useRemScale: () => 1,}));jest.mock('~/data-provider', () => ({diff --git a/client/src/components/Conversations/__tests__/Convo.status.spec.tsx b/client/src/components/Conversations/__tests__/Convo.status.spec.tsxindex 35762f4f97..67ce2383a2 100644--- a/client/src/components/Conversations/__tests__/Convo.status.spec.tsx+++ b/client/src/components/Conversations/__tests__/Convo.status.spec.tsx@@ -7,6 +7,7 @@ let mockIsUnseen = false;jest.mock('@librechat/client', () => ({useMediaQuery: () => false,+ useRemScale: () => 1,useToastContext: () => ({ showToast: jest.fn() }),Spinner: ({ className }: { className?: string }) => (<svg data-testid="status-ring" className={className} />diff --git a/client/src/components/Conversations/__tests__/Convo.touch.spec.tsx b/client/src/components/Conversations/__tests__/Convo.touch.spec.tsxindex 1381ab5c4d..0578db2411 100644--- a/client/src/components/Conversations/__tests__/Convo.touch.spec.tsx+++ b/client/src/components/Conversations/__tests__/Convo.touch.spec.tsx@@ -12,6 +12,7 @@ let mockCloseMenu: () => void = () => undefined;jest.mock('@librechat/client', () => ({useMediaQuery: () => mockIsSmallScreen,+ useRemScale: () => 1,useToastContext: () => ({ showToast: jest.fn() }),Spinner: () => <div data-testid="spinner" />,Button: ({ children, ...props }: React.ComponentProps<'button'>) => (diff --git a/client/src/components/Conversations/__tests__/Convo.unpin.spec.tsx b/client/src/components/Conversations/__tests__/Convo.unpin.spec.tsxindex 283749f060..1ee0103d64 100644--- a/client/src/components/Conversations/__tests__/Convo.unpin.spec.tsx+++ b/client/src/components/Conversations/__tests__/Convo.unpin.spec.tsx@@ -10,6 +10,7 @@ const pinCalls: Array<{ variables: PinVariables; options?: PinOptions }> = [];jest.mock('@librechat/client', () => ({useMediaQuery: () => false,+ useRemScale: () => 1,useToastContext: () => ({ showToast: jest.fn() }),Spinner: () => <div data-testid="spinner" />,TooltipAnchor: ({ render: trigger }: { render: React.ReactNode }) => trigger,diff --git a/client/src/components/Endpoints/AlternativeSettings.tsx b/client/src/components/Endpoints/AlternativeSettings.tsxindex 2ee51da492..89c9742531 100644--- a/client/src/components/Endpoints/AlternativeSettings.tsx+++ b/client/src/components/Endpoints/AlternativeSettings.tsx@@ -17,7 +17,12 @@ export default function AlternativeSettings({}return (- <div className={cn('hide-scrollbar h-[500px] overflow-y-auto md:mb-2 md:h-[350px]', className)}>+ <div+ className={cn(+ 'hide-scrollbar h-[min(31.25rem,70vh)] overflow-y-auto md:mb-2 md:h-[min(21.875rem,70vh)]',+ className,+ )}+ ><Advanced conversation={conversation} setOption={setOption} isPreset={isPreset} /></div>);diff --git a/client/src/components/Endpoints/ConvoIconURL.tsx b/client/src/components/Endpoints/ConvoIconURL.tsxindex 3e2f797b15..61c3d47bfd 100644--- a/client/src/components/Endpoints/ConvoIconURL.tsx+++ b/client/src/components/Endpoints/ConvoIconURL.tsx@@ -22,7 +22,8 @@ const classMap = {};const styleMap = {- 'menu-item': { width: '20px', height: '20px' },+ /** 1.25rem is 20px at the 16px baseline, and follows the UI scale. */+ 'menu-item': { width: '1.25rem', height: '1.25rem' },default: { width: '100%', height: '100%' },};@@ -50,7 +51,7 @@ const ConvoIconURL: React.FC<ConvoIconURLProps> = ({}return (- <div className="shadow-stroke relative flex h-full items-center justify-center rounded-full bg-surface-primary text-text-primary">+ <div className="shadow-stroke bg-surface-primary text-text-primary relative flex h-full items-center justify-center rounded-full"><ProviderIcon provider={provider} size={41} className="h-2/3 w-2/3" /></div>);diff --git a/client/src/components/Endpoints/EndpointSettings.tsx b/client/src/components/Endpoints/EndpointSettings.tsxindex d470f53062..2c8d7d554b 100644--- a/client/src/components/Endpoints/EndpointSettings.tsx+++ b/client/src/components/Endpoints/EndpointSettings.tsx@@ -30,7 +30,12 @@ export default function Settings({if (OptionComponent) {return (- <div className={cn('h-[500px] overflow-y-auto md:mb-2 md:h-[350px]', className)}>+ <div+ className={cn(+ 'h-[min(31.25rem,70vh)] overflow-y-auto md:mb-2 md:h-[min(21.875rem,70vh)]',+ className,+ )}+ ><OptionComponentconversation={conversation}setOption={setOption}@@ -48,7 +53,12 @@ export default function Settings({}return (- <div className={cn('hide-scrollbar h-[500px] overflow-y-auto md:mb-2 md:h-[350px]', className)}>+ <div+ className={cn(+ 'hide-scrollbar h-[min(31.25rem,70vh)] overflow-y-auto md:mb-2 md:h-[min(21.875rem,70vh)]',+ className,+ )}+ ><MultiViewComponent conversation={conversation} models={models} isPreset={isPreset} /></div>);diff --git a/client/src/components/Endpoints/Icon.tsx b/client/src/components/Endpoints/Icon.tsxindex c335868357..a2b32c93ee 100644--- a/client/src/components/Endpoints/Icon.tsx+++ b/client/src/components/Endpoints/Icon.tsx@@ -1,6 +1,6 @@import React, { memo } from 'react';import { useRecoilValue } from 'recoil';-import { UserIcon, useAvatar } from '@librechat/client';+import { UserIcon, useAvatar, pxToRem } from '@librechat/client';import type { IconProps } from '~/common';import MessageEndpointIcon from './MessageEndpointIcon';import { useLocalize } from '~/hooks';@@ -71,7 +71,7 @@ const UserAvatar = memo(return (<divtitle={username}- style={{ width: size, height: size }}+ style={{ width: pxToRem(size), height: pxToRem(size) }}className={cn('relative flex items-center justify-center', className ?? '')}>{resolved.type === 'image' ? (@@ -84,8 +84,8 @@ const UserAvatar = memo() : (<divstyle={{- width: '20px',- height: '20px',+ width: pxToRem(20),+ height: pxToRem(20),}}className="bg-avatar-fill text-avatar-text ring-avatar-edge/10 relative flex h-9 w-9 items-center justify-center rounded-sm p-1 ring-1">diff --git a/client/src/components/Endpoints/MessageEndpointIcon.tsx b/client/src/components/Endpoints/MessageEndpointIcon.tsxindex 7daedf8ee1..c5e953d20e 100644--- a/client/src/components/Endpoints/MessageEndpointIcon.tsx+++ b/client/src/components/Endpoints/MessageEndpointIcon.tsx@@ -1,7 +1,7 @@import { memo } from 'react';import { Feather } from 'lucide-react';import { EModelEndpoint, isAssistantsEndpoint } from 'librechat-data-provider';-import { AssistantIcon, TooltipAnchor, ProviderAvatar } from '@librechat/client';+import { pxToRem, AssistantIcon, TooltipAnchor, ProviderAvatar } from '@librechat/client';import type { IconProps } from '~/common';import { useProviderIcon } from '~/hooks/Endpoint';import { cn } from '~/utils';@@ -25,8 +25,8 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {<TooltipAnchordescription={assistantName ?? ''}style={{- width: size,- height: size,+ width: pxToRem(size),+ height: pxToRem(size),}}className={cn('overflow-hidden rounded-full', props.className ?? '')}>@@ -41,7 +41,7 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {) : (<div className="h-6 w-6"><div className="shadow-stroke flex h-6 w-6 items-center justify-center overflow-hidden rounded-full">- <AssistantIcon className="h-2/3 w-2/3 text-text-tertiary" />+ <AssistantIcon className="text-text-tertiary h-2/3 w-2/3" /></div></div>),@@ -54,8 +54,8 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {<TooltipAnchordescription={agentName ?? ''}style={{- width: size,- height: size,+ width: pxToRem(size),+ height: pxToRem(size),}}className={cn('overflow-hidden rounded-full', props.className ?? '')}>@@ -70,7 +70,7 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {) : (<div className="h-6 w-6"><div className="shadow-stroke flex h-6 w-6 items-center justify-center overflow-hidden rounded-full">- <Feather className="h-2/3 w-2/3 text-text-tertiary" aria-hidden="true" />+ <Feather className="text-text-tertiary h-2/3 w-2/3" aria-hidden="true" /></div></div>),@@ -78,7 +78,7 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {};const errorBadge = error === true && (- <span className="absolute right-0 top-[20px] -mr-2 flex h-3 w-3 items-center justify-center rounded-full border border-surface-primary bg-status-error-strong text-[10px] text-text-on-status">+ <span className="border-surface-primary bg-status-error-strong text-text-on-status absolute top-[1.25rem] right-0 -mr-2 flex h-3 w-3 items-center justify-center rounded-full border text-[10px]">!</span>);@@ -96,11 +96,11 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {<divtitle={endpoint ?? ''}style={{- width: size,- height: size,+ width: pxToRem(size),+ height: pxToRem(size),}}className={cn(- 'relative flex h-9 w-9 items-center justify-center rounded-sm p-1 text-text-primary',+ 'text-text-primary relative flex h-9 w-9 items-center justify-center rounded-sm p-1',props.className ?? '',)}>diff --git a/client/src/components/Endpoints/MinimalIcon.tsx b/client/src/components/Endpoints/MinimalIcon.tsxindex 969ab49af9..440e20292d 100644--- a/client/src/components/Endpoints/MinimalIcon.tsx+++ b/client/src/components/Endpoints/MinimalIcon.tsx@@ -1,6 +1,6 @@import { Feather } from 'lucide-react';import { EModelEndpoint, alternateName } from 'librechat-data-provider';-import { Sparkles, ProviderIcon, getProviderIconDef } from '@librechat/client';+import { pxToRem, Sparkles, ProviderIcon, getProviderIconDef } from '@librechat/client';import type { IconProps } from '~/common';import { useProviderIcon } from '~/hooks/Endpoint';import { cn } from '~/utils';@@ -28,17 +28,17 @@ const MinimalIcon: React.FC<IconProps> = (props) => {title={name}aria-hidden="true"style={{- width: size,- height: size,+ width: pxToRem(size),+ height: pxToRem(size),}}className={cn(- 'relative flex items-center justify-center rounded-sm text-text-secondary',+ 'text-text-secondary relative flex items-center justify-center rounded-sm',props.className ?? '',)}>{icon}{error === true && (- <span className="absolute right-0 top-[20px] -mr-2 flex h-4 w-4 items-center justify-center rounded-full border border-surface-primary bg-status-error-strong text-[10px] text-text-on-status">+ <span className="border-surface-primary bg-status-error-strong text-text-on-status absolute top-[1.25rem] right-0 -mr-2 flex h-4 w-4 items-center justify-center rounded-full border text-[10px]">!</span>)}diff --git a/client/src/components/Endpoints/Settings/Advanced.tsx b/client/src/components/Endpoints/Settings/Advanced.tsxindex 2f986dd731..9668b0b57e 100644--- a/client/src/components/Endpoints/Settings/Advanced.tsx+++ b/client/src/components/Endpoints/Settings/Advanced.tsx@@ -113,7 +113,7 @@ export default function Settings({placeholder={localize('com_endpoint_openai_prompt_prefix_placeholder')}className={cn(defaultTextProps,- 'flex max-h-[138px] min-h-[100px] w-full resize-none px-3 py-2',+ 'flex max-h-[8.625rem] min-h-[6.25rem] w-full resize-none px-3 py-2',)}/></div>@@ -326,7 +326,7 @@ export default function Settings({</HoverCardTrigger></HoverCard><HoverCard openDelay={500}>- <HoverCardTrigger className="flex w-[52%] md:w-[125px]">+ <HoverCardTrigger className="flex w-[52%] md:w-[7.8125rem]"><Sliderid="image-detail-slider"disabled={readonly}diff --git a/client/src/components/Endpoints/Settings/Assistants.tsx b/client/src/components/Endpoints/Settings/Assistants.tsxindex 96a65d5b86..7d1fd9bfd4 100644--- a/client/src/components/Endpoints/Settings/Assistants.tsx+++ b/client/src/components/Endpoints/Settings/Assistants.tsx@@ -152,7 +152,7 @@ export default function Settings({ conversation, setOption, models, readonly }:<div className="grid w-full items-center gap-2"><Label htmlFor="promptPrefix" className="text-left text-sm font-medium">{localize('com_endpoint_prompt_prefix_assistants')}{' '}- <small className="opacity-40 high-contrast:opacity-100">+ <small className="high-contrast:opacity-100 opacity-40">({localize('com_endpoint_default_blank')})</small></Label>@@ -164,14 +164,14 @@ export default function Settings({ conversation, setOption, models, readonly }:placeholder={localize('com_endpoint_prompt_prefix_assistants_placeholder')}className={cn(defaultTextProps,- 'flex max-h-[240px] min-h-[80px] w-full resize-none px-3 py-2',+ 'flex max-h-[15rem] min-h-[5rem] w-full resize-none px-3 py-2',)}/></div><div className="grid w-full items-center gap-2"><Label htmlFor="instructions" className="text-left text-sm font-medium">{localize('com_endpoint_instructions_assistants')}{' '}- <small className="opacity-40 high-contrast:opacity-100">+ <small className="high-contrast:opacity-100 opacity-40">({localize('com_endpoint_default_blank')})</small></Label>@@ -183,7 +183,7 @@ export default function Settings({ conversation, setOption, models, readonly }:placeholder={localize('com_endpoint_instructions_assistants_placeholder')}className={cn(defaultTextProps,- 'flex max-h-[240px] min-h-[80px] w-full resize-none px-3 py-2',+ 'flex max-h-[15rem] min-h-[5rem] w-full resize-none px-3 py-2',)}/></div>diff --git a/client/src/components/Endpoints/Settings/Examples.tsx b/client/src/components/Endpoints/Settings/Examples.tsxindex afe2766bcd..4ba62486c9 100644--- a/client/src/components/Endpoints/Settings/Examples.tsx+++ b/client/src/components/Endpoints/Settings/Examples.tsx@@ -44,7 +44,7 @@ function Examples({ readonly, examples, setExample, addExample, removeExample }:placeholder="Set example input. Example is ignored if empty."className={cn(defaultTextProps,- 'flex max-h-[138px] min-h-[75px] w-full resize-none px-3 py-2',+ 'flex max-h-[8.625rem] min-h-[4.6875rem] w-full resize-none px-3 py-2',)}/></div>@@ -71,7 +71,7 @@ function Examples({ readonly, examples, setExample, addExample, removeExample }:placeholder={'Set example output. Example is ignored if empty.'}className={cn(defaultTextProps,- 'flex max-h-[300px] min-h-[75px] w-full resize-none px-3 py-2',+ 'flex max-h-[18.75rem] min-h-[4.6875rem] w-full resize-none px-3 py-2',)}/></div>@@ -85,14 +85,14 @@ function Examples({ readonly, examples, setExample, addExample, removeExample }:className="text-text-primary hover:bg-surface-hover hover:text-text-primary mt-1 mr-2 h-auto items-center justify-center bg-transparent px-3 py-2 text-xs font-medium font-normal focus:ring-0 focus:ring-offset-0 dark:focus:ring-offset-0"onClick={removeExample}>- <Minus className="w-[16px]" aria-hidden="true" />+ <Minus className="w-[1rem]" aria-hidden="true" /></Button><Buttontype="button"className="text-text-primary hover:bg-surface-hover hover:text-text-primary mt-1 h-auto items-center justify-center bg-transparent px-3 py-2 text-xs font-medium font-normal focus:ring-0 focus:ring-offset-0 dark:focus:ring-offset-0"onClick={addExample}>- <Plus className="w-[16px]" aria-hidden="true" />+ <Plus className="w-[1rem]" aria-hidden="true" /></Button></div></>diff --git a/client/src/components/Endpoints/URLIcon.tsx b/client/src/components/Endpoints/URLIcon.tsxindex e514bc8e46..df80b5fffa 100644--- a/client/src/components/Endpoints/URLIcon.tsx+++ b/client/src/components/Endpoints/URLIcon.tsx@@ -1,13 +1,16 @@import React, { memo, useState } from 'react';import { AlertCircle } from 'lucide-react';-import { ProviderIcon } from '@librechat/client';+import { pxToRem, ProviderIcon } from '@librechat/client';import type { ProviderId } from 'librechat-data-provider';+/** Intrinsic fallback for parents without a definite size; `h-full w-full` scales it elsewhere. */+const FALLBACK_ICON_PX = 20;+export const URLIcon = memo(({iconURL,altName,- containerStyle = { width: 20, height: 20 },+ containerStyle = { width: pxToRem(FALLBACK_ICON_PX), height: pxToRem(FALLBACK_ICON_PX) },imageStyle = { width: '100%', height: '100%' },className = 'icon-md mr-1 shrink-0 overflow-hidden rounded-full',provider,@@ -29,16 +32,16 @@ export const URLIcon = memo(const numericSize =typeof containerStyle.width === 'number' ? containerStyle.width : undefined;return (- <div className="relative" style={{ ...containerStyle, margin: '2px' }}>+ <div className="relative" style={{ ...containerStyle, margin: pxToRem(2) }}><div className={className}><ProviderIcon provider={provider} size={numericSize} className="h-full w-full" /></div>{imageError && iconURL && (<div- className="absolute flex items-center justify-center rounded-full bg-status-error-strong"- style={{ width: '14px', height: '14px', top: 0, right: 0 }}+ className="bg-status-error-strong absolute flex items-center justify-center rounded-full"+ style={{ width: pxToRem(14), height: pxToRem(14), top: 0, right: 0 }}>- <AlertCircle size={10} className="text-text-on-status" aria-hidden="true" />+ <AlertCircle className="text-text-on-status size-2.5" aria-hidden="true" /></div>)}</div>@@ -55,8 +58,8 @@ export const URLIcon = memo(onError={handleImageError}loading="lazy"decoding="async"- width={Number(containerStyle.width) || 20}- height={Number(containerStyle.height) || 20}+ width={FALLBACK_ICON_PX}+ height={FALLBACK_ICON_PX}/></div>);diff --git a/client/src/components/Input/Generations/Button.tsx b/client/src/components/Input/Generations/Button.tsxindex def41de95a..42dfbd8992 100644--- a/client/src/components/Input/Generations/Button.tsx+++ b/client/src/components/Input/Generations/Button.tsx@@ -23,7 +23,7 @@ export default function Button({data-testid={`${type}-generation-button`}aria-keyshortcuts={ariaKey}className={cn(- 'custom-btn btn-neutral relative -z-0 whitespace-nowrap border-0 md:border',+ 'custom-btn btn-neutral relative -z-0 border-0 whitespace-nowrap md:border',removeFocusOutlines,className,)}@@ -32,7 +32,7 @@ export default function Button({<div className="flex w-full items-center justify-center gap-2">{children}{shortcutDisplay && (- <span className="hidden rounded-md border border-border-light px-1.5 py-0.5 text-[10px] leading-none text-text-secondary md:inline-flex">+ <span className="border-border-light text-text-secondary hidden rounded-md border px-1.5 py-0.5 text-[10px] leading-none md:inline-flex">{shortcutDisplay}</span>)}diff --git a/client/src/components/Input/ModelSelect/Anthropic.tsx b/client/src/components/Input/ModelSelect/Anthropic.tsxindex e3cdc5fc9c..34f623bc8a 100644--- a/client/src/components/Input/ModelSelect/Anthropic.tsx+++ b/client/src/components/Input/ModelSelect/Anthropic.tsx@@ -20,7 +20,7 @@ export default function Anthropic({showLabel={false}className={cn(cardStyle,- 'z-50 flex h-[40px] w-48 min-w-48 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer',+ 'z-50 flex h-[2.5rem] w-48 min-w-48 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer',)}/>);diff --git a/client/src/components/Input/ModelSelect/ChatGPT.tsx b/client/src/components/Input/ModelSelect/ChatGPT.tsxindex 70fa7ef9f0..5b46670325 100644--- a/client/src/components/Input/ModelSelect/ChatGPT.tsx+++ b/client/src/components/Input/ModelSelect/ChatGPT.tsx@@ -27,7 +27,7 @@ export default function ChatGPT({showLabel={false}className={cn(cardStyle,- 'z-50 flex h-[40px] w-60 min-w-48 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer',+ 'z-50 flex h-[2.5rem] w-60 min-w-48 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer',)}/>);diff --git a/client/src/components/Input/ModelSelect/Google.tsx b/client/src/components/Input/ModelSelect/Google.tsxindex 870d91ee6b..c6c8522e2a 100644--- a/client/src/components/Input/ModelSelect/Google.tsx+++ b/client/src/components/Input/ModelSelect/Google.tsx@@ -20,7 +20,7 @@ export default function Google({showLabel={false}className={cn(cardStyle,- 'z-50 flex h-[40px] w-48 min-w-48 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer',+ 'z-50 flex h-[2.5rem] w-48 min-w-48 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer',)}/>);diff --git a/client/src/components/Input/ModelSelect/MultiSelectDropDown.tsx b/client/src/components/Input/ModelSelect/MultiSelectDropDown.tsxindex 53bfb6912f..9f986f0485 100644--- a/client/src/components/Input/ModelSelect/MultiSelectDropDown.tsx+++ b/client/src/components/Input/ModelSelect/MultiSelectDropDown.tsx@@ -114,7 +114,7 @@ function MultiSelectDropDown({<divkey={i}className="relative"- style={{ width: '16px', height: '16px' }}+ style={{ width: '1rem', height: '1rem' }}>{v.icon ? (<img@@ -175,7 +175,7 @@ function MultiSelectDropDown({<ListboxOptionkey={i}value={option[optionValueKey]}- className="group border-border-light text-text-primary hover:bg-surface-hover relative flex h-[42px] cursor-pointer items-center overflow-hidden border-b pr-9 pl-3 select-none last:border-0"+ className="group border-border-light text-text-primary hover:bg-surface-hover relative flex h-[2.625rem] cursor-pointer items-center overflow-hidden border-b pr-9 pl-3 select-none last:border-0"><span className="flex items-center gap-1.5 truncate">{!option.isButton && (diff --git a/client/src/components/Input/ModelSelect/OpenAI.tsx b/client/src/components/Input/ModelSelect/OpenAI.tsxindex f885950de3..371af3a98a 100644--- a/client/src/components/Input/ModelSelect/OpenAI.tsx+++ b/client/src/components/Input/ModelSelect/OpenAI.tsx@@ -20,7 +20,7 @@ export default function OpenAI({showLabel={false}className={cn(cardStyle,- 'z-50 flex h-[40px] w-48 min-w-48 flex-none items-center justify-center px-4 hover:cursor-pointer',+ 'z-50 flex h-[2.5rem] w-48 min-w-48 flex-none items-center justify-center px-4 hover:cursor-pointer',)}/>);diff --git a/client/src/components/Input/ModelSelect/SelectDropDownPop.tsx b/client/src/components/Input/ModelSelect/SelectDropDownPop.tsxindex 75ec90c56d..ce9b8be381 100644--- a/client/src/components/Input/ModelSelect/SelectDropDownPop.tsx+++ b/client/src/components/Input/ModelSelect/SelectDropDownPop.tsx@@ -70,7 +70,7 @@ function SelectDropDownPop({className={cn('border-border-light bg-surface-secondary relative flex cursor-pointer flex-col rounded-lg border py-2 pr-10 pl-3 text-left focus:ring-0 focus:ring-offset-0 sm:text-sm','hover:bg-surface-hover data-[state=open]:bg-surface-hover',- 'max-w-[215px] min-w-[200px] sm:max-w-full sm:min-w-full',+ 'max-w-[min(13.4375rem,90vw)] min-w-[min(12.5rem,90vw)] sm:max-w-full sm:min-w-full',)}aria-label={localize('com_ui_select_var', { 0: title })}aria-haspopup="false"@@ -82,7 +82,7 @@ function SelectDropDownPop({className={cn('text-text-primary flex h-6 items-center gap-1 text-sm',!showLabel ? 'text-xs' : '',- 'min-w-[75px] font-normal',+ 'min-w-[4.6875rem] font-normal',)}>{typeof value !== 'string' && value ? (value.label ?? '') : (value ?? '')}diff --git a/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx b/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsxindex 4cb2b52105..5bd01efb75 100644--- a/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx+++ b/client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx@@ -120,7 +120,7 @@ const RevokeKeysButton = ({{localize('com_ui_revoke')}</Button></OGDialogTrigger>- <OGDialogContent className="max-w-[450px]">+ <OGDialogContent className="max-w-[28.125rem]"><OGDialogHeader><OGDialogTitle>{localize('com_ui_revoke_key_endpoint', { 0: endpoint })}</OGDialogTitle></OGDialogHeader>@@ -137,7 +137,7 @@ const RevokeKeysButton = ({variant="destructive"onClick={onClick}disabled={isLoading}- className="bg-surface-destructive text-text-on-status transition-all duration-200 hover:bg-surface-destructive-hover"+ className="bg-surface-destructive text-text-on-status hover:bg-surface-destructive-hover transition-all duration-200">{isLoading ? <Spinner /> : localize('com_ui_revoke')}</Button>@@ -389,7 +389,7 @@ const SetKeyDialog = ({value={expiresAtLabel}onChange={handleExpirationChange}options={expirationOptions.map((option) => option.label)}- sizeClasses="w-[185px]"+ sizeClasses="w-[min(11.5625rem,90vw)]"portal={false}/><FormProvider {...methods}>diff --git a/client/src/components/Insights/InsightsView.tsx b/client/src/components/Insights/InsightsView.tsxindex 16ae62dba9..61bf89ad9d 100644--- a/client/src/components/Insights/InsightsView.tsx+++ b/client/src/components/Insights/InsightsView.tsx@@ -2,14 +2,7 @@ import { useEffect, useId, useMemo, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';import { Navigate, useSearchParams } from 'react-router-dom';import { AlertCircle, Check, Info, Minus, Search } from 'lucide-react';-import {- Button,- Input,- MultiSelect,- Spinner,- TooltipAnchor,- useMediaQuery,-} from '@librechat/client';+import { Button, Input, MultiSelect, Spinner, TooltipAnchor } from '@librechat/client';import {INSIGHTS_MAX_RANGE_DAYS,INSIGHTS_SEARCH_MAX_LENGTH,@@ -27,6 +20,7 @@ import { clearAgentFilters, shouldRecoverAgentFilters } from './agentFilters';import { useGetStartupConfig, useInsightsQuery } from '~/data-provider';import { useAuthContext, useDocumentTitle, useLocalize } from '~/hooks';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { LocalizedDateRangePicker } from '~/components/ui';import { getRollingDateRange } from './dateRange';import { cn } from '~/utils';@@ -310,7 +304,7 @@ function TopUsersTable({<EmptyState message={localize('com_insights_no_data')} />) : (<div className="overflow-x-auto">- <table className="w-full min-w-[420px] text-left text-sm">+ <table className="w-full min-w-[26.25rem] text-left text-sm"><thead className="border-border-medium text-text-secondary border-b text-xs"><tr><th className="px-2 py-2 font-medium">{localize('com_insights_user')}</th>@@ -378,7 +372,7 @@ function ChurnedUsersTable({<EmptyState message={localize('com_insights_no_data')} />) : (<div className="overflow-x-auto">- <table className="w-full min-w-[560px] table-fixed text-left text-sm">+ <table className="w-full min-w-[35rem] table-fixed text-left text-sm"><thead className="border-border-medium text-text-secondary border-b text-xs"><tr><th className="w-[34%] px-2 py-2 font-medium">{localize('com_insights_user')}</th>@@ -472,12 +466,12 @@ function LatestConversations({</div></div><div className="overflow-x-auto">- <table className="w-full min-w-[900px] table-fixed text-left text-sm">+ <table className="w-full min-w-[56.25rem] table-fixed text-left text-sm"><thead className="border-border-medium text-text-secondary border-b text-xs"><tr>- <th className="w-[120px] px-2 py-2 font-medium">{localize('com_insights_date')}</th>- <th className="w-[192px] px-2 py-2 font-medium">{localize('com_insights_user')}</th>- <th className="w-[160px] px-2 py-2 font-medium">{localize('com_insights_agent')}</th>+ <th className="w-[7.5rem] px-2 py-2 font-medium">{localize('com_insights_date')}</th>+ <th className="w-[12rem] px-2 py-2 font-medium">{localize('com_insights_user')}</th>+ <th className="w-[10rem] px-2 py-2 font-medium">{localize('com_insights_agent')}</th><th className="px-2 py-2 font-medium">{localize('com_insights_first_message')}</th><th className="w-20 px-2 py-2 text-right font-medium">{localize('com_insights_messages')}@@ -565,7 +559,7 @@ export default function InsightsView() {const [page, setPage] = useState(1);const [pendingAgentIds, setPendingAgentIds] = useState<string[] | null>(null);const dateRangeSelectionTimeout = useRef<number>();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const insightsFeatureEnabled = startupConfig?.insightsEnabled === true;const selectedAgentIds = useMemo(() => [...new Set(urlSearchParams.getAll('agentIds').filter(Boolean))].sort(),@@ -848,7 +842,7 @@ export default function InsightsView() {</Button>))}</div>- <div className="w-full min-w-0 sm:w-[340px]">+ <div className="w-full min-w-0 sm:w-[21.25rem]"><LocalizedDateRangePickerendDate={displayDateRange.endDate}futureDatesDisabled@@ -893,7 +887,7 @@ export default function InsightsView() {<KpiCard key={card.id} card={card} locale={locale} />))}</div>- <div className="grid w-full grid-cols-[repeat(auto-fit,minmax(min(100%,580px),1fr))] gap-3">+ <div className="grid w-full grid-cols-[repeat(auto-fit,minmax(min(100%,36.25rem),1fr))] gap-3"><TopUsersTable rows={data.topUsers} localize={localize} locale={locale} /><ChurnedUsersTable rows={data.churnedUsers} localize={localize} locale={locale} /></div>diff --git a/client/src/components/MCP/McpOAuthDialog.tsx b/client/src/components/MCP/McpOAuthDialog.tsxindex 40a8d9a098..6eea77d54b 100644--- a/client/src/components/MCP/McpOAuthDialog.tsx+++ b/client/src/components/MCP/McpOAuthDialog.tsx@@ -48,7 +48,7 @@ export default function McpOAuthDialog({return (<OGDialog open={open} onOpenChange={onOpenChange}>- <OGDialogContent className="w-11/12 max-w-md overflow-hidden rounded-2xl">+ <OGDialogContent className="w-11/12 max-w-md overflow-x-hidden overflow-y-auto rounded-2xl"><div className="flex items-center gap-2">{iconUrl && !iconError && (<span@@ -72,7 +72,7 @@ export default function McpOAuthDialog({{localize('com_ui_mcp_oauth_description')}</OGDialogDescription>- <div className="flex flex-col gap-3 p-1">+ <div className="flex min-w-0 flex-col gap-3 p-1">{/* Auto-height reveal via grid-template-rows 0fr -> 1fr so the QR slides* open smoothly without a hardcoded height, matching MCPToolItem. */}<div@@ -88,10 +88,13 @@ export default function McpOAuthDialog({showQR ? 'opacity-100' : 'opacity-0',)}>- <div className="bg-surface-qr rounded-2xl p-4 shadow-lg">+ <div className="bg-surface-qr max-w-full min-w-0 rounded-2xl p-4 shadow-lg">+ {/* size is only the no-CSS fallback; the rem width is what renders,+ so the code follows the dialog instead of staying at 180px. */}<QRCodeSVGvalue={oauthUrl}size={180}+ className="h-auto w-[11.25rem] max-w-full"marginSize={2}title={localize('com_ui_mcp_oauth_qr_code_description')}/>@@ -127,7 +130,7 @@ export default function McpOAuthDialog({/></div>- <div className="flex items-center gap-2">+ <div className="flex min-w-0 flex-wrap items-center gap-2"><Buttontype="button"variant="outline"@@ -142,11 +145,11 @@ export default function McpOAuthDialog({<Buttontype="button"variant="submit"- className="flex-1"+ className="h-auto min-h-10 min-w-0 flex-1 basis-40 whitespace-normal"onClick={() => openInNewTab(oauthUrl)}>{localize('com_ui_continue_oauth')}- <ExternalLink className="size-4" aria-hidden="true" />+ <ExternalLink className="size-4 shrink-0" aria-hidden="true" /></Button></div></div>diff --git a/client/src/components/MCP/StackedMCPIcons.tsx b/client/src/components/MCP/StackedMCPIcons.tsxindex 6f69bcb619..cdeb35214b 100644--- a/client/src/components/MCP/StackedMCPIcons.tsx+++ b/client/src/components/MCP/StackedMCPIcons.tsx@@ -14,8 +14,8 @@ interface StackedMCPIconsProps {const sizeConfig = {sm: {- icon: 'h-[18px] w-[18px]',- container: 'h-[22px] w-[22px]',+ icon: 'h-[1.125rem] w-[1.125rem]',+ container: 'h-[1.375rem] w-[1.375rem]',overlap: '-ml-2.5',},md: {diff --git a/client/src/components/Messages/Content/ActionButton.tsx b/client/src/components/Messages/Content/ActionButton.tsxindex 5eb095e1b9..dc7397e37e 100644--- a/client/src/components/Messages/Content/ActionButton.tsx+++ b/client/src/components/Messages/Content/ActionButton.tsx@@ -41,14 +41,19 @@ const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>(tabIndex={tabIndex}aria-label={currentLabel}className={cn(- 'inline-flex select-none items-center justify-center text-text-secondary transition-all duration-200 ease-out',+ 'text-text-secondary inline-flex items-center justify-center transition-all duration-200 ease-out select-none','hover:bg-surface-hover hover:text-text-primary',- 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-heavy',+ 'focus-visible:outline-border-heavy focus-visible:outline focus-visible:outline-2',iconOnly ? 'rounded-lg p-1.5' : 'ml-auto gap-2 rounded-md px-2 py-1',className,)}>- <MorphIcon icon={isActive ? Check : icon} size={18} />+ <span+ className="relative flex size-[1.125rem] items-center justify-center"+ aria-hidden="true"+ >+ <MorphIcon icon={isActive ? Check : icon} size="1.125rem" />+ </span>{!iconOnly && (<span className="relative overflow-hidden"><spandiff --git a/client/src/components/Messages/Content/Container.tsx b/client/src/components/Messages/Content/Container.tsxindex bad054da25..7572ff18d0 100644--- a/client/src/components/Messages/Content/Container.tsx+++ b/client/src/components/Messages/Content/Container.tsx@@ -1,6 +1,6 @@// Container Componentconst Container = ({ children }: { children: React.ReactNode }) => (- <div className="flex min-h-[20px] grow flex-col items-start gap-4">{children}</div>+ <div className="flex min-h-[1.25rem] grow flex-col items-start gap-4">{children}</div>);export default Container;diff --git a/client/src/components/Messages/Content/Mermaid/Export.tsx b/client/src/components/Messages/Content/Mermaid/Export.tsxindex 9c8c1d6056..427c5b1bef 100644--- a/client/src/components/Messages/Content/Mermaid/Export.tsx+++ b/client/src/components/Messages/Content/Mermaid/Export.tsx@@ -229,7 +229,8 @@ const MermaidExport = memo(function MermaidExport({setIsOpen={setIsOpen}items={dropdownItems}portalElement={portalElement}- className="absolute top-0 right-0 mt-2 min-w-52 motion-reduce:!transition-none"+ className="absolute top-0 right-0 mt-2 motion-reduce:!transition-none"+ minWidth="13rem"trigger={<TooltipAnchorportalElement={portalElement}diff --git a/client/src/components/Messages/Content/Mermaid/Mermaid.tsx b/client/src/components/Messages/Content/Mermaid/Mermaid.tsxindex 3e98d5e8fd..7abad6c398 100644--- a/client/src/components/Messages/Content/Mermaid/Mermaid.tsx+++ b/client/src/components/Messages/Content/Mermaid/Mermaid.tsx@@ -326,8 +326,8 @@ export const MermaidRenderer = memo(function MermaidRenderer({<MermaidHeaderclassName={cn(showCode- ? 'relative z-20 border-b border-border-light bg-surface-secondary'- : 'absolute left-0 right-0 top-0 z-20',+ ? 'border-border-light bg-surface-secondary relative z-20 border-b'+ : 'absolute top-0 right-0 left-0 z-20',showControls ? 'opacity-100' : 'pointer-events-none opacity-0',)}codeContent={children}@@ -343,8 +343,8 @@ export const MermaidRenderer = memo(function MermaidRenderer({/>)}{showCode && (- <div className="min-h-[150px] bg-surface-primary-alt p-4">- <pre className="overflow-auto whitespace-pre-wrap font-mono text-xs text-text-secondary">+ <div className="bg-surface-primary-alt min-h-[9.375rem] p-4">+ <pre className="text-text-secondary overflow-auto font-mono text-xs whitespace-pre-wrap">{children}</pre></div>@@ -362,7 +362,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({data-testid={fillContainer ? 'mermaid-artifact-canvas' : undefined}onMouseDown={handleMouseDown}>- <div className="absolute left-2 top-2 z-10 flex items-center gap-1 rounded border border-border-light bg-surface-secondary px-2 py-1 text-xs text-text-secondary">+ <div className="border-border-light bg-surface-secondary text-text-secondary absolute top-2 left-2 z-10 flex items-center gap-1 rounded border px-2 py-1 text-xs"><Spinner className="h-3 w-3" /></div><div@@ -375,7 +375,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({<imgsrc={blobUrl}alt={localize('com_ui_mermaid_diagram')}- className="select-none opacity-70"+ className="opacity-70 select-none"style={diagramStyle}draggable={false}/>@@ -388,7 +388,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({onZoomOut={handleZoomOut}onReset={handleResetZoom}className={cn(- 'absolute bottom-2 right-2 z-10 transition-opacity duration-200',+ 'absolute right-2 bottom-2 z-10 transition-opacity duration-200',showControls ? 'opacity-100' : 'pointer-events-none opacity-0',)}/>@@ -402,7 +402,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({return (<divclassName={cn(- 'flex min-h-[200px] w-full items-center justify-center rounded-lg border border-border-light bg-surface-primary-alt text-text-secondary',+ 'border-border-light bg-surface-primary-alt text-text-secondary flex min-h-[12.5rem] w-full items-center justify-center rounded-lg border',fillContainer && 'h-full rounded-xl',)}role="status"@@ -416,17 +416,17 @@ export const MermaidRenderer = memo(function MermaidRenderer({return (<divclassName={cn(- 'w-full overflow-hidden rounded-lg border border-border-light',+ 'border-border-light w-full overflow-hidden rounded-lg border',fillContainer && 'h-full rounded-xl',)}>- <div className="flex items-center gap-2 border-b border-border-light bg-surface-secondary px-4 py-2 font-sans text-xs text-text-secondary">+ <div className="border-border-light bg-surface-secondary text-text-secondary flex items-center gap-2 border-b px-4 py-2 font-sans text-xs"><Spinner className="h-3 w-3" /><span className="font-medium">{localize('com_ui_mermaid')}</span></div><preref={streamingCodeRef}- className="max-h-[350px] min-h-[150px] overflow-auto whitespace-pre-wrap bg-surface-primary-alt p-4 font-mono text-xs text-text-secondary"+ className="bg-surface-primary-alt text-text-secondary max-h-[21.875rem] min-h-[9.375rem] overflow-auto p-4 font-mono text-xs whitespace-pre-wrap">{children}</pre>@@ -436,7 +436,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({if (error) {return (- <div className="w-full overflow-hidden rounded-lg border border-border-light">+ <div className="border-border-light w-full overflow-hidden rounded-lg border">{showHeader && (<MermaidHeadercodeContent={children}@@ -445,28 +445,28 @@ export const MermaidRenderer = memo(function MermaidRenderer({/>)}{showCode ? (- <div className="border-t border-border-light bg-surface-primary-alt p-4">- <pre className="overflow-auto whitespace-pre-wrap text-xs text-text-secondary">+ <div className="border-border-light bg-surface-primary-alt border-t p-4">+ <pre className="text-text-secondary overflow-auto text-xs whitespace-pre-wrap">{children}</pre></div>) : (- <div className="border-t border-border-light bg-surface-tertiary p-4">+ <div className="border-border-light bg-surface-tertiary border-t p-4"><div className="mb-2 flex items-center justify-between">- <span className="font-semibold text-text-destructive">+ <span className="text-text-destructive font-semibold">{localize('com_ui_mermaid_failed')}</span><Buttonvariant="ghost"size="sm"onClick={handleRetry}- className="h-auto gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-hover"+ className="text-text-secondary hover:bg-surface-hover h-auto gap-1 rounded px-2 py-1 text-xs"><RefreshCw className="h-3 w-3" aria-hidden="true" />{localize('com_ui_retry')}</Button></div>- <pre className="overflow-auto text-xs text-text-destructive">{error.message}</pre>+ <pre className="text-text-destructive overflow-auto text-xs">{error.message}</pre></div>)}</div>@@ -493,7 +493,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({)}<divclassName={cn(- 'relative w-full overflow-hidden rounded-lg border border-border-light transition-all duration-200',+ 'border-border-light relative w-full overflow-hidden rounded-lg border transition-all duration-200',fillContainer && 'h-full rounded-xl',)}{...hoverHandlers}@@ -501,7 +501,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({>{showHeader && (<MermaidHeader- className="border-b border-border-light bg-surface-secondary"+ className="border-border-light bg-surface-secondary border-b"actionsClassName="transition-opacity duration-200"codeContent={children}showCode={showCode}@@ -517,7 +517,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({)}{showCode && (<div className="bg-surface-primary-alt p-4">- <pre className="overflow-auto whitespace-pre-wrap text-xs text-text-secondary">+ <pre className="text-text-secondary overflow-auto text-xs whitespace-pre-wrap">{children}</pre></div>@@ -558,7 +558,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({onZoomOut={handleZoomOut}onReset={handleResetZoom}className={cn(- 'absolute bottom-2 right-2 z-10 transition-opacity duration-200',+ 'absolute right-2 bottom-2 z-10 transition-opacity duration-200',showControls ? 'opacity-100' : 'pointer-events-none opacity-0',)}/>diff --git a/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx b/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsxindex 9e86b536b7..c711557ccb 100644--- a/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx+++ b/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx@@ -84,9 +84,9 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(<OGDialog open={open} onOpenChange={onOpenChange} triggerRef={triggerRef}><OGDialogContentshowCloseButton={false}- className="border-border-light bg-surface-dialog h-[85vh] max-h-[85vh] w-[90vw] max-w-[90vw] gap-0 overflow-hidden p-0"+ className="border-border-light bg-surface-dialog flex h-[85vh] max-h-[85vh] w-[90vw] max-w-[90vw] flex-col gap-0 overflow-hidden p-0">- <OGDialogTitle className="border-border-light bg-surface-secondary text-text-secondary flex h-10 items-center justify-between border-b px-4 font-sans text-xs">+ <OGDialogTitle className="border-border-light bg-surface-secondary text-text-secondary flex h-10 shrink-0 items-center justify-between border-b px-4 font-sans text-xs"><span>{localize('com_ui_mermaid')}</span><div className="flex gap-1 sm:gap-2"><MermaidExport@@ -116,7 +116,7 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:px-1 sm:py-0"onClick={handleCopy}>- <MorphIcon icon={isCopied ? Check : Copy} size={18} />+ <MorphIcon icon={isCopied ? Check : Copy} size="1.125rem" /><span className="hidden sm:inline">{localize('com_ui_copy_code')}</span></Button><OGDialogClose@@ -129,18 +129,19 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(</div></OGDialogTitle>{showCode && (- <div className="border-border-light bg-surface-secondary border-b p-4">- <pre className="text-text-secondary max-h-[150px] overflow-auto text-xs whitespace-pre-wrap">+ <div className="border-border-light bg-surface-secondary shrink-0 border-b p-4">+ {/* Capped against the viewport as well as in rem, so a scaled-up code+ block cannot claim the height the diagram below it needs. */}+ <pre className="text-text-secondary max-h-[min(9.375rem,25vh)] overflow-auto text-xs whitespace-pre-wrap">{codeContent}</pre></div>)}<divclassName={cn(- 'bg-surface-primary-alt relative flex-1 overflow-hidden p-4',+ 'bg-surface-primary-alt relative min-h-0 flex-1 overflow-hidden p-4',isPanning ? 'cursor-grabbing' : 'cursor-grab',)}- style={{ height: showCode ? 'calc(85vh - 200px)' : 'calc(85vh - 50px)' }}onWheel={handleWheel}onMouseDown={handleMouseDown}>diff --git a/client/src/components/Messages/Content/Mermaid/useSvgProcessing.ts b/client/src/components/Messages/Content/Mermaid/useSvgProcessing.tsindex 60eed3b281..b77071062f 100644--- a/client/src/components/Messages/Content/Mermaid/useSvgProcessing.ts+++ b/client/src/components/Messages/Content/Mermaid/useSvgProcessing.ts@@ -1,9 +1,12 @@import { useEffect, useMemo, useState, useRef } from 'react';+import { useRemScale } from '@librechat/client';import { processMermaidSvg } from '~/utils/diagram/export';import { useDebouncedMermaid } from '~/hooks';+/** Canvas bounds and the p-4 allowance, in baseline pixels. */const MIN_CONTAINER_HEIGHT = 200;const MAX_CONTAINER_HEIGHT = 500;+const CONTAINER_PADDING = 32;interface UseSvgProcessingOptions {content: string;@@ -25,6 +28,9 @@ export default function useSvgProcessing({null,);const [containerWidth, setContainerWidth] = useState(700);+ /** containerWidth is measured in physical pixels and the surrounding preview is sized+ * in rem, so the bounds this height is clamped to have to be read into the same units. */+ const remScale = useRemScale();const lastValidSvgRef = useRef<string | null>(null);const lastProcessedSvgRef = useRef<string | null>(null);@@ -91,20 +97,21 @@ export default function useSvgProcessing({}, [blobUrl]);const { initialScale, calculatedHeight } = useMemo(() => {+ const maxHeight = MAX_CONTAINER_HEIGHT * remScale;if (!svgDimensions) {- return { initialScale: 1, calculatedHeight: MAX_CONTAINER_HEIGHT };+ return { initialScale: 1, calculatedHeight: maxHeight };}- const padding = 32;+ const padding = CONTAINER_PADDING * remScale;const availableWidth = containerWidth - padding;const scaleX = availableWidth / svgDimensions.width;- const scaleY = MAX_CONTAINER_HEIGHT / svgDimensions.height;+ const scaleY = maxHeight / svgDimensions.height;const scale = Math.min(scaleX, scaleY, 1);const height = Math.max(- MIN_CONTAINER_HEIGHT,- Math.min(MAX_CONTAINER_HEIGHT, svgDimensions.height * scale + padding),+ MIN_CONTAINER_HEIGHT * remScale,+ Math.min(maxHeight, svgDimensions.height * scale + padding),);return { initialScale: scale, calculatedHeight: height };- }, [svgDimensions, containerWidth]);+ }, [svgDimensions, containerWidth, remScale]);return {blobUrl,diff --git a/client/src/components/Messages/Content/RunCode.tsx b/client/src/components/Messages/Content/RunCode.tsxindex 0954b27590..acccef7c53 100644--- a/client/src/components/Messages/Content/RunCode.tsx+++ b/client/src/components/Messages/Content/RunCode.tsx@@ -116,10 +116,13 @@ const RunCode: React.FC<CodeBarProps & { iconOnly?: boolean }> = React.memo(: 'ml-auto gap-2 rounded-lg p-1.5 md:rounded-md md:px-2 md:py-1',)}>- <span className="relative flex size-[18px] items-center justify-center" aria-hidden="true">+ <span+ className="relative flex size-[1.125rem] items-center justify-center"+ aria-hidden="true"+ ><MorphIconicon={stateIcon}- size={18}+ size="1.125rem"className={cn('absolute transition-opacity duration-300',isLoading ? 'opacity-0' : 'opacity-100',@@ -131,7 +134,7 @@ const RunCode: React.FC<CodeBarProps & { iconOnly?: boolean }> = React.memo(isLoading ? 'opacity-100' : 'opacity-0',)}>- {isLoading && <Spinner size={18} />}+ {isLoading && <Spinner className="m-auto size-[1.125rem]" />}</span></span>{!iconOnly && (diff --git a/client/src/components/Messages/Content/__tests__/CopyButton.test.tsx b/client/src/components/Messages/Content/__tests__/CopyButton.test.tsxindex 1cc39fa54f..a7d9499540 100644--- a/client/src/components/Messages/Content/__tests__/CopyButton.test.tsx+++ b/client/src/components/Messages/Content/__tests__/CopyButton.test.tsx@@ -20,7 +20,6 @@ describe('CopyButton', () => {render(<CopyButton isCopied={false} onClick={jest.fn()} />);expect(screen.getByRole('button', { name: 'com_ui_copy' })).toBeInTheDocument();expect(screen.getByTestId('morph-icon')).toHaveAttribute('data-icon', 'copy');- expect(screen.getByTestId('morph-icon')).toHaveAttribute('data-size', '18');});it('renders the check icon when copied', () => {diff --git a/client/src/components/Nav/AccountSettings.tsx b/client/src/components/Nav/AccountSettings.tsxindex f350491c9f..8852cbd279 100644--- a/client/src/components/Nav/AccountSettings.tsx+++ b/client/src/components/Nav/AccountSettings.tsx@@ -18,9 +18,9 @@ import { ArchivedChatsModal } from '~/components/Nav/SettingsTabs/General/Archivimport { filesDialogTriggerAtom, showFilesDialogAtom } from '~/store/filesDialog';import { useGetStartupConfig, useGetUserBalance } from '~/data-provider';import { useAuthContext } from '~/hooks/AuthContext';+import { settingsOpenAtom } from './Settings';import { openInNewTab } from '~/utils';import { useLocalize } from '~/hooks';-import Settings from './Settings';import store from '~/store';function HelpSubmenu({@@ -55,7 +55,7 @@ function HelpSubmenu({<Menu.Menuportalgutter={12}- className="account-settings-popover popover-ui popover-from-left z-[126] w-[244px] rounded-lg"+ className="account-settings-popover popover-ui popover-from-left z-[126] w-[min(15.25rem,90vw)] rounded-lg">{hasHelpFaq && (<Menu.MenuItem@@ -101,7 +101,7 @@ function AccountSettings({ collapsed = false }: { collapsed?: boolean }) {const balanceQuery = useGetUserBalance({enabled: !!isAuthenticated && startupConfig?.balance?.enabled,});- const [showSettings, setShowSettings] = useState(false);+ const setShowSettings = useSetAtom(settingsOpenAtom);const setShowFiles = useSetAtom(showFilesDialogAtom);const setFilesDialogTrigger = useSetAtom(filesDialogTriggerAtom);const setShowShortcutsDialog = useSetRecoilState(store.showShortcutsDialog);@@ -136,7 +136,7 @@ function AccountSettings({ collapsed = false }: { collapsed?: boolean }) {</Menu.MenuButton><Menu.Menuportal- className="account-settings-popover popover-ui z-[125] w-[305px] rounded-lg md:w-[244px]"+ className="account-settings-popover popover-ui z-[125] w-[min(19.0625rem,90vw)] rounded-lg md:w-[min(15.25rem,90vw)]"style={{transformOrigin: collapsed ? 'left bottom' : 'bottom',translate: collapsed ? '4px 0' : '0 -4px',@@ -201,7 +201,6 @@ function AccountSettings({ collapsed = false }: { collapsed?: boolean }) {triggerRef={accountSettingsButtonRef}/>)}- {showSettings && <Settings open={showSettings} onOpenChange={setShowSettings} />}</Menu.MenuProvider>);}diff --git a/client/src/components/Nav/ExportConversation/ExportModal.tsx b/client/src/components/Nav/ExportConversation/ExportModal.tsxindex f74d25c14f..3ba36a11f1 100644--- a/client/src/components/Nav/ExportConversation/ExportModal.tsx+++ b/client/src/components/Nav/ExportConversation/ExportModal.tsx@@ -119,7 +119,7 @@ export default function ExportModal({<Label htmlFor="includeOptions" className="text-left text-sm font-medium">{localize('com_nav_export_include_endpoint_options')}</Label>- <div className="flex h-[40px] w-full items-center space-x-3">+ <div className="flex h-[2.5rem] w-full items-center space-x-3"><Checkboxid="includeOptions"disabled={!exportOptionsSupport}@@ -130,7 +130,7 @@ export default function ExportModal({<Labelid="includeOptions-label"htmlFor="includeOptions"- className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"+ className="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70">{exportOptionsSupport? localize('com_nav_export_include_endpoint_options')@@ -143,7 +143,7 @@ export default function ExportModal({<Label htmlFor="exportBranches" className="text-left text-sm font-medium">{localize('com_nav_export_all_message_branches')}</Label>- <div className="flex h-[40px] w-full items-center space-x-3">+ <div className="flex h-[2.5rem] w-full items-center space-x-3"><Checkboxid="exportBranches"disabled={!exportBranchesSupport}@@ -154,7 +154,7 @@ export default function ExportModal({<Labelid="exportBranches-label"htmlFor="exportBranches"- className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"+ className="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70">{exportBranchesSupport? localize('com_nav_export_all_message_branches')@@ -167,7 +167,7 @@ export default function ExportModal({<Label htmlFor="recursive" className="text-left text-sm font-medium">{localize('com_nav_export_recursive_or_sequential')}</Label>- <div className="flex h-[40px] w-full items-center space-x-3">+ <div className="flex h-[2.5rem] w-full items-center space-x-3"><Checkboxid="recursive"checked={recursive}@@ -177,7 +177,7 @@ export default function ExportModal({<Labelid="recursive-label"htmlFor="recursive"- className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"+ className="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70">{localize('com_nav_export_recursive')}</Label>diff --git a/client/src/components/Nav/KeyboardShortcutsDialog.tsx b/client/src/components/Nav/KeyboardShortcutsDialog.tsxindex eeb2260bed..e841107363 100644--- a/client/src/components/Nav/KeyboardShortcutsDialog.tsx+++ b/client/src/components/Nav/KeyboardShortcutsDialog.tsx@@ -189,7 +189,7 @@ function ShortcutRow({onClick={() => onStartEdit(info.id)}aria-label={editAriaLabel}data-testid={`edit-shortcut-${info.id}`}- className="border-border-medium text-text-secondary hover:border-border-heavy hover:bg-surface-tertiary hover:text-text-primary focus-visible:ring-text-primary dark:hover:bg-surface-secondary-alt inline-flex h-[22px] items-center gap-1 rounded-md border border-dashed bg-transparent px-2 text-[11px] font-medium transition-colors focus-visible:ring-2 focus-visible:outline-hidden"+ className="border-border-medium text-text-secondary hover:border-border-heavy hover:bg-surface-tertiary hover:text-text-primary focus-visible:ring-text-primary dark:hover:bg-surface-secondary-alt inline-flex h-[1.375rem] items-center gap-1 rounded-md border border-dashed bg-transparent px-2 text-[11px] font-medium transition-colors focus-visible:ring-2 focus-visible:outline-hidden"><Plus className="h-3 w-3" aria-hidden="true" />{localize('com_shortcut_set')}diff --git a/client/src/components/Nav/NavToggle.tsx b/client/src/components/Nav/NavToggle.tsxindex 5b1abd5c0e..0f0fa8ca28 100644--- a/client/src/components/Nav/NavToggle.tsx+++ b/client/src/components/Nav/NavToggle.tsx@@ -56,7 +56,7 @@ export default function NavToggle({className,'-translate-y-1/2 transition-transform',navVisible ? 'rotate-0' : 'rotate-180',- navVisible && translateX ? 'translate-x-[260px]' : 'translate-x-0',+ navVisible && translateX ? 'translate-x-[16.25rem]' : 'translate-x-0',)}onMouseEnter={() => setIsHovering(true)}onMouseLeave={() => setIsHovering(false)}@@ -76,13 +76,13 @@ export default function NavToggle({><span className="" data-state="closed"><div- className="flex h-[72px] w-8 items-center justify-center"+ className="flex h-[4.5rem] w-8 items-center justify-center"style={{ ...transition, opacity: isHovering ? 1 : 0.25 }}><div className="flex h-6 w-6 flex-col items-center">{/* Top bar */}<div- className="h-3 w-1 rounded-full bg-surface-inverted"+ className="bg-surface-inverted h-3 w-1 rounded-full"style={{...transition,transform: `translateY(0.15rem) rotate(${topBarRotation}) translateZ(0px)`,@@ -90,7 +90,7 @@ export default function NavToggle({/>{/* Bottom bar */}<div- className="h-3 w-1 rounded-full bg-surface-inverted"+ className="bg-surface-inverted h-3 w-1 rounded-full"style={{...transition,transform: `translateY(-0.15rem) rotate(${bottomBarRotation}) translateZ(0px)`,diff --git a/client/src/components/Nav/Settings.tsx b/client/src/components/Nav/Settings.tsxindex bde59fdb6d..9e145ed8cf 100644--- a/client/src/components/Nav/Settings.tsx+++ b/client/src/components/Nav/Settings.tsx@@ -1,6 +1,19 @@-import type { TDialogProps } from '~/common';-import { SettingsDialog } from './Settings/index';+import { lazy, Suspense, useEffect } from 'react';+import { atom, useAtom } from 'jotai';-export default function Settings(props: TDialogProps) {- return <SettingsDialog {...props} />;+export const settingsOpenAtom = atom(false);++/** Keep settings lazy without tying its lifetime to a responsive account-menu trigger. */+const SettingsDialog = lazy(() => import('./Settings/Dialog'));++export default function Settings() {+ const [open, setOpen] = useAtom(settingsOpenAtom);++ useEffect(() => () => setOpen(false), [setOpen]);++ return open ? (+ <Suspense fallback={null}>+ <SettingsDialog open={open} onOpenChange={setOpen} />+ </Suspense>+ ) : null;}diff --git a/client/src/components/Nav/Settings/Dialog.tsx b/client/src/components/Nav/Settings/Dialog.tsxindex 6c12c1b545..5413238f23 100644--- a/client/src/components/Nav/Settings/Dialog.tsx+++ b/client/src/components/Nav/Settings/Dialog.tsx@@ -2,8 +2,14 @@ import { useState } from 'react';import * as Tabs from '@radix-ui/react-tabs';import { X, ChevronLeft } from 'lucide-react';import { SettingsTabValues } from 'librechat-data-provider';-import { Button, DialogLayer, useMediaQuery, DIALOG_SCRIM_CLASS } from '@librechat/client';import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react';+import {+ Button,+ DialogLayer,+ useMediaQuery,+ useRemScale,+ DIALOG_SCRIM_CLASS,+} from '@librechat/client';import type { TDialogProps } from '~/common';import type { SettingsTab } from './types';import { useSettingsContext } from './context';@@ -16,10 +22,14 @@ import { cn } from '~/utils';export default function SettingsDialog({ open, onOpenChange }: TDialogProps) {const localize = useLocalize();const ctx = useSettingsContext();- const isSmallScreen = useMediaQuery('(max-width: 767px)');+ /** The panel is laid out in rem, so the two-column switch has to compare the+ * viewport in the same units: a fixed 768px breakpoint picks the side-by-side+ * layout at scales where the scaled sidebar leaves the content pane too narrow. */+ const remScale = useRemScale();+ const isSmallScreen = useMediaQuery(`(max-width: ${767 * remScale}px)`);const [activeTab, setActiveTab] = useState<SettingsTab>(SettingsTabValues.GENERAL);const [query, setQuery] = useState('');- const [mobileDetail, setMobileDetail] = useState(false);+ const [mobileDetail, setMobileDetail] = useState(!isSmallScreen);const searching = query.trim().length > 0;const inDetail = isSmallScreen && mobileDetail && !searching;@@ -34,9 +44,7 @@ export default function SettingsDialog({ open, onOpenChange }: TDialogProps) {const selectTab = (tab: SettingsTab) => {setActiveTab(tab);- if (isSmallScreen) {- setMobileDetail(true);- }+ setMobileDetail(true);};return (@@ -67,7 +75,7 @@ export default function SettingsDialog({ open, onOpenChange }: TDialogProps) {* and needs the contrast edge declared here. `shadow-2xl` is a* black shadow with nothing to separate against on a black canvas. */'bg-surface-dialog high-contrast:border high-contrast:border-solid high-contrast:border-border-medium high-contrast:shadow-none rounded-theme-surface flex max-h-[85vh] w-full flex-col overflow-hidden shadow-2xl',- 'md:h-[85vh] md:w-[900px]',+ !isSmallScreen && 'h-[85vh] w-[56.25rem] max-w-[calc(100vw-4rem)]',)}><DialogTitle@@ -108,7 +116,10 @@ export default function SettingsDialog({ open, onOpenChange }: TDialogProps) {value={effectiveTab}onValueChange={(v) => setActiveTab(v as SettingsTab)}orientation="vertical"- className="flex flex-1 flex-col gap-4 overflow-hidden p-5 md:flex-row md:gap-6"+ className={cn(+ 'flex min-h-0 flex-1 flex-col gap-4 overflow-hidden p-5',+ !isSmallScreen && 'flex-row gap-6',+ )}>{showSidebar && (<Sidebar@@ -118,10 +129,11 @@ export default function SettingsDialog({ open, onOpenChange }: TDialogProps) {onSelectTab={selectTab}showChevron={isSmallScreen}hideTabs={hideTabs}+ stacked={isSmallScreen}/>)}{showContent && (- <div className="flex-1 overflow-y-auto md:pr-1">+ <div className={cn('flex-1 overflow-y-auto', !isSmallScreen && 'pr-1')}>{searching ? (<Content activeTab={effectiveTab} query={query} ctx={ctx} />) : (diff --git a/client/src/components/Nav/Settings/Sidebar.tsx b/client/src/components/Nav/Settings/Sidebar.tsxindex ce15b71501..14b6f2132a 100644--- a/client/src/components/Nav/Settings/Sidebar.tsx+++ b/client/src/components/Nav/Settings/Sidebar.tsx@@ -12,6 +12,8 @@ interface SidebarProps {onSelectTab: (tab: SettingsTab) => void;showChevron?: boolean;hideTabs?: boolean;+ /** Stacked above the content pane rather than beside it. */+ stacked?: boolean;}export default function Sidebar({@@ -21,13 +23,20 @@ export default function Sidebar({onSelectTab,showChevron = false,hideTabs = false,+ stacked = false,}: SidebarProps) {const localize = useLocalize();const tabs = TABS.filter((t) => !t.show || t.show(ctx));return (- <div className="flex w-full flex-col gap-3 md:w-[230px]">- <div className="relative">+ <div+ className={cn(+ 'flex min-h-0 w-full flex-col gap-3 overflow-hidden',+ !stacked && 'w-[14.375rem]',+ stacked && !hideTabs && 'flex-1',+ )}+ >+ <div className="relative shrink-0"><SearchclassName="text-text-tertiary pointer-events-none absolute top-1/2 left-2 h-4 w-4 -translate-y-1/2"aria-hidden="true"@@ -61,7 +70,7 @@ export default function Sidebar({{!hideTabs && (<Tabs.Listaria-label={localize('com_nav_settings')}- className="flex flex-col gap-1 overflow-visible"+ className="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto">{tabs.map((tab) => (<Tabs.Trigger@@ -69,13 +78,13 @@ export default function Sidebar({value={tab.id}onClick={() => onSelectTab(tab.id)}className={cn(- 'text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-text-primary rounded-theme-control flex items-center justify-between gap-2 px-3 py-2.5 text-sm transition-colors focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset md:py-2',+ 'text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-text-primary rounded-theme-control flex shrink-0 items-center justify-between gap-2 px-3 py-2.5 text-sm transition-colors focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset md:py-2','data-[state=active]:bg-surface-tertiary data-[state=active]:text-text-primary',)}>- <span className="flex items-center gap-2">+ <span className="flex min-w-0 items-center gap-2 [&>svg]:shrink-0">{tab.icon}- <span className="whitespace-nowrap">{localize(tab.labelKey)}</span>+ <span className="min-w-0 text-left break-words">{localize(tab.labelKey)}</span></span>{showChevron && (<ChevronRight className="text-text-tertiary h-4 w-4 shrink-0" aria-hidden="true" />diff --git a/client/src/components/Nav/Settings/StatefulWorkspaceDefault.tsx b/client/src/components/Nav/Settings/StatefulWorkspaceDefault.tsxindex 4057336614..9de7c0d330 100644--- a/client/src/components/Nav/Settings/StatefulWorkspaceDefault.tsx+++ b/client/src/components/Nav/Settings/StatefulWorkspaceDefault.tsx@@ -65,14 +65,14 @@ export default function StatefulWorkspaceDefault() {<label id="default-stateful-workspace-label" htmlFor="default-stateful-workspace">{localize('com_ui_default_stateful_workspace')}</label>- <p id="default-stateful-workspace-description" className="mt-1 text-xs text-text-secondary">+ <p id="default-stateful-workspace-description" className="text-text-secondary mt-1 text-xs">{localize('com_ui_default_stateful_workspace_description')}</p></div><Select value={environment} onValueChange={handleChange} disabled={mutation.isLoading}><SelectTriggerid="default-stateful-workspace"- className="w-full shrink-0 sm:w-[220px]"+ className="w-full shrink-0 sm:w-[13.75rem]"aria-labelledby="default-stateful-workspace-label"aria-describedby="default-stateful-workspace-description"data-testid="default-stateful-workspace"diff --git a/client/src/components/Nav/Settings/registry.tsx b/client/src/components/Nav/Settings/registry.tsxindex fe27c36578..8197013b3a 100644--- a/client/src/components/Nav/Settings/registry.tsx+++ b/client/src/components/Nav/Settings/registry.tsx@@ -33,6 +33,7 @@ import { ArchiveAllChats } from '../SettingsTabs/Data/ArchiveAllChats';import { toggleControl, ThemeSetting, LangSetting } from './controls';import BackupCodesItem from '../SettingsTabs/Account/BackupCodesItem';import { EngineSTTSetting, EngineTTSSetting } from './SpeechControls';+import UiScaleSelector from '../SettingsTabs/General/UiScaleSelector';import FontSizeSelector from '../SettingsTabs/Chat/FontSizeSelector';import ChatTitleInTab from '../SettingsTabs/General/ChatTitleInTab';import AdvancedPrompts from '../SettingsTabs/Chat/AdvancedPrompts';@@ -99,6 +100,14 @@ export const registry: SettingEntry[] = [keywords: ['text', 'zoom'],Component: FontSizeSelector,},+ {+ id: 'uiScale',+ tab: GENERAL,+ section: 'appearance',+ labelKey: 'com_nav_ui_scale',+ keywords: ['zoom', 'scale', 'size', 'interface', 'display'],+ Component: UiScaleSelector,+ },{id: 'chatDirection',tab: GENERAL,diff --git a/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx b/client/src/components/Nav/SettingsTabs/Account/Avatar.tsxindex f9dc2b7362..30b7658a1e 100644--- a/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx+++ b/client/src/components/Nav/SettingsTabs/Account/Avatar.tsx@@ -187,11 +187,11 @@ function Avatar() {}}}>- <div className="flex items-center justify-between">+ <div className="flex flex-wrap items-center justify-between gap-2"><span>{localize('com_nav_profile_picture')}</span><OGDialogTrigger asChild><Button variant="outline">- <FileImage className="mr-2 flex w-[22px] items-center" aria-hidden="true" />+ <FileImage className="mr-2 flex w-[1.375rem] items-center" aria-hidden="true" /><span>{localize('com_nav_change_picture')}</span></Button></OGDialogTrigger>@@ -203,12 +203,12 @@ function Avatar() {{image != null ? localize('com_ui_preview') : localize('com_ui_upload_image')}</OGDialogTitle></OGDialogHeader>- <div className="flex flex-col items-center justify-center p-2">+ <div className="flex min-w-0 flex-col items-center justify-center p-2">{image != null ? (<><divclassName={cn(- 'ring-border-light relative overflow-hidden rounded-full ring-4 transition-all',+ 'ring-border-light relative w-full max-w-[17.5rem] overflow-hidden rounded-full ring-4 transition-all',isDragging && 'ring-ring-primary cursor-move',)}onMouseDown={() => setIsDragging(true)}@@ -227,7 +227,11 @@ function Avatar() {rotate={rotation}position={position}onPositionChange={handlePositionChange}- className="cursor-move"+ /* The width/height props stay at 280 so the exported avatar keeps its+ resolution; only the rendered canvas yields to the dialog, which is+ narrower than 17.5rem once the scale or the reader's font grows. The+ editor writes its size inline, so the overrides are important. */+ className="aspect-square h-auto! w-full! cursor-move"/>{!isDragging && (<div className="pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity hover:opacity-100">@@ -283,7 +287,7 @@ function Avatar() {</div></div>- <div className="flex items-center justify-center space-x-3">+ <div className="flex flex-wrap items-center justify-center gap-3"><Buttontype="button"variant="outline"@@ -313,7 +317,7 @@ function Avatar() {</div>{/* Action Buttons */}- <div className="mt-6 flex w-full space-x-3">+ <div className="mt-6 flex w-full flex-wrap gap-3"><Buttontype="button"variant="outline"@@ -326,7 +330,7 @@ function Avatar() {<Buttonvariant="submit"type="button"- className={cn('w-full', isUploading ? 'cursor-not-allowed opacity-90' : '')}+ className={cn('flex-1', isUploading ? 'cursor-not-allowed opacity-90' : '')}onClick={handleUpload}disabled={isUploading}>diff --git a/client/src/components/Nav/SettingsTabs/Account/TwoFactorPhases/QRPhase.tsx b/client/src/components/Nav/SettingsTabs/Account/TwoFactorPhases/QRPhase.tsxindex 6a9b9d47af..fda39398bf 100644--- a/client/src/components/Nav/SettingsTabs/Account/TwoFactorPhases/QRPhase.tsx+++ b/client/src/components/Nav/SettingsTabs/Account/TwoFactorPhases/QRPhase.tsx@@ -28,9 +28,14 @@ export const QRPhase: React.FC<QRPhaseProps> = ({ secret, otpauthUrl, onNext })<motion.divinitial={{ scale: 0.8, opacity: 0 }}animate={{ scale: 1, opacity: 1 }}- className="bg-surface-fixed rounded-2xl p-4 shadow-lg"+ className="bg-surface-fixed max-w-full min-w-0 rounded-2xl p-4 shadow-lg">- <QRCodeSVG value={otpauthUrl} size={240} title={localize('com_ui_2fa_scan_qr')} />+ <QRCodeSVG+ value={otpauthUrl}+ size={240}+ className="h-auto w-60 max-w-full"+ title={localize('com_ui_2fa_scan_qr')}+ /></motion.div><div className="w-full space-y-3"><p className="text-text-primary text-sm font-medium">{localize('com_ui_secret_key')}</p>diff --git a/client/src/components/Nav/SettingsTabs/ApiKeys/DeleteKeyDialog.tsx b/client/src/components/Nav/SettingsTabs/ApiKeys/DeleteKeyDialog.tsxindex b07590b7ef..04fbfe7b7d 100644--- a/client/src/components/Nav/SettingsTabs/ApiKeys/DeleteKeyDialog.tsx+++ b/client/src/components/Nav/SettingsTabs/ApiKeys/DeleteKeyDialog.tsx@@ -41,16 +41,16 @@ export default function DeleteKeyDialog({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_api_key')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<div className="space-y-3 text-left">- <p className="text-sm text-text-primary">+ <p className="text-text-primary text-sm">{localize('com_ui_api_key_delete_confirm', { 0: name })}</p>- <div className="flex items-center rounded-lg border border-border-light bg-surface-secondary px-3 py-2">- <code className="break-all font-mono text-xs text-text-secondary">{keyPrefix}…</code>+ <div className="border-border-light bg-surface-secondary flex items-center rounded-lg border px-3 py-2">+ <code className="text-text-secondary font-mono text-xs break-all">{keyPrefix}…</code></div>- <p className="text-sm text-text-secondary">+ <p className="text-text-secondary text-sm">{localize('com_ui_api_key_delete_warning')}</p></div>diff --git a/client/src/components/Nav/SettingsTabs/Chat/ChatDirection.tsx b/client/src/components/Nav/SettingsTabs/Chat/ChatDirection.tsxindex 2ae54d224f..0bffbe9f78 100644--- a/client/src/components/Nav/SettingsTabs/Chat/ChatDirection.tsx+++ b/client/src/components/Nav/SettingsTabs/Chat/ChatDirection.tsx@@ -13,7 +13,7 @@ const ChatDirection = () => {};return (- <div className="flex items-center justify-between">+ <div className="flex flex-wrap items-center justify-between gap-2"><div className="flex items-center space-x-2"><span id="chat-direction-label">{localize('com_nav_chat_direction')}</span></div>diff --git a/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx b/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsxindex 3cdbf776ce..b0b531ad5c 100644--- a/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx+++ b/client/src/components/Nav/SettingsTabs/Chat/FontSizeSelector.tsx@@ -22,14 +22,14 @@ export default function FontSizeSelector() {const labelId = 'font-size-selector-label';return (- <div className="flex w-full items-center justify-between">+ <div className="flex w-full flex-wrap items-center justify-between gap-2"><div id={labelId}>{localize('com_nav_font_size')}</div><Dropdownvalue={fontSize}options={options}onChange={handleChange}testId="font-size-selector"- sizeClasses="z-50 w-[150px]"+ sizeClasses="z-50 w-[9.375rem]"className="z-50"aria-labelledby={labelId}/>diff --git a/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx b/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsxindex 83c995a732..9c77a8aa77 100644--- a/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx+++ b/client/src/components/Nav/SettingsTabs/Chat/ForkSettings.tsx@@ -45,7 +45,7 @@ export const ForkSettings = () => {value={forkSetting}onChange={setForkSetting}options={forkOptions}- sizeClasses="z-[50] w-[200px]"+ sizeClasses="z-[50] w-[min(12.5rem,90vw)]"testId="fork-setting-dropdown"className="z-[50]"aria-labelledby="fork-change-default-label"diff --git a/client/src/components/Nav/SettingsTabs/Data/ArchiveAllChats.tsx b/client/src/components/Nav/SettingsTabs/Data/ArchiveAllChats.tsxindex 4638f5427d..f98d18e883 100644--- a/client/src/components/Nav/SettingsTabs/Data/ArchiveAllChats.tsx+++ b/client/src/components/Nav/SettingsTabs/Data/ArchiveAllChats.tsx@@ -122,7 +122,7 @@ export const ArchiveAllChats = () => {<OGDialogTemplateshowCloseButton={false}title={localize('com_nav_confirm_archive_all')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="break-words">{localize('com_nav_archive_all_confirm_message')}</Label>}diff --git a/client/src/components/Nav/SettingsTabs/Data/ClearChats.tsx b/client/src/components/Nav/SettingsTabs/Data/ClearChats.tsxindex 14994b5f9a..ed1cec0f44 100644--- a/client/src/components/Nav/SettingsTabs/Data/ClearChats.tsx+++ b/client/src/components/Nav/SettingsTabs/Data/ClearChats.tsx@@ -45,7 +45,7 @@ export const ClearChats = () => {<OGDialogTemplateshowCloseButton={false}title={localize('com_nav_confirm_clear')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="break-words">{localize('com_nav_clear_conversation_confirm_message')}diff --git a/client/src/components/Nav/SettingsTabs/Data/DeleteCache.tsx b/client/src/components/Nav/SettingsTabs/Data/DeleteCache.tsxindex 46c2a96683..ac6911517e 100644--- a/client/src/components/Nav/SettingsTabs/Data/DeleteCache.tsx+++ b/client/src/components/Nav/SettingsTabs/Data/DeleteCache.tsx@@ -58,7 +58,7 @@ export const DeleteCache = ({ disabled = false }: { disabled?: boolean }) => {<OGDialogTemplateshowCloseButton={false}title={localize('com_nav_confirm_clear')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_nav_clear_cache_confirm_message')}diff --git a/client/src/components/Nav/SettingsTabs/Data/RevokeKeys.tsx b/client/src/components/Nav/SettingsTabs/Data/RevokeKeys.tsxindex 986f682644..f3087a369b 100644--- a/client/src/components/Nav/SettingsTabs/Data/RevokeKeys.tsx+++ b/client/src/components/Nav/SettingsTabs/Data/RevokeKeys.tsx@@ -53,7 +53,7 @@ export const RevokeKeys = ({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_revoke_keys')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_ui_revoke_keys_confirm')}diff --git a/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx b/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsxindex 4b90c585ee..289f3e371c 100644--- a/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx+++ b/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx@@ -325,7 +325,7 @@ export default function SharedLinks() {<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_shared_link_heading')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<><divdiff --git a/client/src/components/Nav/SettingsTabs/General/ClockFormatSelector.tsx b/client/src/components/Nav/SettingsTabs/General/ClockFormatSelector.tsxindex 1e38c46793..1c49d7f093 100644--- a/client/src/components/Nav/SettingsTabs/General/ClockFormatSelector.tsx+++ b/client/src/components/Nav/SettingsTabs/General/ClockFormatSelector.tsx@@ -17,7 +17,7 @@ export default function ClockFormatSelector() {const labelId = 'clock-format-selector-label';return (- <div className="flex w-full items-center justify-between">+ <div className="flex w-full flex-wrap items-center justify-between gap-2"><div id={labelId}>{localize('com_nav_clock_format')}</div><Dropdownvalue={clockFormat}diff --git a/client/src/components/Nav/SettingsTabs/General/UiScaleSelector.spec.tsx b/client/src/components/Nav/SettingsTabs/General/UiScaleSelector.spec.tsxnew file mode 100644index 0000000000..e01ec65fa5--- /dev/null+++ b/client/src/components/Nav/SettingsTabs/General/UiScaleSelector.spec.tsx@@ -0,0 +1,137 @@+import 'test/matchMedia.mock';+import React from 'react';+import { render, fireEvent, act } from '@testing-library/react';+import '@testing-library/jest-dom/extend-expect';+import { Provider as JotaiProvider, createStore } from 'jotai';+import UiScaleSelector from './UiScaleSelector';++const renderSelector = () => {+ const store = createStore();+ return render(+ <JotaiProvider store={store}>+ <UiScaleSelector />+ </JotaiProvider>,+ );+};++const settleReflow = () => {+ act(() => {+ jest.advanceTimersByTime(300);+ });+};++const appliedScale = () => document.documentElement.style.getPropertyValue('--ui-scale');++describe('UiScaleSelector', () => {+ beforeEach(() => {+ jest.useFakeTimers();+ localStorage.clear();+ document.documentElement.style.removeProperty('--ui-scale');+ });++ afterEach(() => {+ jest.useRealTimers();+ });++ it('labels both steppers for assistive technology', () => {+ const { getByLabelText } = renderSelector();++ expect(getByLabelText('Decrease UI scale')).toBeInTheDocument();+ expect(getByLabelText('Increase UI scale')).toBeInTheDocument();+ });++ it('shows the new value immediately but holds the reflow until clicks stop', () => {+ const { getByTestId, getByText } = renderSelector();++ fireEvent.click(getByTestId('ui-scale-increase'));++ expect(getByText('110%')).toBeInTheDocument();+ expect(appliedScale()).toBe('');++ settleReflow();++ expect(appliedScale()).toBe('1.1');+ expect(localStorage.getItem('uiScale')).toBe('1.1');+ });++ it('keeps stepping through the stops while clicks are rapid, applying once', () => {+ const { getByTestId, getByText } = renderSelector();++ fireEvent.click(getByTestId('ui-scale-increase'));+ fireEvent.click(getByTestId('ui-scale-increase'));+ fireEvent.click(getByTestId('ui-scale-increase'));++ expect(getByText('150%')).toBeInTheDocument();+ expect(appliedScale()).toBe('');++ settleReflow();++ expect(appliedScale()).toBe('1.5');+ });++ it('steps down through the stops', () => {+ const { getByTestId, getByText } = renderSelector();++ fireEvent.click(getByTestId('ui-scale-decrease'));+ settleReflow();++ expect(getByText('90%')).toBeInTheDocument();+ expect(appliedScale()).toBe('0.9');+ });++ it('applies a pending change when the panel closes before it settles', () => {+ const { getByTestId, unmount } = renderSelector();++ fireEvent.click(getByTestId('ui-scale-increase'));+ expect(appliedScale()).toBe('');++ unmount();++ expect(appliedScale()).toBe('1.1');+ expect(localStorage.getItem('uiScale')).toBe('1.1');+ });++ it('persists a pending step when the document leaves before reflow', () => {+ const { getByTestId } = renderSelector();+ fireEvent.click(getByTestId('ui-scale-increase'));++ act(() => window.dispatchEvent(new Event('pagehide')));++ expect(localStorage.getItem('uiScale')).toBe('1.1');+ expect(appliedScale()).toBe('1.1');+ });++ it('restores a persisted scale on mount', () => {+ localStorage.setItem('uiScale', '1.25');++ const { getByText } = renderSelector();++ expect(getByText('125%')).toBeInTheDocument();+ });++ it('disables the steppers at the ends of the range', () => {+ localStorage.setItem('uiScale', '1.5');+ const { getByTestId, unmount } = renderSelector();++ expect(getByTestId('ui-scale-increase')).toBeDisabled();+ expect(getByTestId('ui-scale-decrease')).not.toBeDisabled();++ unmount();+ localStorage.setItem('uiScale', '0.5');+ const min = renderSelector();++ expect(min.getByTestId('ui-scale-decrease')).toBeDisabled();+ expect(min.getByTestId('ui-scale-increase')).not.toBeDisabled();+ });++ it('snaps to the neighbouring stop from an off-stop value', () => {+ localStorage.setItem('uiScale', '1.05');+ const { getByTestId, getByText } = renderSelector();++ expect(getByText('105%')).toBeInTheDocument();++ fireEvent.click(getByTestId('ui-scale-increase'));++ expect(getByText('110%')).toBeInTheDocument();+ });+});diff --git a/client/src/components/Nav/SettingsTabs/General/UiScaleSelector.tsx b/client/src/components/Nav/SettingsTabs/General/UiScaleSelector.tsxnew file mode 100644index 0000000000..15ed90f735--- /dev/null+++ b/client/src/components/Nav/SettingsTabs/General/UiScaleSelector.tsx@@ -0,0 +1,112 @@+import { useState, useRef, useEffect } from 'react';+import { useAtom } from 'jotai';+import { Minus, Plus } from 'lucide-react';+import { Button, clampUiScale } from '@librechat/client';+import { uiScaleAtom } from '~/store/uiScale';+import { useLocalize } from '~/hooks';++/** The stops browsers themselves step through for Ctrl -/+. */+const SCALE_STOPS = [0.5, 0.67, 0.75, 0.8, 0.9, 1, 1.1, 1.25, 1.5];+const EPSILON = 0.001;+/**+ * Rescaling the app moves this control, since it lives inside the panel it+ * resizes. Holding the reflow until clicks stop keeps the buttons under the+ * pointer while stepping, so a second click cannot miss a button that moved.+ */+const REFLOW_DELAY_MS = 260;++export default function UiScaleSelector() {+ const localize = useLocalize();+ const [uiScale, setUiScale] = useAtom(uiScaleAtom);+ const [pending, setPending] = useState<number | null>(null);+ const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);+ const pendingRef = useRef<number | null>(null);+ const applyRef = useRef(setUiScale);+ applyRef.current = setUiScale;++ useEffect(() => {+ const flushPending = () => {+ if (timerRef.current != null) {+ clearTimeout(timerRef.current);+ timerRef.current = null;+ }+ if (pendingRef.current != null) {+ const next = pendingRef.current;+ pendingRef.current = null;+ applyRef.current(next);+ }+ };+ const handlePageHide = () => {+ flushPending();+ setPending(null);+ };+ window.addEventListener('pagehide', handlePageHide);+ return () => {+ window.removeEventListener('pagehide', handlePageHide);+ flushPending();+ };+ }, []);++ const scale = clampUiScale(pending ?? uiScale);+ const percent = Math.round(scale * 100);+ const nextUp = SCALE_STOPS.find((stop) => stop > scale + EPSILON);+ const nextDown = [...SCALE_STOPS].reverse().find((stop) => stop < scale - EPSILON);+ const labelId = 'ui-scale-selector-label';++ const step = (next: number | undefined): void => {+ if (next == null) {+ return;+ }+ setPending(next);+ pendingRef.current = next;+ if (timerRef.current != null) {+ clearTimeout(timerRef.current);+ }+ timerRef.current = setTimeout(() => {+ timerRef.current = null;+ pendingRef.current = null;+ setPending(null);+ applyRef.current(next);+ }, REFLOW_DELAY_MS);+ };++ return (+ <div className="flex w-full flex-wrap items-center justify-between gap-2">+ <div id={labelId}>{localize('com_nav_ui_scale')}</div>+ <div+ className="flex max-w-full flex-wrap items-center gap-2"+ role="group"+ aria-labelledby={labelId}+ >+ <Button+ variant="outline"+ size="icon"+ className="size-9"+ onClick={() => step(nextDown)}+ disabled={nextDown == null}+ aria-label={localize('com_nav_ui_scale_decrease')}+ data-testid="ui-scale-decrease"+ >+ <Minus className="size-4" aria-hidden="true" />+ </Button>+ <span+ className="text-text-primary w-12 text-center text-sm tabular-nums"+ aria-live="polite"+ >+ {percent}%+ </span>+ <Button+ variant="outline"+ size="icon"+ className="size-9"+ onClick={() => step(nextUp)}+ disabled={nextUp == null}+ aria-label={localize('com_nav_ui_scale_increase')}+ data-testid="ui-scale-increase"+ >+ <Plus className="size-4" aria-hidden="true" />+ </Button>+ </div>+ </div>+ );+}diff --git a/client/src/components/Nav/SettingsTabs/General/WeekStartSelector.tsx b/client/src/components/Nav/SettingsTabs/General/WeekStartSelector.tsxindex 5596464eea..4cc3be97f2 100644--- a/client/src/components/Nav/SettingsTabs/General/WeekStartSelector.tsx+++ b/client/src/components/Nav/SettingsTabs/General/WeekStartSelector.tsx@@ -17,7 +17,7 @@ export default function WeekStartSelector() {const labelId = 'week-start-selector-label';return (- <div className="flex w-full items-center justify-between">+ <div className="flex w-full flex-wrap items-center justify-between gap-2"><div id={labelId}>{localize('com_nav_week_start')}</div><Dropdownvalue={weekStart}diff --git a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsxindex 5249ee7bfb..c0169e3875 100644--- a/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx+++ b/client/src/components/Nav/SettingsTabs/Integrations/LangfuseConnection.tsx@@ -3,18 +3,14 @@ import {Button,CircleHelpIcon,Dropdown,+ InfoHoverCard,Input,Label,SecretInput,Spinner,+ ESide,useToastContext,} from '@librechat/client';-import {- Root as Popover,- Portal as PopoverPortal,- Trigger as PopoverTrigger,- Content as PopoverContent,-} from '@radix-ui/react-popover';import type {TLangfuseConnectionStatus,TLangfuseConnectionTestErrorCode,@@ -398,48 +394,32 @@ export default function LangfuseConnection() {return (<div className="flex flex-col gap-4">- <Popover>- <div className="flex flex-wrap items-start justify-between gap-x-4 gap-y-2">- <div className="flex min-w-0 flex-1 flex-wrap items-center gap-2">- <div className="font-medium">{localize('com_ui_langfuse_title')}</div>- <div className="border-brand-purple/40 bg-brand-purple/10 text-brand-purple rounded-full border px-2 py-0.5 text-xs font-medium">- {localize('com_ui_beta')}- </div>- <PopoverTrigger asChild>- <button- type="button"- aria-label={localize('com_ui_more_info')}- className="text-text-tertiary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-text-primary inline-flex size-6 items-center justify-center rounded-md transition-colors focus-visible:ring-2 focus-visible:outline-hidden"- >- <CircleHelpIcon className="h-4 w-4" aria-hidden="true" />- </button>- </PopoverTrigger>- </div>- <div- data-testid="langfuse-connection-status"- className={`ml-auto flex max-w-full shrink-0 items-start justify-end gap-1.5 text-right text-xs sm:max-w-[50%] ${connectionStatusTextClass}`}- aria-live="polite"- title={connectionStatusTitle}- >- {connectionTestState === 'checking' ? (- <Spinner className="h-3 w-3" />- ) : (- <span className={`mt-1 h-2 w-2 shrink-0 rounded-full ${connectionStatusDotClass}`} />- )}- <span>{connectionStatusLabel}</span>+ <div className="flex flex-wrap items-start justify-between gap-x-4 gap-y-2">+ <div className="flex min-w-0 flex-1 flex-wrap items-center gap-2">+ <div className="font-medium">{localize('com_ui_langfuse_title')}</div>+ <div className="border-brand-purple/40 bg-brand-purple/10 text-brand-purple rounded-full border px-2 py-0.5 text-xs font-medium">+ {localize('com_ui_beta')}</div>+ <InfoHoverCard side={ESide.Top} text={localize('com_ui_langfuse_beta_info')}>+ <span className="text-text-tertiary hover:bg-surface-hover hover:text-text-primary flex size-6 items-center justify-center rounded-md transition-colors">+ <CircleHelpIcon className="h-4 w-4" aria-hidden="true" />+ </span>+ </InfoHoverCard></div>-- <PopoverPortal>- <PopoverContent- side="top"- sideOffset={6}- className="border-border-light bg-surface-secondary text-text-primary z-[999] w-80 rounded-xl border p-4 shadow-md outline-hidden"- >- <p className="text-text-secondary text-sm">{localize('com_ui_langfuse_beta_info')}</p>- </PopoverContent>- </PopoverPortal>- </Popover>+ <div+ data-testid="langfuse-connection-status"+ className={`ml-auto flex max-w-full shrink-0 items-start justify-end gap-1.5 text-right text-xs sm:max-w-[50%] ${connectionStatusTextClass}`}+ aria-live="polite"+ title={connectionStatusTitle}+ >+ {connectionTestState === 'checking' ? (+ <Spinner className="h-3 w-3" />+ ) : (+ <span className={`mt-1 h-2 w-2 shrink-0 rounded-full ${connectionStatusDotClass}`} />+ )}+ <span>{connectionStatusLabel}</span>+ </div>+ </div><div className="flex flex-col gap-1.5"><Label id="langfuse-destination-label">{localize('com_ui_langfuse_destination')}</Label>diff --git a/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx b/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsxindex 26e18a8f3b..4f8ddde969 100644--- a/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx+++ b/client/src/components/Nav/SettingsTabs/Integrations/__tests__/LangfuseConnection.spec.tsx@@ -110,7 +110,6 @@ describe('LangfuseConnection', () => {'com_ui_langfuse_status_not_configured',);expect(screen.queryByText('com_ui_langfuse_description')).not.toBeInTheDocument();- expect(screen.getByRole('button', { name: 'com_ui_more_info' })).toBeVisible();expect(screen.queryByRole('button', { name: 'com_ui_langfuse_enable' }),).not.toBeInTheDocument();@@ -140,7 +139,7 @@ describe('LangfuseConnection', () => {render(<LangfuseConnection />);expect(screen.queryByText('com_ui_langfuse_description')).not.toBeInTheDocument();- await userEvent.click(screen.getByRole('button', { name: 'com_ui_more_info' }));+ await userEvent.click(screen.getByRole('button', { name: 'com_ui_langfuse_beta_info' }));expect(await screen.findByText('com_ui_langfuse_beta_info')).toBeVisible();});diff --git a/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsxindex 2fac3e82ca..1cb1d4d7b3 100644--- a/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx+++ b/client/src/components/Nav/SettingsTabs/Speech/STT/EngineSTTDropdown.tsx@@ -33,7 +33,7 @@ const EngineSTTDropdown: React.FC<EngineSTTDropdownProps> = ({ external }) => {value={engineSTT}onChange={handleSelect}options={endpointOptions}- sizeClasses="z-50 w-[180px]"+ sizeClasses="z-50 w-[min(11.25rem,90vw)]"testId="EngineSTTDropdown"className="z-50"aria-labelledby={labelId}diff --git a/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx b/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsxindex 8a9f478b75..43dcff0189 100644--- a/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx+++ b/client/src/components/Nav/SettingsTabs/Speech/TTS/EngineTTSDropdown.tsx@@ -33,7 +33,7 @@ const EngineTTSDropdown: React.FC<EngineTTSDropdownProps> = ({ external }) => {value={engineTTS}onChange={handleSelect}options={endpointOptions}- sizeClasses="z-50 w-[180px]"+ sizeClasses="z-50 w-[min(11.25rem,90vw)]"testId="EngineTTSDropdown"className="z-50"aria-labelledby={labelId}diff --git a/client/src/components/Nav/ShortcutKeyCombo.tsx b/client/src/components/Nav/ShortcutKeyCombo.tsxindex c36b05daad..cfab59b08a 100644--- a/client/src/components/Nav/ShortcutKeyCombo.tsx+++ b/client/src/components/Nav/ShortcutKeyCombo.tsx@@ -9,7 +9,7 @@ function ShortcutKbd({ children, className = '' }: { children: ReactNode; classNreturn (<kbdclassName={cn(- 'inline-flex h-[22px] min-w-[22px] items-center justify-center rounded-md border border-border-light bg-surface-primary-alt px-1.5 font-sans text-[11px] font-medium leading-none text-text-primary',+ 'border-border-light bg-surface-primary-alt text-text-primary inline-flex h-[1.375rem] min-w-[1.375rem] items-center justify-center rounded-md border px-1.5 font-sans text-[11px] leading-none font-medium',className,)}>diff --git a/client/src/components/Nav/ShortcutRecorder.tsx b/client/src/components/Nav/ShortcutRecorder.tsxindex 2302b64c0a..5677b0133f 100644--- a/client/src/components/Nav/ShortcutRecorder.tsx+++ b/client/src/components/Nav/ShortcutRecorder.tsx@@ -182,7 +182,7 @@ export function RecorderPill({onKeyDown={onKeyDown}onKeyUp={onKeyUp}className={cn(- 'bg-surface-primary flex h-[30px] items-center gap-1.5 rounded-md border px-2 outline-hidden transition-colors',+ 'bg-surface-primary flex h-[1.875rem] items-center gap-1.5 rounded-md border px-2 outline-hidden transition-colors','focus-visible:ring-text-primary focus-visible:ring-offset-surface-primary-alt focus-visible:ring-2 focus-visible:ring-offset-1',stateBorder,)}diff --git a/client/src/components/Projects/ProjectChatList.tsx b/client/src/components/Projects/ProjectChatList.tsxindex 220a61c70a..9f3ae68a8c 100644--- a/client/src/components/Projects/ProjectChatList.tsx+++ b/client/src/components/Projects/ProjectChatList.tsx@@ -11,7 +11,7 @@ import {} from 'react';import throttle from 'lodash/throttle';import { MessagesSquare } from 'lucide-react';-import { Button, EmptyState, Spinner } from '@librechat/client';+import { Button, EmptyState, Spinner, useRemScale } from '@librechat/client';import { AutoSizer, CellMeasurer, CellMeasurerCache, List } from 'react-virtualized';import type { TConversation } from 'librechat-data-provider';import type { MeasuredCellParent } from '~/components/Conversations/Conversations';@@ -146,6 +146,7 @@ const ProjectChatList = ({}: ProjectChatListProps) => {const localize = useLocalize();const { data: activeJobsData } = useActiveJobs();+ const remScale = useRemScale();const activeJobIds = useMemo(() => new Set(activeJobsData?.activeJobIds ?? []),[activeJobsData?.activeJobIds],@@ -173,7 +174,7 @@ const ProjectChatList = ({() =>new CellMeasurerCache({fixedWidth: true,- defaultHeight: 52,+ defaultHeight: Math.round(52 * remScale),keyMapper: (index) => {const item = flattenedItemsRef.current[index];if (!item) {@@ -188,7 +189,7 @@ const ProjectChatList = ({return `project-workspace-${item.type}`;},}),- [],+ [remScale],);const listRef = useRef<List | null>(null);@@ -263,7 +264,7 @@ const ProjectChatList = ({}return (- <div className="min-h-[280px] flex-1 overflow-hidden">+ <div className="min-h-[17.5rem] flex-1 overflow-hidden"><AutoSizer>{({ width, height }) => (<Listdiff --git a/client/src/components/Projects/ProjectChatOptions.tsx b/client/src/components/Projects/ProjectChatOptions.tsxindex 06d33d57a0..0503fe437c 100644--- a/client/src/components/Projects/ProjectChatOptions.tsx+++ b/client/src/components/Projects/ProjectChatOptions.tsx@@ -105,7 +105,8 @@ function ProjectChatOptions({ conversation, isMenuOpen, setIsMenuOpen }: ProjectmenuId={menuId}isOpen={isMenuOpen}setIsOpen={setIsMenuOpen}- className="z-[125] min-w-44"+ className="z-[125]"+ minWidth="11rem"iconClassName="mr-2 text-text-secondary"trigger={<Ariakit.MenuButtondiff --git a/client/src/components/Projects/ProjectWorkspace.tsx b/client/src/components/Projects/ProjectWorkspace.tsxindex b9b0af087d..802fb8da39 100644--- a/client/src/components/Projects/ProjectWorkspace.tsx+++ b/client/src/components/Projects/ProjectWorkspace.tsx@@ -26,7 +26,6 @@ import {ResizablePanelGroup,Spinner,TooltipAnchor,- useMediaQuery,} from '@librechat/client';import type { ConversationListResponse } from 'librechat-data-provider';import {@@ -37,6 +36,7 @@ import {import ProjectInstructionsDialog from './ProjectInstructionsDialog';import { useElementSize, useLocalize, useNewConvo } from '~/hooks';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import ProjectDeleteDialog from './ProjectDeleteDialog';import ProjectResources from './ProjectResources';import ProjectChatList from './ProjectChatList';@@ -91,7 +91,7 @@ export default function ProjectWorkspace() {const conversation = useRecoilValue(store.conversationByIndex(0));const { newConversation } = useNewConvo();const activeProjectId = project?._id;- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();/** Panel sizes are a workspace-wide preference, so they persist per browser* rather than per project; the files panel keys its own layout so hiding it@@ -438,7 +438,7 @@ export default function ProjectWorkspace() {{detailsHeader}<div className="h-72 shrink-0">{instructionsSection}</div>{filesSection != null && <div className="h-72 shrink-0">{filesSection}</div>}- <div className="flex min-h-[420px] flex-col">{chatsSection}</div>+ <div className="flex min-h-[26.25rem] flex-col">{chatsSection}</div></div>) : (<ResizablePanelGroupdiff --git a/client/src/components/Projects/ProjectsNavBar.tsx b/client/src/components/Projects/ProjectsNavBar.tsxindex d65db21447..eabbc12ed0 100644--- a/client/src/components/Projects/ProjectsNavBar.tsx+++ b/client/src/components/Projects/ProjectsNavBar.tsx@@ -1,6 +1,7 @@import { Plus } from 'lucide-react';-import { Button, FilterInput, useMediaQuery } from '@librechat/client';+import { Button, FilterInput } from '@librechat/client';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { useLocalize } from '~/hooks';type ProjectsNavBarProps = {@@ -11,7 +12,7 @@ type ProjectsNavBarProps = {export default function ProjectsNavBar({ onCreate, search, onSearchChange }: ProjectsNavBarProps) {const localize = useLocalize();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();return (<header className="border-border-light bg-surface-primary-alt sticky top-0 z-10 border-b"><div className="flex min-h-14 w-full flex-wrap items-center gap-2 px-4 py-2.5 md:min-h-16 md:flex-nowrap md:px-6">diff --git a/client/src/components/Projects/ProjectsSortMenu.tsx b/client/src/components/Projects/ProjectsSortMenu.tsxindex 2041e7dc94..8073077851 100644--- a/client/src/components/Projects/ProjectsSortMenu.tsx+++ b/client/src/components/Projects/ProjectsSortMenu.tsx@@ -67,7 +67,8 @@ export default function ProjectsSortMenu({ sortBy, onSortChange }: ProjectsSortMmenuId={sortMenuId}isOpen={isOpen}setIsOpen={setIsOpen}- className="z-[125] min-w-56"+ className="z-[125]"+ minWidth="14rem"trigger={<Ariakit.MenuButtonaria-label={localize('com_ui_sort_projects_by')}diff --git a/client/src/components/Projects/ProjectsView.tsx b/client/src/components/Projects/ProjectsView.tsxindex a6e31c197a..334d0eee85 100644--- a/client/src/components/Projects/ProjectsView.tsx+++ b/client/src/components/Projects/ProjectsView.tsx@@ -126,7 +126,8 @@ function ProjectCard({menuId={menuId}isOpen={isMenuOpen}setIsOpen={setIsMenuOpen}- className="z-[125] min-w-44"+ className="z-[125]"+ minWidth="11rem"iconClassName="mr-2 text-text-secondary"trigger={<Ariakit.MenuButtondiff --git a/client/src/components/Prompts/dialogs/DeletePrompt.tsx b/client/src/components/Prompts/dialogs/DeletePrompt.tsxindex e27b868cc0..dcc6a42cce 100644--- a/client/src/components/Prompts/dialogs/DeletePrompt.tsx+++ b/client/src/components/Prompts/dialogs/DeletePrompt.tsx@@ -45,11 +45,11 @@ const DeleteConfirmDialog = ({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_prompt')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<div className="flex w-full flex-col items-center gap-2"><div className="grid w-full items-center gap-2">- <p className="text-left text-sm text-text-primary">+ <p className="text-text-primary text-left text-sm">{localize('com_ui_delete_confirm_prompt_version_var', { 0: name })}</p></div>diff --git a/client/src/components/Prompts/display/PromptVariables.tsx b/client/src/components/Prompts/display/PromptVariables.tsxindex 2c8e9e85cf..598153d7b7 100644--- a/client/src/components/Prompts/display/PromptVariables.tsx+++ b/client/src/components/Prompts/display/PromptVariables.tsx@@ -37,7 +37,7 @@ const DropdownVariableCard = ({ parsed }: { parsed: ParsedVariable }) => {return (<div- className="bg-surface-secondary/50 rounded-lg border border-border-medium p-2.5 hover:bg-surface-secondary"+ className="border-border-medium bg-surface-secondary/50 hover:bg-surface-secondary rounded-lg border p-2.5"role="listitem"aria-label={localize('com_ui_variable_with_options', {name: parsed.name,@@ -45,11 +45,11 @@ const DropdownVariableCard = ({ parsed }: { parsed: ParsedVariable }) => {})}><div className="mb-2 flex items-center gap-2">- <div className="flex size-6 items-center justify-center rounded-md bg-surface-tertiary">- <ChevronRight className="size-3.5 text-text-secondary" aria-hidden="true" />+ <div className="bg-surface-tertiary flex size-6 items-center justify-center rounded-md">+ <ChevronRight className="text-text-secondary size-3.5" aria-hidden="true" /></div>- <span className="text-sm font-medium text-text-primary">{parsed.name}</span>- <span className="rounded-full bg-surface-tertiary px-1.5 py-0.5 text-[10px] font-medium text-text-secondary">+ <span className="text-text-primary text-sm font-medium">{parsed.name}</span>+ <span className="bg-surface-tertiary text-text-secondary rounded-full px-1.5 py-0.5 text-[10px] font-medium">{parsed.options.length} {localize('com_ui_options')}</span></div>@@ -61,7 +61,7 @@ const DropdownVariableCard = ({ parsed }: { parsed: ParsedVariable }) => {{parsed.options.map((option, index) => (<spankey={index}- className="rounded-md border border-border-medium bg-transparent px-2 py-0.5 text-xs text-text-secondary transition-colors hover:bg-surface-secondary"+ className="border-border-medium text-text-secondary hover:bg-surface-secondary rounded-md border bg-transparent px-2 py-0.5 text-xs transition-colors"role="listitem">{option}@@ -82,16 +82,16 @@ const SpecialVariableChip = ({ parsed }: { parsed: ParsedVariable }) => {return (<div- className="group flex items-start gap-2 rounded-lg border border-border-medium bg-transparent p-2 hover:bg-surface-secondary"+ className="group border-border-medium hover:bg-surface-secondary flex items-start gap-2 rounded-lg border bg-transparent p-2"role="listitem"aria-label={displayLabel}>- <div className="flex size-6 shrink-0 items-center justify-center rounded-md bg-surface-tertiary">- <Icon className="size-3.5 text-text-secondary" aria-hidden="true" />+ <div className="bg-surface-tertiary flex size-6 shrink-0 items-center justify-center rounded-md">+ <Icon className="text-text-secondary size-3.5" aria-hidden="true" /></div><div className="min-w-0 flex-1">- <span className="text-xs font-medium text-text-primary">{displayLabel}</span>- {description && <p className="mt-0.5 text-[11px] text-text-secondary">{description}</p>}+ <span className="text-text-primary text-xs font-medium">{displayLabel}</span>+ {description && <p className="text-text-secondary mt-0.5 text-[11px]">{description}</p>}</div></div>);@@ -99,10 +99,10 @@ const SpecialVariableChip = ({ parsed }: { parsed: ParsedVariable }) => {const SimpleVariableChip = ({ parsed }: { parsed: ParsedVariable }) => (<span- className="bg-surface-secondary/50 inline-flex items-center gap-1.5 rounded-lg border border-border-medium px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-surface-tertiary"+ className="border-border-medium bg-surface-secondary/50 text-text-primary hover:bg-surface-tertiary inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium"role="listitem">- <Variable className="size-3 text-text-secondary" aria-hidden="true" />+ <Variable className="text-text-secondary size-3" aria-hidden="true" /><span className="max-w-32 truncate">{parsed.name}</span></span>);@@ -138,15 +138,15 @@ const PromptVariables = ({ promptText }: { promptText: string }) => {}return (- <div className="overflow-hidden rounded-xl border border-border-medium">- <header className="flex items-center justify-between border-b border-border-medium p-3">+ <div className="border-border-medium overflow-hidden rounded-xl border">+ <header className="border-border-medium flex items-center justify-between border-b p-3"><div className="flex items-center gap-2">- <Variable className="size-4 text-text-secondary" aria-hidden="true" />- <h4 className="text-sm font-semibold text-text-primary">+ <Variable className="text-text-secondary size-4" aria-hidden="true" />+ <h4 className="text-text-primary text-sm font-semibold">{localize('com_ui_variables')}</h4></div>- <span className="flex size-6 items-center justify-center rounded-full bg-surface-tertiary text-xs font-medium tabular-nums text-text-secondary">+ <span className="bg-surface-tertiary text-text-secondary flex size-6 items-center justify-center rounded-full text-xs font-medium tabular-nums">{variables.length}</span></header>@@ -158,7 +158,7 @@ const PromptVariables = ({ promptText }: { promptText: string }) => {>{specialVars.length > 0 && (<section aria-label={localize('com_ui_special_variables')}>- <h5 className="mb-2 text-[11px] font-medium uppercase tracking-wide text-text-secondary">+ <h5 className="text-text-secondary mb-2 text-[11px] font-medium tracking-wide uppercase">{localize('com_ui_special_variables')}</h5><div className="grid gap-2 sm:grid-cols-2">@@ -171,7 +171,7 @@ const PromptVariables = ({ promptText }: { promptText: string }) => {{dropdownVariables.length > 0 && (<section aria-label={localize('com_ui_dropdown_variables')}>- <h5 className="mb-2 text-[11px] font-medium uppercase tracking-wide text-text-secondary">+ <h5 className="text-text-secondary mb-2 text-[11px] font-medium tracking-wide uppercase">{localize('com_ui_dropdown_variables')}</h5><div className="flex flex-col gap-2">@@ -184,7 +184,7 @@ const PromptVariables = ({ promptText }: { promptText: string }) => {{simpleVariables.length > 0 && (<section aria-label={localize('com_ui_text_variables')}>- <h5 className="mb-2 text-[11px] font-medium uppercase tracking-wide text-text-secondary">+ <h5 className="text-text-secondary mb-2 text-[11px] font-medium tracking-wide uppercase">{localize('com_ui_text_variables')}</h5><div className="flex flex-wrap gap-2">diff --git a/client/src/components/Prompts/editor/VariablesDropdown.tsx b/client/src/components/Prompts/editor/VariablesDropdown.tsxindex aeb4754a21..4fc1cd9b39 100644--- a/client/src/components/Prompts/editor/VariablesDropdown.tsx+++ b/client/src/components/Prompts/editor/VariablesDropdown.tsx@@ -87,7 +87,7 @@ export default function VariablesDropdown({</div><div className="min-w-0 flex-1"><span className={`text-sm font-medium ${labelClass}`}>{localize(labelKey)}</span>- <p className="mt-0.5 text-xs text-text-secondary">{localize(descKey)}</p>+ <p className="text-text-secondary mt-0.5 text-xs">{localize(descKey)}</p></div></div>),@@ -122,12 +122,12 @@ export default function VariablesDropdown({aria-label={localize('com_ui_add_special_variables')}className={`group flex h-8 items-center gap-1.5 rounded-lg bg-transparent px-2 text-sm ${buttonClass}`}>- <Sparkles className="size-3.5 text-text-secondary" aria-hidden="true" />+ <Sparkles className="text-text-secondary size-3.5" aria-hidden="true" /><span className="hidden text-xs font-medium sm:inline">{localize('com_ui_special_variables')}</span>{usedCount > 0 && (- <span className="flex size-4 items-center justify-center rounded-full bg-surface-tertiary text-[10px] font-medium text-text-secondary">+ <span className="bg-surface-tertiary text-text-secondary flex size-4 items-center justify-center rounded-full text-[10px] font-medium">{usedCount}</span>)}@@ -139,7 +139,7 @@ export default function VariablesDropdown({}items={items}menuId={menuId}- className="z-50 w-64"+ className="z-50 w-[min(16rem,90vw)]"itemClassName="px-2 py-1"/></div>diff --git a/client/src/components/Prompts/forms/CreatePromptForm.tsx b/client/src/components/Prompts/forms/CreatePromptForm.tsxindex d7582b2033..785f9a9e47 100644--- a/client/src/components/Prompts/forms/CreatePromptForm.tsx+++ b/client/src/components/Prompts/forms/CreatePromptForm.tsx@@ -2,9 +2,10 @@ import { useEffect } from 'react';import { FileText } from 'lucide-react';import { useNavigate } from 'react-router-dom';import { useForm, Controller, FormProvider } from 'react-hook-form';+import { Button, Spinner, TextareaAutosize, Input } from '@librechat/client';import { LocalStorageKeys, PermissionTypes, Permissions } from 'librechat-data-provider';-import { Button, Spinner, TextareaAutosize, Input, useMediaQuery } from '@librechat/client';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import VariablesDropdown from '../editor/VariablesDropdown';import CategorySelector from '../fields/CategorySelector';import PromptVariables from '../display/PromptVariables';@@ -45,7 +46,7 @@ const CreatePromptForm = ({}) => {const localize = useLocalize();const navigate = useNavigate();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const { hasAccess: hasUseAccess } = usePromptGroupsContext() ?? {};const hasCreateAccess = useHasAccess({permissionType: PermissionTypes.PROMPTS,diff --git a/client/src/components/Prompts/forms/PromptForm.tsx b/client/src/components/Prompts/forms/PromptForm.tsxindex 1af1b1a937..58923c770d 100644--- a/client/src/components/Prompts/forms/PromptForm.tsx+++ b/client/src/components/Prompts/forms/PromptForm.tsx@@ -4,7 +4,7 @@ import { useRecoilValue } from 'recoil';import { useParams } from 'react-router-dom';import { Menu, Rocket, X } from 'lucide-react';import { useForm, FormProvider } from 'react-hook-form';-import { Button, Skeleton, useToastContext, useMediaQuery } from '@librechat/client';+import { Button, Skeleton, useToastContext } from '@librechat/client';import {Permissions,ResourceType,@@ -21,6 +21,7 @@ import {} from '~/data-provider';import { useResourcePermissions, useHasAccess, useLocalize, useFocusTrap } from '~/hooks';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import CategorySelector from '../fields/CategorySelector';import PromptVariables from '../display/PromptVariables';import PromptVersions from '../display/PromptVersions';@@ -108,7 +109,7 @@ const VersionsPanel = React.memo({isLoadingPrompts &&Array.from({ length: 6 }).map((_, index: number) => (<div key={index} className="my-2">- <Skeleton className="h-[72px] w-full" />+ <Skeleton className="h-[4.5rem] w-full" /></div>))}{!isLoadingPrompts && prompts.length > 0 && (@@ -188,7 +189,7 @@ const PromptForm = ({ promptId: promptIdProp }: { promptId?: string }) => {const promptId = promptIdProp || params.promptId || '';const editorMode = useRecoilValue(store.promptsEditorMode);- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const [selectionIndex, setSelectionIndex] = useState<number>(0);const prevIsEditingRef = useRef(false);diff --git a/client/src/components/Prompts/lists/PromptGroupSkeleton.tsx b/client/src/components/Prompts/lists/PromptGroupSkeleton.tsxindex be332a2331..ac88d4fbf6 100644--- a/client/src/components/Prompts/lists/PromptGroupSkeleton.tsx+++ b/client/src/components/Prompts/lists/PromptGroupSkeleton.tsx@@ -5,7 +5,7 @@ export default function PromptGroupSkeleton({ count = 5 }: { count?: number }) {return (<div aria-hidden="true">{Array.from({ length: count }, (_, i) => (- <Skeleton key={i} className="mb-1.5 h-[72px] w-full rounded-xl" />+ <Skeleton key={i} className="mb-1.5 h-[4.5rem] w-full rounded-xl" />))}</div>);diff --git a/client/src/components/Prompts/sidebar/GroupSidePanel.tsx b/client/src/components/Prompts/sidebar/GroupSidePanel.tsxindex e688d690c9..f8261555ef 100644--- a/client/src/components/Prompts/sidebar/GroupSidePanel.tsx+++ b/client/src/components/Prompts/sidebar/GroupSidePanel.tsx@@ -62,7 +62,7 @@ export default function GroupSidePanel({return (<div id="prompts-panel" className={cn('flex h-full w-full flex-col', className)}>{onClose && (- <div className="flex items-center justify-end px-2 py-[2px] md:py-2">+ <div className="flex items-center justify-end px-2 py-0.5 md:py-2"><TooltipAnchordescription={localize('com_nav_close_sidebar')}render={diff --git a/client/src/components/Prompts/utils/SkeletonForm.tsx b/client/src/components/Prompts/utils/SkeletonForm.tsxindex ea6248947d..f781770c5d 100644--- a/client/src/components/Prompts/utils/SkeletonForm.tsx+++ b/client/src/components/Prompts/utils/SkeletonForm.tsx@@ -3,12 +3,12 @@ import { Skeleton } from '@librechat/client';export default function SkeletonForm() {return (<div>- <div className="flex flex-col items-center justify-between px-4 text-text-primary sm:flex-row">+ <div className="text-text-primary flex flex-col items-center justify-between px-4 sm:flex-row"><Skeleton className="mb-1 flex h-10 w-32 flex-row items-center font-bold sm:text-xl md:mb-0 md:h-12 md:text-2xl" /></div><div className="flex h-full w-full flex-col md:flex-row">{/* Left Section */}- <div className="flex-1 overflow-y-auto border-border-medium-alt p-4 md:max-h-[calc(100vh-150px)] md:border-r">+ <div className="border-border-medium-alt flex-1 overflow-y-auto p-4 md:max-h-[calc(100vh-9.375rem)] md:border-r"><Skeleton className="h-96" /></div></div>diff --git a/client/src/components/Share/ShareArtifacts.tsx b/client/src/components/Share/ShareArtifacts.tsxindex f52ec8e52c..2e4eadce13 100644--- a/client/src/components/Share/ShareArtifacts.tsx+++ b/client/src/components/Share/ShareArtifacts.tsx@@ -1,19 +1,16 @@import { Suspense, useState, useMemo } from 'react';import { useAtomValue } from 'jotai';import { useRecoilValue } from 'recoil';-import {- useMediaQuery,- ResizablePanel,- ResizableHandleAlt,- ResizablePanelGroup,-} from '@librechat/client';+import { ResizablePanel, ResizableHandleAlt, ResizablePanelGroup } from '@librechat/client';import type { TMessage } from 'librechat-data-provider';import type { ArtifactsContextValue } from '~/Providers';import useArtifactsRegistryLifetime from '~/hooks/Artifacts/useArtifactsRegistryLifetime';import UndockedArtifacts from '~/components/Artifacts/UndockedArtifacts';import { artifactsUndocked } from '~/components/Artifacts/state';import { ArtifactsProvider, EditorProvider } from '~/Providers';+import { ARTIFACTS_SHEET_MAX_WIDTH } from '~/utils/breakpoints';import { useGetSharedStartupConfig } from '~/data-provider';+import useScaledMaxWidth from '~/hooks/useScaledMaxWidth';import { isCodeOnlyArtifact } from '~/utils/artifacts';import { lazyWithRecovery } from '~/lib/assets/lazy';import { useShareContext } from '~/Providers';@@ -65,7 +62,7 @@ export function ShareArtifactsContainer({const artifacts = useRecoilValue(store.artifactsState);const artifactsVisibility = useRecoilValue(store.artifactsVisibility);const currentArtifactId = useRecoilValue(store.currentArtifactId);- const isSmallScreen = useMediaQuery('(max-width: 1023px)');+ const isSmallScreen = useScaledMaxWidth(ARTIFACTS_SHEET_MAX_WIDTH);const isUndocked = useAtomValue(artifactsUndocked);const [artifactPanelSize, setArtifactPanelSize] = useState(getInitialArtifactPanelSize);/* This is the shared conversation's identity, not the chat tab's Recoil@@ -198,7 +195,7 @@ function ShareArtifactsPanel({ contextValue }: ShareArtifactsPanelProps) {function ShareArtifactsOverlay({ contextValue }: ShareArtifactsPanelProps) {return (<div- className="fixed inset-y-0 right-0 z-40 flex w-full max-w-full sm:max-w-[420px]"+ className="fixed inset-y-0 right-0 z-40 flex w-full max-w-full sm:max-w-[26.25rem]"role="complementary"aria-label="Artifacts panel">diff --git a/client/src/components/SharePoint/SharePointPickerDialog.tsx b/client/src/components/SharePoint/SharePointPickerDialog.tsxindex 4919d7689c..a510800794 100644--- a/client/src/components/SharePoint/SharePointPickerDialog.tsx+++ b/client/src/components/SharePoint/SharePointPickerDialog.tsx@@ -64,7 +64,7 @@ export default function SharePointPickerDialog({* needed a scrim of its own: it takes the theme's. */}<OGDialogContentfocusOutline="hidden"- className="sharepoint-picker-bg bg-surface-dialog fixed top-1/2 left-1/2 z-50 h-[680px] max-h-[90vh] max-w-[90vw] -translate-x-1/2 -translate-y-1/2 rounded-lg border p-2 shadow-lg"+ className="sharepoint-picker-bg bg-surface-dialog fixed top-1/2 left-1/2 z-50 h-[42.5rem] max-h-[90vh] max-w-[90vw] -translate-x-1/2 -translate-y-1/2 rounded-lg border p-2 shadow-lg"showCloseButton={true}><OGDialogTitle className="sr-only">diff --git a/client/src/components/Sharing/AccessRolesPicker.tsx b/client/src/components/Sharing/AccessRolesPicker.tsxindex ee30d842bf..b99959200d 100644--- a/client/src/components/Sharing/AccessRolesPicker.tsx+++ b/client/src/components/Sharing/AccessRolesPicker.tsx@@ -65,8 +65,8 @@ export default function AccessRolesPicker({render: (props) => (<button {...props}><div className="flex flex-col items-start gap-0.5 text-left">- <span className="font-medium text-text-primary">{localizedInfo.name}</span>- <span className="text-xs text-text-secondary">{localizedInfo.description}</span>+ <span className="text-text-primary font-medium">{localizedInfo.name}</span>+ <span className="text-text-secondary text-xs">{localizedInfo.description}</span></div></button>),@@ -86,17 +86,17 @@ export default function AccessRolesPicker({ariaLabel || selectedRoleInfo?.description || localize('com_ui_role_select')}className={cn(- 'flex items-center justify-between gap-2 rounded-xl border border-border-light bg-transparent px-3 py-2 text-sm transition-colors hover:bg-surface-tertiary',+ 'border-border-light hover:bg-surface-tertiary flex items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm transition-colors',)}><span className="font-medium">{selectedRoleInfo?.name || localize('com_ui_select')}</span>- <ChevronDown className="h-4 w-4 text-text-secondary" aria-hidden="true" />+ <ChevronDown className="text-text-secondary h-4 w-4" aria-hidden="true" /></Ariakit.MenuButton>}items={dropdownItems}- className="w-[280px]"+ className="w-[min(17.5rem,90vw)]"/></div>);diff --git a/client/src/components/Sharing/GenericGrantAccessDialog.tsx b/client/src/components/Sharing/GenericGrantAccessDialog.tsxindex 6f36945aa9..bfa5e18831 100644--- a/client/src/components/Sharing/GenericGrantAccessDialog.tsx+++ b/client/src/components/Sharing/GenericGrantAccessDialog.tsx@@ -270,7 +270,7 @@ export default function GenericGrantAccessDialog({aria-label={localize('com_ui_permissions_failed_load')}className={cn('h-9', buttonClassName)}>- <div className="flex min-w-[32px] items-center justify-center text-text-destructive">+ <div className="text-text-destructive flex min-w-[2rem] items-center justify-center"><span className="flex h-6 w-6 items-center justify-center">{isFetchingPermissions ? (<Spinner className="h-4 w-4" />@@ -298,12 +298,12 @@ export default function GenericGrantAccessDialog({disabled={disabled}className={cn('h-9', buttonClassName)}>- <div className="flex min-w-[32px] items-center justify-center gap-2 text-status-info">+ <div className="text-status-info flex min-w-[2rem] items-center justify-center gap-2"><span className="flex h-6 w-6 items-center justify-center"><Share2Icon className="icon-md h-4 w-4" /></span>{totalCurrentShares > 0 && (- <Label className="cursor-pointer text-sm font-medium text-text-secondary">+ <Label className="text-text-secondary cursor-pointer text-sm font-medium">{totalCurrentShares}</Label>)}@@ -317,7 +317,7 @@ export default function GenericGrantAccessDialog({<OGDialogContent className="flex max-h-[90dvh] w-11/12 max-w-5xl flex-col gap-0 overflow-hidden p-0"><OGDialogHeader className="shrink-0 px-5 py-5 pr-14 text-left sm:px-6"><div className="flex items-start gap-3">- <div className="flex size-10 shrink-0 items-center justify-center rounded-xl border border-border-light bg-surface-secondary text-text-secondary">+ <div className="border-border-light bg-surface-secondary text-text-secondary flex size-10 shrink-0 items-center justify-center rounded-xl border"><Users className="size-5" aria-hidden="true" /></div><div className="min-w-0 space-y-1">@@ -342,12 +342,12 @@ export default function GenericGrantAccessDialog({<div className="flex items-center justify-between gap-3 px-1 pb-3"><h3id={peopleSectionId}- className="flex min-w-0 items-center gap-2 text-sm font-semibold text-text-primary"+ className="text-text-primary flex min-w-0 items-center gap-2 text-sm font-semibold">- <UserCheck className="size-4 shrink-0 text-text-secondary" aria-hidden="true" />+ <UserCheck className="text-text-secondary size-4 shrink-0" aria-hidden="true" /><span className="truncate">{localize('com_ui_user_group_permissions')}</span></h3>- <span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-surface-tertiary text-xs font-medium text-text-secondary">+ <span className="bg-surface-tertiary text-text-secondary flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-medium">{allShares.length}</span></div>@@ -357,8 +357,8 @@ export default function GenericGrantAccessDialog({<div className="space-y-2" aria-live="polite"><span className="sr-only">{localize('com_ui_loading')}</span><Skeleton className="h-10 w-full rounded-lg" />- <Skeleton className="h-[62px] w-full rounded-xl" />- <Skeleton className="h-[62px] w-full rounded-xl" />+ <Skeleton className="h-[3.875rem] w-full rounded-xl" />+ <Skeleton className="h-[3.875rem] w-full rounded-xl" /></div>) : (<>@@ -377,14 +377,14 @@ export default function GenericGrantAccessDialog({)}{allShares.length === 0 ? (- <div className="rounded-xl border border-dashed border-border-medium px-5 py-8 text-center">- <div className="mx-auto flex size-10 items-center justify-center rounded-full bg-surface-tertiary text-text-secondary">+ <div className="border-border-medium rounded-xl border border-dashed px-5 py-8 text-center">+ <div className="bg-surface-tertiary text-text-secondary mx-auto flex size-10 items-center justify-center rounded-full"><Users className="size-5" aria-hidden="true" /></div>- <p className="mt-3 text-sm font-medium text-text-primary">+ <p className="text-text-primary mt-3 text-sm font-medium">{localize('com_ui_no_individual_resource_access')}</p>- <p className="mt-1 text-xs text-text-secondary">+ <p className="text-text-secondary mt-1 text-xs">{localize('com_ui_search_above_to_add_people')}</p></div>@@ -403,7 +403,7 @@ export default function GenericGrantAccessDialog({</div>{canSharePublic && (- <div className="mt-4 border-t border-border-light pt-4">+ <div className="border-border-light mt-4 border-t pt-4"><PublicSharingToggleisPublic={isPublic}publicRole={publicRole}diff --git a/client/src/components/Sharing/PeoplePicker/SearchPicker.tsx b/client/src/components/Sharing/PeoplePicker/SearchPicker.tsxindex ff1148871c..9c4310ba61 100644--- a/client/src/components/Sharing/PeoplePicker/SearchPicker.tsx+++ b/client/src/components/Sharing/PeoplePicker/SearchPicker.tsx@@ -76,21 +76,21 @@ export function SearchPicker<TOption extends { key: string; value: string }>({return (<Ariakit.ComboboxProvider store={combobox}><Ariakit.ComboboxLabel- className={cn('mb-2 block font-medium text-text-primary', labelClassName)}+ className={cn('text-text-primary mb-2 block font-medium', labelClassName)}>{label}</Ariakit.ComboboxLabel><><divclassName={cn(- 'relative flex h-10 items-center gap-2 text-text-primary',+ 'text-text-primary relative flex h-10 items-center gap-2',isSmallScreen === true ? 'mb-2 h-14 rounded-2xl' : '',)}>{isLoading ? (<Spinner className="absolute left-3 h-4 w-4" />) : (- <Search className="absolute left-3 h-4 w-4 text-text-secondary" aria-hidden="true" />+ <Search className="text-text-secondary absolute left-3 h-4 w-4" aria-hidden="true" />)}<Ariakit.Comboboxrender={<Input />}@@ -134,7 +134,7 @@ export function SearchPicker<TOption extends { key: string; value: string }>({autoFocusOnShow={false}modal={false}className={cn(- 'animate-popover z-[9999] min-w-64 overflow-hidden rounded-2xl border border-border-light bg-surface-secondary shadow-lg',+ 'animate-popover border-border-light bg-surface-secondary z-[9999] max-w-[calc(100vw-1rem)] min-w-[min(16rem,calc(100vw-1rem))] overflow-hidden rounded-2xl border shadow-lg','[pointer-events:auto]', // Override body's pointer-events:none when in modal)}>@@ -179,13 +179,13 @@ export function SearchPicker<TOption extends { key: string; value: string }>({<divclassName={cn('flex items-center justify-center px-4 py-8 text-center',- 'text-sm text-text-secondary',+ 'text-text-secondary text-sm',)}><div className="flex flex-col items-center gap-2">- <Search className="h-8 w-8 text-text-tertiary opacity-50" />+ <Search className="text-text-tertiary h-8 w-8 opacity-50" /><div className="font-medium">{localize('com_ui_no_results_found')}</div>- <div className="text-xs text-text-tertiary">+ <div className="text-text-tertiary text-xs">{localize('com_ui_try_adjusting_search')}</div></div>diff --git a/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsx b/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsxindex 95e30d2851..dbbeff5eaf 100644--- a/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsx+++ b/client/src/components/Sharing/__tests__/GenericGrantAccessDialog.spec.tsx@@ -160,7 +160,7 @@ describe('GenericGrantAccessDialog - permissions load failure', () => {expect(footer).toHaveClass('bg-transparent');expect(footer).not.toHaveClass('border-t');expect(saveButton).toHaveClass('sm:w-auto');- expect(saveButton).not.toHaveClass('min-w-[140px]');+ expect(saveButton).not.toHaveClass('min-w-[8.75rem]');expect(screen.queryByRole('button', { name: 'com_ui_cancel' })).not.toBeInTheDocument();});diff --git a/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsx b/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsxindex 7ef4e66b31..e2aee8e0cd 100644--- a/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsx+++ b/client/src/components/Sharing/__tests__/PeoplePickerAdminSettings.spec.tsx@@ -63,7 +63,7 @@ describe('PeoplePickerAdminSettings', () => {screen.getByRole('switch', { name: 'com_ui_people_picker_allow_view_users' }),).toBeInTheDocument();expect(saveButton).toHaveAttribute('type', 'submit');- expect(saveButton).not.toHaveClass('min-w-[120px]');+ expect(saveButton).not.toHaveClass('min-w-[7.5rem]');expect(dialog.firstElementChild).not.toHaveClass('border-b');expect(saveButton.parentElement).toHaveClass('bg-transparent');expect(saveButton.parentElement).not.toHaveClass('border-t');diff --git a/client/src/components/SidePanel/Agents/ActionsInput.tsx b/client/src/components/SidePanel/Agents/ActionsInput.tsxindex 0eeb7fe168..c5851c4a98 100644--- a/client/src/components/SidePanel/Agents/ActionsInput.tsx+++ b/client/src/components/SidePanel/Agents/ActionsInput.tsx@@ -296,7 +296,7 @@ export default function ActionsInput({variant="submit"onClick={saveAction}disabled={!functions || !functions.length}- className="min-w-[100px]"+ className="min-w-[6.25rem]">{getButtonContent()}</Button>diff --git a/client/src/components/SidePanel/Agents/ActionsTable/Skeleton.tsx b/client/src/components/SidePanel/Agents/ActionsTable/Skeleton.tsxindex de929635f1..e80bf7615a 100644--- a/client/src/components/SidePanel/Agents/ActionsTable/Skeleton.tsx+++ b/client/src/components/SidePanel/Agents/ActionsTable/Skeleton.tsx@@ -14,11 +14,11 @@ export default function ActionsTableSkeleton() {return (<table className="w-full table-auto text-sm" aria-busy="true" aria-live="polite"><thead>- <tr className="border-b border-border-light">+ <tr className="border-border-light border-b">{HEADER_KEYS.map((key) => (<thkey={key}- className="py-2 pr-3 text-left text-[11px] font-medium uppercase tracking-wide text-text-secondary"+ className="text-text-secondary py-2 pr-3 text-left text-[11px] font-medium tracking-wide uppercase">{localize(key)}</th>@@ -27,7 +27,7 @@ export default function ActionsTableSkeleton() {</thead><tbody>{Array.from({ length: SKELETON_ROWS }, (_, row) => (- <tr key={row} className="border-b border-border-light last:border-0">+ <tr key={row} className="border-border-light border-b last:border-0"><td className="py-2.5 pr-3"><Skeleton className="h-4 w-24 rounded" /></td>diff --git a/client/src/components/SidePanel/Agents/ActionsTable/Table.tsx b/client/src/components/SidePanel/Agents/ActionsTable/Table.tsxindex e676336ce5..9c2f56f532 100644--- a/client/src/components/SidePanel/Agents/ActionsTable/Table.tsx+++ b/client/src/components/SidePanel/Agents/ActionsTable/Table.tsx@@ -21,7 +21,7 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro{headerGroup.headers.map((header) => (<thkey={header.id}- className="sticky top-0 z-10 border-b border-border-light bg-surface-primary py-2 pr-3 text-left text-[11px] font-medium uppercase tracking-wide text-text-secondary"+ className="border-border-light bg-surface-primary text-text-secondary sticky top-0 z-10 border-b py-2 pr-3 text-left text-[11px] font-medium tracking-wide uppercase">{header.isPlaceholder? null@@ -35,7 +35,7 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro{table.getRowModel().rows.map((row) => (<trkey={row.id}- className="border-b border-border-light transition-colors last:border-0 hover:bg-surface-secondary"+ className="border-border-light hover:bg-surface-secondary border-b transition-colors last:border-0">{row.getVisibleCells().map((cell) => (<td key={cell.id} className="py-2 pr-3 align-middle">diff --git a/client/src/components/SidePanel/Agents/Advanced/AdvancedPanel.tsx b/client/src/components/SidePanel/Agents/Advanced/AdvancedPanel.tsxindex ace88067b6..8729543a84 100644--- a/client/src/components/SidePanel/Agents/Advanced/AdvancedPanel.tsx+++ b/client/src/components/SidePanel/Agents/Advanced/AdvancedPanel.tsx@@ -82,7 +82,9 @@ export default function AdvancedPanel() {aria-label={localize('com_ui_agent_id_copy')}className="text-text-secondary hover:bg-surface-secondary hover:text-text-primary focus-visible:ring-text-primary h-auto gap-1.5 rounded-lg px-2 py-1 focus-visible:ring-2">- <code className="max-w-[150px] truncate font-mono text-xs">{currentAgentId}</code>+ <code className="max-w-[9.375rem] truncate font-mono text-xs">+ {currentAgentId}+ </code><span className="t-icon-swap" data-state={copied ? 'b' : 'a'} aria-hidden="true"><span className="t-icon" data-icon="a"><Copy className="h-3.5 w-3.5" aria-hidden="true" />diff --git a/client/src/components/SidePanel/Agents/Advanced/MaxAgentSteps.tsx b/client/src/components/SidePanel/Agents/Advanced/MaxAgentSteps.tsxindex 209a648e8e..f519822703 100644--- a/client/src/components/SidePanel/Agents/Advanced/MaxAgentSteps.tsx+++ b/client/src/components/SidePanel/Agents/Advanced/MaxAgentSteps.tsx@@ -44,7 +44,7 @@ export default function MaxAgentSteps() {</div><HoverCardPortal><HoverCardContent side={ESide.Top} className="w-80">- <p className="text-sm text-text-secondary">+ <p className="text-text-secondary text-sm">{localize('com_ui_agent_recursion_limit_info')}</p></HoverCardContent>diff --git a/client/src/components/SidePanel/Agents/AgentPanelSkeleton.tsx b/client/src/components/SidePanel/Agents/AgentPanelSkeleton.tsxindex 8b45321951..22f8698f33 100644--- a/client/src/components/SidePanel/Agents/AgentPanelSkeleton.tsx+++ b/client/src/components/SidePanel/Agents/AgentPanelSkeleton.tsx@@ -27,7 +27,7 @@ export default function AgentPanelSkeleton() {{/* INSTRUCTIONS */}<div className="mb-3 flex flex-col"><Skeleton className="mb-1 h-3 w-20 rounded" />- <Skeleton className="h-[88px] w-full rounded-xl" />+ <Skeleton className="h-[5.5rem] w-full rounded-xl" /></div>{/* TOOLS — header + a couple of rows */}diff --git a/client/src/components/SidePanel/Agents/AgentTool.tsx b/client/src/components/SidePanel/Agents/AgentTool.tsxindex 2fbfc854de..ece5339d45 100644--- a/client/src/components/SidePanel/Agents/AgentTool.tsx+++ b/client/src/components/SidePanel/Agents/AgentTool.tsx@@ -121,7 +121,7 @@ export default function AgentTool({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_tool')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<><div className="text-text-secondary flex w-full flex-col items-start gap-2 text-sm">diff --git a/client/src/components/SidePanel/Agents/DeleteButton.tsx b/client/src/components/SidePanel/Agents/DeleteButton.tsxindex 357b3d2daf..8d18335a47 100644--- a/client/src/components/SidePanel/Agents/DeleteButton.tsx+++ b/client/src/components/SidePanel/Agents/DeleteButton.tsx@@ -104,14 +104,14 @@ function DeleteButton({title={localize('com_ui_delete_agent')}type="button">- <div className="flex w-full items-center justify-center gap-2 text-text-destructive">+ <div className="text-text-destructive flex w-full items-center justify-center gap-2"><TrashIcon /></div></Button></OGDialogTrigger><OGDialogTemplatetitle={localize('com_ui_delete_agent')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<><div className="flex w-full flex-col items-center gap-2">diff --git a/client/src/components/SidePanel/Agents/FileContext.tsx b/client/src/components/SidePanel/Agents/FileContext.tsxindex ec33855aba..0505fc5536 100644--- a/client/src/components/SidePanel/Agents/FileContext.tsx+++ b/client/src/components/SidePanel/Agents/FileContext.tsx@@ -159,7 +159,7 @@ function FileContext({}/>{fileCount > 0 && (- <span className="bg-surface-tertiary text-text-secondary inline-flex h-4 min-w-[16px] items-center justify-center rounded-full px-1.5 text-[10px] font-medium">+ <span className="bg-surface-tertiary text-text-secondary inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full px-1.5 text-[10px] font-medium">{fileCount}</span>)}diff --git a/client/src/components/SidePanel/Agents/Instructions.tsx b/client/src/components/SidePanel/Agents/Instructions.tsxindex 347ad0a1d8..40646863b9 100644--- a/client/src/components/SidePanel/Agents/Instructions.tsx+++ b/client/src/components/SidePanel/Agents/Instructions.tsx@@ -21,7 +21,7 @@ export default function Instructions() {onBlur={field.onBlur}inputRef={field.ref}placeholder={localize('com_agents_instructions_placeholder')}- className="min-h-[88px] resize-y"+ className="min-h-[5.5rem] resize-y"labelClassName="block text-[11px] font-medium uppercase tracking-wide text-text-secondary"rows={3}required={true}@@ -29,7 +29,7 @@ export default function Instructions() {/>{error && (<span- className="mt-1 text-xs text-text-destructive transition duration-300 ease-in-out"+ className="text-text-destructive mt-1 text-xs transition duration-300 ease-in-out"role="alert">{localize('com_ui_field_required')}diff --git a/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx b/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsxindex 90eb729223..7daf6ba84c 100644--- a/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx+++ b/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx@@ -297,7 +297,7 @@ export default function ApiKeyDialog({triggerRefs={triggerRefs}><OGDialogTemplate- className="w-11/12 sm:w-[500px]"+ className="w-11/12 sm:w-[min(31.25rem,90vw)]"title=""main={<>diff --git a/client/src/components/SidePanel/Agents/Tools/ActionEditor.tsx b/client/src/components/SidePanel/Agents/Tools/ActionEditor.tsxindex baa248b6d7..33aa4b1ed1 100644--- a/client/src/components/SidePanel/Agents/Tools/ActionEditor.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ActionEditor.tsx@@ -112,7 +112,7 @@ export default function ActionEditor({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_action')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_ui_delete_action_confirm')}diff --git a/client/src/components/SidePanel/Agents/Tools/ItemDialog/ItemDialog.tsx b/client/src/components/SidePanel/Agents/Tools/ItemDialog/ItemDialog.tsxindex 4ad1e57853..9eac7bc824 100644--- a/client/src/components/SidePanel/Agents/Tools/ItemDialog/ItemDialog.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ItemDialog/ItemDialog.tsx@@ -23,7 +23,7 @@ export default function ItemDialog({ item, agentId, onClose }: Props) {className={cn('w-11/12 gap-0 rounded-2xl p-0 md:max-h-[85dvh]',isOrchestration ? 'overflow-visible' : 'overflow-hidden',- isAction ? 'max-w-5xl' : 'max-w-[560px]',+ isAction ? 'max-w-5xl' : 'max-w-[35rem]',)}data-testid="item-dialog">diff --git a/client/src/components/SidePanel/Agents/Tools/MarketplaceSidebar.tsx b/client/src/components/SidePanel/Agents/Tools/MarketplaceSidebar.tsxindex 143831daf3..e926298252 100644--- a/client/src/components/SidePanel/Agents/Tools/MarketplaceSidebar.tsx+++ b/client/src/components/SidePanel/Agents/Tools/MarketplaceSidebar.tsx@@ -154,14 +154,14 @@ function SidebarItem({ icon, label, active, onClick, count }: SidebarEntry) {className={cn('flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors',active- ? 'bg-surface-active font-medium text-text-primary'+ ? 'bg-surface-active text-text-primary font-medium': 'text-text-secondary hover:bg-surface-hover hover:text-text-primary',)}><span className="flex size-4 shrink-0 items-center justify-center">{icon}</span><span className="flex-1 truncate">{label}</span>{count !== undefined && count > 0 && (- <span className="text-[11px] tabular-nums text-text-secondary">{count}</span>+ <span className="text-text-secondary text-[11px] tabular-nums">{count}</span>)}</button>);@@ -180,14 +180,14 @@ function SidebarChip({ icon, label, active, onClick, count }: SidebarEntry) {'flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs transition-colors','touch:min-h-theme-control-touch touch:px-4',active- ? 'border-border-medium bg-surface-active font-medium text-text-primary'+ ? 'border-border-medium bg-surface-active text-text-primary font-medium': 'border-border-light text-text-secondary hover:bg-surface-hover hover:text-text-primary',)}><span className="flex size-4 shrink-0 items-center justify-center">{icon}</span><span>{label}</span>{count !== undefined && count > 0 && (- <span className="text-[10px] tabular-nums text-text-secondary">{count}</span>+ <span className="text-text-secondary text-[10px] tabular-nums">{count}</span>)}</button>);@@ -200,8 +200,8 @@ export default function MarketplaceSidebar(props: MarketplaceSidebarProps) {const createItems = useCreateItems(props.onCreateNew);return (- <aside className="flex w-56 shrink-0 flex-col gap-0.5 border-r border-border-light bg-surface-primary-alt p-3">- <h2 className="px-2.5 pb-1 pt-1 text-base font-bold text-text-primary">+ <aside className="border-border-light bg-surface-primary-alt flex w-[min(14rem,35%)] shrink-0 flex-col gap-0.5 border-r p-3">+ <h2 className="text-text-primary px-2.5 pt-1 pb-1 text-base font-bold">{localize('com_ui_tools_marketplace')}</h2>@@ -220,7 +220,7 @@ export default function MarketplaceSidebar(props: MarketplaceSidebarProps) {<Buttonvariant="outline"size="sm"- className="mb-2 mt-1 w-full justify-center gap-1.5"+ className="mt-1 mb-2 w-full justify-center gap-1.5"><Plus className="size-4" aria-hidden="true" /><span className="truncate">{localize('com_ui_tools_create_new')}</span>@@ -236,7 +236,7 @@ export default function MarketplaceSidebar(props: MarketplaceSidebarProps) {<SidebarItem key={entry.id} {...entry} />))}- <div className="mx-2 my-3 h-px bg-border-light" />+ <div className="bg-border-light mx-2 my-3 h-px" />{viewEntries.map((entry) => (<SidebarItem key={entry.id} {...entry} />@@ -259,7 +259,7 @@ export function MarketplaceFilterBar(props: MarketplaceSidebarProps) {than this row, so the bar is the only way to reach the trailing views. */<divrole="group"- className="flex shrink-0 items-center gap-1.5 overflow-x-auto border-b border-border-light px-4 pb-2.5 touch:[scrollbar-width:none] touch:[&::-webkit-scrollbar]:hidden"+ className="border-border-light touch:[scrollbar-width:none] touch:[&::-webkit-scrollbar]:hidden flex shrink-0 items-center gap-1.5 overflow-x-auto border-b px-4 pb-2.5"aria-label={localize('com_ui_tools_marketplace')}>{createItems.length > 0 && (@@ -277,7 +277,7 @@ export function MarketplaceFilterBar(props: MarketplaceSidebarProps) {<Buttonvariant="outline"size="sm"- className="h-8 w-8 shrink-0 justify-center p-0 touch:size-theme-control-touch"+ className="touch:size-theme-control-touch h-8 w-8 shrink-0 justify-center p-0"aria-label={localize('com_ui_tools_create_new')}><Plus className="size-4" aria-hidden="true" />@@ -291,7 +291,7 @@ export function MarketplaceFilterBar(props: MarketplaceSidebarProps) {{kindEntries.map((entry) => (<SidebarChip key={entry.id} {...entry} />))}- <span className="h-4 w-px shrink-0 bg-border-light" aria-hidden="true" />+ <span className="bg-border-light h-4 w-px shrink-0" aria-hidden="true" />{viewEntries.map((entry) => (<SidebarChip key={entry.id} {...entry} />))}diff --git a/client/src/components/SidePanel/Agents/Tools/SkillsDialog.tsx b/client/src/components/SidePanel/Agents/Tools/SkillsDialog.tsxindex b4ca4d97e0..fe295a1341 100644--- a/client/src/components/SidePanel/Agents/Tools/SkillsDialog.tsx+++ b/client/src/components/SidePanel/Agents/Tools/SkillsDialog.tsx@@ -208,7 +208,7 @@ export default function SkillsDialog({ open, onOpenChange, agentId }: SkillsDialsize="sm"onClick={() => setCreateOpen(true)}aria-label={localize('com_ui_create_skill')}- className={cn('h-[42px] w-[42px] shrink-0 p-0', !isDesktop && 'ml-auto')}+ className={cn('h-[2.625rem] w-[2.625rem] shrink-0 p-0', !isDesktop && 'ml-auto')}><Plus className="size-4" aria-hidden="true" /></Button>@@ -228,7 +228,7 @@ export default function SkillsDialog({ open, onOpenChange, agentId }: SkillsDialonChange={(e) => setSearch(e.target.value)}placeholder={localize('com_ui_search_skills')}aria-label={localize('com_ui_search_skills')}- className="h-[42px] bg-transparent pl-9"+ className="h-[2.625rem] bg-transparent pl-9"/></div><CategoryFilter options={categoryOptions} value={category} onChange={setCategory} />@@ -237,11 +237,11 @@ export default function SkillsDialog({ open, onOpenChange, agentId }: SkillsDialreturn (<OGDialog open={open} onOpenChange={onOpenChange}>- <OGDialogContent className="border-border-medium w-11/12 max-w-[900px] overflow-hidden rounded-2xl p-0 shadow-xl md:max-h-[92vh]">+ <OGDialogContent className="border-border-medium w-11/12 max-w-[56.25rem] overflow-hidden rounded-2xl p-0 shadow-xl md:max-h-[92vh]"><OGDialogDescription className="sr-only">{localize('com_ui_skills_dialog_description')}</OGDialogDescription>- <div className="flex h-[80dvh] max-h-[760px] flex-col">+ <div className="flex h-[80dvh] max-h-[47.5rem] flex-col"><div className="border-border-light flex flex-col gap-3 border-b px-4 pt-4 pb-3 md:px-6 md:pt-5 md:pb-4"><div className="flex items-center gap-2 pr-10"><OGDialogTitle className="text-base font-semibold">diff --git a/client/src/components/SidePanel/Agents/Tools/ToolCard.tsx b/client/src/components/SidePanel/Agents/Tools/ToolCard.tsxindex 2cc82e077f..a240f1315e 100644--- a/client/src/components/SidePanel/Agents/Tools/ToolCard.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ToolCard.tsx@@ -50,7 +50,7 @@ function ItemIconView({ item, size }: ItemIconProps) {const tileClasses =size === 'md' ? 'h-10 w-10 rounded-xl text-base' : 'h-9 w-9 rounded-lg text-sm';- const iconClasses = size === 'md' ? 'h-[18px] w-[18px]' : 'h-[18px] w-[18px]';+ const iconClasses = size === 'md' ? 'h-[1.125rem] w-[1.125rem]' : 'h-[1.125rem] w-[1.125rem]';if (iconUrl && !imgError) {return (diff --git a/client/src/components/SidePanel/Agents/Tools/ToolsMarketplaceDialog.tsx b/client/src/components/SidePanel/Agents/Tools/ToolsMarketplaceDialog.tsxindex 657efb4719..83b79998eb 100644--- a/client/src/components/SidePanel/Agents/Tools/ToolsMarketplaceDialog.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ToolsMarketplaceDialog.tsx@@ -240,14 +240,14 @@ export default function ToolsMarketplaceDialog({space below the catalog on a tall screen. Below md the shell is thefull-bleed sheet and the body is capped to the same 100dvh, because its`h-full` resolves against a grid area sized to the whole catalog. */}- <OGDialogContent className="border-border-medium h-[100dvh] max-h-[100dvh] w-full max-w-full overflow-hidden rounded-none p-0 shadow-xl md:h-auto md:max-h-[92vh] md:w-11/12 md:max-w-[1200px] md:rounded-2xl">+ <OGDialogContent className="border-border-medium h-[100dvh] max-h-[100dvh] w-full max-w-full overflow-hidden rounded-none p-0 shadow-xl md:h-auto md:max-h-[92vh] md:w-11/12 md:max-w-[75rem] md:rounded-2xl"><OGDialogTitle className="sr-only">{localize('com_ui_tools_marketplace')}</OGDialogTitle><OGDialogDescription className="sr-only">{localize('com_ui_tools_marketplace_description')}</OGDialogDescription>{/* min-w-0: as a grid item of the dialog content, an `auto` minimum wouldsize this column to the chip row's min-content and overflow the viewport. */}- <div className="flex h-full max-h-[100dvh] min-w-0 flex-col md:h-[88vh] md:max-h-[840px] md:flex-row">+ <div className="flex h-full max-h-[100dvh] min-w-0 flex-col md:h-[88vh] md:max-h-[52.5rem] md:flex-row">{isDesktop && (<MarketplaceSidebaractiveView={view}diff --git a/client/src/components/SidePanel/Agents/Tools/ToolsSection.tsx b/client/src/components/SidePanel/Agents/Tools/ToolsSection.tsxindex 8df2f31ba9..1885ae0548 100644--- a/client/src/components/SidePanel/Agents/Tools/ToolsSection.tsx+++ b/client/src/components/SidePanel/Agents/Tools/ToolsSection.tsx@@ -292,7 +292,7 @@ export default function ToolsSection({ agentId }: Props) {<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_action')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_ui_delete_action_confirm')}@@ -317,7 +317,7 @@ export default function ToolsSection({ agentId }: Props) {<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_tool')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_ui_delete_tool_confirm')}@@ -364,7 +364,7 @@ function SelectedSection({<label className="text-text-secondary block text-[11px] font-medium tracking-wide uppercase">{title}{badge != null && (- <span className="bg-surface-tertiary text-text-secondary ml-1.5 inline-flex h-4 min-w-[16px] items-center justify-center rounded-full px-1.5 text-[10px] font-medium tracking-normal normal-case">+ <span className="bg-surface-tertiary text-text-secondary ml-1.5 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full px-1.5 text-[10px] font-medium tracking-normal normal-case">{badge}</span>)}diff --git a/client/src/components/SidePanel/Agents/UploadDropzone.tsx b/client/src/components/SidePanel/Agents/UploadDropzone.tsxindex 5137a4e9ac..759af62c0b 100644--- a/client/src/components/SidePanel/Agents/UploadDropzone.tsx+++ b/client/src/components/SidePanel/Agents/UploadDropzone.tsx@@ -7,7 +7,7 @@ function DropzoneContent({ label, hint }: { label: string; hint?: string }) {return (<span className="pointer-events-none flex flex-col items-center justify-center gap-2 text-center"><span className="bg-surface-tertiary text-text-secondary group-hover:text-text-primary flex h-9 w-9 items-center justify-center rounded-full transition-colors">- <Upload className="h-[18px] w-[18px]" strokeWidth={2} aria-hidden="true" />+ <Upload className="h-[1.125rem] w-[1.125rem]" strokeWidth={2} aria-hidden="true" /></span><span className="flex flex-col gap-0.5"><span className="text-text-primary text-sm font-medium">{label}</span>diff --git a/client/src/components/SidePanel/Agents/Version/VersionItem.tsx b/client/src/components/SidePanel/Agents/Version/VersionItem.tsxindex aa6cfbce0f..e2035da4ba 100644--- a/client/src/components/SidePanel/Agents/Version/VersionItem.tsx+++ b/client/src/components/SidePanel/Agents/Version/VersionItem.tsx@@ -177,7 +177,7 @@ export default function VersionItem({</OGDialogTrigger><OGDialogTemplatetitle={localize('com_ui_agent_version_restore_confirm')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<div className="flex w-full flex-col gap-3 text-sm"><Label className="text-text-primary text-left font-medium">diff --git a/client/src/components/SidePanel/ArtifactsPanel.tsx b/client/src/components/SidePanel/ArtifactsPanel.tsxindex 8bfb6f9dd5..8200d1b800 100644--- a/client/src/components/SidePanel/ArtifactsPanel.tsx+++ b/client/src/components/SidePanel/ArtifactsPanel.tsx@@ -48,7 +48,7 @@ const ArtifactsPanel = memo(function ArtifactsPanel({panelRef={artifactsPanelRef}id="artifacts-panel">- <div className="h-full min-w-[400px] overflow-hidden">{panel}</div>+ <div className="h-full min-w-[min(25rem,100%)] overflow-hidden">{panel}</div></ResizablePanel></>);diff --git a/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx b/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsxindex 7cd975c8e5..7b085dc3f1 100644--- a/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx+++ b/client/src/components/SidePanel/Bookmarks/BookmarkCardActions.tsx@@ -102,7 +102,7 @@ export default function BookmarkCardActions({ bookmark }: BookmarkCardActionsPro<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_bookmarks_delete')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<p className="text-text-secondary text-left text-sm">{localize('com_ui_bookmark_delete_confirm')}{' '}diff --git a/client/src/components/SidePanel/Builder/ActionsInput.tsx b/client/src/components/SidePanel/Builder/ActionsInput.tsxindex 9fe8c6c972..c0279cbbaa 100644--- a/client/src/components/SidePanel/Builder/ActionsInput.tsx+++ b/client/src/components/SidePanel/Builder/ActionsInput.tsx@@ -226,7 +226,7 @@ export default function ActionsInput({<selectid="example-schema"onChange={(e) => console.log(e.target.value)}- className="border-border-medium h-8 min-w-[100px] rounded-lg border bg-transparent px-2 py-0 text-sm"+ className="border-border-medium h-8 min-w-[6.25rem] rounded-lg border bg-transparent px-2 py-0 text-sm"><option value="label">{localize('com_ui_examples')}</option><option value="0">Weather (JSON)</option>@@ -286,7 +286,7 @@ export default function ActionsInput({<buttondisabled={!functions || !functions.length}onClick={saveAction}- className="bg-surface-submit text-text-on-status hover:bg-surface-submit-hover focus-visible:ring-text-primary focus-visible:ring-offset-surface-primary mt-1 flex min-w-[100px] items-center justify-center rounded px-4 py-2 font-semibold focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50"+ className="bg-surface-submit text-text-on-status hover:bg-surface-submit-hover focus-visible:ring-text-primary focus-visible:ring-offset-surface-primary mt-1 flex min-w-[6.25rem] items-center justify-center rounded px-4 py-2 font-semibold focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50"type="button">{submitContext()}diff --git a/client/src/components/SidePanel/Builder/ActionsPanel.tsx b/client/src/components/SidePanel/Builder/ActionsPanel.tsxindex 7320eab1bc..e90b251b64 100644--- a/client/src/components/SidePanel/Builder/ActionsPanel.tsx+++ b/client/src/components/SidePanel/Builder/ActionsPanel.tsx@@ -126,7 +126,7 @@ export default function ActionsPanel({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_action')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_ui_delete_action_confirm')}diff --git a/client/src/components/SidePanel/Builder/AssistantPanel.tsx b/client/src/components/SidePanel/Builder/AssistantPanel.tsxindex 5e2aaa508c..8f9ef812c2 100644--- a/client/src/components/SidePanel/Builder/AssistantPanel.tsx+++ b/client/src/components/SidePanel/Builder/AssistantPanel.tsx@@ -281,7 +281,7 @@ export default function AssistantPanel({{/* Select Button */}{assistant_id && (<button- className="btn bg-surface-submit text-text-on-status hover:bg-surface-submit-hover focus-visible:ring-text-primary focus-visible:ring-offset-surface-primary mx-2 mt-1 h-[40px] rounded px-4 py-2 font-semibold focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2"+ className="btn bg-surface-submit text-text-on-status hover:bg-surface-submit-hover focus-visible:ring-text-primary focus-visible:ring-offset-surface-primary mx-2 mt-1 h-[2.5rem] rounded px-4 py-2 font-semibold focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2"type="button"disabled={!assistant_id}onClick={(e) => {@@ -364,7 +364,7 @@ export default function AssistantPanel({{...field}value={field.value ?? ''}{...{ max: 32768 }}- className={cn(inputClass, 'min-h-[100px] resize-y')}+ className={cn(inputClass, 'min-h-[6.25rem] resize-y')}id="instructions"placeholder={localize('com_assistants_instructions_placeholder')}rows={3}@@ -413,7 +413,7 @@ export default function AssistantPanel({showLabel={false}className={cn(cardStyle,- 'flex h-[40px] w-full flex-none items-center justify-center px-4 hover:cursor-pointer',+ 'flex h-[2.5rem] w-full flex-none items-center justify-center px-4 hover:cursor-pointer',)}containerClassName={cn('rounded-md',diff --git a/client/src/components/SidePanel/Builder/AssistantSelect.tsx b/client/src/components/SidePanel/Builder/AssistantSelect.tsxindex 90023e6409..b4cec1d3d4 100644--- a/client/src/components/SidePanel/Builder/AssistantSelect.tsx+++ b/client/src/components/SidePanel/Builder/AssistantSelect.tsx@@ -265,12 +265,12 @@ export default function AssistantSelect({currentValueClass="text-base font-semibold"className={cn('mt-1 rounded-md',- 'z-50 flex h-[40px] w-full flex-none items-center justify-center px-4 hover:cursor-pointer',+ 'z-50 flex h-[2.5rem] w-full flex-none items-center justify-center px-4 hover:cursor-pointer',)}renderOption={() => (<span className="flex items-center gap-1.5 truncate"><span className="text-text-primary absolute inset-y-0 left-0 flex items-center pl-2">- <Plus className="w-[16px]" />+ <Plus className="w-[1rem]" /></span><span className={cn('text-text-primary ml-4 flex h-6 items-center gap-1')}>{createAssistant}diff --git a/client/src/components/SidePanel/Builder/AssistantTool.tsx b/client/src/components/SidePanel/Builder/AssistantTool.tsxindex b230580f1e..21e7828a44 100644--- a/client/src/components/SidePanel/Builder/AssistantTool.tsx+++ b/client/src/components/SidePanel/Builder/AssistantTool.tsx@@ -92,7 +92,7 @@ export default function AssistantTool({<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete_tool')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<Label className="text-left text-sm font-medium">{localize('com_ui_delete_tool_confirm')}diff --git a/client/src/components/SidePanel/Builder/ContextButton.tsx b/client/src/components/SidePanel/Builder/ContextButton.tsxindex ab2f6250e4..94c6459e8a 100644--- a/client/src/components/SidePanel/Builder/ContextButton.tsx+++ b/client/src/components/SidePanel/Builder/ContextButton.tsx@@ -101,7 +101,7 @@ export default function ContextButton({</DialogTrigger><DialogTemplatetitle={localize('com_ui_delete_assistant')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<><div className="flex w-full flex-col items-center gap-2">diff --git a/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx b/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsxindex 14bac96719..06a078c917 100644--- a/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx+++ b/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx@@ -145,7 +145,7 @@ export default function MemoryCreateDialog({onBlur={() => setTouched((prev) => ({ ...prev, value: true }))}onKeyDown={handleKeyPress}placeholder={localize('com_ui_enter_value')}- className="border-border-light text-text-primary focus-visible:ring-border-heavy max-h-[45vh] min-h-[180px] w-full resize-y rounded-lg border bg-transparent px-3 py-2 text-sm focus-visible:ring-1"+ className="border-border-light text-text-primary focus-visible:ring-border-heavy max-h-[45vh] min-h-[11.25rem] w-full resize-y rounded-lg border bg-transparent px-3 py-2 text-sm focus-visible:ring-1"rows={8}aria-invalid={showValueError && valueError != null}aria-describedby="memory-value-message"diff --git a/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx b/client/src/components/SidePanel/Memories/MemoryEditDialog.tsxindex 20fa96a19c..62fc40b1cc 100644--- a/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx+++ b/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx@@ -218,7 +218,7 @@ export default function MemoryEditDialog({onBlur={() => setTouched((prev) => ({ ...prev, value: true }))}onKeyDown={handleKeyPress}placeholder={localize('com_ui_enter_value')}- className="border-border-light text-text-primary focus-visible:ring-border-heavy max-h-[45vh] min-h-[180px] w-full resize-y rounded-lg border bg-transparent px-3 py-2 text-sm focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50"+ className="border-border-light text-text-primary focus-visible:ring-border-heavy max-h-[45vh] min-h-[11.25rem] w-full resize-y rounded-lg border bg-transparent px-3 py-2 text-sm focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50"rows={8}disabled={!hasUpdateAccess}aria-invalid={showValueError && valueError != null}diff --git a/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx b/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsxindex 4af94f8e16..1590578eb4 100644--- a/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx+++ b/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx@@ -75,7 +75,7 @@ function DynamicCheckbox({disabled={readonly}checked={selectedValue}onCheckedChange={handleCheckedChange}- className="mt-[2px]"+ className="mt-[0.125rem]"aria-label={localize(label as TranslationKeys)}/></div>diff --git a/client/src/components/SidePanel/Parameters/DynamicTextarea.tsx b/client/src/components/SidePanel/Parameters/DynamicTextarea.tsxindex a673c9a0e0..4eb08ab93a 100644--- a/client/src/components/SidePanel/Parameters/DynamicTextarea.tsx+++ b/client/src/components/SidePanel/Parameters/DynamicTextarea.tsx@@ -94,7 +94,7 @@ function DynamicTextarea({: placeholder}className={cn(- 'border-border-light bg-surface-secondary flex max-h-[220px] min-h-[76px] w-full resize-none rounded-lg border px-3 py-2 text-sm',+ 'border-border-light bg-surface-secondary flex max-h-[13.75rem] min-h-[4.75rem] w-full resize-none rounded-lg border px-3 py-2 text-sm',)}/></HoverCardTrigger>diff --git a/client/src/components/SidePanel/SidePanelGroup.tsx b/client/src/components/SidePanel/SidePanelGroup.tsxindex 0f549bfb54..bf8961a767 100644--- a/client/src/components/SidePanel/SidePanelGroup.tsx+++ b/client/src/components/SidePanel/SidePanelGroup.tsx@@ -1,6 +1,8 @@import { useState, memo } from 'react';import { useDefaultLayout } from 'react-resizable-panels';-import { ResizablePanel, ResizablePanelGroup, useMediaQuery } from '@librechat/client';+import { ResizablePanel, ResizablePanelGroup } from '@librechat/client';+import { ARTIFACTS_SHEET_MAX_WIDTH } from '~/utils/breakpoints';+import useScaledMaxWidth from '~/hooks/useScaledMaxWidth';import ArtifactsPanel from './ArtifactsPanel';const PANEL_IDS_SINGLE = ['messages-view'];@@ -14,7 +16,7 @@ interface SidePanelProps {const SidePanelGroup = memo(({ panel, children }: SidePanelProps) => {const [shouldRenderPanel, setShouldRenderPanel] = useState(panel != null);- const isSmallScreen = useMediaQuery('(max-width: 767px)');+ const isSmallScreen = useScaledMaxWidth(ARTIFACTS_SHEET_MAX_WIDTH);const { defaultLayout, onLayoutChanged } = useDefaultLayout({id: 'side-panel-layout',diff --git a/client/src/components/Skills/dialogs/DeleteSkill.tsx b/client/src/components/Skills/dialogs/DeleteSkill.tsxindex c8d5858caf..139e14477e 100644--- a/client/src/components/Skills/dialogs/DeleteSkill.tsx+++ b/client/src/components/Skills/dialogs/DeleteSkill.tsx@@ -77,7 +77,7 @@ function DeleteSkill({ skillId, skillName, disabled, onDelete }: DeleteSkillProp<OGDialogTemplateshowCloseButton={false}title={localize('com_ui_delete')}- className="max-w-[450px]"+ className="max-w-[28.125rem]"main={<p className="text-text-primary text-left text-sm">{localize('com_ui_skill_delete_confirm', { 0: skillName })}diff --git a/client/src/components/Skills/dialogs/UploadSkillDialog.tsx b/client/src/components/Skills/dialogs/UploadSkillDialog.tsxindex b7ccb416c3..51ee456ea0 100644--- a/client/src/components/Skills/dialogs/UploadSkillDialog.tsx+++ b/client/src/components/Skills/dialogs/UploadSkillDialog.tsx@@ -225,7 +225,7 @@ export default function UploadSkillDialog({ isOpen, setIsOpen }: UploadSkillDialonDrop={handleDrop}disabled={importMutation.isLoading}className={cn(- 'text-text-secondary flex h-[120px] w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-dashed text-sm transition-colors',+ 'text-text-secondary flex h-[7.5rem] w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-dashed text-sm transition-colors',isDragging? 'border-border-heavy bg-surface-hover': 'border-border-medium hover:bg-surface-hover',diff --git a/client/src/components/Skills/display/SkillFileViewer.tsx b/client/src/components/Skills/display/SkillFileViewer.tsxindex 26aff8539c..904299eb88 100644--- a/client/src/components/Skills/display/SkillFileViewer.tsx+++ b/client/src/components/Skills/display/SkillFileViewer.tsx@@ -178,7 +178,7 @@ function SkillFileViewer({ skillId, relativePath, skill }: SkillFileViewerProps)<imgsrc={rawUrl}alt={data.filename}- className="max-h-[600px] max-w-full rounded-lg object-contain"+ className="max-h-[37.5rem] max-w-full rounded-lg object-contain"/>)}diff --git a/client/src/components/Skills/display/SkillState.tsx b/client/src/components/Skills/display/SkillState.tsxindex caa2b5cbb3..20750e3bc8 100644--- a/client/src/components/Skills/display/SkillState.tsx+++ b/client/src/components/Skills/display/SkillState.tsx@@ -47,8 +47,8 @@ export default function SkillState({<div className={cn('mb-4 flex size-12 items-center justify-center rounded-xl', style.wrap)}><Icon className={cn('size-6', style.icon)} aria-hidden="true" /></div>- <p className="text-[15px] font-semibold text-text-primary">{title}</p>- <p className="mt-1.5 text-sm leading-relaxed text-text-secondary">{description}</p>+ <p className="text-text-primary text-[15px] font-semibold">{title}</p>+ <p className="text-text-secondary mt-1.5 text-sm leading-relaxed">{description}</p>{actionLabel && onAction && (<Buttontype="button"diff --git a/client/src/components/Skills/forms/InvocationModePicker.tsx b/client/src/components/Skills/forms/InvocationModePicker.tsxindex 21e3e4b1b7..5fff30d768 100644--- a/client/src/components/Skills/forms/InvocationModePicker.tsx+++ b/client/src/components/Skills/forms/InvocationModePicker.tsx@@ -42,10 +42,10 @@ export default function InvocationModePicker({ value, onChange }: InvocationModerender: (props) => (<button {...props}><div className="flex flex-col items-start gap-0.5 text-left">- <span className="font-medium text-text-primary">+ <span className="text-text-primary font-medium">{localize(invocationLabels[mode])}</span>- <span className="text-xs text-text-secondary">+ <span className="text-text-secondary text-xs">{localize(invocationDescriptions[mode])}</span></div>@@ -57,7 +57,7 @@ export default function InvocationModePicker({ value, onChange }: InvocationModereturn (<div className="flex flex-col">- <label className="mb-1 text-sm font-medium text-text-secondary">+ <label className="text-text-secondary mb-1 text-sm font-medium">{localize('com_ui_invocation_mode')}</label><DropdownPopup@@ -67,16 +67,16 @@ export default function InvocationModePicker({ value, onChange }: InvocationModetrigger={<Ariakit.MenuButtonaria-label={localize('com_ui_invocation_mode')}- className="flex w-fit items-center justify-between gap-2 rounded-xl border border-border-medium bg-transparent px-3 py-2 text-sm text-text-primary transition-colors hover:bg-surface-tertiary"+ className="border-border-medium text-text-primary hover:bg-surface-tertiary flex w-fit items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm transition-colors">- <span className="font-medium text-text-primary">+ <span className="text-text-primary font-medium">{localize(invocationLabels[value])}</span>- <ChevronDown className="size-4 text-text-secondary" aria-hidden="true" />+ <ChevronDown className="text-text-secondary size-4" aria-hidden="true" /></Ariakit.MenuButton>}items={menuItems}- className="w-[280px]"+ className="w-[min(17.5rem,90vw)]"portal={true}/></div>diff --git a/client/src/components/Skills/layouts/SkillsView.tsx b/client/src/components/Skills/layouts/SkillsView.tsxindex 564a968b77..bbbccdaf89 100644--- a/client/src/components/Skills/layouts/SkillsView.tsx+++ b/client/src/components/Skills/layouts/SkillsView.tsx@@ -1,4 +1,4 @@-import { Spinner, useMediaQuery } from '@librechat/client';+import { Spinner } from '@librechat/client';import { PermissionTypes, Permissions } from 'librechat-data-provider';import { Navigate, useNavigate, useParams, useLocation, useSearchParams } from 'react-router-dom';import SkillFileViewer from '~/components/Skills/display/SkillFileViewer';@@ -7,6 +7,7 @@ import { useHasAccess, useAuthContext, useLocalize } from '~/hooks';import SkillDetail from '~/components/Skills/display/SkillDetail';import SkillState from '~/components/Skills/display/SkillState';import OpenSidebar from '~/components/Chat/Menus/OpenSidebar';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import { useGetSkillByIdQuery } from '~/data-provider';/**@@ -151,7 +152,7 @@ function EditView({ skillId }: { skillId: string }) {/** Sidebar reopen affordance for small screens, where the drawer is the only navigation. */function MobileSidebarToggle() {- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();if (!isSmallScreen) {return null;}diff --git a/client/src/components/Skills/layouts/__tests__/SkillsView.spec.tsx b/client/src/components/Skills/layouts/__tests__/SkillsView.spec.tsxindex 077e13c9e6..92811fcbbd 100644--- a/client/src/components/Skills/layouts/__tests__/SkillsView.spec.tsx+++ b/client/src/components/Skills/layouts/__tests__/SkillsView.spec.tsx@@ -19,6 +19,7 @@ jest.mock('librechat-data-provider', () => ({jest.mock('@librechat/client', () => ({Spinner: () => <div data-testid="spinner" />,useMediaQuery: (query: string) => mockUseMediaQuery(query),+ useRemScale: () => 1,}));jest.mock('~/components/Chat/Menus/OpenSidebar', () => ({diff --git a/client/src/components/Skills/lists/SkillListItem.tsx b/client/src/components/Skills/lists/SkillListItem.tsxindex e5f46ffca6..d2fef6303d 100644--- a/client/src/components/Skills/lists/SkillListItem.tsx+++ b/client/src/components/Skills/lists/SkillListItem.tsx@@ -1,6 +1,7 @@import { memo, useState, useMemo, useCallback } from 'react';import { FixedSizeTree } from 'react-vtree';import { useNavigate } from 'react-router-dom';+import { useRemScale } from '@librechat/client';import { ScrollText, ChevronDown, ChevronRight, Folder, Pin } from 'lucide-react';import type { FixedSizeNodeData, TreeWalkerValue, TreeWalker } from 'react-vtree';import type { TSkillSummary, TSkillFile } from 'librechat-data-provider';@@ -139,12 +140,12 @@ function FileTreeNode({}) {const isFolder = data.nodeType === 'folder';const isFileActive = !isFolder && treeData?.activeFile === data.path;- const indent = data.depth * 16 + (isFolder ? 8 : 24);+ const indentRem = (data.depth * 16 + (isFolder ? 8 : 24)) / 16;return (<buttontype="button"- style={{ ...style, paddingLeft: `${indent}px` }}+ style={{ ...style, paddingLeft: `${indentRem}rem` }}onClick={(e) => {e.stopPropagation();if (isFolder) {@@ -198,7 +199,8 @@ function InlineFileTree({const visibleCount = useMemo(() => countVisible(treeEntries, openIds), [treeEntries, openIds]);- const height = Math.min(visibleCount * ITEM_SIZE, MAX_HEIGHT);+ const remScale = useRemScale();+ const height = Math.min(visibleCount * ITEM_SIZE, MAX_HEIGHT) * remScale;const handleToggle = useCallback((id: string, isOpen: boolean) => {setOpenIds((prev) => {@@ -241,7 +243,7 @@ function InlineFileTree({return (<FixedSizeTree<FileNodeData>treeWalker={treeWalker}- itemSize={ITEM_SIZE}+ itemSize={ITEM_SIZE * remScale}height={height}width="100%"itemData={callbacks}diff --git a/client/src/components/System/UiScaleSync.tsx b/client/src/components/System/UiScaleSync.tsxnew file mode 100644index 0000000000..748b14ddf9--- /dev/null+++ b/client/src/components/System/UiScaleSync.tsx@@ -0,0 +1,22 @@+import { useEffect } from 'react';+import { useAtomValue } from 'jotai';+import { applyUiScale } from '@librechat/client';+import { uiScaleValueAtom } from '~/store/uiScale';++/**+ * Keeps the scale atom mounted so Jotai's storage subscription stays active and a+ * change made in another tab reaches this one. Renders nothing, which confines the+ * re-render to this leaf instead of the provider tree, where the query client is+ * constructed during render.+ */+export default function UiScaleSync(): null {+ const uiScale = useAtomValue(uiScaleValueAtom);++ /** Reconciles the DOM with the stored value on mount, so a corrupted or+ * out-of-range entry cannot leave the root scale disagreeing with the setting. */+ useEffect(() => {+ applyUiScale(uiScale);+ }, [uiScale]);++ return null;+}diff --git a/client/src/components/Tools/AssistantToolsDialog.tsx b/client/src/components/Tools/AssistantToolsDialog.tsxindex 58ce7f1b9d..5628d6fb8a 100644--- a/client/src/components/Tools/AssistantToolsDialog.tsx+++ b/client/src/components/Tools/AssistantToolsDialog.tsx@@ -158,7 +158,7 @@ function AssistantToolsDialog({><OGDialogContentclassName="bg-surface-dialog gap-0 overflow-hidden overflow-y-auto p-0 text-left max-sm:h-full sm:mx-7 sm:my-8 sm:max-w-2xl lg:max-w-5xl xl:max-w-7xl"- style={{ minHeight: '610px' }}+ style={{ minHeight: 'min(38.125rem, 90vh)' }}><div><div className="border-border-medium flex items-center justify-between border-b-[1px] px-4 pt-5 pb-4 sm:p-6">@@ -191,21 +191,21 @@ function AssistantToolsDialog({)}<div className="p-4 sm:p-6 sm:pt-4"><div className="mt-4 flex flex-col gap-4">- <div className="flex items-center justify-center space-x-4">- <Search className="text-text-tertiary h-6 w-6" aria-hidden="true" />+ <div className="flex min-w-0 items-center justify-center gap-4">+ <Search className="text-text-tertiary h-6 w-6 shrink-0" aria-hidden="true" /><Inputtype="text"value={searchValue}onChange={handleSearch}placeholder={localize('com_nav_tool_search')}aria-label={localize('com_nav_tool_search')}- className="border-border-medium text-text-primary w-64 rounded border bg-transparent px-2 py-1"+ className="border-border-medium text-text-primary max-w-64 min-w-0 flex-1 rounded border bg-transparent px-2 py-1"/></div><divref={gridRef}className="grid grid-cols-1 grid-rows-2 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"- style={{ minHeight: '410px' }}+ style={{ minHeight: '25.625rem' }}>{filteredTools &&filteredTools@@ -229,7 +229,7 @@ function AssistantToolsDialog({onChangePage={handleChangePage}/>) : (- <div style={{ height: '21px' }}></div>+ <div className="h-[1.3125rem]"></div>)}</div></div>diff --git a/client/src/components/Tools/ToolItem.tsx b/client/src/components/Tools/ToolItem.tsxindex 38d6fafd4f..ee99ffafac 100644--- a/client/src/components/Tools/ToolItem.tsx+++ b/client/src/components/Tools/ToolItem.tsx@@ -29,26 +29,26 @@ function ToolItem({ tool, onAddTool, onRemoveTool, isInstalled = false }: ToolItconst icon = (tool as AgentToolType).metadata?.icon || (tool as TPlugin).icon;return (- <div className="flex flex-col gap-4 rounded border border-border-medium bg-transparent p-6">+ <div className="border-border-medium flex flex-col gap-4 rounded border bg-transparent p-6"><div className="flex gap-4">- <div className="h-[70px] w-[70px] shrink-0">+ <div className="h-[4.375rem] w-[4.375rem] shrink-0"><div className="relative h-full w-full">{icon ? (<imgsrc={icon}alt={localize('com_ui_logo', { 0: name })}- className="h-full w-full rounded-[5px] bg-surface-fixed"+ className="bg-surface-fixed h-full w-full rounded-[5px]"/>) : (- <div className="flex h-full w-full items-center justify-center rounded-[5px] border border-border-medium bg-transparent">- <Wrench className="h-8 w-8 text-text-secondary" />+ <div className="border-border-medium flex h-full w-full items-center justify-center rounded-[5px] border bg-transparent">+ <Wrench className="text-text-secondary h-8 w-8" /></div>)}- <div className="absolute inset-0 rounded-[5px] ring-1 ring-inset ring-border-light"></div>+ <div className="ring-border-light absolute inset-0 rounded-[5px] ring-1 ring-inset"></div></div></div><div className="flex min-w-0 flex-col items-start justify-between">- <div className="mb-2 line-clamp-1 max-w-full text-lg leading-5 text-text-primary">+ <div className="text-text-primary mb-2 line-clamp-1 max-w-full text-lg leading-5">{name}</div>{!isInstalled ? (@@ -78,7 +78,7 @@ function ToolItem({ tool, onAddTool, onRemoveTool, isInstalled = false }: ToolIt)}</div></div>- <div className="line-clamp-3 h-[60px] text-sm text-text-secondary">{description}</div>+ <div className="text-text-secondary line-clamp-3 h-[3.75rem] text-sm">{description}</div></div>);}diff --git a/client/src/components/UnifiedSidebar/ConversationsSection.tsx b/client/src/components/UnifiedSidebar/ConversationsSection.tsxindex 7a769f9066..0867623026 100644--- a/client/src/components/UnifiedSidebar/ConversationsSection.tsx+++ b/client/src/components/UnifiedSidebar/ConversationsSection.tsx@@ -1,7 +1,6 @@import { useCallback, useEffect, useState, useMemo, memo, useRef } from 'react';import { useAtomValue } from 'jotai';import { useRecoilValue } from 'recoil';-import { useMediaQuery } from '@librechat/client';import type { InfiniteQueryObserverResult } from '@tanstack/react-query';import type { ConversationListResponse } from 'librechat-data-provider';import type { List } from 'react-virtualized';@@ -29,6 +28,7 @@ import ProjectsSection from '~/components/Conversations/ProjectsSection';import ChatFilterMenu from '~/components/Conversations/ChatFilterMenu';import PinnedSection from '~/components/Conversations/PinnedSection';import ProjectNamesProvider from '~/Providers/ProjectNamesContext';+import useDrawerViewport from '~/hooks/Nav/useDrawerViewport';import useSidebarToggle from '~/hooks/Nav/useSidebarToggle';import { Conversations } from '~/components/Conversations';import { cn, collectPinnedConversations } from '~/utils';@@ -39,7 +39,7 @@ const chatsHeaderTrailing = <ChatFilterMenu />;const ConversationsSection = memo(() => {const localize = useLocalize();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const { setSidebarOpen } = useSidebarToggle();const { isAuthenticated } = useAuthContext();useTitleGeneration(isAuthenticated);diff --git a/client/src/components/UnifiedSidebar/UnifiedSidebar.tsx b/client/src/components/UnifiedSidebar/UnifiedSidebar.tsxindex 9539e47ad4..fdef237374 100644--- a/client/src/components/UnifiedSidebar/UnifiedSidebar.tsx+++ b/client/src/components/UnifiedSidebar/UnifiedSidebar.tsx@@ -1,8 +1,8 @@import { useCallback, useState, useEffect, useRef, memo } from 'react';import { useAtom } from 'jotai';import { useForm } from 'react-hook-form';-import { useMediaQuery } from '@librechat/client';import { useLocation, useNavigate } from 'react-router-dom';+import { pxToRem, useRemScale, useMediaQuery } from '@librechat/client';import type { ReactNode } from 'react';import type { ChatFormValues } from '~/common';import {@@ -69,6 +69,7 @@ function UnifiedSidebar({const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');const [sidebarWidth, setSidebarWidth] = useState(getInitialWidth);const [viewportWidth, setViewportWidth] = useState(() => window.innerWidth);+ const remScale = useRemScale();const [isResizing, setIsResizing] = useState(false);const resizeHandlers = useRef<{ move: (e: MouseEvent) => void; up: () => void } | null>(null);@@ -84,12 +85,11 @@ function UnifiedSidebar({return () => window.removeEventListener('resize', handleViewportResize);}, []);- /** Mirrors the bounds the aside is rendered with, so the handle never announces a value- * outside its own range. CSS resolves a 40% that falls under `min-width` in favor of the- * minimum, and the resize handlers clamp the same way, so the floor belongs here too. */- const resizeMax = Math.max(EXPANDED_MIN, Math.round(viewportWidth * 0.4));+ /** Keep the handle's announced range in the same baseline units as stored widths. */+ const resizeMax = (viewportWidth * 0.4) / remScale;+ const resizeMin = Math.min(EXPANDED_MIN, resizeMax);const resizeNow = panelExpanded- ? Math.min(Math.max(sidebarWidth, EXPANDED_MIN), resizeMax)+ ? Math.min(Math.max(sidebarWidth, resizeMin), resizeMax): COLLAPSED_WIDTH;const handleCollapse = useCallback(@@ -117,7 +117,9 @@ function UnifiedSidebar({const handleResizeStart = useCallback(() => {setIsResizing(true);document.body.style.userSelect = 'none';- const maxWidth = window.innerWidth * 0.4;+ const maxWidth = (window.innerWidth * 0.4) / remScale;+ /** The scaled minimum can exceed the viewport cap, so it yields to the cap. */+ const minWidth = Math.min(EXPANDED_MIN, maxWidth);let rafId: number | null = null;const move = (e: MouseEvent) => {@@ -126,7 +128,7 @@ function UnifiedSidebar({}rafId = requestAnimationFrame(() => {rafId = null;- const next = Math.max(EXPANDED_MIN, Math.min(e.clientX, maxWidth));+ const next = Math.max(minWidth, Math.min(e.clientX / remScale, maxWidth));setSidebarWidth(next);});};@@ -150,18 +152,25 @@ function UnifiedSidebar({resizeHandlers.current = { move, up };document.addEventListener('mousemove', move);document.addEventListener('mouseup', up);- }, []);+ }, [remScale]);- const handleResizeKeyboard = useCallback((direction: 'shrink' | 'grow') => {- setSidebarWidth((w) => {- const next =- direction === 'shrink'- ? Math.max(w - 20, EXPANDED_MIN)- : Math.min(w + 20, window.innerWidth * 0.4);- localStorage.setItem('side:width', String(Math.round(next)));- return next;- });- }, []);+ const handleResizeKeyboard = useCallback(+ (direction: 'shrink' | 'grow') => {+ setSidebarWidth((w) => {+ const maxWidth = (window.innerWidth * 0.4) / remScale;+ /** A width stored at a lower scale can exceed the current maximum, so it+ * is brought into range before stepping rather than crawling down by 20. */+ const current = Math.min(w, maxWidth);+ const next =+ direction === 'shrink'+ ? Math.max(current - 20, Math.min(EXPANDED_MIN, maxWidth))+ : Math.min(current + 20, maxWidth);+ localStorage.setItem('side:width', String(Math.round(next)));+ return next;+ });+ },+ [remScale],+ );useEffect(() => {return () => {@@ -272,9 +281,11 @@ function UnifiedSidebar({<asideclassName="relative flex h-full shrink-0 overflow-hidden"style={{- width: panelExpanded ? sidebarWidth : COLLAPSED_WIDTH,- minWidth: panelExpanded ? EXPANDED_MIN : COLLAPSED_WIDTH,- maxWidth: panelExpanded ? '40%' : COLLAPSED_WIDTH,+ width: pxToRem(panelExpanded ? sidebarWidth : COLLAPSED_WIDTH),+ minWidth: panelExpanded+ ? `min(${pxToRem(EXPANDED_MIN)}, 40%)`+ : pxToRem(COLLAPSED_WIDTH),+ maxWidth: panelExpanded ? '40%' : pxToRem(COLLAPSED_WIDTH),transition: isResizing? 'none': `width ${TRANSITION_MS}ms ${EASING}, min-width ${TRANSITION_MS}ms ${EASING}, max-width ${TRANSITION_MS}ms ${EASING}`,@@ -285,7 +296,7 @@ function UnifiedSidebar({links={links}expanded={panelExpanded}width={resizeNow}- minWidth={panelExpanded ? EXPANDED_MIN : COLLAPSED_WIDTH}+ minWidth={panelExpanded ? resizeMin : COLLAPSED_WIDTH}maxWidth={panelExpanded ? resizeMax : COLLAPSED_WIDTH}onCollapse={handleCollapse}onExpand={handlePanelExpand}diff --git a/client/src/components/UnifiedSidebar/__tests__/drawerPaint.spec.tsx b/client/src/components/UnifiedSidebar/__tests__/drawerPaint.spec.tsxindex bae4c5548d..32daf4e9c6 100644--- a/client/src/components/UnifiedSidebar/__tests__/drawerPaint.spec.tsx+++ b/client/src/components/UnifiedSidebar/__tests__/drawerPaint.spec.tsx@@ -22,6 +22,7 @@ const mockSidebarState = { isSmallScreen: true, expanded: false, setExpanded: jejest.mock('@librechat/client', () => ({useMediaQuery: () => false,+ useRemScale: () => 1,}));jest.mock('~/hooks/Nav/useSidebarState', () => ({diff --git a/client/src/components/UnifiedSidebar/mobile/Switcher.tsx b/client/src/components/UnifiedSidebar/mobile/Switcher.tsxindex 8856e798e8..4f7053e162 100644--- a/client/src/components/UnifiedSidebar/mobile/Switcher.tsx+++ b/client/src/components/UnifiedSidebar/mobile/Switcher.tsx@@ -75,7 +75,7 @@ function Switcher({isOpen={isOpen}setIsOpen={setIsOpen}items={items}- className="min-w-[240px]"+ minWidth="15rem"iconClassName="mr-2 size-5"trigger={<Ariakit.MenuButtondiff --git a/client/src/components/Web/SourceHovercard.tsx b/client/src/components/Web/SourceHovercard.tsxindex af61fbd289..a2eec155a6 100644--- a/client/src/components/Web/SourceHovercard.tsx+++ b/client/src/components/Web/SourceHovercard.tsx@@ -47,7 +47,7 @@ export function FaviconImage({ domain, className = '' }: { domain: string; class}const hovercardClass = cn(- 'z-[999] w-[320px] max-w-[calc(100vw-2rem)] rounded-xl border border-border-medium bg-surface-secondary p-3 text-text-primary shadow-lg',+ 'z-[999] w-[20rem] max-w-[calc(100vw-2rem)] rounded-xl border border-border-medium bg-surface-secondary p-3 text-text-primary shadow-lg','origin-top -translate-y-1 opacity-0 transition-[opacity,transform] duration-150 ease-out','data-[enter]:translate-y-0 data-[enter]:opacity-100','data-[leave]:-translate-y-1 data-[leave]:opacity-0',diff --git a/client/src/components/Web/Sources.tsx b/client/src/components/Web/Sources.tsxindex 672fb18205..dc210d104d 100644--- a/client/src/components/Web/Sources.tsx+++ b/client/src/components/Web/Sources.tsx@@ -92,7 +92,7 @@ function SourceItem({ source, expanded = false }: SourceItemProps) {<Ariakit.Hovercardgutter={16}className={cn(- 'border-border-medium bg-surface-secondary text-text-primary z-[999] w-[320px] max-w-[calc(100vw-2rem)] rounded-xl border p-3 shadow-lg',+ 'border-border-medium bg-surface-secondary text-text-primary z-[999] w-[20rem] max-w-[calc(100vw-2rem)] rounded-xl border p-3 shadow-lg','origin-top-left scale-95 opacity-0 transition-[opacity,transform] duration-150 ease-out','data-[enter]:scale-100 data-[enter]:opacity-100','data-[leave]:scale-95 data-[leave]:opacity-0',@@ -380,7 +380,7 @@ export function StackedFavicons({<FaviconImagekey={`icon-${i}`}domain={getCleanDomain(source.link)}- className={i > 0 ? 'ml-[-6px]' : ''}+ className={i > 0 ? 'ml-[-0.375rem]' : ''}/>))}</div>@@ -411,7 +411,7 @@ const SourcesGroup = React.memo(function SourcesGroup({<div className="grid w-full grid-cols-4 gap-2 overflow-x-auto"><OGDialog>{visibleSources.map((source, i) => (- <div key={`source-${i}`} className="w-full min-w-[120px]">+ <div key={`source-${i}`} className="w-full min-w-[7.5rem]"><SourceItem source={source} /></div>))}@@ -425,7 +425,7 @@ const SourcesGroup = React.memo(function SourcesGroup({</div></OGDialogTrigger>)}- <OGDialogContent className="bg-surface-dialog flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[600px]">+ <OGDialogContent className="bg-surface-dialog flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[37.5rem]"><div className="border-border-light bg-surface-dialog sticky top-0 z-10 flex items-center justify-between border-b px-3 py-2"><OGDialogTitle className="text-base font-medium">{localize('com_sources_title')}@@ -500,7 +500,7 @@ function FilesGroup({ files, messageId, conversationId, limit = 3 }: FilesGroupP<div className="grid w-full grid-cols-4 gap-2 overflow-x-auto"><OGDialog>{visibleFiles.map((file, i) => (- <div key={`file-${i}`} className="w-full min-w-[120px]">+ <div key={`file-${i}`} className="w-full min-w-[7.5rem]"><FileItem file={file} messageId={messageId} conversationId={conversationId} /></div>))}@@ -509,7 +509,10 @@ function FilesGroup({ files, messageId, conversationId, limit = 3 }: FilesGroupP<div className="flex items-center gap-2"><div className="relative flex">{remainingFiles.slice(0, 3).map((_, i) => (- <File key={`file-icon-${i}`} className={`size-4 ${i > 0 ? 'ml-[-6px]' : ''}`} />+ <File+ key={`file-icon-${i}`}+ className={`size-4 ${i > 0 ? 'ml-[-0.375rem]' : ''}`}+ />))}</div><span className="text-text-secondary truncate text-xs font-medium">@@ -518,7 +521,7 @@ function FilesGroup({ files, messageId, conversationId, limit = 3 }: FilesGroupP</div></OGDialogTrigger>)}- <OGDialogContent className="bg-surface-dialog flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[600px]">+ <OGDialogContent className="bg-surface-dialog flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[37.5rem]"><div className="border-border-light bg-surface-dialog sticky top-0 z-10 flex items-center justify-between border-b px-3 py-2"><OGDialogTitle className="text-base font-medium">{localize('com_sources_agent_files')}diff --git a/client/src/components/ui/LocalizedDateRangePicker.tsx b/client/src/components/ui/LocalizedDateRangePicker.tsxindex 11e7d0ded0..f81ccf05d0 100644--- a/client/src/components/ui/LocalizedDateRangePicker.tsx+++ b/client/src/components/ui/LocalizedDateRangePicker.tsx@@ -160,7 +160,7 @@ export default function LocalizedDateRangePicker({<Popover.Contentalign="end"sideOffset={6}- className="border-border-light bg-surface-primary text-text-primary z-50 w-[320px] max-w-[calc(100vw-2rem)] rounded-lg border p-4 shadow-lg"+ className="border-border-light bg-surface-primary text-text-primary z-50 w-[20rem] max-w-[calc(100vw-2rem)] rounded-lg border p-4 shadow-lg"><div className="flex flex-col gap-4"><div className="grid grid-cols-1 gap-3 sm:grid-cols-2">diff --git a/client/src/hooks/Nav/useDrawerViewport.ts b/client/src/hooks/Nav/useDrawerViewport.tsnew file mode 100644index 0000000000..b5528e6457--- /dev/null+++ b/client/src/hooks/Nav/useDrawerViewport.ts@@ -0,0 +1,11 @@+import useScaledMaxWidth from '~/hooks/useScaledMaxWidth';+import { DRAWER_MAX_WIDTH } from '~/utils/breakpoints';++/**+ * Whether navigation is in drawer mode. Shared by the hook that owns the open state and+ * by every route control that reveals the reopen affordance, so they cannot disagree+ * about the current mode.+ */+export default function useDrawerViewport(): boolean {+ return useScaledMaxWidth(DRAWER_MAX_WIDTH);+}diff --git a/client/src/hooks/Nav/useSidebarState.ts b/client/src/hooks/Nav/useSidebarState.tsindex 8f16c55dff..294c9e3574 100644--- a/client/src/hooks/Nav/useSidebarState.ts+++ b/client/src/hooks/Nav/useSidebarState.ts@@ -1,9 +1,7 @@import { useEffect, useRef } from 'react';import { useRecoilState } from 'recoil';-import { useMediaQuery } from '@librechat/client';-import type { SetterOrUpdater } from 'recoil';-+import useDrawerViewport from './useDrawerViewport';import store from '~/store';export type SidebarState = {@@ -27,7 +25,7 @@ export type SidebarState = {* here so they can never disagree about that frame.*/export default function useSidebarState(): SidebarState {- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const isSmallScreen = useDrawerViewport();const [expanded, setExpanded] = useRecoilState(store.sidebarExpanded);const wasSmallScreen = useRef(isSmallScreen);diff --git a/client/src/hooks/useScaledMaxWidth.ts b/client/src/hooks/useScaledMaxWidth.tsnew file mode 100644index 0000000000..00b8ff106d--- /dev/null+++ b/client/src/hooks/useScaledMaxWidth.ts@@ -0,0 +1,13 @@+import { useMediaQuery, useRemScale } from '@librechat/client';+import { scaledMaxWidthQuery } from '~/utils/breakpoints';++/**+ * Whether the viewport is at most `baselinePx` wide, measured in the units the layout is+ * expressed in. Use this rather than a fixed pixel query wherever the branch chooses+ * between a wide and a narrow layout: at a larger scale the wide one keeps being picked+ * while its rem-sized contents outgrow the space it gives them.+ */+export default function useScaledMaxWidth(baselinePx: number): boolean {+ const remScale = useRemScale();+ return useMediaQuery(scaledMaxWidthQuery(baselinePx, remScale));+}diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.jsonindex 897fcbb686..e1cfd21d45 100644--- a/client/src/locales/en/translation.json+++ b/client/src/locales/en/translation.json@@ -936,6 +936,9 @@"com_nav_tool_remove": "Remove","com_nav_tool_search": "Search tools","com_nav_unseen_tab_badge": "Show unread count in the tab title",+ "com_nav_ui_scale": "UI scale",+ "com_nav_ui_scale_decrease": "Decrease UI scale",+ "com_nav_ui_scale_increase": "Increase UI scale","com_nav_user": "USER","com_nav_user_msg_markdown": "Render user messages as markdown","com_nav_user_name_display": "Display username in messages",diff --git a/client/src/routes/Root.tsx b/client/src/routes/Root.tsxindex dae5aeec17..b33a53b5bc 100644--- a/client/src/routes/Root.tsx+++ b/client/src/routes/Root.tsx@@ -47,6 +47,7 @@ import { TermsAndConditionsModal } from '~/components/ui';import useDrawerSwipe from '~/hooks/Nav/useDrawerSwipe';import ChatSettingsProvider from './ChatSettings';import { useHealthCheck } from '~/data-provider';+import Settings from '~/components/Nav/Settings';import { Banner } from '~/components/Banners';import store from '~/store';@@ -153,6 +154,14 @@ function RootLayout() {}}, [termsData]);+ /** The overscroll guard in style.css keys off this attribute: drawer mode is decided+ * against the scaled root font size, which a media query cannot read. */+ useEffect(() => {+ const root = document.documentElement;+ root.toggleAttribute('data-drawer-nav', isSmallScreen);+ return () => root.removeAttribute('data-drawer-nav');+ }, [isSmallScreen]);+const handleAcceptTerms = () => {setShowTerms(false);};@@ -238,6 +247,7 @@ function RootLayout() {</div></div></PromptGroupsProvider>+ <Settings /><KeyboardShortcutsProvider /><ReplyNotifications /><MessagesRetention />diff --git a/client/src/routes/Search.tsx b/client/src/routes/Search.tsxindex cd79ac28b8..76e214f384 100644--- a/client/src/routes/Search.tsx+++ b/client/src/routes/Search.tsx@@ -3,8 +3,8 @@ import { useAtomValue } from 'jotai';import throttle from 'lodash/throttle';import { useRecoilValue } from 'recoil';import { Search as SearchIcon, SearchX } from 'lucide-react';-import { EmptyState, Spinner, useToastContext } from '@librechat/client';import { List, CellMeasurer, CellMeasurerCache } from 'react-virtualized';+import { EmptyState, Spinner, useRemScale, useToastContext } from '@librechat/client';import type { Index, ListRowProps } from 'react-virtualized';import type { TMessage } from 'librechat-data-provider';import { getMessageRowWidthClass } from '~/components/Chat/Messages/ui/MessageRow';@@ -88,6 +88,7 @@ export default function Search() {const { isAuthenticated } = useAuthContext();const search = useRecoilValue(store.search);const fontSize = useAtomValue(fontSizeAtom);+ const remScale = useRemScale();const searchQuery = search.debouncedQuery;const {@@ -141,10 +142,10 @@ export default function Search() {() =>new CellMeasurerCache({fixedWidth: true,- defaultHeight: 140,+ defaultHeight: Math.round(140 * remScale),keyMapper: (index) => itemsRef.current[index]?.messageId ?? `search-row-${index}`,}),- [],+ [remScale],);const recompute = useCallback(@@ -168,11 +169,13 @@ export default function Search() {return () => cancelAnimationFrame(frameId);}, [searchQuery, recompute]);- /** A font-size change alters every row's height but keeps the user's place. */+ /** A font-size or UI-scale change alters every row's height but keeps the user's+ * place. The scale can change without the container width doing so, in which case+ * the width effect below never fires. */useEffect(() => {const frameId = requestAnimationFrame(() => recompute(true));return () => cancelAnimationFrame(frameId);- }, [fontSize, recompute]);+ }, [fontSize, remScale, recompute]);/** Appending a page keeps existing measures; any other content change at the* same row count (a file preview resolving, a refetch) can alter a row's@@ -260,8 +263,9 @@ export default function Search() {);const getRowHeight = useCallback(- ({ index }: Index) => (index >= messages.length ? FOOTER_HEIGHT : cache.getHeight(index, 0)),- [cache, messages.length],+ ({ index }: Index) =>+ index >= messages.length ? FOOTER_HEIGHT * remScale : cache.getHeight(index, 0),+ [cache, messages.length, remScale],);useEffect(() => {diff --git a/client/src/routes/__tests__/Search.spec.tsx b/client/src/routes/__tests__/Search.spec.tsxindex 9dede5f1b1..a8296d2d83 100644--- a/client/src/routes/__tests__/Search.spec.tsx+++ b/client/src/routes/__tests__/Search.spec.tsx@@ -63,6 +63,7 @@ jest.mock('@librechat/client', () => ({</div>),useToastContext: () => ({ showToast: jest.fn() }),+ useRemScale: () => 1,}));jest.mock('~/hooks', () => ({useLocalize: () => (key: string) => key,diff --git a/client/src/store/settings.ts b/client/src/store/settings.tsindex d693eaeb5c..729f59af7f 100644--- a/client/src/store/settings.ts+++ b/client/src/store/settings.ts@@ -2,6 +2,7 @@ import { atom } from 'recoil';import { SettingsViews, LocalStorageKeys } from 'librechat-data-provider';import type { TOptionSettings } from '~/common';import { CHAT_TITLE_IN_TAB_KEY } from '~/utils/documentTitle';+import { isDrawerViewport } from '~/utils/breakpoints';import { atomWithLocalStorage } from '~/store/utils';import { STTEndpoints } from '~/common';@@ -34,23 +35,18 @@ const staticAtoms = {speechSettingsInitialized: atom<boolean>({ key: 'speechSettingsInitialized', default: false }),};-/** Read synchronously: `useMediaQuery` only resolves after the first paint. */-function isSmallViewport(): boolean {- return typeof window !== 'undefined' && window.matchMedia('(max-width: 768px)').matches;-}-const localStorageAtoms = {// General settingssidebarExpanded: atomWithLocalStorage('unifiedSidebarExpanded',- !isSmallViewport(),+ !isDrawerViewport(),/*** The mobile drawer covers the viewport, so a persisted open state would* launch the app into the navigation instead of the conversation.* Normalized during atom initialization so the closed state reaches the* first paint rather than animating shut after it.*/- (saved) => (isSmallViewport() ? false : saved),+ (saved) => (isDrawerViewport() ? false : saved),),enableUserMsgMarkdown: atomWithLocalStorage<boolean>(LocalStorageKeys.ENABLE_USER_MSG_MARKDOWN,diff --git a/client/src/store/uiScale.ts b/client/src/store/uiScale.tsnew file mode 100644index 0000000000..7e67c2cf68--- /dev/null+++ b/client/src/store/uiScale.ts@@ -0,0 +1,43 @@+import { atom } from 'jotai';+import { atomWithStorage, createJSONStorage } from 'jotai/utils';+import { applyUiScale, clampUiScale, DEFAULT_UI_SCALE } from '@librechat/client';++/**+ * Applies the scale to the DOM on every path that changes the stored value,+ * including a storage event from another tab, and before Jotai notifies+ * subscribers so a render never observes a value the DOM has not caught up to.+ *+ * Browser zoom (Ctrl -/+) is left untouched on purpose: it is an accessibility+ * affordance people rely on, and the two zoom levels would compound.+ */+const createUiScaleStorage = () => {+ const storage = createJSONStorage<number>(() => localStorage);++ return {+ ...storage,+ setItem: (key: string, value: number) => {+ storage.setItem(key, value);+ applyUiScale(value);+ },+ subscribe: (key: string, callback: (value: number) => void, initialValue: number) =>+ storage.subscribe?.(+ key,+ (value: number) => {+ applyUiScale(value);+ callback(value);+ },+ initialValue,+ ) ?? (() => undefined),+ };+};++/** This atom stores the user's interface scale preference. */+export const uiScaleAtom = atomWithStorage<number>(+ 'uiScale',+ DEFAULT_UI_SCALE,+ createUiScaleStorage(),+ { getOnInit: true },+);++/** Read-only, always-valid scale for consumers that cannot tolerate a bad value. */+export const uiScaleValueAtom = atom((get) => clampUiScale(get(uiScaleAtom)));diff --git a/client/src/style.css b/client/src/style.cssindex a521364058..33e51798e3 100644--- a/client/src/style.css+++ b/client/src/style.css@@ -48,6 +48,14 @@--font-size-lg: 1.125rem;--font-size-xl: 1.25rem;--markdown-font-size: 1rem;+ --ui-scale: 1;+}++/* Every size in the app is expressed in rem, so scaling the root font size scales+ the whole interface. A percentage keeps the reader's own browser font-size+ preference intact instead of pinning the root to a fixed pixel value. */+html {+ font-size: calc(100% * var(--ui-scale));}/* transitions-dev tokens: semantic names shared by every t-* class below. */@@ -519,7 +527,7 @@ p > small {max-width: 65ch;font-size: var(--markdown-font-size, var(--font-size-base));line-height: calc(- 22px * var(--markdown-font-size, var(--font-size-base)) / var(--font-size-base)+ 1.375rem * var(--markdown-font-size, var(--font-size-base)) / var(--font-size-base));}@@ -1164,16 +1172,16 @@ html {height: 100%;}-/* Scoped to the drawer-gesture breakpoint (useSidebarState's 768px): on small- screens the app never scrolls at the root, so chaining out of nested- scrollers has nothing legitimate to reach — this kills Chrome Android's- pull-to-refresh and horizontal overscroll gliding into browser navigation.- Desktop keeps native trackpad back/forward and refresh gestures. */-@media (max-width: 768px) {- body,- html {- overscroll-behavior: none;- }+/* Scoped to drawer mode rather than a fixed viewport width: that breakpoint is+ scale-aware and a media query cannot read the scaled root font size, so Root+ stamps this attribute from the same predicate. In drawer mode the app never+ scrolls at the root, so chaining out of nested scrollers has nothing legitimate+ to reach: this kills Chrome Android's pull-to-refresh and horizontal overscroll+ gliding into browser navigation. Desktop keeps native trackpad back/forward+ and refresh gestures. */+html[data-drawer-nav],+html[data-drawer-nav] body {+ overscroll-behavior: none;}.dark body,@@ -1191,7 +1199,7 @@ html {max-width: none;font-size: var(--markdown-font-size, var(--font-size-base));line-height: calc(- 22px * var(--markdown-font-size, var(--font-size-base)) / var(--font-size-base)+ 1.375rem * var(--markdown-font-size, var(--font-size-base)) / var(--font-size-base));}@@ -1520,10 +1528,10 @@ html {border-radius: 50%;content: ' ';display: block;- height: 12px;+ height: 0.75rem;position: absolute;- top: -11px;- width: 12px;+ top: -0.6875rem;+ width: 0.75rem;}@media (prefers-reduced-motion: reduce) {@@ -1593,8 +1601,8 @@ html {.result-streaming > pre:last-child code:after {display: inline-block;content: '⬤';- width: 12px;- height: 12px;+ width: 0.75rem;+ height: 0.75rem;font-family:system-ui,Inter,@@ -1631,8 +1639,8 @@ html {vertical-align: middle;font-size: 0.5rem;display: inline-block;- width: 12px;- height: 12px;+ width: 0.75rem;+ height: 0.75rem;}}@@ -1656,8 +1664,8 @@ html {vertical-align: middle;font-size: 0.5rem;display: inline-block;- width: 12px;- height: 12px;+ width: 0.75rem;+ height: 0.75rem;}.result-streaming > ol:last-child > li:last-child > :is(ul, ol, pre) ~ :after,diff --git a/client/src/utils/breakpoints.ts b/client/src/utils/breakpoints.tsnew file mode 100644index 0000000000..762bbbba38--- /dev/null+++ b/client/src/utils/breakpoints.ts@@ -0,0 +1,43 @@+/** Viewport width, in baseline pixels, below which navigation becomes the drawer. */+export const DRAWER_MAX_WIDTH = 768;++/**+ * Below this artifacts render as a fixed sheet rather than a resizable panel. Every+ * layout owner reads this one value: `Artifacts` positions itself, while its two hosts+ * decide whether to reserve a panel for it, so a threshold they did not share left the+ * conversation squeezed beside an empty panel with the sheet overlaying the viewport.+ */+export const ARTIFACTS_SHEET_MAX_WIDTH = 868;++const BASE_FONT_SIZE = 16;++/**+ * Deliberately not `getRemScale` from `@librechat/client`: this module is pulled in by+ * `~/store`, which nearly every suite loads, and many of them replace that package with+ * a partial mock. React consumers go through `useDrawerViewport`, which does use the+ * shared hook.+ */+const readRemScale = (): number => {+ if (typeof document === 'undefined' || typeof getComputedStyle !== 'function') {+ return 1;+ }+ const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);+ return Number.isFinite(rootFontSize) && rootFontSize > 0 ? rootFontSize / BASE_FONT_SIZE : 1;+};++/**+ * Layouts here are sized in rem, so a breakpoint has to compare the viewport in the same+ * units. Every consumer of a given breakpoint builds its query from here: a hook that+ * owns a layout's state and the controls that reveal its affordances have to agree, or a+ * viewport between the fixed and scaled breakpoints picks the wide layout while its+ * rem-sized contents no longer fit the space that layout gives them.+ */+export const scaledMaxWidthQuery = (baselinePx: number, remScale: number): string =>+ `(max-width: ${baselinePx * remScale}px)`;++export const drawerMediaQuery = (remScale: number): string =>+ scaledMaxWidthQuery(DRAWER_MAX_WIDTH, remScale);++/** Read synchronously where a hook cannot run: `useMediaQuery` only resolves after paint. */+export const isDrawerViewport = (): boolean =>+ typeof window !== 'undefined' && window.matchMedia(drawerMediaQuery(readRemScale())).matches;diff --git a/client/src/utils/index.ts b/client/src/utils/index.tsindex 7d6a691185..3ca170582e 100644--- a/client/src/utils/index.ts+++ b/client/src/utils/index.ts@@ -101,16 +101,16 @@ export const removeFocusOutlines = '';export const removeFocusRings = 'focus:outline-hidden focus:ring-0 focus:ring-offset-0';export const cardStyle =- 'transition-colors rounded-md min-w-[75px] border border-border-medium font-normal bg-surface-secondary hover:bg-surface-hover text-text-primary focus:outline-hidden data-[state=open]:bg-surface-hover';+ 'transition-colors rounded-md min-w-[4.6875rem] border border-border-medium font-normal bg-surface-secondary hover:bg-surface-hover text-text-primary focus:outline-hidden data-[state=open]:bg-surface-hover';export const defaultTextProps =- 'rounded-md border border-border-light focus:border-border-heavy focus:bg-surface-secondary bg-transparent text-sm text-text-primary shadow-[0_0_10px_rgba(0,0,0,0.05)] outline-hidden focus-within:placeholder:text-text-primary focus:placeholder:text-text-primary placeholder:text-text-secondary focus:outline-hidden focus:ring-text-primary/20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50';+ 'rounded-md border border-border-light focus:border-border-heavy focus:bg-surface-secondary bg-transparent text-sm text-text-primary shadow-[0_0_0.625rem_rgba(0,0,0,0.05)] outline-hidden focus-within:placeholder:text-text-primary focus:placeholder:text-text-primary placeholder:text-text-secondary focus:outline-hidden focus:ring-text-primary/20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50';export const optionText ='p-0 shadow-none text-right pr-1 h-8 border-transparent hover:bg-surface-hover transition-colors';export const defaultTextPropsLabel =- 'rounded-md border border-border-medium bg-transparent text-sm text-text-primary shadow-[0_0_10px_rgba(0,0,0,0.10)] outline-hidden focus-within:placeholder:text-text-primary focus:placeholder:text-text-primary placeholder:text-text-secondary focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50';+ 'rounded-md border border-border-medium bg-transparent text-sm text-text-primary shadow-[0_0_0.625rem_rgba(0,0,0,0.10)] outline-hidden focus-within:placeholder:text-text-primary focus:placeholder:text-text-primary placeholder:text-text-secondary focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50';export function capitalizeFirstLetter(string: string) {return string.charAt(0).toUpperCase() + string.slice(1);diff --git a/e2e/specs/mock/scenarios/ui-scale-layout.spec.ts b/e2e/specs/mock/scenarios/ui-scale-layout.spec.tsnew file mode 100644index 0000000000..87170afc4c--- /dev/null+++ b/e2e/specs/mock/scenarios/ui-scale-layout.spec.ts@@ -0,0 +1,247 @@+import { randomUUID } from 'crypto';+import { expect, test } from '@playwright/test';+import type { Locator, Page } from '@playwright/test';+import { getE2EUser } from '../../../setup/user';+import { clearUserConversations, deleteConversations, seedConversations } from '../db';+import {+ BASE_FONT_PX,+ MAX_SCALE,+ MIN_SCALE,+ accountButton,+ appearanceCard,+ closeSettingsButton,+ conversationRow,+ decreaseButton,+ documentOverflowsHorizontally,+ expectRootFontPx,+ increaseButton,+ openAppearanceSettings,+ pressStepper,+ rootFontPx,+ visible,+ withCollapsedSidebar,+ withStoredScale,+} from './ui-scale.helpers';++/**+ * Scaling the interface moves every boundary in it at once: the drawer/rail+ * breakpoint, the width available to a row of controls, the anchor of a portaled+ * menu, the intrinsic size of an avatar, and the measured height of a+ * virtualized row. These scenarios pin the observations a person makes at the+ * top of the range, where all of those are tightest.+ */++async function box(locator: Locator) {+ const bounds = await locator.boundingBox();+ expect(bounds, 'element should be laid out').not.toBeNull();+ return bounds!;+}++/** Left and right slack between a control and the card that must contain it. */+async function slackInsideCard(control: Locator) {+ return control.evaluate((element) => {+ const card = element.closest('section');+ if (!card) {+ throw new Error('the control is not inside a settings card');+ }+ const control_ = element.getBoundingClientRect();+ const outer = card.getBoundingClientRect();+ return { left: control_.left - outer.left, right: outer.right - control_.right };+ });+}++test.describe('UI scale layout', () => {+ test('Settings stays open when a step crosses the drawer breakpoint @scenario:ui-scale-settings-survives-the-drawer-breakpoint', async ({+ page,+ }) => {+ /* 800px wide: at 150% the drawer query (768px baseline, scaled) matches, at+ 100% it does not, so stepping down crosses the layout mode while the panel+ that owns the stepper is open. The panel used to be mounted by the account+ menu, which the crossing unmounted, closing Settings mid-interaction. */+ await page.setViewportSize({ width: 800, height: 900 });+ await withStoredScale(page, MAX_SCALE);+ await withCollapsedSidebar(page);+ await page.goto('/c/new', { timeout: 10000 });+ await openAppearanceSettings(page);+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);++ await pressStepper(page, 'decrease', 3);+ await expectRootFontPx(page, BASE_FONT_PX);+ await expect(closeSettingsButton(page)).toBeVisible();+ await expect(decreaseButton(page)).toBeVisible();++ await pressStepper(page, 'increase', 3);+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);+ await expect(closeSettingsButton(page)).toBeVisible();+ await expect(increaseButton(page)).toBeVisible();++ /* Still the same dialog, still dismissible from the keyboard. */+ await page.keyboard.press('Escape');+ await expect(closeSettingsButton(page)).toBeHidden();+ });++ test('Appearance controls stay inside their card on a narrow scaled viewport @scenario:ui-scale-appearance-controls-stay-inside-their-card', async ({+ page,+ }) => {+ await page.setViewportSize({ width: 360, height: 900 });+ await withStoredScale(page, MAX_SCALE);+ await withCollapsedSidebar(page);+ await page.goto('/c/new', { timeout: 10000 });+ await openAppearanceSettings(page);+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);++ const card = appearanceCard(page);+ const controls = [+ card.getByRole('combobox').first(),+ card.getByTestId('ui-scale-decrease'),+ card.getByTestId('ui-scale-increase'),+ ];+ for (const control of controls) {+ await control.scrollIntoViewIfNeeded();+ const slack = await slackInsideCard(control);+ /* A control that overflows its card reports negative slack on that side. */+ expect(slack.left, 'control overflows the card on the left').toBeGreaterThanOrEqual(-1);+ expect(slack.right, 'control overflows the card on the right').toBeGreaterThanOrEqual(-1);+ }+ expect(await documentOverflowsHorizontally(page)).toBe(false);+ });++ test('a portaled menu opens inside the viewport at the top of the range @scenario:ui-scale-portaled-menu-stays-in-the-viewport', async ({+ page,+ }) => {+ await page.setViewportSize({ width: 520, height: 900 });+ await withStoredScale(page, MAX_SCALE);+ await withCollapsedSidebar(page);+ await page.goto('/c/new', { timeout: 10000 });+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);++ const account = await accountButton(page);+ await account.click();+ await expect(visible(page, 'nav-settings')).toBeVisible();+ const menu = page.getByRole('menu', { name: 'Account Settings' });+ const bounds = await box(menu);+ const viewport = page.viewportSize()!;+ /* The menu is portaled to the body, so a scale that fed layout through a+ transform instead of the root font size would leave it anchored off the+ viewport, or force the document to scroll sideways. */+ expect(bounds.x).toBeGreaterThanOrEqual(-1);+ expect(bounds.y).toBeGreaterThanOrEqual(-1);+ expect(bounds.x + bounds.width).toBeLessThanOrEqual(viewport.width + 1);+ expect(bounds.y + bounds.height).toBeLessThanOrEqual(viewport.height + 1);+ expect(await documentOverflowsHorizontally(page)).toBe(false);+ });++ test('the one-line composer fits its padding at both ends of the range @scenario:ui-scale-composer-fits-at-both-range-ends', async ({+ page,+ }) => {+ const composer = page.getByRole('textbox', { name: 'Message input' });+ const measure = () =>+ composer.evaluate((element) => {+ const style = getComputedStyle(element);+ return {+ height: element.clientHeight,+ scrollHeight: element.scrollHeight,+ paddingTop: parseFloat(style.paddingTop),+ };+ });++ /* Written into the live page and reloaded rather than seeded by init+ scripts: two init scripts writing the same key run in no defined order. */+ const reloadAtScale = async (scale: number) => {+ await page.evaluate((value) => {+ window.localStorage.setItem('uiScale', JSON.stringify(value));+ }, scale);+ await page.reload({ timeout: 15000 });+ await expect(composer).toBeVisible({ timeout: 20000 });+ await expectRootFontPx(page, BASE_FONT_PX * scale);+ };++ await page.goto('/c/new', { timeout: 10000 });+ await reloadAtScale(MIN_SCALE);+ const small = await measure();++ await reloadAtScale(MAX_SCALE);+ const large = await measure();++ /* The height is set from the scale in JS; padding left in px would outgrow+ it at the bottom of the range and make an empty composer scroll. */+ for (const sample of [small, large]) {+ expect(sample.scrollHeight, 'an empty composer should not scroll').toBeLessThanOrEqual(+ sample.height + 1,+ );+ }+ expect(large.paddingTop / small.paddingTop).toBeCloseTo(MAX_SCALE / MIN_SCALE, 1);+ });++ test('the account avatar grows square with the scale @scenario:ui-scale-avatar-keeps-its-shape', async ({+ page,+ }) => {+ const avatarBox = async (current: Page) => {+ const account = await accountButton(current);+ return box(account.locator('div.rounded-full, img').first());+ };++ await page.goto('/c/new', { timeout: 10000 });+ await expectRootFontPx(page, BASE_FONT_PX);+ const unscaled = await avatarBox(page);+ expect(+ Math.abs(unscaled.width - unscaled.height),+ 'avatar should be square',+ ).toBeLessThanOrEqual(1);++ await withStoredScale(page, MAX_SCALE);+ await page.reload({ timeout: 15000 });+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);+ const scaled = await avatarBox(page);++ /* A pixel-sized avatar in a scaled flex row gets squeezed into an ellipse;+ an unscaled one stays the same size while its neighbours grow. */+ expect(Math.abs(scaled.width - scaled.height), 'avatar should stay square').toBeLessThanOrEqual(+ 1,+ );+ expect(scaled.height / unscaled.height).toBeGreaterThan(1.35);+ expect(scaled.height / unscaled.height).toBeLessThan(1.65);+ });++ test('virtualized conversation rows are remeasured for the new scale @scenario:ui-scale-conversation-rows-are-remeasured', async ({+ page,+ }) => {+ const user = getE2EUser();+ const conversationIds = [randomUUID(), randomUUID(), randomUUID()];+ await clearUserConversations(user.email);+ await seedConversations(+ user.email,+ conversationIds.map((conversationId, index) => ({+ conversationId,+ title: `Scaled row ${index + 1}`,+ updatedAt: new Date(),+ })),+ );++ try {+ await page.goto('/c/new', { timeout: 10000 });+ /* Below the drawer breakpoint the list lives in a drawer that is not+ painted while closed, so the row is reached through it. */+ let firstRow = await conversationRow(page, 'Scaled row 1');+ const unscaledFont = await rootFontPx(page);+ const unscaled = await box(firstRow);++ await withStoredScale(page, MAX_SCALE);+ await page.reload({ timeout: 15000 });+ firstRow = await conversationRow(page, 'Scaled row 1');+ await expectRootFontPx(page, unscaledFont * MAX_SCALE);+ const scaled = await box(firstRow);++ /* The rows are measured into a CellMeasurerCache; a cache that is not+ invalidated on a scale change keeps the old heights and clips the+ now-larger titles. */+ expect(scaled.height / unscaled.height).toBeGreaterThan(1.25);+ const clipped = await firstRow.evaluate(+ (element) => element.scrollHeight > element.clientHeight + 1,+ );+ expect(clipped, 'the scaled row clips its own content').toBe(false);+ } finally {+ await deleteConversations(conversationIds);+ }+ });+});diff --git a/e2e/specs/mock/scenarios/ui-scale-persistence.spec.ts b/e2e/specs/mock/scenarios/ui-scale-persistence.spec.tsnew file mode 100644index 0000000000..7f476dab72--- /dev/null+++ b/e2e/specs/mock/scenarios/ui-scale-persistence.spec.ts@@ -0,0 +1,126 @@+import { randomUUID } from 'crypto';+import { expect, test } from '@playwright/test';+import type { Page } from '@playwright/test';+import { getE2EUser } from '../../../setup/user';+import { clearUserConversations, deleteConversations, seedConversations } from '../db';+import {+ BASE_FONT_PX,+ MAX_SCALE,+ expectRootFontPx,+ conversationRow,+ withStoredScale,+} from './ui-scale.helpers';++/**+ * The scale is a persisted preference, not a session toggle: it has to be in+ * force on the first frame the interface paints, survive a reload and in-app+ * navigation, and compose with (never replace) the reader's own browser font+ * size preference.+ */++type PaintSample = { fontSize: string; painted: boolean };++/**+ * Sample the root font size on every frame from before the document runs, next+ * to whether the app has painted anything yet. "No flash at the wrong size" is+ * exactly the claim that no painted frame was ever unscaled.+ */+async function recordPaintSamples(page: Page) {+ await page.addInitScript(() => {+ const samples: { fontSize: string; painted: boolean }[] = [];+ window.__uiScalePaintSamples = samples;+ const tick = () => {+ const root = document.getElementById('root');+ samples.push({+ fontSize: getComputedStyle(document.documentElement).fontSize,+ painted: !!root && root.childElementCount > 0,+ });+ if (samples.length < 600) {+ requestAnimationFrame(tick);+ }+ };+ requestAnimationFrame(tick);+ });+}++async function paintSamples(page: Page): Promise<PaintSample[]> {+ return page.evaluate(() => window.__uiScalePaintSamples ?? []);+}++declare global {+ interface Window {+ /** Frame-by-frame root font size and paint state, for the first-paint scenario. */+ __uiScalePaintSamples?: { fontSize: string; painted: boolean }[];+ }+}++test.describe('UI scale persistence', () => {+ test('a scaled interface never paints an unscaled frame @scenario:ui-scale-never-paints-an-unscaled-frame', async ({+ page,+ }) => {+ await withStoredScale(page, MAX_SCALE);+ await recordPaintSamples(page);+ await page.goto('/c/new', { timeout: 10000 });+ await expect(page.getByRole('textbox', { name: 'Message input' })).toBeVisible({+ timeout: 20000,+ });+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);++ const samples = await paintSamples(page);+ const painted = samples.filter((sample) => sample.painted);+ expect(painted.length).toBeGreaterThan(0);+ /* Every frame that had interface in it was already at 24px. A late bootstrap+ would leave 16px frames in here, which is the flash this guards. */+ expect([...new Set(painted.map((sample) => sample.fontSize))]).toEqual(['24px']);+ });++ test('the scale survives a reload and in-app navigation @scenario:ui-scale-survives-reload-and-navigation', async ({+ page,+ }) => {+ const user = getE2EUser();+ const conversationId = randomUUID();+ await clearUserConversations(user.email);+ await seedConversations(user.email, [+ { conversationId, title: 'Scaled navigation target', updatedAt: new Date() },+ ]);++ try {+ await withStoredScale(page, MAX_SCALE);+ await page.goto('/c/new', { timeout: 10000 });+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);++ await page.reload({ timeout: 15000 });+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);++ /* Navigating inside the SPA re-mounts the shell; the scale lives above it.+ Below the drawer breakpoint the list is behind the drawer. */+ const row = await conversationRow(page, 'Scaled navigation target');+ await row.click();+ await expect(page).toHaveURL(new RegExp(`/c/${conversationId}$`));+ await expectRootFontPx(page, BASE_FONT_PX * MAX_SCALE);+ } finally {+ await deleteConversations([conversationId]);+ }+ });++ test("the scale multiplies the reader's own font size instead of replacing it @scenario:ui-scale-keeps-the-browser-font-preference", async ({+ page,+ browserName,+ }) => {+ test.skip(browserName !== 'chromium', 'the font-size preference is set over CDP');++ await withStoredScale(page, MAX_SCALE);+ const cdp = await page.context().newCDPSession(page);+ /* A reader who has set their browser's default text size to 20px. */+ await cdp.send('Page.setFontSizes', { fontSizes: { standard: 20, fixed: 13 } });++ await page.goto('/c/new', { timeout: 10000 });+ await expect(page.getByRole('textbox', { name: 'Message input' })).toBeVisible({+ timeout: 20000,+ });+ /* 20px preference x 150% scale. Hard-coding 16px in the root rule would+ silently discard the preference and land on 24px. */+ await expectRootFontPx(page, 30);+ await cdp.detach();+ });+});diff --git a/e2e/specs/mock/scenarios/ui-scale-stepper.spec.ts b/e2e/specs/mock/scenarios/ui-scale-stepper.spec.tsnew file mode 100644index 0000000000..01e11bafe0--- /dev/null+++ b/e2e/specs/mock/scenarios/ui-scale-stepper.spec.ts@@ -0,0 +1,100 @@+import { expect, test } from '@playwright/test';+import {+ BASE_FONT_PX,+ decreaseButton,+ expectRootFontPx,+ increaseButton,+ openAppearanceSettings,+ pressStepper,+ recordRootFontChanges,+ recordedRootFontChanges,+ scaleReadout,+ withStoredScale,+} from './ui-scale.helpers';++/**+ * Settings > General > Appearance > UI scale is a stepper over the browser's own+ * Ctrl -/+ ladder. Its contract is about what the person operating it sees: the+ * readout answers the click straight away, the interface itself reflows once the+ * clicking stops, the ends of the range are dead, and a value that is not on a+ * stop is stepped back onto one.+ */++test.describe('UI scale stepper', () => {+ test('the readout answers a step before the interface reflows @scenario:ui-scale-readout-answers-each-step', async ({+ page,+ }) => {+ await page.goto('/c/new', { timeout: 10000 });+ await openAppearanceSettings(page);+ await expect(scaleReadout(page)).toHaveText('100%');++ await increaseButton(page).click();+ /* The readout is the acknowledgement; the reflow is deliberately held back,+ so the next stop is readable while the layout is still at the old size. */+ await expect(scaleReadout(page)).toHaveText('110%');++ await expectRootFontPx(page, BASE_FONT_PX * 1.1);+ await expect(scaleReadout(page)).toHaveText('110%');++ await decreaseButton(page).click();+ await expect(scaleReadout(page)).toHaveText('100%');+ await expectRootFontPx(page, BASE_FONT_PX);+ });++ test('a burst of steps reflows once, at the last stop @scenario:ui-scale-burst-of-steps-reflows-once', async ({+ page,+ }) => {+ await page.goto('/c/new', { timeout: 10000 });+ await openAppearanceSettings(page);+ await expect(scaleReadout(page)).toHaveText('100%');++ await recordRootFontChanges(page);+ /* 100 -> 110 -> 125. Keyboard steps stay inside the coalescing window, so+ the intermediate 110% must never reach the page. */+ await pressStepper(page, 'increase', 2);+ await expect(scaleReadout(page)).toHaveText('125%');++ await expectRootFontPx(page, BASE_FONT_PX * 1.25);+ expect(await recordedRootFontChanges(page)).toEqual(['16px', '20px']);+ });++ test('the stepper is dead at both ends of its range @scenario:ui-scale-stops-at-both-range-ends', async ({+ page,+ }) => {+ await withStoredScale(page, 0.5);+ await page.goto('/c/new', { timeout: 10000 });+ await openAppearanceSettings(page);++ await expect(scaleReadout(page)).toHaveText('50%');+ await expect(decreaseButton(page)).toBeDisabled();+ await expect(increaseButton(page)).toBeEnabled();+ await expectRootFontPx(page, BASE_FONT_PX * 0.5);++ /* Eight stops from 50% to 150%; the top has to stop offering more. */+ await pressStepper(page, 'increase', 8);+ await expect(scaleReadout(page)).toHaveText('150%');+ await expectRootFontPx(page, BASE_FONT_PX * 1.5);+ await expect(increaseButton(page)).toBeDisabled();+ await expect(decreaseButton(page)).toBeEnabled();+ });++ test('a stored value off the ladder steps back onto it @scenario:ui-scale-off-stop-value-snaps-to-a-stop', async ({+ page,+ }) => {+ /* Nothing in the UI can produce 137%; a hand-edited or migrated value can. */+ await withStoredScale(page, 1.37);+ await page.goto('/c/new', { timeout: 10000 });+ await expectRootFontPx(page, BASE_FONT_PX * 1.37);++ await openAppearanceSettings(page);+ await expect(scaleReadout(page)).toHaveText('137%');++ await decreaseButton(page).click();+ await expect(scaleReadout(page)).toHaveText('125%');+ await expectRootFontPx(page, BASE_FONT_PX * 1.25);++ await increaseButton(page).click();+ await expect(scaleReadout(page)).toHaveText('150%');+ await expectRootFontPx(page, BASE_FONT_PX * 1.5);+ });+});diff --git a/e2e/specs/mock/scenarios/ui-scale.helpers.ts b/e2e/specs/mock/scenarios/ui-scale.helpers.tsnew file mode 100644index 0000000000..76e94d49ff--- /dev/null+++ b/e2e/specs/mock/scenarios/ui-scale.helpers.ts@@ -0,0 +1,229 @@+import { expect } from '@playwright/test';+import type { Locator, Page } from '@playwright/test';++/**+ * Helpers for the UI scale scenarios.+ *+ * The scale is one number in `localStorage.uiScale`, read by the pre-paint+ * bootstrap in `client/index.html` and by the `uiScaleAtom`, and applied as the+ * `--ui-scale` custom property that `style.css` feeds into the root font size.+ * Every assertion here therefore reads a *rendered* size, never the stored+ * value: the stored number proving nothing is the whole reason these scenarios+ * exist.+ *+ * The shell mounts the account menu twice, once in the desktop rail, once in+ * the mobile drawer header, and both are in the DOM at every viewport, so+ * every shell control is addressed through `visible()` rather than by test id+ * alone, which would be a strict-mode violation.+ */++/** Root font size with no scale applied and no browser font preference set. */+export const BASE_FONT_PX = 16;++export const MAX_SCALE = 1.5;+export const MIN_SCALE = 0.5;++/** The one rendered instance of a shell control that exists at both viewports. */+export const visible = (page: Page, testId: string): Locator =>+ page.locator(`[data-testid="${testId}"]:visible`).first();++/** Seed the persisted preference before the app boots, the way a returning user arrives. */+export async function withStoredScale(page: Page, scale: number) {+ await page.addInitScript((value) => {+ window.localStorage.setItem('uiScale', JSON.stringify(value));+ }, scale);+}++/** Collapse the sidebar before boot so the drawer/rail scenarios start from a known state. */+export async function withCollapsedSidebar(page: Page) {+ await page.addInitScript(() => {+ window.localStorage.setItem('unifiedSidebarExpanded', 'false');+ });+}++export async function rootFontPx(page: Page): Promise<number> {+ return page.evaluate(() => parseFloat(getComputedStyle(document.documentElement).fontSize));+}++/** The rendered root font size, polled: the stepper defers reflow past the click. */+export async function expectRootFontPx(page: Page, expected: number) {+ await expect+ .poll(() => rootFontPx(page), { message: `root font size should settle at ${expected}px` })+ .toBeCloseTo(expected, 1);+}++/**+ * The candidate that is actually on screen. The collapsed rail stays rendered+ * and CSS-visible while translated off-canvas, so "visible" alone can hand back+ * a control no one can click.+ */+async function reachable(page: Page, candidates: Locator): Promise<Locator | null> {+ const viewport = page.viewportSize();+ if (!viewport) {+ return null;+ }+ const count = await candidates.count();+ for (let index = 0; index < count; index++) {+ const candidate = candidates.nth(index);+ const bounds = await candidate.boundingBox();+ /* Intersection, not containment: the off-canvas rail sits entirely beside+ the viewport, while an on-screen control may legitimately bleed a pixel. */+ if (+ bounds &&+ bounds.width > 0 &&+ bounds.height > 0 &&+ bounds.x + bounds.width > 0 &&+ bounds.y + bounds.height > 0 &&+ bounds.x < viewport.width &&+ bounds.y < viewport.height+ ) {+ return candidate;+ }+ }+ return null;+}++/**+ * Wait until one of `candidates` is on screen, opening the sidebar whenever a+ * control for it is offered. Below the (scale-aware) drawer breakpoint the whole+ * sidebar is a drawer, and the control that opens it is published under+ * different test ids by the rail and by the chat header; the accessible name is+ * the one thing both share. The opener is also mounted a beat after first paint,+ * so the attempt has to be repeated rather than made once.+ */+async function reachableInSidebar(+ page: Page,+ candidates: Locator,+ label: string,+): Promise<Locator> {+ let found: Locator | null = null;+ await expect+ .poll(+ async () => {+ found = await reachable(page, candidates);+ if (found) {+ return true;+ }+ /* Once the drawer is open its opener goes off-canvas, so this stops+ clicking by itself rather than toggling the drawer back shut. */+ const opener = await reachable(+ page,+ page.getByRole('button', { name: 'Open sidebar', exact: true }),+ );+ await opener?.click().catch(() => undefined);+ return false;+ },+ { message: `${label} should come on screen`, timeout: 30000 },+ )+ .toBe(true);+ if (!found) {+ throw new Error(`${label} never became reachable`);+ }+ return found;+}++/** The account menu button, opening the drawer if that is where it lives. */+export async function accountButton(page: Page): Promise<Locator> {+ return reachableInSidebar(+ page,+ page.locator('[data-testid="nav-user"]'),+ 'the account menu button',+ );+}++/** A conversation row in the sidebar list, by its title. */+export async function conversationRow(page: Page, title: string): Promise<Locator> {+ return reachableInSidebar(+ page,+ page.locator('[data-testid="convo-item"]').filter({ hasText: title }),+ `the conversation row "${title}"`,+ );+}++/** Open Settings from the account menu. */+export async function openSettings(page: Page) {+ const account = await accountButton(page);+ await account.click();+ await visible(page, 'nav-settings').click();+ await expect(closeSettingsButton(page)).toBeVisible();+}++/**+ * Open Settings and land on General > Appearance. Below the drawer breakpoint the+ * panel opens on its tab list and needs the tab picked; above it the tab is+ * already selected and clicking it is a no-op.+ */+export async function openAppearanceSettings(page: Page) {+ await openSettings(page);+ const general = page.getByRole('tab', { name: 'General', exact: true });+ if (await general.isVisible().catch(() => false)) {+ await general.click();+ }+ await expect(decreaseButton(page)).toBeVisible();+}++export const closeSettingsButton = (page: Page) =>+ page.getByRole('button', { name: 'Close Settings', exact: true });++export const decreaseButton = (page: Page) => visible(page, 'ui-scale-decrease');+export const increaseButton = (page: Page) => visible(page, 'ui-scale-increase');++/** The stepper's own readout, the number a person reads back after stepping. */+export const scaleReadout = (page: Page) =>+ page+ .locator('[aria-labelledby="ui-scale-selector-label"]')+ .locator('span[aria-live="polite"]')+ .first();++/** The Appearance card that holds the scale stepper and its sibling controls. */+export const appearanceCard = (page: Page) =>+ page.locator('section').filter({ has: page.locator('[data-testid="ui-scale-decrease"]') });++declare global {+ interface Window {+ /** Root font sizes painted since `recordRootFontChanges`, in order. */+ __uiScaleSizes?: string[];+ }+}++/**+ * Record every *change* in the rendered root font size from now on. The stepper+ * promises a rapid burst of steps reflows once, which is only observable as the+ * sequence of sizes the page actually painted.+ */+export async function recordRootFontChanges(page: Page) {+ await page.evaluate(() => {+ const sizes: string[] = [];+ window.__uiScaleSizes = sizes;+ const tick = () => {+ const size = getComputedStyle(document.documentElement).fontSize;+ if (sizes[sizes.length - 1] !== size) {+ sizes.push(size);+ }+ requestAnimationFrame(tick);+ };+ tick();+ });+}++export async function recordedRootFontChanges(page: Page): Promise<string[]> {+ return page.evaluate(() => window.__uiScaleSizes ?? []);+}++/** Horizontal overflow of the document, which a scaled layout must not introduce. */+export async function documentOverflowsHorizontally(page: Page): Promise<boolean> {+ return page.evaluate(() => {+ const root = document.documentElement;+ return root.scrollWidth > root.clientWidth + 1;+ });+}++/** Press a stepper button through the keyboard, which is faster than a click+ * round-trip and keeps a burst of steps inside the coalescing window. */+export async function pressStepper(page: Page, button: 'increase' | 'decrease', times: number) {+ const target = button === 'increase' ? increaseButton(page) : decreaseButton(page);+ await target.focus();+ for (let i = 0; i < times; i++) {+ await page.keyboard.press('Enter');+ }+}diff --git a/eslint-suppressions.json b/eslint-suppressions.jsonindex 20810f96e9..58ed82e8d7 100644--- a/eslint-suppressions.json+++ b/eslint-suppressions.json@@ -148,7 +148,7 @@},"client/src/components/Chat/Footer.tsx": {"shadcn/no-arbitrary-values": {- "count": 2+ "count": 1}},"client/src/components/Chat/Input/AddedConvo.tsx": {@@ -163,7 +163,7 @@},"client/src/components/Chat/Input/ChatForm.tsx": {"shadcn/no-arbitrary-values": {- "count": 4+ "count": 3},"shadcn/no-inline-styles": {"count": 3@@ -265,9 +265,6 @@}},"client/src/components/Chat/Input/OptionsPopover.tsx": {- "shadcn/no-arbitrary-values": {- "count": 1- },"shadcn/no-restyle": {"count": 5}@@ -577,7 +574,7 @@},"client/src/components/Chat/Messages/Content/Parts/Summary.tsx": {"shadcn/no-arbitrary-values": {- "count": 2+ "count": 1},"shadcn/no-inline-styles": {"count": 1@@ -595,9 +592,6 @@}},"client/src/components/Chat/Messages/Content/Parts/Thinking.tsx": {- "shadcn/no-arbitrary-values": {- "count": 1- },"shadcn/no-inline-styles": {"count": 1}@@ -816,9 +810,6 @@}},"client/src/components/Chat/Subagents/SubagentActivity.tsx": {- "shadcn/no-arbitrary-values": {- "count": 1- },"shadcn/no-restyle": {"count": 13},@@ -1411,9 +1402,6 @@}},"client/src/components/Prompts/sidebar/GroupSidePanel.tsx": {- "shadcn/no-arbitrary-values": {- "count": 1- },"shadcn/no-restyle": {"count": 11}diff --git a/packages/client/src/components/Avatar.tsx b/packages/client/src/components/Avatar.tsxindex ecb344d707..90c16b0550 100644--- a/packages/client/src/components/Avatar.tsx+++ b/packages/client/src/components/Avatar.tsx@@ -2,6 +2,7 @@ import React, { useState, useMemo, useCallback } from 'react';import type { TUser } from 'librechat-data-provider';import { Skeleton } from './Skeleton';import { useAvatar } from '~/hooks';+import { pxToRem } from '~/utils';import { UserIcon } from '~/svgs';export interface AvatarProps {@@ -51,8 +52,8 @@ const Avatar: React.FC<AvatarProps> = ({() => (<divstyle={{- width: `${size}px`,- height: `${size}px`,+ width: pxToRem(size),+ height: pxToRem(size),}}className={`bg-avatar-fill text-avatar-text ring-avatar-edge/10 relative flex items-center justify-center rounded-full p-1 ring-1 ${className}`}aria-hidden="true"@@ -69,15 +70,18 @@ const Avatar: React.FC<AvatarProps> = ({if (avatarSeed.length > 0 && !imageError) {return (- <div className="relative" style={{ width: `${size}px`, height: `${size}px` }}>+ <div className="relative" style={{ width: pxToRem(size), height: pxToRem(size) }}>{!imageLoaded && (- <Skeleton className="rounded-full" style={{ width: `${size}px`, height: `${size}px` }} />+ <Skeleton+ className="rounded-full"+ style={{ width: pxToRem(size), height: pxToRem(size) }}+ />)}<imgstyle={{- width: `${size}px`,- height: `${size}px`,+ width: pxToRem(size),+ height: pxToRem(size),display: imageLoaded ? 'block' : 'none',}}className={`rounded-full ${className}`}diff --git a/packages/client/src/components/Composer.tsx b/packages/client/src/components/Composer.tsxindex bf42fe6050..97a91a829e 100644--- a/packages/client/src/components/Composer.tsx+++ b/packages/client/src/components/Composer.tsx@@ -138,7 +138,7 @@ const Composer: ForwardRefExoticComponent<data-testid="composer-send-button"className={cn(CONTROL_CLASS, offeredActions.length > 0 && 'ml-auto')}>- <SendIcon size={24} />+ <SendIcon className="size-6" /></button>);@@ -198,7 +198,7 @@ const Composer: ForwardRefExoticComponent</** Main chat's own field metrics (`ChatForm`'s `baseClasses`), so the* two composers stand the same height and their surfaces line up* when this panel is open beside the thread. */- className="text-text-primary placeholder:text-text-tertiary m-0 w-full resize-none bg-transparent px-3 py-[13px] focus:outline-hidden disabled:cursor-not-allowed md:py-3.5"+ className="text-text-primary placeholder:text-text-tertiary m-0 w-full resize-none bg-transparent px-3 py-[0.8125rem] focus:outline-hidden disabled:cursor-not-allowed md:py-3.5"/>{/* The row holds its height whether or not it carries secondary actions,so the surface cannot resize as a run changes what it offers. */}diff --git a/packages/client/src/components/ControlCombobox.spec.tsx b/packages/client/src/components/ControlCombobox.spec.tsxindex f055b0df09..31a253bb95 100644--- a/packages/client/src/components/ControlCombobox.spec.tsx+++ b/packages/client/src/components/ControlCombobox.spec.tsx@@ -313,20 +313,20 @@ describe('ControlCombobox dropdown caps', () => {renderCapped();openPopover();const popover = document.querySelector('.animate-popover') as HTMLElement;- expect(popover.style.maxHeight).toBe('min(480px, var(--popover-available-height, 480px))');+ expect(popover.style.maxHeight).toBe('min(30rem, var(--popover-available-height, 30rem))');expect(popover.className).toContain('flex-col');const scroller = popover.querySelector('div.overflow-auto');expect(scroller?.className).toContain('flex-1');expect(scroller?.className).toContain('min-h-0');});- it('keeps the fixed 300px list cap for consumers that pass neither prop', () => {+ it('keeps the fixed list cap (300px at 100% scale) for consumers that pass neither prop', () => {renderCapped({ popoverMaxHeight: undefined, unsearchedLimit: undefined });openPopover();const popover = document.querySelector('.animate-popover') as HTMLElement;expect(popover.style.maxHeight).toBe('');const scroller = popover.querySelector('div.overflow-auto');- expect(scroller?.className).toContain('max-h-[300px]');+ expect(scroller?.className).toContain('max-h-[18.75rem]');expect(screen.getAllByRole('option')[0]).toHaveAttribute('aria-setsize', '15');});});diff --git a/packages/client/src/components/ControlCombobox.tsx b/packages/client/src/components/ControlCombobox.tsxindex 2d3820843b..87adbc5178 100644--- a/packages/client/src/components/ControlCombobox.tsx+++ b/packages/client/src/components/ControlCombobox.tsx@@ -5,10 +5,11 @@ import { Search, ChevronDown } from 'lucide-react';import { SelectRenderer } from '@ariakit/react-components/select/select-renderer';import type { OptionWithIcon } from '~/common';import { usePopoverZIndex } from './OriginalDialog';+import useRemScale from '~/hooks/useRemScale';import { fieldControl } from './Field';import './AnimatePopover.css';import { JSX } from 'react/jsx-runtime';-import { cn } from '~/utils';+import { cn, pxToRem } from '~/utils';interface ControlComboboxProps {selectedValue: string;@@ -92,9 +93,10 @@ function ControlCombobox({onOpenChange,}: ControlComboboxProps): JSX.Element {const [searchValue, setSearchValue] = useState('');+ const remScale = useRemScale();const buttonRef = useRef<HTMLButtonElement>(null);const [buttonWidth, setButtonWidth] = useState<number | null>(null);- const popoverWidth = isCollapsed ? '300px' : (buttonWidth ?? '300px');+ const popoverWidth = isCollapsed ? '18.75rem' : (buttonWidth ?? '18.75rem');const popoverZIndex = usePopoverZIndex();const getItem = (option: OptionWithIcon) => ({@@ -250,12 +252,16 @@ function ControlCombobox({* placement, so a short viewport shrinks the cap instead of pushing* lower options offscreen; the fallback keeps the cap when the* variable is absent. */+ /** The preferred width is expressed in rem, so it grows with the UI scale+ * past narrow viewports. Cap it here rather than in each caller: a+ * min-width outranks a max-width, so the minimum has to carry the cap. */+ maxWidth: '90vw',maxHeight:popoverMaxHeight != null- ? `min(${popoverMaxHeight}px, var(--popover-available-height, ${popoverMaxHeight}px))`+ ? `min(${pxToRem(popoverMaxHeight)}, var(--popover-available-height, ${pxToRem(popoverMaxHeight)}))`: undefined,width: matchTriggerWidth ? popoverWidth : undefined,- minWidth: matchTriggerWidth ? undefined : '16rem',+ minWidth: matchTriggerWidth ? undefined : 'min(16rem, 90vw)',}}><div className="shrink-0 py-1.5">@@ -273,11 +279,16 @@ function ControlCombobox({className={cn(popoverMaxHeight != null? 'min-h-0 flex-1 overflow-auto'- : 'max-h-[300px] overflow-auto',+ : 'max-h-[18.75rem] overflow-auto',)}><Ariakit.ComboboxList store={combobox}>- <SelectRenderer store={select} items={matches} itemSize={ROW_HEIGHT} overscan={5}>+ <SelectRenderer+ store={select}+ items={matches}+ itemSize={ROW_HEIGHT * remScale}+ overscan={5}+ >{({ value, icon, label, ...item }) => (<Ariakit.ComboboxItemkey={item.id}diff --git a/packages/client/src/components/DataTable.tsx b/packages/client/src/components/DataTable.tsxindex eff19def6b..23c9190102 100644--- a/packages/client/src/components/DataTable.tsx+++ b/packages/client/src/components/DataTable.tsx@@ -46,7 +46,7 @@ const SelectionCheckbox = memo(role="button"tabIndex={0}onKeyDown={(e) => e.stopPropagation()}- className="flex h-full w-[30px] items-center justify-center"+ className="flex h-full w-[1.875rem] items-center justify-center"onClick={(e) => e.stopPropagation()}><Checkbox checked={checked} onCheckedChange={onChange} aria-label={ariaLabel} />@@ -201,7 +201,7 @@ const DeleteButton = memo(variant="outline"onClick={onDelete}disabled={disabled}- className={cn('min-w-[40px] transition-all duration-200', isSmallScreen && 'px-2 py-1')}+ className={cn('min-w-[2.5rem] transition-all duration-200', isSmallScreen && 'px-2 py-1')}aria-label={ariaLabel}>{isDeleting ? (@@ -254,7 +254,7 @@ export default function DataTable<TData, TValue>({const selectColumn = {id: 'select',header: ({ table }: { table: TTable<TData> }) => (- <div className="flex h-full w-[30px] items-center justify-center">+ <div className="flex h-full w-[1.875rem] items-center justify-center"><Checkboxchecked={table.getIsAllPageRowsSelected()}onCheckedChange={(value) => table.toggleAllPageRowsSelected(Boolean(value))}@@ -269,7 +269,7 @@ export default function DataTable<TData, TValue>({ariaLabel="Select row"/>),- meta: { size: '50px' },+ meta: { size: '3.125rem' },};return [selectColumn, ...columns];}, [columns, enableRowSelection, showCheckboxes]);@@ -464,7 +464,7 @@ export default function DataTable<TData, TValue>({><Tableunwrapped- className="w-full min-w-[300px] table-fixed border-separate border-spacing-0"+ className="w-full min-w-[18.75rem] table-fixed border-separate border-spacing-0"><TableHeader className="bg-surface-secondary sticky top-0 z-50">{table.getHeaderGroups().map((headerGroup) => (diff --git a/packages/client/src/components/DataTable/DataTable.tsx b/packages/client/src/components/DataTable/DataTable.tsxindex 860ee7e940..da877f0d04 100644--- a/packages/client/src/components/DataTable/DataTable.tsx+++ b/packages/client/src/components/DataTable/DataTable.tsx@@ -19,6 +19,7 @@ import { SelectionCheckbox, MemoizedTableRow, SkeletonRows } from './DataTableCoimport { Table, TableBody, TableHead, TableHeader, TableCell, TableRow } from '../Table';import { useMediaQuery, useLocalize } from '~/hooks';import { DataTableSearch } from './DataTableSearch';+import useRemScale from '~/hooks/useRemScale';import { MorphIcon } from '../MorphIcon';import { cn, logger } from '~/utils';import { Button } from '../Button';@@ -51,7 +52,8 @@ function DataTable<TData extends Record<string, unknown>, TValue>({customActionsRenderer,}: DataTableProps<TData, TValue>): JSX.Element {const localize = useLocalize();- const isSmallScreen = useMediaQuery('(max-width: 768px)');+ const remScale = useRemScale();+ const isSmallScreen = useMediaQuery(`(max-width: ${768 * remScale}px)`);const tableContainerRef = useRef<HTMLDivElement>(null);const scrollTimeoutRef = useRef<number | null>(null);@@ -255,7 +257,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({);},meta: {- className: 'max-w-[20px] flex-1',+ className: 'max-w-[1.25rem] flex-1',},};@@ -305,7 +307,9 @@ function DataTable<TData extends Record<string, unknown>, TValue>({(index: number) => getRowId(data[index] as TData, index),[data, getRowId],);- const estimateSize = useCallback(() => rowHeight, [rowHeight]);+ /** Rows are laid out in rem, so the virtualizer must measure in the same units. */+ const scaledRowHeight = rowHeight * remScale;+ const estimateSize = useCallback(() => scaledRowHeight, [scaledRowHeight]);const rowVirtualizer = useVirtualizer({enabled: virtualizationActive,@@ -343,7 +347,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({tableBodyContent = (<SkeletonRowscount={skeletonCount}- rowHeight={rowHeight}+ rowHeight={scaledRowHeight}columns={tableColumns as ColumnDef<Record<string, unknown>>[]}/>);@@ -369,7 +373,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({virtualIndex={virtualRow.index}selected={row.getIsSelected()}cellsVersion={cellsVersionRef.current}- style={{ height: rowHeight }}+ style={{ height: scaledRowHeight }}/>);})}@@ -391,7 +395,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({virtualIndex={row.index}selected={row.getIsSelected()}cellsVersion={cellsVersionRef.current}- style={{ height: rowHeight }}+ style={{ height: scaledRowHeight }}/>));}@@ -420,6 +424,18 @@ function DataTable<TData extends Record<string, unknown>, TValue>({}}, [debouncedTerm, filterValue, onFilterChange, setOptimizedRowSelection]);+ /** TanStack Virtual memoizes its measurements on the item-size cache, not on+ * estimateSize, so a new estimate on its own leaves the previous scale's row+ * offsets in place. measure() drops that cache and forces a recompute. */+ const measuredScaleRef = useRef(remScale);+ useEffect(() => {+ if (!virtualizationActive || measuredScaleRef.current === remScale) {+ return;+ }+ measuredScaleRef.current = remScale;+ rowVirtualizer.measure();+ }, [remScale, virtualizationActive, rowVirtualizer]);+// Recalculate virtual range when data or state changesuseEffect(() => {if (!virtualizationActive) return;@@ -598,6 +614,9 @@ function DataTable<TData extends Record<string, unknown>, TValue>({{WebkitOverflowScrolling: 'touch',overscrollBehavior: 'contain',+ /** Inherited by memoized cells and skeletons so one scaled breakpoint+ * controls every table column without rebuilding the row model. */+ '--data-table-desktop-display': isSmallScreen ? 'none' : 'table-cell',} as React.CSSProperties}role="region"@@ -634,7 +653,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({?.width;let widthStyle: React.CSSProperties = {};if (isSelectHeader) {- widthStyle = { width: '32px', maxWidth: '32px', minWidth: '32px' };+ widthStyle = { width: '2rem', maxWidth: '2rem', minWidth: '2rem' };} else if (metaWidth != null && metaWidth >= 1 && metaWidth <= 100) {widthStyle = {width: `${metaWidth}%`,@@ -710,7 +729,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({canSort && 'cursor-pointer',meta?.className,header.column.getIsResizing() && 'bg-surface-tertiary/60',- isDesktopOnly && 'hidden md:table-cell',+ isDesktopOnly && '[display:var(--data-table-desktop-display,table-cell)]',)}style={widthStyle}aria-sort={ariaSort}diff --git a/packages/client/src/components/DataTable/DataTableComponents.spec.tsx b/packages/client/src/components/DataTable/DataTableComponents.spec.tsxindex 0467b1dc31..97e14720f0 100644--- a/packages/client/src/components/DataTable/DataTableComponents.spec.tsx+++ b/packages/client/src/components/DataTable/DataTableComponents.spec.tsx@@ -236,26 +236,6 @@ describe('DataTableComponents', () => {expect(skeletons).toHaveLength(2); // One per column});- it('should apply desktopOnly class to column cells', () => {- const columns = [- { accessorKey: 'name', header: 'Name' },- { accessorKey: 'status', header: 'Status', meta: { desktopOnly: true } },- ] as TableColumn<Record<string, unknown>, unknown>[];-- render(- <table>- <tbody>- <SkeletonRows count={1} columns={columns} />- </tbody>- </table>,- );-- const cells = screen.getAllByTestId('table-cell');- // Second cell should have desktopOnly class- expect(cells[1]).toHaveClass('hidden');- expect(cells[1]).toHaveClass('md:table-cell');- });-it('should apply custom className from column meta', () => {const columns = [{ accessorKey: 'name', header: 'Name', meta: { className: 'custom-class' } },diff --git a/packages/client/src/components/DataTable/DataTableComponents.tsx b/packages/client/src/components/DataTable/DataTableComponents.tsxindex 5923b1feb6..dea3c81b78 100644--- a/packages/client/src/components/DataTable/DataTableComponents.tsx+++ b/packages/client/src/components/DataTable/DataTableComponents.tsx@@ -72,7 +72,7 @@ const TableRowComponent = <TData extends Record<string, unknown>>(const percent = meta?.width;let widthStyle: React.CSSProperties | undefined;if (cell.column.id === 'select') {- widthStyle = { width: '32px', maxWidth: '32px', minWidth: '32px' };+ widthStyle = { width: '2rem', maxWidth: '2rem', minWidth: '2rem' };} else if (percent) {widthStyle = {width: `${percent}%`,@@ -92,7 +92,7 @@ const TableRowComponent = <TData extends Record<string, unknown>>('group-hover:bg-surface-secondary-alt group-data-[state=selected]:bg-surface-active',cell.column.id === 'select' && 'w-8 p-1',meta?.className,- isDesktopOnly && 'hidden md:table-cell',+ isDesktopOnly && '[display:var(--data-table-desktop-display,table-cell)]',)}style={widthStyle}>@@ -169,7 +169,11 @@ export const SkeletonRows: React.MemoExoticComponent<<TableCellkey={columnKey}size="dense"- className={cn('px-3', meta?.className, meta?.desktopOnly && 'hidden md:table-cell')}+ className={cn(+ 'px-3',+ meta?.className,+ meta?.desktopOnly && '[display:var(--data-table-desktop-display,table-cell)]',+ )}><Skeleton className="h-6 w-full" /></TableCell>diff --git a/packages/client/src/components/Dropdown.css b/packages/client/src/components/Dropdown.cssindex acbe67ea0e..b125f9224c 100644--- a/packages/client/src/components/Dropdown.css+++ b/packages/client/src/components/Dropdown.css@@ -1,6 +1,7 @@.popover-ui {display: flex;max-height: min(var(--popover-available-height, 1700px), 1700px);+ max-width: min(calc(100vw - 1rem), var(--popover-available-width, 100vw));flex-direction: column;overflow: auto;overscroll-behavior: contain;diff --git a/packages/client/src/components/Dropdown.tsx b/packages/client/src/components/Dropdown.tsxindex 2d4736fc85..44d081d488 100644--- a/packages/client/src/components/Dropdown.tsx+++ b/packages/client/src/components/Dropdown.tsx@@ -161,7 +161,7 @@ const Dropdown: React.FC<DropdownProps> = ({);return (- <div className={cn('relative', variant === 'field' && 'w-full', className)}>+ <div className={cn('relative max-w-full min-w-0', variant === 'field' && 'w-full', className)}><Select.Selectstore={selectProps}disabled={disabled}@@ -177,7 +177,7 @@ const Dropdown: React.FC<DropdownProps> = ({/** Horizontal padding would squeeze the icon, which flex-shrinks to fit */iconOnly? 'size-theme-button min-h-theme-target min-w-theme-target justify-center px-0'- : 'w-fit gap-2 px-3',+ : 'w-fit max-w-full gap-2 px-3',variant === 'field' && fieldControl,variant === 'compact' && 'h-theme-button-compact px-2.5 py-0 text-xs transition-none',triggerClassName,@@ -193,7 +193,7 @@ const Dropdown: React.FC<DropdownProps> = ({ariaLabelledBy == null || iconOnly ? ariaLabelledBy : `${ariaLabelledBy} ${valueId}`}>- <div className={cn('flex items-center gap-2', iconOnly ? 'shrink-0' : 'w-full')}>+ <div className={cn('flex min-w-0 items-center gap-2', iconOnly ? 'shrink-0' : 'w-full')}>{icon}{!iconOnly && (<span id={valueId} className="block truncate">@@ -208,7 +208,7 @@ const Dropdown: React.FC<DropdownProps> = ({</span>)}</div>- {!iconOnly && <Select.SelectArrow />}+ {!iconOnly && <Select.SelectArrow className="shrink-0" />}</Select.Select><Select.SelectPopoverportal={portal}diff --git a/packages/client/src/components/DropdownPopup.tsx b/packages/client/src/components/DropdownPopup.tsxindex 08c27d5bb1..c42b713cca 100644--- a/packages/client/src/components/DropdownPopup.tsx+++ b/packages/client/src/components/DropdownPopup.tsx@@ -15,6 +15,8 @@ interface DropdownProps {iconClassName?: string;itemClassName?: string;sameWidth?: boolean;+ /** Preferred CSS minimum width, capped to the space available to the menu. */+ minWidth?: string;anchor?: { x: string; y: string };gutter?: number;modal?: boolean;@@ -77,6 +79,7 @@ const Menu: React.FC<MenuProps> = ({modal,portal,sameWidth,+ minWidth,gutter = 8,finalFocus,unmountOnHide,@@ -97,7 +100,14 @@ const Menu: React.FC<MenuProps> = ({finalFocus={finalFocus}unmountOnHide={unmountOnHide}preserveTabOrder={preserveTabOrder}- style={{ zIndex, ...style }}+ style={{+ zIndex,+ minWidth:+ minWidth == null+ ? undefined+ : `min(${minWidth}, calc(100vw - 1rem), var(--popover-available-width, 100vw))`,+ ...style,+ }}/* Portaled menus land beside modal OGDialog layers, which set`pointer-events: none` on body and re-enable it only on their owncontent. Without `pointer-events-auto` the menu inherits `none` and itsdiff --git a/packages/client/src/components/HoverCard.tsx b/packages/client/src/components/HoverCard.tsxindex 01bb029d45..d0e1c34d63 100644--- a/packages/client/src/components/HoverCard.tsx+++ b/packages/client/src/components/HoverCard.tsx@@ -36,7 +36,7 @@ const HoverCardContent: React.ForwardRefExoticComponent<sideOffset={sideOffset}style={{ ...nestedStyle, ...style }}className={cn(- 'border-border-light bg-surface-secondary 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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-xl border p-4 shadow-md outline-hidden',+ 'border-border-light bg-surface-secondary 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 z-50 w-64 max-w-[min(calc(100vw-1rem),var(--radix-hover-card-content-available-width))] origin-(--radix-hover-card-content-transform-origin) rounded-xl border p-4 shadow-md outline-hidden',className,)}{...props}diff --git a/packages/client/src/components/MultiSelect.tsx b/packages/client/src/components/MultiSelect.tsxindex 91a2d56416..9c41f64207 100644--- a/packages/client/src/components/MultiSelect.tsx+++ b/packages/client/src/components/MultiSelect.tsx@@ -179,8 +179,8 @@ export default function MultiSelect<T extends string>({unmountOnHidefinalFocus={selectRef}className={cn(- 'animate-popover z-40 flex max-h-[300px]',- 'flex-col overflow-hidden rounded-xl',+ 'animate-popover z-40 flex max-h-[18.75rem]',+ 'flex-col overflow-auto overscroll-contain rounded-xl','bg-surface-secondary text-text-primary px-1.5 py-1 shadow-lg','border-border-light border','outline-hidden',diff --git a/packages/client/src/components/Radio.tsx b/packages/client/src/components/Radio.tsxindex 7f59490ccf..4439eba0c0 100644--- a/packages/client/src/components/Radio.tsx+++ b/packages/client/src/components/Radio.tsx@@ -189,7 +189,7 @@ const Radio: React.NamedExoticComponent<RadioProps> = memo(function Radio({onClick={() => handleChange(option.value)}onKeyDown={(event) => handleKeyDown(event, index)}disabled={disabled}- className={`focus-visible:ring-focus-control relative z-10 flex h-[34px] items-center justify-center gap-2 rounded-md px-4 text-sm font-medium transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-hidden ${+ className={`focus-visible:ring-focus-control relative z-10 flex h-[2.125rem] items-center justify-center gap-2 rounded-md px-4 text-sm font-medium transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-hidden ${currentValue === option.value ? 'text-text-primary' : 'text-text-secondary'} ${disabled ? 'cursor-not-allowed opacity-50' : ''} ${disabledInkClasses} ${fullWidth ? 'flex-1' : ''} ${buttonClassName}`}>diff --git a/packages/client/src/components/SegmentedMeter.spec.tsx b/packages/client/src/components/SegmentedMeter.spec.tsxindex d3579fa3f8..9e9c0ae9ed 100644--- a/packages/client/src/components/SegmentedMeter.spec.tsx+++ b/packages/client/src/components/SegmentedMeter.spec.tsx@@ -24,7 +24,7 @@ const children = () => Array.from(screen.getByTestId('meter').children) as HTMLEconst sizing = (el: HTMLElement): { fraction: number; gapShare: number } => {const width = el.style.width;const fraction = Number(/([\d.]+)%/.exec(width)?.[1]) / 100;- const gapShare = Number(/-\s*([\d.]+)px/.exec(width)?.[1] ?? 0);+ const gapShare = Number(/-\s*([\d.]+)rem/.exec(width)?.[1] ?? 0);return { fraction, gapShare };};@@ -39,17 +39,17 @@ describe('SegmentedMeter', () => {it('takes the gaps out of the fill, not out of the free track', () => {renderMeter();- /** Three segments touch across two 2px gaps. Each gives up its share of that- * 4px, so fills + gaps span exactly the 76% that is actually used — a bar- * reading three-quarters full means three-quarters of the window is gone. */+ /** Three segments touch across two 0.125rem gaps. Each gives up its share of+ * that 0.25rem, so fills + gaps span exactly the 76% that is actually used:+ * a bar reading three-quarters full means three-quarters of the window is gone. */const parts = children().map(sizing);const filled = parts.reduce((sum, part) => sum + part.fraction, 0);const surrendered = parts.reduce((sum, part) => sum + part.gapShare, 0);/** Shares are rounded to 3dp on the way into the declaration. */expect(filled).toBeCloseTo(0.76, 5);- expect(surrendered).toBeCloseTo(4, 2);- parts.forEach((part) => expect(part.gapShare).toBeCloseTo((4 * part.fraction) / filled, 2));+ expect(surrendered).toBeCloseTo(0.25, 2);+ parts.forEach((part) => expect(part.gapShare).toBeCloseTo((0.25 * part.fraction) / filled, 2));});it('reserves no gap share for a lone segment', () => {@@ -61,7 +61,7 @@ describe('SegmentedMeter', () => {it('floors every rendered segment so a present category cannot vanish', () => {renderMeter({ segments: [{ id: 'tiny', value: 1, slot: 3 }], max: 1_000_000 });- expect(children()[0].style.minWidth).toBe('2px');+ expect(children()[0].style.minWidth).toBe('0.125rem');});it('drops segments that contribute nothing', () => {diff --git a/packages/client/src/components/SegmentedMeter.tsx b/packages/client/src/components/SegmentedMeter.tsxindex 047c0b1193..a4c7a3ef20 100644--- a/packages/client/src/components/SegmentedMeter.tsx+++ b/packages/client/src/components/SegmentedMeter.tsx@@ -96,9 +96,9 @@ export interface SegmentedMeterProps extends React.ComponentPropsWithoutRef<'div}/** Surface gap between touching fills, and the floor that keeps a present- * category from rendering as nothing. Both in px. */-const SEGMENT_GAP = 2;-const SEGMENT_MIN = 2;+ * category from rendering as nothing. Both in rem, matching the CSS gap. */+const SEGMENT_GAP = 0.125;+const SEGMENT_MIN = 0.125;/*** A part-to-whole meter: one tinted segment per series, free space left as@@ -111,7 +111,7 @@ const SEGMENT_MIN = 2;* The one deliberate overshoot is the {@link SEGMENT_MIN} floor: a category* present but too small to see is rounded up, and that rounding comes out of* free space, never out of a neighbouring category. It is bounded by- * `SEGMENT_MIN` per sub-pixel category — on a 288px meter, five such categories+ * `SEGMENT_MIN` per sub-pixel category. On an 18rem meter, five such categories* read about 3 percentage points fuller than the window actually is, and the* exact figures stay in the legend beside the bar.*/@@ -131,7 +131,7 @@ export const SegmentedMeter: React.ForwardRefExoticComponent<<divref={ref}className={cn(- 'flex h-2 w-full gap-[2px] overflow-hidden rounded-full bg-surface-tertiary',+ 'bg-surface-tertiary flex h-2 w-full gap-[0.125rem] overflow-hidden rounded-full',className,)}{...props}@@ -152,8 +152,8 @@ export const SegmentedMeter: React.ForwardRefExoticComponent<highlightId != null && segment.id !== highlightId && 'opacity-40',)}style={{- width: `calc(${fraction} * 100% - ${gapShare.toFixed(3)}px)`,- minWidth: `${SEGMENT_MIN}px`,+ width: `calc(${fraction} * 100% - ${gapShare.toFixed(3)}rem)`,+ minWidth: `${SEGMENT_MIN}rem`,...(segment.hatched ? hatchStyle('2.5px') : undefined),}}/>diff --git a/packages/client/src/components/SelectDropDown.tsx b/packages/client/src/components/SelectDropDown.tsxindex 954fee3ceb..39ed02b82f 100644--- a/packages/client/src/components/SelectDropDown.tsx+++ b/packages/client/src/components/SelectDropDown.tsx@@ -202,7 +202,7 @@ function SelectDropDown({key={'listbox-render-option'}value={null}className={cn(- 'group text-text-primary hover:bg-surface-hover relative flex h-[42px] cursor-pointer items-center overflow-hidden pr-9 pl-3 select-none',+ 'group text-text-primary hover:bg-surface-hover relative flex h-[2.625rem] cursor-pointer items-center overflow-hidden pr-9 pl-3 select-none',optionsClass ?? '',)}>@@ -231,7 +231,7 @@ function SelectDropDown({value={option}className={({ active }) =>cn(- 'group text-text-primary hover:bg-surface-hover relative flex h-[42px] cursor-pointer items-center overflow-hidden pr-9 pl-3 select-none',+ 'group text-text-primary hover:bg-surface-hover relative flex h-[2.625rem] cursor-pointer items-center overflow-hidden pr-9 pl-3 select-none',active ? 'bg-surface-active text-text-primary' : '',optionsClass ?? '',)diff --git a/packages/client/src/components/SendActions.tsx b/packages/client/src/components/SendActions.tsxindex 1e41e7c18a..7f2415f08a 100644--- a/packages/client/src/components/SendActions.tsx+++ b/packages/client/src/components/SendActions.tsx@@ -60,7 +60,7 @@ export function SendActions({gutter={8}unmountOnHidearia-label={label}- className="border-border-light bg-surface-secondary text-text-primary z-50 min-w-[12rem] rounded-xl border p-1.5 shadow-lg outline-hidden"+ className="border-border-light bg-surface-secondary text-text-primary z-50 max-w-[90vw] min-w-[min(12rem,90vw)] rounded-xl border p-1.5 shadow-lg outline-hidden">{actions.map((action) => (<buttondiff --git a/packages/client/src/components/Separator.tsx b/packages/client/src/components/Separator.tsxindex e628114574..ff4fc6ffb3 100644--- a/packages/client/src/components/Separator.tsx+++ b/packages/client/src/components/Separator.tsx@@ -21,7 +21,7 @@ const Separator: React.ForwardRefExoticComponent<orientation,className: cn('shrink-0 bg-border-light',- orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',+ orientation === 'horizontal' ? 'h-[0.0625rem] w-full' : 'h-full w-[0.0625rem]',className,),}}diff --git a/packages/client/src/components/SplitText.spec.tsx b/packages/client/src/components/SplitText.spec.tsxindex 3e7671c7f1..376decbcda 100644--- a/packages/client/src/components/SplitText.spec.tsx+++ b/packages/client/src/components/SplitText.spec.tsx@@ -1,6 +1,16 @@-import { render } from '@testing-library/react';+import { act, render } from '@testing-library/react';import SplitText from './SplitText';+let mockRemScale = 1;+jest.mock('~/hooks/useRemScale', () => ({+ __esModule: true,+ default: () => mockRemScale,+}));++beforeEach(() => {+ mockRemScale = 1;+});+describe('SplitText', () => {it('renders emojis correctly', () => {const emojis = ['🚧', '❤️🔥', '💜', '🦎', '❌', '✅', '⚠️'];@@ -53,4 +63,66 @@ describe('SplitText', () => {document.documentElement.dir = previousDir;}});++ it('reports new wrapping after scale changes without changing the text', () => {+ jest.useFakeTimers();+ const observerSpy = jest+ .spyOn(window, 'IntersectionObserver')+ .mockImplementation((callback) => {+ const observer: IntersectionObserver = {+ root: null,+ rootMargin: '',+ thresholds: [0],+ observe(target) {+ callback(+ [+ {+ target,+ isIntersecting: true,+ intersectionRatio: 1,+ time: 0,+ boundingClientRect: target.getBoundingClientRect(),+ intersectionRect: target.getBoundingClientRect(),+ rootBounds: null,+ },+ ],+ observer,+ );+ },+ unobserve() {},+ disconnect() {},+ takeRecords: () => [],+ };+ return observer;+ });+ const onLineCountChange = jest.fn();+ const animation = { opacity: 1, transform: 'none' };+ const props = {+ text: 'A stable greeting',+ delay: 0,+ animationFrom: animation,+ animationTo: animation,+ onLineCountChange,+ };+ const view = render(<SplitText {...props} />);+ const paragraph = view.container.querySelector('p')!;+ let height = 20;+ Object.defineProperty(paragraph, 'offsetHeight', { get: () => height });+ try {+ paragraph.style.lineHeight = '20px';+ act(() => jest.advanceTimersByTime(100));+ expect(onLineCountChange).toHaveBeenLastCalledWith(1);++ mockRemScale = 1.5;+ height = 60;+ paragraph.style.lineHeight = '30px';+ view.rerender(<SplitText {...props} />);+ act(() => jest.advanceTimersByTime(100));+ expect(onLineCountChange).toHaveBeenLastCalledWith(2);+ } finally {+ view.unmount();+ observerSpy.mockRestore();+ jest.useRealTimers();+ }+ });});diff --git a/packages/client/src/components/SplitText.tsx b/packages/client/src/components/SplitText.tsxindex 8eebaa6323..22ebd2f611 100644--- a/packages/client/src/components/SplitText.tsx+++ b/packages/client/src/components/SplitText.tsx@@ -1,5 +1,6 @@import { useEffect, useMemo, useRef, useState } from 'react';import { useSprings, animated, SpringConfig } from '@react-spring/web';+import useRemScale from '~/hooks/useRemScale';interface SegmenterOptions {granularity?: 'grapheme' | 'word' | 'sentence';@@ -93,6 +94,7 @@ const SplitText: React.FC<SplitTextProps> = ({const [inView, setInView] = useState(false);const ref = useRef<HTMLParagraphElement>(null);const animatedCount = useRef(0);+ const remScale = useRemScale();const [springs] = useSprings(letterCount,@@ -134,21 +136,17 @@ const SplitText: React.FC<SplitTextProps> = ({}, [threshold, rootMargin]);useEffect(() => {- if (ref.current && inView) {- const element = ref.current;- setTimeout(() => {- const lineHeight =- parseInt(getComputedStyle(element).lineHeight) ||- parseInt(getComputedStyle(element).fontSize) * 1.2;- const height = element.offsetHeight;- const lines = Math.round(height / lineHeight);-- if (onLineCountChange) {- onLineCountChange(lines);- }- }, 100);+ const element = ref.current;+ if (!element || !inView || !onLineCountChange) {+ return;}- }, [inView, text, onLineCountChange]);+ const timeout = setTimeout(() => {+ const style = getComputedStyle(element);+ const lineHeight = parseFloat(style.lineHeight) || parseFloat(style.fontSize) * 1.2;+ onLineCountChange(Math.round(element.offsetHeight / lineHeight));+ }, 100);+ return () => clearTimeout(timeout);+ }, [inView, text, onLineCountChange, remScale]);return (<>diff --git a/packages/client/src/components/TimePicker.tsx b/packages/client/src/components/TimePicker.tsxindex f3c1f3f351..d4377a2c7c 100644--- a/packages/client/src/components/TimePicker.tsx+++ b/packages/client/src/components/TimePicker.tsx@@ -193,7 +193,7 @@ function PickerShell({align="start"sideOffset={6}className={cn(- 'border-border-light bg-surface-secondary z-[999] rounded-xl border p-2 shadow-lg outline-hidden',+ 'border-border-light bg-surface-secondary z-[999] max-w-[min(calc(100vw-1rem),var(--radix-popover-content-available-width))] rounded-xl border p-2 shadow-lg outline-hidden',// Same enter/exit motion as the shared Radix primitives (Combobox,// Select, DropdownMenu): fade + zoom from the trigger edge, with Radix's// own transform origin so the zoom grows out of wherever it was placed.diff --git a/packages/client/src/hooks/index.ts b/packages/client/src/hooks/index.tsindex 98617ce8cf..1b6b0d06ba 100644--- a/packages/client/src/hooks/index.ts+++ b/packages/client/src/hooks/index.ts@@ -3,6 +3,7 @@export type { TranslationKeys } from './useLocalize';export { default as useToast } from './useToast';+export { default as useRemScale } from './useRemScale';export { default as useAvatar } from './useAvatar';export { default as useCombobox } from './useCombobox';export { default as useLocalize } from './useLocalize';diff --git a/packages/client/src/hooks/useRemScale.ts b/packages/client/src/hooks/useRemScale.tsnew file mode 100644index 0000000000..d66172fa6c--- /dev/null+++ b/packages/client/src/hooks/useRemScale.ts@@ -0,0 +1,27 @@+import { useSyncExternalStore } from 'react';+import { getRemScale, invalidateRemScale } from '~/utils/remScale';++/**+ * Watches the root element rather than the stored preference, so the value is+ * already correct on the render that follows a scale change, including one that+ * arrives from another tab through a storage event.+ */+const subscribe = (onStoreChange: () => void): (() => void) => {+ if (typeof MutationObserver === 'undefined' || typeof document === 'undefined') {+ return () => undefined;+ }+ const observer = new MutationObserver(() => {+ invalidateRemScale();+ onStoreChange();+ });+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ['style'] });+ return () => observer.disconnect();+};++/**+ * Ratio between a rendered rem and the 16px baseline, for layout that cannot be+ * expressed in CSS: virtualized row heights and drag-resized panels.+ */+export default function useRemScale(): number {+ return useSyncExternalStore(subscribe, getRemScale, () => 1);+}diff --git a/packages/client/src/icons/provider/Avatar.tsx b/packages/client/src/icons/provider/Avatar.tsxindex eac14d4e53..f399a86ad2 100644--- a/packages/client/src/icons/provider/Avatar.tsx+++ b/packages/client/src/icons/provider/Avatar.tsx@@ -3,6 +3,7 @@ import type { NamedExoticComponent, ReactNode } from 'react';import type { ProviderId } from 'librechat-data-provider';import type { JSX } from 'react/jsx-runtime';import { getProviderIconDef } from './registry';+import { pxToRem } from '../../utils/theme';import { ProviderIcon } from './Icon';import { cn } from '../../utils';@@ -32,8 +33,8 @@ function ProviderAvatarComponent({title={def.label}style={{background: hasBrand ? def.brandColor : 'transparent',- width: size,- height: size,+ width: pxToRem(size),+ height: pxToRem(size),color: hasBrand ? 'var(--provider-foreground, #ffffff)' : undefined,}}className={cn(diff --git a/packages/client/src/icons/provider/Icon.tsx b/packages/client/src/icons/provider/Icon.tsxindex c230f63e5c..b5a79bb188 100644--- a/packages/client/src/icons/provider/Icon.tsx+++ b/packages/client/src/icons/provider/Icon.tsx@@ -3,6 +3,7 @@ import type { ProviderId } from 'librechat-data-provider';import type { NamedExoticComponent } from 'react';import type { JSX } from 'react/jsx-runtime';import { getProviderIconDef } from './registry';+import { pxToRem } from '../../utils/theme';import { cn } from '../../utils';export interface ProviderIconProps {@@ -31,7 +32,7 @@ function ProviderIconComponent({<spanrole="img"aria-label={def.label}- style={{ width: size, height: size }}+ style={{ width: pxToRem(size), height: pxToRem(size) }}className={cn('inline-flex items-center justify-center', classes)}><Component size={size} className={cn(classes, 'h-full w-full')} />@@ -45,6 +46,7 @@ function ProviderIconComponent({alt={def.label}width={size}height={size}+ style={{ width: pxToRem(size), height: pxToRem(size) }}className={cn('object-contain', classes)}/>);diff --git a/packages/client/src/svgs/UserIcon.tsx b/packages/client/src/svgs/UserIcon.tsxindex 928dc98282..1cb526cdc2 100644--- a/packages/client/src/svgs/UserIcon.tsx+++ b/packages/client/src/svgs/UserIcon.tsx@@ -1,11 +1,21 @@import { JSX } from 'react/jsx-runtime';-export default function UserIcon(): JSX.Element {+/**+ * `size-[1.125rem]` is the 18px default expressed in rem: the CSS dimensions win over+ * the attributes below, so the glyph follows every scaled container it sits in without+ * each caller having to size it.+ */+export default function UserIcon({+ className = 'size-[1.125rem]',+}: {+ className?: string | undefined;+} = {}): JSX.Element {return (<svgxmlns="http://www.w3.org/2000/svg"width="18"height="18"+ className={className}viewBox="0 0 24 24"fill="none"stroke="currentColor"diff --git a/packages/client/src/utils/index.ts b/packages/client/src/utils/index.tsindex 3bc370ad8f..ba8e0cbb60 100644--- a/packages/client/src/utils/index.ts+++ b/packages/client/src/utils/index.ts@@ -1,5 +1,6 @@export * from './utils';export * from './theme';export * from './composer';+export * from './remScale';export * from './cloudfront';export { default as logger } from './logger';diff --git a/packages/client/src/utils/remScale.ts b/packages/client/src/utils/remScale.tsnew file mode 100644index 0000000000..cfab8a22f4--- /dev/null+++ b/packages/client/src/utils/remScale.ts@@ -0,0 +1,28 @@+const BASE_FONT_SIZE = 16;++let cache: number | null = null;++/**+ * Ratio between a rendered rem and the 16px baseline that pixel layout constants+ * assume. Measured from the DOM rather than the stored preference, so it stays+ * correct for readers whose browser default is not 16px.+ *+ * Kept in its own module so consumers can import it by path: the `~/utils` barrel+ * is partially mocked in several suites, which would otherwise leave this+ * undefined at the point a hook reads it.+ */+export const getRemScale = (): number => {+ if (cache != null) {+ return cache;+ }+ if (typeof document === 'undefined' || typeof getComputedStyle !== 'function') {+ return 1;+ }+ const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);+ cache = Number.isFinite(rootFontSize) && rootFontSize > 0 ? rootFontSize / BASE_FONT_SIZE : 1;+ return cache;+};++export const invalidateRemScale = (): void => {+ cache = null;+};diff --git a/packages/client/src/utils/theme.spec.ts b/packages/client/src/utils/theme.spec.tsnew file mode 100644index 0000000000..4a367b3370--- /dev/null+++ b/packages/client/src/utils/theme.spec.ts@@ -0,0 +1,37 @@+import { applyUiScale, MIN_UI_SCALE, MAX_UI_SCALE, DEFAULT_UI_SCALE } from './theme';++describe('applyUiScale', () => {+ const readScale = () => document.documentElement.style.getPropertyValue('--ui-scale');++ afterEach(() => {+ document.documentElement.style.removeProperty('--ui-scale');+ });++ it('sets the scale custom property on the root element', () => {+ applyUiScale(1.25);+ expect(readScale()).toBe('1.25');+ });++ it('clamps values below the minimum', () => {+ applyUiScale(0.1);+ expect(readScale()).toBe(String(MIN_UI_SCALE));+ });++ it('clamps values above the maximum', () => {+ applyUiScale(4);+ expect(readScale()).toBe(String(MAX_UI_SCALE));+ });++ it('falls back to the default for non-finite values', () => {+ applyUiScale(Number.NaN);+ expect(readScale()).toBe(String(DEFAULT_UI_SCALE));++ applyUiScale(Number.POSITIVE_INFINITY);+ expect(readScale()).toBe(String(DEFAULT_UI_SCALE));+ });++ it('falls back to the default when a persisted value is not a number', () => {+ applyUiScale('1.25' as unknown as number);+ expect(readScale()).toBe(String(DEFAULT_UI_SCALE));+ });+});diff --git a/packages/client/src/utils/theme.ts b/packages/client/src/utils/theme.tsindex b0cce449f8..8dd1ffd6c9 100644--- a/packages/client/src/utils/theme.ts+++ b/packages/client/src/utils/theme.ts@@ -1,3 +1,5 @@+import { invalidateRemScale } from './remScale';+/*** The disabled appearance a `fill` theme paints (`disabledStyle: 'fill'`): the* disabled fill, ink, placeholder and edge at full opacity. Every shared control@@ -27,6 +29,39 @@ export const peerDisabledInkClasses =export const disabledWithinFillClasses ='theme-disabled-within:border-border-disabled theme-disabled-within:bg-surface-disabled theme-disabled-within:text-text-disabled theme-disabled-within:opacity-100 theme-disabled-within:[&_*]:border-border-disabled theme-disabled-within:[&_*]:text-text-disabled';+export const MIN_UI_SCALE = 0.5;+export const MAX_UI_SCALE = 1.5;+export const DEFAULT_UI_SCALE = 1;++const BASE_FONT_SIZE = 16;++/**+ * Expresses a pixel measurement in rem so elements sized from JavaScript follow+ * the UI scale. A fixed pixel size in a scaled layout gets squeezed by its flex+ * container, which distorts avatars and icons.+ */+export const pxToRem = (px: number): string => `${px / BASE_FONT_SIZE}rem`;++/**+ * Guards every consumer of the stored preference: a corrupted value must not be+ * able to render the app unusable, nor reach layout maths as NaN.+ */+export const clampUiScale = (scale: number): number => {+ if (typeof scale !== 'number' || !Number.isFinite(scale)) {+ return DEFAULT_UI_SCALE;+ }+ return Math.min(MAX_UI_SCALE, Math.max(MIN_UI_SCALE, scale));+};++/**+ * Scales the entire interface by driving the `--ui-scale` custom property, which+ * `style.css` feeds to the root font size.+ */+export const applyUiScale = (scale: number): void => {+ document.documentElement.style.setProperty('--ui-scale', String(clampUiScale(scale)));+ invalidateRemScale();+};+export const applyFontSize = (val: string): void => {const root = document.documentElement;const size = val.split('-')[1]; // This will be 'xs', 'sm', 'base', 'lg', or 'xl'