Skip to content

feat(stats): aggregate synced global stats#176

Closed
uxjulia wants to merge 18 commits into
developmentfrom
feat/synced-global-stats
Closed

feat(stats): aggregate synced global stats#176
uxjulia wants to merge 18 commits into
developmentfrom
feat/synced-global-stats

Conversation

@uxjulia
Copy link
Copy Markdown
Owner

@uxjulia uxjulia commented May 21, 2026

Summary

  • Add peer-to-peer all-time Reading Stats aggregation through /.crosspoint/synced_stats/.
  • Treat synced_stats as opt-in: if the folder exists, each device mirrors local stats to device_<mac>.bin and skips that local contribution while summing the folder; if the folder is absent, no sync folder is created and stats remain local-only.
  • Keep /.crosspoint/global_stats.bin as the local writable source of truth and update Reading Stats entry points, Lyra Carousel cache invalidation, README, file-format docs, and changelog.

Verification

  • ./bin/clang-format-fix
  • pio run -e simulator
  • pio run -e tiny

Hardware check

Without /.crosspoint/synced_stats/, read long enough to trigger a stats save and confirm no sync folder is created. Then create or copy in /.crosspoint/synced_stats/, trigger another stats save, and confirm the device writes device_<mac>.bin. Copy the synced_stats folder between devices, re-enter Home or restart, and confirm Reading Stats shows local totals plus the other devices' contribution files without double-counting the local device.

@uxjulia uxjulia marked this pull request as ready for review May 21, 2026 21:37
@uxjulia
Copy link
Copy Markdown
Owner Author

uxjulia commented May 21, 2026

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@uxjulia uxjulia force-pushed the feat/synced-global-stats branch from 455bbf2 to 8789f86 Compare May 21, 2026 22:05
@uxjulia uxjulia marked this pull request as draft May 21, 2026 22:05
@uxjulia uxjulia force-pushed the feat/synced-global-stats branch from 8789f86 to d245bbc Compare May 21, 2026 22:08
uxjulia added 17 commits May 21, 2026 18:15
* fix: show loading state before opds retry
* feat: add more debugging wifi connection diagnostics
* fix: make opds download cancellation more responsive
* docs: update changelog
Release v1.30 Highlights:

- Adds the Download Font Size Range setting so SD-card fonts can download a range of font sizes instead of installing one fixed size set from upstream Crosspoint repo.
- Swaps font repo from Crosspoint to Crossink's
- Adds OPDS download cancellation, clearer retry/loading feedback, and safer low-memory OPDS handling.
- Adds Recent Books long-press actions for delete, cache delete, completion, and remove-from-recents.
- Adds the Minimal sleep screen, Quick Resume setting changes, and sleep/download reliability improvements.
- Adds the 9pt Itty Bitty reader font size and the new teensy firmware variant.
- Improves EPUB cache stability, low-memory layout behavior, cover thumbnail rendering, and SD-card font handling.
- Fixes WiFi/manual connection flow, saved credential validation, XTC chapter selector crashes, KOReader Sync compatibility, and several reader/Home UI polish issues.
…eader#2101)

## Summary

### **What is the goal of this PR?**
This fixes an unintended settings side effect when cycling the `Sleep
Screen` option through `Quick Resume`.

Previously, selecting `Sleep Screen = Quick Resume` globally forced
`Quick Resume on Timeout = ON` and left it enabled even after the user
toggled `Sleep Screen` to another option within the same settings
session. Now the auto-enable behavior is scoped to the Settings screen
session:

- If `Quick Resume on Timeout` was already `ON` when entering Settings,
it stays `ON`.
- If it was `OFF`, selecting `Sleep Screen = Quick Resume` temporarily
turns it `ON`.
- If the user then switches away from `Quick Resume`, it turns back
`OFF`.

### **What changes are included?**

- Removes the global logic that permanently forced `Quick Resume on
Timeout` to `ON` whenever `Sleep Screen` was set to `Quick Resume`, even
if it was just due to toggling through the options.
- Adds Settings-screen session tracking so `Quick Resume on Timeout` is
only auto-enabled while the user has `Sleep Screen = Quick Resume`.
- Restores `Quick Resume on Timeout` back to `OFF` when the user
switches away, but only if it was `OFF` when they entered Settings.
- Preserves existing `ON` timeout preferences.
- Same behavior applies to the web settings

## Additional Context

- Tested this on device and via the settings UI
---

### 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  >**_
* fix(opds): show more specific opds errors for low memory scenario

* fix(opds): free sd font before catalog loading

* fix: improve font download timeout diagnostics

* fix(opds): show more specific opds errors for low memory scenario

* fix(opds): free sd font before catalog loading

* fix: increase opds transfer buffer back up to 4096 and increase font buffer to 2048kb
@uxjulia uxjulia closed this May 24, 2026
@uxjulia uxjulia deleted the feat/synced-global-stats branch May 24, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant