feat(engine): one-shot What's-new card after updates (Phase I)
Test / fmt (pull_request) Successful in 5s
Test / test (pull_request) Successful in 5m0s

ObtainX updates install silently, so shipped features went unnoticed.
On the first launch where the running release differs from the new
Settings::last_seen_whats_new, a dismissible card summarises the
latest CHANGELOG.md section (embedded; its top version doubles as the
app's release identity — no build-time version plumbing). Internal
sections are dropped and bullets reduce to their bold lead sentence.

Launch beat: splash -> onboarding (first run) -> what's-new -> Home;
spawn_home_on_launch waits on the new WhatsNewPending resource. Fresh
installs never see the card — onboarding completion stamps the current
version silently. The seen-stamp persists on spawn, not dismissal, so
the card can never nag twice.

8 new tests (changelog parsing incl. the real embedded file, upgrade/
seen/fresh-install gating, dismissal). Workspace + clippy green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-13 18:05:15 -07:00
parent 9a0d6496c5
commit 25f1fd27d9
6 changed files with 550 additions and 1 deletions
+6
View File
@@ -480,6 +480,10 @@ fn persist_last_mode(
/// owns the launch beat; Home appearing underneath it stacked two
/// modals (Phase H fix; spotted in the v0.44.0 emulator smoke). Home
/// spawns on the first frame after the player finishes or skips.
/// * The What's-new card (Phase I) must have had its beat —
/// [`crate::whats_new_plugin::WhatsNewPending`] released — so an
/// upgrade's release notes get read before the mode picker lands on
/// top of them.
/// * `HomeScreen` must not already exist (defensive — e.g. the player
/// pressed `M` between ticks).
/// * `LaunchHomeShown` flips to `true` after the first spawn so this
@@ -494,6 +498,7 @@ fn spawn_home_on_launch(
restore_prompts: Query<(), With<crate::game_plugin::RestorePromptScreen>>,
pending_restore: Option<Res<crate::game_plugin::PendingRestoredGame>>,
onboarding: Query<(), With<crate::onboarding_plugin::OnboardingScreen>>,
whats_new: Option<Res<crate::whats_new_plugin::WhatsNewPending>>,
existing: Query<(), With<HomeScreen>>,
sources: HomeSpawnSources,
mut deal_expanded: ResMut<DealOptionsExpanded>,
@@ -503,6 +508,7 @@ fn spawn_home_on_launch(
|| !restore_prompts.is_empty()
|| pending_restore.as_ref().is_some_and(|p| p.0.is_some())
|| !onboarding.is_empty()
|| whats_new.as_ref().is_some_and(|w| w.0)
|| sources
.settings
.as_ref()