Skip to content

Commit a062542

Browse files
authored
fix: Polish message editor, settings dialog and minor UX tweaks (#1468)
## Problem Small UI inconsistencies across the message editor, settings dialog and session indicator. <!-- Who is this for and what problem does it solve? --> <!-- Closes #ISSUE_ID --> ## Changes 1. Refine message editor padding, spacing and add slim custom scrollbar 2. Style hyperlinks in Tiptap editor with accent color and underline 3. Change "interrupt" to "stop" in generating indicator copy 4. Use text cursor for inline editable textarea 5. Make settings scroll area span full panel width with centered content <!-- What did you change and why? --> <!-- If there are frontend changes, include screenshots. --> ## How did you test this? Manually <!-- Describe what you tested -- manual steps, automated tests, or both. --> <!-- If you're an agent, only list tests you actually ran. -->
1 parent 9e0be66 commit a062542

9 files changed

Lines changed: 42 additions & 15 deletions

File tree

.github/workflows/code-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,4 @@ jobs:
220220
env:
221221
GH_TOKEN: ${{ steps.app-token.outputs.token }}
222222
APP_VERSION: ${{ steps.version.outputs.version }}
223-
run: gh release edit "v$APP_VERSION" --repo PostHog/code --draft=false
223+
run: gh release edit "v$APP_VERSION" --repo PostHog/code --draft=false --generate-notes

apps/code/src/renderer/components/action-selector/InlineEditableText.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export function InlineEditableText({
8787
overflow: "auto",
8888
maxHeight: "120px",
8989
wordBreak: "break-word",
90+
cursor: "text",
9091
userSelect: active ? "auto" : "none",
9192
pointerEvents: active ? "auto" : "none",
9293
}}

apps/code/src/renderer/features/message-editor/components/AttachmentsBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export function AttachmentsBar({ attachments, onRemove }: AttachmentsBarProps) {
153153
if (attachments.length === 0) return null;
154154

155155
return (
156-
<Flex gap="1" align="center" className="mb-2 flex-wrap">
156+
<Flex gap="1" align="center" className="flex-wrap pb-1.5">
157157
{attachments.map((att) =>
158158
isImageFile(att.label) ? (
159159
<ImageThumbnail

apps/code/src/renderer/features/message-editor/components/MessageEditor.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,7 @@ function ModeAndBranchRow({
6464
}
6565

6666
return (
67-
<Flex
68-
align="center"
69-
justify="between"
70-
pl="1"
71-
style={{ overflow: "hidden" }}
72-
>
67+
<Flex align="center" justify="between" style={{ overflow: "hidden" }}>
7368
<Flex align="center" gap="2" flexShrink="0">
7469
{isBashMode ? (
7570
<Text
@@ -273,19 +268,19 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
273268
direction="column"
274269
gap="2"
275270
onClick={handleContainerClick}
276-
className={`rounded-md p-2 ${isBashMode ? "ring-1 ring-blue-9" : ""}`}
271+
className={`rounded-md py-2 pr-2 pl-1.5 ${isBashMode ? "ring-1 ring-blue-9" : ""}`}
277272
style={{ cursor: "text" }}
278273
>
279274
<AttachmentsBar attachments={attachments} onRemove={removeAttachment} />
280275

281276
<div
282-
className="max-h-[200px] min-h-[50px] flex-1 overflow-y-auto text-[15px]"
277+
className="-mr-2 cli-editor-scroll max-h-[200px] min-h-[50px] flex-1 overflow-y-auto text-[15px]"
283278
style={{ position: "relative" }}
284279
>
285280
<EditorContent editor={editor} />
286281
</div>
287282

288-
<Flex justify="between" align="center" pl="1">
283+
<Flex justify="between" align="center" className="pt-1.5">
289284
<Flex gap="2" align="center">
290285
<EditorToolbar
291286
disabled={disabled}

apps/code/src/renderer/features/message-editor/components/message-editor.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@
1111
.cli-editor [data-node-view-wrapper] {
1212
display: inline;
1313
}
14+
15+
/* Editor scrollbar - slim, transparent track, hugs right edge */
16+
.cli-editor-scroll::-webkit-scrollbar {
17+
width: 6px;
18+
}
19+
20+
.cli-editor-scroll::-webkit-scrollbar-track {
21+
background: transparent;
22+
}
23+
24+
.cli-editor-scroll::-webkit-scrollbar-thumb {
25+
background: var(--gray-a5);
26+
border-radius: 3px;
27+
}
28+
29+
.cli-editor-scroll::-webkit-scrollbar-thumb:hover {
30+
background: var(--gray-a7);
31+
}

apps/code/src/renderer/features/message-editor/tiptap/useTiptapEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface UseTiptapEditorOptions {
3838
}
3939

4040
const EDITOR_CLASS =
41-
"cli-editor min-h-[1.5em] w-full break-words border-none bg-transparent text-[13px] text-[var(--gray-12)] outline-none [overflow-wrap:break-word] [white-space:pre-wrap] [word-break:break-word]";
41+
"cli-editor min-h-[1.5em] w-full break-words border-none bg-transparent pr-2 text-[13px] text-[var(--gray-12)] outline-none [overflow-wrap:break-word] [white-space:pre-wrap] [word-break:break-word]";
4242

4343
async function pasteTextAsFile(
4444
view: EditorView,

apps/code/src/renderer/features/sessions/components/GeneratingIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export function GeneratingIndicator({
158158
<Brain size={12} className="ph-pulse" />
159159
<Text size="1">{activity}...</Text>
160160
<Text size="1" color="gray">
161-
(Esc to interrupt
161+
(Esc to stop
162162
</Text>
163163
<Circle
164164
size={4}

apps/code/src/renderer/features/settings/components/SettingsDialog.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,13 @@ export function SettingsDialog() {
204204
style={{
205205
height: "100%",
206206
width: "100%",
207-
maxWidth: "800px",
208207
}}
209208
>
210-
<Box p="6" style={{ position: "relative", zIndex: 1 }}>
209+
<Box
210+
p="6"
211+
mx="auto"
212+
style={{ position: "relative", zIndex: 1, maxWidth: "800px" }}
213+
>
211214
<Flex direction="column" gap="4">
212215
<Text size="4" weight="medium">
213216
{CATEGORY_TITLES[activeCategory]}

apps/code/src/renderer/styles/globals.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,16 @@ body {
531531
outline: none;
532532
}
533533

534+
.ProseMirror a {
535+
color: var(--accent-11);
536+
text-decoration: underline;
537+
cursor: pointer;
538+
}
539+
540+
.ProseMirror a:hover {
541+
color: var(--accent-12);
542+
}
543+
534544
.CollapsibleContent {
535545
overflow: hidden;
536546
}

0 commit comments

Comments
 (0)