Skip to content

Commit 9998a4d

Browse files
committed
chore(Electron template): non-latin text formatting
1 parent 558e2a0 commit 9998a4d

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

templates/electron-typescript-react/src/App/components/ChatHistory/components/ModelResponseThought/ModelResponseThought.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
margin-bottom: 24px;
122122
opacity: 0.64;
123123
padding-left: 24px;
124+
justify-self: flex-start;
124125
position: relative;
125126
overflow: clip;
126127

@@ -133,7 +134,7 @@
133134
width: 4px;
134135
height: 100%;
135136
background-color: var(--message-blockquote-border-color);
136-
inset-inline-start: 0px;
137+
left: 0px;
137138
}
138139

139140
&.hide {

templates/electron-typescript-react/src/App/components/ChatHistory/components/ModelResponseThought/ModelResponseThought.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ export function ModelResponseThought({text, active, duration}: ModelResponseThou
3636
<div className="title">{title}</div>
3737
<RightChevronIconSVG className="chevron" />
3838
</span>
39-
<MarkdownContent className={classNames("excerpt", isOpen && "hide")} inline>{text.slice(-excerptLength)}</MarkdownContent>
39+
<MarkdownContent
40+
className={classNames("excerpt", isOpen && "hide")}
41+
dir="auto"
42+
inline
43+
>
44+
{text.slice(-excerptLength)}
45+
</MarkdownContent>
4046
</button>
4147
<MessageMarkdown className={classNames("content", !isOpen && "hide")} activeDot={active}>{text}</MessageMarkdown>
4248
</div>;

templates/electron-typescript-react/src/App/components/InputRow/InputRow.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@
8282
display: inline;
8383
white-space: pre-wrap;
8484
word-break: break-word;
85+
unicode-bidi: normal;
8586
}
8687

8788
> .completion {
8889
display: inline;
8990
white-space: pre-wrap;
9091
word-break: break-word;
92+
unicode-bidi: normal;
9193
}
9294

9395
> .pressTab {

templates/electron-typescript-react/src/App/components/MarkdownContent/MarkdownContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const md = markdownit({
1818
}
1919
});
2020

21-
export function MarkdownContent({children, inline = false, className}: MarkdownContentProps) {
21+
export function MarkdownContent({children, inline = false, dir, className}: MarkdownContentProps) {
2222
const divRef = useRef<HTMLDivElement>(null);
2323

2424
useLayoutEffect(() => {
@@ -34,11 +34,13 @@ export function MarkdownContent({children, inline = false, className}: MarkdownC
3434
return <div
3535
className={className}
3636
ref={divRef}
37+
dir={dir}
3738
/>;
3839
}
3940

4041
type MarkdownContentProps = {
4142
className?: string,
4243
inline?: boolean,
44+
dir?: string,
4345
children: string
4446
};

templates/electron-typescript-react/src/App/components/MessageMarkdown/MessageMarkdown.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
margin-bottom: 0px;
3131
}
3232

33+
* {
34+
unicode-bidi: plaintext;
35+
}
36+
3337
h2 {
3438
margin: 16px 0px;
3539
padding-top: 24px;

0 commit comments

Comments
 (0)