fix(tiles): a keyboard focus brings the Tiles hover card back after a click

Found live: a click on Tiles hides the card and keeps it hidden while
the pointer rests on the button, until the pointer leaves. With the
pointer left there, tabbing away and back onto the button showed no card
either, so a keyboard user whose mouse happened to sit on the button
never got the Shift+F10 hint.

Leaving the button (blur) now ends that suppression as well: a keyboard
focus that comes back later is a new arrival. A click that opens the
grid or a right-click that opens the menu still shows nothing, since no
pointerenter or focus follows while the pointer stays.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-08 17:48:04 +02:00
parent d2a1d14eac
commit a898253089
2 changed files with 18 additions and 1 deletions
+12
View File
@@ -281,6 +281,18 @@ describe('hiding', () => {
}
});
it('a keyboard focus coming back after a click shows it, the pointer still resting there', () => {
shown();
btn.dispatch('click', {});
expect(card()!.hidden).toBe(true);
// Tab away and back, the mouse never moved.
btn.dispatch('blur', {});
(btn as unknown as { matches: (s: string) => boolean }).matches = (s) => s === ':focus-visible';
btn.dispatch('focus', {});
vi.advanceTimersByTime(300);
expect(card()!.hidden).toBe(false);
});
it('the count menu never opens beside it: openTileCountMenu hides it first', () => {
const app = shown();
app.openTileCountMenu({ preventDefault: vi.fn() });