From 29c69b3d8f4a53a82719ae6adb07991c4f04c727 Mon Sep 17 00:00:00 2001 From: Julia Date: Sat, 20 Jun 2026 15:09:28 -0400 Subject: [PATCH 01/12] fix: automatically connect to wifi for clock sync (#2379) ## Summary * **What is the goal of this PR?** * Make manual clock sync work even when the device is not already connected to Wi-Fi, so the user can start the sync flow directly from settings instead of being blocked by connection state. * **What changes are included?** * `ClockSyncActivity` now launches the normal Wi-Fi selection flow before syncing when the device is offline. * After Wi-Fi selection succeeds, clock sync resumes automatically and performs the existing forced NTP sync. * If clock sync had to bring Wi-Fi up, the activity disconnects and uses the existing silent restart cleanup path to avoid leaving the device in a fragmented post-Wi-Fi heap state. * The completion UI now only advertises Back, matching the updated input handling. ## Additional Context * Existing behavior is unchanged when Wi-Fi is already connected: the activity syncs immediately. * Cancelling Wi-Fi selection exits the clock sync flow. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**< YES >**_ --- src/activities/settings/ClockSyncActivity.cpp | 45 ++++++++++++++++--- src/activities/settings/ClockSyncActivity.h | 6 ++- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/activities/settings/ClockSyncActivity.cpp b/src/activities/settings/ClockSyncActivity.cpp index 407af69a41b..496ecde6a53 100644 --- a/src/activities/settings/ClockSyncActivity.cpp +++ b/src/activities/settings/ClockSyncActivity.cpp @@ -10,6 +10,8 @@ #include "CrossPointSettings.h" #include "MappedInputManager.h" +#include "SilentRestart.h" +#include "activities/network/WifiSelectionActivity.h" #include "components/UITheme.h" #include "fontIds.h" @@ -17,14 +19,46 @@ void ClockSyncActivity::onEnter() { Activity::onEnter(); state = SYNCING; syncedTime[0] = '\0'; - requestUpdate(); + + if (WiFi.status() == WL_CONNECTED) { + requestUpdate(); + return; + } + + shouldTearDownWifiOnExit = true; + launchWifiSelection(); +} + +void ClockSyncActivity::onExit() { + Activity::onExit(); + + if (shouldTearDownWifiOnExit && WiFi.getMode() != WIFI_MODE_NULL) { + WiFi.disconnect(false); + delay(30); + silentRestart(); + } } -void ClockSyncActivity::onExit() { Activity::onExit(); } +void ClockSyncActivity::launchWifiSelection() { + LOG_INF("CLK", "Manual sync requested without WiFi, launching WiFi selection"); + startActivityForResult(std::make_unique(renderer, mappedInput), + [this](const ActivityResult& result) { onWifiSelectionComplete(!result.isCancelled); }); +} + +void ClockSyncActivity::onWifiSelectionComplete(const bool connected) { + if (!connected) { + LOG_INF("CLK", "WiFi selection cancelled before manual clock sync"); + finish(); + return; + } + + state = SYNCING; + requestUpdate(); +} void ClockSyncActivity::runSync() { if (WiFi.status() != WL_CONNECTED) { - LOG_INF("CLK", "Manual sync requested but WiFi is not connected"); + LOG_INF("CLK", "Manual sync requested but WiFi is not connected after selection"); state = NO_WIFI; requestUpdate(); return; @@ -59,8 +93,7 @@ void ClockSyncActivity::loop() { return; } - if (mappedInput.wasPressed(MappedInputManager::Button::Back) || - mappedInput.wasPressed(MappedInputManager::Button::Confirm)) { + if (mappedInput.wasPressed(MappedInputManager::Button::Back)) { finish(); } } @@ -100,7 +133,7 @@ void ClockSyncActivity::render(RenderLock&&) { } if (state != SYNCING) { - const auto labels = mappedInput.mapLabels(tr(STR_BACK), tr(STR_OK_BUTTON), "", ""); + const auto labels = mappedInput.mapLabels(tr(STR_BACK), "", "", ""); GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4); } diff --git a/src/activities/settings/ClockSyncActivity.h b/src/activities/settings/ClockSyncActivity.h index 887ee2e529f..06ec956e069 100644 --- a/src/activities/settings/ClockSyncActivity.h +++ b/src/activities/settings/ClockSyncActivity.h @@ -3,7 +3,8 @@ #include "activities/Activity.h" // Manual NTP resync action. Runs a forced sync (bypassing the once-per-device debounce), -// reports success/failure, then waits for Back. Requires WiFi to already be connected. +// reports success/failure, then waits for Back. If WiFi is not connected yet, it reuses the +// normal WiFi selection flow first. class ClockSyncActivity final : public Activity { public: explicit ClockSyncActivity(GfxRenderer& renderer, MappedInputManager& mappedInput) @@ -19,6 +20,9 @@ class ClockSyncActivity final : public Activity { enum State { SYNCING, SUCCESS, NO_WIFI, FAILED }; State state = SYNCING; char syncedTime[16] = {0}; + bool shouldTearDownWifiOnExit = false; void runSync(); + void launchWifiSelection(); + void onWifiSelectionComplete(bool connected); }; From 8b9a73a7350845ceaf0979509fd388f87f89a163 Mon Sep 17 00:00:00 2001 From: Leopoldo Pla Sempere Date: Sat, 20 Jun 2026 23:26:30 +0200 Subject: [PATCH 02/12] chore: update Spanish, Catalan, and Valencian translations (#2384) --- lib/I18n/translations/catalan.yaml | 4 ++++ lib/I18n/translations/spanish.yaml | 6 +++++- lib/I18n/translations/valencian.yaml | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/I18n/translations/catalan.yaml b/lib/I18n/translations/catalan.yaml index 1af9a7a2e89..a3c527ef817 100644 --- a/lib/I18n/translations/catalan.yaml +++ b/lib/I18n/translations/catalan.yaml @@ -77,6 +77,7 @@ STR_LONG_PRESS_BEHAVIOR: "Comportament de prémer llargament el botó" STR_LONG_PRESS_BEHAVIOR_OFF: "Desactivat" STR_LONG_PRESS_BEHAVIOR_SKIP: "Saltar capítols" STR_LONG_PRESS_BEHAVIOR_ORIENTATION: "Canvi d'orientació" +STR_LONG_PRESS_MENU: "Funció de pulsació llarga" STR_FONT_FAMILY: "Tipus de lletra" STR_FONT_SIZE: "Mida de la lletra (UI)" STR_LINE_SPACING: "Interlineat del lector" @@ -138,6 +139,8 @@ STR_INVERTED: "Invertit" STR_LANDSCAPE_CCW: "Horitzontal antihorari" STR_PREV_NEXT: "Anterior/Següent" STR_NEXT_PREV: "Següent/Anterior" +STR_KOSYNC: "KOSync" +STR_BOOKMARK_OPTION: "Punt de llibre" STR_DISABLED: "Desactivats" STR_NOTO_SERIF: "Noto Serif" STR_NOTO_SANS: "Noto Sans" @@ -294,6 +297,7 @@ STR_BOOK_S_STYLE: "Estil del llibre" STR_EMBEDDED_STYLE: "Estil incrustat" STR_FOCUS_READING: "Lectura enfocada" STR_OPDS_SERVER_URL: "URL del servidor OPDS" +STR_PWR_BTN_FOOTNOTE_BACK: "Retorn ràpid des de les notes al peu" STR_FOOTNOTES: "Notes al peu" STR_NO_FOOTNOTES: "No hi ha notes al peu en aquesta pàgina" STR_LINK: "[enllaç]" diff --git a/lib/I18n/translations/spanish.yaml b/lib/I18n/translations/spanish.yaml index fb35eab71c0..b56bdf6abfb 100644 --- a/lib/I18n/translations/spanish.yaml +++ b/lib/I18n/translations/spanish.yaml @@ -77,6 +77,7 @@ STR_LONG_PRESS_BEHAVIOR: "Al mantener pulsado un botón" STR_LONG_PRESS_BEHAVIOR_OFF: "No hacer nada" STR_LONG_PRESS_BEHAVIOR_SKIP: "Saltar capítulo" STR_LONG_PRESS_BEHAVIOR_ORIENTATION: "Cambiar orient." +STR_LONG_PRESS_MENU: "Función de pulsación larga" STR_FONT_PREVIEW_TEXT: "Benjamín pidió una bebida de kiwi y fresa. Noé, sin vergüenza, la más exquisita champaña del menú" STR_FONT_FAMILY: "Tipografía" STR_FONT_SIZE: "Tamaño" @@ -140,6 +141,8 @@ STR_INVERTED: "Invertido" STR_LANDSCAPE_CCW: "Horizontal (antihorario)" STR_PREV_NEXT: "Ant./Sig." STR_NEXT_PREV: "Sig./Ant." +STR_KOSYNC: "KOSync" +STR_BOOKMARK_OPTION: "Marcador" STR_DISABLED: "Desactivados" STR_NOTO_SERIF: "Noto Serif" STR_NOTO_SANS: "Noto Sans" @@ -319,8 +322,9 @@ STR_BOOK_S_STYLE: "Estilo del libro" STR_EMBEDDED_STYLE: "Estilo integrado" STR_FOCUS_READING: "Lectura enfocada" STR_OPDS_SERVER_URL: "URL del servidor OPDS" +STR_PWR_BTN_FOOTNOTE_BACK: "Retorno rápido desde las notas al pie" STR_SET_SLEEP_COVER: "Pant. sus." -STR_FOOTNOTES: "Pie de página" +STR_FOOTNOTES: "Notas al pie" STR_NO_FOOTNOTES: "No hay notas al pie de esta página" STR_LINK: "[enlace]" STR_SLEEP_TIMER_VALUE_FORMAT: "%u min." diff --git a/lib/I18n/translations/valencian.yaml b/lib/I18n/translations/valencian.yaml index d1360f478d6..a4c2f147c0f 100644 --- a/lib/I18n/translations/valencian.yaml +++ b/lib/I18n/translations/valencian.yaml @@ -78,6 +78,7 @@ STR_LONG_PRESS_BEHAVIOR: "Comportament de prémer llargament el botó" STR_LONG_PRESS_BEHAVIOR_OFF: "Desactivat" STR_LONG_PRESS_BEHAVIOR_SKIP: "Saltar capítols" STR_LONG_PRESS_BEHAVIOR_ORIENTATION: "Canvi d'orientació" +STR_LONG_PRESS_MENU: "Funció de pulsació llarga" STR_FONT_PREVIEW_TEXT: "Jove xef, porti whisky amb quinze glaçons d'hidrogen, coi!" STR_FONT_FAMILY: "Família de fonts" STR_FONT_SIZE: "Grandària de la lletra (UI)" @@ -143,6 +144,8 @@ STR_INVERTED: "Invertit" STR_LANDSCAPE_CCW: "Horitzontal antihorari" STR_PREV_NEXT: "Anterior/Següent" STR_NEXT_PREV: "Següent/Anterior" +STR_KOSYNC: "KOSync" +STR_BOOKMARK_OPTION: "Punt de llibre" STR_DISABLED: "Desactivats" STR_NOTO_SERIF: "Noto Serif" STR_NOTO_SANS: "Noto Sans" @@ -298,6 +301,7 @@ STR_BOOK_S_STYLE: "Estil del llibre" STR_EMBEDDED_STYLE: "Estil incrustat" STR_FOCUS_READING: "Lectura enfocada" STR_OPDS_SERVER_URL: "URL del servidor OPDS" +STR_PWR_BTN_FOOTNOTE_BACK: "Retorn ràpid des de les notes al peu" STR_FOOTNOTES: "Notes al peu" STR_NO_FOOTNOTES: "No hi ha notes al peu en esta pàgina" STR_LINK: "[enllaç]" From 370f87ea011e6ad5056fba649eb5674b9d9b1d0b Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Sun, 21 Jun 2026 02:14:42 -0400 Subject: [PATCH 03/12] feat: add Spacing Modifier Letters range to font presets (#2194) --- lib/EpdFont/scripts/fontconvert_sdcard.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/EpdFont/scripts/fontconvert_sdcard.py b/lib/EpdFont/scripts/fontconvert_sdcard.py index e2125be4738..28373b58dad 100755 --- a/lib/EpdFont/scripts/fontconvert_sdcard.py +++ b/lib/EpdFont/scripts/fontconvert_sdcard.py @@ -40,7 +40,8 @@ "ascii": [(0x0020, 0x007E)], "latin1": [(0x0080, 0x00FF)], "latin-ext": [(0x0020, 0x007E), (0x0080, 0x00FF), (0x0100, 0x024F), - (0x1E00, 0x1EFF), (0x2000, 0x206F), (0xFB00, 0xFB06)], + (0x02B0, 0x02FF), (0x1E00, 0x1EFF), (0x2000, 0x206F), + (0xFB00, 0xFB06)], "greek": [(0x0370, 0x03FF), (0x1F00, 0x1FFF)], "cyrillic": [(0x0400, 0x04FF), (0x0500, 0x052F)], "hebrew": [(0x0590, 0x05FF), (0xFB1D, 0xFB4F)], @@ -62,7 +63,7 @@ # Composite preset for English-language literary fiction including scifi/popsci. # Greek for physics terms, math operators, geometric shapes, uncommon # dialogue punctuation, CJK quote marks, miscellaneous symbols (♪♫♬), dingbats. - "reading": [(0x0020, 0x024F), (0x0300, 0x036F), (0x0370, 0x03FF), + "reading": [(0x0020, 0x024F), (0x02B0, 0x02FF), (0x0300, 0x036F), (0x0370, 0x03FF), (0x0400, 0x04FF), (0x1E00, 0x1EFF), (0x2000, 0x206F), (0x2070, 0x209F), (0x20A0, 0x20CF), (0x2150, 0x218F), (0x2190, 0x21FF), (0x2200, 0x22FF), (0x2500, 0x257F), From d1e4650e19638fb74b745df9e09b90f3f29271c5 Mon Sep 17 00:00:00 2001 From: SurprisedDuck Date: Sun, 21 Jun 2026 15:12:14 +0200 Subject: [PATCH 04/12] fix: don't justify-stretch a leading no-break space (#2185) (#2298) --- lib/Epub/Epub/ParsedText.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/Epub/Epub/ParsedText.cpp b/lib/Epub/Epub/ParsedText.cpp index e57d1743467..ebe758db4f6 100644 --- a/lib/Epub/Epub/ParsedText.cpp +++ b/lib/Epub/Epub/ParsedText.cpp @@ -1006,7 +1006,10 @@ void ParsedText::extractLine(const size_t breakIndex, const int pageWidth, const int advance = renderer.getKerning(fontId, lastCodepoint(reorderedWordsScratch[wordIdx]), firstCodepoint(reorderedWordsScratch[wordIdx + 1]), reorderedStylesScratch[wordIdx]); - if (reorderedWordsScratch[wordIdx] == " " && reorderedContinuesScratch[wordIdx] && + // wordIdx > 0 mirrors the gap accounting above (which skips index 0): a leading + // no-break space must not receive justifyExtra, or the line over-stretches by one + // gap and the last word is pushed past the right margin (issue #2185). + if (wordIdx > 0 && reorderedWordsScratch[wordIdx] == " " && reorderedContinuesScratch[wordIdx] && effectiveAlignment == CssTextAlign::Justify && !isLastLine) { advance += reorderedJustifyExtra; } @@ -1048,7 +1051,8 @@ void ParsedText::extractLine(const size_t breakIndex, const int pageWidth, const // Cross-boundary kerning for continuation words int advance = renderer.getKerning(fontId, lastCodepoint(lineWords[wordIdx]), firstCodepoint(lineWords[wordIdx + 1]), lineWordStyles[wordIdx]); - if (lineWords[wordIdx] == " " && continuesVec[lastBreakAt + wordIdx] && + // wordIdx > 0: see the LTR branch — a leading no-break space is not a justifiable gap. + if (wordIdx > 0 && lineWords[wordIdx] == " " && continuesVec[lastBreakAt + wordIdx] && effectiveAlignment == CssTextAlign::Justify && !isLastLine) { advance += justifyExtra; } @@ -1086,7 +1090,10 @@ void ParsedText::extractLine(const size_t breakIndex, const int pageWidth, const int advance = wordWidths[lastBreakAt + wordIdx]; advance += renderer.getKerning(fontId, lastCodepoint(lineWords[wordIdx]), firstCodepoint(lineWords[wordIdx + 1]), lineWordStyles[wordIdx]); - if (lineWords[wordIdx] == " " && continuesVec[lastBreakAt + wordIdx] && + // wordIdx > 0 mirrors the gap accounting above (which skips index 0): a leading + // no-break space must not receive justifyExtra, or the line over-stretches by one + // gap and the last word is pushed past the right margin (issue #2185). + if (wordIdx > 0 && lineWords[wordIdx] == " " && continuesVec[lastBreakAt + wordIdx] && effectiveAlignment == CssTextAlign::Justify && !isLastLine) { advance += justifyExtra; } From 282514f755421d4b07676a922eaf1a934f39012d Mon Sep 17 00:00:00 2001 From: kygia Date: Sun, 21 Jun 2026 13:43:39 -0700 Subject: [PATCH 05/12] fix(epub): flush displaced anchor before overwrite (#2336) (#2382) ## Summary * **What is the goal of this PR?** (e.g., Implements the new feature for file uploading.) Fixes footnote links landing in start section instead of the specific foot note target. * **What changes are included?** ChapterHtmlSlimParser.cpp: call flushPendingAnchor() before overwriting pendingAnchorId. First id got lost due to consecutive non-block elements carry ids, the first id was lost and the reader had no page to jump to, so it defaulted to page 0. ## Additional Context Tested with the epubs attached to to #2336. Need to clear .crosspoint/ cache after flashing so the anchor map gets rebuilt with the fix. * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? Partially assisted with writing documentation. --- lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp index c4b0ccd59e1..bd51f9d2f71 100644 --- a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp +++ b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp @@ -317,6 +317,14 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char* const bool isTocAnchor = std::find(self->tocAnchors.begin(), self->tocAnchors.end(), idValue) != self->tocAnchors.end(); if (isTocAnchor || (!isNonNavigableInlineElement(name) && self->anchorData.size() < MAX_ANCHORS_PER_CHAPTER)) { + // Flush a displaced anchor before overwriting. Consecutive non-block elements + // (e.g.