mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🧬 fix: Collapse Radix Layer Packages to One Copy Radix coordinates nested layers and focus scopes through module-level state, so a dialog and a popover inside it cooperate only while they import the same copy of `react-dismissable-layer` / `react-focus-scope`. This tree had four and three of them: dialog -> react-dialog/node_modules/… 1.0.2 (exact pin) select -> react-select/node_modules/… 1.1.10 menu -> react-menu/node_modules/… 1.1.0 hover -> hoisted 1.0.5 Split that way, a popover never learns the dialog disabled body pointer events and the dialog's focus trap is never paused, so in-dialog selects and hover cards are inert and keyboard-dead (#15738). The exact `1.0.2` pin on `react-dialog` and `react-alert-dialog` came from #11023, which downgraded them from ^1.1.15 to fix modal tooltip and dropdown regressions — the same split seen from the other side, when the dialog was the new package and everything else was old. Unpinning both and refreshing the other Radix packages inside their existing carets collapses the tree to one copy of each. No `overrides` entry: the resolution stands on its own, and pinning transitive versions would only hide the next split. `radixLayers.spec.ts` reads the lockfile and fails if either package is ever nested again; `dialogPopoverFocus.spec.tsx` asserts the behaviour that invariant exists for — a portaled option holding focus inside a dialog, which fails on the old tree and passes on this one. Verified with a real install in a worktree: one copy of each resolved from dialog, select and hover-card alike; `packages/client` 46 suites / 476 tests and `client` 323 suites / 3201 tests green; both workspaces typecheck. Needs a manual pass over the app's modals before merge — what #11023 was guarding cannot be proven by jsdom. * 🍞 fix: Give Escape Back to the Dialog Under a Toast Radix routes Escape to the highest dismissable layer only, and `Toast.Root` registers one — mounted after whatever dialog is already open. Splitting `react-dismissable-layer` into per-package copies hid this: toasts and dialogs were never in the same stack. Collapsing them to one copy puts a status toast above every open dialog, and it eats the Escape meant for the dialog beneath. Measured in the running app (mock e2e, instrumented): the dialog's own `onEscapeKeyDown` was never called, the layer above it was `<li class="toast-root" data-radix-collection-item>`, and a SECOND Escape closed the dialog. That is `agent-skills.spec.ts:709`, which failed deterministically here across three attempts. The frontmost open dialog now takes Escape back while a toast is present, closing through a hidden `Dialog.Close` so controlled and uncontrolled dialogs behave alike. Scoped tightly: no toast on screen leaves Radix's arbitration untouched, and only the frontmost dialog acts, so an inner dialog still closes alone. The toast is matched whatever its `data-state`. A toast that has begun closing keeps its layer registered until the exit animation ends, and that is exactly the case that failed — the first attempt keyed on `[data-state="open"]` and missed it, which the instrumentation caught (`FB toast= null allLis= 1`). `agent-skills.spec.ts` now passes locally on the deduped tree: 4 passed. Regression test verified to fail with the fix reverted. * 🚪 fix: Close the MCP Menu With the Dialog It Opened Ariakit takes Escape for a menu only when the event target is the menu, its trigger, or `body`: if (event.key !== "Escape") return; if (event.defaultPrevented) return; ... if (isElement(target) && target.tagName === "BODY") return true; if (contains(dialog, target)) return true; if (contains(disclosureElement, target)) return true; return false; // ariakit dialog.tsx:496-517 While the MCP config dialog holds focus none of those is true, so the Escape that closes the dialog leaves the menu open behind it — and `disabled={isOpen}` on the trigger then makes it unclickable. The reader is stranded with a menu they cannot reach and a button they cannot press; `mcp-oauth-readiness` times out clicking it, three tests over. Keyed on the dialog CLOSING, not opening. The first attempt closed the menu as the dialog opened and broke a fourth test that reads the server rows from the still-mounted menu underneath (`unmountOnHide` deletes them): `element(s) not found`. Closing on the way back out leaves that untouched. Local mock e2e on the deduped tree: `mcp-oauth-readiness` 5 passed (was 2/5), `agent-skills` + `mcp` 5 passed, `client` 3204 tests green, typecheck clean. * 🛡️ fix: Keep the Escape Fallback Inside Its Lane Codex found three, all real. **P1 — the fallback overruled the guards it should obey.** Any Escape while a toast was up clicked the dialog's close button, including when a select inside the dialog owned that Escape (WCAG 2.1.1) or when another layer had already answered it. A reader closing a listbox would have lost the whole dialog and anything unsaved in it. It now bails on `event.defaultPrevented` and on the same popup conditions the Radix-provided handler honours — extracted into one `escapeBelongsToPopup` helper both call, so they cannot drift apart. **P2 — the frontmost check read inline z-index only.** `ImagePreview` is a raw `DialogPrimitive.Content` carrying `z-[250]` as a CLASS, so it scored zero and the My Files dialog underneath was mistaken for the frontmost — Escape in the preview would have closed it too. Ranking now reads the resolved `getComputedStyle().zIndex`. **P2 — the published contract did not carry the singleton.** `@librechat/client` still admitted `react-toast@1.1.5` and `react-popover@1.0.7`, which depend on the older dismissable-layer/focus-scope line, so a consumer could reassemble the very split this PR removes. Radix minimums raised to the versions the lockfile resolves; the tree still holds exactly one copy of each. Three regression tests, each verified to fail against the pre-fix component. `packages/client` 484 tests, `client` 3204 tests, both typecheck clean, local mock e2e `agent-skills` + `mcp-oauth-readiness` 9 passed. * 🎚️ fix: Let the Consumer and the Alert Dialog Have Their Say Two more from codex, both real. The fallback never ran the dialog's own `onEscapeKeyDown`. Radix calls that only for the highest layer, which the toast is — so a dialog whose consumer cancels Escape (`event.preventDefault()`) closed anyway, taking whatever was in it. The fallback now invokes the supplied handler and honours the cancellation, exactly as the Radix path does. The frontmost ranking looked only for `role="dialog"`. `OGDialogContent` is also used as an alert dialog — the shared-link delete confirmation (`SharedLinkButton.tsx:426`) — so its content was never found, `frontmost` stayed null, and the fallback declined to act: that confirmation still needed two Escapes. Alert dialogs are ranked too. Two more regression tests, both verified to fail against the previous version. `packages/client` 486 tests, `client` 3204 tests, typecheck and static checks clean.
128 lines
4 KiB
JSON
128 lines
4 KiB
JSON
{
|
|
"name": "@librechat/client",
|
|
"version": "0.4.77",
|
|
"description": "React components for LibreChat",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/danny-avila/LibreChat"
|
|
},
|
|
"main": "dist/index.cjs",
|
|
"module": "dist/index.mjs",
|
|
"types": "./dist/index.d.cts",
|
|
"exports": {
|
|
".": {
|
|
"import": {
|
|
"types": "./dist/index.d.mts",
|
|
"default": "./dist/index.mjs"
|
|
},
|
|
"require": {
|
|
"types": "./dist/index.d.cts",
|
|
"default": "./dist/index.cjs"
|
|
}
|
|
},
|
|
"./tailwind-preset": "./tailwind.preset.cjs",
|
|
"./style.css": "./dist/style.css",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"tailwind.preset.cjs"
|
|
],
|
|
"scripts": {
|
|
"clean": "rimraf dist",
|
|
"b:clean": "bun run rimraf dist",
|
|
"build": "npm run clean && tsdown",
|
|
"build:dev": "npm run clean && NODE_ENV=development tsdown",
|
|
"b:build": "bun run b:clean && bun run tsdown",
|
|
"build:watch": "tsdown --watch",
|
|
"dev": "tsdown --watch",
|
|
"test": "jest",
|
|
"test:ci": "jest --ci"
|
|
},
|
|
"peerDependencies": {
|
|
"@ariakit/react": "^0.4.29",
|
|
"@ariakit/react-components": "^0.1.2",
|
|
"@dicebear/collection": "^9.4.3",
|
|
"@dicebear/core": "^9.4.3",
|
|
"@headlessui/react": "^2.1.2",
|
|
"@radix-ui/react-accordion": "^1.2.20",
|
|
"@radix-ui/react-alert-dialog": "^1.1.23",
|
|
"@radix-ui/react-checkbox": "^1.3.11",
|
|
"@radix-ui/react-collapsible": "^1.1.20",
|
|
"@radix-ui/react-dialog": "^1.1.23",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.24",
|
|
"@radix-ui/react-hover-card": "^1.1.23",
|
|
"@radix-ui/react-icons": "^1.3.0",
|
|
"@radix-ui/react-label": "^2.1.7",
|
|
"@radix-ui/react-popover": "^1.1.23",
|
|
"@radix-ui/react-progress": "^1.1.2",
|
|
"@radix-ui/react-radio-group": "^1.3.7",
|
|
"@radix-ui/react-select": "^2.3.7",
|
|
"@radix-ui/react-separator": "^1.1.7",
|
|
"@radix-ui/react-slider": "^1.3.5",
|
|
"@radix-ui/react-slot": "^1.0.0",
|
|
"@radix-ui/react-switch": "^1.2.5",
|
|
"@radix-ui/react-tabs": "^1.1.21",
|
|
"@radix-ui/react-toast": "^1.2.23",
|
|
"@rc-component/mini-decimal": "^1.0.1",
|
|
"@react-spring/web": "^10.0.1",
|
|
"@tanstack/react-query": "^4.28.0 || ^5.0.0",
|
|
"@tanstack/react-table": "^8.11.7",
|
|
"@tanstack/react-virtual": "^3.0.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"dompurify": "^3.4.0",
|
|
"framer-motion": "^12.40.0",
|
|
"i18next": "^24.2.2 || ^25.3.2",
|
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
"input-otp": "^1.4.2",
|
|
"jotai": "^2.12.5",
|
|
"librechat-data-provider": "*",
|
|
"lucide": "^0.525.0",
|
|
"lucide-react": "^0.525.0",
|
|
"match-sorter": "^8.1.0",
|
|
"morphicons": "^1.4.1",
|
|
"rc-input-number": "^7.4.2",
|
|
"react": "^18.2.0 || ^19.1.0",
|
|
"react-dom": "^18.2.0 || ^19.1.0",
|
|
"react-hook-form": "^7.56.4",
|
|
"react-i18next": "^15.4.0 || ^15.6.0",
|
|
"react-resizable-panels": "^4.7.4",
|
|
"react-textarea-autosize": "^8.4.0",
|
|
"tailwind-merge": "^1.9.1"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.28.5",
|
|
"@babel/preset-env": "^7.29.5",
|
|
"@babel/preset-react": "^7.28.5",
|
|
"@babel/preset-typescript": "^7.28.5",
|
|
"@tanstack/react-query": "^4.28.0",
|
|
"@tanstack/react-table": "^8.21.3",
|
|
"@tanstack/react-virtual": "^3.13.13",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^14.0.0",
|
|
"@tsdown/css": "^0.22.2",
|
|
"@types/jest": "^29.5.14",
|
|
"@types/react": "^18.2.11",
|
|
"@types/react-dom": "^18.2.4",
|
|
"babel-jest": "^30.2.0",
|
|
"caniuse-lite": "^1.0.30001741",
|
|
"i18next": "^24.2.3",
|
|
"identity-obj-proxy": "^3.0.0",
|
|
"jest": "^30.2.0",
|
|
"jest-environment-jsdom": "^30.2.0",
|
|
"jotai": "^2.12.5",
|
|
"librechat-data-provider": "*",
|
|
"lucide": "^0.525.0",
|
|
"lucide-react": "^0.525.0",
|
|
"morphicons": "^1.4.1",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"react-i18next": "^15.4.0",
|
|
"rimraf": "^6.1.3",
|
|
"tailwindcss": "^3.4.1",
|
|
"tailwindcss-radix": "^2.8.0",
|
|
"tsdown": "^0.22.2",
|
|
"typescript": "^5.9.3"
|
|
}
|
|
}
|