Preact app frontend - #76
Open
Roznoshchik wants to merge 14 commits into
Open
Conversation
Bookmark migration now handles missing bookmarks with existing progress, clamps percentages over 100%, and handles offsets at article end. Reanchoring switches from exact string search to regex pattern that tolerates whitespace/void element differences around inline elements.
GET /articles/<uuid>/chunks/<idx> for lazy chunk loading, POST /articles/<uuid>/process for first-time article processing with highlight navigation and unanchorable detection. Highlight populate now includes start_chunk and end_chunk fields.
Replace single-chunk loading with a sliding window hook (useChunkWindow) that loads adjacent chunks as the user scrolls. Reader now supports chunk/offset-based navigation, bookmarks, and highlight anchoring. Scroll-to-position uses Range API for character-precise positioning. Unanchorable highlights show a warning alert on navigation.
Notes panel slides in from the left with CSS transform transition. Sidebar and main content suppress transitions on initial mount to prevent layout flash. Notes toggle saves and restores scroll position.
Articles and highlights lists detect unprocessed articles and route to the processing path. Article/highlight cards link to reader with chunk/offset params when anchored, or unprocessed flag when not.
Was used as transient storage during chunk building then immediately set to None — replaced with a local variable. Also removed the unused get_flat_text method that depended on it.
build_content_tree, tree splitting, slicing, and offset helpers were pure functions with no model state — extracted to a standalone module. Article model now imports and delegates to them.
useReaderBookmarks and useReaderProgress used an old bookmark format predating the chunk-based system — superseded by inline logic in reader.jsx
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.
Summary
Test plan