@@ -53,6 +53,7 @@ const char *intro_message = NULL;
53
53
const char * intro_submessage = NULL ;
54
54
char intro_msg_buf [MAX_CHARS_PER_VALUE1_LINE ];
55
55
char intro_submsg_buf [MAX_CHARS_SUBMSG_LINE ];
56
+ static char approval_label_buf [64 ];
56
57
57
58
#define REVIEW_STANDALONE_SIZE 22
58
59
#define REVIEW_MESSAGE_SIZE 18
@@ -476,7 +477,8 @@ static void config_useCaseReview(nbgl_operationType_t type) {
476
477
} else {
477
478
nbgl_useCaseReview (
478
479
type , & pairList , & C_icon_stax_64 , (intro_message == NULL ? "Review transaction" : intro_message ),
479
- (intro_submessage == NULL ? NULL : intro_submessage ), APPROVE_LABEL_NBGL , reviewTransactionChoice );
480
+ (intro_submessage == NULL ? NULL : intro_submessage ),
481
+ (approval_label_buf [0 ] != '\0' ? approval_label_buf : APPROVE_LABEL_NBGL ), reviewTransactionChoice );
480
482
}
481
483
}
482
484
@@ -497,9 +499,9 @@ static void config_useCaseMessageReview() {
497
499
(intro_message == NULL ? "Review Message" : intro_message ), NULL ,
498
500
"Accept risk and sign message ?" , NULL , reviewMessageChoice );
499
501
} else {
500
- nbgl_useCaseReview (TYPE_MESSAGE , & pairList , & C_Review_64px ,
501
- (intro_message == NULL ? "Review Message" : intro_message ), NULL , APPROVE_LABEL_NBGL_MSG ,
502
- reviewMessageChoice );
502
+ nbgl_useCaseReview (
503
+ TYPE_MESSAGE , & pairList , & C_Review_64px , (intro_message == NULL ? "Review Message" : intro_message ), NULL ,
504
+ ( approval_label_buf [ 0 ] != '\0' ? approval_label_buf : APPROVE_LABEL_NBGL_MSG ), reviewMessageChoice );
503
505
}
504
506
}
505
507
@@ -595,6 +597,25 @@ void view_review_show_with_intent_impl(unsigned int requireReply, const char *in
595
597
}
596
598
intro_message = intro_msg_buf ;
597
599
intro_submessage = NULL ; // No second line for NBGL
600
+
601
+ // Format the approval label with intent for the final approval screen
602
+ const char * sign_text = (review_type == REVIEW_MSG ) ? "Sign message" : "Sign transaction" ;
603
+ ret = snprintf (approval_label_buf , sizeof (approval_label_buf ), "%s to %s?" , sign_text , intent );
604
+
605
+ // Check if truncation occurred and add ellipsis if needed
606
+ if (ret >= (int )sizeof (approval_label_buf )) {
607
+ const size_t buf_len = sizeof (approval_label_buf );
608
+ if (buf_len >= 4 ) {
609
+ approval_label_buf [buf_len - 4 ] = '.' ;
610
+ approval_label_buf [buf_len - 3 ] = '.' ;
611
+ approval_label_buf [buf_len - 2 ] = '.' ;
612
+ approval_label_buf [buf_len - 1 ] = '\0' ;
613
+ }
614
+ }
615
+ } else {
616
+ // Use default labels if no intent
617
+ snprintf (approval_label_buf , sizeof (approval_label_buf ), "%s" ,
618
+ (review_type == REVIEW_MSG ) ? APPROVE_LABEL_NBGL_MSG : APPROVE_LABEL_NBGL );
598
619
}
599
620
600
621
h_paging_init ();
0 commit comments