diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 75ec3b7be52b..04dc096db1fb 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -224,6 +224,16 @@ export const PromptInput: Component = (props) => { const inset = 56 const space = `${inset}px` + const isRtl = createMemo(() => { + if (typeof window === "undefined" || !(window as any).api) return false + const text = prompt + .current() + .map((part) => ("content" in part ? part.content : "")) + .join("") + const rtlRegex = /[\u0590-\u05FF\u0600-\u06FF\u0700-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/ + return rtlRegex.test(text) + }) + const scrollCursorIntoView = () => { const container = scrollRef const selection = window.getSelection() @@ -1608,6 +1618,7 @@ export const PromptInput: Component = (props) => { "[&_[data-type=agent]]:text-syntax-type": true, "font-mono!": store.mode === "shell", }} + style={isRtl() ? { direction: "rtl", "text-align": "right" } : undefined} />
= (props) => { "[&_[data-type=agent]]:text-syntax-type": true, "font-mono!": store.mode === "shell", }} - style={{ "padding-bottom": space }} + style={isRtl() ? { direction: "rtl", "text-align": "right", "padding-bottom": space } : { "padding-bottom": space }} />
answers()[i()] ?? [] return (
-
{q.question}
-
{answer().join(", ") || i18n.t("ui.question.answer.none")}
+
+ {q.question} +
+
+ {answer().join(", ") || i18n.t("ui.question.answer.none")} +
) }}