From 78e9c7c733f1faf5a89b9d706f58c215d3d28dbb Mon Sep 17 00:00:00 2001 From: Arthur Tazhitdinov Date: Mon, 2 Feb 2026 18:25:29 +0300 Subject: [PATCH] refactor: Simplify reader menu activity handling by removing suppression logic --- src/activities/reader/EpubReaderActivity.cpp | 16 +--------------- src/activities/reader/EpubReaderActivity.h | 2 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 4c3ac400..18600780 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -136,19 +136,7 @@ void EpubReaderActivity::loop() { return; } - // Enter reader menu activity (suppressed after slider confirm/cancel). - if (suppressMenuOpenOnce) { - // If we're seeing the confirm release that closed the slider, consume it and return. - if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { - suppressMenuOpenOnce = false; - return; - } - // If confirm is no longer pressed and no release is pending, clear suppression. - if (!mappedInput.isPressed(MappedInputManager::Button::Confirm)) { - suppressMenuOpenOnce = false; - } - } - + // Enter reader menu activity. if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { // Don't start activity transition while rendering xSemaphoreTake(renderingMutex, portMAX_DELAY); @@ -382,13 +370,11 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction [this](const int percent) { // Apply the new position and exit back to the reader. jumpToPercent(percent); - suppressMenuOpenOnce = true; exitActivity(); updateRequired = true; }, [this]() { // Cancel selection and return to the reader. - suppressMenuOpenOnce = true; exitActivity(); updateRequired = true; })); diff --git a/src/activities/reader/EpubReaderActivity.h b/src/activities/reader/EpubReaderActivity.h index fa3218dd..76ba95f9 100644 --- a/src/activities/reader/EpubReaderActivity.h +++ b/src/activities/reader/EpubReaderActivity.h @@ -23,8 +23,6 @@ class EpubReaderActivity final : public ActivityWithSubactivity { bool pendingPercentJump = false; // Normalized 0.0-1.0 progress within the target spine item, computed from book percentage. float pendingSpineProgress = 0.0f; - // Prevents the reader menu from reopening due to the confirm button used to exit the slider. - bool suppressMenuOpenOnce = false; bool updateRequired = false; const std::function onGoBack; const std::function onGoHome;