Rearrange landscape puzzle layout

Landscape leaves now lay the puzzle out in two columns: the whole grid
keeps one column (square, sized to the page) with the heading, area
totals, hint/undo and notes beside it, and the leaf navigation folds
into a single row. The game leaf also keeps its actions in a compact
bottom bar, so the board and controls are visible without scrolling.

- Leaf gains an optional wideBody used on landscape pages.
- Board gains maxWidth, defaulting to the previous 350.
- Split the puzzle body into area, board and note builders so both
  layouts share the same controls.
- Add a landscape widget regression test and document the layout.

This snapshot also carries the pending 2.0.2 notebook work already in
the tree: read-ahead restore, bundled PCM WAV narration assets, the
audio consistency comment, version 2.0.2+11, and the related unit,
integration and script updates.
This commit is contained in:
Hadrian Burkhardt
2026-10-31 06:21:36 +01:00
parent 302ad6d38e
commit a863b0ca93
22 changed files with 971 additions and 374 deletions
+61 -1
View File
@@ -43,6 +43,16 @@ void main() {
await tester.dragFrom(Offset(width - 12, 300), const Offset(-180, 0));
await tester.pumpAndSettle();
expect(g.storyIndex, 1);
// A normal swipe over the writing must work, not just the edge.
await tester.drag(find.text('By the cottage window'), const Offset(170, 0));
await tester.pumpAndSettle();
expect(g.storyIndex, 0);
await tester.drag(
find.text('For you, when you are ready'),
const Offset(-170, 0),
);
await tester.pumpAndSettle();
expect(g.storyIndex, 1);
expect(
tester
.getBottomRight(find.text('A recorded reading, kept with this page'))
@@ -50,7 +60,7 @@ void main() {
lessThan(tester.getTopLeft(find.text('Contents')).dy),
);
await shot('02-cottage');
// Actual native decoder, all five files. Position must survive pause/resume.
// Actual native WAV playback, all five files. Position must survive pause/resume.
final narrator = Narrator(book.tracks);
for (final id in book.tracks.keys) {
await narrator.toggle(id, 1);
@@ -85,6 +95,14 @@ void main() {
await tester.tap(find.byKey(const ValueKey('cell-0')));
await tester.pumpAndSettle();
expect(g.cells[0], 1);
await tester.tap(find.byKey(const ValueKey('cell-1')));
await tester.pump();
await tester.tap(find.byKey(const ValueKey('cell-1')));
await tester.pumpAndSettle();
expect(g.cells[1], 2);
await shot('03-pencil-marks');
await tap('Undo a mark');
await tap('Undo a mark');
await tap('Undo a mark');
expect(g.cells, before);
await tap('Next leaf →');
@@ -146,6 +164,48 @@ void main() {
expect(g.screen, Screen.reveal);
expect(g.solved, 2);
await shot('07-campaign-reveal');
// The later campaign leaves need swipes too, including read-ahead.
Future<void> swipeWriting(String text, double dx) async {
final target = find.text(text);
await tester.ensureVisible(target);
await tester.drag(target, Offset(dx, 0));
await tester.pumpAndSettle();
}
await swipeWriting('The lantern', 170);
expect(g.screen, Screen.briefing);
await swipeWriting('Something to carry the flame', -170);
expect(g.screen, Screen.reveal);
await swipeWriting('The lantern', -170);
expect(g.screen, Screen.briefing);
expect(g.campaignIndex, 2);
await swipeWriting('Under the loose floorboard', -170);
expect(g.screen, Screen.game);
await tester.ensureVisible(find.byKey(const ValueKey('cell-0')));
await tester.tap(find.byKey(const ValueKey('cell-0')));
await tester.pumpAndSettle();
final keyMarks = List<int>.of(g.cells);
await swipeWriting('Under the loose floorboard', -170);
await tap('Keep solving');
expect(g.screen, Screen.game);
await swipeWriting('Under the loose floorboard', -170);
await tap('Read ahead');
expect(g.screen, Screen.reveal);
expect(g.recovered(2), false);
expect(g.solved, 2);
await shot('08-campaign-read-ahead');
await swipeWriting('The brass key', -170);
expect(g.screen, Screen.briefing);
expect(g.campaignIndex, 3);
await swipeWriting('A direction in the dark', 170);
expect(g.screen, Screen.reveal);
expect(g.campaignIndex, 2);
await swipeWriting('The brass key', 170);
expect(g.screen, Screen.briefing);
await swipeWriting('Under the loose floorboard', -170);
expect(g.screen, Screen.game);
expect(g.cells, keyMarks);
expect(g.solved, 2);
// Exercise real plugin persistence without touching main-app data.
final disk = await Progress.load();
await disk.set('qa_roundtrip', 'notebook-and-audio');