From 68b1aa23b34fe15f9d92ebd4aa8cfa2a35a95f05 Mon Sep 17 00:00:00 2001 From: John Taylor Date: Wed, 12 Aug 2026 18:05:40 -0400 Subject: [PATCH] fix(run): Rules to the bottom; Rules + Reference fold away MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Run dashboard opened with two 320px lookup viewers pinned open — Rules sat second in the left column on a wide screen, above Party, so the live panels a solo player actually acts on were pushed down by a reference surface. Both lookup panels now sit last: on a wide screen they span the full width under the two columns rather than stranding one of them in a column, and on a phone they trail the list, Reference then Rules. Both switch from _Panel to a new _FoldingPanel (same Card chrome, an ExpansionTile body collapsed by default), so their viewers no longer eat 320px each on arrival and their children build lazily on first expand. Panel keys are unchanged. Co-Authored-By: Claude --- lib/features/run_screen.dart | 98 ++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 32 deletions(-) diff --git a/lib/features/run_screen.dart b/lib/features/run_screen.dart index 44d566a..0461598 100644 --- a/lib/features/run_screen.dart +++ b/lib/features/run_screen.dart @@ -48,36 +48,40 @@ class RunScreen extends ConsumerWidget { const capture = _CapturePanel(); const reference = _ReferencePanel(); if (wide) { + // Reference + Rules sit full-width under both columns: they are + // lookup surfaces, consulted after the live panels. return const SingleChildScrollView( padding: EdgeInsets.all(12), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column(children: [ - initiative, - SizedBox(height: 12), - quickref, - SizedBox(height: 12), - party, - ]), - ), - SizedBox(width: 12), - Expanded( - child: Column(children: [ - scene, - SizedBox(height: 12), - threads, - SizedBox(height: 12), - dice, - SizedBox(height: 12), - capture, - SizedBox(height: 12), - reference, - ]), - ), - ], - ), + child: Column(children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column(children: [ + initiative, + SizedBox(height: 12), + party, + ]), + ), + SizedBox(width: 12), + Expanded( + child: Column(children: [ + scene, + SizedBox(height: 12), + threads, + SizedBox(height: 12), + dice, + SizedBox(height: 12), + capture, + ]), + ), + ], + ), + SizedBox(height: 12), + reference, + SizedBox(height: 12), + quickref, + ]), ); } return ListView( @@ -85,8 +89,6 @@ class RunScreen extends ConsumerWidget { children: const [ initiative, SizedBox(height: 12), - quickref, - SizedBox(height: 12), party, SizedBox(height: 12), scene, @@ -98,6 +100,8 @@ class RunScreen extends ConsumerWidget { capture, SizedBox(height: 12), reference, + SizedBox(height: 12), + quickref, ], ); }, @@ -132,6 +136,36 @@ class _Panel extends StatelessWidget { } } +/// Panel chrome for the lookup surfaces (Reference, Rules): same card, but the +/// body folds away so a 320px viewer doesn't sit open under the live panels. +class _FoldingPanel extends StatelessWidget { + const _FoldingPanel({ + required this.k, + required this.title, + required this.child, + }); + final Key k; + final String title; + final Widget child; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + return Card( + key: k, + child: ExpansionTile( + title: Text(title, style: theme.textTheme.titleSmall), + tilePadding: const EdgeInsets.symmetric(horizontal: 12), + childrenPadding: const EdgeInsets.fromLTRB(12, 0, 12, 12), + expandedCrossAxisAlignment: CrossAxisAlignment.stretch, + shape: const Border(), + collapsedShape: const Border(), + children: [child], + ), + ); + } +} + class _InitiativePanel extends ConsumerWidget { const _InitiativePanel(); @@ -737,7 +771,7 @@ class _QuickRefPanel extends StatelessWidget { const _QuickRefPanel(); @override Widget build(BuildContext context) { - return const _Panel( + return const _FoldingPanel( k: Key('run-panel-quickref'), title: 'Rules', child: SizedBox(height: 320, child: QuickRefView(useProvider: true)), @@ -749,7 +783,7 @@ class _ReferencePanel extends StatelessWidget { const _ReferencePanel(); @override Widget build(BuildContext context) { - return const _Panel( + return const _FoldingPanel( k: Key('run-panel-reference'), title: 'Reference', child: SizedBox(height: 320, child: ReferenceView()),