feat(engine): ManualSyncRequestEvent + Sync Now button in settings

- Added ManualSyncRequestEvent to events.rs (exported from lib.rs).
- SyncPlugin now handles ManualSyncRequestEvent: if no pull is in
  flight, spawns a new AsyncComputeTaskPool task and sets status to
  Syncing. Ignores duplicate requests while a pull is active.
- Settings panel "Sync" section now shows the status text alongside a
  "Sync Now" button that fires ManualSyncRequestEvent.
- Cleaned up stale doc comment in input_plugin.rs (Esc pause note).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-27 00:03:24 +00:00
parent f7f14efe07
commit 20db4b312a
5 changed files with 77 additions and 11 deletions
+7
View File
@@ -61,3 +61,10 @@ pub struct CardFlippedEvent(pub u32);
/// persistence/UI systems that need unlock metadata.
#[derive(Event, Debug, Clone)]
pub struct AchievementUnlockedEvent(pub AchievementRecord);
/// Request to manually trigger a sync pull from the active backend.
///
/// Fired by the Settings panel "Sync Now" button. `SyncPlugin` responds by
/// starting a new pull task if one is not already in flight.
#[derive(Event, Debug, Clone, Copy, Default)]
pub struct ManualSyncRequestEvent;