Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔡 fix: Rendering of Bidirectional Text #3195

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion client/src/components/Chat/Messages/Content/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { TMessage } from 'librechat-data-provider';
import Files from './Files';

const Container = ({ children, message }: { children: React.ReactNode; message: TMessage }) => (
<div className="text-message flex min-h-[20px] flex-col items-start gap-3 overflow-x-auto [.text-message+&]:mt-5">
<div
className="text-message flex min-h-[20px] flex-col items-start gap-3 overflow-x-auto [.text-message+&]:mt-5"
dir="auto"
>
{message.isCreatedByUser && <Files message={message} />}
{children}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const EditMessage = ({
contentEditable={true}
value={editedText}
suppressContentEditableWarning={true}
dir="auto"
/>
</div>
<div className="mt-2 flex w-full justify-center text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const SearchContent = ({ message }: { message: TMessage }) => {
'markdown prose dark:prose-invert light w-full break-words',
message.isCreatedByUser ? 'whitespace-pre-wrap dark:text-gray-20' : 'dark:text-gray-70',
)}
dir="auto"
>
<MarkdownLite content={message.text ?? ''} />
</div>
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Messages/Content/EditMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const EditMessage = ({
contentEditable={true}
ref={textEditor}
suppressContentEditableWarning={true}
dir="auto"
>
{text}
</div>
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Nav/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const SearchBar = forwardRef((props: SearchBarProps, ref: Ref<HTMLDivElement>) =
placeholder={localize('com_nav_search_placeholder')}
onKeyUp={handleKeyUp}
autoComplete="off"
dir="auto"
/>
<X
className={cn(
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ui/TextareaAutosize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export const TextareaAutosize = forwardRef<HTMLTextAreaElement, TextareaAutosize
(props, ref) => {
const [, setIsRerendered] = useState(false);
useLayoutEffect(() => setIsRerendered(true), []);
return <ReactTextareaAutosize {...props} ref={ref} />;
return <ReactTextareaAutosize dir="auto" {...props} ref={ref} />;
},
);