feat: Add Chapter Progress Bar status bar option#636
Conversation
|
Can you share some screenshots to show how it looks |
|
Bar shows position in current chapter (or in full txt file, since they don't have chapters) Percentage display is progress in full book/file Centered is chapter title (or text file name) cc: @el |
4436e44 to
58c2d84
Compare
|
I haven't checked the code in detail, but would it work if instead of adding drawChapterProgressBar() function just reuse existing one and send chapter progress number to it? Functions seems to be identical |
Thanks @osteotek. Refactored and then tested on device with both epub and text files in both (book) progress and chapter progress settings and seems to work as expected (i.e., identical to before refactor). I can imagine the value of the two progress bars looking different—for example, many readers offer tick marks on the book progress bar to show where the chapter breaks are—but in the absence of any plan to differentiate the two I think a single function as you suggested is def cleaner. |
|
Looks like this would address idea #593 |
Thank you! I had thought there was an issue and somehow couldn't find it. |
|
Works great on my device
However 2 small observations:
|
Thanks @aaroncunliffe! I re-named the options (and added to the User Guide in this PR) as follows, but I'm not attached to the names:
|
|
The latest changes work great on device, I'll definitely be using this as my default once it's in, nice change @lukestein. One behaviour note: on some books it looks like the bar tracks spine item progress rather than full chapter progress. With an EPUB of The Martian, I can finish a subchapter and the bar resets while still in that same parent chapter. I actually prefer this behaviour since the full chapter title still shows, but flagging it in case it’s unexpected. |
Thanks @aaroncunliffe. I just tried to use the existing values (without really considering a spine/chapter distinction) used to calculate the chapter page display in the old, existing "full" status bar: so I did I'm happy to take a suggestion (from anyone) if there's a better way to do this. |
|
I'm not familiar enough with the underlying EPUB construction just yet to suggest a fix. From your snippet above I've realised I'd suggest leaving it as it is right now, but I am slightly biased as I prefer it this way 😄 |
@aaroncunliffe, I suspect we may have encountered what's behind #383 … |
c3724fc to
13ca27c
Compare
07afa6c to
c3a7898
Compare
|
Testing on device (successfully) with both default and Lyra UI |
## Summary This pull request introduces a new "Chapter Progress Bar" mode to the status bar, allowing users to track their progress within the current chapter in addition to the existing book-level progress options. It also unifies and increases the progress bar height for better visibility, and updates the settings UI to support the new mode. Closes crosspoint-reader#636 **Status Bar/Progress Bar Enhancements:** * Added a new `CHAPTER_PROGRESS_BAR` mode to `CrossPointSettings::STATUS_BAR_MODE`, and updated the settings UI to allow users to select this mode. [[1]](diffhunk://#diff-3af36372bb6233a83387a68091b5e0651c23585c7c0a95669ed893268ca709a8R34) [[2]](diffhunk://#diff-c55df9ec3ade843be000ba463cb75aa3df27dc34620a56c248fc4cc4e917b34bL22-R23) * Implemented `drawChapterProgressBar` in `ScreenComponents` and integrated it into both EPUB and TXT reader activities, so the chapter progress bar is displayed when the new mode is selected. [[1]](diffhunk://#diff-be271778a942f7fab0d920acd73442512346ff811a4625c011275a7ca6be3a3eL51-R64) [[2]](diffhunk://#diff-dd410cab3a363d78172706d2ad6591f327e9b5b05f314db405db31a667af03faL16-R20) [[3]](diffhunk://#diff-82798dedbe135495e619d4aa27a4bef560c70c7663cf43148b67a26ddde45682R518-R525) [[4]](diffhunk://#diff-471ba9d9eb65b1a8451d41246db2aa695a42ea4ae4762163adfda4c20fec0950R563-R567) * Updated logic in EPUB and TXT reader activities to show the correct progress bar, progress text, and battery indicator based on the selected status bar mode, including the new chapter progress bar mode. [[1]](diffhunk://#diff-82798dedbe135495e619d4aa27a4bef560c70c7663cf43148b67a26ddde45682R470-R481) [[2]](diffhunk://#diff-82798dedbe135495e619d4aa27a4bef560c70c7663cf43148b67a26ddde45682L490-R503) [[3]](diffhunk://#diff-471ba9d9eb65b1a8451d41246db2aa695a42ea4ae4762163adfda4c20fec0950R522-R533) [[4]](diffhunk://#diff-471ba9d9eb65b1a8451d41246db2aa695a42ea4ae4762163adfda4c20fec0950L539-R548) **UI/Visual Tweaks:** * Increased the progress bar height from 4 to 6 pixels for improved visibility, and refactored code to use the new constant. [[1]](diffhunk://#diff-dd410cab3a363d78172706d2ad6591f327e9b5b05f314db405db31a667af03faL16-R20) [[2]](diffhunk://#diff-82798dedbe135495e619d4aa27a4bef560c70c7663cf43148b67a26ddde45682L295-R295) [[3]](diffhunk://#diff-471ba9d9eb65b1a8451d41246db2aa695a42ea4ae4762163adfda4c20fec0950L177-R177) These changes collectively provide users with more granular progress tracking options and a clearer visual indicator for reading progress. ## Additional Context --- ### AI Usage Did you use AI tools to help write this code? _**YES**_ --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>



Summary
This pull request introduces a new "Chapter Progress Bar" mode to the status bar, allowing users to track their progress within the current chapter in addition to the existing book-level progress options. It also unifies and increases the progress bar height for better visibility, and updates the settings UI to support the new mode.
Closes #636
Status Bar/Progress Bar Enhancements:
CHAPTER_PROGRESS_BARmode toCrossPointSettings::STATUS_BAR_MODE, and updated the settings UI to allow users to select this mode. [1] [2]drawChapterProgressBarinScreenComponentsand integrated it into both EPUB and TXT reader activities, so the chapter progress bar is displayed when the new mode is selected. [1] [2] [3] [4]UI/Visual Tweaks:
These changes collectively provide users with more granular progress tracking options and a clearer visual indicator for reading progress.
Additional Context
AI Usage
Did you use AI tools to help write this code? YES