Skip to content

fix: add history.replaceState to clearAllFilters to clean URL on rese…#1952

Open
Rudrasamadhiya wants to merge 1 commit into
S3DFX-CYBER:mainfrom
Rudrasamadhiya:patch-1
Open

fix: add history.replaceState to clearAllFilters to clean URL on rese…#1952
Rudrasamadhiya wants to merge 1 commit into
S3DFX-CYBER:mainfrom
Rudrasamadhiya:patch-1

Conversation

@Rudrasamadhiya

@Rudrasamadhiya Rudrasamadhiya commented Jun 24, 2026

Copy link
Copy Markdown

Fixes #1053

Summary

clearAllFilters() in index.html was missing history.replaceState() to clean the URL after resetting filters. This caused stale URL params to persist, so sharing or refreshing after clearing would restore all supposedly cleared filters.

Changes

  • Added history.replaceState(null, '', location.pathname) before applyFilters() in clearAllFilters() to clean the URL query string on reset

Review in cubic

closes S3DFX-CYBER#1053)

Updated history state management to reset URL parameters before applying filters.
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@Rudrasamadhiya 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 added dco-missing bug Something isn't working labels Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ DCO Sign-off Missing

Hi @Rudrasamadhiya 👋

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

Invalid Commits

  • 0187cea

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

💬 Faster Reviews & Assignments

Hi @Rudrasamadhiya, 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

👋 Thanks for opening a PR, @Rudrasamadhiya!

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 Jun 24, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Validation Issues

Hi @Rudrasamadhiya, 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.

@coderabbitai

coderabbitai Bot commented Jun 24, 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

Run ID: 4ea90a69-856e-4367-8e82-58d747ad56c4

📥 Commits

Reviewing files that changed from the base of the PR and between 2262547 and 0187cea.

📒 Files selected for processing (1)
  • index.html
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (1)
index.html (1)

4260-4260: LGTM!


📝 Walkthrough

Summary by CodeRabbit

Bug Fixes

  • Filter clearing now properly resets the URL query string, ensuring the address bar reflects the current cleared state and provides a more consistent browsing experience.

Walkthrough

In index.html, clearAllFilters() now calls history.replaceState(null, '', location.pathname) before invoking applyFilters(), explicitly stripping all URL query parameters when the user clears filters instead of relying solely on applyFilters() to handle URL state.

Changes

URL Reset on Filter Clear

Layer / File(s) Summary
Explicit URL reset in clearAllFilters
index.html
Adds history.replaceState(null, '', location.pathname) immediately before applyFilters() so URL query parameters are stripped when all filters are cleared.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • S3DFX-CYBER/GSoC-Org-Finder-#198: Implements URL query–based filter state syncing and initialization, which is directly complemented by this explicit URL clear on reset.
  • S3DFX-CYBER/GSoC-Org-Finder-#555: Modifies the same clearAllFilters/applyFilters URL-handling logic with history.replaceState in index.html.
  • S3DFX-CYBER/GSoC-Org-Finder-#1685: Also modifies clearAllFilters() in index.html to reset filter state and call applyFilters(), with overlapping "clear URL query parameters" behavior.

Suggested labels

type:bug, size/s

Suggested reviewers

  • S3DFX-CYBER

Poem

🐇 Hop, hop — the URL's clean at last,
No ghostly query strings haunting the past!
replaceState wipes the path with glee,
Filters reset, as clear as can be.
✨ A single line, a mighty fix!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only partially addresses issue #1053. It adds history.replaceState() but omits resetting activeChip and selectedLanguages variables, leaving the ghost filtering problem unresolved. Also reset activeChip = null and selectedLanguages.clear() in clearAllFilters() to fully resolve the state management bug described in issue #1053.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately references the main change: adding history.replaceState to clearAllFilters to clean the URL on filter reset.
Description check ✅ Passed The description is directly related to the changeset, explaining the bug fix and the specific code change needed to address the issue.
Out of Scope Changes check ✅ Passed The change is within scope of the linked issue, making only a focused modification to index.html's clearAllFilters function.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

@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

🤖 TENET Agent Review

📋 Summary

This PR addresses a client-side bug where clearing filters did not update the URL, causing previously cleared filters to reappear upon refresh or sharing. The fix correctly implements history.replaceState to clean the URL's query string, ensuring the UI state and URL state are synchronized after filters are reset. The approach is sound and uses standard browser APIs for client-side URL manipulation.

🔐 Security Findings

No security issues found.

🧹 Code Quality

  • index.html - The two statements history.replaceState(null, '', location.pathname); and applyFilters(); are combined on a single line. For improved readability and adherence to common coding style, consider splitting them onto separate lines.

✅ What's Done Well

  • Effectively resolves a user experience issue related to stale URL parameters.
  • Utilizes the standard history.replaceState API correctly for client-side URL manipulation.
  • The updated comment accurately reflects the combined actions of resetting URL parameters and re-rendering.

📝 Overall Verdict

[APPROVE] - The fix is correct, improves user experience, and introduces no security concerns.

@sonarqubecloud

Copy link
Copy Markdown

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Modifies browser history handling to fix URL persistence after clearing filters, a user-facing change that could affect navigation and sharing. It should be reviewed to avoid any side effects.

Re-trigger cubic

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

✅ Merge Conflicts Resolved

Thanks @Rudrasamadhiya, 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] clearAllFilters() leaves activeChip and selectedLanguages dirty — ghost filtering persists silently after reset

1 participant