[PR #2604] [MERGED] fix(modal): open dialog reliably in electron desktop #5761

Closed
opened 2026-04-16 13:51:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2604
Author: @tink-bot
Created: 4/11/2026
Status: Merged
Merged: 4/11/2026
Merged by: @kolaente

Base: mainHead: fix-desktop-search-modal


📝 Commits (4)

  • 4ec7b7b test(modal): cover open race for #2590
  • 9238d22 fix(modal): open dialog reliably in electron desktop
  • c0d288c fix(modal): clear stale data-closing flag when re-opened mid-close
  • a1db662 fix(modal): skip showModal if enabled flipped false before mount

📊 Changes

2 files changed (+242 additions, -14 deletions)

View changed files

frontend/src/components/misc/Modal.test.ts (+216 -0)
📝 frontend/src/components/misc/Modal.vue (+26 -14)

📄 Description

The search (quick actions) modal in the Vikunja Desktop v2.3.0 Electron build is unresponsive: the <dialog> element mounts but never gets showModal() called on it, leaving .open === false and opacity: 0. Root cause is a race in Modal.vue where showModal() was scheduled via nextTick() after flipping showDialog = true, but the element's mount flush can be deferred past that nextTick under Electron's renderer timing, so dialogRef.value was null when the callback ran and the call was silently skipped.

Replace the nextTick wait with watch(dialogRef, ...), which fires deterministically the moment Vue populates the template ref — regardless of how many flushes the renderer takes. The enabled watcher is flipped to {immediate: true} to absorb the removed onMounted path.

Fixes #2590


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2604 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 4/11/2026 **Status:** ✅ Merged **Merged:** 4/11/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix-desktop-search-modal` --- ### 📝 Commits (4) - [`4ec7b7b`](https://github.com/go-vikunja/vikunja/commit/4ec7b7b1f90f8dc957a181585fda2936de18d870) test(modal): cover open race for #2590 - [`9238d22`](https://github.com/go-vikunja/vikunja/commit/9238d22c73ad35cfbee511688c0c49f338659500) fix(modal): open dialog reliably in electron desktop - [`c0d288c`](https://github.com/go-vikunja/vikunja/commit/c0d288c6c6a59e348a48d5f0eb2cf5f1f6e52c40) fix(modal): clear stale data-closing flag when re-opened mid-close - [`a1db662`](https://github.com/go-vikunja/vikunja/commit/a1db662c72ce86f017cc2342c5a881596ce6cb5b) fix(modal): skip showModal if enabled flipped false before mount ### 📊 Changes **2 files changed** (+242 additions, -14 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/components/misc/Modal.test.ts` (+216 -0) 📝 `frontend/src/components/misc/Modal.vue` (+26 -14) </details> ### 📄 Description The search (quick actions) modal in the Vikunja Desktop v2.3.0 Electron build is unresponsive: the `<dialog>` element mounts but never gets `showModal()` called on it, leaving `.open === false` and `opacity: 0`. Root cause is a race in `Modal.vue` where `showModal()` was scheduled via `nextTick()` after flipping `showDialog = true`, but the element's mount flush can be deferred past that `nextTick` under Electron's renderer timing, so `dialogRef.value` was `null` when the callback ran and the call was silently skipped. Replace the `nextTick` wait with `watch(dialogRef, ...)`, which fires deterministically the moment Vue populates the template ref — regardless of how many flushes the renderer takes. The `enabled` watcher is flipped to `{immediate: true}` to absorb the removed `onMounted` path. Fixes #2590 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:51:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5761