diff --git a/lib/widgets/contacts/contact_route_dialog.dart b/lib/widgets/contacts/contact_route_dialog.dart index d7a28ae..8e8642d 100644 --- a/lib/widgets/contacts/contact_route_dialog.dart +++ b/lib/widgets/contacts/contact_route_dialog.dart @@ -164,7 +164,12 @@ class _ContactRouteDialogState extends State { } Future _loadHashSizePreference() async { - final hashSize = await RouteHashPreferences.getHashSize(); + // Use the contact's current path hash size if it has a path, + // otherwise fall back to the global preference. + final contactHashSize = widget.contact.hasPath + ? widget.contact.pathHashSize + : null; + final hashSize = contactHashSize ?? await RouteHashPreferences.getHashSize(); if (!mounted) return; setState(() { _selectedHashSize = hashSize; @@ -594,7 +599,7 @@ class _ContactRouteDialogState extends State { ? 'AABB,CCDD' : 'AABBCC,DDEEFF', helperText: - 'Comma-separated hops. Hash size follows global Settings. Colon form like AA:BB is also accepted.', + 'Comma-separated hops using the selected path size. Colon form like AA:BB is also accepted.', errorText: _errorText, border: const OutlineInputBorder(), ), @@ -690,6 +695,32 @@ class _ContactRouteDialogState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Text( + 'Path Size', + style: Theme.of(context).textTheme.labelLarge, + ), + const Spacer(), + SegmentedButton( + segments: [ + for (final size in RouteHashPreferences.supportedSizes) + ButtonSegment( + value: size, + label: Text('${size}B'), + ), + ], + selected: {_selectedHashSize}, + onSelectionChanged: (selection) { + setState(() { + _selectedHashSize = selection.first; + _syncControllerFromSelectedHops(); + }); + }, + ), + ], + ), + const SizedBox(height: 12), Wrap( spacing: 8, runSpacing: 8,