SHA256
Доработать исследователь сети и кошелёк
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
client.version=1.20.73
|
||||
client.version=1.20.74
|
||||
server.version=1.16.43
|
||||
|
||||
@@ -6,16 +6,18 @@
|
||||
|
||||
## Управление
|
||||
|
||||
- `Близкие` — рёбра только типа `close_friend` (тип выбирается владельцем исходящего отношения).
|
||||
- `Сияющие` — только сияющие пользователи; выбранный центр виден всегда.
|
||||
- `X2` — для текущего пользователя дополнительно читаем друзей каждого непосредственного друга,
|
||||
по четыре запроса одновременно. Чтение прогрессивное: текущий граф показывается сразу,
|
||||
остальные ветки появляются после завершения запросов; ошибки не скрывают успешные ветки.
|
||||
- `Глубина: 0–4` (старт `1`) — максимальное **кратчайшее** расстояние в уже исследованном
|
||||
графе: `1 + глубина`, если X2 выключен, и `2 + глубина`, если X2 включён.
|
||||
Для определения расстояния по известным исходящим дружеским рёбрам используется BFS без
|
||||
учёта их направления; оригинальное направление сохраняется для отображения отношений.
|
||||
- Верхнее меню `⋮`: «Искать пользователей» и «Очистить кэш».
|
||||
- `Только близкие` — рёбра только типа `close_friend` (тип выбирается владельцем исходящего отношения).
|
||||
- `Только сияющие` — только сияющие пользователи; выбранный центр виден всегда.
|
||||
Оба фильтра независимы, по умолчанию выключены. Активный фильтр появляется над графом;
|
||||
нажатие на него отключает фильтр и убирает кнопку. Состояние галочек в меню синхронно.
|
||||
- `X2` постоянно включён: для текущего пользователя дополнительно читаем друзей каждого
|
||||
непосредственного друга, по четыре запроса одновременно. Чтение прогрессивное.
|
||||
- `Показывать историю` включено по умолчанию (глубина 3, радиус BFS 5). При снятии галочки
|
||||
глубина 0, радиус 2; исследованные данные не удаляются. Для определения расстояния
|
||||
используется BFS без учёта направления, оригинальное направление сохраняется для отображения.
|
||||
- Верхнее меню `⋮`: «Искать пользователей», «Показать меня», оба фильтра,
|
||||
«Показывать историю», «Очистить кэш». «Показать меня» возвращает собственный
|
||||
аккаунт в центр карты без очистки истории. Постоянных кнопок X2, глубины и «Компактнее» нет.
|
||||
Очистка удаляет **только кэш V3**, обнуляет исследованный граф и заново запрашивает
|
||||
связи текущего пользователя. Поиск использует текущий серверный `searchUsers`.
|
||||
|
||||
@@ -53,7 +55,7 @@
|
||||
Подтверждённое изменение дружеских связей через UI также сбрасывает кэш V3, если
|
||||
этот экран открыт. Операция очистки инвалидирует незавершённые загрузки. **При каждом нажатии нижней
|
||||
кнопки «Связи»** исследованный граф V3/V4, координаты и IndexedDB-кэш графа
|
||||
сбрасываются, центр снова — собственный пользователь; X2 и фильтры выключены.
|
||||
сбрасываются, центр снова — собственный пользователь; X2 и история включены, дополнительные фильтры выключены.
|
||||
При смене V3 ↔ V4 внутри открытого экрана сброса нет. Кэш изображений не затрагивается.
|
||||
|
||||
## Проверка
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
## Данные и управление
|
||||
|
||||
V4 использует ту же страницу `network-explorer/network-view.js` через `renderExplorer(context, { canvas: true })`:
|
||||
передача `graph-model.js`, кэш IndexedDB, загрузка X2, глубина 0–4, фильтры «Близкие»/«Сияющие»,
|
||||
передача `graph-model.js`, кэш IndexedDB, постоянная загрузка X2, история (глубина 3/0), фильтры «Только близкие»/«Только сияющие»,
|
||||
поиск, сброс кэша и хранение координат являются общими для V3 и V4. Если пользователь перемещает
|
||||
узел, координаты сохраняются точно так же, как в V3. Разрешено перерисовать весь граф при приходе
|
||||
новых данных; перерасчёт модели не превращается в бесконечную анимацию.
|
||||
@@ -48,12 +48,14 @@ V4 поддерживает мышь/сенсорный экран: перета
|
||||
|
||||
Каждое нажатие **нижней кнопки «Связи»** сбрасывает исследованный граф V3/V4:
|
||||
очищает графы в памяти и в IndexedDB, забывает раскрытые ветви и координаты, возвращает
|
||||
к собственному профилю, отключает X2 и дополнительные фильтры. После окончания
|
||||
очистки загружаются собственные непосредственные связи. Новый запрос ждёт завершения
|
||||
к собственному профилю, включает X2 и историю, отключает дополнительные фильтры. После окончания
|
||||
очистки загружаются собственные связи и связи непосредственных друзей. Новый запрос ждёт завершения
|
||||
очистки — старые данные не восстанавливаются наперегонки из IndexedDB.
|
||||
Переключение версий V1/V2/V3/V4 в селекторе внутри открытого экрана **не** сбрасывает
|
||||
исследованный граф. Кэш изображений браузера, фотографии и другие данные приложения не стираются.
|
||||
Верхнее меню «Очистить кэш» остаётся отдельным действием внутри уже открытой карты.
|
||||
Верхнее меню содержит «Показать меня» (возврат к собственному центру без сброса графа),
|
||||
галочки фильтров и истории, поиск и отдельное действие «Очистить кэш». Над картой видны только
|
||||
активные фильтры, нажатие отключает соответствующий фильтр.
|
||||
|
||||
## Файлы
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
2. Arweave кошелёк.
|
||||
3. Turbo кошелёк.
|
||||
4. **Поддержать проект SHiNE** — открывает существующий `openShineSupportDialog()` без получателя. В этом режиме вызывается `supportShineDaoOnSolana` и **100% пожертвования** поступает в `shine_payments_inflow_vault` через `shine_users.support_dao`; сумма учитывается в `dao_direct` пользователя.
|
||||
5. **Предоплаченное место Сияния (больше не используется)** — сохранён прежний экран и его код, изменена только надпись в меню.
|
||||
6. **Билеты и очереди выплат SHiNE** — прежний `renderSupportHub()` (билеты, очередь, генерация ключей); функциональность не менялась, переименована только навигация и заголовок.
|
||||
5. **Билеты и очереди выплат SHiNE** — прежний `renderSupportHub()` (билеты, очередь, генерация ключей); функциональность не менялась, переименована только навигация и заголовок.
|
||||
|
||||
Пункт «Предоплаченное место Сияния» убран из меню; прежний код экрана сохранён.
|
||||
|
||||
Кнопка поддержки проекта **удалена из внутреннего экрана Solana**, чтобы не смешивать просмотр кошелька и добровольное пожертвование. Никаких изменений в переводах `support_user`, экономическом PDA, серверном API или механизме выплат этот UI-патч не делает.
|
||||
|
||||
@@ -19,7 +20,7 @@
|
||||
|
||||
## Мультивалютный кошелёк и прямые переводы (17.11.2026)
|
||||
|
||||
Добавлен отдельный маршрут `wallet/transfer` и `wallet/transfer/<login>`: форма с валютой SOL/USDT, балансами и подтверждением суммы. Из чата получатель фиксирован (логин + найденный blockchainKey), из кошелька вводится только произвольный адрес Base58. Опциональное DM-уведомление доступно только при переводе из чата.
|
||||
Добавлен отдельный маршрут `wallet/transfer` и `wallet/transfer/<login>`: форма с валютой SOL/USDT, балансами и подтверждением суммы. Из чата получатель фиксирован (логин + найденный blockchainKey), из кошелька вводится только произвольный адрес Base58. Опциональное DM-уведомление доступно только при переводе из чата; при каждом открытии формы его галочка включена по умолчанию, пользователь может её снять.
|
||||
|
||||
- Старая кнопка SOL перевода по `window.prompt` заменена переходом на полноэкранный `wallet-transfer-view.js`.
|
||||
- Из меню переписки (вертикальное троеточие) пункт «Перевести деньги» открывает ту же страницу с предвыбранным собеседником.
|
||||
|
||||
@@ -109,14 +109,16 @@ export function createDropdownMenu({
|
||||
|
||||
const button = document.createElement('button');
|
||||
button.type = 'button';
|
||||
button.className = `dropdown-menu__item${item.selected ? ' is-selected' : ''}${item.danger ? ' is-danger' : ''}${item.className ? ` ${item.className}` : ''}`;
|
||||
button.setAttribute('role', 'menuitem');
|
||||
const checkable = typeof item.checked === 'boolean';
|
||||
button.className = `dropdown-menu__item${(item.selected || item.checked) ? ' is-selected' : ''}${item.danger ? ' is-danger' : ''}${item.className ? ` ${item.className}` : ''}`;
|
||||
button.setAttribute('role', checkable ? 'menuitemcheckbox' : 'menuitem');
|
||||
if (checkable) button.setAttribute('aria-checked', String(item.checked));
|
||||
button.disabled = Boolean(item.disabled);
|
||||
|
||||
if (item.iconHtml) {
|
||||
if (checkable || item.iconHtml) {
|
||||
const icon = document.createElement('span');
|
||||
icon.className = 'dropdown-menu__icon';
|
||||
icon.innerHTML = item.iconHtml;
|
||||
icon.innerHTML = checkable ? iconHtml(item.checked ? 'checkbox-checked' : 'checkbox') : item.iconHtml;
|
||||
button.append(icon);
|
||||
} else if (item.iconSrc) {
|
||||
const icon = document.createElement('img');
|
||||
|
||||
@@ -34,6 +34,8 @@ const paths = {
|
||||
gift: '<rect x="3" y="8" width="18" height="5" rx="1"/><path d="M5 13v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7M12 8v13M12 8S10.5 3 8 3.5 7 8 12 8Zm0 0s1.5-5 4-4.5S17 8 12 8Z"/>',
|
||||
plus: '<path d="M12 5v14M5 12h14"/>',
|
||||
check: '<path d="m5 12.5 4.5 4.5L19 7.5"/>',
|
||||
checkbox: '<rect x="4" y="4" width="16" height="16" rx="3"/>',
|
||||
'checkbox-checked': '<rect x="4" y="4" width="16" height="16" rx="3"/><path d="m7.5 12 3 3 6-6"/>',
|
||||
open: '<path d="M5 12h14M13 6l6 6-6 6"/>',
|
||||
chevron: '<path d="m9 6 6 6-6 6"/>',
|
||||
'chevron-up': '<path d="m6 15 6-6 6 6"/>',
|
||||
|
||||
@@ -4291,6 +4291,10 @@
|
||||
"close": "Close avatar preview"
|
||||
},
|
||||
"network_explorer": {
|
||||
"show_me": "Show me",
|
||||
"only_close": "Close friends only",
|
||||
"only_shining": "Shining members only",
|
||||
"show_history": "Show history",
|
||||
"depth": "Depth: {value1}",
|
||||
"depth_hint": "Up to {value1} links from the selected person. Tap to change depth.",
|
||||
"menu": "Connections menu",
|
||||
|
||||
@@ -4291,6 +4291,10 @@
|
||||
"close": "Закрыть просмотр аватара"
|
||||
},
|
||||
"network_explorer": {
|
||||
"show_me": "Показать меня",
|
||||
"only_close": "Только близкие",
|
||||
"only_shining": "Только сияющие",
|
||||
"show_history": "Показывать историю",
|
||||
"depth": "Глубина: {value1}",
|
||||
"depth_hint": "Максимум {value1} связей от выбранного пользователя. Нажмите, чтобы изменить глубину.",
|
||||
"menu": "Меню связей",
|
||||
|
||||
@@ -558,6 +558,12 @@ export function createExplorerCanvasGraph({ stage, model, onCenterTap, onNodeTap
|
||||
return {
|
||||
setModel, nodeScreenPoint,
|
||||
getFocusNode: () => nodeById.get(focusId) || null,
|
||||
centerCamera: () => {
|
||||
const node = nodeById.get(focusId);
|
||||
camX = -(node?.x || 0) * zoom;
|
||||
camY = -(node?.y || 0) * zoom;
|
||||
requestDraw();
|
||||
},
|
||||
recenter: () => { camX = 0; camY = 0; updateZoom(DIVE_ZOOM); requestDraw(); },
|
||||
destroy: () => {
|
||||
if (destroyed) return;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { CONNECTIONS_GRAPH_CHANGED } from '../../services/connections-graph-cach
|
||||
import { createForceGraph } from '../network-legacy/force-graph.js';
|
||||
import { createExplorerCanvasGraph } from '../network-canvas-v4/graph-renderer.js';
|
||||
import { openNodeMenu } from '../network-legacy/node-menu.js';
|
||||
import { createExplorerGraph, keyOf, EXPLORER_DEFAULT_DEPTH, EXPLORER_MAX_DEPTH } from './graph-model.js';
|
||||
import { createExplorerGraph, keyOf } from './graph-model.js';
|
||||
import { getExplorerGraph, readExplorerCachedGraphs, clearExplorerGraphCache, explorerCacheScope, explorerGraphSavedAt } from './graph-cache.js';
|
||||
|
||||
export const pageMeta = {
|
||||
@@ -69,7 +69,7 @@ export function renderExplorer({ navigate, route, chrome } = {}, { canvas = fals
|
||||
const scope = explorerCacheScope(authService, state.session.login);
|
||||
if (!retained || retained.scope !== scope) retained = {
|
||||
scope, graph: createExplorerGraph(), positions: new Map(), center: '',
|
||||
depth: EXPLORER_DEFAULT_DEPTH, x2: false, close: false, shining: false, compact: false,
|
||||
depth: 3, x2: true, close: false, shining: false,
|
||||
};
|
||||
const session = retained;
|
||||
let centerLogin = normalizeLogin(route?.params?.login || session.center || state.session.login);
|
||||
@@ -118,8 +118,8 @@ export function renderExplorer({ navigate, route, chrome } = {}, { canvas = fals
|
||||
const center = keyOf(centerLogin);
|
||||
if (!session.positions.has(center)) session.positions.set(center, { x: 0, y: 0 });
|
||||
const pending = nodes.filter((node) => !session.positions.has(node.id)).sort((a, b) => a.distance - b.distance);
|
||||
const spacing = session.compact ? 62 : 84;
|
||||
const minNodeGap = session.compact ? 48 : 66;
|
||||
const spacing = 84;
|
||||
const minNodeGap = 66;
|
||||
for (const node of pending) {
|
||||
const connected = (adjacency.get(node.id) || []).filter((id) => session.positions.has(id));
|
||||
const nearest = connected.sort((a, b) => (byId.get(a)?.distance ?? 99) - (byId.get(b)?.distance ?? 99))[0];
|
||||
@@ -223,14 +223,13 @@ export function renderExplorer({ navigate, route, chrome } = {}, { canvas = fals
|
||||
if (disposed || seq !== loadSeq) return;
|
||||
if (!ok) { updateStatus(t('screens.network_explorer.error')); return; }
|
||||
draw();
|
||||
if (!session.x2) { updateStatus(); return; }
|
||||
|
||||
const friends = [...(session.graph.getFriends(next) || [])];
|
||||
let index = 0;
|
||||
let finished = 0;
|
||||
let failed = 0;
|
||||
const workers = Array.from({ length: Math.min(4, friends.length) }, async () => {
|
||||
while (index < friends.length && !disposed && seq === loadSeq && session.x2) {
|
||||
while (index < friends.length && !disposed && seq === loadSeq) {
|
||||
const friend = friends[index++];
|
||||
if (!await fetchGraph(friend, seq)) failed += 1;
|
||||
finished += 1;
|
||||
@@ -243,56 +242,43 @@ export function renderExplorer({ navigate, route, chrome } = {}, { canvas = fals
|
||||
updateStatus(failed ? t('screens.network_explorer.partial', { value1: failed }) : '');
|
||||
}
|
||||
|
||||
function chip(label, fn, selected = false) {
|
||||
const element = document.createElement('button');
|
||||
element.type = 'button'; element.className = `fg-filter-chip${selected ? ' is-active' : ''}`;
|
||||
element.textContent = label;
|
||||
element.setAttribute('aria-pressed', selected ? 'true' : 'false');
|
||||
element.addEventListener('click', fn);
|
||||
toolbar.append(element);
|
||||
return element;
|
||||
// Верхняя панель содержит только активные фильтры; меню читает то же состояние.
|
||||
function syncFilters() {
|
||||
toolbar.replaceChildren();
|
||||
for (const [key, label] of [
|
||||
['close', 'screens.network_explorer.only_close'],
|
||||
['shining', 'screens.network_explorer.only_shining'],
|
||||
]) {
|
||||
if (!session[key]) continue;
|
||||
const button = document.createElement('button');
|
||||
button.type = 'button';
|
||||
button.className = 'fg-filter-chip is-active';
|
||||
button.textContent = t(label);
|
||||
button.setAttribute('aria-pressed', 'true');
|
||||
button.addEventListener('click', () => toggleFilter(key));
|
||||
toolbar.append(button);
|
||||
}
|
||||
function actionChip(label, fn) {
|
||||
const element = document.createElement('button');
|
||||
element.type = 'button'; element.className = 'fg-filter-chip';
|
||||
element.textContent = label;
|
||||
element.addEventListener('click', fn);
|
||||
toolbar.append(element);
|
||||
return element;
|
||||
toolbar.hidden = !session.close && !session.shining;
|
||||
}
|
||||
const closeChip = chip(t('screens.network_view.text_002'), () => {
|
||||
session.close = !session.close;
|
||||
closeChip.classList.toggle('is-active', session.close);
|
||||
closeChip.setAttribute('aria-pressed', String(session.close));
|
||||
function toggleFilter(key) {
|
||||
session[key] = !session[key];
|
||||
syncFilters();
|
||||
draw();
|
||||
}, session.close);
|
||||
const shineChip = chip(t('screens.network_view.text_003'), () => {
|
||||
session.shining = !session.shining;
|
||||
shineChip.classList.toggle('is-active', session.shining);
|
||||
shineChip.setAttribute('aria-pressed', String(session.shining));
|
||||
draw();
|
||||
}, session.shining);
|
||||
const x2Chip = chip('X2', () => {
|
||||
session.x2 = !session.x2;
|
||||
x2Chip.classList.toggle('is-active', session.x2);
|
||||
x2Chip.setAttribute('aria-pressed', String(session.x2));
|
||||
void load(centerLogin);
|
||||
}, session.x2);
|
||||
const depthChip = chip('', () => {
|
||||
session.depth = (session.depth + 1) % (EXPLORER_MAX_DEPTH + 1);
|
||||
syncDepth(); draw();
|
||||
});
|
||||
actionChip(t('screens.network_explorer.compact'), () => {
|
||||
session.compact = true;
|
||||
session.positions.clear();
|
||||
draw();
|
||||
});
|
||||
function syncDepth() {
|
||||
depthChip.textContent = t('screens.network_explorer.depth', { value1: session.depth });
|
||||
depthChip.title = t('screens.network_explorer.depth_hint', { value1: session.depth + (session.x2 ? 2 : 1) });
|
||||
depthChip.setAttribute('aria-label', depthChip.title);
|
||||
}
|
||||
syncDepth();
|
||||
function toggleHistory() {
|
||||
session.depth = session.depth === 3 ? 0 : 3;
|
||||
draw();
|
||||
}
|
||||
function showMe() {
|
||||
const login = normalizeLogin(state.session.login);
|
||||
if (!login || disposed) return;
|
||||
// load() сдвигает координаты при смене центра; для уже выбранного себя
|
||||
// тоже возвращаем узел в начало координат, если он был перемещён вручную.
|
||||
if (keyOf(login) === keyOf(centerLogin)) shiftToCenter(login);
|
||||
void load(login, true);
|
||||
engine?.centerCamera?.();
|
||||
}
|
||||
syncFilters();
|
||||
|
||||
async function resetCache() {
|
||||
++loadSeq;
|
||||
@@ -435,8 +421,14 @@ export function renderExplorer({ navigate, route, chrome } = {}, { canvas = fals
|
||||
icon: 'moreVertical', title: t('screens.network_explorer.menu'),
|
||||
ariaLabel: t('screens.network_explorer.menu'),
|
||||
menu: {
|
||||
items: [
|
||||
items: () => [
|
||||
{ iconHtml: iconHtml('search'), label: t('screens.network_explorer.search'), action: openSearchModal },
|
||||
{ iconHtml: iconHtml('focus'), label: t('screens.network_explorer.show_me'), disabled: !normalizeLogin(state.session.login), action: showMe },
|
||||
{ divider: true },
|
||||
{ label: t('screens.network_explorer.only_close'), checked: session.close, action: () => toggleFilter('close') },
|
||||
{ label: t('screens.network_explorer.only_shining'), checked: session.shining, action: () => toggleFilter('shining') },
|
||||
{ label: t('screens.network_explorer.show_history'), checked: session.depth === 3, action: toggleHistory },
|
||||
{ divider: true },
|
||||
{ iconHtml: iconHtml('trash'), label: t('screens.network_explorer.clear_cache'), action: () => void resetCache() },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -57,6 +57,7 @@ export function render({ navigate, chrome, route }) {
|
||||
q('recipient-label').textContent = t('wallet_multi.recipient');
|
||||
q('notify-label').textContent = t('wallet_multi.notify');
|
||||
q('notify-row').hidden = !recipientFromRoute;
|
||||
q('notify').checked = Boolean(recipientFromRoute);
|
||||
q('send').textContent = t('wallet_multi.send');
|
||||
q('hint').textContent = t('wallet_multi.no_stars');
|
||||
q('selected').textContent = '';
|
||||
|
||||
@@ -1289,7 +1289,6 @@ export function render({navigate, chrome}) {
|
||||
[t('screens.wallet_view.text_118'), t('screens.wallet_view.text_119'), () => renderArweaveWallet()],
|
||||
[t('screens.wallet_view.text_120'), t('screens.wallet_view.text_121'), () => renderTurboWallet()],
|
||||
[t('screens.wallet_view.support_project_label'), t('screens.wallet_view.support_project_hint'), () => openShineSupportDialog()],
|
||||
[t('screens.wallet_view.text_122'), t('screens.wallet_view.text_123'), () => renderShineBlockchainWallet()],
|
||||
[t('screens.wallet_view.text_124'), t('screens.wallet_view.text_125'), () => renderSupportHub()],
|
||||
];
|
||||
const buttons = items.map(([label, hint, open]) => {
|
||||
|
||||
@@ -421,6 +421,8 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.fg-filter-bar[hidden] { display: none; }
|
||||
|
||||
.fg-filter-bar > button {
|
||||
pointer-events: auto;
|
||||
position: relative;
|
||||
|
||||
@@ -131,3 +131,24 @@ test('V3: сияние не стирает тип связи у красно-с
|
||||
assert.equal(edge.reverseRelationType, 'close_friend');
|
||||
assert.equal(find(g.snapshot('a', { depth: 0 }), 'b').shining, true);
|
||||
});
|
||||
|
||||
test('V3/V4: история с постоянно включённым X2 меняет радиус 5 ↔ 2, не удаляя граф', () => {
|
||||
const g = createExplorerGraph();
|
||||
for (const [a, b] of [['a','b'], ['b','c'], ['c','d'], ['d','e'], ['e','f'], ['f','g']]) {
|
||||
g.add(friends(a, [b]));
|
||||
}
|
||||
const ids = (depth) => g.snapshot('a', { x2: true, depth }).nodes.map((node) => node.id);
|
||||
assert.deepEqual(ids(3), ['a','b','c','d','e','f']);
|
||||
assert.deepEqual(ids(0), ['a','b','c']);
|
||||
assert.deepEqual(ids(3), ['a','b','c','d','e','f']);
|
||||
});
|
||||
|
||||
test('V3/V4: оба фильтра работают совместно и могут отключаться независимо', () => {
|
||||
const g = createExplorerGraph();
|
||||
g.add(friends('a', ['b'], ['c', 'd'], [], [['b', true], ['c', true], ['d', false]]));
|
||||
const ids = (close, shining) => g.snapshot('a', { x2: true, depth: 3, close, shining }).nodes.map((node) => node.id).sort();
|
||||
assert.deepEqual(ids(true, true), ['a','c']);
|
||||
assert.deepEqual(ids(false, true), ['a','b','c']);
|
||||
assert.deepEqual(ids(true, false), ['a','c','d']);
|
||||
assert.deepEqual(ids(false, false), ['a','b','c','d']);
|
||||
});
|
||||
|
||||
@@ -116,3 +116,23 @@ test('V4 Canvas открывается по умолчанию, но ранее
|
||||
assert.match(switcher, /const DEFAULT_MODE = 'explorer-canvas';/);
|
||||
assert.match(switcher, /MODES\.has\(saved\) \? saved : DEFAULT_MODE/);
|
||||
});
|
||||
|
||||
test('V3/V4: defaults, dynamic menu, active-only chips and self-centering contract', () => {
|
||||
const view = readFileSync(new URL('../js/pages/network-explorer/network-view.js', import.meta.url), 'utf8');
|
||||
const dropdown = readFileSync(new URL('../js/components/dropdown-menu.js', import.meta.url), 'utf8');
|
||||
const renderer = readFileSync(new URL('../js/pages/network-canvas-v4/graph-renderer.js', import.meta.url), 'utf8');
|
||||
assert.match(view, /depth: 3, x2: true, close: false, shining: false/);
|
||||
assert.doesNotMatch(view, /x2Chip|depthChip|session\.compact|session\.x2\s*=/);
|
||||
assert.match(view, /session\.depth = session\.depth === 3 \? 0 : 3/);
|
||||
assert.match(view, /toolbar\.replaceChildren\(\)/);
|
||||
assert.match(view, /if \(!session\[key\]\) continue/);
|
||||
assert.match(view, /toolbar\.hidden = !session\.close && !session\.shining/);
|
||||
assert.match(view, /items: \(\) => \[/);
|
||||
assert.match(view, /checked: session\.close, action: \(\) => toggleFilter\('close'\)/);
|
||||
assert.match(view, /checked: session\.shining, action: \(\) => toggleFilter\('shining'\)/);
|
||||
assert.match(view, /checked: session\.depth === 3, action: toggleHistory/);
|
||||
assert.match(view, /function showMe\(\)[\s\S]*?void load\(login, true\);\s*engine\?\.centerCamera\?\.\(\)/);
|
||||
assert.match(dropdown, /'menuitemcheckbox'/);
|
||||
assert.match(dropdown, /setAttribute\('aria-checked', String\(item\.checked\)\)/);
|
||||
assert.match(renderer, /centerCamera: \(\) => \{[\s\S]*?camX = -\(node\?\.x \|\| 0\) \* zoom/);
|
||||
});
|
||||
|
||||
@@ -24,8 +24,9 @@ test('menu opens existing DAO donation dialog without navigating to the Solana b
|
||||
assert.match(menu, /support_project_label/);
|
||||
assert.doesNotMatch(ui, /id="donate-shine"/, 'Solana wallet must not duplicate the donation button');
|
||||
const order = ['renderSolanaWallet()', 'renderArweaveWallet()', 'renderTurboWallet()',
|
||||
'openShineSupportDialog()', 'renderShineBlockchainWallet()', 'renderSupportHub()']
|
||||
'openShineSupportDialog()', 'renderSupportHub()']
|
||||
.map((entry) => menu.indexOf(entry));
|
||||
assert.doesNotMatch(menu, /renderShineBlockchainWallet|wallet_view\.text_122/);
|
||||
assert.ok(order.every((position) => position >= 0));
|
||||
assert.deepEqual(order, [...order].sort((a, b) => a - b));
|
||||
assert.match(menu, /\(\) => openShineSupportDialog\(\)/);
|
||||
|
||||
@@ -85,6 +85,9 @@ test('chat transfer fixes recipient; wallet transfer has only free-address entry
|
||||
assert.match(transfer, /const recipientLogin = recipientFromRoute;/);
|
||||
assert.match(transfer, /q\('recipient'\)\.readOnly = true;/);
|
||||
assert.match(transfer, /q\('notify-row'\)\.hidden = !recipientFromRoute;/);
|
||||
assert.match(transfer, /q\('notify'\)\.checked = Boolean\(recipientFromRoute\);/);
|
||||
assert.match(transfer, /const messageWanted = q\('notify'\)\.checked;/);
|
||||
assert.match(transfer, /if \(messageWanted && recipientLogin\)/);
|
||||
assert.match(transfer, /if \(recipientLogin\) \{/);
|
||||
assert.match(transfer, /toAddress = await resolveContactBlockchainAddress\(recipientLogin, endpoint\);/);
|
||||
assert.doesNotMatch(transfer, /data-clear-contact|data-search|data-contacts|wallet-transfer-contact-picker|authService\.listContacts/);
|
||||
|
||||
Reference in New Issue
Block a user