Feature Description
When users read dense, long-form core subject notes (such as Data Structures, Operating Systems, or Compiler Design), it can be difficult to track how far they have progressed down the page.
This feature introduces two key UX enhancements to the chapter documentation layout (/sem* routes):
- Visual Reading Progress Bar: A minimalist, high-performance horizontal progress bar fixed at the very top of the viewport (or nested just beneath the sticky navbar) that fills up dynamically as the user scrolls down a chapter.
- Persistent Scroll Memory: An auto-save mechanism using
localStorage that remembers exactly where a student stopped reading. When they return to that specific chapter later, the page smoothly auto-scrolls back to their last saved position.
Problem It Solves
- Cognitive Load: Long walls of technical academic text can feel overwhelming. A visual indicator gives students a sub-conscious sense of achievement and a clear indicator of remaining content length.
- Interrupted Learning Sessions: Students frequently study in short bursts. If a user accidentally closes their tab or returns to a complex chapter the next day, they lose their spot and must waste time scrolling to find where they left off.
Proposed Solution
-
Scroll Tracking: Implement a lightweight scroll event listener using a React
useEffect hook (or an IntersectionObserver approach for efficiency) inside the main chapter layout component to calculate:
$$\text{Progress %} = \left( \frac{\text{window.scrollY}}{\text{document.documentElement.scrollHeight} - \text{window.innerHeight}} \right) \times 100$$
-
Framer Motion / Tailwind CSS Animation: Bind this percentage to a stylized div bar matching the brand's aesthetic.
-
Debounced LocalStorage: Save the unique route path and current
window.scrollY position to local storage, debounced by 500ms to avoid performance lag. Upon mounting the component, check for an existing coordinate match and trigger a smooth window scroll adjustment.
Additional Context
- This builds perfectly upon openCSE's goal of creating a clean, modern, and distraction-free documentation experience for college students.
- It scales elegantly across both desktop viewports and mobile devices.
Feature Description
When users read dense, long-form core subject notes (such as Data Structures, Operating Systems, or Compiler Design), it can be difficult to track how far they have progressed down the page.
This feature introduces two key UX enhancements to the chapter documentation layout (
/sem*routes):localStoragethat remembers exactly where a student stopped reading. When they return to that specific chapter later, the page smoothly auto-scrolls back to their last saved position.Problem It Solves
Proposed Solution
useEffecthook (or anIntersectionObserverapproach for efficiency) inside the main chapter layout component to calculate:window.scrollYposition to local storage, debounced by 500ms to avoid performance lag. Upon mounting the component, check for an existing coordinate match and trigger a smooth window scroll adjustment.Additional Context