Skip to content

Commit af15705

Browse files
FEAT
1 parent a4b611d commit af15705

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

src/features/address_book/handle_identity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@ nbgl_contentTagValue_t *get_edit_identifier_tagValue(uint8_t pairIndex) {
367367
break;
368368

369369
case 2:
370-
g_ctx.current_pair.item = "Old address name";
370+
g_ctx.current_pair.item = "Old address";
371371
g_ctx.current_pair.value = g_ctx.edit_identifier.old_identifier;
372372
break;
373373

374374
case 3:
375-
g_ctx.current_pair.item = "New address name";
375+
g_ctx.current_pair.item = "New address";
376376
g_ctx.current_pair.value = g_ctx.edit_identifier.new_identifier;
377377
break;
378378

src/features/address_book/handle_ledger_account.c

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343

4444
/* Private defines -----------------------------------------------------------*/
4545

46+
/** Number of hex chars shown on each side of the middle-truncated address */
47+
#define ADDR_SHORT_HEX_LEN 4
48+
/** "0x" + ADDR_SHORT_HEX_LEN + "..." + ADDR_SHORT_HEX_LEN + '\0' */
49+
#define ADDR_DISPLAY_SHORT_SIZE (2 + ADDR_SHORT_HEX_LEN + 3 + ADDR_SHORT_HEX_LEN + 1)
50+
4651
/* Private types -------------------------------------------------------------*/
4752

4853
/**
@@ -51,6 +56,7 @@
5156
typedef struct {
5257
char *address_display;
5358
char *network_display;
59+
char address_display_short[ADDR_DISPLAY_SHORT_SIZE]; ///< "0x1234...5678"
5460
const char *texts[1];
5561
const char *subTexts[1];
5662
nbgl_warningDetails_t details;
@@ -158,6 +164,7 @@ void display_register_ledger_account_review(nbgl_choiceCallback_t choice_callbac
158164
get_network_icon_from_chain_id(&g_ctx.ledger_account->chain_id);
159165
register_ledger_account_ctx_t *ra = &g_ctx.register_account;
160166

167+
// Full address kept for the details modal (accessible via detail header icon)
161168
ra->texts[0] = "Address";
162169
ra->subTexts[0] = ra->address_display;
163170
ra->details.title = g_ctx.ledger_account->account_name;
@@ -166,13 +173,27 @@ void display_register_ledger_account_review(nbgl_choiceCallback_t choice_callbac
166173
ra->details.barList.texts = ra->texts;
167174
ra->details.barList.subTexts = ra->subTexts;
168175

169-
nbgl_useCaseChoiceWithDetails(icon,
170-
"Confirm name?",
171-
g_ctx.ledger_account->account_name,
172-
"Confirm",
173-
"Cancel",
174-
&ra->details,
175-
choice_callback);
176+
// Middle-truncated address for the subMessage line: "0x1234...5678"
177+
snprintf(ra->address_display_short,
178+
sizeof(ra->address_display_short),
179+
"0x%.*s...%s",
180+
ADDR_SHORT_HEX_LEN,
181+
ra->address_display + 2,
182+
ra->address_display + 2 + ADDRESS_LENGTH_HEX - ADDR_SHORT_HEX_LEN);
183+
184+
nbgl_useCaseAdvancedChoiceWithDetails(icon,
185+
#ifdef SCREEN_SIZE_WALLET
186+
&INFO_I_ICON,
187+
#else
188+
NULL,
189+
#endif
190+
"Confirm name?",
191+
g_ctx.ledger_account->account_name,
192+
ra->address_display_short,
193+
"Confirm",
194+
"Cancel",
195+
&ra->details,
196+
choice_callback);
176197
}
177198

178199
/* =========================================================================

0 commit comments

Comments
 (0)