LibreChat/client
Marco Beretta c821638e3d
🌓 refactor: Scrim OGDialog With the Overlay Theme Role (#16068)
* 🌓 refactor: Scrim OGDialog With the Overlay Theme Role

OGDialog scrimmed with a literal bg-black/80, so a theme that redefined
surface-overlay moved the Dialog and AlertDialog families and left every
OGDialog black. The scrim now paints bg-surface-overlay/80: the opacity
is unchanged, so the themes whose overlay resolves to black (dark, and
both high-contrast modes) render the same rgba as before, and the light
theme gets the gray scrim it defines, at 4.3:1 against the dialog it
frames.

Follow-up from the review of #15798, tracked as berry-13/LibreChat#14.

* 🧪 test: Carry the Scenario Theme Mode in the URL

The black-overlay scenario switched modes by writing `color-theme` and
reloading, but the init script that seeds the mode stays registered for
the life of the page and rewrote it on every load, so the high-contrast
iterations re-read the first mode and never matched their `<html>`
classes. The mode now rides in the URL and the init script copies
whatever the current navigation asks for.

* 🧪 test: Read the Scrim of the Frontmost Open Dialog

The scrim helpers resolved the dialog with `querySelector`, which takes
the first match in document order. Nothing in the suite is affected —
the settings modal is Headless UI and carries no `data-state`, so the
stacked scenario already measured the account confirmation — but a
scenario that opened an OGDialog from inside another one would have
silently read the outer dialog's scrim. The helpers now resolve the
frontmost open dialog by z-index and read its sibling scrim, and the
color and both sample points come back from one pass over the DOM.

* 🗂️ fix: Let the SharePoint Picker Take the App's Scrim

The picker rendered an OGDialogOverlay of its own beside the
OGDialogContent that portals one anyway. Both sat at depth 1, so both
resolved to z-index 130, and the primitive's overlay — mounted second —
painted over the picker's, so the lighter black it asked for never
reached the screen. The dialog is opaque, so it needs no backdrop of
its own: the extra overlay and its literal are gone and the picker
scrims with the theme's overlay role, exactly once, like every other
OGDialog.

* 🧪 test: Compare the Picker's Scrim to the Primitive's Own

The picker spec pinned the scrim's utility classes, which says nothing
a reader of the app would recognise and would break the next time the
primitive's opacity moves. It now renders a bare OGDialog beside it and
asserts the picker's single scrim is the same layer the app paints.
2026-09-19 08:58:30 -04:00
..
public 🍋 feat: Add AMD Lemonade Provider Recognition and Branding (#15664) 2026-09-06 20:46:08 +02:00
src 🌓 refactor: Scrim OGDialog With the Overlay Theme Role (#16068) 2026-09-19 08:58:30 -04:00
sw
test 🎨 feat: Theme-Adaptive SVG Support for Custom MCP and Group Icons (#13817) 2026-09-04 10:49:43 -04:00
babel.config.cjs
check_updates.sh
index.html 🔭 feat: Tag Browser Diagnostics With Client Build IDs (#15656) 2026-09-06 12:47:34 -04:00
jest.config.cjs 🧵 ci: Keep a Floor of Two Jest Workers in CI (#15819) 2026-09-14 00:32:20 -04:00
jest.resolver.cjs
nginx.conf
package.json 🚀 v0.8.8-rc3 (#15859) 2026-09-13 02:17:48 -04:00
postcss.config.cjs
tailwind.config.cjs
tsconfig.json
vite.config.ts 🖼️ fix: Precache PWA Icons and Let Them Refresh (#15654) 2026-09-06 11:32:09 -04:00