kitops icon indicating copy to clipboard operation
kitops copied to clipboard

fix(dev-mode): use animationend for modal scroll lock

Open AdeshDeshmukh opened this issue 8 months ago • 1 comments

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 modalShow while modal is open

Validation

  • npx eslint src/components/SettingsModal.vue passes
  • 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.

AdeshDeshmukh avatar Mar 25 '26 13:03 AdeshDeshmukh

I also noticed that there are unsigned commits, so that too needs to be fixed.

javisperez avatar Mar 25 '26 14:03 javisperez

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.

amisevsk avatar Jun 22 '26 18:06 amisevsk

Hi @javisperez and @amisevsk — thank you both for your review and guidance on this PR. I've addressed all the feedback:

  • Fixed the animationName check 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!

AdeshDeshmukh avatar Jun 23 '26 04:06 AdeshDeshmukh