From 3eb5202aac8fee9d900170e020e66653ba1341b2 Mon Sep 17 00:00:00 2001
From: th
Date: Sun, 12 Apr 2026 12:10:56 +0200
Subject: [PATCH] fix: ESC doesn't kill panel mid-run, remove stale #inbox test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
runner.js: the Escape handler now checks panel.style.display !== 'none'
before closing. During the test run the panel is hidden (display:none)
but the variable is truthy — synthetic Escape events dispatched by
tests (e.g. "closes on ESC") were triggering close() mid-run, removing
the panel entirely so results never showed.
quick-capture.test.js: the "Enter creates card with #inbox tag" test
was asserting found.tags contains 'inbox', but the #inbox auto-tag
was removed in 0.9.17. Renamed to "Enter creates card in active
bucket" and dropped the stale tags assertion.
chore: bump version to 0.9.20
Co-Authored-By: Claude Opus 4.6 (1M context)
---
config.php | 2 +-
public/plugins/tests/quick-capture.test.js | 3 +--
public/plugins/tests/runner.js | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/config.php b/config.php
index 7d7576b..a0ea6fb 100644
--- a/config.php
+++ b/config.php
@@ -1,7 +1,7 @@
{
await closeAll();
});
- it('Enter creates card with #inbox tag', async () => {
+ it('Enter creates card in active bucket', async () => {
pressKey('n', { ctrlKey: true });
await sleep(100);
const input = $('#quick-capture-input');
@@ -57,7 +57,6 @@ describe('Quick Capture: Card Creation', () => {
const cards = await fetch('api/cards').then(r => r.json());
const found = cards.find(c => c.title === '__test_quick_capture__');
expect(found).toExist();
- expect(found.tags).toContain('inbox');
});
it('capture bar closes after Enter', async () => {
diff --git a/public/plugins/tests/runner.js b/public/plugins/tests/runner.js
index 5967035..8c5b2f6 100644
--- a/public/plugins/tests/runner.js
+++ b/public/plugins/tests/runner.js
@@ -496,7 +496,7 @@ document.addEventListener('keydown', e => {
e.preventDefault();
panel ? close() : open();
}
- if (e.key === 'Escape' && panel) {
+ if (e.key === 'Escape' && panel && panel.style.display !== 'none') {
e.preventDefault();
e.stopPropagation();
close();
|