LibreChat/packages/client/src
Danny Avila 49b6e519e8
🧷 fix: Keep Ref Cleanup and Hold Consumer Handlers to the Frontmost Dialog (#15751)
Two findings from the last codex round on #15742, which merged before these
landed. Both are real; the third report was the same ref finding filed three
times.

The ref wrapper `OGDialogContent` gained there swallows a callback ref's return
value. Under the React 19 peer range a consumer's teardown never runs when the
node is replaced, stranding whatever it had attached — the direct forwarding it
replaced had no such gap. The cleanup is passed on now, and only when it really
is a function, because React 18 warns about any other return value.

The Escape fallback also called the consumer's `onEscapeKeyDown` before
establishing that this dialog was the one the Escape belonged to. Every mounted
dialog runs that listener, so a dialog underneath fired its handler for someone
else's keystroke — and a `preventDefault()` there would have stopped the
frontmost dialog from closing at all, since the lower listener registers first.
The call now happens after the frontmost check.

The gating has a regression test, verified to fail without the fix. The ref
cleanup does not: React 18 ignores the returned function outright, so the
repo's own test runtime cannot observe it.

`packages/client` 488 tests, typecheck and static checks clean.
2026-09-08 16:37:35 -04:00
..
common 🔖 fix: Announce Bookmark Selection State (#11450) 2026-01-21 13:49:50 -05:00
components 🧷 fix: Keep Ref Cleanup and Hold Consumer Handlers to the Frontmost Dialog (#15751) 2026-09-08 16:37:35 -04:00
hooks 🔔 fix: Honor Toast Duration and Support Persistent Toasts (#15049) 2026-09-06 04:38:15 +02:00
icons/provider 🍋 feat: Add AMD Lemonade Provider Recognition and Branding (#15664) 2026-09-06 20:46:08 +02:00
locales ♿ feat: High Contrast Light and Dark Appearance Modes (#15178) 2026-09-05 22:20:33 +02:00
Providers ⚡ refactor: Migrate @librechat/client build to tsdown (#13596) 2026-06-08 11:20:03 -04:00
svgs 🖼️ refactor: Consolidate Provider Icons Into a Single Registry (#15148) 2026-08-24 13:00:38 -04:00
test ✨ feat: add morphing state icons across the client (#14697) 2026-09-04 03:27:14 +02:00
theme 🟫 fix: Reject Invalid Hex Color Matches (#15744) 2026-09-08 12:07:46 -04:00
utils 💠 style: Unify Code Approval With Composer Controls (#15721) 2026-09-07 23:13:27 -04:00
index.ts 🖼️ refactor: Consolidate Provider Icons Into a Single Registry (#15148) 2026-08-24 13:00:38 -04:00
store.ts 🔔 fix: Honor Toast Duration and Support Persistent Toasts (#15049) 2026-09-06 04:38:15 +02:00