From 0bd8fc541c02d2535f1ed7890e7aa0936d2b104f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:13:57 +0000 Subject: [PATCH 1/5] Initial plan From ea443be39bbe376d39177728de329971ab796fea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:20:21 +0000 Subject: [PATCH 2/5] Fix text overlay inversion when book cover is selected Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com> --- src/activities/home/HomeActivity.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index 3a97e132..1bc784b0 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -438,14 +438,14 @@ void HomeActivity::render() { const int boxX = (pageWidth - boxWidth) / 2; const int boxY = titleYStart - boxPadding; - // Draw white filled box - renderer.fillRect(boxX, boxY, boxWidth, boxHeight, false); - // Draw black border around the box - renderer.drawRect(boxX, boxY, boxWidth, boxHeight, true); + // Draw box (inverted when selected: black box instead of white) + renderer.fillRect(boxX, boxY, boxWidth, boxHeight, bookSelected); + // Draw border around the box (inverted when selected: white border instead of black) + renderer.drawRect(boxX, boxY, boxWidth, boxHeight, !bookSelected); } for (const auto& line : lines) { - renderer.drawCenteredText(UI_12_FONT_ID, titleYStart, line.c_str(), !bookSelected || coverRendered); + renderer.drawCenteredText(UI_12_FONT_ID, titleYStart, line.c_str(), coverRendered ? bookSelected : !bookSelected); titleYStart += renderer.getLineHeight(UI_12_FONT_ID); } @@ -466,13 +466,13 @@ void HomeActivity::render() { } trimmedAuthor.append("..."); } - renderer.drawCenteredText(UI_10_FONT_ID, titleYStart, trimmedAuthor.c_str(), !bookSelected || coverRendered); + renderer.drawCenteredText(UI_10_FONT_ID, titleYStart, trimmedAuthor.c_str(), coverRendered ? bookSelected : !bookSelected); } // "Continue Reading" label at the bottom const int continueY = bookY + bookHeight - renderer.getLineHeight(UI_10_FONT_ID) * 3 / 2; if (coverRendered) { - // Draw white box behind "Continue Reading" text + // Draw box behind "Continue Reading" text (inverted when selected: black box instead of white) const char* continueText = "Continue Reading"; const int continueTextWidth = renderer.getTextWidth(UI_10_FONT_ID, continueText); constexpr int continuePadding = 6; @@ -480,9 +480,9 @@ void HomeActivity::render() { const int continueBoxHeight = renderer.getLineHeight(UI_10_FONT_ID) + continuePadding; const int continueBoxX = (pageWidth - continueBoxWidth) / 2; const int continueBoxY = continueY - continuePadding / 2; - renderer.fillRect(continueBoxX, continueBoxY, continueBoxWidth, continueBoxHeight, false); - renderer.drawRect(continueBoxX, continueBoxY, continueBoxWidth, continueBoxHeight, true); - renderer.drawCenteredText(UI_10_FONT_ID, continueY, continueText, true); + renderer.fillRect(continueBoxX, continueBoxY, continueBoxWidth, continueBoxHeight, bookSelected); + renderer.drawRect(continueBoxX, continueBoxY, continueBoxWidth, continueBoxHeight, !bookSelected); + renderer.drawCenteredText(UI_10_FONT_ID, continueY, continueText, bookSelected); } else { renderer.drawCenteredText(UI_10_FONT_ID, continueY, "Continue Reading", !bookSelected); } From 62877ca87dfda184648b1c60c025ebbdf90401bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:21:28 +0000 Subject: [PATCH 3/5] Improve code readability with extracted invertText variable Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com> --- src/activities/home/HomeActivity.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index 1bc784b0..92eff6b3 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -444,8 +444,11 @@ void HomeActivity::render() { renderer.drawRect(boxX, boxY, boxWidth, boxHeight, !bookSelected); } + // When cover is shown, invert text colors on selection; without cover, invert normally + const bool invertText = coverRendered ? bookSelected : !bookSelected; + for (const auto& line : lines) { - renderer.drawCenteredText(UI_12_FONT_ID, titleYStart, line.c_str(), coverRendered ? bookSelected : !bookSelected); + renderer.drawCenteredText(UI_12_FONT_ID, titleYStart, line.c_str(), invertText); titleYStart += renderer.getLineHeight(UI_12_FONT_ID); } @@ -466,7 +469,7 @@ void HomeActivity::render() { } trimmedAuthor.append("..."); } - renderer.drawCenteredText(UI_10_FONT_ID, titleYStart, trimmedAuthor.c_str(), coverRendered ? bookSelected : !bookSelected); + renderer.drawCenteredText(UI_10_FONT_ID, titleYStart, trimmedAuthor.c_str(), invertText); } // "Continue Reading" label at the bottom From a72fbdda62af1bd468c9209e6fe76f12db3b2ed2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:22:40 +0000 Subject: [PATCH 4/5] Use consistent invertText variable for all text rendering Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com> --- src/activities/home/HomeActivity.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index 92eff6b3..1eee0436 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -325,6 +325,9 @@ void HomeActivity::render() { } if (hasContinueReading) { + // When cover is shown, invert text colors on selection; without cover, invert normally + const bool invertText = coverRendered ? bookSelected : !bookSelected; + // Split into words (avoid stringstream to keep this light on the MCU) std::vector words; words.reserve(8); @@ -444,9 +447,6 @@ void HomeActivity::render() { renderer.drawRect(boxX, boxY, boxWidth, boxHeight, !bookSelected); } - // When cover is shown, invert text colors on selection; without cover, invert normally - const bool invertText = coverRendered ? bookSelected : !bookSelected; - for (const auto& line : lines) { renderer.drawCenteredText(UI_12_FONT_ID, titleYStart, line.c_str(), invertText); titleYStart += renderer.getLineHeight(UI_12_FONT_ID); @@ -485,9 +485,9 @@ void HomeActivity::render() { const int continueBoxY = continueY - continuePadding / 2; renderer.fillRect(continueBoxX, continueBoxY, continueBoxWidth, continueBoxHeight, bookSelected); renderer.drawRect(continueBoxX, continueBoxY, continueBoxWidth, continueBoxHeight, !bookSelected); - renderer.drawCenteredText(UI_10_FONT_ID, continueY, continueText, bookSelected); + renderer.drawCenteredText(UI_10_FONT_ID, continueY, continueText, invertText); } else { - renderer.drawCenteredText(UI_10_FONT_ID, continueY, "Continue Reading", !bookSelected); + renderer.drawCenteredText(UI_10_FONT_ID, continueY, "Continue Reading", invertText); } } else { // No book to continue reading From d8064009611f78de7e18f4964913a25f3b2543f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:23:16 +0000 Subject: [PATCH 5/5] Improve comment clarity for invertText logic Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com> --- src/activities/home/HomeActivity.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index 1eee0436..ab319d29 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -325,7 +325,9 @@ void HomeActivity::render() { } if (hasContinueReading) { - // When cover is shown, invert text colors on selection; without cover, invert normally + // Invert text colors based on selection state: + // - With cover: selected = white text on black box, unselected = black text on white box + // - Without cover: selected = white text on black card, unselected = black text const bool invertText = coverRendered ? bookSelected : !bookSelected; // Split into words (avoid stringstream to keep this light on the MCU)