Skip to content

feat: add scroll progress indicator - #2030

Open
SagarSingh01 wants to merge 5 commits into
S3DFX-CYBER:mainfrom
SagarSingh01:scroll-progress-clean
Open

feat: add scroll progress indicator#2030
SagarSingh01 wants to merge 5 commits into
S3DFX-CYBER:mainfrom
SagarSingh01:scroll-progress-clean

Conversation

@SagarSingh01

@SagarSingh01 SagarSingh01 commented Jul 20, 2026

Copy link
Copy Markdown

Related Issue

Closes #2028


Description of Changes

This PR adds an animated scroll progress indicator to the bottom edge of the sticky header, providing visual feedback as users navigate through the page.

The progress line fills smoothly from left to right based on the user's scroll position while preserving the existing sticky navigation, backdrop blur, and overall layout.

What Changed

  • Added a thin 1–2px scroll progress bar beneath the header.
  • Progress updates dynamically based on the current page scroll percentage.
  • Uses the existing brand orange accent to maintain visual consistency.
  • Progress starts at 0% when the page loads and reaches 100% at the bottom of the page.
  • Preserved the existing sticky header and backdrop blur behavior.
  • Added support for prefers-reduced-motion by disabling animated transitions for users who prefer reduced motion.
  • Implemented without introducing layout shifts or affecting existing navigation functionality.

Screenshot

image
image

Testing

  • Tested locally
  • Verified progress starts at 0% on page load
  • Verified progress updates smoothly while scrolling
  • Verified progress reaches 100% at the bottom of the page
  • Verified orange accent matches the existing branding
  • Verified sticky header behavior remains unchanged
  • Verified no layout shifts during scrolling
  • Verified prefers-reduced-motion disables transition animations
  • npm run lint
  • npm test

PR Checklist

  • Code follows the existing project conventions
  • Feature tested locally
  • Responsive behavior verified
  • No breaking changes introduced
  • Screenshots attached
  • Documentation updated (if required)
  • Branch synced with the latest main

Review in cubic

Signed-off-by: SagarSingh01 <sagarsingh07789@gmail.com>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@SagarSingh01 is attempting to deploy a commit to the s3dfx-cyber's projects Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening a PR, @SagarSingh01!

Your PR has entered the 🚦 PR Review Pipeline.

Standard PR detected — your PR will follow the standard repository review pipeline.


🔄 Review Flow

Stage Reviewer Purpose
Stage 1 🤖 Automation Validation · Duplicate Detection · AI/Slop Checks · Formatting · PR Analysis
Stage 2 👥 Repository Reviewer Code Review · Scope Validation · Quality Check
Stage 3 🔑 Project Admin / Maintainer Final Approval & Merge Decision

The automated PR analysis system will verify issue linkage, PR relevance, and contribution quality.

A pipeline status comment may appear automatically as your PR progresses.


✅ Contributor Checklist

  • Sign commits using git commit -s
  • Link a valid issue (Closes #123)
  • Keep changes focused and relevant
  • Do not include unrelated modifications
  • Ensure workflows/build/tests are passing
  • Read the appropriate contributor guide:

⚠️ Important Notes

  • Low-quality, spammy, or AI-generated PRs may be closed
  • PRs without linked issues may fail automated checks
  • Large unrelated PRs are likely to be rejected
  • Review times may vary depending on mentor/reviewer availability

Happy contributing 🚀

This message is posted automatically and only once.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

💬 Faster Reviews & Assignments

Hi @SagarSingh01, for faster coordination and smoother communication, consider joining our Discord community:

👉 https://discord.gg/jYrbHKtn8t

Useful Channels

  • #issue-links-for-assignment → Share issue links for assignment help
  • #pr-links-for-review → Share PR links for mentor/maintainer review

Please avoid spamming channels or repeatedly pinging mentors/maintainers.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

✅ DCO Sign-off Verified

Hi @SagarSingh01 👋

All commits in this PR contain valid Signed-off-by lines.

Thank you for following the DCO requirements 🚀

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ PR Validation Issues

Hi @SagarSingh01, your PR requires fixes before review.

Warnings

  • ⚠️ Missing contribution program declaration (GSSOC or NSOC).
  • ⚠️ Missing PR template section: type of change

Please push fixes after updating the PR.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8deec4b-7e38-4de4-943e-149849e55d55

📥 Commits

Reviewing files that changed from the base of the PR and between 1a766e4 and 8b0dd19.

📒 Files selected for processing (3)
  • index.html
  • landing.html
  • src/js/scroll-progress.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • index.html
  • landing.html
  • src/js/scroll-progress.js
📜 Recent review details
⚠️ CI failures not shown inline (1)

Commit Status: Vercel: Vercel

Conclusion: failure

Authorization required to deploy.

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a visual scroll progress bar to the navigation header.
    • Progress updates dynamically as users scroll and resize the page.
    • Supports pages with changing content size and remains inactive when no scrolling is available.

Walkthrough

Adds a fixed #scrollProgressBar to both HTML pages, loads shared scroll-progress logic, and updates the bar width during scroll, resize, body layout changes, and initial page load.

Changes

Scroll progress indicator

Layer / File(s) Summary
Progress bar markup and page wiring
index.html, landing.html
Adds the fixed progress bar and loads src/js/scroll-progress.js on both pages. The landing page also reformats stylesheet links and adds whitespace.
Scroll progress calculation and updates
src/js/scroll-progress.js
Calculates scroll percentage, updates the bar width, throttles updates with requestAnimationFrame, observes body size changes when supported, and initializes the display.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ScrollProgressScript
  participant scrollProgressBar
  participant ResizeObserver
  Browser->>ScrollProgressScript: Emit scroll or resize event
  ScrollProgressScript->>ScrollProgressScript: Calculate scroll percentage
  ScrollProgressScript->>scrollProgressBar: Set width style
  ScrollProgressScript->>scrollProgressBar: Apply calculated width
  ResizeObserver->>ScrollProgressScript: Report body size change
Loading

Possibly related issues

Possibly related PRs

Suggested labels: enhancement, type:feature

Suggested reviewers: s3dfx-cyber, tarunyaprogrammer, kumarnirupam1

Poem

I’m a rabbit watching pixels glide,
The orange progress line grows wide.
Scroll down the page; I hop along.
Resize the view; the bar stays strong.
At the bottom, the trail is complete! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The implementation covers the progress bar and scroll updates, but the provided change summary does not show prefers-reduced-motion support. Add a prefers-reduced-motion media rule that disables or makes the progress-bar transition instant, then verify the behavior.
Out of Scope Changes check ⚠️ Warning The landing.html Google Fonts reformatting and inserted blank line are unrelated to the linked scroll-progress requirement. Remove unrelated formatting-only changes from landing.html, including the Google Fonts reformatting and blank line.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a scroll progress indicator.
Description check ✅ Passed The description covers the change, issue, testing, screenshots, and checklist, despite using headings different from the repository template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🚦 PR Review Pipeline

Standard PR

Stage Status
Stage 1 — Automated Checks ✅ All automated checks passed
Stage 2 — Mentor/Reviewer ⏳ Awaiting reviewer approval
Stage 3 — Maintainer 🔒 Blocked until Stage 2 passes

No active issues


Last updated: Fri, 07 Aug 2026 03:49:50 GMT

@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This PR introduces an animated scroll progress indicator, displayed as a thin bar at the bottom of the sticky header, for both index.html and landing.html. The progress bar dynamically updates its width based on the user's scroll position, uses the brand's accent color, and includes support for prefers-reduced-motion for accessibility. While the feature itself is well-described and includes good accessibility and performance considerations, the implementation involves significant code duplication and inline scripting, which impacts code quality and maintainability.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html, landing.html - Code Duplication: The entire div element for the scroll progress bar and its associated JavaScript logic are duplicated verbatim in both index.html and landing.html. This violates the DRY (Don't Repeat Yourself) principle.
    • Suggestion: Extract the JavaScript logic into a separate file (e.g., src/js/scroll-progress.js) and link to it from both HTML files. The div element could be part of a reusable header component if the project uses a templating system, or at least documented as a required element for the script.
  • index.html, landing.html - Inline Script Placement: Embedding the JavaScript directly within the HTML files, especially duplicated across multiple pages, makes the code harder to manage and update.
    • Suggestion: Move the JavaScript logic to an external .js file as suggested above.
  • index.html, landing.html - Missing Newline at EOF: The diff indicates that both index.html and landing.html end without a newline character after the changes.
    • Suggestion: Add a newline character at the end of both files to conform to common file formatting standards.
  • index.html, landing.html - High Z-index: The z-[9999] class on the progress bar is an extremely high z-index. While it ensures visibility, it might indicate a lack of a structured z-index strategy and could potentially conflict with future elements.
    • Suggestion: Consider if a slightly lower, more context-specific z-index could be used, or ensure this high value is justified within the project's z-index hierarchy.

✅ What's Done Well

  • Accessibility: Excellent implementation of prefers-reduced-motion support, which is crucial for users with motion sensitivities.
  • Performance: Utilizes passive: true for the scroll event listener and ResizeObserver for efficient updates, contributing to a smooth user experience without performance overhead.
  • Clear Description & Testing: The PR description is comprehensive, detailing changes, providing relevant screenshots, and including a thorough testing checklist, which aids in understanding and verifying the feature.

📝 Overall Verdict

REQUEST CHANGES - The significant code duplication and inline script placement need to be addressed for improved maintainability and adherence to best practices.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
landing.html (1)

1124-1126: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove duplicate comment.

The section comment for the scroll progress bar is duplicated.

♻️ Proposed fix
-  <!-- ═══════════════════ Scroll ProgressBar ═══════════════════ -->
   <!-- ═══════════════════ Scroll ProgressBar ═══════════════════ -->
   <script>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@landing.html` around lines 1124 - 1126, Remove the duplicated Scroll
ProgressBar section comment, keeping a single comment immediately before the
related script block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@index.html`:
- Around line 1203-1205: Update the scrollProgressBar in index.html (lines
1203-1205) and landing.html (lines 67-69) to use absolute bottom-0 within a
relative header container, or otherwise position it at the header’s bottom
rather than the viewport bottom; ensure both pages preserve the intended
progress-bar placement beneath the header.

---

Nitpick comments:
In `@landing.html`:
- Around line 1124-1126: Remove the duplicated Scroll ProgressBar section
comment, keeping a single comment immediately before the related script block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25ef11d6-f1c8-40ba-b2a6-c9176de15a36

📥 Commits

Reviewing files that changed from the base of the PR and between 025f43d and 3ae1e7e.

📒 Files selected for processing (2)
  • index.html
  • landing.html
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: cubic · AI code reviewer
⚠️ CI failures not shown inline (1)

Commit Status: Vercel: Vercel

Conclusion: failure

Authorization required to deploy.
🔇 Additional comments (1)
index.html (1)

5815-5841: LGTM!

Comment thread index.html
Signed-off-by: SagarSingh01 <sagarsingh07789@gmail.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request introduces an animated scroll progress indicator, displayed as a thin bar at the bottom of the sticky header. The progress bar dynamically updates its width based on the user's scroll position, providing visual feedback. The implementation uses standard HTML, CSS (Tailwind), and JavaScript, including support for prefers-reduced-motion and ResizeObserver for robustness. The approach is sound and effectively delivers the described UI feature.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html, landing.html, src/js/scroll-progress.js - Missing newline at the end of the file. It's good practice to ensure all files end with a newline character for consistency and compatibility with various tools.
  • index.html, landing.html - The scrollProgressBar div is placed inside the <header> element. While functionally correct due to fixed positioning, semantically, a page-level progress indicator could be a direct child of <body> or <html>. However, given its visual attachment to the header, this is a minor stylistic choice.

✅ What's Done Well

  • Accessibility Consideration: The implementation correctly supports prefers-reduced-motion by disabling transition animations, improving user experience for those with motion sensitivities.
  • Performance & Robustness: Utilizes passive: true for the scroll event listener to prevent blocking the main thread and incorporates ResizeObserver for more reliable progress updates on dynamic content changes.
  • Clear Separation of Concerns: The scroll progress logic is encapsulated in its own scroll-progress.js file, promoting modularity.

📝 Overall Verdict

[APPROVE] - The feature is well-implemented with good practices and no security concerns.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread landing.html Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/js/scroll-progress.js (1)

5-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer globalThis over window and throttle layout updates.

Reading layout properties (scrollHeight, innerHeight) and writing styles directly on every scroll event can cause performance jank. Wrapping these updates in requestAnimationFrame is a recommended practice to ensure smooth scrolling. Additionally, based on learnings, this repository prefers using globalThis over window to keep the code environment-agnostic and satisfy SonarCloud static analysis.

♻️ Proposed refactor
-    const updateProgress = () => {
-        const scrollTop = window.scrollY;
-        const scrollHeight =
-            document.documentElement.scrollHeight - window.innerHeight;
-
-        const progress =
-            scrollHeight > 0 ? (scrollTop / scrollHeight) * 100 : 0;
-
-        progressBar.style.width = `${progress}%`;
-    };
-
-    window.addEventListener("scroll", updateProgress, { passive: true });
-    window.addEventListener("resize", updateProgress);
-
-    if ("ResizeObserver" in window) {
-        new ResizeObserver(updateProgress).observe(document.body);
-    }
+    let ticking = false;
+
+    const updateProgress = () => {
+        const scrollTop = globalThis.scrollY;
+        const scrollHeight =
+            document.documentElement.scrollHeight - globalThis.innerHeight;
+
+        const progress =
+            scrollHeight > 0 ? (scrollTop / scrollHeight) * 100 : 0;
+
+        progressBar.style.width = `${progress}%`;
+        ticking = false;
+    };
+
+    const requestUpdate = () => {
+        if (!ticking) {
+            globalThis.requestAnimationFrame(updateProgress);
+            ticking = true;
+        }
+    };
+
+    globalThis.addEventListener("scroll", requestUpdate, { passive: true });
+    globalThis.addEventListener("resize", requestUpdate);
+
+    if ("ResizeObserver" in globalThis) {
+        new ResizeObserver(requestUpdate).observe(document.body);
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/js/scroll-progress.js` around lines 5 - 21, Update the scroll-progress
implementation around updateProgress to use globalThis instead of window for
global APIs, and throttle layout reads and progressBar.style.width writes
through requestAnimationFrame. Ensure scroll, resize, and ResizeObserver
callbacks schedule at most one pending frame while preserving the current
progress calculation.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/js/scroll-progress.js`:
- Around line 5-21: Update the scroll-progress implementation around
updateProgress to use globalThis instead of window for global APIs, and throttle
layout reads and progressBar.style.width writes through requestAnimationFrame.
Ensure scroll, resize, and ResizeObserver callbacks schedule at most one pending
frame while preserving the current progress calculation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3aa2a94d-1396-4971-b863-708794d57305

📥 Commits

Reviewing files that changed from the base of the PR and between 3ae1e7e and 219370f.

📒 Files selected for processing (3)
  • index.html
  • landing.html
  • src/js/scroll-progress.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • index.html
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: cubic · AI code reviewer
⚠️ CI failures not shown inline (1)

Commit Status: Vercel: Vercel

Conclusion: failure

Authorization required to deploy.
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-06-15T18:15:28.688Z
Learnt from: arghya29
Repo: S3DFX-CYBER/GSoC-Org-Finder- PR: 1882
File: src/js/footer.js:33-33
Timestamp: 2026-06-15T18:15:28.688Z
Learning: In this repo’s JavaScript (e.g., footer.js), `globalThis` is intentionally preferred over `window` to keep code environment-agnostic and to satisfy SonarCloud static analysis. The project targets modern browsers (ES2021) with no transpilation, so `globalThis` is fully supported—do not flag `globalThis` usage as a browser compatibility concern or suggest replacing it with `window` during review.

Applied to files:

  • src/js/scroll-progress.js
🔇 Additional comments (1)
landing.html (1)

1125-1125: LGTM!

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 20, 2026
@SagarSingh01

Copy link
Copy Markdown
Author

Hi! I've addressed all the requested review comments and pushed the fixes. All checks are passing now. I'd appreciate a review when convenient. Thank you!

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

Re-trigger cubic

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request introduces a scroll progress indicator to the sticky header of both index.html and landing.html. The indicator is a thin, orange bar that dynamically updates its width based on the user's scroll position, providing visual feedback. The implementation correctly accounts for prefers-reduced-motion for accessibility and uses modern browser APIs like ResizeObserver for robust behavior. The approach is sound for adding a non-critical UI element.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • src/js/scroll-progress.js - The new JavaScript file is missing a newline character at the end of the file. This is a common linting convention. Please add a newline at the end of the file.

✅ What's Done Well

  • Accessibility: The implementation correctly uses motion-reduce:transition-none in CSS and checks for prefers-reduced-motion, ensuring a good user experience for those with motion sensitivities.
  • Performance: The use of passive: true for the scroll event listener and ResizeObserver for layout changes demonstrates a thoughtful approach to performance and efficiency.
  • Robustness: The script includes checks for the existence of the progress bar element and handles cases where scrollHeight might be zero, preventing potential errors.

📝 Overall Verdict

REQUEST CHANGES - Address the minor code quality issue regarding the missing newline in the new JS file.

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 20, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Auto-approved: Adds a scroll progress bar to the header. Feature is purely visual, bounded, respects reduced-motion, and poses no operational, security, or data risks.

Re-trigger cubic

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This PR introduces an animated scroll progress indicator, displayed as a thin bar at the bottom of the sticky header. The progress bar dynamically updates its width based on the user's scroll position, utilizing the brand's orange accent. The implementation includes considerations for accessibility (prefers-reduced-motion) and performance (passive event listeners). The approach is sound, providing a useful UI enhancement without introducing security vulnerabilities.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html, landing.html - Duplication of HTML and Script Inclusion: The <div id="scrollProgressBar"> element and the <script src="src/js/scroll-progress.js"></script> tag are duplicated across index.html and landing.html. For better maintainability and to avoid repetition, consider if these common UI components and their associated scripts could be managed through a shared template or a more centralized inclusion mechanism if the project structure allows.
  • src/js/scroll-progress.js - High Z-index: The z-[9999] class on the progress bar is a very high z-index. While it ensures visibility, it's generally good practice to use the lowest possible z-index that achieves the desired stacking context to minimize potential conflicts with other elements in complex layouts.

✅ What's Done Well

  • Accessibility: The implementation correctly supports prefers-reduced-motion by disabling transition animations for users who prefer reduced motion, enhancing inclusivity.
  • Performance: The scroll event listener is registered with { passive: true }, which is a best practice for improving scroll performance and responsiveness.
  • Robustness and Encapsulation: The JavaScript logic is encapsulated within an IIFE, includes a check for the progress bar element's existence, and correctly handles edge cases for scroll height calculation, making the script robust.

📝 Overall Verdict

[APPROVE] - The feature is well-implemented, secure, and considers accessibility and performance.


Review powered by TENET Agent 🛡️ | Triggered automatically on PR #2030

@SagarSingh01

Copy link
Copy Markdown
Author

Hi maintainers! Just following up on this PR. All requested changes have been addressed, and the automated checks are passing. I'd appreciate a review whenever you have time. Thank you!

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 20, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Auto-approved: Adds a purely visual scroll progress indicator to the header. No behavioral or operational changes, just a bounded UI enhancement.

Re-trigger cubic

@SagarSingh01

Copy link
Copy Markdown
Author

Hi! @S3DFX-CYBER
I've addressed all the requested review comments and pushed the fixes. All checks are passing now. I'd appreciate a review when convenient.
Thank you!

@S3DFX-CYBER S3DFX-CYBER left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a scroll progress bar to the header on both index.html and landing.html, backed by a new src/js/scroll-progress.js. The approach is clean — a self-executing IIFE, passive scroll listener, ResizeObserver for layout changes. But there are a couple of things to fix, and this is also a duplicate of #2052 which adds the same feature.

First, the duplicate: #2052 adds a reading progress indicator to the same pages with slightly different implementation. You should coordinate with that PR's author and pick one to go forward with — having both open will just cause merge conflicts. I'd lean toward this one since it's simpler and doesn't introduce unrelated scope, but either way one needs to be closed.

On the code itself: src/js/scroll-progress.js uses window.scrollY, window.innerHeight, window.addEventListener, and "ResizeObserver" in window throughout. The repo convention is globalThis over window in src/js/ files — this is intentional, to keep the code environment-agnostic and satisfy SonarCloud. Switch all the window references to globalThis.

The scroll handler runs updateProgress directly on every scroll event, which reads layout properties (scrollHeight, innerHeight) and writes to style.width each time. Wrap it in requestAnimationFrame with a ticking guard so you batch at most one update per frame — the scroll event fires far more often than the screen refreshes, and the direct style write will cause jank on slower devices.

The landing.html diff includes unrelated reformatting of the Google Fonts <link> tags (splitting them across multiple lines) and whitespace changes to the <a href="/"> tag. Those aren't part of the scroll progress feature — drop them so the diff stays focused.

Comment thread src/js/scroll-progress.js Outdated
Comment thread src/js/scroll-progress.js Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 7, 2026

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request introduces an animated scroll progress indicator to the sticky header of the application. The feature is implemented using HTML, Tailwind CSS, and a dedicated JavaScript file. The JavaScript logic efficiently calculates scroll progress, updates the indicator's width using requestAnimationFrame, and includes support for prefers-reduced-motion for accessibility. The approach is sound for a frontend UI enhancement.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html, landing.html - Missing newline at the end of the file. This can cause issues with some tools and version control systems.
  • index.html, landing.html - The HTML comments for the scroll progress bar (<!-- ═══════════════════ Scroll ProgressBar ═══════════════════ -->) are overly verbose. A simpler comment like <!-- Scroll Progress Bar --> would suffice.
  • src/js/scroll-progress.js - The z-[9999] class for the progress bar is an unusually high value. While it ensures visibility, a lower, more context-appropriate z-index (e.g., z-10 or z-20 if it needs to be above other header elements) would be more maintainable and less prone to unexpected stacking issues.

✅ What's Done Well

  • The JavaScript implementation in src/js/scroll-progress.js is robust, utilizing requestAnimationFrame for smooth updates, passive event listeners for performance, and ResizeObserver for responsiveness to layout changes.
  • Accessibility is well-considered with the motion-reduce:transition-none class, disabling animations for users who prefer reduced motion.
  • The JavaScript logic is encapsulated within an Immediately Invoked Function Expression (IIFE), preventing global scope pollution.

📝 Overall Verdict

REQUEST CHANGES - Address minor code quality issues, specifically the missing newlines and verbose comments.

@coderabbitai
coderabbitai Bot requested a review from S3DFX-CYBER August 7, 2026 03:47
Signed-off-by: SagarSingh01 <sagarsingh07789@gmail.com>
Signed-off-by: SagarSingh01 <sagarsingh07789@gmail.com>
Signed-off-by: SagarSingh01 <sagarsingh07789@gmail.com>
@SagarSingh01
SagarSingh01 force-pushed the scroll-progress-clean branch from 4a10c53 to 8b0dd19 Compare August 7, 2026 03:49

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request introduces an animated scroll progress indicator, displayed as a thin bar at the bottom of the sticky header. The progress bar dynamically updates its width based on the user's scroll position, providing visual feedback. The implementation is robust, utilizing requestAnimationFrame for performance, ResizeObserver for dynamic layout changes, and respecting prefers-reduced-motion for accessibility. The changes are confined to UI presentation and do not interact with sensitive data or backend logic.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html, landing.html - The \ No newline at end of file warning in the diff indicates that these HTML files do not end with a newline character. While not critical, it's a common linting/formatting best practice to ensure all files end with a newline. Consider adding a newline at the very end of these files.

✅ What's Done Well

  • Performance & Accessibility: The use of requestAnimationFrame for scroll updates, passive: true for scroll event listeners, and prefers-reduced-motion in CSS demonstrates a strong focus on performance and user accessibility.
  • Robustness: The JavaScript implementation includes defensive checks (if (!progressBar) return;), handles edge cases (scrollHeight > 0), and uses ResizeObserver to ensure the progress bar updates correctly even if the page content changes dynamically.
  • Clean Implementation: The JavaScript logic is encapsulated within an Immediately Invoked Function Expression (IIFE), uses clear variable names, and follows modern browser API best practices.

📝 Overall Verdict

[APPROVE] - The feature is well-implemented, robust, and adheres to good performance and accessibility practices with no security concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add scroll-progress line animation to header

2 participants