mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-05 01:14:58 +03:00
🐛 fix(chat): вернуть свёрнутый список диалогов, зелёный акцент по умолчанию
Кнопка «Показать список» жила только в шапке переписки. При пустом списке или просто без выбранного диалога переписки нет — свёрнутый список оказывался не вернуть ничем. Теперь кнопка есть и в пустой области, на том же месте, что и в шапке. Сценарий закрыт e2e-тестом. Цвет продукта по умолчанию — зелёный #0f9b8e: он же первый в палитре акцентов профиля. Прежний синий остался вторым пресетом. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8580b480e7
commit
b76871caf0
10 files changed
+36
-11
No files matched your search
@@ -113,7 +113,7 @@ MESSAGES: dict[str, object] = {
|
||||
"portals.invalid_section": "Invalid section",
|
||||
"portals.not_found": "Portal not found",
|
||||
"portals.section_not_found": "Section not found",
|
||||
"profile.accent_hex": "The accent is a HEX colour like #1677ff",
|
||||
"profile.accent_hex": "The accent is a HEX colour like #0f9b8e",
|
||||
"profile.choose_photo_file": "Choose a photo file",
|
||||
"profile.link_not_found": "Link not found",
|
||||
"profile.notification_bot_not_found": "Notification bot not found",
|
||||
|
||||
@@ -117,7 +117,7 @@ MESSAGES: dict[str, object] = {
|
||||
"portals.invalid_section": "Некорректный раздел",
|
||||
"portals.not_found": "Портал не найден",
|
||||
"portals.section_not_found": "Раздел не найден",
|
||||
"profile.accent_hex": "Акцент — HEX-цвет вида #1677ff",
|
||||
"profile.accent_hex": "Акцент — HEX-цвет вида #0f9b8e",
|
||||
"profile.choose_photo_file": "Выберите файл фото",
|
||||
"profile.link_not_found": "Привязка не найдена",
|
||||
"profile.notification_bot_not_found": "Бот уведомлений не найден",
|
||||
|
||||
@@ -75,7 +75,7 @@ class HumanUser(AbstractUser):
|
||||
# без этой отметки принимался бы второй раз ещё полторы минуты.
|
||||
totp_last_counter = models.BigIntegerField(default=0)
|
||||
# Внешний вид — глобальная настройка пользователя (не membership):
|
||||
# тема и акцентный HEX-цвет; пустой акцент — дефолтный синий #1677ff.
|
||||
# тема и акцентный HEX-цвет; пустой акцент — цвет продукта #0f9b8e.
|
||||
ui_theme = models.CharField(max_length=8, choices=UiTheme.choices, default=UiTheme.SYSTEM)
|
||||
ui_accent = models.CharField(max_length=9, blank=True)
|
||||
# Язык интерфейса — тоже глобальная настройка пользователя, а не
|
||||
|
||||
@@ -4,6 +4,7 @@ import { CallOverlay } from "./CallOverlay";
|
||||
import { Composer } from "./Composer";
|
||||
import { ConversationThread } from "./ConversationThread";
|
||||
import { DialogList } from "./DialogList";
|
||||
import { IconButton } from "../../shared/ui-controls";
|
||||
import {
|
||||
claimConversation,
|
||||
closeConversation,
|
||||
@@ -227,7 +228,16 @@ export function ConversationWorkspace({ isOwner = false, viewerId = null, listTi
|
||||
hint={hint}
|
||||
/>
|
||||
{!selectedDialog && (
|
||||
<section className="sales-conversation"><div className="sales-conversation-empty">{t("conversations.pick_conversation")}</div></section>
|
||||
<section className="sales-conversation">
|
||||
{/* Свёрнутый список без выбранного диалога: вернуть его больше неоткуда —
|
||||
шапки переписки, где живёт та же кнопка, здесь нет. */}
|
||||
{listCollapsed && (
|
||||
<div className="sales-conversation-head">
|
||||
<IconButton bare icon="collapseLeft" iconSize={17} label={t("conversations.show_list")} className="list-expand" onClick={() => setListCollapsed(false)} />
|
||||
</div>
|
||||
)}
|
||||
<div className="sales-conversation-empty">{t("conversations.pick_conversation")}</div>
|
||||
</section>
|
||||
)}
|
||||
{selectedDialog && (
|
||||
<section className="sales-conversation enter-surface" key={selectedDialog.id}>
|
||||
|
||||
@@ -94,7 +94,7 @@ export function ProfileAppearanceCard({ user, onUserUpdated }: { user: SessionUs
|
||||
<input
|
||||
disabled={saving}
|
||||
maxLength={7}
|
||||
placeholder="#1677ff"
|
||||
placeholder="#0f9b8e"
|
||||
value={customAccent}
|
||||
onChange={(event) => setCustomAccent(event.target.value)}
|
||||
onKeyDown={(event) => {
|
||||
|
||||
@@ -1228,7 +1228,7 @@ export const en: Record<MessageKey, Message> = {
|
||||
"profile.create_agent": "Create an agent",
|
||||
"profile.current": "current",
|
||||
"profile.current_password": "Current password",
|
||||
"profile.custom_colour_hex_value_like": "A custom colour is a HEX value like #1677ff",
|
||||
"profile.custom_colour_hex_value_like": "A custom colour is a HEX value like #0f9b8e",
|
||||
"profile.dark": "Dark",
|
||||
"profile.disconnect": "Disconnect",
|
||||
"profile.drag_resize_double_click_reset": "Drag to resize, double-click to reset",
|
||||
|
||||
@@ -1229,7 +1229,7 @@ export const ru = {
|
||||
"profile.create_agent": "Создать агента",
|
||||
"profile.current": "текущая",
|
||||
"profile.current_password": "Текущий пароль",
|
||||
"profile.custom_colour_hex_value_like": "Свой цвет — HEX вида #1677ff",
|
||||
"profile.custom_colour_hex_value_like": "Свой цвет — HEX вида #0f9b8e",
|
||||
"profile.dark": "Тёмная",
|
||||
"profile.disconnect": "Отключить",
|
||||
"profile.drag_resize_double_click_reset": "Потяните, двойной клик — сбросить",
|
||||
|
||||
@@ -7,13 +7,13 @@ import { t } from "../i18n";
|
||||
|
||||
export type UiTheme = "LIGHT" | "DARK" | "SYSTEM";
|
||||
|
||||
export const DEFAULT_ACCENT = "#1677ff";
|
||||
export const DEFAULT_ACCENT = "#0f9b8e";
|
||||
|
||||
// Пресеты акцента из дизайн-базлайна v2 (Tweaks макета).
|
||||
// Пресеты акцента; первый — цвет продукта по умолчанию.
|
||||
export const ACCENT_PRESETS: Array<[string, string]> = [
|
||||
["#0f9b8e", t("shared.teal")],
|
||||
["#1677ff", t("shared.blue")],
|
||||
["#6d5dfc", t("shared.indigo")],
|
||||
["#0f9b8e", t("shared.teal")],
|
||||
["#e8590c", t("shared.orange")],
|
||||
];
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
--primary — акцент на экране: в тёмной теме он приглушён подложкой
|
||||
карточки, как в дизайн-базлайне v2 (accentMuted). Производные оттенки
|
||||
считаются от сырого акцента, а не от приглушённого. */
|
||||
--accent: #1677ff;
|
||||
--accent: #0f9b8e;
|
||||
--primary: var(--accent);
|
||||
--primary-hover: color-mix(in srgb, var(--accent) 88%, black);
|
||||
--primary-bg: color-mix(in srgb, var(--accent) 10%, var(--surface-card));
|
||||
|
||||
@@ -802,3 +802,18 @@ test("подсветка тура встаёт ровно по элементу
|
||||
|
||||
await page.screenshot({ path: "test-results/onboarding-tour-settings.png" });
|
||||
});
|
||||
|
||||
test("свёрнутый список диалогов возвращается и без выбранного диалога", async ({ page }) => {
|
||||
await login(page, OWNER_IDENTITY);
|
||||
await expect(page).toHaveURL(/\/chat$/);
|
||||
|
||||
// Кнопка возврата жила только в шапке переписки, а при пустом списке
|
||||
// переписки нет — список оказывался не вернуть.
|
||||
await page.getByRole("button", { name: "Скрыть список" }).click();
|
||||
await expect(page.locator(".sales-dialogs.is-list-collapsed")).toBeVisible();
|
||||
await expect(page.locator(".sales-dialog-list")).toBeHidden();
|
||||
|
||||
await page.getByRole("button", { name: "Показать список" }).click();
|
||||
await expect(page.locator(".sales-dialogs.is-list-collapsed")).toHaveCount(0);
|
||||
await expect(page.locator(".sales-dialog-list")).toBeVisible();
|
||||
});
|
||||
Reference in new issue
Block a user