diff --git a/VERSION.properties b/VERSION.properties index 002ce549..c4515948 100644 --- a/VERSION.properties +++ b/VERSION.properties @@ -1,2 +1,2 @@ -client.version=1.20.36 +client.version=1.20.37 server.version=1.16.21 diff --git a/docs/UI-Design/README.md b/docs/UI-Design/README.md index 10fbd94e..52bceeae 100644 --- a/docs/UI-Design/README.md +++ b/docs/UI-Design/README.md @@ -7,6 +7,7 @@ Галерея сохранена без изменений и ещё не отражает итоговое сочетание решений. Для последующего переноса источником истины служит `DESIGN.md`, а не детали одного старого варианта. Эта галерея не является описанием текущего кода приложения. +- [Поддержка SHiNE в меню кошельков](WALLET_SHINE_SUPPORT.md) — отдельный пункт пожертвования, старые экраны кошельков и билетов. - [Локализация UI (этап 1)](I18N.md) — языковой движок, приоритет системного языка и глобальные настройки. - [Связи V3: исследование графа](NETWORK_EXPLORER_V3.md) — BFS-глубина, X2, размеры аватарок, кэш 24 часа. - [PWA: масштабирование и аватар профиля](PWA_VIEWPORT_AND_AVATAR_PREVIEW.md) — поведение полноэкранного интерфейса и просмотра фотографии. diff --git a/docs/UI-Design/WALLET_SHINE_SUPPORT.md b/docs/UI-Design/WALLET_SHINE_SUPPORT.md new file mode 100644 index 00000000..ff238ffd --- /dev/null +++ b/docs/UI-Design/WALLET_SHINE_SUPPORT.md @@ -0,0 +1,18 @@ +# Поддержка SHiNE в меню кошельков + +Статус: реализовано в `shine-UI/js/pages/wallet-view.js` (13.11.2026). + +В меню кошельков (`renderWalletChoice`) пункты расположены в следующем порядке: + +1. Solana кошелёк — просмотр баланса и обычный перевод SOL. +2. Arweave кошелёк. +3. Turbo кошелёк. +4. **Поддержать проект SHiNE** — открывает существующий `openShineSupportDialog()` без получателя. В этом режиме вызывается `supportShineDaoOnSolana` и **100% пожертвования** поступает в `shine_payments_inflow_vault` через `shine_users.support_dao`; сумма учитывается в `dao_direct` пользователя. +5. **Предоплаченное место Сияния (больше не используется)** — сохранён прежний экран и его код, изменена только надпись в меню. +6. **Билеты и очереди выплат SHiNE** — прежний `renderSupportHub()` (билеты, очередь, генерация ключей); функциональность не менялась, переименована только навигация и заголовок. + +Кнопка поддержки проекта **удалена из внутреннего экрана Solana**, чтобы не смешивать просмотр кошелька и добровольное пожертвование. Никаких изменений в переводах `support_user`, экономическом PDA, серверном API или механизме выплат этот UI-патч не делает. + +Название и подсказка пункта локализованы в RU/EN; словарь `screens.support_phase2` управляет уже существующим окном пожертвования. + +Проверка: `node --test shine-UI/tests/support-phase2.test.mjs shine-UI/tests/wallet-donate-menu.test.mjs`. diff --git a/shine-UI/js/i18n/locales/en.json b/shine-UI/js/i18n/locales/en.json index c3e05676..c72a94d9 100644 --- a/shine-UI/js/i18n/locales/en.json +++ b/shine-UI/js/i18n/locales/en.json @@ -2687,8 +2687,10 @@ "text_097": "Please wait while your Arweave key is derived from your blockchain key. This is a one-time setup; subsequent access should be almost instant.", "text_120": "Turbo wallet", "text_121": "Turbo credits for file uploads", - "text_124": "Support SHiNE", - "text_125": "Tickets and help", + "support_project_label": "✨ Support the SHiNE project", + "support_project_hint": "Donate to keep the ecosystem running and growing", + "text_124": "SHiNE tickets and payout queues", + "text_125": "Buy tickets, check queues and get help", "text_105": "Loading Turbo balance…", "text_106": "Not enough SOL in your wallet to add credits.", "text_118": "Arweave wallet", @@ -2699,7 +2701,7 @@ "text_127": "exists but is not anchored in Solana", "text_101": "Load your Turbo wallet address first.", "text_102": "Enter a positive SOL amount (up to 9 decimal places).", - "text_122": "Prepaid SHiNE storage", + "text_122": "Prepaid SHiNE storage (no longer used)", "text_123": "Limit, used, and remaining", "text_114": "The purchase is within the current limit.", "text_115": "The amount exceeds the current limit or is invalid.", @@ -2758,7 +2760,7 @@ "text_203": "Please enter your ticket number.", "text_208": "Please enter your ticket number.", "text_206": "Drop it", - "text_189": "Support SHiNE", + "text_189": "SHiNE tickets and payout queues", "text_227": "Certificate", "text_244": "Certificate", "text_238": "Loading…", diff --git a/shine-UI/js/i18n/locales/ru.json b/shine-UI/js/i18n/locales/ru.json index 8483f18e..dc3b5631 100644 --- a/shine-UI/js/i18n/locales/ru.json +++ b/shine-UI/js/i18n/locales/ru.json @@ -2873,10 +2873,12 @@ "text_119": "Баланс AR", "text_120": "Turbo кошелёк", "text_121": "Кредиты Turbo для загрузки файлов", - "text_122": "Предоплаченное место Сияния", + "support_project_label": "✨ Поддержать проект SHiNE", + "support_project_hint": "Пожертвование на работу и развитие экосистемы", + "text_122": "Предоплаченное место Сияния (больше не используется)", "text_123": "Лимит, израсходовано и остаток", - "text_124": "Поддержать проект Сияние", - "text_125": "Билеты и справка", + "text_124": "Билеты и очереди выплат SHiNE", + "text_125": "Покупка билетов, очередь и справка", "text_126": "закреплён", "text_127": "есть, но не закреплён в Solana", "text_128": "Solana: слепок ещё не закреплён", @@ -2940,7 +2942,7 @@ "text_186": "Баланс Solana для пополнения: {value1} SOL", "text_187": "Обновлено: {value1}", "text_188": "Пополнение отправлено. Транзакция: {value1}", - "text_189": "Поддержать проект Сияние", + "text_189": "Билеты и очереди выплат SHiNE", "text_190": "Здесь можно купить билет, посмотреть очередь и увидеть, как устроена покупка.\n Оплата идет в SOL, а сумма считается по курсу USD/USDT на момент транзакции.\n Номер билета и секретный ключ кошелька нужно сохранить отдельно.", "text_191": "Купить билет", "text_192": "Посмотреть очередь", diff --git a/shine-UI/js/pages/wallet-view.js b/shine-UI/js/pages/wallet-view.js index 9ac4d260..0e70d0ea 100644 --- a/shine-UI/js/pages/wallet-view.js +++ b/shine-UI/js/pages/wallet-view.js @@ -1319,6 +1319,7 @@ export function render({navigate, chrome}) { [t('screens.wallet_view.text_116'), t('screens.wallet_view.text_117'), () => renderSolanaWallet()], [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()], ]; @@ -1868,12 +1869,10 @@ export function render({navigate, chrome}) { - `; const refreshBtn = actions.querySelector('#refresh-balance'); const sendBtn = actions.querySelector('#send-sol'); - actions.querySelector('#donate-shine')?.addEventListener('click', () => openShineSupportDialog({ onSuccess: () => void refreshBalance() })); const refreshBalance = async () => { if (!walletAddress) { diff --git a/shine-UI/tests/support-phase2.test.mjs b/shine-UI/tests/support-phase2.test.mjs index c9f0c77d..c817049d 100644 --- a/shine-UI/tests/support-phase2.test.mjs +++ b/shine-UI/tests/support-phase2.test.mjs @@ -19,10 +19,11 @@ test('profile views attach counters from server cache and support user action', assert.match(other, /openShineSupportDialog\(\{ recipientLogin: card\.login/); }); -test('wallet supports direct SHiNE economy donation', () => { +test('wallet offers SHiNE economy donation through the menu, not the Solana wallet', () => { const wallet = file('../js/pages/wallet-view.js'); - assert.match(wallet, /id="donate-shine"/); - assert.match(wallet, /openShineSupportDialog\(\{ onSuccess/); + const menu = wallet.split('function renderWalletChoice()')[1].split('async function renderShineBlockchainWallet()')[0]; + assert.match(menu, /openShineSupportDialog\(\)/); + assert.doesNotMatch(wallet, /id="donate-shine"/); }); test('message buttons pass checked block hashes, not message text', () => { diff --git a/shine-UI/tests/wallet-donate-menu.test.mjs b/shine-UI/tests/wallet-donate-menu.test.mjs new file mode 100644 index 00000000..f2832a72 --- /dev/null +++ b/shine-UI/tests/wallet-donate-menu.test.mjs @@ -0,0 +1,34 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; + +const file = (path) => readFileSync(new URL(path, import.meta.url), 'utf8'); +const ui = file('../js/pages/wallet-view.js'); +const ru = JSON.parse(file('../js/i18n/locales/ru.json')); +const en = JSON.parse(file('../js/i18n/locales/en.json')); + +for (const [locale, dict] of [['ru', ru], ['en', en]]) { + test(`${locale}: distinct menu descriptions for donations, obsolete storage and ticket flow`, () => { + const names = dict.screens.wallet_view; + assert.match(names.support_project_label, /SHiNE/i); + assert.ok(names.support_project_hint.length >= 20); + assert.match(names.text_122, locale === 'ru' ? /больше не используется/ : /no longer used/); + assert.notEqual(names.text_124, names.support_project_label); + assert.notEqual(names.text_189, names.support_project_label); + assert.ok(names.text_125); + }); +} + +test('menu opens existing DAO donation dialog without navigating to the Solana balance', () => { + const menu = ui.split('function renderWalletChoice()')[1].split('async function renderShineBlockchainWallet()')[0]; + 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()'] + .map((entry) => menu.indexOf(entry)); + assert.ok(order.every((position) => position >= 0)); + assert.deepEqual(order, [...order].sort((a, b) => a - b)); + assert.match(menu, /\(\) => openShineSupportDialog\(\)/); + assert.match(ui, /import \{ openShineSupportDialog \} from/); + assert.match(file('../js/components/shine-support-dialog.js'), /supportShineDaoOnSolana/); +});