Skip to content

fix(epub-reader): select first chapter when opening EPUB for the first time - #3212

Merged
AlexAndBear merged 1 commit into
mainfrom
fix/epub-reader-first-chapter-selection
Aug 24, 2026
Merged

AlexAndBear merged 1 commit into
mainfrom
fix/epub-reader-first-chapter-selection

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

This PR fixes a bug where no chapter was selected in the chapter list when opening an EPUB file for the first time (i.e., when no previous reading location was stored in localStorage).

Changes

  • Modified the relocated event handler in App.vue to set the first chapter as a fallback when resolveCurrentChapter() returns undefined and no chapter is currently selected
  • This ensures users always see which chapter they're currently reading, even on first open

Related Issue

N/A

How Has This Been Tested

Tested locally by:

  • Opening an EPUB file for the first time (clearing localStorage first)
  • Verifying that the first chapter is now highlighted in the chapter list
  • Verifying that navigation still works correctly
  • Verifying that chapter selection still works when reopening a previously read EPUB

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking improvement to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt (code quality, refactoring, documentation)
  • Tests (adding, updating, or removing tests)
  • Documentation (adding, updating, or removing documentation)
  • Maintenance (dependency updates, CI/CD, tooling)

…t time

When an EPUB was opened for the first time (no previous reading location stored),
no chapter was selected in the chapter list. This fix ensures that if chapter
resolution fails and no chapter is currently selected, the first chapter is
automatically selected as a fallback.
@AlexAndBear
AlexAndBear requested a review from kulmann August 24, 2026 13:09
@AlexAndBear
AlexAndBear merged commit 7927070 into main Aug 24, 2026
31 of 32 checks passed
@AlexAndBear
AlexAndBear deleted the fix/epub-reader-first-chapter-selection branch August 24, 2026 13:33
@openclouders openclouders mentioned this pull request Aug 24, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants