Skip to content

feat: Implement smooth modal closing animations - #41

Open
bugragungoz wants to merge 1 commit into
masterfrom
feat/ux-modal-animations-2196284633839480676
Open

feat: Implement smooth modal closing animations#41
bugragungoz wants to merge 1 commit into
masterfrom
feat/ux-modal-animations-2196284633839480676

Conversation

@bugragungoz

Copy link
Copy Markdown
Owner

This change implements a smooth micro-UX improvement for modal interactions.

Previously, modals and overlays were abruptly hidden by hardcoding display = 'none', which breaks common micro-interaction design patterns (like fade and scale-out).

Changes include:

  • A new global window.closeModal(overlay) JavaScript helper inside src/app.js applying a 140ms timeout with .closing animation class, including a mechanism to stop potential race condition timeouts.
  • Replacing the abrupt display = 'none' logic with the new helper inside app.js and various JS modules (modals.js, ai.js, bulk_categorize.js, import.js, export.js, projects.js, table.js).
  • Adding .closing CSS definitions to src/style.css.
  • Appending the relevant critical UX log into .Jules/palette.md to reinforce UX consistency across the Vanilla JS/Tauri application.

PR created automatically by Jules for task 2196284633839480676 started by @bugragungoz

- Add a `window.closeModal` helper in `src/app.js` with timeout and race-condition prevention to handle smooth transitions.
- Replace abrupt `overlay.style.display = 'none'` logic with the helper logic for modal overlays.
- Define `.closing` keyframes (`ci-overlay-fade-out` and `ci-modal-pop-out`) in `src/style.css` for graceful transitions matching Material Design 3 guidelines.
- Append learning logic to `.Jules/palette.md` for consistent UX application across the project architecture.

Co-authored-by: bugragungoz <209906170+bugragungoz@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings July 10, 2026 00:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces smoother modal close micro-interactions by replacing abrupt display = 'none' closes with a shared close helper that triggers a short CSS exit animation before hiding the overlay.

Changes:

  • Added .closing exit animations for modal overlays/modals in CSS.
  • Introduced a global window.closeModal(overlay) helper in src/app.js and updated multiple modules to use it when closing overlays.
  • Added a UX guideline entry documenting the expected modal-close behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/style.css Adds .closing styles and keyframes for overlay fade-out + modal pop-out.
src/app.js Introduces window.closeModal() and wires it into common close handlers.
src/modules/table.js Uses window.closeModal() for the bulk-delete confirmation overlay.
src/modules/projects.js Uses window.closeModal() after saving project assignment.
src/modules/modals.js Uses window.closeModal() for edit/detail/confirm modal closes.
src/modules/import.js Uses window.closeModal() after import completion.
src/modules/export.js Uses window.closeModal() when choosing an export format.
src/modules/bulk_categorize.js Uses window.closeModal() for the bulk categorize overlay.
src/modules/ai.js Uses window.closeModal() for the categorize progress overlay.
.Jules/palette.md Documents the UX rule for modal close animations and the helper usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app.js
Comment on lines 551 to 553
if (newName === (isSub ? oldSub : oldCat)) {
overlay.style.display = 'none';
window.closeModal(overlay);
return;
Comment thread src/app.js
Comment on lines +1274 to +1287
// Clear any pending timeout to prevent race conditions
if (overlay.dataset.closeTimeout) {
clearTimeout(parseInt(overlay.dataset.closeTimeout));
}

// Only animate if it's a modal overlay
if (overlay.classList.contains('modal-overlay')) {
overlay.classList.add('closing');
const timeoutId = setTimeout(() => {
overlay.style.display = 'none';
overlay.classList.remove('closing');
delete overlay.dataset.closeTimeout;
}, 140);
overlay.dataset.closeTimeout = timeoutId.toString();
Comment thread src/app.js
Comment on lines +1271 to +1276
window.closeModal = function(overlay) {
if (!overlay) return;

// Clear any pending timeout to prevent race conditions
if (overlay.dataset.closeTimeout) {
clearTimeout(parseInt(overlay.dataset.closeTimeout));
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.

2 participants