LibreChat/packages/client
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
..
src 🧷 fix: Keep Ref Cleanup and Hold Consumer Handlers to the Frontmost Dialog (#15751) 2026-09-08 16:37:35 -04:00
babel.config.js
jest.config.js ✨ feat: add morphing state icons across the client (#14697) 2026-09-04 03:27:14 +02:00
jest.resolver.cjs ⬆️ chore: Migrate off deprecated @ariakit/react-core to @ariakit/react-components (#13940) 2026-06-24 23:13:57 -04:00
jest.setup.ts
package.json 👯 fix: Collapse Radix Layer Packages to One Copy (#15742) 2026-09-08 16:00:27 -04:00
tailwind.config.js 🎨 feat: Add Versioned Theme Foundation (#14709) 2026-08-10 13:41:03 -04:00
tailwind.preset.cjs ♿ feat: High Contrast Light and Dark Appearance Modes (#15178) 2026-09-05 22:20:33 +02:00
tsconfig.json ⚡ refactor: Migrate @librechat/client build to tsdown (#13596) 2026-06-08 11:20:03 -04:00
tsconfig.test.json
tsdown.config.mjs 🖼️ refactor: Consolidate Provider Icons Into a Single Registry (#15148) 2026-08-24 13:00:38 -04:00