diff --git a/web/src/main/resources/static/css/app.css b/web/src/main/resources/static/css/app.css index 66c85ba..ba94721 100644 --- a/web/src/main/resources/static/css/app.css +++ b/web/src/main/resources/static/css/app.css @@ -24,6 +24,9 @@ body { --c-badge-ok-text: #166534; --c-badge-warn-bg: #fef3c7; --c-badge-warn-text: #92400e; + --c-tone-pos: #16803c; + --c-tone-neg: #b3283b; + --c-tone-neu: #64748b; } [data-theme="dark"] { @@ -39,6 +42,9 @@ body { --c-badge-ok-text: #6ee7b7; --c-badge-warn-bg: rgba(251, 191, 36, 0.15); --c-badge-warn-text: #fcd34d; + --c-tone-pos: #4ade80; + --c-tone-neg: #f87171; + --c-tone-neu: #9aa3b2; } a { color: var(--c-text-link); text-decoration: none; } @@ -319,8 +325,15 @@ code.code { padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-family: monos border-radius: 0.4rem; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); } .ac-list.drop-up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 2px; } -.ac-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.875rem; } +.ac-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; padding-left: 0.45rem; border-left: 3px solid transparent; cursor: pointer; font-size: 0.875rem; } .ac-item:hover, .ac-item.active { background: var(--c-bg); } +.ac-item.ac-pos { border-left-color: var(--c-tone-pos); } +.ac-item.ac-neg { border-left-color: var(--c-tone-neg); } +.ac-item.ac-neu { border-left-color: var(--c-tone-neu); } +.ac-tone { flex: 0 0 auto; width: 1rem; text-align: center; font-size: 0.8rem; font-weight: 700; } +.ac-tone-pos { color: var(--c-tone-pos); } +.ac-tone-neg { color: var(--c-tone-neg); } +.ac-tone-neu { color: var(--c-tone-neu); } .ac-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ac-count { flex: 0 0 auto; background: var(--c-border); color: var(--c-text-muted); } .ac-del { flex: 0 0 auto; border: none; background: transparent; color: var(--c-text-muted); cursor: pointer; padding: 0 0.25rem; border-radius: 0.25rem; font-size: 0.75rem; line-height: 1.4; } diff --git a/web/src/main/resources/static/js/admin-group.js b/web/src/main/resources/static/js/admin-group.js index 7e62f42..378c17c 100644 --- a/web/src/main/resources/static/js/admin-group.js +++ b/web/src/main/resources/static/js/admin-group.js @@ -106,8 +106,16 @@ function attachCommentAutocomplete(input) { list.innerHTML = ''; items.forEach(function (item) { var count = parseInt(item.count || 0, 10) || 0; + var tone = String(item.tone || 'neutral').toLowerCase(); + var toneKey = tone.indexOf('pos') === 0 ? 'pos' : (tone.indexOf('neg') === 0 ? 'neg' : 'neu'); var row = document.createElement('div'); - row.className = 'ac-item'; + row.className = 'ac-item ac-' + toneKey; + + var mark = document.createElement('span'); + mark.className = 'ac-tone ac-tone-' + toneKey; + mark.textContent = toneKey === 'pos' ? '+' : (toneKey === 'neg' ? '—' : '○'); + mark.title = toneKey === 'pos' ? 'Позитивный' : (toneKey === 'neg' ? 'Негативный' : 'Нейтральный'); + row.appendChild(mark); var text = document.createElement('span'); text.className = 'ac-text';