Skip to content

fix: remove duplicate back-to-top button (#1894)#1932

Open
saurabhhhcodes wants to merge 7 commits into
S3DFX-CYBER:mainfrom
saurabhhhcodes:fix/duplicate-back-to-top-1894
Open

fix: remove duplicate back-to-top button (#1894)#1932
saurabhhhcodes wants to merge 7 commits into
S3DFX-CYBER:mainfrom
saurabhhhcodes:fix/duplicate-back-to-top-1894

Conversation

@saurabhhhcodes

@saurabhhhcodes saurabhhhcodes commented Jun 21, 2026

Copy link
Copy Markdown

Fixes #1894

Review in cubic

Saurabh Kumar Bajpai added 7 commits June 21, 2026 12:32
Wrap localStorage.setItem in syncBookmark and clearAllBookmarks with
try/catch to prevent uncaught errors when storage quota is exceeded.
Alert the user when bookmark operations cannot be persisted.
The .sr-only utility class was defined twice in the internal
stylesheet (lines 204 and 436). Removed the duplicate at line 436
to keep the codebase DRY.
Changed from old Twitter blue (#1DA1F2) to X brand black (#000000)
to maintain visual consistency with other social media icons.
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Someone 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.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Validation Issues

Hi @saurabhhhcodes, your PR requires fixes before review.

Warnings

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

Please push fixes after updating the PR.

@github-actions github-actions Bot added bug Something isn't working frontend size/m labels Jun 21, 2026
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@saurabhhhcodes, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 46 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81b5f922-c030-4dec-9736-b5313861e5ef

📥 Commits

Reviewing files that changed from the base of the PR and between d959db7 and 67f4fa8.

📒 Files selected for processing (5)
  • index.html
  • src/components/footer.html
  • src/js/app.js
  • src/js/footer.js
  • src/styles.css
✨ Finishing Touches
🧪 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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Program Classification Required

Your PR does not currently specify a valid contribution program.

Please edit your PR description and select exactly ONE:

  • GSSOC
  • NSOC
  • General Contribution

Example

program: gssoc

or use the PR template checkboxes.

Once updated, this validation will automatically re-run.

Stage-2 review routing is temporarily paused until classification is resolved.

@github-actions

Copy link
Copy Markdown
Contributor

💬 Faster Reviews & Assignments

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

👉 https://discord.gg/MmZGG2ee

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

Copy link
Copy Markdown
Contributor

⚠️ DCO Sign-off Missing

Hi @saurabhhhcodes 👋

Some commits in this PR are missing a valid Signed-off-by line.

Invalid Commits

  • 28b5687
  • ecf4d92
  • 5322b5b
  • d4f7567
  • 3510ad5
  • 97e2ad5
  • 67f4fa8

Fix Single Commit

git commit --amend --signoff
git push --force-with-lease

Fix Multiple Commits

git rebase --signoff HEAD~N
git push --force-with-lease

This comment updates automatically after fixes are pushed.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening a PR, @saurabhhhcodes!

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.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request primarily addresses the removal of a duplicate "back-to-top" button, including its associated HTML, CSS, and JavaScript. Beyond this core fix, the PR introduces several valuable enhancements: improved error handling for localStorage operations to prevent client-side storage issues, a crucial security improvement by adding rel="noopener noreferrer" to external links, and better accessibility through the inclusion of alt attributes for images. Minor styling updates for mentor chips and social links are also present. The changes collectively enhance the application's robustness, security posture, and user experience.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html - The removal of the .sr-only CSS class definition (L433-435) should be verified. If this class was actively used elsewhere in the application for screen reader accessibility, its removal could lead to an accessibility regression. If it was unused, its removal is appropriate cleanup.
  • src/styles.css - The change in social-link.twitter:hover background and border-color (L521-524) from Twitter blue to black might be a branding decision. Ensure this aligns with current brand guidelines.

✅ What's Done Well

  1. Security & Robustness: The addition of rel="noopener noreferrer" to the "Privacy Policy" link (src/components/footer.html, L110) is an excellent security practice, mitigating tabnabbing risks. Furthermore, the try-catch blocks around localStorage.setItem calls (index.html, L3651-3657, L3685-3691) significantly improve application robustness by gracefully handling potential storage quota limits.
  2. Accessibility: Including a descriptive alt attribute for the organization logo image (src/js/app.js, L946) is a good practice that enhances accessibility for users relying on screen readers.
  3. Code Clean-up: The comprehensive removal of the duplicate back-to-top button's HTML, CSS, and JavaScript (src/components/footer.html, src/js/footer.js, src/styles.css) effectively streamlines the codebase and eliminates redundant functionality.

📝 Overall Verdict

APPROVE - The PR introduces valuable security, robustness, and accessibility improvements while cleaning up redundant code.

@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.

3 issues found across 5 files

Confidence score: 4/5

  • src/components/footer.html changes Privacy Policy to open in a new tab, which introduces a user-facing navigation behavior change unrelated to the back-to-top fix and could surprise users or trigger policy/accessibility review late—revert this link behavior or move it to a dedicated PR before merging.
  • src/styles.css updates the Twitter hover color from #1DA1F2 to #000000, creating an unintended branding/UI shift that can slip through under an unrelated bugfix scope—remove this style edit from this PR or split it into a separate styling change.
  • src/js/app.js (renderCompare()) adds an image alt attribute outside the stated scope; while likely beneficial, mixed-purpose edits increase review noise and make regressions harder to trace after merge—keep this PR focused and land the accessibility tweak in its own follow-up PR.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/styles.css">

<violation number="1" location="src/styles.css:524">
P2: Out-of-scope style change: Twitter hover branding color changed from #1DA1F2 to #000000 in a PR scoped to removing a duplicate back-to-top button. Please remove this unrelated change or move it to a separate PR.</violation>
</file>

<file name="src/js/app.js">

<violation number="1" location="src/js/app.js:949">
P2: Out-of-scope change: the only edit in this file adds an `alt` attribute to an image in `renderCompare()`, which is unrelated to the PR purpose of removing a duplicate back-to-top button. Unrelated edits should be moved to a separate PR.</violation>
</file>

<file name="src/components/footer.html">

<violation number="1" location="src/components/footer.html:113">
P2: Unrelated behavior change: `Privacy Policy` link opens in new tab, which is out of scope for a back-to-top duplication fix.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant User as User
    participant Browser as Browser
    participant DOM as DOM
    participant JS as Application JS
    participant LS as localStorage
    
    Note over User,LS: Duplicate Back-to-Top Button Removal
    
    User->>Browser: Scrolling page
    Browser->>DOM: fire scroll event
    
    alt Scroll > 300px (NEW: No duplicate button logic)
        DOM->>JS: CHANGED: No back-to-top show/hide listener
        Note over JS: Previously: window.addEventListener('scroll', toggle back-to-top)
    end
    
    Note over User,LS: Bookmark feature improvement
    
    User->>Browser: Click bookmark button
    Browser->>DOM: Click event
    DOM->>JS: toggleBookmark(orgName, shouldAdd)
    JS->>LS: localStorage.setItem('bookmarks', ...)
    
    alt Storage quota exceeded (NEW: Error handling)
        LS-->>JS: QuotaExceededError
        JS->>DOM: alert('Could not save bookmark...')
        JS->>JS: return early (skip bookmark update)
    else Success
        LS-->>JS: ok
        JS->>JS: refreshOrgGridAfterBookmarkChange()
        JS->>JS: renderWatchlist()
        JS->>JS: updateAIInsights()
    end
    
    Note over User,LS: Clear all bookmarks with error handling
    
    User->>Browser: Click clear bookmarks
    Browser->>DOM: Click event
    DOM->>JS: confirm dialog
    alt User confirms
        JS->>LS: localStorage.setItem('bookmarks', '[]')
        alt Storage error (NEW)
            LS-->>JS: error
            JS->>DOM: alert('Could not clear bookmarks...')
        else Success
            LS-->>JS: ok
            JS->>JS: applyFilters()
            JS->>JS: renderWatchlist()
            JS->>JS: updateAIInsights()
        end
    end
    
    Note over User,LS: Mentor chip hover effects (NEW)
    
    User->>Browser: Hover mentor link chip
    Browser->>DOM: Apply CSS transitions (transform, background, border-color, box-shadow)
    
    Note over User,Browser: Privacy link opens new tab (CHANGED)
    
    User->>Browser: Click "Privacy Policy"
    Browser->>Browser: Open in new tab (target="_blank") with noopener noreferrer
    
    Note over User,DOM: Compare page image accessibility (NEW)
    
    User->>Browser: View compare section
    DOM->>DOM: <img> now includes alt text (org name)
Loading

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

Re-trigger cubic

Comment thread src/styles.css
background: #1DA1F2;
border-color: #1DA1F2;
box-shadow: 0 0 12px rgba(29, 161, 242, 0.5);
background: #000000;

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.

P2: Out-of-scope style change: Twitter hover branding color changed from #1DA1F2 to #000000 in a PR scoped to removing a duplicate back-to-top button. Please remove this unrelated change or move it to a separate PR.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/styles.css, line 524:

<comment>Out-of-scope style change: Twitter hover branding color changed from #1DA1F2 to #000000 in a PR scoped to removing a duplicate back-to-top button. Please remove this unrelated change or move it to a separate PR.</comment>

<file context>
@@ -521,49 +521,12 @@ body{background:var(--bg);color:var(--ink);font-family:'Plus Jakarta Sans',sans-
-  background: #1DA1F2;
-  border-color: #1DA1F2;
-  box-shadow: 0 0 12px rgba(29, 161, 242, 0.5);
+  background: #000000;
+  border-color: #000000;
+  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
</file context>

Comment thread src/js/app.js
item.innerHTML = safeHTML`
<div class="w-10 h-10 rounded-lg bg-orange-100 dark:bg-orange-950/40 flex items-center justify-center mx-auto mb-3 overflow-hidden">
<img src="${logoUrl}" data-org-name="${org.name}" class="w-full h-full object-contain" />
<img src="${logoUrl}" data-org-name="${org.name}" alt="${org.name} logo" class="w-full h-full object-contain" />

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.

P2: Out-of-scope change: the only edit in this file adds an alt attribute to an image in renderCompare(), which is unrelated to the PR purpose of removing a duplicate back-to-top button. Unrelated edits should be moved to a separate PR.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/js/app.js, line 949:

<comment>Out-of-scope change: the only edit in this file adds an `alt` attribute to an image in `renderCompare()`, which is unrelated to the PR purpose of removing a duplicate back-to-top button. Unrelated edits should be moved to a separate PR.</comment>

<file context>
@@ -946,7 +946,7 @@ function renderCompare() {
     item.innerHTML = safeHTML`
       <div class="w-10 h-10 rounded-lg bg-orange-100 dark:bg-orange-950/40 flex items-center justify-center mx-auto mb-3 overflow-hidden">
-        <img src="${logoUrl}" data-org-name="${org.name}" class="w-full h-full object-contain" />
+        <img src="${logoUrl}" data-org-name="${org.name}" alt="${org.name} logo" class="w-full h-full object-contain" />
       </div>
       <p class="font-bold text-sm truncate">${org.name}</p>
</file context>

<div class="flex items-center gap-4 flex-wrap justify-center">
<a class="text-xs font-bold uppercase tracking-widest text-zinc-500 hover:text-primary dark:text-zinc-400 transition-colors mr-2"
href="privacy.html">Privacy Policy</a>
href="privacy.html" target="_blank" rel="noopener noreferrer">Privacy Policy</a>

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.

P2: Unrelated behavior change: Privacy Policy link opens in new tab, which is out of scope for a back-to-top duplication fix.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/components/footer.html, line 113:

<comment>Unrelated behavior change: `Privacy Policy` link opens in new tab, which is out of scope for a back-to-top duplication fix.</comment>

<file context>
@@ -110,7 +110,7 @@ <h3 class="text-xs font-bold uppercase tracking-widest text-zinc-900 dark:text-z
     <div class="flex items-center gap-4 flex-wrap justify-center">
       <a class="text-xs font-bold uppercase tracking-widest text-zinc-500 hover:text-primary dark:text-zinc-400 transition-colors mr-2"
-        href="privacy.html">Privacy Policy</a>
+        href="privacy.html" target="_blank" rel="noopener noreferrer">Privacy Policy</a>
       <a class="social-link github" href="https://github.com/S3DFX-CYBER/GSoC-Org-Finder-" target="_blank"
         rel="noopener noreferrer" aria-label="GitHub Repository">
</file context>
Suggested change
href="privacy.html" target="_blank" rel="noopener noreferrer">Privacy Policy</a>
href="privacy.html">Privacy Policy</a>

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

✅ Merge Conflicts Resolved

Thanks @saurabhhhcodes, this PR is mergeable again.

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.

[BUG] : Remove duplicate two back to top buttons

1 participant