mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-19 21:03:09 +00:00
Merge default close-app selection
This commit is contained in:
3 files changed
+9
-10
No files matched your search
@@ -1967,9 +1967,8 @@ class Shell {
|
||||
},
|
||||
});
|
||||
}
|
||||
// Close current app sits first but the menu opens on Focus app switcher, so a
|
||||
// reflexive tap never closes the window.
|
||||
const initialSelection = items.length;
|
||||
// Prefer closing the current app; pinned windows fall back to the switcher.
|
||||
const initialSelection = 0;
|
||||
items.push(
|
||||
{
|
||||
// Defocus the app (hand focus to the sidebar) without closing it: the
|
||||
|
||||
@@ -10,8 +10,7 @@ is closeable. It is absent for the pinned launcher (the large application grid).
|
||||
multiple windows belonging to one app. Pinned windows remain available.
|
||||
|
||||
Both actions reuse the shell's normal close/cleanup path. The menu closes before
|
||||
the windows do, and focus returns to the switcher. It opens on “Focus app switcher”
|
||||
to avoid an accidental close. With no closeable windows, “Close all apps” is disabled.
|
||||
the windows do, and focus returns to the switcher. It selects “Close current app” by default when available, otherwise “Focus app switcher”. With no closeable windows, “Close all apps” is disabled.
|
||||
No new preferences or persistence format are introduced.
|
||||
|
||||
Software: `tests/app-switcher-menu.test.cjs` covers both gestures, apps claiming
|
||||
@@ -27,7 +26,7 @@ Manual validation on glasses remains pending:
|
||||
4. Use “Close all apps”; verify the launcher remains usable and apps can reopen.
|
||||
5. Repeat for left/right/bottom/popup switcher positions and with a running game,
|
||||
a hold-to-talk app and an app exposing multiple windows.
|
||||
6. Check cancel/back and the initial selection do not close anything. Check both
|
||||
6. Check cancel/back closes nothing; confirming the initial selection closes the current app when available. Check both
|
||||
menu gestures still work normally when focus is inside an app.
|
||||
|
||||
Closing windows retains each app's existing lifecycle semantics; it does not
|
||||
|
||||
@@ -152,7 +152,7 @@ test('switcher opens its menu on hold or tap-hold even for an app claiming holds
|
||||
assert.ok(h.menu());
|
||||
assert.ok(h.menu().items.some(item => item.label === 'Close current app'));
|
||||
assert.ok(h.menu().items.some(item => item.label === 'Close all apps'));
|
||||
assert.equal(h.menu().items[h.menu().selectedIndex].label, 'Focus app switcher');
|
||||
assert.equal(h.menu().items[h.menu().selectedIndex].label, 'Close current app');
|
||||
assert.deepEqual(h.delivered, [['current', 'system-menu-opened']]);
|
||||
assert.equal(h.s.escapeStarted, undefined);
|
||||
assert.equal(h.s.focus, 'sidebar');
|
||||
@@ -164,7 +164,7 @@ test('close current app closes the captured window and preserves the launcher an
|
||||
const h = fixture();
|
||||
await h.input('long-press');
|
||||
h.s.selectedIndex = 2; // An asynchronous focus change must not redirect the close action.
|
||||
h.choose('Close current app');
|
||||
h.menu().items[h.menu().selectedIndex].onSelect({ stack: h.s.stack });
|
||||
assert.deepEqual(h.closed, ['current']);
|
||||
assert.deepEqual(h.s.windows.map(w => w.windowId), ['launcher', 'background']);
|
||||
assert.equal(h.s.focus, 'sidebar');
|
||||
@@ -176,6 +176,7 @@ test('launcher offers close all but never close current; close all leaves only t
|
||||
h.s.selectedIndex = 0;
|
||||
await h.input('short-then-long-press');
|
||||
assert.ok(!h.menu().items.some(item => item.label === 'Close current app'));
|
||||
assert.equal(h.menu().items[h.menu().selectedIndex].label, 'Focus app switcher');
|
||||
h.choose('Close all apps');
|
||||
assert.deepEqual(h.closed, ['current', 'background']);
|
||||
assert.deepEqual(h.s.windows.map(w => w.windowId), ['launcher']);
|
||||
@@ -197,10 +198,10 @@ test('close all uses normal cleanup despite reentrant removal, multiple windows
|
||||
assert.equal(h.s.foregroundWindow().windowId, 'launcher');
|
||||
});
|
||||
|
||||
test('default selection and cancel do not close apps; an open overlay never receives a second menu', async () => {
|
||||
test('focusing switcher and cancelling do not close apps; an open overlay never receives a second menu', async () => {
|
||||
const h = fixture();
|
||||
await h.input('long-press');
|
||||
h.choose(h.menu().items[h.menu().selectedIndex].label);
|
||||
h.choose('Focus app switcher');
|
||||
assert.deepEqual(h.closed, []);
|
||||
await h.input('long-press');
|
||||
const menu = h.menu();
|
||||
|
||||
Reference in new issue
Block a user