From d30fde2f4d54e96dacc1dbb96cac5f06c4250017 Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Wed, 24 Jun 2026 16:21:49 -0400 Subject: [PATCH] Add Bluetooth connecting popup message Add new translation string for displaying a popup message while Bluetooth connection is in progress. --- lib/I18n/translations/english.yaml | 1 + src/activities/reader/EpubReaderActivity.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/I18n/translations/english.yaml b/lib/I18n/translations/english.yaml index 7d552ead..c7989712 100644 --- a/lib/I18n/translations/english.yaml +++ b/lib/I18n/translations/english.yaml @@ -296,6 +296,7 @@ STR_BT_PAIRED_DEVICES: "Paired Devices" STR_BT_NO_PAIRED: "No paired devices" STR_BT_MAP_BUTTONS: "Map Remote Buttons" STR_BT_PRESS_REMOTE: "Press a button on your remote" +STR_BT_CONNECTING_POPUP: "BT Connecting" STR_BT_PAGE_FORWARD: "Page Forward" STR_BT_PAGE_BACK: "Page Back" STR_BT_FORGET_PROMPT: "Hold Confirm to forget" diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 8672f812..7946be9d 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -874,7 +874,20 @@ void EpubReaderActivity::render(RenderLock&& lock) { bleinput::stop(); built = buildSection(); const bool bleOk = bleinput::ensureStarted(); - LOG_INF("ERS", "BLE restart after build: begin=%d (auto-reconnect follows)", bleOk); + LOG_INF("ERS", "BLE restart after build: begin=%d", bleOk); + if (bleOk) { + // Show a connecting popup and give the bonded remote a moment to re-link so the + // user isn't left with an unresponsive remote and a silent pause. Bounded: a + // remote that needs a button press to re-advertise won't stall reading — it + // reconnects in the background after we return. The popup is drawn once (e-ink + // holds it) and the page render overwrites it when we resume. + GUI.drawPopup(renderer, tr(STR_BT_CONNECTING_POPUP)); + const unsigned long deadline = millis() + 4000; + while (!BleHid.isConnected() && millis() < deadline) { + BleHid.poll(); + delay(50); + } + } } if (!built) { LOG_ERR("ERS", "Failed to persist page data to SD");