feat(rithmomachia): guide defaults to docked right on open
Change guide opening behavior: - Created handleOpenGuide() function - Sets guideDocked=true and guideDockSide='right' when opening - Guide now opens docked to the right side by default - No need to drag and dock manually on first open - Provides better initial UX with guide immediately in workspace User can still undock or drag to left side if preferred. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9fd54067ce
commit
11f674d542
|
|
@ -94,6 +94,14 @@ export function RithmomachiaGame() {
|
||||||
return badges
|
return badges
|
||||||
}, [whitePlayerId, blackPlayerId])
|
}, [whitePlayerId, blackPlayerId])
|
||||||
|
|
||||||
|
const handleOpenGuide = () => {
|
||||||
|
console.log('[RithmomachiaGame] handleOpenGuide called')
|
||||||
|
setIsGuideOpen(true)
|
||||||
|
setGuideDocked(true) // Default to docked on right
|
||||||
|
setGuideDockSide('right')
|
||||||
|
console.log('[RithmomachiaGame] Guide opened in docked right position')
|
||||||
|
}
|
||||||
|
|
||||||
const handleDock = (side: 'left' | 'right') => {
|
const handleDock = (side: 'left' | 'right') => {
|
||||||
console.log('[RithmomachiaGame] handleDock called', { side })
|
console.log('[RithmomachiaGame] handleDock called', { side })
|
||||||
setGuideDockSide(side)
|
setGuideDockSide(side)
|
||||||
|
|
@ -144,8 +152,8 @@ export function RithmomachiaGame() {
|
||||||
height: '100%',
|
height: '100%',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{state.gamePhase === 'setup' && <SetupPhase onOpenGuide={() => setIsGuideOpen(true)} />}
|
{state.gamePhase === 'setup' && <SetupPhase onOpenGuide={handleOpenGuide} />}
|
||||||
{state.gamePhase === 'playing' && <PlayingPhase onOpenGuide={() => setIsGuideOpen(true)} />}
|
{state.gamePhase === 'playing' && <PlayingPhase onOpenGuide={handleOpenGuide} />}
|
||||||
{state.gamePhase === 'results' && <ResultsPhase />}
|
{state.gamePhase === 'results' && <ResultsPhase />}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue