@@ -231,7 +231,11 @@ export class AiRideCommandHandler extends BaseCommandHandler {
231231 // state.lastParams stays as pure AI output; RideService re-parses on confirm.
232232 const previewParams = await this . _enrichWithRouteInfo ( params , state ) ;
233233
234- const previewObj = this . _buildPreviewObject ( previewParams , state ) ;
234+ const creatorProfile = UserProfile . fromTelegramUser ( ctx . from ) ;
235+ const previewObj = this . _buildPreviewObject ( previewParams , state , {
236+ creatorProfile,
237+ language : ctx . lang
238+ } ) ;
235239 const previewText = this . messageFormatter . formatRidePreview ( previewObj , ctx . lang ) ;
236240 const atLimit = state . messageCount >= MAX_DIALOG_MESSAGES ;
237241 const fullText = atLimit
@@ -338,8 +342,9 @@ export class AiRideCommandHandler extends BaseCommandHandler {
338342 * reflects the full final state (existing + changes).
339343 * @param {Object } params - AI-extracted params
340344 * @param {Object|null } state - handler state (used to access existing ride in update mode)
345+ * @param {{creatorProfile?: UserProfile|null, language?: string} } options
341346 */
342- _buildPreviewObject ( params , state = null ) {
347+ _buildPreviewObject ( params , state = null , options = { } ) {
343348 const existingRide = state ?. mode === 'update' ? state . ride : null ;
344349 const routeInputs = params . routes ?? ( params . route ? [ params . route ] : null ) ;
345350 const clearsRoutes = Array . isArray ( routeInputs ) && routeInputs . length === 1 && routeInputs [ 0 ] === '-' ;
@@ -351,7 +356,7 @@ export class AiRideCommandHandler extends BaseCommandHandler {
351356 title : params . title || existingRide ?. title || null ,
352357 date : null ,
353358 category : null ,
354- organizer : params . organizer || existingRide ?. organizer || null ,
359+ organizer : this . _resolvePreviewOrganizer ( params , state , options ) ,
355360 meetingPoint : params . meet || existingRide ?. meetingPoint || null ,
356361 routes : clearsRoutes ? [ ] : ( routeInputs ? ( parsedPreviewRoutes || null ) : getRideRoutes ( existingRide ) ) ,
357362 distance : params . dist ? parseFloat ( params . dist )
@@ -407,6 +412,26 @@ export class AiRideCommandHandler extends BaseCommandHandler {
407412 return preview ;
408413 }
409414
415+ /**
416+ * Resolve organizer for preview using the same creator fallback as ride creation.
417+ * @param {Object } params
418+ * @param {Object|null } state
419+ * @param {{creatorProfile?: UserProfile|null, language?: string} } options
420+ * @returns {string|null }
421+ */
422+ _resolvePreviewOrganizer ( params , state = null , options = { } ) {
423+ const existingRide = state ?. mode === 'update' ? state . ride : null ;
424+ if ( existingRide ) {
425+ return params . organizer || existingRide . organizer || null ;
426+ }
427+
428+ return this . rideService . resolveCreateOrganizer (
429+ params . organizer ,
430+ options . creatorProfile || null ,
431+ { language : options . language }
432+ ) || null ;
433+ }
434+
410435 async _executeRideOperation ( ctx , stateKey , state ) {
411436 const options = { language : ctx . lang } ;
412437 const creatorProfile = UserProfile . fromTelegramUser ( ctx . from ) ;
0 commit comments