Repository navigation
app/ui: render chat messages with automatic text direction - #16954
Open
tenderdeve wants to merge 2 commits into
Open
tenderdeve wants to merge 2 commits into
tenderdeve wants to merge 2 commits into
Conversation
The qwen3-vl parser always started in the thinking-collection state when the model supported thinking, ignoring the request's think value. With think=false the model emits an answer directly with no </think> tag, so the parser kept treating every token as reasoning and never produced content, ending in finish_reason=length. Pass the think value through to setInitialState and start in the content state when thinking is disabled, matching the qwen3.5 and deepseek3 parsers. Fixes ollama#16945
Assistant and user messages were always laid out left-to-right, so responses in RTL languages (Arabic, Persian, Hebrew, Urdu, ...) were misaligned and hard to read. Set dir="auto" on the user bubble and the assistant markdown container so the browser picks direction per message from its content, while keeping code blocks left-to-right. Fixes ollama#16940
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16940
Assistant and user messages were always rendered left-to-right, so responses in RTL languages (Arabic, Persian, Hebrew, Urdu, Kurdish, ...) came out misaligned and hard to read.
Set
dir="auto"on the user message bubble and the assistant markdown container, so the browser determines direction per message from its first strong character. RTL content lays out right-to-left, LTR content is unchanged, and mixed content is handled by the Unicode bidi algorithm. Code blocks are pinned todir="ltr"so code stays left-aligned inside an RTL message.No new dependencies. Added tests covering the auto direction on message content and the LTR pin on code blocks.