* 🔘 style: Seat Sidebar Row Actions One Radius Inside Their Row Every control that sits on a sidebar row took the base `rounded-lg`, the same radius as the row hosting it, so a hovered button filled corner to corner with its row. `row-action` and `section-action` now carry `rounded-md`, one step inside the rows, which stay as they were. Three controls also diverged from the recipe they were built on. `ConvoOptions` and the Projects heading action overrode the variant's hover fill with `surface-hover`; the rename form's save and cancel buttons answered the pointer with `hover:opacity-70` and no fill at all. All four now take the shared hover. The project row's two actions are the exception that earns its own recipe: they sit on a row that fills on hover, where the variant's hover surface reads as a second, weaker hover stacked on the first. They take `surface-active` instead, under the pointer and while the menu one of them owns is open, and sit 4px apart like a pinned chat's own pair. * 🧲 fix: Give Both Pinned Row Kinds One Unpin Badge, and Stop Its Flicker Pinned chats and pinned agents/models sit in one list and are dragged against each other, but their unpin badges were two controls: the chat's was `text-text-primary` and always visible, the favorite's was a hand-rolled copy of the shared row action, `text-text-secondary`, revealed on hover. `UnpinButton` is now the single badge both rows render. It keeps the favorites' reveal, holds open while the row's overflow menu is, and is inert while hidden so it cannot swallow a click meant for the row. The reveal is asked for in JS rather than through an `@media (hover: hover)` variant: the variant has to beat the `group-hover` rules that reveal the badge, and it loses that cascade for `opacity` while winning it for `pointer-events`, which left the badge visible and unclickable. Two things made a row's controls flicker under the pointer: - The overflow slot took its width from its content, and the menu mounts a tick after the row is hovered. The unpin badge beside it slid 28px left at that moment, out from under the pointer, mid-fill; whatever landed there started its own. The slot now reserves its width from the row's hover, and `shrink-0` keeps a growing sibling from squeezing it. - `hasInteracted` unmounted that menu on every leave, so each entry mounted a fresh button one frame late into an already-revealed slot, restarting its fill from transparent. A row that has been reached now keeps its control for as long as the row lives; virtualization still drops the whole row. * 🧺 feat: Unpin a Chat by Dropping It on Chats, and Keep Pinned Kinds Apart Dropping a chat on the Chats section filed it out of its project but left a pinned one pinned, so the section it landed in was not the section it went to. The drop now also unpins, and accepts a pinned chat that is already in the root list; a chat that is both filed and pinned comes out of both, each call a no-op for the half that already holds. Pinned chats and pinned agents/models could be dragged through each other, which the list cannot honour: the two are ordered independently and a row dropped into the other group snapped back. Each row now accepts only its own drag type, so the other kind never previews a displacement, and Alt+Arrow refuses the same step. An order saved while the two interleaved is read back grouped, or a row would be walled in by neighbours it is not allowed to swap with. * 🧹 fix: Unnest the Row Action Width Ternary and Correct the Pinned Doc The rebase onto `dev` left two things the branch's own checks catch: the width branch that reserves a chat row's action slot had grown a nested ternary, which the repository's ESLint forbids, and `dnd.ts` carried an import out of order. The section's own doc comment still promised that favorites and conversations "interleave freely", which this branch stopped being true: a row only reorders against its own kind, and a stored order is read back grouped. * 🪃 fix: Keep a Pinned Reorder That Was Released on a Row Reordering the Pinned section with the pointer never survived the release. The rows shifted under the drag, and the moment the button came up they snapped back to where they had started; nothing was written, so a reload showed the old order too. Only Alt+Arrow could actually reorder the list. A row is a drop target — that is what makes the hover that reorders the list arrive at all, since the HTML5 backend reports hover only for targets that could receive the drag. react-dnd then counts that target as having handled the drop whether or not it carries a `drop` handler, so `monitor.didDrop()` was true for every release on a row, and the drag's `end` reads that as "this chat was filed somewhere else" and discards the arrangement the drag built. The row now answers the release with a result that names it, and `end` treats a handled drop as a filing action only when the result is not that one. The same change stops a row swallowing the drop of an unpinned chat that lands on it: that drop reaches the section underneath, which is what pins the chat. Covered by `dropping-a-chat-on-a-pinned-row-pins-it` and the same-kind control inside `a-pinned-chat-cannot-be-dragged-through-a-pinned-model`, both in `e2e/specs/mock/scenarios/pinned-drag-rules.spec.ts`. * 🧪 test: Drive the Sidebar Row Rules in a Real Browser Twelve scenarios in the mock harness, one per behaviour this branch claims: the radius and fill every row control draws inside its row, the one unpin badge both pinned row kinds carry and when it shows, the controls holding still while the pointer crosses a row, the touch tap that reaches the badge directly, the drop on Chats that unpins, the drop on a pinned row that pins, the kind boundary a drag and Alt+Arrow both refuse, and the stored interleaved order that loads grouped. They seed pinned chats straight into Mongo and set favourites and the pinned order through the routes the star and the drag use, so the server's own cache invalidation runs. Pointer-only scenarios skip on a pointer that cannot hover and the touch scenario skips where it can, which is what lets the same file cover the desktop and mobile projects. `dragRowOnto` steps the pointer rather than jumping: the list reorders on `dragover` once the pointer has crossed the hovered row's midpoint, and a single move never delivers enough of them. * 🧭 fix: Sequence the Two Halves of a Drop on Chats, and Reach the Mobile Drawer Dropping a chat that is both pinned and filed in a project asked for the two writes at once. The pin route answers with the conversation as it stands after its own write, and the sidebar publishes that answer into every list, so a pin that overlapped the project write could put the old `chatProjectId` back over the lists the assignment had just corrected — and a failed assignment still left the chat unpinned, out of the section it had been dragged from and still in the project it was supposed to leave. The unpin now waits for the assignment and runs only if it took, so a failure leaves the chat exactly where it was and the published snapshot is the one taken after both writes. `useAssignDroppedConversation` reports that outcome through a named `AssignDroppedConversation` type, and the project row's drop keeps handing back nothing, since the pinned list reads the drop result to tell a reorder from a filing action. On a narrow viewport the sidebar is a drawer that slides out of view rather than unmounting, so its rows answer every query while nothing on them can be tapped. The scenario helpers open it through the chat header the way a person does, which is what lets the touch and keyboard scenarios run in the mobile project. * 📝 docs: Say What the Kept Overflow Control Actually Costs The comment beside `hasInteracted` claimed virtualization bounded the controls a hovered row leaves mounted. It does for the chats list, which drops a row as it scrolls out, but not for the Pinned section: that one mounts every pinned row at once, so a pointer crossing it leaves one `ConvoOptions` per row it touched, standing until the section unmounts. The bound there is the number of chats the user pinned, which is worth stating rather than implying it is zero. * ⏱️ test: Give the Sidebar Scenario Hooks the Time Their Seeding Takes `test.setTimeout` called inside a test body does not reach the hooks around it, and the slow part of these scenarios is in a hook: seeding a pinned list, then reloading and waiting for the section. On a loaded machine the `beforeEach` hit the default 30s and failed a scenario whose own budget was 60s. The timeout is configured once per file instead, and the per-test calls it duplicated are gone. * ⏳ test: Allow for the Cold Start the First Sidebar Scenario Pays The first test of a run loads the app for the first time against a database that\nmay be a network hop away, and under reviewctl verify that first load pushed the\nseeding hook past 60s. The file budget is 120s and the navigation waits are 30s,\nwhich is the cold start plus room, not a licence for a slow assertion: every\nassertion here still resolves in single-digit seconds once the app is warm. * 🧱 test: Tell an Unlaid Sidebar From a Closed One The helper that brings the sidebar on screen read a missing bounding box as "off\nscreen" and reached for the chat header's opener, which desktop widths do not\nrender: the click waited out the whole test budget while the panel it was waiting\nfor was already open beside it. Placement is now three states — on screen, slid\nout of view, not laid out yet — and only a drawer that is really closed, on a\nviewport that really has an opener, is clicked. * 🧮 fix: Keep Each Pinned Kind in Its Own Slots, and Never Report a Pending Write as Done Two ways the drop and order bookkeeping could still move a row nobody touched. A stored order written before the two kinds were kept apart can interleave them, and `mergeVisibleOrder` substituted visible keys across that interleaving. With part of the pinned list still draining, reordering two visible chats could carry an undelivered chat across the favorite between them, so the row moved within its own group once the rest of the list arrived. The stored order is now grouped the way the section reads it back, and each kind is substituted inside its own run. `useAssignDroppedConversation` treated a pending assignment's destination as an outcome: dropping the same chat on Chats again while its first write was still in flight matched `effectiveProjectId`, reported success, and unpinned the chat — and if that first write then failed, the chat stayed in its project with its pin gone. A write already heading where the drop asks now reports "not filed", so the drop that started it keeps ownership of what follows. Covered by `dnd.spec.ts` (`keeps each kind in its own slots when a legacy order interleaves them`), `unpinDropped.spec.tsx` (`does not unpin again while an assignment to the same place is in flight`) and the `PinnedSection` hidden-key test, which now states the normalized order it expects. The pinned scenarios also wait for the rows to advertise their reorder shortcut before dragging: a move is refused until the saved order has arrived, so a drag issued before that passed or failed on how fast the query answered. * 🔗 fix: Wait for the Write a Drop Asked For, Whoever Started It The pending-assignment guard assumed the write in flight belonged to another\ndrop, which would unpin the chat when it landed. The row menu populates the same\nmap and unfiles a chat without unpinning it, so a drop onto Chats made while that\nmenu action was in flight did nothing at all: an accepted drop left the chat in\nthe Pinned section.\n\nA pending entry now only stops this path from reading \ as\n"already there". The drop issues its own write and waits for that one; the\nmutation queues writes per conversation, so it lands after the one already out\nand repeats what it asked for, which the server takes as the no-op it is. The\nunpin still runs only on a write this drop saw succeed. * 🛰️ fix: Let the Server Say Whether a Dropped Chat Is Out of Its Project Three rounds of review found three ways the same guess went wrong, so the guess is gone. Deciding locally whether the filing half of a Chats drop "already holds" meant reading one of three things that are not the answer: a pending write, which is a request that can still fail; a cached project, which another tab may already have changed; or the drag item's own copy, older still. Each one could let the drop unpin a chat that stayed in its project, and a chat that is pinned nowhere and filed in a project is in neither list the sidebar shows. The drop now always sends the assignment and acts on what comes back. Repeating an assignment the chat already has is the no-op update it looks like, and the mutation queues writes per conversation, so this one lands after anything already out. The success notice reads the two project ids in the response rather than the fact that a request was sent, so a write that moved nothing stays quiet — which is what a pinned chat with no project gets when it is dropped on Chats. `unpinDropped.spec.tsx` covers the three: the unpin waits for the write, a failed write keeps the pin, and a chat already out of every project is still confirmed with the server and unpinned without announcing a move that did not happen. The scenario drag helper also steps its pointer more finely. The list shifts rows as it reorders and reads the pointer offset when the hover fires; a pointer that arrived in one jump got a single reading, sometimes taken mid-render, and the reorder it asked for did not always happen. * 🧷 test: Press Only a Row the List Has Connected for Dragging The pinned list disconnects its drag sources while the saved order reconciles,\nand a press on a disconnected row is not a refused drag — it is a click, so the\nrow opens instead of moving. Against the lab database, where that reconciliation\ntakes long enough to overlap the gesture, the Chats-drop scenario failed with the\ndragged row still pinned and now the active chat.\n\nreact-dnd marks a connected source \, so the helper waits for that\nbefore pressing. |
||
|---|---|---|
| .. | ||
| benchmarks | ||
| benchmarks-mobile-chat | ||
| benchmarks-navigation | ||
| benchmarks-reasoning | ||
| benchmarks-tree | ||
| bombadil | ||
| byom | ||
| config | ||
| fixtures | ||
| lighthouse | ||
| perf | ||
| recordings | ||
| setup | ||
| specs | ||
| client-build.test.mjs | ||
| config.local.example.ts | ||
| jestSetup.js | ||
| playwright.config.a11y.ts | ||
| playwright.config.benchmark.ts | ||
| playwright.config.bombadil.ts | ||
| playwright.config.lighthouse.ts | ||
| playwright.config.local.ts | ||
| playwright.config.mermaid.ts | ||
| playwright.config.mobile-chat-perf.ts | ||
| playwright.config.mock.ts | ||
| playwright.config.navigation-perf.ts | ||
| playwright.config.real.ts | ||
| playwright.config.reasoning-perf.ts | ||
| playwright.config.redis.ts | ||
| playwright.config.tree-parity.ts | ||
| playwright.config.tree-perf-prod.ts | ||
| playwright.config.tree-perf.ts | ||
| playwright.config.ts | ||
| README.md | ||
| types.ts | ||
LibreChat e2e
The mock e2e profile is the safest default for generated tests. It starts LibreChat with e2e/config/librechat.e2e.yaml, injects an in-process fake LLM (via LIBRECHAT_TEST_RUN_HOOK), creates an authenticated e2e user, and avoids real provider credentials.
Stream Stores and Shards
The mock profile uses the in-memory generation stream store by default. To exercise the same browser scenarios through a real Redis job store and pub/sub transport, start Redis on port 6379 and run:
npm run e2e:mock:redis
Memory mode explicitly disables Redis. Redis mode defaults to database 15 with a LibreChatE2E key prefix, and fails closed: the test server pings Redis and verifies that the generation job manager did not silently fall back to memory. Override REDIS_URI or E2E_REDIS_KEY_PREFIX when needed.
Pull request CI runs the complete mock suite in memory mode across three shards, plus a focused Redis transport suite. The Redis suite covers streaming fidelity, steering, interrupts, resumptions, HITL approvals, completion, thread folding, model icons, and usage:
npx playwright test --config=e2e/playwright.config.mock.ts --shard=1/3
npm run e2e:mock:redis:transport
The nightly schedule and manual workflow dispatch run the complete mock suite in both stream modes across two shards per mode. Every shard keeps one worker so tests do not contend for its authenticated user and database.
Property-based browser testing
Bombadil explores randomized sequences across the core chat loop, message branches, parallel multi-conversation responses, model changes, reloads, and sidebar conversation lifecycle operations:
npm run e2e:bombadil
Set BOMBADIL_TIME_LIMIT for longer local or scheduled runs. Failures leave a
reproducible trace under e2e/.generated/bombadil-output; rerun it with:
BOMBADIL_REPRODUCE=e2e/.generated/bombadil-output npm run e2e:bombadil:run
Reproducing a real violation is expected to fail the Playwright test. Before a
new run overwrites the active output, the harness archives it under
e2e/.generated/bombadil-history/. Reproduction can diverge when streaming
timing changes; Bombadil reports that explicitly.
The harness uses the credential-free mock-LLM profile, so exploration never sends billable provider requests.
CI runs the broad property exploration for five minutes in the non-blocking
Bombadil Property Exploration workflow. If a property fails, download the
bombadil-reproduction-* artifact into
e2e/.generated/bombadil-output/, then reproduce it locally:
BOMBADIL_REPRODUCE=e2e/.generated/bombadil-output npm run e2e:bombadil:run
The accompanying bombadil-diagnostics-* artifact contains the captured CI log,
Playwright HTML report, and Playwright test results. A Bombadil failure produces
a workflow warning but does not block merge.
The default instruments inline JavaScript only because instrumenting LibreChat's
full Vite bundle can exceed Bombadil's driver timeout during stateful runs. Set
BOMBADIL_INSTRUMENT_JAVASCRIPT=files,inline for shorter coverage-guided
experiments.
The branch reload, fork submission, model/conversation, HITL pause/resume, and mid-run steering lifecycle properties can be run independently:
npm run e2e:bombadil:branch-reload
npm run e2e:bombadil:fork-lifecycle
npm run e2e:bombadil:model-lifecycle
npm run e2e:bombadil:hitl
npm run e2e:bombadil:steering
These focused commands are diagnostic properties: they exit nonzero when they
reproduce a product invariant violation. Reproduce a focused trace with its
matching :run script and output directory, for example:
BOMBADIL_REPRODUCE=e2e/.generated/bombadil-output-hitl npm run e2e:bombadil:hitl:run
HITL drives a real ask_user_question checkpoint through the answer/resume
controller, reloads while the question is paused, answers it once, and reloads
the completed conversation. Steering submits an in-flight steer during a slow
MCP-backed run, checks that it moves exactly once from the composer anchor into
the response at the tool boundary, and reloads the applied state. The model
lifecycle property is the passing control. The branch reload and fork
properties preserve their minimal failing traces.
Recording Tests
Use Playwright codegen when you want to turn an exploratory browser session into a draft test:
npm run e2e:record
That command builds the app, starts the LibreChat test server (with an in-process fake LLM) when needed, writes e2e/storageState.json, and opens Playwright codegen at /c/new. The npm script uses http://localhost:3333 so it does not collide with a normal dev server on 3080. Raw recordings are written to e2e/recordings/ and ignored by git.
For a real local LibreChat config instead of the mock profile:
npm run e2e:record:local
Useful direct options:
node e2e/setup/record.js --url=http://localhost:3080/c/new
node e2e/setup/record.js --profile=local --no-output
node e2e/setup/record.js --auth-only
node e2e/setup/record.js --output=e2e/recordings/settings-draft.spec.ts
LLM-Assisted Loop
- Start
npm run e2e:record. - Let the LLM use Computer Use to operate the headed Playwright browser.
- Stop codegen after the workflow is captured.
- Move the useful parts from
e2e/recordings/into a committed spec undere2e/specs/mock/. - Replace brittle generated selectors with role, label, text, or
data-testidlocators. - Add assertions that prove the behavior, not just the clicked path.
- Run the finished spec with
npm run e2e:mock -- <spec name>.
Generated recordings are a draft, not the final test. The committed version should use the shared helpers in e2e/specs/mock/helpers.ts where possible, wait on network or visible UI state instead of fixed sleeps, and keep test data deterministic.