mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
fix: respect RTL text direction in file attachment containers
Fixes #19742 where file attachment containers did not inherit the chat direction setting, causing layout issues when typing in RTL languages like Persian. Added dir={$settings?.chatDirection ?? 'auto'} to file container divs in: - MessageInput.svelte (chat input file attachments) - UserMessage.svelte (user message file display) - ResponseMessage.svelte (response message file display) - channel/Messages/Message.svelte (channel message file display) The fix ensures file containers automatically detect and respect RTL text direction, maintaining proper layout alignment for RTL languages while preserving LTR behavior for Latin text.
This commit is contained in:
parent
3b3e12b43a
commit
d3b6c5afc7
4 changed files with 16 additions and 4 deletions
|
|
@ -338,7 +338,10 @@
|
|||
<Skeleton />
|
||||
</div>
|
||||
{:else if (message?.data?.files ?? []).length > 0}
|
||||
<div class="my-2.5 w-full flex overflow-x-auto gap-2 flex-wrap">
|
||||
<div
|
||||
class="my-2.5 w-full flex overflow-x-auto gap-2 flex-wrap"
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
>
|
||||
{#each message?.data?.files as file}
|
||||
<div>
|
||||
{#if file.type === 'image' || (file?.content_type ?? '').startsWith('image/')}
|
||||
|
|
|
|||
|
|
@ -1139,7 +1139,10 @@
|
|||
{/if}
|
||||
|
||||
{#if files.length > 0}
|
||||
<div class="mx-2 mt-2.5 pb-1.5 flex items-center flex-wrap gap-2">
|
||||
<div
|
||||
class="mx-2 mt-2.5 pb-1.5 flex items-center flex-wrap gap-2"
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
>
|
||||
{#each files as file, fileIdx}
|
||||
{#if file.type === 'image'}
|
||||
<div class=" relative group">
|
||||
|
|
|
|||
|
|
@ -666,7 +666,10 @@
|
|||
{/if}
|
||||
|
||||
{#if message?.files && message.files?.filter((f) => f.type === 'image').length > 0}
|
||||
<div class="my-1 w-full flex overflow-x-auto gap-2 flex-wrap">
|
||||
<div
|
||||
class="my-1 w-full flex overflow-x-auto gap-2 flex-wrap"
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
>
|
||||
{#each message.files as file}
|
||||
<div>
|
||||
{#if file.type === 'image'}
|
||||
|
|
|
|||
|
|
@ -188,7 +188,10 @@
|
|||
<div class="chat-{message.role} w-full min-w-full markdown-prose">
|
||||
{#if edit !== true}
|
||||
{#if message.files}
|
||||
<div class="mb-1 w-full flex flex-col justify-end overflow-x-auto gap-1 flex-wrap">
|
||||
<div
|
||||
class="mb-1 w-full flex flex-col justify-end overflow-x-auto gap-1 flex-wrap"
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
>
|
||||
{#each message.files as file}
|
||||
<div class={($settings?.chatBubble ?? true) ? 'self-end' : ''}>
|
||||
{#if file.type === 'image'}
|
||||
|
|
|
|||
Loading…
Reference in a new issue