Repository navigation
chore: Merge upstream - #153
Merged
Merged
Conversation
…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 >**_
…#2336) (crosspoint-reader#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 crosspoint-reader#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.
…sing reading position (crosspoint-reader#2394)
## Summary This PR enhances the EPUB reader's bookmark system with two complementary improvements: a per-page bookmark indicator icon and toggle behavior on the existing long-press action. --- ### What Changed **Bookmark Toggle (was: add-only)** The long-press Confirm action now toggles bookmarks rather than always adding. `addBookmark()` checks whether a bookmark with the same xpath already exists in the in-memory cache: - If found → removes it and shows "Bookmark removed." - If not found → adds it and shows "Bookmark added." A new `STR_BOOKMARK_REMOVED` translation string was added to support the removal message. **Bookmark Icon Indicator** A `BookmarkIcon` is now drawn at the top-right corner of the page whenever the current page has a bookmark. `updateBookmarkFlag()` is called at render time to determine whether the current page is bookmarked. **In-Memory Bookmark Cache** Bookmarks are now loaded into `cachedBookmarks` on `onEnter()` rather than being re-read from disk on every toggle. All subsequent add/remove operations work against this cache and flush to disk, avoiding redundant file reads on each bookmark action. **Faster bookmarks list** Previously, calculating "page X/Y" for each entry required decompressing the entire spine item. We now persist `si`/`pc`/`pp` (spine index, page count, and page progress) in the bookmark JSON when saving, and restore them when loading. This avoids the expensive `toCrossPoint()` loop in `onEnter()`, significantly reducing the cost of initializing the bookmarks list. --- ### Files Changed - `EpubReaderActivity.cpp` — `addBookmark()` toggle logic, `updateBookmarkFlag()` (new), icon rendering in `renderContents()`, cache initialization in `onEnter()` - `EpubReaderActivity.h` — new fields: `currentPageBookmarked`, `bookmarkRemoved`, `cachedBookmarks`; new method declaration `updateBookmarkFlag()` --- ### 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 >**_ --------- Co-authored-by: Julia Nguyen <julia@uxj.io>
…-merge # Conflicts: # USER_GUIDE.md # lib/I18n/translations/catalan.yaml # lib/I18n/translations/english.yaml # lib/I18n/translations/german.yaml # lib/I18n/translations/italian.yaml # lib/I18n/translations/russian.yaml # lib/I18n/translations/slovak.yaml # lib/I18n/translations/spanish.yaml # lib/I18n/translations/swedish.yaml # lib/I18n/translations/ukrainian.yaml # lib/I18n/translations/valencian.yaml # lib/I18n/translations/vietnamese.yaml # lib/Typesetter/Typesetter/Page.cpp # lib/Typesetter/Typesetter/ParsedText.cpp # src/CrossPointSettings.h # src/JsonSettingsIO.cpp # src/activities/reader/EpubReaderActivity.cpp # src/activities/reader/EpubReaderBookmarksActivity.cpp # src/activities/settings/ClockSyncActivity.cpp # src/components/themes/BaseTheme.cpp
Git rename detection carried upstream's lib/Epub/Epub/Page.* changes to lib/Typesetter/Typesetter/Page.* during the merge, but without manifest entries the walk tool reported the files as absent from the fork. chore: Add missing relocations to upstream-sync manifest Audited against git rename detection between the upstream anchor tree and the fork (diff -M --diff-filter=R): six whole-library moves (converters and the BMP converters -> lib/ImageDecoder, hyphenation -> lib/Hyphenation, JsonParser -> lib/JsonIO, and six small libs flattened into lib/Utility) plus the Footnotes/PercentSelection activity .cpp renames were detectable but unlisted, so the walk tool reported their files as absent from the fork.
…tity The page-top (paragraph, listItem) LUT identity only matches a bookmark on the exact page it was added in the exact layout it was added: the bookmarks list resolves entries to max(paragraph page, list-item page), so a bookmark whose list item starts below the top of its landing page rendered as unbookmarked there, and a toggle would duplicate instead of remove. The same mismatch appeared after any relayout. Resolve each of the current spine's bookmarks to a page once per spine load (same max() rule as the list), cache it in the key cache, and compare pages in RAM. This also removes the two SD file opens per page render that the per-render LUT derivation cost. refactor: Use std::optional for bookmark page-resolution tracking bookmarkPagesResolvedForSpine means 'the spine whose keys carry valid resolved pages, if any' - express that as std::optional (same idiom as chapterPageInfo.tocIndex) instead of reusing the PAGE_UNRESOLVED sentinel, which also aliased a theoretical spine index 0xFFFF. The per-key resolvedPage keeps the sentinel: widening every cache entry for an optional buys nothing since it is only read while the member names the current spine.
znelson
force-pushed
the
upstream-merge
branch
from
November 10, 2026 02:12
b3604c2 to
d20fa18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream sync
Upstream commits merged:
29c69b3dfix: automatically connect to wifi for clock sync (#2379)8b9a73a7chore: update Spanish, Catalan, and Valencian translations (#2383)370f87eafeat: add Spacing Modifier Letters range to font presets (#2386)d1e4650efix: don't justify-stretch a leading no-break space (#2185) (#2387)282514f7fix(epub): flush displaced anchor before overwrite (#2336) (#2390)0ce874f8feat: footnote returns to original position on deep sleep (#2392)d1abcc00feat: render grayscale epub images without text aa (#2393)362dcb2afeat: Smooth progressive JPEG cover upscales in BMP conversion (#2398)1db14423fix: several bookmarks UX improvments (#2372)9ad2da09fix: add seven missing hebrew translations (#2409)Resolutions
#2372): semantics ported, model kept. Upstream's toggle-on-repeat (with "Bookmark removed." popup), per-page bookmarked flag, statusbar indicator, and menu TOGGLE_BOOKMARK action are adopted - but re-expressed on our identity-basedBookmarkStore(spineIndex/paragraphIndex/liIndex) instead of their xpath/percentage JSON model. Their whole-entry RAM cache became a 6-byte-per-entry identity-key cache (same goal: no SD reads on page turns). Their JSON save/load, xpath matchers, progress-epsilon helpers, and theSTR_HOLD_OPEN_TO_DELETErename were dropped; the bookmarks list activity stays ours.#2379): adopted - offline manual sync now launches the WiFi picker and resumes. Expressed throughhalWifi(isConnected/disconnect/stop) and oursilentRestart()teardown pattern instead of rawWiFi.*calls.#2185): thewordIdx > 0guard applied in all three positioning loops of our relocated ParsedText (reordered/RTL/LTR), our TextAlign and index-indirect forms.Section::FILE_VERSION29 -> 30 - affected justified lines serialize different positions.#2393): adopted; the new page-element filter helper re-expressed on ourunique_ptrelement vector. ThestoreBwBufferfailure guard adopted (our API already returned bool).#2392): adopted onto oursavedPositionsstack in onExit.STR_BOOKMARK_REMOVEDadded to english, OPDS/feed strings excluded.Follow-up commits on the branch: manifest relocation entries for
Page.*plus thirteen rename-detected library moves (fixes walk-tool classification), and a bookmark-indicator fix - indicator/toggle now match by resolved page (samemax(paragraph page, list-item page)rule the bookmarks list uses) instead of page-top LUT identity. Equality-on-page-top flagged every page topped by the bookmarked paragraph (one bookmark could flag several consecutive pages), went invisible after relayout (stored tops may top no page in the new layout, making toggle duplicate instead of remove), and cost two SD opens per page render. Resolved-page matching gives one invariant: the page the list jumps to is the page that is flagged is the page a toggle removes.Verification