From 00ec14aed38e6dbd977fdc962f08004fc887b20d Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Fri, 27 Feb 2026 19:49:05 +0300 Subject: [PATCH] feat(web-test): add required field detection via markIncomplete CSS class Fields with 1C fill-check enabled show `required: true` in getFormState() when empty, allowing proactive filling before posting. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/web-test/SKILL.md | 2 +- .claude/skills/web-test/scripts/dom.mjs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.claude/skills/web-test/SKILL.md b/.claude/skills/web-test/SKILL.md index c674872d..83a14915 100644 --- a/.claude/skills/web-test/SKILL.md +++ b/.claude/skills/web-test/SKILL.md @@ -102,7 +102,7 @@ In `exec` sandbox, all browser.mjs functions are available as globals — no `im | Function | Description | |----------|-------------| -| `getFormState()` | Current form: fields, buttons, tabs, table preview, filters | +| `getFormState()` | Current form: fields (with `required` flag for unfilled mandatory fields), buttons, tabs, table preview, filters | | `readTable({maxRows, offset})` | Full table data with pagination. Default: 20 rows | | `getSections()` | Sections + commands of active section | | `getPageState()` | Sections + open tabs | diff --git a/.claude/skills/web-test/scripts/dom.mjs b/.claude/skills/web-test/scripts/dom.mjs index 7b56de91..d7c2fb2b 100644 --- a/.claude/skills/web-test/scripts/dom.mjs +++ b/.claude/skills/web-test/scripts/dom.mjs @@ -58,6 +58,7 @@ const READ_FORM_FN = `function readForm(p) { if (el.type && el.type !== 'text') field.type = el.type; if (document.activeElement === el) field.focused = true; if (actions.length) field.actions = actions; + if (el.closest('.inputsBox')?.classList.contains('markIncomplete')) field.required = true; fields.push(field); }); @@ -73,6 +74,7 @@ const READ_FORM_FN = `function readForm(p) { if (el.readOnly) field.readonly = true; if (el.disabled) field.disabled = true; if (document.activeElement === el) field.focused = true; + if (el.closest('.inputsBox')?.classList.contains('markIncomplete')) field.required = true; fields.push(field); });