fix(dev-mode): use animationend for modal scroll lock
Summary
This change fixes the Settings modal open lifecycle by replacing a timer-based body scroll lock with an animation-driven approach.
Problem
The modal previously used a hard-coded setTimeout(150) in onMounted to add overflow-hidden to document.body. This is brittle and can drift from actual animation timing.
Root cause
UI state synchronization depended on elapsed time instead of the real completion event of the modalShow animation.
Solution
- Added
onModalAnimationEnd(event: AnimationEvent) - Updated template to use
@animationend="onModalAnimationEnd" - Removed timer logic from
onMounted - Kept guard checks to ensure we only react to
modalShowwhile modal is open
Validation
npx eslint src/components/SettingsModal.vuepasses- Note: repo-wide frontend lint/type-check currently has unrelated pre-existing issues in other files
Risk
Low. Change is localized to one component (SettingsModal.vue) and only affects timing mechanism for applying body scroll lock.
I also noticed that there are unsigned commits, so that too needs to be fixed.
Closing this PR as it has been in request changes for nearly a month with no attention. Feel free to reopen with the review addressed.
Hi @javisperez and @amisevsk — thank you both for your review and guidance on this PR. I've addressed all the feedback:
- Fixed the
animationNamecheck to use.includes('modalShow')instead of strict equality, so it correctly handles Vue's scoped style hashing in both dev and production builds - Added DCO sign-off to the commit
- Tested with
pnpm build(vite build passes)
Since GitHub doesn't allow reopening a PR after force-pushing, I've opened a new PR with the fixes applied: #1220. Would appreciate your review when you have time. Thank you!