@@ -48,12 +48,12 @@ export function createButtonHandlers(
4848 deps : ButtonHandlerDeps ,
4949 expandableContent : ExpandableContentMap
5050) : ButtonHandlers {
51- const { messageHistory, handlers, getClaudeSessionId } = deps ;
51+ const { messageHistory, handlers } = deps ;
5252 const { addToHistory, getPreviousMessage, getNextMessage, getState } = messageHistory ;
5353 const { claude : claudeHandlers , git : gitHandlers } = handlers ;
5454
5555 const buttonHandlers : ButtonHandlers = new Map ( [
56- // Cancel Claude session
56+ // Cancel Claude session (kept for programmatic use, no longer on completion buttons)
5757 [ 'cancel-claude' , async ( ctx : InteractionContext ) => {
5858 const cancelled = claudeHandlers . onClaudeCancel ( ctx ) ;
5959 await ctx . update ( {
@@ -66,52 +66,34 @@ export function createButtonHandlers(
6666 } ) ;
6767 } ] ,
6868
69- // Copy session ID button
70- [ 'copy-session' , async ( ctx : InteractionContext ) => {
71- const sessionId = getClaudeSessionId ( ) ;
72- await ctx . update ( {
73- embeds : [ {
74- color : 0x00ff00 ,
75- title : 'Session ID' ,
76- description : sessionId ? `\`${ sessionId } \`` : 'No active session' ,
77- timestamp : true
78- } ]
79- } ) ;
80- } ] ,
81-
82- // Jump to previous message button
83- [ 'jump-previous' , async ( ctx : InteractionContext ) => {
69+ // Prompt history — replaces old "jump-previous"
70+ [ 'prompt-history' , async ( ctx : InteractionContext ) => {
8471 const previousMessage = getPreviousMessage ( ) ;
8572
8673 if ( ! previousMessage ) {
8774 await ctx . update ( {
8875 embeds : [ {
8976 color : 0xffaa00 ,
90- title : '⬆️ No Previous Messages ' ,
91- description : 'No previous messages found in history .' ,
77+ title : '📜 No Prompt History ' ,
78+ description : 'No previous prompts found.' ,
9279 fields : [
93- { name : 'Tip' , value : 'Send some Claude commands to build up your message history! ' , inline : false }
80+ { name : 'Tip' , value : 'Use `/claude` to send prompts — they\'ll appear here for reuse. ' , inline : false }
9481 ] ,
9582 timestamp : true
9683 } ]
9784 } ) ;
9885 return ;
9986 }
10087
101- // Show the previous message with navigation options
10288 const historyState = getState ( ) ;
10389 const historyPosition = historyState . currentIndex + 1 ;
10490 const totalMessages = historyState . history . length ;
10591
10692 await ctx . update ( {
10793 embeds : [ {
10894 color : 0x0099ff ,
109- title : `⬆️ Previous Message (${ historyPosition } /${ totalMessages } )` ,
95+ title : `📜 Prompt History (${ historyPosition } /${ totalMessages } )` ,
11096 description : `\`\`\`\n${ previousMessage } \n\`\`\`` ,
111- fields : [
112- { name : 'Usage' , value : 'Copy this message to use with `/claude prompt:...`' , inline : false } ,
113- { name : 'Navigation' , value : `Position ${ historyPosition } of ${ totalMessages } messages in history` , inline : false }
114- ] ,
11597 timestamp : true
11698 } ] ,
11799 components : [
@@ -120,40 +102,19 @@ export function createButtonHandlers(
120102 components : [
121103 { type : 'button' , customId : 'history-previous' , label : '⬅️ Older' , style : 'secondary' } ,
122104 { type : 'button' , customId : 'history-next' , label : '➡️ Newer' , style : 'secondary' } ,
123- { type : 'button' , customId : 'history-use' , label : '🔄 Use This Message ' , style : 'primary' } ,
105+ { type : 'button' , customId : 'history-use' , label : '▶️ Run This Prompt ' , style : 'primary' } ,
124106 { type : 'button' , customId : 'history-close' , label : '❌ Close' , style : 'danger' }
125107 ]
126108 }
127109 ]
128110 } ) ;
129111 } ] ,
130112
131- // Continue button with session ID
132- [ 'continue' , async ( ctx : InteractionContext ) => {
133- const sessionId = getClaudeSessionId ( ) ;
134- if ( ! sessionId ) {
135- await ctx . update ( {
136- embeds : [ {
137- color : 0xff0000 ,
138- title : '❌ No Session Available' ,
139- description : 'No active session found. Use `/claude` to start a new conversation.' ,
140- timestamp : true
141- } ]
142- } ) ;
143- return ;
144- }
145-
146- await ctx . update ( {
147- embeds : [ {
148- color : 0xffff00 ,
149- title : '➡️ Continue Session' ,
150- description : `Use \`/continue\` or \`/claude session_id:${ sessionId } \` to continue the conversation.` ,
151- fields : [
152- { name : 'Session ID' , value : `\`${ sessionId } \`` , inline : false }
153- ] ,
154- timestamp : true
155- } ]
156- } ) ;
113+ // Legacy alias — old messages may still have jump-previous buttons
114+ [ 'jump-previous' , async ( ctx : InteractionContext ) => {
115+ // Delegate to prompt-history handler
116+ const handler = buttonHandlers . get ( 'prompt-history' ) ;
117+ if ( handler ) await handler ( ctx ) ;
157118 } ] ,
158119
159120 // History navigation - older
@@ -164,8 +125,8 @@ export function createButtonHandlers(
164125 await ctx . update ( {
165126 embeds : [ {
166127 color : 0xffaa00 ,
167- title : '⬅️ No Older Messages ' ,
168- description : 'You\'ve reached the beginning of your message history.' ,
128+ title : '⬅️ No Older Prompts ' ,
129+ description : 'You\'ve reached the beginning of your prompt history.' ,
169130 timestamp : true
170131 } ] ,
171132 components : [ ]
@@ -180,12 +141,8 @@ export function createButtonHandlers(
180141 await ctx . update ( {
181142 embeds : [ {
182143 color : 0x0099ff ,
183- title : `⬅️ Older Message (${ historyPosition } /${ totalMessages } )` ,
144+ title : `📜 Prompt History (${ historyPosition } /${ totalMessages } )` ,
184145 description : `\`\`\`\n${ olderMessage } \n\`\`\`` ,
185- fields : [
186- { name : 'Usage' , value : 'Copy this message to use with `/claude prompt:...`' , inline : false } ,
187- { name : 'Navigation' , value : `Position ${ historyPosition } of ${ totalMessages } messages in history` , inline : false }
188- ] ,
189146 timestamp : true
190147 } ] ,
191148 components : [
@@ -194,7 +151,7 @@ export function createButtonHandlers(
194151 components : [
195152 { type : 'button' , customId : 'history-previous' , label : '⬅️ Older' , style : 'secondary' } ,
196153 { type : 'button' , customId : 'history-next' , label : '➡️ Newer' , style : 'secondary' } ,
197- { type : 'button' , customId : 'history-use' , label : '🔄 Use This Message ' , style : 'primary' } ,
154+ { type : 'button' , customId : 'history-use' , label : '▶️ Run This Prompt ' , style : 'primary' } ,
198155 { type : 'button' , customId : 'history-close' , label : '❌ Close' , style : 'danger' }
199156 ]
200157 }
@@ -210,8 +167,8 @@ export function createButtonHandlers(
210167 await ctx . update ( {
211168 embeds : [ {
212169 color : 0xffaa00 ,
213- title : '➡️ No Newer Messages ' ,
214- description : 'You\'ve reached the end of your message history.' ,
170+ title : '➡️ No Newer Prompts ' ,
171+ description : 'You\'ve reached the end of your prompt history.' ,
215172 timestamp : true
216173 } ] ,
217174 components : [ ]
@@ -226,12 +183,8 @@ export function createButtonHandlers(
226183 await ctx . update ( {
227184 embeds : [ {
228185 color : 0x0099ff ,
229- title : `➡️ Newer Message (${ historyPosition } /${ totalMessages } )` ,
186+ title : `📜 Prompt History (${ historyPosition } /${ totalMessages } )` ,
230187 description : `\`\`\`\n${ newerMessage } \n\`\`\`` ,
231- fields : [
232- { name : 'Usage' , value : 'Copy this message to use with `/claude prompt:...`' , inline : false } ,
233- { name : 'Navigation' , value : `Position ${ historyPosition } of ${ totalMessages } messages in history` , inline : false }
234- ] ,
235188 timestamp : true
236189 } ] ,
237190 components : [
@@ -240,7 +193,7 @@ export function createButtonHandlers(
240193 components : [
241194 { type : 'button' , customId : 'history-previous' , label : '⬅️ Older' , style : 'secondary' } ,
242195 { type : 'button' , customId : 'history-next' , label : '➡️ Newer' , style : 'secondary' } ,
243- { type : 'button' , customId : 'history-use' , label : '🔄 Use This Message ' , style : 'primary' } ,
196+ { type : 'button' , customId : 'history-use' , label : '▶️ Run This Prompt ' , style : 'primary' } ,
244197 { type : 'button' , customId : 'history-close' , label : '❌ Close' , style : 'danger' }
245198 ]
246199 }
@@ -256,8 +209,8 @@ export function createButtonHandlers(
256209 await ctx . update ( {
257210 embeds : [ {
258211 color : 0xff0000 ,
259- title : '❌ No Message Selected' ,
260- description : 'No message available to use .' ,
212+ title : '❌ No Prompt Selected' ,
213+ description : 'No prompt available to run .' ,
261214 timestamp : true
262215 } ] ,
263216 components : [ ]
@@ -268,11 +221,8 @@ export function createButtonHandlers(
268221 await ctx . update ( {
269222 embeds : [ {
270223 color : 0x00ff00 ,
271- title : '🔄 Using Previous Message' ,
272- description : `Running Claude Code with:\n\`\`\`\n${ currentMessage } \n\`\`\`` ,
273- fields : [
274- { name : 'Status' , value : 'Executing...' , inline : false }
275- ] ,
224+ title : '▶️ Running Prompt' ,
225+ description : `\`\`\`\n${ currentMessage } \n\`\`\`` ,
276226 timestamp : true
277227 } ] ,
278228 components : [ ]
0 commit comments