diff --git a/src/client/src/components/CodeViewer.ts b/src/client/src/components/CodeViewer.ts
index 7523f15..91b132a 100644
--- a/src/client/src/components/CodeViewer.ts
+++ b/src/client/src/components/CodeViewer.ts
@@ -55,6 +55,7 @@ export class CodeViewer extends LitElement {
EditorView.editable.of(false),
EditorView.lineWrapping,
viewerTheme,
+ ...bidiTextExtensions(this.language),
...languageExtensions(this.language),
],
}),
@@ -97,6 +98,19 @@ const viewerTheme = EditorView.theme({
},
});
+const bidiTextTheme = EditorView.theme({
+ ".cm-content": {
+ textAlign: "start",
+ },
+ ".cm-line": {
+ unicodeBidi: "plaintext",
+ },
+});
+
+function bidiTextExtensions(language: string | undefined): Extension[] {
+ return language === "markdown" ? [EditorView.contentAttributes.of({ dir: "auto" }), bidiTextTheme] : [];
+}
+
function languageExtensions(language: string | undefined): Extension[] {
if (language === undefined) return [];
switch (language) {
diff --git a/src/client/src/components/FormattedText.ts b/src/client/src/components/FormattedText.ts
index 259204b..dccf74e 100644
--- a/src/client/src/components/FormattedText.ts
+++ b/src/client/src/components/FormattedText.ts
@@ -9,7 +9,7 @@ export class FormattedText extends LitElement {
@property() text = "";
override render() {
- return html`
${unsafeHTML(toSafeMarkdownHtml(this.text))}
`;
+ return html`${unsafeHTML(toSafeMarkdownHtml(this.text))}
`;
}
override updated(): void {
diff --git a/src/client/src/components/PromptEditor.ts b/src/client/src/components/PromptEditor.ts
index 449c045..ee88588 100644
--- a/src/client/src/components/PromptEditor.ts
+++ b/src/client/src/components/PromptEditor.ts
@@ -433,6 +433,7 @@ const proseInputAssistanceAttributes: Record = {
autocorrect: "on",
autocapitalize: "sentences",
writingsuggestions: "true",
+ dir: "auto",
};
const codeLikeInputAssistanceAttributes: Record = {
@@ -440,6 +441,7 @@ const codeLikeInputAssistanceAttributes: Record = {
autocorrect: "off",
autocapitalize: "off",
writingsuggestions: "false",
+ dir: "auto",
};
function inputAssistanceContentAttributes(draftBeforeCursor: string): Record {
diff --git a/src/client/src/components/SessionList.ts b/src/client/src/components/SessionList.ts
index e2c156d..fea428c 100644
--- a/src/client/src/components/SessionList.ts
+++ b/src/client/src/components/SessionList.ts
@@ -134,7 +134,7 @@ export class SessionList extends LitElement implements KeyboardNavigableSection
const selectedTitle = this.selected?.path ?? selectedSummary;
return html`
-
+
${this.renderCurrentSelectionButton(currentSessions)}
${sessionCount}
@@ -213,7 +213,7 @@ export class SessionList extends LitElement implements KeyboardNavigableSection
>
${showsCheckbox ? html` { event.stopPropagation(); }} @change=${() => { this.toggleSelected(session.id); }}>` : null}
- ${row.depth > 0 ? html`↳` : null}${sessionLabel(session)}${row.depth > 2 ? html` depth ${row.depth}` : null}${row.hasMissingParent ? html` parent unavailable` : null}${this.renderSessionMetaPrefix(session)}${String(session.messageCount)} messages
+ ${row.depth > 0 ? html`↳` : null}${sessionLabel(session)}${row.depth > 2 ? html` depth ${row.depth}` : null}${row.hasMissingParent ? html` parent unavailable` : null}${this.renderSessionMetaPrefix(session)}${String(session.messageCount)} messages
${this.renderActivity(session)}