mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
⬤ style: Circular Streaming Cursor (#1736)
* Updated Style Cursor like ChatGPT * style(Markdown.tsx): add space before cursor when there is text * fix: revert OpenAIClient.tokens.js change * fix:(Markdown.tsx): revert change of unused file * fix(convos.spec.ts): test fix * chore: remove raw HTML for cursor animations --------- Co-authored-by: Danny Avila <danacordially@gmail.com> Co-authored-by: Danny Avila <messagedaniel@protonmail.com>
This commit is contained in:
parent
92a41fbf47
commit
a2e85b7053
7 changed files with 75 additions and 58 deletions
|
|
@ -1,7 +1,6 @@
|
|||
const partialRight = require('lodash/partialRight');
|
||||
const { sendMessage } = require('./streamResponse');
|
||||
const { getCitations, citeText } = require('./citations');
|
||||
const cursor = '<span className="result-streaming">█</span>';
|
||||
const citationRegex = /\[\^\d+?\^]/g;
|
||||
|
||||
const addSpaceIfNeeded = (text) => (text.length > 0 && !text.endsWith(' ') ? text + ' ' : text);
|
||||
|
|
@ -51,7 +50,7 @@ const createOnProgress = ({ generation = '', onProgress: _onProgress }) => {
|
|||
const sendIntermediateMessage = (res, payload, extraTokens = '') => {
|
||||
tokens += extraTokens;
|
||||
sendMessage(res, {
|
||||
text: tokens?.length === 0 ? cursor : tokens,
|
||||
text: tokens?.length === 0 ? '' : tokens,
|
||||
message: true,
|
||||
initial: i === 0,
|
||||
...payload,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue