mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-15 15:25:16 +03:00
refactor(web-test): этап E.13 — финализация (v1.17 + чистый facade + чистка)
1. Версия v1.16 → v1.17 во всех заголовках движка.
2. browser.mjs стал чистым facade — только re-exports, 0 функций определено.
Было: 249 LOC с 4 настоящими функциями (saveClipboard, restoreClipboard,
pasteText, getFormState) — теперь 57 LOC чистых re-export'ов.
3. engine/core/clipboard.mjs — новый модуль:
pasteText + saveClipboard + restoreClipboard (~85 LOC, был в browser.mjs).
4. engine/core/form-state.mjs — новый модуль:
getFormState — центральный читатель состояния формы (~30 LOC).
5. Убрано 12 циклических импортов из engine/* → ../../browser.mjs:
- Все читатели pasteText теперь импортят из engine/core/clipboard.mjs
- Все читатели getFormState — из engine/core/form-state.mjs
- session.mjs → nav/navigation.mjs (getPageState напрямую)
- filter.mjs → core/click.mjs (clickElement напрямую)
Граф зависимостей стал деревом (без обратных рёбер).
6. Убраны _-префиксы у 9 функций, которые стали приватными внутри своих
модулей (раньше _ означало "приватная для browser.mjs"):
_detectPlatformDialogs → detectPlatformDialogs
_closePlatformDialogs → closePlatformDialogs
_parseErrorStack → parseErrorStack
_fetchStackViaReport → fetchStackViaReport
_fetchStackViaHamburger → fetchStackViaHamburger
_logoutSlot → logoutSlot
_saveActiveSlot → saveActiveSlot
_activateSlot → activateSlot
_attachSessionListeners → attachSessionListeners
Публичный API: 56 экспортов, идентичный исходному.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// web-test table/filter v1.16 — filterList / unfilterList — simple search + advanced-column filter badges.
|
||||
// web-test table/filter v1.17 — filterList / unfilterList — simple search + advanced-column filter badges.
|
||||
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import { page, ensureConnected, normYo, highlightMode, ACTION_WAIT } from '../core/state.mjs';
|
||||
@@ -8,8 +8,9 @@ import { waitForStable, waitForCondition } from '../core/wait.mjs';
|
||||
import { highlight, unhighlight } from '../recording/highlight.mjs';
|
||||
import { safeClick } from '../core/helpers.mjs';
|
||||
import { selectValue, fillReferenceField } from '../forms/select-value.mjs';
|
||||
// pasteText + getFormState + clickElement still in browser.mjs.
|
||||
import { pasteText, getFormState, clickElement } from '../../browser.mjs';
|
||||
import { pasteText } from '../core/clipboard.mjs';
|
||||
import { getFormState } from '../core/form-state.mjs';
|
||||
import { clickElement } from '../core/click.mjs';
|
||||
|
||||
/**
|
||||
* Filter the current list by field value, or search via search bar.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// web-test table/grid-toggle v1.16 — shared icon-detection for grid expand/
|
||||
// web-test table/grid-toggle v1.17 — shared icon-detection for grid expand/
|
||||
// collapse toggles. Used by clickElement's gridGroup/gridParent and
|
||||
// gridTreeNode branches; the actual mouse click stays in the caller because
|
||||
// it depends on the caller-local modifier-key handling.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// web-test table/grid v1.16 — Form-grid operations: read table rows, fill rows, delete rows.
|
||||
// web-test table/grid v1.17 — Form-grid operations: read table rows, fill rows, delete rows.
|
||||
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
//
|
||||
// "Grid" в терминах 1С — таблица на форме (.gridLine/.gridBody/.grid в DOM):
|
||||
@@ -11,7 +11,7 @@ import { dismissPendingErrors } from '../core/errors.mjs';
|
||||
import { waitForStable } from '../core/wait.mjs';
|
||||
import { clickElement } from '../core/click.mjs';
|
||||
// getFormState lives in browser.mjs.
|
||||
import { getFormState } from '../../browser.mjs';
|
||||
import { getFormState } from '../core/form-state.mjs';
|
||||
|
||||
/** Read structured table data with pagination. Returns columns, rows, total count. */
|
||||
export async function readTable({ maxRows = 20, offset = 0, table } = {}) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// web-test table/row-fill v1.16 — fillTableRow — заполнение строки табличной части/списка через Tab-навигацию и попутный выбор значений.
|
||||
// web-test table/row-fill v1.17 — fillTableRow — заполнение строки табличной части/списка через Tab-навигацию и попутный выбор значений.
|
||||
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import {
|
||||
@@ -20,7 +20,8 @@ import {
|
||||
fillReferenceField, selectValue,
|
||||
} from '../forms/select-value.mjs';
|
||||
// pasteText + getFormState still in browser.mjs (cycle).
|
||||
import { pasteText, getFormState } from '../../browser.mjs';
|
||||
import { pasteText } from '../core/clipboard.mjs';
|
||||
import { getFormState } from '../core/form-state.mjs';
|
||||
|
||||
/**
|
||||
* Fill cells in the current table row via Tab navigation.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// web-test table/spreadsheet v1.16 — readTable, readSpreadsheet, scanSpreadsheetCells, scroll/click helpers for SpreadsheetDocument.
|
||||
// web-test table/spreadsheet v1.17 — readTable, readSpreadsheet, scanSpreadsheetCells, scroll/click helpers for SpreadsheetDocument.
|
||||
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import { page, ensureConnected, normYo } from '../core/state.mjs';
|
||||
import { detectFormScript, readTableScript, resolveGridScript } from '../../dom.mjs';
|
||||
import { waitForStable } from '../core/wait.mjs';
|
||||
// getFormState still in browser.mjs (cycle resolves at call time).
|
||||
import { getFormState } from '../../browser.mjs';
|
||||
import { getFormState } from '../core/form-state.mjs';
|
||||
|
||||
// readTable moved to table/grid.mjs (form-grid операции отделены от SpreadsheetDocument).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user