Skip to content

fix: restore prior body overflow when ProfileQrModal unmounts - #3502

Merged
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
nyxsky404:fix/profile-qr-restore-overflow
Aug 30, 2026
Merged

fix: restore prior body overflow when ProfileQrModal unmounts#3502
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
nyxsky404:fix/profile-qr-restore-overflow

Conversation

@nyxsky404

@nyxsky404 nyxsky404 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

Test plan

  • pnpm exec vitest run test/components/ProfileQrModal.test.tsx
  • Open the profile QR modal, close it, and confirm background scroll returns to whatever it was before (including if another overlay had already locked it)

CodeAnt-AI Description

Restore the page’s previous scroll setting after closing the profile QR modal

What Changed

  • The modal still prevents background scrolling while open
  • Closing or unmounting the modal now restores the scroll setting that was active before it opened, instead of clearing it
  • Tests verify that an existing overflow setting is preserved

Impact

✅ Preserved background scroll behavior with stacked overlays
✅ Fewer unexpected page scroll changes after closing the modal

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Hardcoding "" on cleanup clobbers any inline overflow that was set before the modal opened.
@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:testing GSSoC type bonus: tests (+10 pts) labels Aug 17, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@codeant-ai

codeant-ai Bot commented Aug 17, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR e84978d Aug 17, 2026 · 17:15 17:17

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Aug 17, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Exactly the follow-up I asked for, and you did the part that makes it real: the test now sets document.body.style.overflow = "scroll" before mounting and asserts it comes back, so the behaviour is actually pinned rather than just described. Capturing the previous value beats hardcoding "", which clobbered whatever was there before the modal opened.

Verified against current main: merges clean, type-check clean, all 8 ProfileQrModal tests pass.

The Analyze (javascript-typescript) failure was not your code — CodeQL hit a GitHub-side outage on 17 Aug (No server is currently available to service your request, thrown from the init action before it could even produce debugging artifacts). I re-ran the job and it passes.

Merged. Thanks for splitting it out cleanly.

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level1 GSSoC Level 1 - Beginner (10 points) labels Aug 30, 2026
@Priyanshu-byte-coder
Priyanshu-byte-coder merged commit 6e22da7 into Priyanshu-byte-coder:main Aug 30, 2026
18 of 20 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

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

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level1 GSSoC Level 1 - Beginner (10 points) size:S This PR changes 10-29 lines, ignoring generated files type:bug GSSoC type bonus: bug fix type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants