From 21a0e360ef20166f53aeb82a9ea0faec158419b0 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Mon, 16 Mar 2026 13:04:27 +0300 Subject: [PATCH] fix(web-test): fillTableRow stops Tab early when only checkboxes remain Tab past the last cell in 1C creates extra rows. Now when all unfilled fields are checkboxes (boolean values), the Tab loop exits immediately instead of pressing Tab 3 more times on non-INPUT cells. Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/skills/web-test/scripts/browser.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.claude/skills/web-test/scripts/browser.mjs b/.claude/skills/web-test/scripts/browser.mjs index 2a279df0..2b438b35 100644 --- a/.claude/skills/web-test/scripts/browser.mjs +++ b/.claude/skills/web-test/scripts/browser.mjs @@ -2537,7 +2537,10 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) { if (cell.tag !== 'INPUT' || !cell.fullName) { // Not in an editable grid cell — Tab past (ERP has DIV focus between cells) nonInputCount++; - if (nonInputCount > 3) break; // truly exited edit mode + // If only checkbox fields remain unfilled, stop Tab'ing to avoid creating extra rows + const onlyCheckboxLeft = [...pending.values()].every(p => p.filled || + ['true', 'false', 'да', 'нет', '1', '0', 'yes', 'no'].includes(p.value.toLowerCase().trim())); + if (nonInputCount > 3 || onlyCheckboxLeft) break; await page.keyboard.press('Tab'); await page.waitForTimeout(300); continue;