Conversation
Adjusted the logic in `ReadingProgress.astro` to ensure the progress bar starts at 0% when the page is at the top. The previous implementation included the initial viewport height in the progress, leading to a non-zero start (around 25-40%). The new calculation uses `getBoundingClientRect()` for accuracy and defines the scroll range from the top of the page to the point where the bottom of the article content reaches the bottom of the viewport. Co-authored-by: rockoder <2136164+rockoder@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
The reading progress bar was showing ~25% progress even when a post was just opened at the top of the page. This was due to the calculation logic which considered the portion of the article visible in the initial viewport as "completed".
I updated
src/components/ReadingProgress.astrowith a new formula:scrollRange = articleTop + articleHeight - windowHeightprogress = scrollY / scrollRangeThis ensures that at
scrollY = 0, the progress is0%. The progress reaches100%when the bottom of the article aligns with the bottom of the viewport. I also usedgetBoundingClientRect()for more robust element positioning.Verified the fix using Playwright screenshots and build checks.
PR created automatically by Jules for task 9015881955667487806 started by @rockoder