diff --git a/apps/web/src/components/__tests__/turn-navigation.test.tsx b/apps/web/src/components/__tests__/turn-navigation.test.tsx index 3932fd1..68c6625 100644 --- a/apps/web/src/components/__tests__/turn-navigation.test.tsx +++ b/apps/web/src/components/__tests__/turn-navigation.test.tsx @@ -80,7 +80,7 @@ describe("TurnNavigation", () => { expect(container.textContent).not.toContain("\u2014"); }); - it("round badge and combatant name are siblings in the center area", () => { + it("round badge is in the left zone and name is in the center zone", () => { renderNav( buildEncounter({ combatants: [buildCombatant({ name: "Goblin" })], @@ -88,7 +88,8 @@ describe("TurnNavigation", () => { ); const badge = screen.getByText("R1"); const name = screen.getByText("Goblin"); - expect(badge.closest(".flex")).toBe(name.parentElement); + // Badge and name are in separate grid cells to prevent layout shifts + expect(badge.parentElement).not.toBe(name.parentElement); }); }); diff --git a/apps/web/src/components/turn-navigation.tsx b/apps/web/src/components/turn-navigation.tsx index aaf32ff..c223179 100644 --- a/apps/web/src/components/turn-navigation.tsx +++ b/apps/web/src/components/turn-navigation.tsx @@ -26,19 +26,19 @@ export function TurnNavigation() { const activeCombatant = encounter.combatants[encounter.activeIndex]; return ( -
- - +
+ {/* Left zone: navigation + history + round */}
+ + + R{encounter.roundNumber} +
-
- - - R{encounter.roundNumber} - - + {/* Center zone: active combatant name */} +
{activeCombatant ? ( {activeCombatant.name} ) : ( No combatants )} +
+ + {/* Right zone: difficulty + destructive + forward */} +
{difficulty && ( -
+
setShowBreakdown((prev) => !prev)} @@ -85,9 +88,6 @@ export function TurnNavigation() { ) : null}
)} -
- -
} label="Clear encounter"