Fix home heading clipping and reset notebook page scrolling

This commit is contained in:
Hadrian Burkhardt
2026-11-03 05:05:39 +01:00
parent c6168f46ac
commit 5b9a76fb53
4 changed files with 200 additions and 84 deletions
+103 -81
View File
@@ -407,87 +407,109 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
Widget home() => ColoredBox(
color: cream,
child: SafeArea(
child: SingleChildScrollView(
key: const ValueKey('home-scroll'),
padding: const EdgeInsets.fromLTRB(28, 26, 28, 36),
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 650),
child: column([
folio('L U M E N / AN ISLAND STORY'),
writing('A light to come\nhome to.', size: 40),
Image.asset(
'assets/artwork/home-harbour-v2.png',
height: 220,
fit: BoxFit.contain,
semanticLabel: 'Watercolour of the island at dusk, with the lighthouse and Gran’s cottage.',
child: Column(
children: [
Padding(
padding: const EdgeInsets.fromLTRB(28, 34, 28, 8),
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 650),
child: SizedBox(
width: double.infinity,
child: folio('L U M E N / AN ISLAND STORY'),
),
),
writing(
'Some things are worth keeping. — Gran',
size: 25,
color: const Color(0xff70503b),
),
Cover(onTap: g.openNotebook),
action(
'Open Mara’s notebook · ${g.recoveredCount} / 12',
g.openNotebook,
primary: true,
),
gap(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'${g.streak}\nDAY STREAK',
textAlign: TextAlign.center,
style: hand(18, color: blue),
),
Text(
'${g.solved}\nPATTERNS FOUND',
textAlign: TextAlign.center,
style: hand(18, color: blue),
),
],
),
divider(),
folio('A SMALL DAILY RITUAL'),
writing(
DateFormat('EEEE, d MMMM').format(DateTime.now()),
size: 27,
),
action(
'Play today’s puzzle →',
() => g.startDaily(DateTime.now()),
),
gap(),
folio('BY THE COTTAGE WINDOW'),
writing(
'A few spare pages for practice. For overlapping-area puzzles, follow the notebook’s story.',
size: 22,
color: muted,
),
action('Difficulty · ${g.difficulty.label} ▾', chooseDifficulty),
action(
'Practice · ${g.difficulty.label} · Level ${g.practiceLevel}',
() => unawaited(g.startPractice()),
),
action('How to play', rules),
action('Sound & atmosphere', soundSettings),
action('Privacy & advertising', privacy),
action(
'Open-source licenses',
() =>
showLicensePage(context: context, applicationName: 'Lumen'),
),
gap(),
writing(
'Leave a light in the window.',
size: 26,
color: const Color(0xff70503b),
),
]),
),
),
),
Expanded(
child: SingleChildScrollView(
key: const ValueKey('home-scroll'),
padding: const EdgeInsets.fromLTRB(28, 0, 28, 36),
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 650),
child: column([
writing('A light to come\nhome to.', size: 40),
Image.asset(
'assets/artwork/home-harbour-v2.png',
height: 220,
fit: BoxFit.contain,
semanticLabel: 'Watercolour of the island at dusk, with the lighthouse and Gran’s cottage.',
),
writing(
'Some things are worth keeping. — Gran',
size: 25,
color: const Color(0xff70503b),
),
Cover(onTap: g.openNotebook),
action(
'Open Mara’s notebook · ${g.recoveredCount} / 12',
g.openNotebook,
primary: true,
),
gap(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'${g.streak}\nDAY STREAK',
textAlign: TextAlign.center,
style: hand(18, color: blue),
),
Text(
'${g.solved}\nPATTERNS FOUND',
textAlign: TextAlign.center,
style: hand(18, color: blue),
),
],
),
divider(),
folio('A SMALL DAILY RITUAL'),
writing(
DateFormat('EEEE, d MMMM').format(DateTime.now()),
size: 27,
),
action(
'Play today’s puzzle →',
() => g.startDaily(DateTime.now()),
),
gap(),
folio('BY THE COTTAGE WINDOW'),
writing(
'A few spare pages for practice. For overlapping-area puzzles, follow the notebook’s story.',
size: 22,
color: muted,
),
action(
'Difficulty · ${g.difficulty.label} ▾',
chooseDifficulty,
),
action(
'Practice · ${g.difficulty.label} · Level ${g.practiceLevel}',
() => unawaited(g.startPractice()),
),
action('How to play', rules),
action('Sound & atmosphere', soundSettings),
action('Privacy & advertising', privacy),
action(
'Open-source licenses',
() => showLicensePage(
context: context,
applicationName: 'Lumen',
),
),
gap(),
writing(
'Leave a light in the window.',
size: 26,
color: const Color(0xff70503b),
),
]),
),
),
),
),
],
),
),
);
@@ -1069,8 +1091,8 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
const SizedBox(width: 18),
Expanded(
child: SingleChildScrollView(
key: const PageStorageKey('leaf-side-scroll'),
padding: const EdgeInsets.fromLTRB(2, 0, 2, 8),
key: const ValueKey('leaf-side-scroll'),
padding: const EdgeInsets.fromLTRB(2, 8, 2, 8),
child: column(side),
),
),
+4 -2
View File
@@ -195,8 +195,10 @@ class Leaf extends StatelessWidget {
child: wide
? wideBody!
: SingleChildScrollView(
key: const PageStorageKey('leaf-scroll'),
padding: const EdgeInsets.fromLTRB(4, 0, 4, 8),
// Each newly opened leaf starts at the top, including
// leaves revisited with Previous or a bookmark.
key: const ValueKey('leaf-scroll'),
padding: const EdgeInsets.fromLTRB(4, 8, 4, 8),
child: body,
),
),