Skip to content

feat: Add Chapter Progress Bar status bar option#636

Merged
daveallie merged 4 commits intocrosspoint-reader:masterfrom
lukestein:copilot/add-chapter-progress-bar-option
Feb 5, 2026
Merged

feat: Add Chapter Progress Bar status bar option#636
daveallie merged 4 commits intocrosspoint-reader:masterfrom
lukestein:copilot/add-chapter-progress-bar-option

Conversation

@lukestein
Copy link
Contributor

@lukestein lukestein commented Jan 31, 2026

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:

  • 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] [2]
  • 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] [2] [3] [4]
  • 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] [2] [3] [4]

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] [2] [3]

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

@lukestein lukestein changed the title Copilot/add chapter progress bar option feat:Add Chapter Progress Bar status bar option Jan 31, 2026
@lukestein lukestein changed the title feat:Add Chapter Progress Bar status bar option feat: Add Chapter Progress Bar status bar option Jan 31, 2026
@lukestein lukestein marked this pull request as ready for review February 1, 2026 04:04
@el
Copy link
Contributor

el commented Feb 1, 2026

Can you share some screenshots to show how it looks

@lukestein
Copy link
Contributor Author

lukestein commented Feb 1, 2026

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)

image

image

cc: @el

@lukestein lukestein closed this Feb 1, 2026
@lukestein lukestein deleted the copilot/add-chapter-progress-bar-option branch February 1, 2026 13:24
@lukestein lukestein restored the copilot/add-chapter-progress-bar-option branch February 1, 2026 13:27
@lukestein lukestein reopened this Feb 1, 2026
@lukestein lukestein force-pushed the copilot/add-chapter-progress-bar-option branch from 4436e44 to 58c2d84 Compare February 1, 2026 21:33
@osteotek
Copy link
Member

osteotek commented Feb 1, 2026

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

@lukestein
Copy link
Contributor Author

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.

@lukestein lukestein requested a review from osteotek February 1, 2026 22:23
@efenner
Copy link
Contributor

efenner commented Feb 2, 2026

Looks like this would address idea #593

@lukestein
Copy link
Contributor Author

Looks like this would address idea #593

Thank you! I had thought there was an issue and somehow couldn't find it.

@aaroncunliffe
Copy link
Contributor

aaroncunliffe commented Feb 2, 2026

Works great on my device

However 2 small observations:

  • There is documentation for this setting that seems to be missing a few options now USER_GUIDE.md
  • The other options that involve progress bar are Full /w Progress Bar and Progress Bar. Full meaning it includes the battery percentage, chapter name, and book percentage - like this new option does. So does it fit better as Full /w Chapter Progress Bar?

@lukestein
Copy link
Contributor Author

  • There is documentation for this setting that seems to be missing a few options now USER_GUIDE.md
  • The other options that involve progress bar are Full /w Progress Bar and Progress Bar. Full meaning it includes the battery percentage, chapter name, and book percentage - like this new option does. So does it fit better as Full /w Chapter Progress Bar?

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:

Status Bar: Configure the status bar displayed while reading:

  • "None" - No status bar
  • "No Progress" - Show status bar without reading progress
  • "Full w/ Percentage" - Show status bar with book progress (as percentage)
  • "Full w/ Book Bar" - Show status bar with book progress (as bar)
  • "Book Bar Only" - Show book progress (as bar)
  • "Full w/ Chapter Bar" - Show status bar with chapter progress (as bar)

@lukestein lukestein requested a review from osteotek February 2, 2026 20:49
@osteotek osteotek requested a review from a team February 3, 2026 09:53
osteotek
osteotek previously approved these changes Feb 3, 2026
@osteotek osteotek requested a review from a team February 3, 2026 13:59
@aaroncunliffe
Copy link
Contributor

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.

@lukestein
Copy link
Contributor Author

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:

    if (showProgressPercentage) {
      snprintf(progressStr, sizeof(progressStr), "%d/%d  %.0f%%", section->currentPage + 1, section->pageCount,
               bookProgress);
    } else if (showBookPercentage) {
      snprintf(progressStr, sizeof(progressStr), "%.0f%%", bookProgress);
    } else {
      snprintf(progressStr, sizeof(progressStr), "%d/%d", section->currentPage + 1, section->pageCount);
    }

so I did

    const float chapterProgress =
        (section->pageCount > 0) ? (static_cast<float>(section->currentPage + 1) / section->pageCount) * 100 : 0;

I'm happy to take a suggestion (from anyone) if there's a better way to do this.

@lukestein lukestein requested a review from osteotek February 3, 2026 18:36
@aaroncunliffe
Copy link
Contributor

I'm not familiar enough with the underlying EPUB construction just yet to suggest a fix.

From your snippet above I've realised Full w/ Percentage which falls into the else statement also tracks this the same way, so I don't think it's too much of a problem right now. It might only be a small percentage of books structured this way.

I'd suggest leaving it as it is right now, but I am slightly biased as I prefer it this way 😄

@lukestein
Copy link
Contributor Author

I'm not familiar enough with the underlying EPUB construction just yet to suggest a fix.

@aaroncunliffe, I suspect we may have encountered what's behind #383

@lukestein lukestein force-pushed the copilot/add-chapter-progress-bar-option branch from c3724fc to 13ca27c Compare February 5, 2026 14:30
@lukestein lukestein force-pushed the copilot/add-chapter-progress-bar-option branch 2 times, most recently from 07afa6c to c3a7898 Compare February 5, 2026 15:20
@lukestein
Copy link
Contributor Author

Testing on device (successfully) with both default and Lyra UI

@daveallie daveallie merged commit c3b9bc3 into crosspoint-reader:master Feb 5, 2026
5 checks passed
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## 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]>
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.

7 participants