Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit c0fae5f

Browse files
committed
hint option arrows on first prompt recall
1 parent dcdbccf commit c0fae5f

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎packages/ui/src/features/message-editor/tiptap/useTiptapEditor.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import {
1818
isUrlOnly,
1919
shouldAutoConvertLongText,
2020
} from "@posthog/core/message-editor/paste";
21+
import {
22+
formatHotkey,
23+
SHORTCUTS,
24+
} from "@posthog/ui/features/command/keyboard-shortcuts";
2125
import type { PromptRecallHandler } from "@posthog/ui/features/sessions/components/chat-thread/composerPromptRecall";
2226
import { sessionStoreSetters } from "@posthog/ui/features/sessions/sessionStore";
2327
import { useSettingsStore as useFeatureSettingsStore } from "@posthog/ui/features/settings/settingsStore";
@@ -180,6 +184,16 @@ function hasVisibleSuggestionPopup(sessionId: string): boolean {
180184
);
181185
}
182186

187+
function showMessageNavHint(): void {
188+
const store = useFeatureSettingsStore.getState();
189+
if (!store.shouldShowHint("recall-message-nav")) return;
190+
store.recordHintShown("recall-message-nav");
191+
toast.info(
192+
"Recalled a sent prompt",
193+
`Use ${formatHotkey(SHORTCUTS.MESSAGE_PREV)} and ${formatHotkey(SHORTCUTS.MESSAGE_NEXT)} to jump between your messages in the conversation.`,
194+
);
195+
}
196+
183197
function showPasteHint(message: string, description: string): void {
184198
const store = useFeatureSettingsStore.getState();
185199
const key =
@@ -394,6 +408,7 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
394408
if (result.kind === "recall") {
395409
if (result.fresh) {
396410
promptRecallDraftRef.current = view.state.doc;
411+
showMessageNavHint();
397412
}
398413
const tr = view.state.tr
399414
.delete(1, view.state.doc.content.size - 1)

‎packages/ui/src/features/sessions/components/ConversationView.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export function ConversationView({
282282

283283
const handleNavigateMessage = useCallback(
284284
(direction: -1 | 1) => {
285+
useSettingsStore.getState().markHintLearned("recall-message-nav");
285286
if (userMessages.length === 0) return;
286287

287288
const currentIndex = keyboardFocusedMessageId

‎packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ function ThreadKeyboardNav({
854854

855855
const handleNavigateMessage = useCallback(
856856
(direction: -1 | 1) => {
857+
useSettingsStore.getState().markHintLearned("recall-message-nav");
857858
if (userMessageIds.length === 0) return;
858859

859860
const currentIndex = keyboardFocusedMessageId

0 commit comments

Comments
 (0)