refactor(web-test): returnFormState в nav + grid + spreadsheet + selectValue (7 веток)

navigation.mjs: navigateSection (sections+commands ветка), switchTab, openFile
(оба success-сайта). Закрывает R1/R2 для навигационных action-функций.

grid.mjs: deleteTableRow — заодно унификация shape с SKILL.md ("→ form state"
плоский). До этого код возвращал {deleted, ..., form: formData} в нарушение
документации; теперь плоский state с extras. JSDoc обновлён.

spreadsheet.mjs: clickSpreadsheetCell. select-value.mjs: ветка clear-success
selectValue (search=null, method='clear').

Phase 1 / C3 (final) из плана upload/returnFormState-audit.md. Полный регресс 19/19
зелёный. Известный pre-existing test-isolation issue в одиночном прогоне
04-selectvalue (auto-history) — описан в backlog §0.8 #4 родительского плана.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-05-27 12:41:13 +03:00
parent a381fca0a1
commit 707033e25b
4 changed files with 16 additions and 21 deletions
@@ -1,4 +1,4 @@
// web-test forms/select-value v1.17 — Reference & composite-type value selection: selectValue, fillReferenceField, selection/type-dialog pickers.
// web-test forms/select-value v1.18 — Reference & composite-type value selection: selectValue, fillReferenceField, selection/type-dialog pickers.
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import {
@@ -17,7 +17,7 @@ import { highlight, unhighlight } from '../recording/highlight.mjs';
import {
safeClick, findFieldInputId, readEdd,
detectNewForm as helperDetectNewForm,
clickEddItemViaDispatch, clickShowAllInEdd,
clickEddItemViaDispatch, clickShowAllInEdd, returnFormState,
} from '../core/helpers.mjs';
import { pasteText } from '../core/clipboard.mjs';
import { getFormState } from './state.mjs';
@@ -617,8 +617,7 @@ export async function selectValue(fieldName, searchText, { type } = {}) {
await waitForStable();
}
if (highlightMode) try { await unhighlight(); } catch {}
const formData = await getFormState();
return { ...formData, selected: { field: fieldName, search: null, method: 'clear' } };
return returnFormState({ selected: { field: fieldName, search: null, method: 'clear' } });
}
// === COMPOSITE TYPE HANDLING ===