From 422709d5bce99aa243e67d7bd8fc57ada99c6c1c Mon Sep 17 00:00:00 2001 From: Ronen Mars Date: Sat, 25 Jul 2026 23:51:12 +0300 Subject: [PATCH] fix(conversation): restore in-chat search button and repair locale drift The integration branch has never been run through test.yml, so three failures accumulated unnoticed across ~82 commits. PR #425 was the first thing to trigger CI on it, which surfaced them. Type check and Integration tests both traced to app/conversation/[id].tsx. a1e263c1 added LivePauseControl to the header actions and, in resolving that conflict, deleted the in-chat search Pressable that ff28c605 had introduced, while leaving the MagnifyingGlass import, the headerButton styles, the searchBarState hook, and the test coverage all in place. The same commit also dropped the makeSearchStyles import while keeping its call site, which is the TS2552 error. Restore both: the import and the search button, verbatim from a1e263c1's parent. i18n unused keys flagged three keys with no remaining code reference. b75dfb87 pruned connect.step1 and connect.step2 as dead, but ConnectStep.tsx still renders all three steps as a numbered sequence, so step3 rendered alone after a gap. Restore step1 and step2 in all four locales from their pre-prune text. Drop onboarding.connect.footnote and servers.dialog.removeDismiss, which are genuinely unreferenced. conversation.search.open is left as-is: it labels the restored search button, so it was never dead. --- app/conversation/[id].tsx | 17 +++++++++++++++++ locales/ar/onboarding.json | 3 ++- locales/ar/servers.json | 3 +-- locales/en/onboarding.json | 3 ++- locales/en/servers.json | 3 +-- locales/he/onboarding.json | 3 ++- locales/he/servers.json | 3 +-- locales/ru/onboarding.json | 3 ++- locales/ru/servers.json | 3 +-- 9 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/conversation/[id].tsx b/app/conversation/[id].tsx index aa56aa42..0094f116 100644 --- a/app/conversation/[id].tsx +++ b/app/conversation/[id].tsx @@ -26,6 +26,7 @@ import { MessageSkeletonRow } from '@/components/conversation/MessageSkeletonRow import { SlowLoadingBanner } from '@/components/conversation/SlowLoadingBanner' import { ConversationHistoryList } from '@/components/conversation/ConversationHistoryList' import { ConversationSearchView } from '@/components/conversation/ConversationSearchView' +import { makeStyles as makeSearchStyles } from '@/components/sessions/SearchStyles' import { useLoadingStateStore } from '@/stores/loading-state' import { useConversation } from '@/hooks/useConversations' import { useConversationStream } from '@/hooks/useConversationStream' @@ -528,6 +529,22 @@ export default function ConversationDetailScreen() { const headerActions = ( {isLive ? : null} + setSearchBarState((prev) => ({ ...prev, open: !prev.open }))} + hitSlop={8} + accessibilityLabel={t('search.open')} + testID="conversation-search-btn" + style={({ pressed }) => [ + styles.headerButton, + searchOpen && styles.headerButtonActive, + { opacity: pressed ? 0.5 : 1 }, + ]} + > + + { void toggleFavorite() diff --git a/locales/ar/onboarding.json b/locales/ar/onboarding.json index c24241f0..f6d98ac4 100644 --- a/locales/ar/onboarding.json +++ b/locales/ar/onboarding.json @@ -27,7 +27,6 @@ "qrHeadline": "امسح للإقران.", "openCamera": "فتح الكاميرا", "ready": "✓ جاهز", - "footnote": "// على سطح مكتبك، شغّل tb pair لطباعة توكن.", "manualSectionLabel": "على جهازك", "manualSectionHint": "افتح Terminal وشغّل:", "manualSectionPasteHint": "يطبع URL + رمزًا (أو رابط threadbase://) — الصق أدناه.", @@ -40,6 +39,8 @@ "connectBusy": "…جارٍ الاتصال", "connectErrHint": "انتهت صلاحية الرمز؟ شغّل tb pair مجدداً على جهازك.", "backToOptions": "← خيارات أخرى", + "step1": "1. على خادمك، شغّل tb pair. سيُطبَع رمز QR في الطرفية.", + "step2": "2. اضغط على فتح الكاميرا بالأسفل. سيطلب Threadbase إذنًا لاستخدام الكاميرا — يُستخدم فقط لقراءة رمز QR.", "step3": "3. وجّه هاتفك نحو رمز QR. الرمز صالح لمدة 3 دقائق؛ إن انتهت صلاحيته، شغّل tb pair مجدداً." }, "done": { diff --git a/locales/ar/servers.json b/locales/ar/servers.json index e0b34947..df51dd88 100644 --- a/locales/ar/servers.json +++ b/locales/ar/servers.json @@ -14,8 +14,7 @@ "dialog": { "removeTitle": "إزالة الخادم", "removeMessage": "قطع الاتصال بـ {{server}}؟", - "removeConfirm": "إزالة", - "removeDismiss": "إلغاء" + "removeConfirm": "إزالة" }, "form": { "labelOptional": "التسمية (اختياري)", diff --git a/locales/en/onboarding.json b/locales/en/onboarding.json index 98c392f2..04e6c1a9 100644 --- a/locales/en/onboarding.json +++ b/locales/en/onboarding.json @@ -25,7 +25,6 @@ "qrHeadline": "Scan to pair.", "openCamera": "Open camera", "ready": "✓ ready", - "footnote": "// On your desktop, run tb pair to print a token.", "manualSectionLabel": "On your computer", "manualSectionHint": "Open Terminal and run:", "manualSectionPasteHint": "It prints a URL + token (or a threadbase:// link) — paste below.", @@ -40,6 +39,8 @@ "connectBusy": "…connecting", "connectErrHint": "Token expired? Run tb pair again on your computer.", "backToOptions": "← Other options", + "step1": "1. On your server, run tb pair. A QR will print to the terminal.", + "step2": "2. Tap Open camera below. Threadbase will ask permission to use the camera — that's only used to read the QR.", "step3": "3. Point your phone at the QR. The pair token is valid for 3 minutes; if it expires, just run tb pair again." }, "done": { diff --git a/locales/en/servers.json b/locales/en/servers.json index 56c37284..f8b5ca2e 100644 --- a/locales/en/servers.json +++ b/locales/en/servers.json @@ -14,8 +14,7 @@ "dialog": { "removeTitle": "Remove Server", "removeMessage": "Disconnect from {{server}}?", - "removeConfirm": "Remove", - "removeDismiss": "Cancel" + "removeConfirm": "Remove" }, "form": { "labelOptional": "Label (optional)", diff --git a/locales/he/onboarding.json b/locales/he/onboarding.json index 6c2acb8a..19bb74ca 100644 --- a/locales/he/onboarding.json +++ b/locales/he/onboarding.json @@ -27,7 +27,6 @@ "qrHeadline": "סרוק כדי לזווג.", "openCamera": "פתח מצלמה", "ready": "✓ מוכן", - "footnote": "// על שולחן העבודה שלך, הרץ tb pair כדי להדפיס טוקן.", "manualSectionLabel": "במחשב שלך", "manualSectionHint": "פתח טרמינל והרץ:", "manualSectionPasteHint": "הוא מדפיס URL + טוקן (או קישור threadbase://) — הדבק למטה.", @@ -40,6 +39,8 @@ "connectBusy": "…מתחבר", "connectErrHint": "פג תוקף הטוקן? הרץ tb pair שוב במחשב.", "backToOptions": "← אפשרויות אחרות", + "step1": "1. על השרת שלך, הרץ tb pair. QR יודפס לטרמינל.", + "step2": "2. הקש על פתח מצלמה למטה. Threadbase תבקש הרשאה להשתמש במצלמה — היא משמשת רק לקריאת ה-QR.", "step3": "3. כוון את הטלפון ל-QR. הטוקן תקף ל-3 דקות; אם פג, הרץ tb pair שוב." }, "done": { diff --git a/locales/he/servers.json b/locales/he/servers.json index a96aec54..1a65706b 100644 --- a/locales/he/servers.json +++ b/locales/he/servers.json @@ -14,8 +14,7 @@ "dialog": { "removeTitle": "הסר שרת", "removeMessage": "להתנתק מ-{{server}}?", - "removeConfirm": "הסר", - "removeDismiss": "ביטול" + "removeConfirm": "הסר" }, "form": { "labelOptional": "תווית (אופציונלי)", diff --git a/locales/ru/onboarding.json b/locales/ru/onboarding.json index a05b4c31..baf26d91 100644 --- a/locales/ru/onboarding.json +++ b/locales/ru/onboarding.json @@ -27,7 +27,6 @@ "qrHeadline": "Сканируйте для сопряжения.", "openCamera": "Открыть камеру", "ready": "✓ готово", - "footnote": "// На вашем компьютере запустите tb pair, чтобы вывести токен.", "manualSectionLabel": "На вашем компьютере", "manualSectionHint": "Откройте Терминал и запустите:", "manualSectionPasteHint": "Он выведет URL + токен (или ссылку threadbase://) — вставьте ниже.", @@ -40,6 +39,8 @@ "connectBusy": "…подключение", "connectErrHint": "Токен истёк? Снова выполните tb pair на компьютере.", "backToOptions": "← Другие варианты", + "step1": "1. На вашем сервере запустите tb pair. QR выведется в терминал.", + "step2": "2. Нажмите Открыть камеру ниже. Threadbase запросит разрешение на использование камеры — она используется только для чтения QR.", "step3": "3. Наведите телефон на QR. Токен действует 3 минуты; если истёк — снова выполните tb pair." }, "done": { diff --git a/locales/ru/servers.json b/locales/ru/servers.json index 68bf4fff..ece3067d 100644 --- a/locales/ru/servers.json +++ b/locales/ru/servers.json @@ -14,8 +14,7 @@ "dialog": { "removeTitle": "Удалить сервер", "removeMessage": "Отключиться от {{server}}?", - "removeConfirm": "Удалить", - "removeDismiss": "Отмена" + "removeConfirm": "Удалить" }, "form": { "labelOptional": "Метка (необязательно)",