feat(ui): chat-bubbles layout, fix eval bar visibility, no terminals

UI rewrite per user feedback:
- Remove agent terminal panels entirely (tmux runs headlessly).
- Left column: chat with colored bubbles per move (white→light, black→
  dark, click to jump to ply, label shows agent+side+SAN).
- Right column: SAN move history (lichess style, click to jump).
- Center: board, untouched, but now constrained so it stops overflowing.
- Eval bar between chat and board, vertical with cp/mate text; the
  earlier visual issue was pure CSS (no explicit height) — bar fills
  full column height now.
- Keyboard nav: ←/→/space.
- Bottom log strip kept (compact).

Backend: TmuxTailer no longer started in lifespan (UI doesn't need
term_chunk events). Stockfish + eval_bridge now log explicit errors
to backend.log on startup failure.
This commit is contained in:
ai-chess
2026-05-14 23:51:24 +03:00
parent 4c5b306a9a
commit 6f4525d59f
4 changed files with 299 additions and 179 deletions
+111 -47
View File
@@ -2,73 +2,137 @@
html, body { height: 100%; margin: 0; }
body {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
background: #16161a;
background: #0f0f12;
color: #e7e5e4;
font-size: 13px;
}
#layout {
display: grid;
grid-template-columns: 30% 40% 30%;
grid-template-rows: minmax(0, 88vh) minmax(0, 12vh);
grid-template-columns: minmax(280px, 1.1fr) 28px minmax(420px, 700px) minmax(180px, 240px);
grid-template-rows: 1fr 110px;
grid-template-areas:
"left center right"
"log log log";
"chat eval board moves"
"log log log log";
height: 100vh;
gap: 8px;
padding: 8px;
}
#agent-codex { grid-area: left; }
#board-col { grid-area: center; }
#agent-claude{ grid-area: right; }
#log-strip { grid-area: log; border-top: 1px solid #333; overflow: auto; }
#log-text { font-size: 11px; padding: 4px 8px; margin: 0; color: #999; white-space: pre-wrap; }
.agent-panel {
display: flex; flex-direction: column;
border-right: 1px solid #333;
min-width: 0; min-height: 0;
}
#agent-claude { border-right: none; border-left: 1px solid #333; }
#chat-col { grid-area: chat; min-width: 0; min-height: 0; }
#eval-col { grid-area: eval; min-width: 0; min-height: 0; }
#board-col { grid-area: board; min-width: 0; min-height: 0; }
#moves-col { grid-area: moves; min-width: 0; min-height: 0; }
#log-strip { grid-area: log; min-width: 0; min-height: 0; }
.agent-panel.theme-light { background: #f5f5f4; color: #1a1a1a; }
.agent-panel.theme-dark { background: #1a1a1a; color: #e7e5e4; }
.agent-header {
padding: 4px 8px; font-weight: 600; border-bottom: 1px solid #333;
/* ----- columns shared header ----- */
.col-header {
display: flex; justify-content: space-between; align-items: center;
padding: 4px 8px; opacity: 0.6; font-size: 11px; text-transform: uppercase;
letter-spacing: 0.08em; border-bottom: 1px solid #2a2a30;
}
.agent-side { font-size: 11px; opacity: 0.6; }
.terminal { flex: 1; min-height: 0; padding: 4px; overflow: hidden; }
.terminal .xterm { height: 100%; }
/* ----- chat (left) ----- */
#chat-col { display: flex; flex-direction: column; background: #15151a; border-radius: 6px; overflow: hidden; }
#chat-list {
flex: 1; overflow-y: auto; padding: 8px;
display: flex; flex-direction: column; gap: 6px;
}
.bubble {
padding: 6px 9px 8px;
border-radius: 8px;
border: 1px solid transparent;
cursor: pointer;
line-height: 1.35;
word-wrap: break-word;
transition: outline-color 0.1s ease;
outline: 1px solid transparent;
outline-offset: 2px;
}
.bubble:hover { outline-color: #777; }
.bubble.active { outline-color: #c0a060; }
.bubble-white { background: #f0eee6; color: #16161a; align-self: flex-start; max-width: 92%; }
.bubble-black { background: #1f1e22; color: #e7e5e4; align-self: flex-end; max-width: 92%; border-color: #2a2a30; }
.bubble-meta {
font-size: 10px; opacity: 0.65; margin-bottom: 3px;
display: flex; justify-content: space-between; gap: 6px; align-items: center;
}
.bubble-san { font-weight: 700; opacity: 0.95; }
.bubble-body { font-size: 12.5px; }
.bubble-empty { font-style: italic; opacity: 0.55; }
#board-col {
display: flex; flex-direction: column; padding: 12px;
min-width: 0; min-height: 0;
}
#board-wrap {
display: grid; grid-template-columns: 24px 1fr 200px;
gap: 8px; flex: 1; min-height: 0;
}
#eval-bar {
position: relative; width: 24px; background: #444; border-radius: 4px; overflow: hidden;
/* ----- eval bar ----- */
#eval-col {
position: relative;
background: #18181c;
border-radius: 4px;
overflow: hidden;
}
#eval-fill {
position: absolute; left: 0; right: 0; bottom: 50%;
background: #f5f5f4; transition: bottom 0.3s ease;
background: linear-gradient(180deg, #fafafa 0%, #ddd 100%);
transition: bottom 0.4s ease;
}
#eval-text {
position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
text-align: center; font-size: 10px; color: #000; mix-blend-mode: difference;
text-align: center; font-size: 10px; color: #888;
background: rgba(20,20,24,0.6); padding: 2px 0;
}
#board { aspect-ratio: 1 / 1; background: #444; }
#history { overflow-y: auto; font-size: 14px; }
#history-list { padding-left: 28px; }
#history-list li { cursor: pointer; }
#history-list li.active { background: #555; }
#board-footer { display: flex; gap: 8px; align-items: center; padding: 8px 0; }
#status-line { flex: 1; opacity: 0.8; }
#sf-lines { font-size: 12px; opacity: 0.8; min-height: 1.5em; }
button { background: #2a2a2a; color: #e7e5e4; border: 1px solid #444; padding: 4px 12px; cursor: pointer; }
button:hover { background: #333; }
/* ----- board ----- */
#board-col {
display: flex; flex-direction: column; align-items: center; gap: 8px;
min-width: 0; min-height: 0;
}
#board {
width: min(100%, calc(100vh - 220px));
aspect-ratio: 1 / 1;
max-width: 100%;
background: #444;
border-radius: 4px;
overflow: hidden;
}
#board cg-container { width: 100% !important; height: 100% !important; }
#board-footer {
display: flex; gap: 8px; align-items: center; width: 100%; padding: 0 4px;
font-size: 12px;
}
#status-line { flex: 0 0 auto; opacity: 0.85; }
#sf-pv { flex: 1; opacity: 0.55; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog { background: #1a1a1a; color: #e7e5e4; border: 1px solid #444; padding: 16px; }
dialog form { display: flex; flex-direction: column; gap: 8px; min-width: 320px; }
/* ----- moves history ----- */
#moves-col { display: flex; flex-direction: column; background: #15151a; border-radius: 6px; overflow: hidden; }
#history-list {
flex: 1; overflow-y: auto; padding: 4px 8px; margin: 0;
list-style: none;
display: grid; grid-template-columns: 28px 1fr 1fr; row-gap: 1px;
align-content: start;
}
#history-list li { padding: 2px 6px; border-radius: 3px; cursor: pointer; font-size: 12.5px; }
#history-list li.ply-num { opacity: 0.4; cursor: default; }
#history-list li:not(.ply-num):hover { background: #25252b; }
#history-list li.active { background: #3d342a; color: #f0d090; }
/* ----- log strip ----- */
#log-strip {
background: #0c0c0e; border: 1px solid #1f1f24; border-radius: 6px;
overflow: auto; padding: 4px 8px;
}
#log-text {
font-size: 11px; margin: 0; color: #888; white-space: pre-wrap;
}
/* ----- buttons + dialog ----- */
button {
background: #25252b; color: #e7e5e4; border: 1px solid #34343a;
padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px;
}
button:hover { background: #2e2e36; }
#live-btn { background: #3d342a; color: #f0d090; }
dialog {
background: #15151a; color: #e7e5e4; border: 1px solid #2a2a30;
padding: 16px; border-radius: 6px;
}
dialog form { display: flex; flex-direction: column; gap: 10px; min-width: 320px; }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 0; }