@@ -199,6 +199,43 @@ async fn goal_slash_command_records_original_command_in_history() {
199199 ) ;
200200}
201201
202+ #[ tokio:: test]
203+ async fn goal_slash_command_records_mentions_in_history ( ) {
204+ let ( mut chat, _rx, mut op_rx) = make_chatwidget_manual ( /*model_override*/ None ) . await ;
205+ chat. set_feature_enabled ( Feature :: GoalMode , /*enabled*/ true ) ;
206+ chat. thread_id = Some ( ThreadId :: new ( ) ) ;
207+ chat. bottom_pane . set_composer_text_with_mention_bindings (
208+ "/goal use $figma for the mockup" . to_string ( ) ,
209+ Vec :: new ( ) ,
210+ Vec :: new ( ) ,
211+ vec ! [ MentionBinding {
212+ mention: "figma" . to_string( ) ,
213+ path: "app://figma" . to_string( ) ,
214+ } ] ,
215+ ) ;
216+
217+ chat. handle_key_event ( KeyEvent :: new ( KeyCode :: End , KeyModifiers :: NONE ) ) ;
218+ chat. handle_key_event ( KeyEvent :: new ( KeyCode :: Esc , KeyModifiers :: NONE ) ) ;
219+ chat. handle_key_event ( KeyEvent :: new ( KeyCode :: Enter , KeyModifiers :: NONE ) ) ;
220+
221+ match next_submit_op ( & mut op_rx) {
222+ Op :: UserTurn { items, .. } => {
223+ let [ UserInput :: Text { text, .. } ] = items. as_slice ( ) else {
224+ panic ! ( "expected one text item, got {items:?}" ) ;
225+ } ;
226+ assert ! (
227+ text. starts_with( "Set the current thread goal" ) ,
228+ "model should receive goal-parser prompt, got {text:?}"
229+ ) ;
230+ }
231+ other => panic ! ( "expected user turn, got {other:?}" ) ,
232+ }
233+ assert_eq ! (
234+ next_add_to_history_op( & mut op_rx) ,
235+ "/goal use [$figma](app://figma) for the mockup"
236+ ) ;
237+ }
238+
202239#[ tokio:: test]
203240async fn goal_slash_command_preserves_attached_images ( ) {
204241 let ( mut chat, _rx, mut op_rx) = make_chatwidget_manual ( /*model_override*/ None ) . await ;
0 commit comments