Implement the 027-ui-polish feature that adds six combatant row improvements (inline conditions, row-click stat block, hover-only remove button, AC shield shape, expanded concentration click target, larger d20 icon) plus top bar redesign with icon-only StepBack/StepForward navigation buttons, dark-themed scrollbars, and multiple UX fixes including stat block panel stability during initiative rolls and mobile touch safety for hidden buttons
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -93,8 +93,12 @@ export function App() {
|
||||
}, [encounter.activeIndex]);
|
||||
|
||||
// Auto-show stat block for the active combatant when turn changes,
|
||||
// but only when the viewport is wide enough to show it alongside the tracker
|
||||
// but only when the viewport is wide enough to show it alongside the tracker.
|
||||
// Only react to activeIndex changes — not combatant reordering (e.g. Roll All).
|
||||
const prevActiveIndexRef = useRef(encounter.activeIndex);
|
||||
useEffect(() => {
|
||||
if (prevActiveIndexRef.current === encounter.activeIndex) return;
|
||||
prevActiveIndexRef.current = encounter.activeIndex;
|
||||
if (!window.matchMedia("(min-width: 1024px)").matches) return;
|
||||
const active = encounter.combatants[encounter.activeIndex];
|
||||
if (!active?.creatureId || !isLoaded) return;
|
||||
@@ -104,7 +108,7 @@ export function App() {
|
||||
|
||||
return (
|
||||
<div className="flex h-screen flex-col">
|
||||
<div className="mx-auto flex w-full max-w-2xl flex-1 flex-col gap-6 px-4 min-h-0">
|
||||
<div className="mx-auto flex w-full max-w-2xl flex-1 flex-col gap-3 px-4 min-h-0">
|
||||
{/* Turn Navigation — fixed at top */}
|
||||
<div className="shrink-0 pt-8">
|
||||
<TurnNavigation
|
||||
@@ -118,13 +122,7 @@ export function App() {
|
||||
|
||||
{/* Scrollable area — combatant list */}
|
||||
<div className="flex-1 overflow-y-auto min-h-0">
|
||||
<header className="space-y-1 mb-6">
|
||||
<h1 className="text-2xl font-bold tracking-tight">
|
||||
Initiative Tracker
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<div className="flex flex-col gap-1 pb-2">
|
||||
<div className="flex flex-col pb-2">
|
||||
{encounter.combatants.length === 0 ? (
|
||||
<p className="py-12 text-center text-sm text-muted-foreground">
|
||||
No combatants yet — add one to get started
|
||||
|
||||
Reference in New Issue
Block a user