feat(шапка): Статистика, Файлы, приглашение и программа — в меню аккаунта
Хозяин 21.11.2026: «это всё нужно убрать в меню пользователя». Кнопки ушли из шапки в меню аккаунта пунктами: Статистика, Файлы, Пригласить коллегу, Подключить программу, Выйти. В шапке остались Новый диалог, режим, тема и аккаунт — на телефоне меньше прокрутки. Проверки: в шапке пунктов нет, в меню все есть, выбор пункта закрывает меню (панель приглашения открывается); мутация с возвратом кнопки в шапку краснеет. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -545,7 +545,7 @@ MAX_MESSAGE_LEN = 10_000
|
||||
|
||||
# ⚠️ Версия UI — единый источник. БАМПАТЬ ПРИ КАЖДОМ ДЕПЛОЕ (формат: YYYY-MM-DD + буква).
|
||||
# Фронт берёт её через GET /api/version (chat.html + admin.html, элемент .app-version).
|
||||
APP_VERSION = "2026-11-21k"
|
||||
APP_VERSION = "2026-11-21l"
|
||||
|
||||
# Audit: path → action name mapping
|
||||
_AUDIT_MAP = [
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
[
|
||||
{
|
||||
"version": "2026-11-21l",
|
||||
"date": "2026-11-21",
|
||||
"changes": [
|
||||
"Статистика, Файлы, приглашение коллеги и подключение программы переехали в меню аккаунта — шапка стала короче"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2026-11-21k",
|
||||
"date": "2026-11-21",
|
||||
@@ -27,13 +34,5 @@
|
||||
"Кнопка «Внести» в карточке клиента стала зелёной — денежное действие заметнее",
|
||||
"Подсказка у остатка в пробном доступе говорит про вопросы, а не про сутки"
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2026-11-21f",
|
||||
"date": "2026-11-21",
|
||||
"changes": [
|
||||
"Пробный доступ: окно зовёт пополнить счёт кнопкой, а не писать на почту",
|
||||
"Кнопки пополнения стали зелёными — заметнее на странице"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
+8
-4
@@ -220,6 +220,7 @@ button { font-family: inherit; }
|
||||
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.account-menu { position: fixed; min-width: 240px; max-width: calc(100vw - 24px); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .4rem; z-index: 1200; }
|
||||
.account-menu-email { padding: .5rem .6rem; font-size: .8rem; color: var(--text-muted); border-bottom: 1px solid var(--border-light); margin-bottom: .35rem; word-break: break-all; }
|
||||
.account-menu-sep { height: 1px; background: var(--border-light); margin: .35rem .2rem; }
|
||||
.account-menu button { width: 100%; text-align: left; padding: .5rem .6rem; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); }
|
||||
.account-menu button:hover, .account-menu button:focus-visible { background: var(--bg); }
|
||||
@media (max-width: 720px) { .account-email { display: none; } .account-btn { padding: .26rem; } }
|
||||
@@ -710,16 +711,12 @@ html { color-scheme: light; }
|
||||
-->
|
||||
<button id="theme-toggle" onclick="toggleTheme()" title="Светлая / тёмная тема" aria-label="Переключить тему">☾</button>
|
||||
<button id="btn-new-dialog" onclick="newChat()">Новый диалог</button>
|
||||
<button onclick="listFiles()">Файлы</button>
|
||||
<button onclick="location.href='/stats'">Статистика</button>
|
||||
<span class="mode-switch" role="group" aria-label="Режим работы">
|
||||
<button type="button" class="mode-on" aria-pressed="true"
|
||||
onclick="try{localStorage.setItem('ui_mode','solver')}catch(e){}">Сметчик</button>
|
||||
<button type="button" aria-pressed="false"
|
||||
onclick="try{localStorage.setItem('ui_mode','checker')}catch(e){};location.href='/review'">Проверяющий</button>
|
||||
</span>
|
||||
<button id="btn-invite" onclick="toggleInvitePanel()" aria-expanded="false" aria-controls="invite-panel">Пригласить коллегу</button>
|
||||
<button id="btn-device" onclick="connectProgram()">Подключить программу</button>
|
||||
|
||||
<div class="account" id="account" style="display:none">
|
||||
<button type="button" id="account-btn" class="account-btn" onclick="toggleAccountMenu(event)"
|
||||
@@ -729,6 +726,13 @@ html { color-scheme: light; }
|
||||
</button>
|
||||
<div id="account-menu" class="account-menu" role="menu" aria-label="Аккаунт" style="display:none">
|
||||
<div class="account-menu-email" id="account-menu-email"></div>
|
||||
<button type="button" role="menuitem" onclick="closeAccountMenu(); location.href='/stats'">Статистика</button>
|
||||
<button type="button" role="menuitem" onclick="closeAccountMenu(); listFiles()">Файлы</button>
|
||||
<button type="button" role="menuitem" id="btn-invite" aria-expanded="false" aria-controls="invite-panel"
|
||||
onclick="closeAccountMenu(); toggleInvitePanel()">Пригласить коллегу</button>
|
||||
<button type="button" role="menuitem" id="btn-device"
|
||||
onclick="closeAccountMenu(); connectProgram()">Подключить программу</button>
|
||||
<div class="account-menu-sep" aria-hidden="true"></div>
|
||||
<button type="button" role="menuitem" onclick="logout()">Выйти</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,16 +57,28 @@ def test_account_menu_shows_email_and_logout(browser, site):
|
||||
assert pg.get_attribute("#account-btn", "title") == "Вы вошли как stub@user"
|
||||
menu = pg.locator("#account-menu")
|
||||
assert not menu.is_visible(), "меню открыто до нажатия"
|
||||
# Редкие разделы живут в меню, а не кнопками в шапке (Хозяин, 21.11.2026).
|
||||
for пункт in ("Статистика", "Файлы", "Пригласить коллегу",
|
||||
"Подключить программу", "Выйти"):
|
||||
assert pg.locator(".header-actions > button", has_text=пункт).count() == 0, (
|
||||
f"«{пункт}» остался кнопкой в шапке")
|
||||
btn.click()
|
||||
assert menu.is_visible(), "меню не открылось"
|
||||
текст = menu.inner_text()
|
||||
assert "stub@user" in текст and "Выйти" in текст, текст
|
||||
for пункт in ("stub@user", "Статистика", "Файлы", "Пригласить коллегу",
|
||||
"Подключить программу", "Выйти"):
|
||||
assert пункт in текст, f"в меню нет «{пункт}»: {текст!r}"
|
||||
pg.keyboard.press("Escape")
|
||||
assert not menu.is_visible(), "Escape не закрыл меню"
|
||||
btn.click()
|
||||
assert menu.is_visible()
|
||||
pg.mouse.click(3, 300)
|
||||
assert not menu.is_visible(), "клик мимо не закрыл меню"
|
||||
# Пункт меню работает и закрывает его: «Пригласить коллегу» открывает панель.
|
||||
btn.click()
|
||||
menu.get_by_role("menuitem", name="Пригласить коллегу").click()
|
||||
assert not menu.is_visible(), "меню не закрылось после выбора пункта"
|
||||
pg.wait_for_selector("#invite-panel", state="visible")
|
||||
finally:
|
||||
ctx.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user