feat(chat): личный чат тьютор ↔ админ с вложениями
Диалоги 1:1 (один тред на тьютора), отдельный SSE-канал whatido:chat вместо общей ленты notifications, вложения с белым списком расширений и вставкой из буфера (Ctrl+V), очистка по chat_retention_days. Таблицы в бэкап, chat_attachments добавлен в sweepOrphanedUploads.
This commit is contained in:
@@ -906,3 +906,90 @@ body.report-card-open .report-fields{display:flex}
|
||||
.student-card__badge{font-size:12px;padding:6px 11px}
|
||||
}
|
||||
|
||||
.chat-layout{display:grid;grid-template-columns:300px 1fr;gap:16px;align-items:start}
|
||||
.chat-layout.chat-layout-solo{grid-template-columns:1fr}
|
||||
.chat-side{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;max-height:calc(100dvh - 190px)}
|
||||
.chat-side-head{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border)}
|
||||
.chat-side-title{font-size:.85rem;font-weight:600}
|
||||
.chat-side-head .grow{flex:1}
|
||||
.chat-new-btn{padding:7px 12px;font-size:.8rem}
|
||||
.chat-new-btn svg{width:14px;height:14px}
|
||||
.chat-thread-list{overflow-y:auto;display:flex;flex-direction:column}
|
||||
.chat-side-empty{padding:22px 14px;color:var(--muted);font-size:.85rem;text-align:center}
|
||||
.chat-thread{display:flex;gap:10px;align-items:flex-start;width:100%;text-align:left;background:transparent;border:none;border-bottom:1px solid var(--border);padding:11px 14px;cursor:pointer;font-family:inherit;transition:background .15s}
|
||||
.chat-thread:last-child{border-bottom:none}
|
||||
.chat-thread:hover{background:var(--bg)}
|
||||
.chat-thread.active{background:rgba(37,99,235,.07)}
|
||||
.chat-thread.unread .chat-thread-name{font-weight:700}
|
||||
.chat-thread-avatar{width:34px;height:34px;border-radius:10px;background:rgba(37,99,235,.1);color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem;flex-shrink:0}
|
||||
.chat-thread-body{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
|
||||
.chat-thread-top{display:flex;align-items:center;gap:6px;min-width:0}
|
||||
.chat-thread-top .grow{flex:1}
|
||||
.chat-thread-name{font-size:.86rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.chat-thread-time{font-size:.7rem;color:var(--muted);flex-shrink:0}
|
||||
.chat-thread-preview{font-size:.78rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.chat-off{font-size:.65rem;color:var(--muted);border:1px solid var(--border);border-radius:5px;padding:1px 5px;flex-shrink:0}
|
||||
.chat-thread-badge{min-width:18px;height:18px;padding:0 6px;border-radius:999px;background:#ef4444;color:#fff;font-size:.65rem;font-weight:700;line-height:18px;text-align:center;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:center}
|
||||
.chat-pane{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);min-height:420px;display:flex;flex-direction:column;overflow:hidden}
|
||||
.chat-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:70px 20px;text-align:center;color:var(--muted)}
|
||||
.chat-empty svg{width:34px;height:34px;opacity:.4}
|
||||
.chat-empty-title{font-size:.95rem;font-weight:600;color:var(--text)}
|
||||
.chat-empty-sub{font-size:.82rem}
|
||||
.chat-main{display:flex;flex-direction:column;min-height:520px}
|
||||
.chat-empty[hidden],.chat-main[hidden],.chat-attach-list[hidden],.chat-new-btn[hidden]{display:none}
|
||||
.chat-head{display:flex;align-items:center;gap:11px;padding:12px 16px;border-bottom:1px solid var(--border)}
|
||||
.chat-head .grow{flex:1}
|
||||
.chat-avatar{width:36px;height:36px;border-radius:10px;background:rgba(37,99,235,.1);color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0}
|
||||
.chat-head-meta{display:flex;flex-direction:column;min-width:0}
|
||||
.chat-head-name{font-size:.9rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.chat-head-sub{font-size:.75rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.chat-live{display:inline-flex;align-items:center;gap:6px;font-size:.72rem;color:var(--muted);flex-shrink:0}
|
||||
.chat-live[hidden]{display:none}
|
||||
.chat-live-dot{width:7px;height:7px;border-radius:50%;background:#22c55e}
|
||||
.chat-live-dot{width:7px;height:7px;border-radius:50%;background:#22c55e}
|
||||
.chat-messages{flex:1;min-height:260px;max-height:calc(100dvh - 400px);overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--bg)}
|
||||
.chat-msgs-empty{margin:auto;color:var(--muted);font-size:.85rem;text-align:center}
|
||||
.msg{display:flex;flex-direction:column;gap:5px;background:var(--card);border:1px solid var(--border);border-radius:12px;padding:10px 13px;max-width:78%;align-self:flex-start}
|
||||
.msg-mine{align-self:flex-end;background:rgba(37,99,235,.07);border-color:rgba(37,99,235,.25)}
|
||||
.msg-head{display:flex;align-items:center;gap:7px;font-size:.72rem;color:var(--muted)}
|
||||
.msg-head .grow{flex:1}
|
||||
.msg-who{font-weight:600;color:var(--text);font-size:.78rem}
|
||||
.msg-role{border:1px solid var(--border);border-radius:5px;padding:0 5px;font-size:.65rem}
|
||||
.msg-time{white-space:nowrap}
|
||||
.msg-body{font-size:.88rem;line-height:1.45;white-space:pre-wrap;word-break:break-word}
|
||||
.msg-files{display:flex;flex-wrap:wrap;gap:8px}
|
||||
.msg-file{display:flex;align-items:center;gap:8px;background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:7px 10px;font-size:.78rem;color:var(--text);text-decoration:none;max-width:230px;min-width:0;transition:border-color .15s}
|
||||
.msg-file:hover{border-color:var(--accent)}
|
||||
.msg-file svg{width:16px;height:16px;flex-shrink:0;color:var(--muted)}
|
||||
.msg-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}
|
||||
.msg-file-size{font-size:.68rem;color:var(--muted);flex-shrink:0}
|
||||
.msg-file-img{flex-direction:column;align-items:stretch;gap:5px;padding:5px;max-width:180px}
|
||||
.msg-file-img img{width:100%;height:110px;object-fit:cover;border-radius:6px;display:block;background:var(--bg)}
|
||||
.msg-file-img .msg-file-name{font-size:.7rem;color:var(--muted)}
|
||||
.chat-composer{border-top:1px solid var(--border);padding:11px 14px 13px;display:flex;flex-direction:column;gap:8px}
|
||||
.chat-attach-list{display:flex;flex-wrap:wrap;gap:7px}
|
||||
.chat-attach-list[hidden]{display:none}
|
||||
.chat-attach-chip{display:inline-flex;align-items:center;gap:6px;background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:5px 9px;font-size:.75rem;max-width:250px}
|
||||
.chat-attach-chip svg{width:13px;height:13px;color:var(--muted);flex-shrink:0}
|
||||
.chat-attach-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.chat-attach-size{color:var(--muted);flex-shrink:0;font-size:.68rem}
|
||||
.chat-attach-del{background:none;border:none;color:var(--muted);cursor:pointer;font-size:.8rem;line-height:1;padding:0 1px}
|
||||
.chat-attach-del:hover{color:#ef4444}
|
||||
.chat-compose-row{display:flex;align-items:flex-end;gap:8px}
|
||||
.chat-attach-btn{width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:var(--bg);border:1px solid var(--border);border-radius:10px;color:var(--muted);cursor:pointer;flex-shrink:0}
|
||||
.chat-attach-btn:hover{color:var(--accent);border-color:var(--accent)}
|
||||
.chat-attach-btn svg{width:17px;height:17px}
|
||||
.chat-input{flex:1;background:var(--bg);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:10px 13px;font-size:.88rem;outline:none;font-family:inherit;resize:none;line-height:1.45;max-height:160px;min-height:40px}
|
||||
.chat-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
|
||||
.chat-composer .btn-primary{padding:11px 17px}
|
||||
.chat-composer .btn-primary:disabled{opacity:.55;cursor:not-allowed}
|
||||
.chat-composer .btn-primary svg{width:15px;height:15px}
|
||||
.chat-hint{font-size:.75rem;margin:0}
|
||||
.chat-new-modal{max-width:420px}
|
||||
|
||||
@media(max-width:900px){
|
||||
.chat-layout{grid-template-columns:1fr}
|
||||
.chat-side{max-height:230px}
|
||||
.chat-messages{max-height:none}
|
||||
.msg{max-width:92%}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user