Skip to content

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

Open
AdeshDeshmukh wants to merge 3 commits into
kitops-ml:mainfrom
AdeshDeshmukh:fix/settings-modal-animationend
Open

fix(dev-mode): use animationend for modal scroll lock#1220
AdeshDeshmukh wants to merge 3 commits into
kitops-ml:mainfrom
AdeshDeshmukh:fix/settings-modal-animationend

Conversation

@AdeshDeshmukh

@AdeshDeshmukh AdeshDeshmukh commented Jun 23, 2026

Copy link
Copy Markdown

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. Additionally, Vue's scoped styles rewrite @keyframes names with a hash suffix at build time (e.g. modalShow-xxxx), so a strict equality check against 'modalShow' would never match at runtime.

Root cause

UI state synchronization depended on elapsed time instead of the real completion event of the modalShow animation.

Solution

  • Added onModalAnimationEnd(event: AnimationEvent) handler
  • Template uses @animationend="onModalAnimationEnd"
  • Changed animation name check from strict equality to .includes('modalShow') to handle Vue's scoped style hashing
  • Removed timer logic from onMounted
  • Removed unused isVisible state

Validation

  • vite build passes
  • Note: repo-wide frontend type-check currently has unrelated pre-existing issues in other files (Input.vue, Radio.vue, Checkbox.vue)

Addresses previous review

This is a follow-up to the now-closed PR #1140, addressing @javisperez's feedback:

  • Fixed animationName check to use .includes() instead of !== (handles Vue scoped style hashing)
  • Added DCO sign-off to commit

Replace timer-based body scroll locking with an animationend handler tied to the modalShow animation. This removes timing race conditions and keeps modal behavior robust if animation duration changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
Copilot AI review requested due to automatic review settings June 23, 2026 04:56

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread frontend/dev-mode/src/components/SettingsModal.vue

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

Copilot's feedback makes sense, we should handle it.

Prevents the animationend handler from firing on bubbled events from
child elements, as suggested by Copilot review.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
@AdeshDeshmukh

Copy link
Copy Markdown
Author

Thank you for the review. I have added the .self modifier as suggested by Copilot.

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread frontend/dev-mode/src/components/SettingsModal.vue Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
@AdeshDeshmukh

Copy link
Copy Markdown
Author

Thanks, already pushed the fix. Ready for re-review.

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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

LGTM, Thanks for the PR @AdeshDeshmukh !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants