Commit Graph
8 Commits
Author SHA1 Message Date
ai-chess 0657cec846 fix(ui): normalize FEN key for eval cache
python-chess always sets the en-passant target after a 2-square pawn
move; chess.js omits it when no capture is legally possible. That
disagreement skipped evals for plies after every double pawn push
(1.e4, 1...c5, 3.d4, ...). Use position + side-to-move + castling as
the lookup key on both producer and consumer; halfmove/fullmove
counters and en-passant target are dropped from the key.
2026-05-15 00:20:40 +03:00
ai-chess 0eec263fd8 feat(ui): floating moves under board, chat full-height right, refined eval bar
Layout (after iterative feedback):
- Two columns: board+eval (left, square) | chat full-height (right).
- Moves row floats just under the board as a compact one-row strip with
  the controls (new game / settings) — replaces the old right sidebar.
- Board sized imperatively via fitBoard + ResizeObserver; eval bar height
  matches the board exactly (no overflow into neighbours).

Eval bar:
- 36px wide (was 28); text fits without pill background.
- System sans-serif, 10.5px / 700 weight, tabular-nums.
- Text positioned on whichever side is winning (bottom-white-half when
  white ahead → dark text; top-black-half when black ahead → light).
- Sign now correct: backend stores raw cp from side-to-move; frontend
  flips when FEN says "b" so the bar always reflects white POV.

Replay:
- evalByFen on the client gets backfilled from /api/state's new `evals`
  list (backend keeps state.eval_cache per game). Clicking past bubbles
  now restores the stockfish eval for that ply.
- renderBoard clears stockfish arrow when no eval is known yet for the
  shown FEN, so the arrow no longer 'lags' onto the next position.

Auto-focus:
- Latest played move is highlighted in both the chat bubble list and
  the moves strip when in live mode (viewPly === null).
- scrollIntoView keeps the active bubble/SAN visible after each move.
2026-05-15 00:17:33 +03:00
ai-chess 3a9ba2ea49 feat(ui): eval bar as two opposing bars (black on top, white on bottom)
The dark container now visually represents the black share; the
bottom-anchored white fill grows/shrinks with the eval. cp range ±800
maps to full bar. Mate is pinned at 100%/0% with #M text. The score
label flips to the top when black is ahead so it stays inside the
darker half.
2026-05-14 23:55:33 +03:00
ai-chess 6f4525d59f 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.
2026-05-14 23:51:24 +03:00
ai-chess d5d5756b18 feat(ui): /games page with replay 2026-05-14 23:28:22 +03:00
ai-chess 62d66c5ab6 feat(ui): chessground + WS + xterm.js + settings dialog 2026-05-14 23:27:54 +03:00
ai-chess f4af57c5e9 fix(ui): chess.js/chessground are ESM, load via app.js imports 2026-05-14 23:27:16 +03:00
ai-chess 67e077ae49 feat(ui): HTML skeleton + 3-column grid CSS 2026-05-14 23:25:50 +03:00