Skip to content

Reader: way back after jumps, previewing progress bar, short phone text settings, fixes; Android widgets - #11

Merged
Mischou01 merged 2 commits into
mainfrom
claude/selection-text-display-bugs-anh4fo
Oct 26, 2026
Merged

Mischou01 merged 2 commits into
mainfrom
claude/selection-text-display-bugs-anh4fo

Conversation

@Mischou01

@Mischou01 Mischou01 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Two batches, one commit each: reader features and fixes, then Android home-screen widgets. "Squash and merge" turns them into one commit on main.

Reader

A way back after jumps

  • After a jump, a small "Back to Chapter 3" pill offers the way back. Jumps are:
    • Contents (a chapter, bookmark or highlight)
    • a search result
    • a link in the book (footnotes stay in their popover)
    • the progress bar
    • another device's position
  • The pill comes and goes with the toolbar. On the desktop it sits in the middle of the footer's line, clear of the toasts; on phones it sits under the top toolbar.
  • Several jumps in a row keep the way back to where you were reading.
  • The pill goes away after you go back, after three page turns at the new place, or when you page back there yourself.
  • A jump that lands on the same page offers nothing.
  • Alt+← goes back too. On Android, the back gesture goes back there before it leaves the book.
  • The logic is pure and tested: src/reader/jumpBack.ts.

A progress bar that previews

  • Dragging no longer moves through the book as you drag. A bubble names the chapter and percentage it would land at, and the jump happens on letting go.
  • On the desktop, pointing at the bar shows the same bubble.
  • Chapter starts show as hairline notches.

Text settings on phones

  • The sheet opens short (theme, size, line spacing), so the page stays visible while you change them. "More options" opens the rest.
  • The settings are in the same order everywhere, and "Two pages on wide windows" is hidden on phones.

Fixes

  • Search outlines are cleared however the search sheet closes. Picking a result on a phone, tapping the page or opening another sheet left every match outlined.
  • The search match's mark stays while it's on screen; a tap on a touch screen used to remove it.
  • Contents lists bookmarks and highlights in book order.
  • Arrow keys in scrolling mode scroll wherever the focus is.
  • Layout attributes are only set when they change. Opening and closing a sheet used to re-lay out the book, 8 times for one sheet on a phone.
  • The definition lookup no longer gets stuck on "Looking it up…" in development.
  • Unused styles are removed.

Android widgets

What they show

  • Continue reading (4×2, resizable): the cover, title, chapter, a progress bar and "34% · 9 min left in chapter". Narrow, the cover over a small ring with the percentage. A tap opens the book.
  • Reading goal (2×2): today's minutes in a ring against your daily goal, and the streak. A tap opens Stats. It redraws just after midnight, when the day starts again.
  • Reading now (4×2): the covers of the books you're reading, most recent first, as many as fit the width, each over its progress. A tap on one opens it.

How they look

  • The book's cover colours glow from either side over the Paper or Dusk surface, as on the app's toolbar and sheets.
  • They follow the system's dark mode.
  • Progress takes the book's accent.
  • From Android 12, they use the launcher's corner radius and its own day and night switching.

How they work

  • Snapshot: the app sends one whenever its reading data changes (src/state/widgets.ts, tested). While a book is open the widgets aren't visible, so it waits until you leave the book or the app.
  • Covers: Rust adds each book's cover file. Widgets.kt keeps the snapshot and draws from it, scaling covers down to stay within the size limit of a widget update.
  • Taps: a tap leaves an open request. The UI takes it when it starts, or on an app:open-request event if the app is already running.
  • One cover lookup: protocol::cover_file now serves the cover:// scheme, the widgets and the read-aloud notification. The notification used to miss a cover you'd chosen yourself.
  • Today's stats: a session checkpointed when the app goes to the background counts in today's minutes right away.

Testing

  • UI: bun run check passes, 137 tests, including new ones for jumpBack, book order and the widget snapshot.
  • Rust: cargo test passes (132, including the snapshot's cover filling and the new event). Desktop clippy with -D warnings and rustfmt are clean.
  • Reader features: run in headless Chromium with the Tauri core mocked, at desktop and phone sizes.
  • Widget Kotlin: type-checked against the Android 15 framework, a Robolectric android-all jar from Maven Central, since Google's repositories aren't reachable from where this was written. RemoteViews calls were checked against the framework's remotable methods, and the layouts' framework attributes were confirmed to exist.
  • This PR's APK build is the first full compile of the Kotlin, the resources and the Android-only Rust. The widgets haven't run on a device yet.
  • Not covered:
    • the Android back gesture
    • dragging the bar by touch
    • WebKitGTK

Generated by Claude Code

…ings on phones, and fixes

The way back
- After a jump (Contents, a search result, a link in the book, the progress bar, another
  device's position) a small "Back to Chapter 3" pill offers the way back. It comes and goes
  with the toolbar: in the middle of the footer's line on the desktop, under the toolbar on
  phones. Several jumps in a row keep the way back to where the reader was reading. It goes after
  going back, after three page turns at the new place, or on paging back there by hand.
- Alt+Left goes back too, and on Android the back gesture goes back there before leaving the
  book. The logic is pure (jumpBack.ts) and tested.

The progress bar
- Dragging it no longer moves through the book as it goes: a bubble names the chapter and
  percentage it would land at, and it goes there on letting go. Pointing at the bar on the
  desktop shows the same bubble.
- Chapters' starts show as hairline notches. BookView.chapterStarts() replaces the unused
  sectionFractions().

Text settings
- On phones the sheet opens short (theme, size, line spacing) so the page shows above it while
  changing them; "More options" opens the rest. One order on every screen, and "Two pages on wide
  windows" is left out on phones.

Fixes
- Search outlines are cleared however the search sheet closes; picking a result on a phone, a
  tap on the page or another sheet left every match outlined.
- A search match's mark stays while it's on screen; a tap on a touch screen took it away.
- Bookmarks and highlights in Contents are in book order, not the order they were made.
- Scrolled, the arrow keys scroll wherever the focus is; before the page was clicked they did
  nothing.
- Layout attributes are only set when they change: opening and closing any sheet re-laid out the
  book (8 times for one sheet on a phone).
- The definition lookup lost a ref guard that left it stuck at "Looking it up…" in development,
  and unused styles are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011d6aBsdw5zNEaRoJx1ciHF
…the books being read

- Continue reading shows the cover, title, chapter, progress and time left in the chapter;
  narrow, the cover over a ring of progress. Reading goal shows today's minutes in a ring against
  the goal, and the streak. Reading now shows the covers of the books being read, as many as fit,
  each over its progress. They take the book's colours over the Paper or Dusk surface, follow the
  system's dark mode, and a tap opens the book (or the stats).
- The app sends a snapshot whenever its reading data changes (src/state/widgets.ts, tested),
  except while a book is open, when it waits for leaving the book or the app. Rust adds each
  book's cover file; Widgets.kt keeps the snapshot and draws from it, and redraws the goal just
  after midnight. A tap opens the app through an open request the UI takes when it starts, or on
  an app:open-request event when it's already running.
- One cover lookup (protocol::cover_file) serves the cover:// scheme, the widgets and the
  read-aloud notification, which so far missed a cover the reader chose.
- A reading session checkpointed on going to the background counts in today's stats at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011d6aBsdw5zNEaRoJx1ciHF
@Mischou01 Mischou01 changed the title A way back after jumps, a progress bar that previews, short text settings on phones, and fixes Reader: way back after jumps, previewing progress bar, short phone text settings, fixes; Android widgets Oct 26, 2026
@Mischou01
Mischou01 merged commit e2eec0b into main Oct 26, 2026
6 checks passed
@Mischou01
Mischou01 deleted the claude/selection-text-display-bugs-anh4fo branch November 2, 2026 14:14
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.

2 participants