Commit Graph

95 Commits

Author SHA1 Message Date
Robin Kutesa
ff7800588e Fix notification icon: add all explicit iOS icon sizes to asset catalog
Single-size universal entry was not generating 20pt notification sizes.
Added all traditional sizes (20/29/40/60/76/83.5pt) so iOS notification
center finds the pre-baked icon directly.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 03:40:00 +03:00
Robin Kutesa
228607fde6 Add rest timer with toggle — auto-starts after each set when enabled
Floating banner shows circular progress + MM:SS countdown with skip button.
Haptic + system sound fires when timer reaches zero. Duration and on/off
toggle live in Settings → Rest Timer sheet.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 03:30:00 +03:00
Robin Kutesa
0e085f7fec Fix app icon: full orange fill so it's visible in lock screen notifications
Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 03:20:32 +03:00
Robin Kutesa
5596bcbe6f Fix app icon background to orange so it's visible on lock screen notifications
Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 03:00:18 +03:00
Robin Kutesa
f784ef38b3 Fix app icon cropped to fill full 1024x1024, removing dead black border
Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:41:35 +03:00
Robin Kutesa
3bc63119ee Fix: scope task completion toggle to circle only
Wrapping the entire TaskRowView in a Button caused any tap on the row
to mark the task complete. Circle is now the only interactive element.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:37:54 +03:00
Robin Kutesa
43fb8f7036 Fix stale notification count and add deeplink navigation
Evening check-in no longer embeds the urgent task count in the body —
repeating notifications bake that value at schedule time so it always
shows a stale number. Replaced with a generic prompt.

didReceive now routes notification taps via ShortcutHandler:
'workout' deeplink → Workout tab, everything else → Today tab.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:31:41 +03:00
Robin Kutesa
a49d5fea35 Show overdue + today task count on app icon badge
updateBadge() counts all incomplete tasks with a due date earlier
than tomorrow (i.e. overdue or due today) and calls setBadgeCount().
Called inside reschedule() so the badge updates on foreground, task
changes, and workout set completions — same triggers as notifications.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:25:35 +03:00
Robin Kutesa
8f8825ac04 Add tooltip coach mark tutorial for new users
- TutorialManager: tracks 4 steps (NLP, Calendar, Matrix, Workout)
  persisted via AppStorage; shown once then never again
- TutorialView: fullscreen overlay with even-odd spotlight cutout,
  animated accent border, ultraThinMaterial callout card, pill progress
  dots, Next/Get started button, and Skip
- TutorialFrameKey: PreferenceKey collects CGRect for each anchor index;
  .tutorialAnchor() modifier wired to FAB (step 0) and all 4 tab buttons
- Callout auto-positions above or below the spotlight based on screen half
- ContentView collects frames via onPreferenceChange and layers the overlay

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:23:12 +03:00
Robin Kutesa
409b4f8ee6 Mark NotificationManager @unchecked Sendable
Needed because self is captured in @Sendable closures passed to
UNUserNotificationCenter callbacks. Safe: the only mutable state
(isAuthorized) is exclusively written on the main thread.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:03:01 +03:00
Robin Kutesa
fc6d5a91bd Fix all NotificationManager concurrency warnings
- Remove @MainActor from class (caused all Sendable/isolation cascade)
- Keep @MainActor only on reschedule() where VM access is needed
- Snapshot tasks in reschedule() so scheduleTasks() never captures
  a non-Sendable TaskViewModel across async boundaries
- Capture center locally in scheduleTasks() to avoid @MainActor
  property access inside the @Sendable getPendingNotificationRequests callback
- Mark UNUserNotificationCenterDelegate methods nonisolated to satisfy
  protocol conformance without actor crossing

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 02:02:04 +03:00
Robin Kutesa
7b23493f6f Fix MainActor isolation in NotificationManager; var→let in AuthManager
Snapshot WorkoutViewModel's schedule/programs/progress before the
async getNotificationSettings callback so scheduleWorkout receives
plain value types instead of MainActor-isolated properties.
Also fix unused-mutation warning: email in handleApple changed to let.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 01:54:20 +03:00
Robin Kutesa
30382f6f52 Replace hardcoded name/initials with live auth user data
Profile header and ProfileStatsSheet now read displayName and email
from AuthManager.shared instead of hardcoded "Robin Kutesa" / "RK".
Initials are computed dynamically from the user's display name.

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 01:50:37 +03:00
Robin Kutesa
2f08e4a006 Fix build errors: Self.kXxx refs and MainActor isolation
- Remove leftover Self. prefix on instance storage keys in save()
- Mark TaskViewModel and WorkoutViewModel @MainActor so init() can
  safely access AuthManager.shared without isolation violations

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 01:38:19 +03:00
Robin Kutesa
d424a2a814 Clear demo data, namespace storage by user, add profile setup
- Remove all personal sampleTasks from TaskViewModel (tasks start empty)
- Namespace UserDefaults keys by Apple ID for task and workout data isolation
- Add ProfileSetupView for name capture after first Sign in with Apple
- Add updateDisplayName() to AuthManager
- Route to ProfileSetupView when user has no display name yet

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 01:31:55 +03:00
Robin Kutesa
ac7f2d0614 fix: add AuthManager and AuthView to Xcode project target 2026-06-01 01:16:19 +03:00
Robin Kutesa
ea869f51b0 feat: Sign in with Apple authentication
- AuthManager: native AuthenticationServices, session in Keychain
- AuthView: branded screen with Apple Sign In button
- App gates ContentView behind auth; animates on sign-in/out
- Settings: Account section shows name/email + Sign Out button
- Entitlements: added com.apple.developer.applesignin

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-06-01 00:44:02 +03:00
Robin Kutesa
68efa02803 feat: floating tab bar, NLP date parsing, and task date picker
- Tab bar: TickTick-style floating pill (cornerRadius 28, shadow, systemGray5 active highlight)
- NLP: month+day parsing (8th June, June 8), recurrence (every year/week/etc), intent stripping (remind me of)
- Recurrence chip in add-task toolbar; isRecurring saved with task
- Date chip defaults to Today on new tasks; tapping opens full date picker
- Date picker: calendar grid, inline time wheel, Repeat menu (Date tab)
- Duration tab: Start/End column selector, live duration counter, All Day toggle
- TaskItem: added endDate and isAllDay fields
- Fixed hidden Unicode character corrupting + operator in TodayView

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
2026-05-30 23:49:30 +03:00
kutesir
a11258dea5 feat: upcoming section — collapse, 5-item cap, show more
Default view shows the next 5 upcoming tasks. If more exist, a
"N more ↓" button expands the full list; tapping again collapses
back to 5. The section header is tappable to fully hide the list
(only title + count badge remain visible). Collapsed state is
persisted via @AppStorage so it survives app restarts.
2026-05-30 02:42:50 +03:00
kutesir
cab5c4ef05 feat: home screen quick actions (long press app icon)
Adds four UIApplicationShortcutItems registered dynamically at launch:
  • Add Task — opens the add-task sheet immediately, any tab
  • Today — switches to the Today tab
  • Calendar — switches to the Calendar tab
  • Workout — switches to the Workout tab (only registered if the
    workout tab is enabled in settings; re-registers when the setting changes)

Cold-launch and foreground-activation paths both handled via AppDelegate.
ShortcutHandler singleton bridges UIKit callbacks to SwiftUI via @Published.
2026-05-30 02:38:15 +03:00
kutesir
e0e4f709b6 feat: replace day strip with vertical timeline in month view
Selected-day panel below the month grid now renders as a proper vertical
timeline: time labels in the left gutter, continuous track line with
circle markers, and white cards for each item. All-day tasks and events
get a stroke circle; timed entries get a solid colored dot; workout gets
a dumbbell icon; completed items show a checkmark circle with strikethrough.
Tasks can be toggled directly from the timeline card. Cal events show
end time as subtitle. Empty state shows a calendar icon.
2026-05-29 13:51:37 +03:00
kutesir
98eaa9fb27 fix: reduce memory footprint — Canvas for dot grid, scope PreferenceKey
DotGridProgress replaced GeometryReader + 200+ Circle view nodes with a
single Canvas draw call. Canvas receives its own size parameter so no
GeometryReader is needed; SwiftUI interpolates the progress value through
the .animation modifier for smooth fill transitions.

FloatingTabState ScrollYKey made private to TabBarScrollModifier to limit
its PreferenceKey scope and prevent unintended propagation across unrelated
subtrees.
2026-05-29 13:38:52 +03:00
kutesir
875f562801 Add profile stats sheet with task and workout analytics
Tapping the profile card opens a full stats sheet showing:
Tasks — completed this week, overdue count, done rate, 7-day bar
chart, open count by Eisenhower quadrant.
Workouts — streak, sets today, today % progress, weekly schedule
grid (dumbbell = scheduled, checkmark = done), active program summary.
2026-05-29 12:06:34 +03:00
kutesir
27890825d4 Unify workout progress: dot grid in WorkoutView + session sheet
Replace ProgressRingCard in WorkoutView with DotProgressCard using the
same dot grid as the workout session sheet. Remove private from DotRow
so it's accessible across view files.
2026-05-29 11:26:02 +03:00
kutesir
90d0a03eab Fix add-task sheet expanding to full screen on keyboard
iOS auto-snaps to the next larger detent when keyboard appears over a
text field. Removing .large locks the sheet to .height(150) so it
stays compact and hugs the keyboard like the reference app.
Also removed the Description label and reduced input maxHeight to 72pt
so all content fits within the 150pt detent.
2026-05-29 11:18:56 +03:00
kutesir
b6c90a4177 Fix FloatingTabState crash + landscape layout on iPhone
Use UIDevice.userInterfaceIdiom instead of hSizeClass so large iPhones
in landscape keep the iPhone layout. Move tabState environmentObject to
the top-level Group so both layouts always have it in scope.
2026-05-29 11:01:58 +03:00
kutesir
8210cbf487 Add KisaniCal scheme to project.yml 2026-05-29 10:55:43 +03:00
kutesir
28f8b4a0f1 Remove widget extension
Delete KisaniCalWidget target, Shared/WidgetDataStore, WidgetBridge,
App Group entitlements, and all syncWidget() calls.
2026-05-29 10:36:39 +03:00
kutesir
1d4d7f07c5 Add task persistence and per-task reminder notifications
Tasks now survive app restarts via UserDefaults JSON. Each task with a
due time fires a notification at that exact time; date-only tasks fire
at 9am on the due date. Completing or deleting a task cancels its
pending notification. ContentView now reschedules on any task change.
2026-05-29 10:33:55 +03:00
kutesir
bc55d27f45 Fix NL parser: fuzzy tomorrow matching + relative date offsets
Handles tommorow/tomorow/tomarrow misspellings. Adds "in N days",
"in N weeks", and "next week" recognition with numeric and word forms.
2026-05-29 10:23:50 +03:00
kutesir
dc99a3f1f0 fix: widget iOS 17 deployment target + register FloatingTabState
- Widget extension: 16.0 → 17.0 (containerBackground/widget API require 17)
- xcodegen re-run picks up FloatingTabState.swift (was on disk but
  not registered in project.pbxproj after previous xcodegen run)
2026-05-28 20:35:44 +03:00
kutesir
5e232f2d81 feat: add widget extension — small, medium, large
- KisaniCalWidget: 3 sizes sharing the app's design language
  Small: date badge + kisaniCAL. wordmark + task count
  Medium: badge + task list (3 items) + workout row
  Large: badge + full task list (6 items) + workout row

- WidgetDataStore (Shared/): lightweight Codable types for App Group
  UserDefaults cross-process data exchange

- WidgetBridge: TaskViewModel/WorkoutViewModel extensions that sync
  data into App Group and call WidgetCenter.reloadAllTimelines()

- ContentView: calls syncWidget() on appear and scene becoming active

- project.yml + entitlements updated; project regenerated via xcodegen
2026-05-28 19:48:01 +03:00
kutesir
05a579e2f7 feat: replace workout progress bar with dot-grid indicator
7 rows of dots fill left-to-right, top-to-bottom as sets complete.
Filled dots: AppColors.green solid. Empty: green at 12% opacity.
Also: strip emoji from completion banner, tighten copy.
2026-05-28 18:55:09 +03:00
kutesir
e06f15c585 fix: compact AddTaskSheet to 150pt detent, eliminating empty space
Sheet was 500pt tall with ~145pt of content, leaving ~355pt blank.
Dropping to height(150) makes the sheet hug its content and sit flush
above the keyboard like the reference design.
2026-05-28 09:57:41 +03:00
kutesir
ad8b6574fb redesign: replace full calendar grid with compact date badge on splash
88pt badge: accent month strip on top, large day number below.
Wordmark collapsed to single line — kisaniCAL. with orange dot.
2026-05-28 00:43:14 +03:00
kutesir
d33a3d0168 fix: resolve SplashView type-check timeout and DayCell redeclaration
Break SplashCalendarCard body into monthHeader/weekdayRow/dayGrid
computed vars and extract SplashWeekRow to help the type-checker.
Rename DayCell -> SplashDayCell to avoid collision with CalendarView.
2026-05-28 00:38:34 +03:00
kutesir
21bbde8980 fix: register SplashView.swift in Xcode project file
Add PBXFileReference, PBXBuildFile, Views group entry, and
PBXSourcesBuildPhase entry so Xcode compiles the new file.
2026-05-28 00:35:13 +03:00
kutesir
07bc2eee1c feat: add launch splash screen with calendar and kisaniCAL. wordmark
Calendar card animates in with spring, wordmark fades in 280ms later.
Splash fades out at 1.65s and is removed from the view tree at 2s.
2026-05-28 00:29:06 +03:00
kutesir
234ef622f4 fix: resolve Swift phase-1 init errors in WorkoutViewModel
Using self.programs on the RHS of activeSections assignment violated
Swift's two-phase init rule (self is partially initialized). Use local
`migrated` array instead, then assign programs and activeSections in
the correct order.
2026-05-28 00:08:38 +03:00
kutesir
b3f21769ec refactor(design): replace workout emoji icon with segmented section bar
Replace the emoji tile on CalendarWorkoutBlock and WorkoutSessionSheet
header with WorkoutSectionBar — a stack of N horizontal segments, one
per workout section. No emojis, no custom per-program images.
2026-05-28 00:00:46 +03:00
kutesir
e105af147d fix: migrate persisted gamified emojis on load
UserDefaults retained the old 🔥/💥 emojis from before the sample data
was cleaned. On init, replace those emojis in loaded programs and persist
the result so they don't reappear after restart.
2026-05-27 23:55:38 +03:00
kutesir
36191f616f refactor(design): remove gamification — replace emoji icons with progress ring
WorkoutTodayBanner: progress ring replaces emoji cell as the lead
visual. Card background is now surface/border, not blue-tinted.

StreakBannerView: strip gradient, dot trail, and "Don't break the
chain". Replace with clean number + 7-tick week bar.

ProgressRingCard: "Keep going 🔥" / "Workout complete! 🎉" removed;
replaced with "N sets remaining" / "All sets done".

Sample programs: 🔥 Shoulders & Arms -> 🔄, 💥 Full Body -> 🏋️.
Emoji picker: 🔥 replaced with 🫀 (heart/cardio) as last option.
2026-05-27 23:41:15 +03:00
kutesir
1b29fb996f feat(tasks): natural language task input with inline token highlighting
Replace full-form AddTaskSheet with a compact NL input sheet.
Type "meeting today at 1500" — the words "today" and "at 1500"
highlight inline in blue, the toolbar shows "Today, 15:00", and
the mic button becomes a submit arrow when the title is non-empty.

Parser handles: today/tomorrow, weekday names (mon–sun),
times as at 3pm / at 15:00 / at 1500 / 3:30pm.
Clean title strips the date tokens before saving.
Sheet uses height(500) detent so it floats above the keyboard.
2026-05-27 14:58:47 +03:00
kutesir
d7ec351dd4 fix(layout): fix rotation crash and improve iPad split view
iPadLayout was rendering TodayView without workoutVM, crashing with
a fatal EnvironmentObject error on any device where hSizeClass goes
.regular (iPad, iPhone Plus/Max in landscape). Rewrote to use proper
NavigationSplitView with List(selection:) driving the detail column.

Also caches calendarIcon as a static func + @State instead of
recomputing UIGraphicsImageRenderer on every body evaluation.
2026-05-27 14:01:34 +03:00
kutesir
f67429de0b Initial commit: KisaniCal iOS app
Task management, Eisenhower matrix, workout logging with persistence,
and calendar with 6 view modes (Month, List, Year, Week, 3 Day, Day).
Custom floating tab bar, dynamic calendar icon, and workout data seeded.
2026-05-27 02:09:44 +03:00