wenay-react2 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/EXAMPLE_USAGE.md +971 -0
- package/doc/PROJECT_FUNCTIONALITY.md +405 -0
- package/doc/PROJECT_RULES.md +80 -0
- package/doc/WENAY_REACT2_RENAMES.md +177 -0
- package/doc/changes/v1.0.35.md +26 -0
- package/doc/changes/v1.0.37.md +13 -0
- package/doc/changes/v1.0.38.md +48 -0
- package/doc/changes/v1.0.39.md +35 -0
- package/doc/changes/v1.0.40.md +15 -0
- package/doc/changes/v1.0.41.md +36 -0
- package/doc/changes/v1.0.42.md +26 -0
- package/doc/progress/README.md +14 -0
- package/doc/progress/architecture-fix-queue.md +74 -0
- package/doc/progress/hook-controller-opportunities.md +367 -0
- package/doc/progress/hook-extraction-audit.md +195 -0
- package/doc/progress/public-surface-normalization.md +368 -0
- package/doc/progress/style-system-normalization.md +121 -0
- package/doc/target/README.md +33 -0
- package/doc/target/my.md +81 -0
- package/doc/wenay-react2-1.0.8.tgz +0 -0
- package/doc/wenay-react2-rare.md +807 -0
- package/doc/wenay-react2.md +539 -0
- package/lib/common/api.d.ts +1 -0
- package/lib/common/api.js +8 -4
- package/lib/common/src/components/Dnd/DragArea.d.ts +5 -0
- package/lib/common/src/components/Dnd/DragArea.js +5 -1
- package/lib/common/src/components/Dnd/FloatingWindow.d.ts +9 -5
- package/lib/common/src/components/Dnd/FloatingWindow.js +39 -97
- package/lib/common/src/components/Dnd/Resizable.d.ts +3 -7
- package/lib/common/src/components/Dnd/Resizable.js +4 -3
- package/lib/common/src/components/Menu/RightMenu.js +8 -4
- package/lib/common/src/components/Menu/RightMenuStore.d.ts +2 -2
- package/lib/common/src/components/Menu/RightMenuStore.js +5 -3
- package/lib/common/src/components/Modal/LeftModal.js +4 -2
- package/lib/common/src/components/Modal/ModalContextProvider.js +5 -16
- package/lib/common/src/components/MyResizeObserver.d.ts +24 -0
- package/lib/common/src/components/MyResizeObserver.js +49 -0
- package/lib/common/src/components/Overlay.d.ts +24 -0
- package/lib/common/src/components/Overlay.js +28 -0
- package/lib/common/src/components/Settings/SettingsDialog.js +21 -22
- package/lib/common/src/components/Toolbar/Toolbar.d.ts +1 -0
- package/lib/common/src/components/Toolbar/Toolbar.js +16 -23
- package/lib/common/src/grid/columnState/ColumnsMenu.js +4 -13
- package/lib/common/src/grid/columnState/columnGrid.d.ts +103 -0
- package/lib/common/src/grid/columnState/columnGrid.js +231 -0
- package/lib/common/src/grid/columnState/columnState.js +10 -9
- package/lib/common/src/grid/columnState/index.js +3 -0
- package/lib/common/src/hooks/useDraggable.d.ts +8 -0
- package/lib/common/src/hooks/useDraggable.js +13 -4
- package/lib/common/src/hooks/useOutside.d.ts +4 -1
- package/lib/common/src/hooks/useOutside.js +2 -1
- package/lib/common/src/logs/logs.d.ts +123 -5
- package/lib/common/src/logs/logs.js +218 -130
- package/lib/common/src/logs/logsController.d.ts +3 -0
- package/lib/common/src/styles/tokens.d.ts +7 -6
- package/lib/common/src/styles/tokens.js +8 -5
- package/lib/common/src/utils/cache.d.ts +12 -0
- package/lib/common/src/utils/cache.js +0 -0
- package/lib/common/src/utils/fixedOrder.d.ts +15 -0
- package/lib/common/src/utils/fixedOrder.js +30 -0
- package/lib/common/src/utils/index.d.ts +2 -0
- package/lib/common/src/utils/index.js +2 -0
- package/lib/common/src/utils/memoryStore.d.ts +3 -6
- package/lib/common/src/utils/memoryStore.js +1 -3
- package/lib/common/src/utils/persistedMaps.d.ts +16 -0
- package/lib/common/src/utils/persistedMaps.js +5 -0
- package/lib/common/src/utils/searchHistory.js +7 -6
- package/lib/common/src/utils/structEqual.d.ts +12 -0
- package/lib/common/src/utils/structEqual.js +40 -0
- package/lib/common/updateBy.d.ts +3 -0
- package/lib/common/updateBy.js +57 -22
- package/lib/style/menuRight.css +29 -23
- package/lib/style/style.css +73 -10
- package/lib/style/tokens.css +8 -4
- package/package.json +3 -2
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
# Public surface normalization
|
|
2
|
+
|
|
3
|
+
Задача из target: пройти второй слой публичной поверхности `wenay-react2` и внедрять только те primitives, которые реально заменяют ручной код.
|
|
4
|
+
|
|
5
|
+
## Status
|
|
6
|
+
|
|
7
|
+
In progress.
|
|
8
|
+
|
|
9
|
+
## Usage/example sources
|
|
10
|
+
|
|
11
|
+
Обновляем вместе с кодом, если меняется canonical usage:
|
|
12
|
+
- `doc/EXAMPLE_USAGE.md` — главный standards/example файл;
|
|
13
|
+
- `src/common/testUseReact/qa.tsx` — QA cards как живые примеры использования, особенно cards 20-31;
|
|
14
|
+
- `src/common/testUseReact/replayVideo.tsx` — Replay usage examples для cards 23-26;
|
|
15
|
+
- `src/common/src/grid/agGrid4/example.tsx`, `README.md`, `WRAPPER.md`, `MIGRATION.md` — grid wrapper examples/docs.
|
|
16
|
+
|
|
17
|
+
Legacy/compat examples (`src/common/testUseReact/use.tsx`, `useGrid.tsx`, отдельные старые cards) не переписывать автоматически; если они показывают low-level path, помечать как regression/compat, а не canonical pattern.
|
|
18
|
+
|
|
19
|
+
Правило прохода: для каждого изменения проверять, есть ли affected card/example. Если публичный API не менялся и пример уже показывает правильный usage, фиксировать "пример проверен, менять не нужно".
|
|
20
|
+
|
|
21
|
+
## Task scoring
|
|
22
|
+
|
|
23
|
+
Перед выполнением следующего кандидата ставим оценку:
|
|
24
|
+
- эффективность: high / medium / low;
|
|
25
|
+
- простота: simple / medium / hard;
|
|
26
|
+
- риск: low / medium / high.
|
|
27
|
+
|
|
28
|
+
Делаем сразу только high/medium эффективность при simple/medium сложности и понятном риске. Low-effectiveness или hard/high-risk без явного выигрыша — пропускать и записывать причину.
|
|
29
|
+
|
|
30
|
+
## Pass 1 — low-risk controller reuse
|
|
31
|
+
|
|
32
|
+
### `createUpdateApi` / `useUpdateByApi`
|
|
33
|
+
|
|
34
|
+
Проверено:
|
|
35
|
+
- `src/common/src/hooks/useKeyboard.ts` содержит простой mutable singleton `keyboardState` и прямые вызовы `renderBy(keyboardState)`.
|
|
36
|
+
|
|
37
|
+
Сделано:
|
|
38
|
+
- `useKeyboard.ts` переведён на `createUpdateApi(keyboardState)` для локального render-controller.
|
|
39
|
+
- Публичный API `keyboard`, `keyboardState`, `useKeyboard`, `keyboard.on/subscribe` не менялся.
|
|
40
|
+
|
|
41
|
+
Почему это не высосано из пальца:
|
|
42
|
+
- это ровно contract `createUpdateApi`: mutable object + render/subscribe controller;
|
|
43
|
+
- изменение маленькое и не тянет UI-поведение.
|
|
44
|
+
|
|
45
|
+
Ограничение:
|
|
46
|
+
- широкая замена `updateBy/renderBy` в `Toolbar`, `SettingsDialog`, `columnState` пока не делалась. Там controller может быть полезен, но риск выше, потому что эти объекты имеют persistence, registry или grid side effects.
|
|
47
|
+
|
|
48
|
+
## Pass 1 — tasks intentionally not implemented yet
|
|
49
|
+
|
|
50
|
+
### `ArrayPromise`
|
|
51
|
+
|
|
52
|
+
Статус: пока не внедрять.
|
|
53
|
+
|
|
54
|
+
Причина:
|
|
55
|
+
- в текущей библиотеке нет потребителя, где явно нужен именно последовательный набор promise-thunks с progress counters;
|
|
56
|
+
- для параллельных batch operations counters у `ArrayPromise` не являются стабильным контрактом;
|
|
57
|
+
- внедрение без конкретной batch-команды будет искусственным.
|
|
58
|
+
|
|
59
|
+
Что считать подходящим местом позже:
|
|
60
|
+
- реальные последовательные операции: массовое закрытие позиций, очистка лимиток, transfer step-by-step;
|
|
61
|
+
- если операции параллельные, нужен другой progress contract, не `ArrayPromise` counters.
|
|
62
|
+
|
|
63
|
+
### `DragBox` / `DragArea`
|
|
64
|
+
|
|
65
|
+
Статус: не использовать в новом коде как high-level стандарт.
|
|
66
|
+
|
|
67
|
+
Причина:
|
|
68
|
+
- это low-level/legacy movement components;
|
|
69
|
+
- для нового кода уже есть hook-first путь `useDraggableApi`, а для окон — `FloatingWindow`.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Pass 2 — grid helpers without grid lifecycle change
|
|
73
|
+
|
|
74
|
+
### Log tables default column definition
|
|
75
|
+
|
|
76
|
+
Проверено:
|
|
77
|
+
- `src/common/src/logs/miniLogs.tsx` и `src/common/src/logs/logs.tsx` дублировали один и тот же `defaultColDef`: `headerClass`, `resizable`, centered `cellStyle`, `sortable`, `filter`, `wrapText`.
|
|
78
|
+
|
|
79
|
+
Сделано:
|
|
80
|
+
- оба места переведены на общий `colDefCentered` + локальный `wrapText: true`.
|
|
81
|
+
- `AgGridReact` намеренно оставлен на месте: перевод на `AgGridTable` может изменить тему, row selection и lifecycle, поэтому это отдельная задача после визуальной проверки.
|
|
82
|
+
|
|
83
|
+
Почему это не высосано из пальца:
|
|
84
|
+
- helper `colDefCentered` уже существует именно для такого dense table default;
|
|
85
|
+
- замена убирает ручное дублирование, но не трогает grid lifecycle.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## Pass 3 — compatibility modal store controller
|
|
89
|
+
|
|
90
|
+
### `createModalElementStore` / `createModalRenderStore`
|
|
91
|
+
|
|
92
|
+
Проверено:
|
|
93
|
+
- `src/common/src/components/Modal/Modal.tsx` содержит общий `createJsxStore`, где mutable object `data` одновременно используется как render subscription target.
|
|
94
|
+
|
|
95
|
+
Сделано:
|
|
96
|
+
- прямые `renderBy(data)` / `updateBy(data)` заменены на `createUpdateApi(data)` (`dataApi.render()` / `dataApi.use()`).
|
|
97
|
+
- публичные compatibility APIs `createModalElementStore()` и `createModalRenderStore()` не менялись.
|
|
98
|
+
|
|
99
|
+
Почему это не высосано из пальца:
|
|
100
|
+
- store уже был построен на mutable object + render subscription;
|
|
101
|
+
- `createUpdateApi` делает этот контракт явным без изменения поведения.
|
|
102
|
+
## Pass 4 — persisted slot controller
|
|
103
|
+
|
|
104
|
+
### `createUiSlot`
|
|
105
|
+
|
|
106
|
+
Проверено:
|
|
107
|
+
- `src/common/src/components/UiSlot/UiSlot.tsx` содержит persisted mutable store `st` из `memoryGetOrCreate` и прямые `renderBy(st)` / `updateBy(st)`.
|
|
108
|
+
|
|
109
|
+
Сделано:
|
|
110
|
+
- `createUiSlot` переведён на `createUpdateApi(st)` (`stApi.render()` / `stApi.use()`).
|
|
111
|
+
- публичный API `Slot`, `PlacementSetting`, `getPlace`, `setPlace` не менялся.
|
|
112
|
+
- usage example проверен: card 21 (createUiSlot - configurable block placement) уже использует публичный API; менять card не нужно, потому что refactor внутренний.
|
|
113
|
+
|
|
114
|
+
Почему это не высосано из пальца:
|
|
115
|
+
- это тот же contract, что в `useKeyboard` и compatibility modal store: mutable object + render subscription;
|
|
116
|
+
- persistence через `memoryMarkDirty` оставлен без изменений.
|
|
117
|
+
|
|
118
|
+
## Pass 5 — toolbar density registry controller
|
|
119
|
+
|
|
120
|
+
### `registerToolbarDensity` / toolbar density consumers
|
|
121
|
+
|
|
122
|
+
Оценка перед выполнением:
|
|
123
|
+
- эффективность: medium;
|
|
124
|
+
- простота: simple;
|
|
125
|
+
- риск: low.
|
|
126
|
+
|
|
127
|
+
Проверено:
|
|
128
|
+
- `src/common/src/components/Toolbar/Toolbar.tsx` содержит module-level mutable registry `densities` и прямые `renderBy(densities)` / `updateBy(densities)`.
|
|
129
|
+
- card 25 использует `registerToolbarDensity` как usage example.
|
|
130
|
+
|
|
131
|
+
Сделано:
|
|
132
|
+
- только registry `densities` переведён на `createUpdateApi(densities)` (`densitiesApi.render()` / `densitiesApi.use()`).
|
|
133
|
+
- persisted toolbar config `st`, `sourceMode`, external `listSource`, `memoryMarkDirty` не трогались.
|
|
134
|
+
- usage example проверен: card 25 (`createToolbar - customizable toolbar`) уже использует публичный `registerToolbarDensity`; менять card не нужно, потому что refactor внутренний.
|
|
135
|
+
|
|
136
|
+
Почему это не высосано из пальца:
|
|
137
|
+
- `densities` ровно module singleton + subscription target;
|
|
138
|
+
- изменение уменьшает прямой `renderBy/updateBy` там, где нет persistence/grid side effects.
|
|
139
|
+
|
|
140
|
+
## Pass 6 — settings section registry controller
|
|
141
|
+
|
|
142
|
+
### `registerSettingsSection` / `SettingsDialog`
|
|
143
|
+
|
|
144
|
+
Оценка перед выполнением:
|
|
145
|
+
- эффективность: medium;
|
|
146
|
+
- простота: medium;
|
|
147
|
+
- риск: medium.
|
|
148
|
+
|
|
149
|
+
Проверено:
|
|
150
|
+
- `src/common/src/components/Settings/SettingsDialog.tsx` содержит module-level mutable registry `registry` и прямые `renderBy(registry)` / `updateBy(registry)`.
|
|
151
|
+
- card 20 использует `registerSettingsSection` как usage example.
|
|
152
|
+
|
|
153
|
+
Сделано:
|
|
154
|
+
- только section registry переведён на `createUpdateApi(registry)` (`registryApi.render()` / `registryApi.use()`).
|
|
155
|
+
- search history, tree UX, resize behavior и `settingsDialogLayout` не менялись.
|
|
156
|
+
- usage example проверен: card 20 (`SettingsDialog - searchable settings tree + registry`) уже использует публичный `registerSettingsSection`; менять card не нужно, потому что refactor внутренний.
|
|
157
|
+
|
|
158
|
+
Low-effectiveness skip:
|
|
159
|
+
- `settingsDialogLayout` пока не переводился: сейчас нет явного `updateBy(settingsDialogLayout)` consumer, а nav width живёт в React state и сохраняется через `memoryMarkDirty`. Отдельный controller здесь мало что даст без изменения layout contract.
|
|
160
|
+
|
|
161
|
+
## Pass 7 — columnState controller split
|
|
162
|
+
|
|
163
|
+
### `createColumnState` runtime `rt` and persisted `st`
|
|
164
|
+
|
|
165
|
+
Оценка перед выполнением:
|
|
166
|
+
- `rt` present/presentGate: эффективность medium, простота simple, риск low-medium;
|
|
167
|
+
- `st` persisted config: эффективность medium, простота medium, риск medium.
|
|
168
|
+
|
|
169
|
+
Проверено:
|
|
170
|
+
- `src/common/src/grid/columnState/columnState.ts` содержит runtime store `rt` для `present` / `presentGate` и persisted store `st` для column config.
|
|
171
|
+
- cards 29/30 используют `usePresent` / `setPresentGate`; cards 28-31 используют persisted config через `useConfig`, grid adapter, menu, toolbar source.
|
|
172
|
+
|
|
173
|
+
Сделано:
|
|
174
|
+
- `rt` переведён на `createUpdateApi(rt)` (`rtApi.render()` / `rtApi.use()`).
|
|
175
|
+
- `st` переведён на `createUpdateApi(st)` (`stApi.render()` / `stApi.use()`).
|
|
176
|
+
- `commit`, `memoryMarkDirty`, `applyToGrid`, `emitChange`, `listSource` и grid adapter flow не менялись.
|
|
177
|
+
- usage examples проверены: cards 28-31 уже используют публичный `createColumnState` API; менять cards не нужно, потому что refactor внутренний.
|
|
178
|
+
|
|
179
|
+
## Pass 8 — search history controller
|
|
180
|
+
|
|
181
|
+
### `createSearchHistory`
|
|
182
|
+
|
|
183
|
+
Оценка перед выполнением:
|
|
184
|
+
- эффективность: high;
|
|
185
|
+
- простота: simple;
|
|
186
|
+
- риск: low.
|
|
187
|
+
|
|
188
|
+
Проверено:
|
|
189
|
+
- `src/common/src/utils/searchHistory.ts` содержит persisted mutable store `st` и прямые `renderBy(st)` / `updateBy(st)`.
|
|
190
|
+
- `SettingsDialog` и card 20 используют этот primitive для истории поиска.
|
|
191
|
+
|
|
192
|
+
Сделано:
|
|
193
|
+
- `createSearchHistory` переведён на `createUpdateApi(st)` (`stApi.render()` / `stApi.use()`).
|
|
194
|
+
- публичный API `items`, `use`, `add`, `remove`, `clear` не менялся.
|
|
195
|
+
- usage docs уже рекомендуют `createSearchHistory({key})`; менять пример не нужно.
|
|
196
|
+
|
|
197
|
+
## Pass 9 — toolbar persisted config controller
|
|
198
|
+
|
|
199
|
+
### `createToolbar` local `st`
|
|
200
|
+
|
|
201
|
+
Оценка перед выполнением:
|
|
202
|
+
- эффективность: medium;
|
|
203
|
+
- простота: medium;
|
|
204
|
+
- риск: medium.
|
|
205
|
+
|
|
206
|
+
Проверено:
|
|
207
|
+
- `src/common/src/components/Toolbar/Toolbar.tsx` после density-registry pass всё ещё содержал persisted config store `st` с прямыми `renderBy(st)` / `updateBy(st)`.
|
|
208
|
+
- cards 25, 30, 31 используют `createToolbar` local/external source flows.
|
|
209
|
+
|
|
210
|
+
Сделано:
|
|
211
|
+
- local toolbar store `st` переведён на `createUpdateApi(st)` (`stApi.render()` / `stApi.use()`).
|
|
212
|
+
- external source hook `ext?.useConfig()`, `sourceMode`, `memoryMarkDirty`, `emitChange` не менялись.
|
|
213
|
+
- usage examples проверены: cards 25/30/31 уже используют публичный API; менять cards не нужно, потому что refactor внутренний.
|
|
214
|
+
|
|
215
|
+
## Pass 10 — window/menu controller normalization
|
|
216
|
+
|
|
217
|
+
### `FloatingWindow` open-window registry
|
|
218
|
+
|
|
219
|
+
Оценка перед выполнением:
|
|
220
|
+
- эффективность: medium;
|
|
221
|
+
- простота: medium;
|
|
222
|
+
- риск: medium.
|
|
223
|
+
|
|
224
|
+
Проверено:
|
|
225
|
+
- `src/common/src/components/Dnd/FloatingWindow.tsx` содержит module-level `openWindows` registry для z-index order и прямые `renderBy(openWindows)` / `updateBy(openWindows, cb)`.
|
|
226
|
+
- card 2 и Settings/Dialog flows используют `FloatingWindow` как usage examples.
|
|
227
|
+
|
|
228
|
+
Сделано:
|
|
229
|
+
- `openWindows` переведён на `createUpdateApi(openWindows)` (`openWindowsApi.render()` / `openWindowsApi.use(cb)`).
|
|
230
|
+
- drag/resize geometry, document listeners, `floatingWindowMap` persistence и `DragBox` не менялись.
|
|
231
|
+
|
|
232
|
+
### `LeftModal` menu store
|
|
233
|
+
|
|
234
|
+
Оценка перед выполнением:
|
|
235
|
+
- эффективность: medium;
|
|
236
|
+
- простота: simple;
|
|
237
|
+
- риск: medium.
|
|
238
|
+
|
|
239
|
+
Проверено:
|
|
240
|
+
- `src/common/src/components/Modal/LeftModal.tsx` содержит local `menuStore` Map внутри `getApiLeftMenu()` и прямые `renderBy(menuStore)` / `updateBy(menuStore)`.
|
|
241
|
+
|
|
242
|
+
Сделано:
|
|
243
|
+
- `menuStore` переведён на `createUpdateApi(menuStore)` (`menuStoreApi.render()` / `menuStoreApi.use()`).
|
|
244
|
+
- compatibility method `ApiLeftMenu.renderBy()` оставлен, но внутри вызывает `menuStoreApi.render()`.
|
|
245
|
+
- `createModalElementStore()` path уже был переведён раньше; меню/модалка публично не менялись.
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
## Pass 11 — log tables wrapper transition
|
|
249
|
+
|
|
250
|
+
### `PageLogs` / `MiniLogs`
|
|
251
|
+
|
|
252
|
+
Оценка перед выполнением:
|
|
253
|
+
- эффективность: medium/high;
|
|
254
|
+
- простота: medium;
|
|
255
|
+
- риск: medium, потому что внешний вид/theme/resize могут измениться, но QA stand это покрывает вручную.
|
|
256
|
+
|
|
257
|
+
Проверено:
|
|
258
|
+
- `src/common/src/logs/logs.tsx` и `src/common/src/logs/miniLogs.tsx` после defaultColDef pass всё ещё использовали raw `AgGridReact`.
|
|
259
|
+
- card 9 (`Logs - time format`) использует `logsApi.React.PageLogs` и подходит для ручной проверки основного log table path.
|
|
260
|
+
|
|
261
|
+
Сделано:
|
|
262
|
+
- `PageLogs` и `MiniLogs` переведены на `AgGridTable`.
|
|
263
|
+
- logger state/timing, `logsApi`, `MessageEventLogs`, `contextMenu` copy action, filter update path и row transaction path не менялись.
|
|
264
|
+
- `logsContext.tsx` намеренно не трогался: это отдельный older/context logger implementation with localStorage + raw grid.
|
|
265
|
+
|
|
266
|
+
Ручная проверка:
|
|
267
|
+
- card 9: нажать `add log`, время форматируется как `HH:mm:ss`, строка появляется в таблице, правый клик по ячейке даёт copy menu.
|
|
268
|
+
- если `MiniLogs` есть в app/stand consumer, проверить: таблица растягивается по контейнеру, click callback на ячейке вызывается.
|
|
269
|
+
|
|
270
|
+
## Pass 12 — MiniLogs hook/controller layering
|
|
271
|
+
|
|
272
|
+
### `useMiniLogsTable` / `MiniLogsView` / `MiniLogsTable`
|
|
273
|
+
|
|
274
|
+
Оценка перед выполнением:
|
|
275
|
+
- эффективность: medium/high;
|
|
276
|
+
- простота: medium;
|
|
277
|
+
- риск: medium.
|
|
278
|
+
|
|
279
|
+
Проверено:
|
|
280
|
+
- прямых runtime-использований `MiniLogs` в repo не найдено, но public barrel уже экспортирует `miniLogs.tsx` через `src/common/api.tsx`;
|
|
281
|
+
- card 9 покрывал `PageLogs`, но не `MiniLogs`, поэтому QA example требовал обновления;
|
|
282
|
+
- row identity нельзя менять на `AgGridTable data={...}` / default `id`, потому логовый `id` может повторяться по source area.
|
|
283
|
+
|
|
284
|
+
Сделано:
|
|
285
|
+
- `MiniLogs` разделён на hook/controller `useMiniLogsTable`, pure visual `MiniLogsView`, convenience `MiniLogsTable` и compatibility wrapper `MiniLogs`;
|
|
286
|
+
- hook отдаёт `props/tableProps/gridProps`, `apiRef`, `fit`, `getApi`, `withApi` и callbacks, но не создаёт внутренний `useAgGrid` controller;
|
|
287
|
+
- сохранён `rowData` path и старый `CellMouseDownEvent<T>` click contract;
|
|
288
|
+
- QA card 9 получил прямой `MiniLogsTable` block;
|
|
289
|
+
- docs обновлены в `doc/EXAMPLE_USAGE.md`, `doc/wenay-react2.md`, `doc/wenay-react2-rare.md`;
|
|
290
|
+
- добавлен `__test/miniLogs.test.tsx` на hook props/click/grid helpers.
|
|
291
|
+
|
|
292
|
+
Почему store не добавлен:
|
|
293
|
+
- MiniLogs сейчас table-view над внешним `data`; нет реального consumer для append/limit/history store;
|
|
294
|
+
- MiniLogs-owned state лучше добавлять позже только вместе с `createLogsController` или конкретным app consumer.
|
|
295
|
+
|
|
296
|
+
## Next candidates
|
|
297
|
+
|
|
298
|
+
1. `logs.tsx` logger internals — эффективность medium, простота hard, риск medium-high. Там несколько stores, callback-subscriptions, notification timing и table rendering; не делать как small pass без отдельного logger plan.
|
|
299
|
+
2. `logsContext.tsx` — эффективность medium, простота hard, риск medium-high. Есть прямой `localStorage` и голый `AgGridReact`, но split нужен отдельно: persistence contract + grid lifecycle/visual check.
|
|
300
|
+
3. `memoryStore.tsx` direct `renderBy(cur)` — эффективность low/medium, простота medium, риск medium. Подробно:
|
|
301
|
+
- прямой вызов есть только в `memoryUpdate(key, mutate)`: он ререндерит подписчиков именно на объект `cur`, который лежит внутри `memoryProps`;
|
|
302
|
+
- `memoryProps` сам является `ObservableMap` и уже наблюдается `memoryCache`, поэтому `memorySet`, `memoryGetOrCreate`, `memoryMarkDirty` идут по map/cache dirty channel, а не по React-subscription API;
|
|
303
|
+
- перевод `memoryUpdate` на `createUpdateApi(cur)` технически возможен, но почти ничего не меняет для публичного contract, потому что API создаётся на лету для произвольного stored object;
|
|
304
|
+
- риск в том, что это core persistence helper: им пользуются toolbar/columnState/UiSlot/search history/settings/window/right menu flows, и ошибка ударит не по одному widget, а по всему сохранению UI-конфига;
|
|
305
|
+
- делать стоит только если появится конкретный consumer/test на `memoryUpdate` или если мы явно вводим стандарт “memory object update controller” и покрываем это тестом: subscribe to stored object -> `memoryUpdate` -> rerender + `memoryCache.onDirty`.
|
|
306
|
+
4. `SettingsDialog.layout` controller — эффективность low, простота simple, риск low. Сейчас нет `updateBy(settingsDialogLayout)` consumer, поэтому пропущено как малоэффективное.
|
|
307
|
+
5. `PageVisibilityProvider` candidates — эффективность low до появления реального polling/replay/canvas consumer. Сейчас не внедрять в обычный UI ради helper.
|
|
308
|
+
6. Store/listen hooks — эффективность low внутри shared library без настоящего `Observe.Store` / `listen` consumer. Больше смысла искать в QA/app examples.
|
|
309
|
+
|
|
310
|
+
## Verification
|
|
311
|
+
|
|
312
|
+
- `npx tsc -p tsconfig.qa-check.json --noEmit` — passed after Pass 12.
|
|
313
|
+
- `npm run testjest -- --runInBand miniLogs.test.tsx` — passed after Pass 12: 1 suite, 2 tests.
|
|
314
|
+
- `npm run testjest -- --runInBand` — passed after Pass 12: 10 suites, 27 tests.
|
|
315
|
+
- `npm run build` — passed after Pass 12.
|
|
316
|
+
- `git diff --check` — passed after Pass 12; only LF/CRLF normalization warnings.
|
|
317
|
+
|
|
318
|
+
## Pass 13 — final inventory of remaining primitive-reuse candidates
|
|
319
|
+
|
|
320
|
+
Дата: 2026-07-09.
|
|
321
|
+
|
|
322
|
+
Цель: после hook/controller-first очереди повторно проверить широкий пункт `Недоиспользуемые методы wenay-react2` и не делать задачи ради задач.
|
|
323
|
+
|
|
324
|
+
Проверено:
|
|
325
|
+
- raw `AgGridReact`: остался только внутри самого wrapper `agGrid4.tsx` и в `src/common/testUseReact/useGrid.tsx`;
|
|
326
|
+
- `src/common/testUseReact/useGrid.tsx` уже документирован в `doc/EXAMPLE_USAGE.md` / `doc/PROJECT_FUNCTIONALITY.md` как legacy/regression example для низкоуровневого `applyGridRows`, а не canonical grid pattern;
|
|
327
|
+
- `logsContext.tsx` всё ещё имеет прямой `localStorage`, но это публичное legacy/compat поведение provider-а; перевод на `memoryCache` изменит contract, потому что app должен будет сам вызывать `memoryCache.load/save`;
|
|
328
|
+
- `PageVisibilityProvider` candidates есть только в тяжёлых timer/canvas/replay/chart местах (`useReplay`, chart engines, QA replay demos), где нужно отдельное policy-решение: продолжать catch-up в hidden tab или паузить;
|
|
329
|
+
- ручные `listen.on` / `useEffect` в QA в основном демонстрируют compatibility APIs или сами hook implementations; единственный useful cleanup — card 25 toolbar `tb.api.onChange` — безопасно переведён на `useListenEffect`;
|
|
330
|
+
- Settings/Toolbar registries уже показаны активными QA cards 20/25/30/31; новых low-risk registry migrations без app consumer не найдено;
|
|
331
|
+
- ModalProvider/useModal уже есть active QA card 13; imperative modal stores оставлены documented compatibility path.
|
|
332
|
+
|
|
333
|
+
Решение:
|
|
334
|
+
- `qa.tsx` card 25: `tb.api.onChange.on(...)` заменён на `useListenEffect(tb.api.onChange, ...)`;
|
|
335
|
+
- `useGrid.tsx` не переводить на `AgGridTable`, пока он нужен как regression для `applyGridRows`;
|
|
336
|
+
- `logsContext` storage не менять без отдельной задачи “context logger persistence contract”;
|
|
337
|
+
- PageVisibility/replay/chart timers не менять без явного UX-policy;
|
|
338
|
+
- broad primitive-reuse target считать выполненным на текущем repository surface: оставшиеся пункты low-effectiveness или high-risk без нового consumer/test.
|
|
339
|
+
|
|
340
|
+
## Verification update
|
|
341
|
+
|
|
342
|
+
- `npx tsc -p tsconfig.qa-check.json --noEmit` — passed after FloatingWindow / final inventory / QA listen cleanup.
|
|
343
|
+
- `npm run testjest -- --runInBand createToolbar.test.ts` — passed after QA listen cleanup.
|
|
344
|
+
- `npm run testjest -- --runInBand floatingWindowController.test.tsx settingsDialog.test.tsx` — passed: 2 suites, 6 tests.
|
|
345
|
+
- `npm run testjest -- --runInBand` — passed: 14 suites, 44 tests.
|
|
346
|
+
- `npm run build` — passed.
|
|
347
|
+
- `git diff --check` — passed; only LF/CRLF normalization warnings.
|
|
348
|
+
## Pass 14 — Toolbar.Bar movement animation
|
|
349
|
+
|
|
350
|
+
Дата: 2026-07-09.
|
|
351
|
+
|
|
352
|
+
Задача: пользователь подтвердил card 30 как эталон и попросил такую же анимацию горизонтального меню в cards 25 и 31.
|
|
353
|
+
|
|
354
|
+
Сделано:
|
|
355
|
+
- `createToolbar().Bar` получил общий FLIP-pass (`useToolbarFlip`): при изменении order/visibility/density элементы получают временный `translate(dx,dy)` и возвращаются через `transform 180ms ease`;
|
|
356
|
+
- card 25 and card 31 используют стандартный `Toolbar.Bar`, поэтому получили анимацию без копирования stand-only `Qa30AnimatedMenuBar`;
|
|
357
|
+
- card 30 оставлен эталоном и не переписывался;
|
|
358
|
+
- публичный API `createToolbar`, `ToolbarItem`, `ToolbarConfig` не менялся.
|
|
359
|
+
|
|
360
|
+
Проверка:
|
|
361
|
+
- `npx tsc -p tsconfig.qa-check.json --noEmit`;
|
|
362
|
+
- `npm run testjest -- --runInBand createToolbar.test.ts`;
|
|
363
|
+
- full test/build перед публикацией v1.0.40.
|
|
364
|
+
|
|
365
|
+
Оценка пользы:
|
|
366
|
+
- UI-польза: high для cards 25/31, потому order/density changes теперь визуально читаются так же, как в card 30;
|
|
367
|
+
- архитектурная польза: medium/high, потому поведение находится в shared `Toolbar.Bar`, а не в каждом stand/example отдельно;
|
|
368
|
+
- performance-польза: low/medium, это не ускорение вычислений, а FLIP-анимация с одним layout read pass на изменение меню.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Style system normalization
|
|
2
|
+
|
|
3
|
+
Status: done/released (v1.0.38, v1.0.39, v1.0.41); default inventory and column-state scoped token fixes implemented and shipped.
|
|
4
|
+
|
|
5
|
+
## Source
|
|
6
|
+
|
|
7
|
+
User clarification: compatibility can be an aggressive migration when it is
|
|
8
|
+
clearly recorded in changelog, but default styles are dangerous to remove.
|
|
9
|
+
If default styles disappear, the project can become visually broken even when
|
|
10
|
+
the TypeScript/API migration is understandable.
|
|
11
|
+
|
|
12
|
+
## Standard
|
|
13
|
+
|
|
14
|
+
- Shared primitives must keep a usable default visual style.
|
|
15
|
+
- A default style may be changed, but not silently removed.
|
|
16
|
+
- Removing/replacing a default class requires a replacement class/token path,
|
|
17
|
+
changelog entry, and migration note.
|
|
18
|
+
- New shared visual rules should use CSS custom properties first.
|
|
19
|
+
- Runtime geometry may stay inline when it is state-derived, but color, spacing,
|
|
20
|
+
border, shadow, font, and hover/active states should move to classes/tokens.
|
|
21
|
+
- Apps may override variables; primitives should not require apps to copy a full
|
|
22
|
+
CSS block to remain usable.
|
|
23
|
+
|
|
24
|
+
## Token direction
|
|
25
|
+
|
|
26
|
+
Current prefixes are a good start:
|
|
27
|
+
|
|
28
|
+
- `--color-*`
|
|
29
|
+
- `--menu-*`
|
|
30
|
+
- `--wnd-*`
|
|
31
|
+
- `--dlg-*`
|
|
32
|
+
- `--tb-*`
|
|
33
|
+
- `--logs-*`
|
|
34
|
+
- `--cols-menu-*` for compact `ColumnsMenu/MenuStrip` visuals.
|
|
35
|
+
- `--cols-dots-*` for `ColumnDots` visuals.
|
|
36
|
+
- `--cols-card-*` for `CardList` visuals.
|
|
37
|
+
|
|
38
|
+
Likely next prefixes:
|
|
39
|
+
|
|
40
|
+
- `--cols-*` remains a family prefix; concrete prefixes now use `--cols-menu-*`, `--cols-dots-*`, and `--cols-card-*`.
|
|
41
|
+
- `--input-*` for generic input/panel defaults if they stay public.
|
|
42
|
+
- `--param-*` for `ParamsEditor` if it remains a shared primitive.
|
|
43
|
+
|
|
44
|
+
## First audit candidates
|
|
45
|
+
|
|
46
|
+
- `src/style/style.css`: old button/menu classes, `FloatingWindow`, `SettingsDialog`, `Toolbar`, `ColumnDots/CardList`, and raw hover colors.
|
|
47
|
+
- `src/style/menuRight.css`: right-menu visual contract and default state styles.
|
|
48
|
+
- `src/common/src/grid/columnState/*`: finish deciding whether mobile/card
|
|
49
|
+
visuals need `--cols-*` tokens.
|
|
50
|
+
- `src/common/src/components/ParamsEditor.tsx`: move reusable editor visuals
|
|
51
|
+
out of component-owned inline styles if the API remains public.
|
|
52
|
+
- `src/common/src/components/Input.tsx`: decide whether old input panels are
|
|
53
|
+
compatibility-only or need a proper tokenized default.
|
|
54
|
+
|
|
55
|
+
## Acceptance
|
|
56
|
+
|
|
57
|
+
- Default visual contract documented per public primitive group.
|
|
58
|
+
- Token prefixes chosen before broad style rewrites.
|
|
59
|
+
- No removal of default classes without replacement and changelog.
|
|
60
|
+
- Scoped visual QA cards checked before and after style migration.
|
|
61
|
+
## 2026-07-09 default style contract inventory
|
|
62
|
+
|
|
63
|
+
Source of truth:
|
|
64
|
+
|
|
65
|
+
- CSS tokens: `src/style/tokens.css`.
|
|
66
|
+
- TS mirror for inline styles/theme builders: `src/common/src/styles/tokens.ts`.
|
|
67
|
+
- Shared runtime CSS: `src/style/style.css` and `src/style/menuRight.css`.
|
|
68
|
+
- Generated `dist/lib/style/*` is build output, not the edit target.
|
|
69
|
+
|
|
70
|
+
Public/default visual contracts:
|
|
71
|
+
|
|
72
|
+
- `Menu` / `MenuR` / mouse context menu: legacy `.MenuR`, `.toButton`, `.toButtonA` classes remain; colors/shadow/borders are already routed through `--menu-*` tokens. Keep the old class names as compatibility surface.
|
|
73
|
+
- `RightMenu`: default classes `.menu-container`, `.menu-button`, `.dropdown-content`, `.menu-item`, `.submenu`, `.draggable-div` live in `src/style/menuRight.css` and already consume `--menu-*` / `--menu-outline-color`.
|
|
74
|
+
- `FloatingWindow`: `.wenayWnd*` and `.wenayCloseBtn` live in `src/style/style.css`; defaults intentionally preserve the old transparent/striped window while allowing `--wnd-*` theme overrides.
|
|
75
|
+
- `SettingsDialog`: `.wenayDlg*` classes live in `src/style/style.css`; default look is dark and tokenized through `--dlg-*` plus selected `--wnd-*` bridge variables on `.wenayDlgWindow`.
|
|
76
|
+
- `Toolbar` / `createToolbar`: `.wenayTb*` classes live in `src/style/style.css`; defaults consume `--tb-*`; stand-specific skins should override through wrapper classes, not by changing shared defaults.
|
|
77
|
+
- `Logs`: `src/common/src/logs/logStyles.ts` maps inline logger chrome to `--logs-*`; this is an accepted transitional contract while old logger JSX stays inline-heavy.
|
|
78
|
+
- `ColumnDots` / `CardList`: `.wenayColDots*` and `.wenayCardList*` classes live in `src/style/style.css`; restored card-29 defaults are now tokenized through `--cols-dots-*` / `--cols-card-*` with the same fallback values.
|
|
79
|
+
- `ColumnsMenu` / `MenuStrip`: behavior is already headless/presentation split. Visual button/container/divider states now use `.wenayColsMenu*` classes and `--cols-menu-*` tokens with the exact previous GitHub-like defaults; runtime reorder transform stays inline.
|
|
80
|
+
- `ParamsEditor`: public and still mostly old class + inline style based (`toIndicatorMenuButton`, `miniEl`, `toButtonEasy`, `inputCan`). Do not token-migrate broadly until hook/API direction is decided; candidate prefix `--param-*`.
|
|
81
|
+
- `Input` modal helpers: public compatibility helpers over `FloatingWindow`, `.msTradeAlt`, `.msTradeActive`, `.inputCan`, inline panel spacing. Candidate prefix `--input-*`, but may remain compatibility-only if newer app surfaces replace them.
|
|
82
|
+
|
|
83
|
+
Done scoped fix:
|
|
84
|
+
|
|
85
|
+
- `ColumnsMenu/MenuStrip` visual button/container/divider styles moved to classes/tokens; runtime reorder transform/drag geometry remains inline.
|
|
86
|
+
|
|
87
|
+
Done scoped fixes:
|
|
88
|
+
|
|
89
|
+
- `ColumnsMenu/MenuStrip` visual button/container/divider styles moved to classes/tokens; runtime reorder transform/drag geometry remains inline.
|
|
90
|
+
- `ColumnDots/CardList` restored card-29 defaults moved to `--cols-dots-*` / `--cols-card-*` variables with unchanged fallback values.
|
|
91
|
+
|
|
92
|
+
Next scoped candidate:
|
|
93
|
+
|
|
94
|
+
- Leave `ParamsEditor` / `Input` broad visual migration until the hook-first/API direction is clearer; only do bug-level style fixes there.
|
|
95
|
+
## 2026-07-09 scoped fix - ColumnsMenu/MenuStrip tokens
|
|
96
|
+
|
|
97
|
+
Implemented the compact column menu style contract:
|
|
98
|
+
|
|
99
|
+
- Added `--cols-menu-*` defaults to `src/style/tokens.css` and the TS mirror in `src/common/src/styles/tokens.ts`.
|
|
100
|
+
- Added `.wenayColsMenu*` classes in `src/style/style.css` for container/list/button states, fixed/drag shadow, text abbreviation, marks, and divider.
|
|
101
|
+
- Updated `src/common/src/grid/columnState/ColumnsMenu.tsx` so visual state uses classes; only consumer `style` and `useReorder` runtime transform remain inline.
|
|
102
|
+
|
|
103
|
+
Verification: `npx tsc -p tsconfig.qa-check.json --noEmit`; `npm run testjest -- --runInBand`; `npm run build`; `git diff --check`.
|
|
104
|
+
## 2026-07-09 scoped fix - ColumnDots/CardList tokens
|
|
105
|
+
|
|
106
|
+
Implemented the mobile/card column-state style contract:
|
|
107
|
+
|
|
108
|
+
- Added `--cols-dots-*` and `--cols-card-*` defaults to `src/style/tokens.css` and the TS mirror in `src/common/src/styles/tokens.ts`.
|
|
109
|
+
- Rewrote `.wenayColDots*` and `.wenayCardList*` values in `src/style/style.css` to use variables with the exact previous fallbacks.
|
|
110
|
+
- Kept component code unchanged; `ColumnDots` runtime geometry (`left`, drag transform) remains inline in the component where it belongs.
|
|
111
|
+
|
|
112
|
+
Verification: `npx tsc -p tsconfig.qa-check.json --noEmit`; `npm run testjest -- --runInBand`; `npm run build`; `git diff --check`.
|
|
113
|
+
## 2026-07-09 — Menu default contrast restore
|
|
114
|
+
|
|
115
|
+
Сделано:
|
|
116
|
+
- `--menu-bg-color` возвращён к непрозрачному dark fallback `#0c0c0c`, `--menu-blur` по умолчанию `0px`;
|
|
117
|
+
- добавлены `--menu-item-active-*` и `--menu-item-pressed-*` tokens, старый `--menu-active-background` оставлен alias/fallback;
|
|
118
|
+
- `MenuR` / mouse context menu and `RightMenu` CSS получили hard fallbacks: default dark background, white text, hover white with dark text, pressed yellow-ish contrast state;
|
|
119
|
+
- причина: рабочие проекты могут ещё не переопределять новые CSS variables, поэтому дефолт не должен становиться glass/transparent.
|
|
120
|
+
|
|
121
|
+
Проверка: CSS-only visual contract; прогнать `tsc`/`build`, card 4 вручную открыть правой кнопкой.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Target Backlog Rules
|
|
2
|
+
|
|
3
|
+
`doc/target` is the durable task backlog for dictated or imported work. It is not a scratchpad and it is not a changelog.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `doc/target/my.md` is the user-owned inbox/queue for dictated tasks. Keep it clean and actionable.
|
|
8
|
+
- `target/*.md` are source prompt files imported into this repo. Treat them as task specs; do not edit or delete them just to mark progress unless the user asks for that exact cleanup.
|
|
9
|
+
- `doc/progress/*.md` are temporary working notes for an active task. They may be deleted when the task is finished, so they must never be the only place where queue status lives.
|
|
10
|
+
- `doc/changes/vX.Y.Z.md` records durable completed changes when code, public docs, theme contracts, dependencies, or policy changed.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. When the user says to start from `target`, read this README first, then `doc/target/my.md`, then relevant files under `target/`.
|
|
15
|
+
2. Before coding, normalize dictated text into concrete tasks in `doc/target/my.md`: a short title, current status, source note, and acceptance checks if they are known.
|
|
16
|
+
3. When taking a task, move it to `In Progress` in `doc/target/my.md` and point to the progress file if one is created.
|
|
17
|
+
4. Use `doc/progress/<task>.md` only for checkpoints, decisions, blockers, and verification while work is active.
|
|
18
|
+
5. When implementation is believed complete, move the task to `Verify` in `doc/target/my.md` with the concrete checks that prove it: commands, QA stand checks, screenshots, or manual acceptance points.
|
|
19
|
+
6. Remove a task from `doc/target/my.md` only after `Verify` checks pass and the durable result exists: code/docs are updated, verification is recorded, and changelog is updated when required.
|
|
20
|
+
7. If the task is paused or blocked, leave it in `doc/target/my.md` under `In Progress` or `Blocked` with the next concrete action. Do not delete the progress file in that case.
|
|
21
|
+
8. If a task from `target/*.md` is found already implemented, move it to `Verify` first and check its acceptance criteria before removing it. Do not rely on a deleted progress file as proof.
|
|
22
|
+
|
|
23
|
+
## Status Sections For `my.md`
|
|
24
|
+
|
|
25
|
+
Use these sections:
|
|
26
|
+
|
|
27
|
+
- `Inbox` - raw or lightly cleaned tasks not yet triaged.
|
|
28
|
+
- `Ready` - concrete tasks that can be started.
|
|
29
|
+
- `In Progress` - the task currently being worked on, with a progress-file link when applicable.
|
|
30
|
+
- `Verify` - implementation is believed complete, but acceptance checks still need to be run or reviewed.
|
|
31
|
+
- `Blocked` - tasks waiting for user input, another repository, credentials, or an external change.
|
|
32
|
+
|
|
33
|
+
Completed tasks are normally removed from `my.md`; the final response, commit message, and changelog carry the durable completion record.
|