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
co-authored by Claude Opus 4.7
parent a381fca0a1
commit 707033e25b
4 changed files with 16 additions and 21 deletions
@@ -1,4 +1,4 @@
// web-test nav/navigation v1.16 — Section navigation, openCommand, switchTab, navigateLink (Shift+F11), openFile.
// web-test nav/navigation v1.17 — Section navigation, openCommand, switchTab, navigateLink (Shift+F11), openFile.
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import {
@@ -12,9 +12,9 @@ import {
import { dismissPendingErrors, checkForErrors } from '../core/errors.mjs';
import { waitForStable, waitForCondition } from '../core/wait.mjs';
import { highlight, unhighlight } from '../recording/highlight.mjs';
import { returnFormState } from '../core/helpers.mjs';
import { returnFormState } from '../core/helpers.mjs';
// Static import — ESM cycle that resolves at call time.
// Static import — ESM cycle that resolves at call time.
import { pasteText } from '../core/clipboard.mjs';
import { getFormState } from '../forms/state.mjs';
/**
@@ -60,7 +60,7 @@ export async function navigateSection(name) {
sections: ${readSectionsScript()},
commands: ${readCommandsScript()}
})`);
})`);
return returnFormState({ navigated: result, sections, commands });
}
/** Read commands of the current section. */
@@ -88,7 +88,7 @@ export async function switchTab(name) {
const result = await page.evaluate(switchTabScript(name));
if (result?.error) throw new Error(`switchTab: "${name}" not found. Available: ${result.available?.join(', ') || 'none'}`);
await waitForStable();
await waitForStable();
return returnFormState();
}
// English → Russian metadata type mapping for e1cib navigation links
@@ -206,9 +206,7 @@ export async function openFile(filePath) {
}
}
// It's the real EPF form
// It's the real EPF form
const state = await getFormState();
state.opened = { file: absPath, attempt: attempt + 1 };
return returnFormState({ opened: { file: absPath, attempt: attempt + 1 } });
}
// Form didn't appear — retry
continue;