v0.16.0 import PGN, delete games, two-layout web client
test / test (push) Canceled after 0s
test / e2e (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-10-19 21:02:39 -04:00
1 parent e1fa5242e3
commit 664cf9654e
34 files changed
+2007 -150

No files matched your search

@@ -50,9 +50,13 @@
(the host's 30rem frame leaves 416px), so the embed keeps a 360px
board while a full window gets up to 560px. */
--topbar-height: 2.5rem;
--board-edge: clamp(360px, min(32vw, calc(100vh - 64px)), 560px);
--board-pad: clamp(16px, 1.04vw, 20px);
--panel-width: clamp(280px, 20vw, 380px);
--panel-width: clamp(260px, 22vw, 380px);
/* The board takes what the window leaves beside the panel and under the
top bar, so the panel is never pushed out of view and the row never
scrolls: 5rem covers the gaps and the frame's padding. The host's
30rem desktop frame leaves 416px. */
--board-edge: clamp(280px, min(100vw - var(--panel-width) - 5rem, 100vh - var(--topbar-height) - 2.5rem), 600px);
--board-pad: clamp(14px, 1.04vw, 20px);
}
html, body {
@@ -404,8 +408,18 @@ body[data-mode="replay"] .square, .square.inert { cursor: default; }
border: 1px solid var(--line);
border-radius: var(--radius);
overflow: hidden;
container-type: inline-size;
}
/* A narrow panel shows the export buttons as icons. */
@container (max-width: 300px) {
.toolbar .btn-tool span { display: none; }
.toolbar .btn-tool .icon { width: 1.2rem; height: 1.2rem; }
.controls .btn { font-size: 0.78rem; padding: 0.5rem 0.2rem; }
}
.toolbar .btn-tool { min-width: 0; overflow: hidden; }
.pane {
height: 100%;
padding: 0.75rem;
@@ -566,7 +580,7 @@ body[data-mode="replay"] .pane-live { display: none; }
}
.replay-result { color: var(--fg); font-weight: 600; }
.replay-ply { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.replay-ply { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }
.replay-players {
color: var(--fg);
@@ -822,6 +836,7 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
}
.modal-message.show { visibility: visible; }
.modal-message.hint { color: var(--muted); }
.modal-message.error { background: rgba(247, 118, 142, 0.12); color: var(--red); border-color: rgba(247, 118, 142, 0.4); }
.modal-message.success { background: rgba(158, 206, 106, 0.12); color: var(--green); border-color: rgba(158, 206, 106, 0.4); }
@@ -843,6 +858,11 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
.confirm-modal { max-width: 320px; }
.import-modal { max-width: 460px; }
.pgn-input { min-height: 9rem; }
.file-label { margin: 0; }
#import-file { max-width: 55%; font-size: 0.8rem; color: var(--muted); }
.promotion-modal { max-width: 320px; }
.promotion-choices {
@@ -1020,6 +1040,38 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
align-items: center;
}
/* A row's delete control sits beside the row; a confirmation replaces it. */
.game-item {
display: flex;
align-items: stretch;
gap: 0.35rem;
}
.game-item .game-row { flex: 1; min-width: 0; }
.game-delete {
flex: none;
width: 2.2rem;
padding: 0;
background: var(--surface-2);
border: 1px solid var(--line);
color: var(--muted);
}
.game-delete:hover:not(:disabled) { color: var(--red); border-color: var(--red); transform: none; }
.game-confirm {
flex: none;
display: flex;
flex-direction: column;
justify-content: center;
gap: 0.3rem;
padding: 0 0.2rem;
}
.game-confirm .btn { padding: 0.3rem 0.5rem; font-size: 0.78rem; }
.game-origin { color: var(--periwinkle); }
.games-status {
margin: 0.4rem 0;
font-size: 0.85rem;
@@ -1033,104 +1085,18 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
#games-more { margin-top: 0.4rem; }
#games-more.hidden { display: none; }
/* --- Stacked layout (board over panel) -------------------------------- */
@media (min-width: 641px) and (max-width: 978px) {
:root {
--panel-width: clamp(360px, 45vw, 440px);
--panel-height: 230px;
/* Board edge = the smaller of the width-derived size and the height
that is left: topbar 40 + gaps 16 + panel 230 + app padding 16 +
slack 40 = 342. A short frame shrinks the board before anything
scrolls. */
--board-edge: max(280px, min(clamp(360px, 45vw, 440px), calc(100vh - 342px)));
--board-pad: clamp(16px, 2.04vw, 20px);
}
body { overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.app { height: auto; min-height: 100%; }
.workspace {
flex-direction: column;
gap: 0.5rem;
overflow: visible;
}
.panel {
width: var(--panel-width);
height: var(--panel-height);
}
.pane {
display: grid;
grid-template-columns: clamp(150px, 18.4vw, 180px) minmax(0, 1fr);
grid-template-rows: min-content 1fr;
gap: 0.5rem 0.75rem;
padding: 0.6rem;
}
.pane > * { min-width: 0; }
.toolbar .btn-tool { min-width: 0; overflow: hidden; }
/* Four export buttons in the narrow right column: icons only. */
.pane-replay .toolbar .btn-tool span { display: none; }
.pane-replay .toolbar .btn-tool .icon { width: 1.2rem; height: 1.2rem; }
body[data-mode="replay"] .pane-live, body[data-mode="live"] .pane-replay { display: none; }
.pane-live .turn-strip { grid-column: 1; grid-row: 1; }
.pane-live .controls {
grid-column: 1;
grid-row: 2;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
align-self: stretch;
}
.pane-live .controls .btn { padding: 0.3rem 0.2rem; font-size: 0.78rem; min-height: 2rem; }
.pane-live .moves { grid-column: 2; grid-row: 1 / 3; }
.pane-live .toolbar { grid-column: 2; grid-row: 3; }
.pane-live { grid-template-rows: min-content 1fr min-content; }
.pane-live .controls { grid-row: 2 / 4; }
/* Replay: head, navigation and the exit button down the left; the move
list with the export row on the right. */
.pane-replay { grid-template-rows: min-content min-content 1fr min-content; }
.pane-replay .replay-head { grid-column: 1; grid-row: 1; padding: 0.3rem 0.5rem; }
.pane-replay .replay-nav {
grid-column: 1;
grid-row: 2;
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 0.25rem;
}
.pane-replay .replay-nav .speed { grid-column: 1 / 5; margin: 0; }
.pane-replay .replay-nav .speed select { width: 100%; }
.pane-replay #replay-exit { grid-column: 1; grid-row: 3 / 5; align-self: end; padding: 0.35rem; font-size: 0.78rem; }
.pane-replay .moves { grid-column: 2; grid-row: 1 / 4; }
.pane-replay .toolbar { grid-column: 2; grid-row: 4; }
.pane-replay .btn-nav { width: 100%; height: 1.65rem; }
.pane-replay .btn-nav .icon { width: 1rem; height: 1rem; }
.pane-replay .speed select { height: 1.65rem; font-size: 0.72rem; padding: 0 0.2rem; }
.pane-replay .replay-meta { display: none; }
.pane-replay .replay-title-row { flex-wrap: wrap; gap: 0.2rem 0.4rem; }
.pane-replay .replay-players { font-size: 0.76rem; }
.pane-replay .replay-result { font-size: 0.76rem; }
.move-grid { grid-template-columns: 2rem 1fr 1fr; font-size: 0.84rem; }
.btn-tool { font-size: 0.74rem; padding: 0.3rem 0.2rem; }
}
/* --- Phone layout: full-width rows, edge to edge ------------------------ */
@media (max-width: 640px) {
@media (max-width: 699px) {
:root {
/* Reserve under the board: top bar 40 + gap 6 + turn strip 32 +
controls 36 + move list 96 + toolbar 36 + gaps and padding 26 =
276. Small viewport units, so the browser's bars never cover the
panel. The replay pane is taller (head, navigation, export, exit),
so a replay reserves more and the board gives way on a short
screen rather than the controls dropping below the fold. */
--board-edge: max(240px, min(100vw, calc(100svh - 284px)));
/* Reserve under the board, in rem so a larger system font grows it:
top bar 2.5 + gap 0.4 + turn strip 2 + controls 2.25 + move list 6
+ toolbar 2.25 + gaps and padding 2.35 = 17.75rem. Small viewport
units, so the browser's bars never cover the panel. The replay
pane is taller (head, navigation, export, exit), so a replay
reserves more and the board gives way on a short screen rather
than the controls dropping below the fold. */
--board-edge: max(240px, min(100vw, calc(100svh - 17.75rem)));
--board-pad: 14px;
--panel-width: 100%;
--panel-height: auto;
@@ -1138,7 +1104,7 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
}
body { overflow-y: auto; overflow-x: hidden; }
body[data-mode="replay"] { --board-edge: max(240px, min(100vw, calc(100svh - 372px))); }
body[data-mode="replay"] { --board-edge: max(240px, min(100vw, calc(100svh - 23.25rem))); }
/* The app is exactly the viewport, so the panel and its move list shrink
to fit; only when their minimums do not fit does the page scroll. */
@@ -1174,6 +1140,7 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
.coordinates.ranks { left: -14px; }
.coordinates.files { top: -15px; }
/* The panel never clips: what the viewport cannot hold scrolls the page. */
.panel {
display: flex;
flex-direction: column;
@@ -1185,8 +1152,13 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
border-left: none;
border-right: none;
border-bottom: none;
overflow: visible;
container-type: normal;
}
/* min-height 0: a flex item's automatic minimum is its content height,
which would let a long move list push the controls below the fold
instead of scrolling inside its box. */
.pane, .pane-live, .pane-replay {
display: flex;
flex: 1 1 auto;
@@ -1194,6 +1166,7 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
gap: 0.4rem;
padding: 0.5rem 0.6rem 0.6rem;
height: auto;
min-height: 0;
}
.pane > * { min-width: 0; }
@@ -1207,7 +1180,7 @@ input[type="range"]:focus-visible { outline: 2px solid var(--periwinkle); outlin
}
.pane-live .controls .btn { padding: 0.5rem 0.2rem; font-size: 0.85rem; min-height: 2.25rem; height: auto; }
.moves { flex: 1 1 auto; min-height: 96px; }
.moves { flex: 1 1 auto; min-height: 6rem; }
.move-grid { grid-template-columns: 2.2rem 1fr 1fr; font-size: 0.9rem; }
.toolbar .btn-tool { padding: 0.45rem 0.3rem; font-size: 0.82rem; min-width: 0; }