fix(rithmomachia): adjust error dialog sizing to prevent text clipping

Reduce font sizes and adjust container dimensions to ensure text fits properly
without clipping.

Changes:
- Increase foreignObject width from 3 to 4 cells
- Reduce main text fontSize from 0.28 to 0.18 cellSize
- Reduce button fontSize from 0.22 to 0.16 cellSize
- Reduce padding from 0.25 to 0.15/0.2 cellSize
- Add whiteSpace: 'nowrap' to prevent text wrapping
- Add width/height: 100% and boxSizing: border-box
- Add justifyContent: 'center' for proper vertical centering

Result: Clean, properly-sized error dialog with no text clipping.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-10-29 14:18:35 -05:00
parent 82a5eb2e4b
commit cda1126cb0
1 changed files with 17 additions and 12 deletions

View File

@ -56,45 +56,50 @@ function CaptureErrorDialog({
)} )}
> >
<foreignObject <foreignObject
x={-cellSize * 1.5} x={-cellSize * 2}
y={-cellSize * 0.8} y={-cellSize * 0.7}
width={cellSize * 3} width={cellSize * 4}
height={cellSize * 1.6} height={cellSize * 1.4}
> >
<div <div
style={{ style={{
background: 'rgba(239, 68, 68, 0.95)', background: 'rgba(239, 68, 68, 0.95)',
color: 'white', color: 'white',
padding: `${cellSize * 0.25}px`, padding: `${cellSize * 0.15}px ${cellSize * 0.2}px`,
borderRadius: `${cellSize * 0.2}px`, borderRadius: `${cellSize * 0.15}px`,
fontSize: `${cellSize * 0.28}px`, fontSize: `${cellSize * 0.18}px`,
fontWeight: 600, fontWeight: 600,
textAlign: 'center', textAlign: 'center',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.5)', boxShadow: '0 8px 24px rgba(0, 0, 0, 0.5)',
border: '3px solid rgba(255, 255, 255, 0.9)', border: '3px solid rgba(255, 255, 255, 0.9)',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
gap: `${cellSize * 0.15}px`, gap: `${cellSize * 0.1}px`,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center',
width: '100%',
height: '100%',
boxSizing: 'border-box',
}} }}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<div>No valid mathematical relation</div> <div style={{ whiteSpace: 'nowrap' }}>No valid mathematical relation</div>
<button <button
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
onClose() onClose()
}} }}
style={{ style={{
padding: `${cellSize * 0.12}px ${cellSize * 0.25}px`, padding: `${cellSize * 0.08}px ${cellSize * 0.2}px`,
borderRadius: `${cellSize * 0.12}px`, borderRadius: `${cellSize * 0.1}px`,
border: '2px solid white', border: '2px solid white',
background: 'rgba(255, 255, 255, 0.2)', background: 'rgba(255, 255, 255, 0.2)',
color: 'white', color: 'white',
fontSize: `${cellSize * 0.22}px`, fontSize: `${cellSize * 0.16}px`,
fontWeight: 'bold', fontWeight: 'bold',
cursor: 'pointer', cursor: 'pointer',
transition: 'all 0.2s ease', transition: 'all 0.2s ease',
whiteSpace: 'nowrap',
}} }}
onMouseEnter={(e) => { onMouseEnter={(e) => {
e.currentTarget.style.background = 'rgba(255, 255, 255, 0.3)' e.currentTarget.style.background = 'rgba(255, 255, 255, 0.3)'