mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🪶 perf: Render a Finished Message's Markdown in One Pass Opening a conversation rendered every assistant text part per top-level block: a full mdast parse just to find block boundaries, then one ReactMarkdown pipeline, two providers and a layout effect per paragraph, table and fence. The split only pays while a message streams, where it keeps completed blocks memoized. A message that was never streamed in this view now renders as one pipeline and skips the boundary parse, keyed on its source so an in-place edit remounts it with fresh code and artifact indices. A message that streamed here keeps the per-block split after it finishes, so ending an answer never remounts its blocks. The benchmark gains a finished-message mount case. * 🪪 perf: Keep the Agents List From Re-Rendering Every Message Part The author header a message hands its parts, restated after an inline steer, was an element built from the resolved agent. The agents list resolves after first paint, so that element changed identity, broke the memo on ContentParts and re-rendered every part of the message, even though the header only shows after a steer. Both row renderers now hand the parts one constant header element that reads the author from AuthorContext. An agent or assistant resolving re-renders only the headers on screen, and the row's own icon and label reuse the same memoized author. * 🧷 fix: Move a Finished Message to Per-Block Rendering on Its First Change A finished message kept its single pipeline keyed on its source, so every change remounted all of it. An artifact editor saves the message every few hundred milliseconds while the user types, and each save collapsed its expanded Mermaid rows and reset its code blocks, where per-block rendering had re-rendered only the artifact's block. The single pipeline now serves a message only while it is exactly as it mounted. Generating or any content change moves it to per-block rendering for good, which remounts it once; later changes re-render only the blocks they touch. The move happens as generation starts, so the fade baseline is set on the blocks it mounts. The splitter also sliced each top-level block after its indentation, which decides how the block parses: an indented fence under a two-digit list item kept its indentation in the code, and a two-space-indented list turned a note into a code block. Blocks now keep their line's indentation. |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| sw | ||
| test | ||
| babel.config.cjs | ||
| check_updates.sh | ||
| index.html | ||
| jest.config.cjs | ||
| jest.resolver.cjs | ||
| nginx.conf | ||
| package.json | ||
| postcss.config.cjs | ||
| tailwind.config.cjs | ||
| tsconfig.json | ||
| vite.config.ts | ||