fix(reader): resolve KOReader sync conflict against non-KOReader servers (#4205)

The sync-conflict dialog had two issues with servers other than KOReader
(e.g. Kavita's KOReader-compatible sync endpoint):

- "This device" preview rendered a bare "undefined" because reflowable
  books built the string from `sectionLabel`, which is empty for spine
  items with no matching TOC entry. It now falls back to the page count.
- Choosing "use remote" closed the dialog but never moved the reader:
  `applyRemoteProgress` only knew how to navigate via CREngine XPointers,
  so non-XPointer progress strings were silently ignored. It now falls
  back to `view.goToFraction` using the reported percentage.

Also fixes the section-title indentation in the dialog (SectionTitle
bakes in `ps-4`, which misaligned the labels against their values).

Closes #4200

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-05-17 23:22:34 +08:00
committed by GitHub
parent 9f0aa2f55d
commit c8fabd331c
6 changed files with 220 additions and 37 deletions
@@ -50,7 +50,7 @@ const KOSyncConflictResolver: React.FC<KOSyncConflictResolverProps> = ({
`as='span'` because this lives inside a button, not as a
document heading; opacity override expresses the
"secondary on this surface" relationship. */}
<SectionTitle as='span' className='!text-base-content/55'>
<SectionTitle as='span' className='!text-base-content/55 !ps-0'>
{_('This device')}
</SectionTitle>
<span className='line-clamp-2 text-sm font-medium leading-snug'>
@@ -72,7 +72,7 @@ const KOSyncConflictResolver: React.FC<KOSyncConflictResolverProps> = ({
{/* On the primary-color button background the default
/65 token would clash; opacity-75 inherits the button's
contrast color and dims it uniformly. */}
<SectionTitle as='span' className='!text-current opacity-75'>
<SectionTitle as='span' className='!ps-0 !text-current opacity-75'>
{remoteDeviceName}
</SectionTitle>
<span className='line-clamp-2 text-sm font-medium leading-snug'>