Skip to content

Commit 2f2bc79

Browse files
authored
Merge branch 'main' into fix/thinking-messages-from-posthog
2 parents 17fef06 + 904d8c9 commit 2f2bc79

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

apps/code/src/renderer/constants/keyboard-shortcuts.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,20 @@ export const KEYBOARD_SHORTCUTS: KeyboardShortcut[] = [
137137
category: "panels",
138138
context: "Task detail",
139139
},
140+
{
141+
id: "prompt-history-prev",
142+
keys: "shift+up",
143+
description: "Previous prompt",
144+
category: "editor",
145+
context: "Message editor",
146+
},
147+
{
148+
id: "prompt-history-next",
149+
keys: "shift+down",
150+
description: "Next prompt",
151+
category: "editor",
152+
context: "Message editor",
153+
},
140154
{
141155
id: "editor-bold",
142156
keys: "mod+b",

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
252252
>
253253
<AttachmentsBar attachments={attachments} onRemove={removeAttachment} />
254254

255-
<div className="max-h-[200px] min-h-[50px] flex-1 overflow-y-auto font-mono text-sm">
255+
<div
256+
className="max-h-[200px] min-h-[50px] flex-1 overflow-y-auto font-mono text-sm"
257+
style={{ position: "relative" }}
258+
>
256259
<EditorContent editor={editor} />
257260
</div>
258261

@@ -265,12 +268,12 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
265268
onAttachFiles={onAttachFiles}
266269
/>
267270
{isBashMode && (
268-
<Text size="1" className="font-mono text-accent-11">
271+
<Text size="1" className="ml-2 font-mono text-accent-11">
269272
bash mode
270273
</Text>
271274
)}
272275
</Flex>
273-
<Flex gap="4" align="center">
276+
<Flex gap="2" align="center">
274277
{isLoading && onCancel ? (
275278
<Tooltip content="Stop">
276279
<IconButton

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
157157
const isAtStart = from === 1;
158158
const isAtEnd = from === view.state.doc.content.size - 1;
159159

160-
if (event.key === "ArrowUp" && (isEmpty || isAtStart)) {
160+
const forceNavigate = event.shiftKey;
161+
162+
if (
163+
event.key === "ArrowUp" &&
164+
(forceNavigate || isEmpty || isAtStart)
165+
) {
161166
const queuedContent =
162167
sessionStoreSetters.dequeueMessagesAsText(taskId);
163168
if (queuedContent !== null && queuedContent !== undefined) {
@@ -182,7 +187,10 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
182187
}
183188
}
184189

185-
if (event.key === "ArrowDown" && (isEmpty || isAtEnd)) {
190+
if (
191+
event.key === "ArrowDown" &&
192+
(forceNavigate || isEmpty || isAtEnd)
193+
) {
186194
const newText = historyActions.navigateDown(taskId);
187195
if (newText !== null) {
188196
event.preventDefault();

0 commit comments

Comments
 (0)