Add midnight fallback notice, overnight simulations, and keyboard log filter

This commit is contained in:
dwindown
2026-04-07 11:27:39 +07:00
parent 414450125d
commit c1eade84ab
8 changed files with 1989 additions and 1615 deletions

View File

@@ -93,12 +93,14 @@ class _HomeViewState extends ConsumerState<HomeView> {
if (result.synced) {
debugPrint('[AutoSync] Cache refreshed successfully.');
ref.invalidate(todayScheduleProvider);
ref.invalidate(runtimeScheduleProvider);
ref.invalidate(scheduleCacheStatusProvider);
return;
}
if (result.attempted) {
debugPrint('[AutoSync] Refresh attempt failed. Staying on local cache.');
debugPrint(
'[AutoSync] Refresh attempt failed. Staying on local cache.');
}
} finally {
_isAutoRefreshRunning = false;
@@ -211,7 +213,10 @@ class _HomeViewState extends ConsumerState<HomeView> {
BackgroundRotateAction? _matchManualRotateSequence() {
if (_recentKeys.length < 3) return null;
final tail = _recentKeys.sublist(_recentKeys.length - 3).map(_normalizedComboKey).toList();
final tail = _recentKeys
.sublist(_recentKeys.length - 3)
.map(_normalizedComboKey)
.toList();
if (tail[0] == LogicalKeyboardKey.arrowRight &&
tail[1] == LogicalKeyboardKey.arrowRight &&
tail[2] == LogicalKeyboardKey.select) {
@@ -294,14 +299,17 @@ class _HomeViewState extends ConsumerState<HomeView> {
if (previous == null) return;
// TRIGGER 1: Adzan Beep (Fires precisely when transitioning to Adzan)
if (previous.state != ScreenState.adzan && next.state == ScreenState.adzan) {
if (previous.state != ScreenState.adzan &&
next.state == ScreenState.adzan) {
SoundService.instance.playAdzanBeep();
}
// TRIGGER 2: 3-Second Iqomah Countdown
if (next.state == ScreenState.menujuIqomah && next.iqomahRemaining != null) {
if (next.state == ScreenState.menujuIqomah &&
next.iqomahRemaining != null) {
// Play precisely on the tick where it is 3 seconds.
if (previous.iqomahRemaining?.inSeconds != 3 && next.iqomahRemaining!.inSeconds == 3) {
if (previous.iqomahRemaining?.inSeconds != 3 &&
next.iqomahRemaining!.inSeconds == 3) {
SoundService.instance.playIqomahCountdown();
}
}
@@ -319,8 +327,8 @@ class _HomeViewState extends ConsumerState<HomeView> {
if (screenData.isFriday && screenData.nextPrayer?.id == 'dzuhur') {
screen = const JumatScreen(key: ValueKey('jumat'));
} else {
screen = isMainScreen
? const MainScreen(key: ValueKey('main'))
screen = isMainScreen
? const MainScreen(key: ValueKey('main'))
: SlideshowScreen(key: ValueKey('slideshow-$rotationIndex'));
}
break;