fix(ui): F3 overlay was always shown as an empty box and could not be closed

This commit is contained in:
Benjamin Oezcan
2026-11-19 15:28:23 +01:00
parent 90f1c9c37e
commit 2bf5a40ebc
2 changed files with 14 additions and 0 deletions

View File

@@ -38,6 +38,7 @@
#netov { position: absolute; left: 8px; bottom: 12px; z-index: 9; width: 316px; padding: 8px; border-radius: 6px;
background: rgba(10,12,16,.86); border: 1px solid var(--line); box-shadow: var(--hl); font: 12px/1.35 Consolas, monospace;
color: var(--text); pointer-events: none; }
#netov.hide { display: none; } /* #netov beats the generic .hide rule - hide it explicitly */
#netov .nvh { font-weight: bold; color: var(--accent); margin-bottom: 4px; }
#netov canvas { display: block; width: 300px; height: 84px; }
#netov .nvleg { display: flex; gap: 8px; flex-wrap: wrap; margin: 3px 0 5px; font-size: 11px; color: var(--dim, #8d95a8); }

View File

@@ -88,3 +88,16 @@ test('shop purchase is checked and stored by the server', async ({ browser }) =>
expect((await cheat.json()).money).toBe(after);
await ctx.close();
});
test('F3 network overlay: hidden at start, F3 shows it with content, F3 hides it again', async ({ page }) => {
await login(page, 'benni', 'Benni2000!');
const ov = page.locator('#netov');
await expect(ov).toBeHidden(); // regression: an empty box was always on screen
await page.keyboard.press('F3');
await expect(ov).toBeVisible();
await expect(ov).toContainText(/ping/i);
await page.keyboard.press('F3');
await expect(ov).toBeHidden(); // regression: it could not be closed again
await page.keyboard.press('F3');
await expect(ov).toBeVisible();
});