Header: preserve compact channel accessibility state

This commit is contained in:
callebtc 2026-07-30 03:00:49 +02:00
parent 57cc39dbdf
commit 1699cc7986
36 changed files with 47 additions and 36 deletions

View File

@ -96,6 +96,16 @@ internal fun headerCrowdingMode(availableWidth: Dp): HeaderCrowdingMode = when {
else -> HeaderCrowdingMode.Full
}
internal fun locationChannelContentDescription(
actionDescription: String,
channelLabel: String,
showLabel: Boolean,
): String = if (showLabel) {
actionDescription
} else {
"$channelLabel. $actionDescription"
}
/** Corner radius for the header's tappable label+icon clusters. */
private val HeaderClusterShape = RoundedCornerShape(8.dp)
@ -850,7 +860,12 @@ private fun LocationChannelsButton(
} else {
R.drawable.ic_spec_range
}
val contentDescription = stringResource(R.string.cd_open_location_channels)
val actionDescription = stringResource(R.string.cd_open_location_channels)
val contentDescription = locationChannelContentDescription(
actionDescription = actionDescription,
channelLabel = badgeText,
showLabel = showLabel
)
Row(
verticalAlignment = Alignment.CenterVertically,
@ -859,7 +874,7 @@ private fun LocationChannelsButton(
.clip(HeaderClusterShape)
.pressScaleClickable(
onClick = onClick,
onClickLabel = contentDescription
onClickLabel = actionDescription
)
.height(HeaderTapTarget)
.widthIn(min = HeaderTapTarget)

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">يمكن الوصول عبر Nostr</string>
<string name="cd_unread_private_messages">رسائل خاصة غير مقروءة</string>
<string name="cd_teleported">تم الانتقال</string>
<string name="cd_tor_status">حالة Tor</string>
<string name="cd_open_location_channels">فتح إعدادات الموقع والقنوات</string>
<string name="cd_connected_peers">الأقران المتصلون</string>
<string name="cd_geohash_participants">مشاركو geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr এর মাধ্যমে পৌঁছানো যায়</string>
<string name="cd_unread_private_messages">অপঠিত ব্যক্তিগত বার্তা</string>
<string name="cd_teleported">টেলিপোর্ট করা হয়েছে</string>
<string name="cd_tor_status">Tor অবস্থা</string>
<string name="cd_open_location_channels">অবস্থান ও চ্যানেল সেটিংস খুলুন</string>
<string name="cd_connected_peers">সংযুক্ত পিয়ার</string>
<string name="cd_geohash_participants">জিওহ্যাশ অংশগ্রহণকারী</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Über Nostr erreichbar</string>
<string name="cd_unread_private_messages">Ungelesene private Nachrichten</string>
<string name="cd_teleported">Teleportiert</string>
<string name="cd_tor_status">TorStatus</string>
<string name="cd_open_location_channels">Standort- und Kanaleinstellungen öffnen</string>
<string name="cd_connected_peers">Verbundenen Peers</string>
<string name="cd_geohash_participants">GeohashTeilnehmer</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Accesible vía Nostr</string>
<string name="cd_unread_private_messages">Mensajes privados sin leer</string>
<string name="cd_teleported">Teletransportado</string>
<string name="cd_tor_status">Estado de Tor</string>
<string name="cd_open_location_channels">Abrir ajustes de ubicación y canales</string>
<string name="cd_connected_peers">Pares conectados</string>
<string name="cd_geohash_participants">Participantes geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">قابل دسترس از طریق Nostr</string>
<string name="cd_unread_private_messages">پیام‌های خصوصی خوانده‌نشده</string>
<string name="cd_teleported">انتقال مکانی</string>
<string name="cd_tor_status">وضعیت Tor</string>
<string name="cd_open_location_channels">باز کردن تنظیمات مکان و کانال‌ها</string>
<string name="cd_connected_peers">همتایان متصل</string>
<string name="cd_geohash_participants">شرکت‌کنندگان geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Maabot sa Nostr</string>
<string name="cd_unread_private_messages">Hindi nabasang pribadong mensahe</string>
<string name="cd_teleported">Naiteleport</string>
<string name="cd_tor_status">Katayuan ng Tor</string>
<string name="cd_open_location_channels">Buksan ang mga setting ng lokasyon at channel</string>
<string name="cd_connected_peers">Nakakonektang peers</string>
<string name="cd_geohash_participants">Mga kalahok sa geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Joignable via Nostr</string>
<string name="cd_unread_private_messages">Messages privés non lus</string>
<string name="cd_teleported">Téléporté</string>
<string name="cd_tor_status">Statut Tor</string>
<string name="cd_open_location_channels">Ouvrir les réglages de localisation et des canaux</string>
<string name="cd_connected_peers">Pairs connectés</string>
<string name="cd_geohash_participants">Participants geohash</string>

View File

@ -122,7 +122,6 @@
<string name="cd_unread_private_messages">הודעות פרטיות שלא נקראו</string>
<string name="cd_location_notes">הערות מיקום</string>
<string name="cd_teleported">טלפורט</string>
<string name="cd_tor_status">סטטוס Tor</string>
<string name="cd_open_location_channels">פתיחת הגדרות מיקום וערוצים</string>
<string name="cd_connected_peers">עמיתים מחוברים</string>
<string name="cd_geohash_participants">משתתפי geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr के माध्यम से उपलब्ध</string>
<string name="cd_unread_private_messages">अपठित निजी संदेश</string>
<string name="cd_teleported">टेलीपोर्ट हुआ</string>
<string name="cd_tor_status">Tor स्थिति</string>
<string name="cd_open_location_channels">स्थान और चैनल सेटिंग खोलें</string>
<string name="cd_connected_peers">कनेक्टेड पीयर्स</string>
<string name="cd_geohash_participants">geohash प्रतिभागी</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Dapat dijangkau melalui Nostr</string>
<string name="cd_unread_private_messages">Pesan pribadi yang belum dibaca</string>
<string name="cd_teleported">Diteleportasi</string>
<string name="cd_tor_status">Status Tor</string>
<string name="cd_open_location_channels">Buka pengaturan lokasi dan channel</string>
<string name="cd_connected_peers">Peer yang terhubung</string>
<string name="cd_geohash_participants">Peserta geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Raggiungibile via Nostr</string>
<string name="cd_unread_private_messages">Messaggi privati non letti</string>
<string name="cd_teleported">Teletrasportato</string>
<string name="cd_tor_status">Stato Tor</string>
<string name="cd_open_location_channels">Apri le impostazioni di posizione e canali</string>
<string name="cd_connected_peers">Peer connessi</string>
<string name="cd_geohash_participants">Partecipanti geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr 経由で到達可能</string>
<string name="cd_unread_private_messages">未読のプライベートメッセージ</string>
<string name="cd_teleported">テレポート済み</string>
<string name="cd_tor_status">Tor ステータス</string>
<string name="cd_open_location_channels">位置情報とチャンネルの設定を開く</string>
<string name="cd_connected_peers">接続中のピア</string>
<string name="cd_geohash_participants">Geohash 参加者</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">მისაწვდომია Nostr-ით</string>
<string name="cd_unread_private_messages">წაუკითხავი პირადი შეტყობინებები</string>
<string name="cd_teleported">ტელეპორტირებული</string>
<string name="cd_tor_status">Tor-ის სტატუსი</string>
<string name="cd_open_location_channels">მდებარეობისა და არხების პარამეტრების გახსნა</string>
<string name="cd_connected_peers">დაკავშირებული პირები</string>
<string name="cd_geohash_participants">geohash მონაწილეები</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr로 연결 가능</string>
<string name="cd_unread_private_messages">읽지 않은 개인 메시지</string>
<string name="cd_teleported">텔레포트됨</string>
<string name="cd_tor_status">Tor 상태</string>
<string name="cd_open_location_channels">위치 및 채널 설정 열기</string>
<string name="cd_connected_peers">연결된 피어</string>
<string name="cd_geohash_participants">geohash 참여자</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Azo tratrarina amin\'ny alalan\'ny Nostr</string>
<string name="cd_unread_private_messages">Hafatra manokana tsy voavaky</string>
<string name="cd_teleported">Nafindra toerana</string>
<string name="cd_tor_status">Toe-javatra Tor</string>
<string name="cd_open_location_channels">Sokafy ny fikirana toerana sy fantsona</string>
<string name="cd_connected_peers">Mpiara-miasa mifandray</string>
<string name="cd_geohash_participants">Mpandray anjara Geohash</string>

View File

@ -76,7 +76,6 @@
<string name="cd_unread_private_messages">Mesej peribadi belum dibaca</string>
<string name="cd_location_notes">Nota lokasi</string>
<string name="cd_teleported">Diteleport</string>
<string name="cd_tor_status">Status Tor</string>
<string name="cd_open_location_channels">Buka tetapan lokasi dan saluran</string>
<string name="cd_connected_peers">Rakan disambungkan</string>
<string name="cd_geohash_participants">Peserta geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr मार्फत पुग्न सकिने</string>
<string name="cd_unread_private_messages">नपढिएका निजी सन्देश</string>
<string name="cd_teleported">टेलिपोर्ट भयो</string>
<string name="cd_tor_status">Tor स्थिति</string>
<string name="cd_open_location_channels">स्थान र च्यानल सेटिङ खोल्नुहोस्</string>
<string name="cd_connected_peers">जडान भएका साथीहरू</string>
<string name="cd_geohash_participants">Geohash सहभागिहरू</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Bereikbaar via Nostr</string>
<string name="cd_unread_private_messages">Ongelezen privéberichten</string>
<string name="cd_teleported">Geteleporteerd</string>
<string name="cd_tor_status">Tor-status</string>
<string name="cd_open_location_channels">Locatie- en kanaalinstellingen openen</string>
<string name="cd_connected_peers">Verbonden peers</string>
<string name="cd_geohash_participants">Geohash-deelnemers</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr راہین پہنچ ممکن اے</string>
<string name="cd_unread_private_messages">انہ پڑھیا ذاتی پیغام</string>
<string name="cd_teleported">ٹیلپورٹ کیتا گیا</string>
<string name="cd_tor_status">Tor حالت</string>
<string name="cd_open_location_channels">مقام تے چینل دیاں ترتیباں کھولو</string>
<string name="cd_connected_peers">جُڑے پیئر</string>
<string name="cd_geohash_participants">geohash شریک</string>

View File

@ -120,7 +120,6 @@
<string name="cd_unread_private_messages">Nieprzeczytane wiadomości prywatne</string>
<string name="cd_location_notes">Notatki lokalizacji</string>
<string name="cd_teleported">Teleportowany</string>
<string name="cd_tor_status">Status Tor</string>
<string name="cd_open_location_channels">Otwórz ustawienia lokalizacji i kanałów</string>
<string name="cd_connected_peers">Połączeni użytkownicy</string>
<string name="cd_geohash_participants">Uczestnicy geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Acessível via Nostr</string>
<string name="cd_unread_private_messages">Mensagens privadas não lidas</string>
<string name="cd_teleported">Teletransportado</string>
<string name="cd_tor_status">Status do Tor</string>
<string name="cd_open_location_channels">Abrir configurações de localização e canais</string>
<string name="cd_connected_peers">Peers conectados</string>
<string name="cd_geohash_participants">Participantes geohash</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Alcançável via Nostr</string>
<string name="cd_unread_private_messages">Mensagens privadas não lidas</string>
<string name="cd_teleported">Teletransportado</string>
<string name="cd_tor_status">Estado do Tor</string>
<string name="cd_open_location_channels">Abrir definições de localização e canais</string>
<string name="cd_connected_peers">Pares ligados</string>
<string name="cd_geohash_participants">Participantes geohash</string>

View File

@ -66,7 +66,6 @@
<string name="cd_nostr_reachable">Доступен через Nostr</string>
<string name="cd_unread_private_messages">Непрочитанные личные</string>
<string name="cd_teleported">Телепортировано</string>
<string name="cd_tor_status">Статус Tor</string>
<string name="cd_open_location_channels">Открыть настройки местоположения и каналов</string>
<string name="cd_connected_peers">Подключённые узлы</string>
<string name="cd_geohash_participants">Участники geohash</string>

View File

@ -66,7 +66,6 @@
<string name="cd_nostr_reachable">Nås via Nostr</string>
<string name="cd_unread_private_messages">Olästa privata meddelanden</string>
<string name="cd_teleported">Teleporterad</string>
<string name="cd_tor_status">Torstatus</string>
<string name="cd_open_location_channels">Öppna plats- och kanalinställningar</string>
<string name="cd_connected_peers">Anslutna noder</string>
<string name="cd_geohash_participants">Geohashdeltagare</string>

View File

@ -112,7 +112,6 @@
<string name="cd_unread_private_messages">படிக்காத தனிப்பட்ட செய்திகள்</string>
<string name="cd_location_notes">இருப்பிட குறிப்புகள்</string>
<string name="cd_teleported">டெலிபோர்ட் செய்யப்பட்டது</string>
<string name="cd_tor_status">Tor நிலை</string>
<string name="cd_open_location_channels">இருப்பிடம் மற்றும் சேனல் அமைப்புகளைத் திற</string>
<string name="cd_connected_peers">இணைக்கப்பட்ட பியர்ஸ்</string>
<string name="cd_geohash_participants">ஜியோஹாஷ் பங்கேற்பாளர்கள்</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">ติดต่อได้ผ่าน Nostr</string>
<string name="cd_unread_private_messages">ข้อความส่วนตัวยังไม่ได้อ่าน</string>
<string name="cd_teleported">เทเลพอร์ตแล้ว</string>
<string name="cd_tor_status">สถานะ Tor</string>
<string name="cd_open_location_channels">เปิดการตั้งค่าตำแหน่งและช่อง</string>
<string name="cd_connected_peers">เพียร์ที่เชื่อมต่อ</string>
<string name="cd_geohash_participants">ผู้เข้าร่วม geohash</string>

View File

@ -66,7 +66,6 @@
<string name="cd_nostr_reachable">Nostr üzerinden ulaşılabilir</string>
<string name="cd_unread_private_messages">Okunmamış özel mesaj</string>
<string name="cd_teleported">Teleport edildi</string>
<string name="cd_tor_status">Tor durumu</string>
<string name="cd_open_location_channels">Konum ve kanal ayarlarını</string>
<string name="cd_connected_peers">Bağlı eşler</string>
<string name="cd_geohash_participants">Geohash katılımcıları</string>

View File

@ -105,7 +105,6 @@
<string name="cd_unread_private_messages">Непрочитані приватні повідомлення</string>
<string name="cd_location_notes">Нотатки про місце</string>
<string name="cd_teleported">Телепортовано</string>
<string name="cd_tor_status">Статус Tor</string>
<string name="cd_open_location_channels">Відкрити налаштування розташування та каналів</string>
<string name="cd_connected_peers">Підключені піри</string>
<string name="cd_geohash_participants">Учасники геохешу</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Nostr کے ذریعے رسائی</string>
<string name="cd_unread_private_messages">غیر پڑھے ہوئے نجی پیغامات</string>
<string name="cd_teleported">ٹیلی پورٹ</string>
<string name="cd_tor_status">Tor کی کیفیت</string>
<string name="cd_open_location_channels">مقام اور چینل کی ترتیبات کھولیں</string>
<string name="cd_connected_peers">منسلک پیئرز</string>
<string name="cd_geohash_participants">geohash شرکاء</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">Có thể tiếp cận qua Nostr</string>
<string name="cd_unread_private_messages">Tin nhắn riêng chưa đọc</string>
<string name="cd_teleported">Đã dịch chuyển</string>
<string name="cd_tor_status">Trạng thái Tor</string>
<string name="cd_open_location_channels">Mở cài đặt vị trí và kênh</string>
<string name="cd_connected_peers">Peers đã kết nối</string>
<string name="cd_geohash_participants">Người tham gia geohash</string>

View File

@ -121,7 +121,6 @@
<string name="cd_unread_private_messages">未读私信</string>
<string name="cd_location_notes">位置笔记</string>
<string name="cd_teleported">已传送</string>
<string name="cd_tor_status">Tor 状态</string>
<string name="cd_connected_peers">已连接的节点</string>
<string name="cd_geohash_participants">Geohash 参与者</string>
<string name="cd_ready_for_handshake">准备握手</string>

View File

@ -121,7 +121,6 @@
<string name="cd_unread_private_messages">未讀私訊</string>
<string name="cd_location_notes">位置筆記</string>
<string name="cd_teleported">已傳送</string>
<string name="cd_tor_status">Tor 狀態</string>
<string name="cd_connected_peers">已連線的節點</string>
<string name="cd_geohash_participants">地理雜湊參與者</string>
<string name="cd_ready_for_handshake">準備好進行握手</string>

View File

@ -74,7 +74,6 @@
<string name="cd_nostr_reachable">可通过 Nostr 联系</string>
<string name="cd_unread_private_messages">未读私信</string>
<string name="cd_teleported">已传送</string>
<string name="cd_tor_status">Tor 状态</string>
<string name="cd_open_location_channels">打开位置和频道设置</string>
<string name="cd_connected_peers">已连接节点</string>
<string name="cd_geohash_participants">Geohash 参与者</string>

View File

@ -123,7 +123,6 @@
<string name="you">You</string>
<string name="cd_location_notes">Location notes</string>
<string name="cd_teleported">Teleported</string>
<string name="cd_tor_status">Tor status</string>
<string name="cd_open_location_channels">Open location and channel settings</string>
<string name="cd_connected_peers">Connected peers</string>
<string name="cd_geohash_participants">Geohash participants</string>

View File

@ -35,4 +35,34 @@ class ChatHeaderCrowdingTest {
headerCrowdingMode(320.dp)
)
}
@Test
fun `icon-only location action includes the selected channel in its description`() {
val action = "Open location and channel settings"
assertEquals(
action,
locationChannelContentDescription(
actionDescription = action,
channelLabel = "mesh",
showLabel = true
)
)
assertEquals(
"mesh. $action",
locationChannelContentDescription(
actionDescription = action,
channelLabel = "mesh",
showLabel = false
)
)
assertEquals(
"#u33d. $action",
locationChannelContentDescription(
actionDescription = action,
channelLabel = "#u33d",
showLabel = false
)
)
}
}