Commit Graph

411 Commits

Author SHA1 Message Date
ef14b9dc0e HW fix 2026-02-27 23:23:56 +01:00
Pearoo
9238869568 feat: add error page (+pubspec merge fix) 2026-02-27 23:23:56 +01:00
6f04f9e9b8 Tantárgy megjelenítése 2026-02-27 23:23:56 +01:00
b6c8bb3267 grade chart próbálkozgatás 2026-02-27 23:23:56 +01:00
5ef21222aa Hiba fix (-1-es óraszám) 2026-02-27 23:23:56 +01:00
c0a8c696a3 Összátlag 2026-02-27 23:23:56 +01:00
f4a7fe7923 showSubjectBottomSheetSettings belekezdés (?) 2026-02-27 23:23:56 +01:00
c2f3af7be1 Átlagszámláló segéd 2026-02-27 23:23:56 +01:00
3440ea2eef gradeDefault svg hozzáadása 2026-02-27 23:23:56 +01:00
34475f35b0 Update firka/lib/ui/phone/screens/home/home_screen.dart 2026-02-27 23:23:56 +01:00
091647dbe4 chart folytatás 2026-02-27 23:23:56 +01:00
36ca357392 chart megjelenítése 2026-02-27 23:23:56 +01:00
dbbc119fd5 Hiba fix: nincs középen az óraszám 2026-02-27 23:23:56 +01:00
448be1ae10 pici fix 2026-02-27 23:23:56 +01:00
23beb6e31f Extras menü átalakítása dizájn alapján 2026-02-27 23:23:56 +01:00
c122eb4ff9 asszem hiba fix 2026-02-27 23:23:56 +01:00
8568aa5678 Holnapi órák megjelenítése, amennyibe nem lesz dolgozat (Félkész) 2026-02-27 23:23:56 +01:00
12dea89cd4 HTML házinál 2026-02-27 23:23:56 +01:00
67965610ce Óraszámok megjelenítése 2026-02-27 23:23:56 +01:00
7cede065c3 Kéthetes órarend 2026-02-27 23:23:56 +01:00
ae4862a653 Holnapi dolgozat megjelenítése 2026-02-27 23:23:56 +01:00
30f493ddc4 Értékelésnél tantárgy megtekintése gomb 2026-02-27 23:23:56 +01:00
50eb96377e pici szerkesztés 2026-02-27 23:23:56 +01:00
61c795e362 Jegy dátum formázás 2026-02-27 23:23:56 +01:00
7c65a696aa Tantárgy dizájn alapján szerkesztés 2026-02-27 23:23:56 +01:00
a341833441 nyelv 2026-02-27 23:23:56 +01:00
8bf3cc72be Születésnap jelzés konfettivel 2026-02-27 23:23:56 +01:00
33028cdf38 tördelés fix 2026-02-27 23:23:56 +01:00
f01b9d4fd5 License rész javítás 2026-02-27 23:23:56 +01:00
41ff65d50b Dátum formázás javítása 2026-02-27 23:23:56 +01:00
ae9ef1603a added loading spinner, fade out, and matched the color theme to the login page 2026-02-27 23:23:56 +01:00
1d8d341f2d fordítás hozzáadása 2026-02-27 23:23:56 +01:00
633926bf2d Áthúzással jelzés, hogy kész a házi 2026-02-27 23:23:56 +01:00
a6344e42fa dátum formálása fix, showHomeworkBottomSheet hozzáadása 2026-02-27 23:23:56 +01:00
9cb2265a97 Adatbázisba mentés: kész házik 2026-02-27 23:23:56 +01:00
971a35b738 HomeworkDoneModelSchema hozzáadása 2026-02-27 23:23:56 +01:00
69ee75966d SVG hozzáadása 2026-02-27 23:23:56 +01:00
177bf3bf38 generált homework_cache_model_g.dart 2026-02-27 23:23:56 +01:00
5b794b199c Órarend szünet fix (2) 2026-02-27 23:23:56 +01:00
a000481cd9 Órarend fix: Szünetek megjelenítése 2026-02-27 23:23:56 +01:00
ae79a44df9 firka: make android buildable again 2026-02-27 23:23:56 +01:00
Horváth Gergely
70213e376c Refactor timetable day selection and parsing
Add robust date parsing and simplify lesson selection logic. Introduces ISO8601 formatters (with and without fractional seconds) and updates parseNextSchoolDayDate to try both variants, plus existing yyyy-MM-dd fallback. Adds LessonCandidate, startOfDay and nextSchoolDay helpers and builds a sorted candidate list (today, tomorrow, next school day) to pick the appropriate lesson set and correctly set isNextDay/isNextSchoolDay flags. Cleans up previous branching-heavy logic and improves handling of edge cases (lessons finished, next-school-day resolution).
2026-02-27 23:23:56 +01:00
Horváth Gergely
146124228a Improve watch UI and robust language sync
Several watch UI and sync improvements: clamp CountdownRing values and use clamped values for progress/color/display; add optional backgroundColor to FirkaCard and refactor HomeView to use lessonTitleWithStatus, lessonCardBackgroundColor and improved break time calculation and refresh handling (onChange of lastUpdated). TimetableView now shows status icons/colors via helper methods. DataStore now returns a localized "time_now" for recent updates. WatchSessionManager handles Flutter channel/unready states by serving shared language state when available and avoids empty language replies. Dart fixes: await initLang in settings, return null from WatchSyncHelper when uninitialized, and attempt to publish language to watch after initialization in main.
2026-02-27 23:23:56 +01:00
Horváth Gergely
9a99a6869a Use zip to iterate adjacent lessons
Replace index-based loops with zip(entry.lessons, entry.lessons.dropFirst()) in TimetableMediumView and TimetableLargeView to iterate adjacent lesson pairs. This improves readability and safety (avoids manual index arithmetic and potential out-of-bounds issues) while keeping the same break-detection logic.
2026-02-27 23:23:56 +01:00
Horváth Gergely
61953b68d2 Add shared session/language state & refresh leases
Introduce shared session and language state plus cross-device refresh leases to improve Watch/iPhone sync. Adds SharedSessionStateManager, SharedLanguageStateManager and RefreshLeaseManager (keychain-backed) and exposes accessGroup via SharedKeychainManager. Wire shared state into WatchSessionManager (publish/load language and session state, immediate token send via message + userInfo + applicationContext, reachability check, lease-related Flutter handlers) and into WatchConnectivityManager (parse versions, apply immediate token updates). Update DataStore and WatchL10n to reconcile shared session/language state, handle stale account switching, and request tokens from phone when needed. Add TokenManager watch-side lease wrapper for refresh coordination, UI tweaks for pairing/no-token messages and icons, small fixes (date parsing in widget provider, background refresh cadence to ~15 min, time-since localization keys and usage), and various helper utilities for parsing int64 and state versioning.
2026-02-27 23:23:56 +01:00
Horváth Gergely
69dde9281d Send language to Watch and handle locale changes
iOS: Update WatchSessionManager to send the current language via WCSession.default.updateApplicationContext with logging and error handling, in addition to existing transferUserInfo. Dart: await initLang during startup and add dispatcher.onLocaleChanged handler that re-initializes language when the app is in auto-language mode, logs locale changes, and triggers a global UI update.
2026-02-27 23:23:56 +01:00
Horváth Gergely
86c7641c60 Migrate token storage to shared Keychain
Add SharedKeychainManager and migrate token storage from the old iCloud Key-Value (KV) approach to a synchronized Keychain-backed solution. Replace iCloudTokenManager usages across WatchSessionManager, TokenManager, and WatchConnectivityManager, update saveToken API to syncToSharedKeychain, and add KV-store migration logic that moves existing KV entries into the shared Keychain and clears the old KV store. Update entitlements (add keychain-access-groups) for both Runner and the Watch app, add/remove files in the Xcode project, delete iCloudTokenManager.swift. Also include access-group resolution, logging, and compatibility observer methods in the new manager.
2026-02-27 23:23:56 +01:00
Horváth Gergely
71f1412164 Improve token recovery and iCloud probing
Track and surface classified token recovery failures and add a timed iCloud probe to accelerate recovery. TokenManager: introduce lastRecoveryFailure, clearLastRecoveryFailure(), and iCloudProbeTimeoutNs; add probeICloudTokenWithTimeout() and attempt an early iCloud-probe apply before refresh flow; record TokenError results from refresh attempts and abort recovery early on network errors; clear failure on successful actions; default lastRecoveryFailure to .noToken when all attempts fail. KretaAPIClient: clear failure on valid token/recovery success and throw a classified APIError when recovery produced a known TokenError. Overall: better diagnostics, faster iCloud-based short-circuiting, and more robust recovery error handling.
2026-02-27 23:23:56 +01:00
Horváth Gergely
7c344be550 Add robust Apple Watch token sync & force-logout
Improve Apple Watch sync resilience and token safety across iOS and Flutter. Key changes:

- Watch (watchOS): rate-limit phone token requests, handle "force_logout" via applicationContext/userInfo and perform local token deletion/cleanup. Added cooldown tracking.
- iPhone host (Swift): expose Flutter methods to check watch app installation, clear iCloud token, and send force-logout to the watch; refuse to forward expired tokens and avoid using iCloud fallback when Flutter reports reauth needed.
- Flutter (WatchSyncHelper/KretaClient): cache and check whether a paired Watch app is installed before touching iCloud/watch; reject expired access tokens (both incoming and outgoing) and prevent sending expired tokens to watch; added fresh-install cleanup to clear iCloud/local state once per install; added methods to notify watch of forced logout and to clear iCloud token.
- Initialization: run fresh-install cleanup before attempting iCloud recovery and skip recovery if cleanup ran.
- Login/settings/home UI: only attempt watch sync when a watch is installed; clear iCloud token on account removal (iOS); minor UX/timing and formatting cleanups.

These changes prevent propagation of expired tokens, reduce redundant phone/watch messaging, and provide a controlled force-logout flow for account removal or fresh installs.
2026-02-27 23:23:56 +01:00
Horváth Gergely
e620f3e564 Add force account-switch and iCloud recovery
Introduce forced account-switch handling and improve token selection/recovery logic.

- WatchConnectivityManager & ReauthRequiredView: parse sentAtMs robustly and compute a shouldForceAccountSwitch flag when an incoming token is for a different account; pass forceAccountSwitch to TokenManager.saveToken and include it in logs.
- TokenManager: add localTokenFromKeychainAndFile helper, prefer the active account when selecting a local token, and refine loadToken to prefer active-account tokens but fall back to the freshest available. saveToken now accepts forceAccountSwitch and will persist a token even if it switches accounts when requested. Adjust iCloud handling to skip iCloud token only if a local active-account token exists; improve diagnostic logging.
- WatchToken: enhance isNewer comparison to consider effectiveUpdatedAt and tokenVersion before falling back to expiryDate.
- HomeScreen (phone): import watch_sync_helper and run a secondary iCloud recovery pass on startup (with a short delay) to apply a fresher iCloud token to the app state if needed.

These changes aim to make cross-device token sync more robust, correctly handle account switches triggered from the watch, and recover stale auth state from iCloud on app startup.
2026-02-27 23:23:56 +01:00