Skip to content

feat(tafsir): step between verses and resize the floating card - #53

Merged
ask-786 merged 1 commit into
masterfrom
feat/tafsir-step-and-resize
Sep 21, 2026
Merged

ask-786 merged 1 commit into
masterfrom
feat/tafsir-step-and-resize

Conversation

@ask-786

@ask-786 ask-786 commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Previous/next verse — both the floating card and the side panel get chevron buttons in their header.

  • Steps one verse at a time and stays within the current Surah (disabled at its first/last verse).
  • One verse at a time even where an edition comments on a run of verses, so the recitation strip plays every verse. The label now reads e.g. 2:3 on 2:1–5, so a step inside a run is still visible.
  • The reader scrolls to the new verse only when it is outside the visible area (revealAyah in follow-scroll.ts, sharing the lookup with recitation follow).
  • The floating card stays where it is while stepping, so the buttons stay under the pointer; focus stays on the pressed button.

Resizable floating card

  • Bottom-right grip: drag, arrow keys (Shift for bigger steps), double-click to reset to automatic.
  • The size is saved for every card: new settings tafsir_card_width / tafsir_card_height (0 = automatic) in the TS defaults, Rust model, load_settings and schema.sql defaults. No migration needed.
  • Never extends off screen: growth stops at the window edge while dragging, and the saved size is refitted to the window on every placement and window resize.

The side panel was already resizable (left-edge handle) and is unchanged.

Test plan

  • Step through a Surah in both surfaces. Buttons disable at its first and last verse.
  • Step through a grouped-commentary run. Audio follows each verse, and the label updates.
  • Step to an off-screen verse, in list and Mushaf view. The reader scrolls; a visible verse doesn't move the page.
  • Resize the card, close and reopen, restart the app. The size persists.
  • Shrink the window with a large saved card size. The card stays fully on screen.
  • Double-click the grip. The card returns to the automatic size.

🤖 Generated with Claude Code

Both tafsir surfaces get previous/next verse buttons. They move one verse
at a time within the current Surah, so the recitation strip follows every
verse even where an edition comments on a run of them; the verse label now
shows the verse on show beside the run it belongs to. The reader scrolls
to the new verse only when it is off screen.

The floating card gets a corner grip (drag, arrow keys, double-click to
reset). The size is saved in tafsir_card_width/tafsir_card_height and fitted
to the window on every placement, so the card never extends off screen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ask-786
ask-786 merged commit 6229607 into master Sep 21, 2026
5 checks passed
@ask-786
ask-786 deleted the feat/tafsir-step-and-resize branch September 21, 2026 07:57
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