fix: resolve promotion dialog bugs and column resizing issues
Some checks failed
CI Pipeline / Code Linting (pull_request) Successful in 14s
CI Pipeline / Run Tests (pull_request) Failing after 20s
CI Pipeline / Build Verification (pull_request) Has been skipped
CI Pipeline / Generate Quality Report (pull_request) Successful in 19s

This commit addresses Issue #7 and fixes the column resizing bug:

1. Issue #7 Fix (already implemented):
   - Added status-message element to index.html
   - Added CSS styling for status messages
   - Messages now display visually to users

2. Column Resizing Bug Fix:
   - Changed grid-template-columns from flexible minmax() to fixed widths
   - Changed from: minmax(200px, 250px) minmax(600px, 3fr) minmax(200px, 250px)
   - Changed to: 250px 600px 250px
   - Fixed sidebar widths to 250px (removed width: 100%, max-width)
   - Fixed board section width to 600px (removed min-width, width: 100%)
   - Fixed move-history width to 218px (accounting for padding)
   - Added justify-content: center to game-container

Root cause: The minmax() function with fractional units (3fr) was causing
the browser to recalculate column widths when sidebar content changed
(captured pieces being added). Fixed widths prevent this reflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Christoph Wagner 2025-11-23 20:31:02 +01:00
parent e88e67de4b
commit df3735a8ec

View File

@ -92,27 +92,26 @@ body {
.game-container {
flex: 1;
display: grid;
grid-template-columns: minmax(200px, 250px) minmax(600px, 3fr) minmax(200px, 250px);
grid-template-columns: 250px 600px 250px;
gap: 2rem;
padding: 2rem;
max-width: 1600px;
margin: 0 auto;
justify-content: center;
}
.board-section {
display: flex;
align-items: center;
justify-content: center;
min-width: 600px;
width: 100%;
width: 600px;
}
.game-sidebar {
display: flex;
flex-direction: column;
gap: 1.5rem;
width: 100%;
max-width: 250px;
width: 250px;
}
.captured-pieces {
@ -120,8 +119,7 @@ body {
padding: 1rem;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 250px;
width: 250px;
}
.captured-pieces h3 {
@ -136,7 +134,7 @@ body {
flex-wrap: wrap;
gap: 0.5rem;
min-height: 60px;
max-width: 100%;
width: 100%;
overflow: hidden;
}
@ -146,8 +144,7 @@ body {
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
flex: 1;
width: 100%;
max-width: 250px;
width: 250px;
}
.move-history {
@ -156,7 +153,7 @@ body {
overflow-x: hidden;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
width: 100%;
width: 218px;
}
.game-controls {