fix(chess): send game updates to move sender + responsive mobile redesign
Some checks failed
Deploy to Production / test (push) Failing after 32s
Some checks failed
Deploy to Production / test (push) Failing after 32s
Bun's ws.publish() excludes the sender, so the player making a move never received the GAME_UPDATE with the new FEN — causing pieces to snap back. Added ctx.send() alongside ctx.publish() for GAME_UPDATE and GAME_ENDED. Also redesigned the panel for mobile: hamburger drawer sidebar, responsive chess board sizing via ResizeObserver, stacked layouts on small screens, and touch-friendly modals/controls across lobby and game pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,11 +50,11 @@ export function GameRoom({ userId }: { userId: string }) {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-xl">{plugin.icon}</span>
|
||||
<div>
|
||||
<h1 className="font-display text-base font-semibold">{plugin.name}</h1>
|
||||
<div className="flex items-center justify-between gap-3 mb-4 md:mb-6">
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<span className="text-xl shrink-0">{plugin.icon}</span>
|
||||
<div className="min-w-0">
|
||||
<h1 className="font-display text-base font-semibold truncate">{plugin.name}</h1>
|
||||
<div className="flex items-center gap-2 text-xs text-text-tertiary">
|
||||
<span className={`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold ${
|
||||
roomStatus === "waiting" ? "bg-warning/15 text-warning"
|
||||
@@ -70,7 +70,7 @@ export function GameRoom({ userId }: { userId: string }) {
|
||||
</div>
|
||||
<button
|
||||
onClick={() => { leaveRoom(); navigate("/games"); }}
|
||||
className="rounded-md px-3 py-1.5 text-sm font-medium bg-card border border-border text-text-tertiary hover:text-foreground transition-colors"
|
||||
className="rounded-md px-3 py-1.5 text-sm font-medium bg-card border border-border text-text-tertiary hover:text-foreground transition-colors shrink-0"
|
||||
>
|
||||
Leave
|
||||
</button>
|
||||
@@ -94,12 +94,13 @@ export function GameRoom({ userId }: { userId: string }) {
|
||||
)}
|
||||
|
||||
{roomStatus === "waiting" && (
|
||||
<div className="bg-card rounded-lg border border-border p-8 text-center">
|
||||
<div className="bg-card rounded-lg border border-border p-5 md:p-8 text-center">
|
||||
<div className="text-sm text-text-tertiary mb-2">
|
||||
Waiting for players ({players.length}/2)
|
||||
</div>
|
||||
<div className="text-xs text-text-disabled">
|
||||
Share this URL to invite: <span className="font-mono bg-surface px-2 py-0.5 rounded select-all">{window.location.href}</span>
|
||||
Share this URL to invite:
|
||||
<span className="block mt-1 font-mono bg-surface px-2 py-1 rounded select-all text-[11px] break-all">{window.location.href}</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user