Repository navigation
feat(reader): reading navigation history stack and return-to-reading pill - #2
Merged
Merged
Conversation
… and expand return shortcuts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Ringkasan Perubahan Utama (Summary)
PR ini mengimplementasikan sistem tumpukan riwayat navigasi membaca (reading navigation history stack) untuk mendukung alur lompat-dan-kembali (jump and return) antar-berkas XHTML. Ketika pembaca mengklik tautan antar-bab (melalui Table of Contents, tautan rujukan di teks dokumen, atau tombol fallback pada popover), ekstensi secara instan merekam titik koordinat baca sebelumnya (
uri,scrollY,scrollRatio, serta judul chapter asal).Setelah berpindah ke bab tujuan, pembaca diberikan floating pill "← Return to previous reading position" di pojok kiri bawah lengkap dengan nama bab asal dan badge persentase baca. Pembaca dapat mengklik tombol tersebut atau menggunakan shortcut keyboard (
Backspace,B, atauAlt+Left) untuk seketika kembali ke posisi semula tanpa kehilangan konteks bacaan.✨ Fitur Baru & Pembaruan (Features & Updates)
NavigationHistoryData Structure:backStackdanforwardStackdisrc/state-manager.tsdengan batas kedalaman tumpukan (pruning) untuk mencegah kebocoran memori.forwardStackotomatis ketika percabangan lompatan baru terjadi.panel.onDidDispose).scrollY,scrollRatio, dan mode baca) dari webview sebelum mengirim pesanopenLink.historyBackdanhistoryForwarddisrc/extension.tsuntuk memulihkan dokumen dan mengarahkan kembali ke koordinat scroll yang tersimpan.getChapterTitleuntuk mengekstrak label judul chapter dari ToC atau urutan spine EPUB.×) untuk dismiss manual, serta perilaku auto-minimize (memudar halus) saat pembaca melakukan scroll intensif (>350px).Backspacedan shortcut satu tombolB(ketika tidak mengetik di kotak pencarian) untuk kembali seketika ke posisi baca asal.Alt+Left/ArrowLeft/Leftuntuk melengkapi pengalaman pengguna.🐛 Perbaikan Bug & Optimasi (Bug Fixes & Refactor)
navigateToChapteragar terhindar dari potensi kendala escaping regex di webview script.📦 Maintenance & Dokumentasi (Maintenance & Docs)
test/history.test.mjsuntuk validasi kapasitas, peeking, navigasi bolak-balik, dan pembersihan tumpukan riwayat.test/reader-shell.test.mjsuntuk memverifikasi keberadaan elemen return pill, message handler, dan binding keyboard.sample-book/OEBPS/ch_1.xhtml.Catatan Reviewer / Dev Notes:
tsc --noEmitbersih 0 error, build esbuild sukses, dan 30 unit tests lulus.