Open Lumen on a responsive bookshelf and land pending story work

- Start the app on a shelf of every installed book instead of the last
  book's home. Cards show the cover, translated metadata, available
  languages, restored patterns and either "Continue reading" or a way in.
- Keep each book's saved route: the shelf is never written to
  flutter_screen, so choosing a book resumes its own leaf.
- Lay the shelf out responsively: dense single-column cards on phones,
  a two-column grid from 720 logical pixels, a centred 860 px column on
  tablets and a chevron that exists in the bundled handwriting font.
- Keep Settings reachable from the shelf and let the home page's story
  library button open the shelf instead of a dialog.
- Add tool/shelf_screenshots_test.dart, which renders the shelf at phone
  and tablet metrics, checks that every card and Settings stay reachable
  without overflow, and writes artifacts/library/shelf-*.png.
- Commit the pending Midnight Invitation package (campaign, notebook,
  narration and artwork), cast drama and ambience tooling, region
  selection, phone/tablet integration coverage and related docs.

flutter analyze is clean and all 74 widget/domain tests pass.
This commit is contained in:
Hadrian Burkhardt
2026-11-05 14:29:50 +01:00
parent d45cd0698a
commit 0718e3f252
149 changed files with 16875 additions and 393 deletions
+30 -1
View File
@@ -8,7 +8,7 @@ import 'book.dart';
import 'library.dart';
import 'puzzle.dart';
enum Screen { home, story, contents, briefing, game, reveal }
enum Screen { library, home, story, contents, briefing, game, reveal }
enum Mode { daily, classic, campaign }
@@ -149,6 +149,35 @@ class Game extends ChangeNotifier {
notifyListeners();
}
/// Claim one of three reading breaks, persisted independently for each book.
/// Existing chapter-ad records count toward the same lifetime cap.
bool claimBookAd(int position, int total) {
final oldCount = List.generate(
book.levels.length,
(i) => i,
).where((i) => progress.flag('storyAd_$i')).length;
final used = List.generate(
3,
(i) => i + 1,
).where((slot) => progress.flag('storyAd_break_$slot')).length;
if (oldCount + used >= 3) return false;
final slot = (position * 3 ~/ total).clamp(0, 3);
if (slot == 0 || progress.flag('storyAd_break_$slot')) return false;
unawaited(progress.set('storyAd_break_$slot', true));
return true;
}
/// The shelf is the app's first window. It is deliberately not written to a
/// story's saved route (`flutter_screen`), so every book keeps its own reading
/// position and the next launch still opens the shelf.
void showLibrary() {
if (library == null) return;
_request++;
busy = false;
screen = Screen.library;
notifyListeners();
}
void home() {
_request++;
busy = false;