Skip to content

feat: add dynamic remaining reading time on blog posts#30

Draft
Copilot wants to merge 5 commits into
patch-1from
copilot/resolve-issue-1484
Draft

feat: add dynamic remaining reading time on blog posts#30
Copilot wants to merge 5 commits into
patch-1from
copilot/resolve-issue-1484

Conversation

Copilot AI commented May 18, 2026

Copy link
Copy Markdown

Description

Adds a dynamic "min remaining" indicator to individual blog post pages so readers can see estimated time left while scrolling.
This was refined based on feedback so the remaining time now decreases from the full estimate using actual article scroll progress, while preserving the existing "X min read" metadata.

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

  • Swizzled BlogPostItem/Header/Info into src/theme/BlogPostItem/Header/Info/index.tsx.
  • Kept existing publish date and total reading time display.
  • Added scroll-based remaining reading time for blog post pages using useBlogPost().isBlogPostPage.
  • Updated the calculation to use true article scroll progress so remaining time starts from full estimate and decreases as the reader moves through the post.
  • Added handling for short articles that fit inside the viewport to avoid incorrect progress/remaining-time values.
  • Added requestAnimationFrame-throttled scroll/resize handling and resilient article lookup (closest("article")).
  • Added local styles module for the swizzled header info container.

Dependencies

  • No new dependencies were added.
  • No dependency version updates were made.

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

@Adez017

Adez017 commented May 18, 2026

Copy link
Copy Markdown
Owner

@copilot i think you didn't get what issue we already had 5 min read ,something on top of our blog , we need to create a dynamic component on the blog page that shows how much time remaning to erad the complete or based on the above you need to calculate the logic also

Copilot AI commented May 18, 2026

Copy link
Copy Markdown
Author

@copilot i think you didn't get what issue we already had 5 min read ,something on top of our blog , we need to create a dynamic component on the blog page that shows how much time remaning to erad t...

Updated in commit be36bc6 (with the main logic adjustment in d34974b). Remaining time now starts from full read time and decreases based on actual article scroll progress, while keeping the existing 5 min read metadata.

Screenshot:
updated remaining time

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • giscus.app
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-edgeupdater --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl r (dns block)
  • www.googletagmanager.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-edgeupdater --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-edgeupdater --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl r (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

2 participants