Skip to content

Commit abf0220

Browse files
authored
codegen-fixes (#10353)
* feat(ui): increase chat message max width from px to 620px * style: add border to markdown blocks and adjust background visibility * Abort CC generation on Ctrl+C * fix(textarea): ensure textarea respects padding when switching to a new line
1 parent 33ed5aa commit abf0220

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

apps/desktop/src/components/codegen/CodegenInput.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@
8787
borderless
8888
maxRows={10}
8989
minRows={2}
90+
onkeydown={(e) => {
91+
// Global gotakey on the button doesn't work inside textarea, so we handle it here
92+
if (e.key === 'c' && e.ctrlKey && onAbort) {
93+
e.preventDefault();
94+
onAbort();
95+
}
96+
}}
9097
/>
9198

9299
<div class="dialog-input__actions">
@@ -102,6 +109,7 @@
102109
style="error"
103110
action={onAbort}
104111
icon="stop"
112+
hotkey="⌃C"
105113
reversedDirection
106114
>
107115
Stop

apps/desktop/src/components/codegen/CodegenPage.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@
10851085
gap: 8px;
10861086
10871087
/* SHARABLE */
1088-
--message-max-width: 520px;
1088+
--message-max-width: 620px;
10891089
}
10901090
10911091
.chat-view {

apps/desktop/src/components/codegen/CodegenUserMessage.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
background-color: var(--clr-bg-2);
4545
text-wrap: wrap;
4646
word-break: break-word;
47+
48+
/* make code blocks visible */
49+
:global(.markdown pre) {
50+
background-color: var(--clr-bg-1);
51+
}
4752
}
4853
4954
.user-icon {

packages/ui/src/lib/components/Textarea.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@
195195
width: 100%;
196196
padding: var(--padding-top) var(--padding-right) var(--padding-bottom) var(--padding-left);
197197
line-height: var(--lineheight-ratio);
198+
scroll-padding: var(--padding-top) var(--padding-right) var(--padding-bottom)
199+
var(--padding-left);
198200
word-wrap: break-word;
199201
white-space: pre-wrap;
200202
}

packages/ui/src/styles/sharable/markdown.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
margin: 1em 0;
7777
padding: 1em;
7878
overflow: auto;
79+
border: 1px solid var(--clr-border-3);
7980
border-radius: var(--radius-m);
8081
background-color: var(--clr-bg-2);
8182
font-size: 92%;

0 commit comments

Comments
 (0)