Skip to content

fix: don't report cancellation as a sync error; fix accent-text contrast and stark CTA fill - #65

Merged
schmitzkr merged 1 commit into
mainfrom
worktree-reader-fixups
Sep 8, 2026
Merged

schmitzkr merged 1 commit into
mainfrom
worktree-reader-fixups

Conversation

@schmitzkr

Copy link
Copy Markdown
Owner

Three fixes from this session's on-device reader testing:

"StandaloneCoroutine was cancelled" Snackbar on leaving the reader

DebouncedSaver and PageProgressSaver both caught CancellationException
(a subclass of Exception) and reported it through onError as a real
sync failure. Leaving the reader mid-save — a completely normal part of
navigating away — showed that error to the user. Both now rethrow
cancellation instead of reporting it.

Translucent reader controls in dark mode

A side effect of the previous PR: the EPUB reader's chrome was built from
a from-scratch Material scheme instead of the app's own grimScheme(),
losing surfaceTint = Color.Transparent and looking washed-out/translucent
in dark reading themes. Now built with grimScheme() itself, using the
app's actual accent and OLED-black preference (plumbed from Settings via
the ViewModel) — the same colors the rest of the app uses.

"the continue reading button ... comes as stark with white text on the black theme"

Ran a UI/UX audit off this report. Two separate causes:

  • Theme.kt's onColorFor() picked white/near-black button text from a
    flat 0.4 luminance cutoff. All 6 accents fall under that cutoff and get
    white text, but for every single one, near-black text actually contrasts
    roughly twice as well (5.5–7.5:1 vs 2.5–3.4:1). Replaced the cutoff with
    an actual WCAG contrast-ratio comparison, and exported the function so
    the Settings accent-picker's checkmark (which duplicated the same
    white-text logic inline) shares it instead of silently breaking on some
    future accent.
  • The button's large solid-fill block was also just too stark on its own:
    BookDetailScreen's four Continue/Read/Listen/Open-with CTAs used raw
    primary/onPrimary (full-saturation accent, meant for small
    high-emphasis elements) for a 52dp full-width block. Switched to
    primaryContainer/onPrimaryContainer, the softer accent-tinted fill
    grimScheme() already defines for large prominent elements. Button
    height is an intentional, consistent convention shared with both
    Sign-in buttons on the login screen, so left unchanged.

🤖 Generated with Claude Code

…ast and stark CTA fill

Three unrelated fixes surfaced by this session's reader testing:

- DebouncedSaver and PageProgressSaver both caught CancellationException
  (a subclass of Exception) and reported it through onError as if it
  were a real failure, so leaving the reader mid-save -- a completely
  normal part of navigating away -- showed a 'StandaloneCoroutine was
  cancelled' Snackbar. Both now rethrow cancellation instead.

- EpubReaderScreen's chrome (last commit) was built from a from-scratch
  Material scheme instead of the app's own grimScheme(), losing its
  surfaceTint = Color.Transparent and looking translucent in dark
  reading themes. Now built with grimScheme() itself, using the app's
  actual accent/OLED-black preference (plumbed from Settings via the
  ViewModel), same as the rest of the app.

- Theme.kt's onColorFor() picked white/near-black button text from a
  flat 0.4 luminance cutoff. Every one of the 6 accents falls under that
  cutoff and got white text, but for every single one, near-black text
  actually contrasts roughly twice as well (5.5-7.5:1 vs 2.5-3.4:1) --
  a UI/UX audit prompted by 'the continue reading button ... comes as
  stark with white text on the black theme' traced the stark-text half
  of that complaint here. Replaced the cutoff with an actual WCAG
  contrast-ratio comparison, exported the function so SettingsScreen's
  accent-picker checkmark (which duplicated the same white-text logic
  inline) can share it instead of silently breaking on some future
  accent.

- The other half of that complaint -- the button's large solid-fill
  block reading as too stark against a neutral/black page -- is a
  separate, Material3-idiomatic issue: BookDetailScreen's four
  Continue/Read/Listen/Open-with CTAs used raw primary/onPrimary (the
  full-saturation accent, meant for small high-emphasis elements) for a
  52dp full-width block. Switched them to primaryContainer/
  onPrimaryContainer, the softer accent-tinted fill grimScheme() already
  defines for exactly this kind of large prominent element. Button
  height (52dp) is an intentional, consistent convention shared with
  both Sign-in buttons on the login screen, so left unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M421Z8byhEsWKMq7eWWqDN
@schmitzkr
schmitzkr merged commit 77077f7 into main Sep 8, 2026
4 checks passed
@schmitzkr
schmitzkr deleted the worktree-reader-fixups branch September 8, 2026 01:30
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