diff --git a/CLAUDE.md b/CLAUDE.md index 80fe078d..5611c625 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,12 +15,12 @@ The native SwiftUI app in `ios/` is the product and is ahead of the HTML/JS prot ## Layout: native app (`ios/`, the source of truth) Use the [interaction, motion and haptics specification](docs/design/interaction-motion-haptics.md) for gesture ownership, feedback semantics, timing, and acceptance. -- **One page, five lenses: Day · Week · Month · Year · ☑** (`TodayLens` in `HomeView`): a row of pills at the top of the page picks the lens; the ☑ icon pill at the right end is Reminders. There is no top bar and no tab bar: the page starts under the status bar with this row, which hides while a reminders list is pushed. All lenses share one day: Week, Month and Year start from it, and tapping a day there opens it in Day. The last lens survives a restart (not under `-uiTesting`). Day shows the month and year above its week strip; Month shows "December 2026" above its grid (`MonthLabel`). The Today circle in the dock returns to Day, today and Now; it carries a dot when another lens or another day is showing. Clock is not a lens: it opens as a sheet (sidebar → Clock, + → Timer, the Next alarm line, a running timer row) and closes by pulling down. +- **One page, five lenses: Day · Week · Month · Year · Reminders** (`TodayLens` in `HomeView`): a row of pills at the top of the page picks Day/Week/Month/Year; the **+** pill at the right end of that row is the add menu; Reminders opens from the sidebar (sidebar → Reminders). There is no top bar and no tab bar: the page starts under the status bar with this row, which hides while a reminders list is pushed. All lenses share one day: Week, Month and Year start from it, and tapping a day there opens it in Day. The last lens survives a restart (not under `-uiTesting`). Day shows the month and year above its week strip; Month shows "December 2026" above its grid (`MonthLabel`). The Today circle in the dock returns to Day, today and Now; it carries a dot when another lens or another day is showing. Clock is not a lens: it opens as a sheet (sidebar → Clock, + → Timer, the Next alarm line, a running timer row) and closes by pulling down. - **Day** = one day (any day, from Week/Month/Year or from its top week strip, which is Month's own component, `MonthCalendar`, starting folded: swipe sideways for another week, drag or tap its grab handle down for the month grid and up to fold back; it has no other date row; the dock's Today button always returns to Day on today) as one timeline: an "N overdue" line on top with Tidy (opens the Tidy overdue preview), then events, reminders at their due time, alarms and quiet "Free 1 h 30 min" rows. Now is a thin red line across the list with the time in a small red capsule, like Apple Calendar; it takes no row height, and a gap starting now is an ordinary Free row under it. Tapping a Free row opens a sheet of open, non-repeating reminders that could go there (`GapFit`: a length counts only when stated, the 25-minute default is "Length not set"; no gap after a deadline); tapping one makes it due at the gap start (`TaskActions.place`: source commit, ledger, exact Undo), nothing else writes. On today, when reminders are due today with no time, one quiet line under the overdue line says whether the time is there ("“Proposal” needs 1 h 30 min · fits at 14:00", "2 due today · 2 h free, next at 10:00"); tapping it opens that opening's sheet. The list is one flat, time-ordered list with no day-part sections or disclosures; entering Today starts at the top and nothing scrolls by itself. On today a 38 pt time ribbon sits under the week strip (`DayRibbon`, 06–24 or earlier when an item starts earlier), a read-only whole-day overview that works as a scrollbar: events are blue capsules, alarms orange ticks, reminders dots (hollow when repeating), on today finished items are left out (on other days done reminders fade), open past items are red, a red Now line, and a tinted box for the time range of the rows on screen (`TodayTimeline.viewport`), which moves only when the list scrolls. Tapping or dragging the ribbon scrolls the list to that time (a detent haptic per row, a settle haptic on release). A Now chip scrolls to the Now line; VoiceOver adjusts it by an hour. Rows fit in 44 pt at standard text sizes and allow long titles to wrap. A footer counts upcoming items below the viewport and jumps to the first one. On today, finished items (completed reminders, ended events, alarms whose time has passed) disappear at once: they leave the list and the ribbon and do not go to `Settled (N)`, which holds only what the user settled; open past-due reminders stay in the list with a red time and never leave by themselves (`TodayTimeline.isFinished` in TodayCore). Other days start at their first item; a past day shows its history with no red. Reminders due that day with no time sit under "Anytime today". A past day also shows what was done on it, read-only, rebuilt from Activity (`DayHistory`): reminders completed that day at their completion time (also ones deleted since), alarms whose Stop was recorded (green check), and events deleted after they happened; reminders due that day but not done stay open and overdue. **Settle is on today only** (`SettleGate`): a swipe or long-press Settle hides an item from today's timeline, the Up Next card and the widgets without changing its source, into the final `Settled (N)` section, collapsed by default, with Unsettle and Ask AI (Settings → Today → "Show Settle", on; store `TodayFocus` / `TodayFocusStore`, `docs/engineering/today-focus.md`); past and future days have no Settle action and no Settled section, and show every row as if nothing were settled (a past day per `DayHistory`). On today a quiet Health summary by the month heading (steps + sleep by default, Settings → Health summary) opens the **Health sheet**, a compact grouped list of metrics the user picks (Manage Metrics with visibility toggles, Hide, reorder; default steps, sleep, weight; row = value, a date only when it isn't today's, 7-day sparkline, tap for a 7/30/90 day chart; a ··· menu holds Manage Metrics and Browse Health Records; read-only; the sheet, each metric detail, Manage Metrics and Settings → Today have an **Open Health** button into Apple's Health app, `HealthLauncher`, `x-apple-health://`; `HealthMetrics.swift`, `docs/health/metrics-and-density.md`); Tomorrow is viewed by selecting its day in the week strip or Calendar, not through a timeline disclosure; **Week / Month / Year** (`CalendarView`) = Week (a view-only time grid of seven days, the week of the shared day; a swipe pages one week; events are blocks, staggered where they overlap; timed reminders and alarms are one-line chips at their time, extra ones on a crowded hour fold into "+N"; tapping a day header opens it in Day; the gutter top-left holds the week number and a globe button for the second time zone) / Month (grid above a continuous compact agenda like Fantastical: scrolling it selects the day at its top and moves the grid, tapping a day scrolls to it; `MonthAgendaList`; swiping its grab handle up folds the grid into the selected week's strip, down unfolds it, `MonthWeekStrip`) / Year modeled on Apple Calendar (picking a month opens Month); which calendars show is a Setting; past days are dimmed (Setting "Dim past days", on) and weekends have no tint or special colour; first day of the week follows the region unless Settings picks Sunday/Monday (`Calendar.app`); optional week numbers (Month rows; "W43" in the Week gutter). **Reminders** = modeled on Apple Reminders: small pills (wrapping, no cards, no empty band) for the smart lists Today/Scheduled/All/Flagged/Completed (with counts) and pinned lists, kept above the List so each pill has its own long-press menu, My Lists (color + symbol, create/rename/delete, reorder, pin), no Edit button or edit mode anywhere (long-press menu: Rename / Color & Icon / Pin / Delete; press-hold-drag to reorder; trailing swipe via `RowAction`; which smart lists show and their order is in Settings), list screens with an inline New Reminder row (note, date, flag, repeat, suggestions). Two-way sync with Apple Reminders via EventKit (`RemindersSync`, Apple wins on conflict). **Clock** (a sheet, formerly the Clock tab) = modeled on Apple's Clock app: real alarms (`OneAlarm`, AlarmKit) plus items marked "Ring as alarm", split by a switcher into Alarms · World Clock (Overlap-style: home first, time-of-day cards, sideways scrub, overlap chart) · Stopwatch · Timer (Apple-style Timers: hours/minutes/seconds wheels, up to 23 h 59 min, Label/Sound, Recents and running timer rings; Focus and breaks remain as three preset Recents); the selected section shows its icon and name, the others only their icon, and a + at the right adds an alarm (Alarms) or a city (World Clock); no nag-until-done reminders. **Running timers show at the top of Day** (up to 2 live countdown rows + "+N more"; Pause/Resume/Stop by swipe, tap opens Clock → Timer). Under them on today, a quiet **Next alarm** line ("Next alarm · Tomorrow 7:00", or "No alarm on" when no alarm will ring; hidden with no alarms; counts real alarms only, `AlarmPlan.nextAlarm`) opens Clock → Alarms. Today only sees timers it started: timers from the Clock app or Siri's built-in "set a timer" are not readable by any app (`docs/research/timer-siri-sync.md`), so the Timer section says so. - **Alarm time** in the alarm editor is the custom wheel from the alarm wheel lab, version C (`TimeWheelPicker`): minutes in five-minute steps (00, 05 … 55, `AlarmPlan.wheelMinuteStep`); an existing alarm that is not on a five-minute mark keeps every-minute rows, so opening and saving it never moves its minute (`AlarmPlan.minuteStep`). Speed-compressed spacing (version C) applies only to those every-minute rows; the 12 five-minute rows keep fixed spacing. A new alarm opens on the next five-minute mark (`AlarmPlan.nextFiveMinutes`). - **Settings** (sidebar) with a compact Appearance menu row, then sections: Apple Calendar/Reminders/Alarms; Today (alarms, free time, travel time, Health); Calendar (dim past days, first day of week, week numbers, new event alert and length, Event sound); Reminders ("New reminders go to" Auto or a list, Quick-Add Times, Notifications, Reminder sound, Smart Lists); Alarms (new-alarm snooze and sound; the sound follows the last one changed in an alarm editor). Tones are synthesized by `ios/Tools/make_alarm_sounds.py`: 16 alarm tones (28 s, also for timers), 8 short event and 8 short reminder tones (`AlarmSound.Kind`); Default = the system sound; AI (Luna AI account, AI Changes, archive chats); Activity data; Delete All Data. New choices live in `ios/Sources/TodayCore/Preferences.swift` (keys + defaults = the old behaviour, unit-tested) with rows in `SettingsRows.swift`; add a choice only if it changes what the user sees or how the app acts, with the current behaviour as the default. -- **A rightward swipe anywhere** opens the **sidebar**, like ChatGPT/Claude (`DrawerPan`, a window-level pan: from the left edge it always wins; elsewhere content that can still move right keeps the swipe, i.e. a horizontal scroller not at its start such as the week strip or Week paging, and the time ribbon; no menu button; VoiceOver has a hidden "Open menu" button at the top): Search at the top, past AI chats grouped by day (swipe Archive/Delete, long-press Rename, an Archived section; finished chats auto-archive, Settings → "Archive finished chats"), New chat and Settings at the bottom. Search and Clock live in the sidebar (Clock under Search, "Alarms · World Clock · Timer"). **Settings** starts with **Appearance** (a compact row showing the current System / Light / Dark choice with a native menu; default System; `@AppStorage` `today.appearance`, applied at the root with `preferredColorScheme` and to every window's `overrideUserInterfaceStyle` so Apple's event editor matches; widgets and Lock Screen follow the system). -- **Dock**: a floating Liquid Glass capsule holds **+** and a field "Ask or add…"; a separate Liquid Glass circle at the far right holds **Today** (☀, the user's Today button color). **+** is a menu: New Reminder / New Event / New Alarm, then Timer (opens Clock → Timer); the field opens a new chat (VoiceOver "Chat", identifier "Ask AI or add anything"). There are no tab icons and no sideways swipe on the dock. Pulling down on Day or Calendar also opens Chat (`docs/design/pull-to-ask.md`); the field is its visible and VoiceOver equivalent. Chat opens a new chat every time as a full-screen page like ChatGPT (menu to past chats top-left, Close top-right back to the page, composer at the bottom with the keyboard up; Reminder / Event / Alarm buttons above it select a kind for the next message, highlighted, without touching the draft, and open a time panel between them and the composer with the keyboard still up (`AskQuickPanel`, state `AskQuickDraft` in TodayCore): a dark red date bar (tap for a date picker) over a one-tap grid of preset times and ± nudges; Event adds 30 min / 1 h / 2 h / All-day, Alarm uses 06:30–08:00 presets, ± 5–60 min and Once / Weekdays / Daily and always rings within a day. A time typed in the draft moves the bar; the last action, typed or tapped, wins. Send adds the item at once on the device with Added and Undo (principle 1; Preview First keeps the card for Add; no model call, works offline), an alarm even with no label; the chat shows what was typed; the kind's `skill` lives in `AskQuickKind`). The next new chat is built hidden ahead of time (after launch and after each Close) and the keyboard is warmed at launch, so a tap only reveals it, the first tap included. Closing keeps the conversation in the sidebar from its first message; an unsent draft is dropped. A chat opened from the sidebar closes back to the sidebar. The **+** opens the same menu on every lens. New Reminder (and the Home Screen quick action) opens a new chat with Reminder selected, filed in the list on screen; a new event uses Apple's own editor when Calendar access is on, in the calendar Settings → "New events go to" picks. +- **A rightward swipe anywhere** opens the **sidebar**, like ChatGPT/Claude (`DrawerPan`, a window-level pan: from the left edge it always wins; elsewhere content that can still move right keeps the swipe, i.e. a horizontal scroller not at its start such as the week strip or Week paging, and the time ribbon; no menu button; VoiceOver has a hidden "Open menu" button at the top): Search at the top, Reminders and Clock under it, past AI chats grouped by day (swipe Archive/Delete, long-press Rename, an Archived section; finished chats auto-archive, Settings → "Archive finished chats"), New chat and Settings at the bottom. Search and Clock live in the sidebar (Clock under Search, "Alarms · World Clock · Timer"). **Settings** starts with **Appearance** (a compact row showing the current System / Light / Dark choice with a native menu; default System; `@AppStorage` `today.appearance`, applied at the root with `preferredColorScheme` and to every window's `overrideUserInterfaceStyle` so Apple's event editor matches; widgets and Lock Screen follow the system). +- **Dock**: a floating Liquid Glass capsule holds the field "Ask or add…"; a separate Liquid Glass circle at the far right holds **Today** (☀, the user's Today button color). **+** (top right of the page) is a menu: New Reminder / New Event / New Alarm, then Timer (opens Clock → Timer); the field opens a new chat (VoiceOver "Chat", identifier "Ask AI or add anything"). There are no tab icons and no sideways swipe on the dock. Pulling down on Day or Calendar also opens Chat (`docs/design/pull-to-ask.md`); the field is its visible and VoiceOver equivalent. Chat opens a new chat every time as a full-screen page like ChatGPT (menu to past chats top-left, Close top-right back to the page, composer at the bottom with the keyboard up; Reminder / Event / Alarm buttons above it select a kind for the next message, highlighted, without touching the draft, and open a time panel between them and the composer with the keyboard still up (`AskQuickPanel`, state `AskQuickDraft` in TodayCore): a dark red date bar (tap for a date picker) over a one-tap grid of preset times and ± nudges; Event adds 30 min / 1 h / 2 h / All-day, Alarm uses 06:30–08:00 presets, ± 5–60 min and Once / Weekdays / Daily and always rings within a day. A time typed in the draft moves the bar; the last action, typed or tapped, wins. Send adds the item at once on the device with Added and Undo (principle 1; Preview First keeps the card for Add; no model call, works offline), an alarm even with no label; the chat shows what was typed; the kind's `skill` lives in `AskQuickKind`). The next new chat is built hidden ahead of time (after launch and after each Close) and the keyboard is warmed at launch, so a tap only reveals it, the first tap included. Closing keeps the conversation in the sidebar from its first message; an unsent draft is dropped. A chat opened from the sidebar closes back to the sidebar. The **+** opens the same menu on every lens. New Reminder (and the Home Screen quick action) opens a new chat with Reminder selected, filed in the list on screen; a new event uses Apple's own editor when Calendar access is on, in the calendar Settings → "New events go to" picks. - **Gestures follow Apple**: tap the circle to complete; swipe right-to-left for actions, the same look everywhere (`RowActions`: Delete red and rightmost, full swipe deletes with an Undo toast; deleting a reminder, alarm or one-off event without attendees never asks first (Undo is the safety net; a full swipe on an event with attendees opens the confirmation, because Undo cannot recall its cancellation); Flag, Archive, Pin); long-press menu (a hold that stays still; on a movable Today row a hold that moves drags it instead, `TimelineHoldDrag`, and tapping its time label opens the exact-time editor; Ask AI first, then Show Details / Flag / Today / Tomorrow / Unschedule / Delete; Ask AI (also on Settled rows) opens a new chat about that item, `AskSubject`: "it" means the item and the model is told its title and facts); a repeating event asks "this event or the series?" before Delete; Apple Calendar events open in Apple's own Edit Event (every Apple field: calendar, alerts, travel time, invitees; `NativeEvents.edit`); shake to undo. Nothing is moved by drag in the Week grid; events are fixed and a reminder's date changes from its menu or editor. - **AI**: the agent architecture is the AI (`docs/engineering/ai-agent-architecture.md`, P4, no flag): a rules-only fast lane (`FastLane`: the clear one-off reminder, continuation answers to its own draft, attached-item edits) runs first, everything else goes to one on-phone agent loop (`AgentRunner` → `ModelClient` → the hosted Luna model, `gpt-6-luna` behind `backend/luna` `/v1/responses` agent mode) with typed tools (`AgentPlannerTools`) whose writes are proposals tiered by code (`ActionPolicy`), shown as cards and applied by Ask right after the reply when the tier is `direct` (principle 1); there is no Foundation Models call. Offline or not signed in to Luna AI, FastLane still adds reminders, events and alarms it is sure of (`FastLane.localPreview`), Tidy keeps working, and anything else says the AI is unavailable and keeps the draft. TodayMock is "not signed in" unless `-uiTestingAgentScript ` plays a `ScriptedModelClient` fixture (`ios/Development/Support/AgentScripts.swift`). One line can add several items at once (`CaptureStack`); a follow-up ("make it 4pm") edits what was just added; agent edits to existing items ("move the dentist to 4") show an agent change card (before → after, consequences, Applied, Undo). "Tidy overdue" gives each overdue reminder a new date (`OverdueTidy`, keeping its time) with Undo. What stays manual is listed in principle 1. A capture card stays in the chat (`CardStatus`: Added with Undo and Open, Dropped, Undone with Add again; decided cards are saved with the thread, `StoredCard`), under the AI message that added it. The empty Ask page has no suggestion chips (the old rule/model chips were removed in P4); a new chat opens with one rule-built, read-only butler greeting line about the day (`ButlerGreeting`, `docs/design/pull-to-ask.md`). - **Widgets** (`ios/TodayWidgets`): Next Up on the Lock Screen and Home Screen, fed by a JSON snapshot in the App Group (`WidgetFeed`), leaving out what is settled today like the Up Next card. Lock Screen rectangular shows the next item only (time line + live timer + "+N", title on two lines; `ios/Sources/TodayShared/LockScreenNext.swift`); Home Screen small/medium keep their lists. **Up Next Live Activity** (`ios/TodayWidgets/UpNextLiveActivity.swift`, `UpNextLive.swift`, `UpNextActivity.swift`): a quiet Lock Screen card with up to three timed items in the next 3 hours by default (Settings → Today → Customize Up Next: 1–4 hours, 1–3 items, events / reminders / alarms), leaving out what is settled today (time and title only, no card when there are none, never an alert). Updated locally on foreground, data changes and background refresh; no push. Settings → Today → "Up Next on Lock Screen", on by owner decision (2026-11-08); a Lock Screen dismissal holds for that calendar day. diff --git a/ios/README.md b/ios/README.md index b644485b..e1644fa6 100644 --- a/ios/README.md +++ b/ios/README.md @@ -109,11 +109,11 @@ Phone delivery acceptance must record the exact source/artifact, device/OS and L ## What's in the app -One page with a row of lens pills at the top: **Day · Week · Month · Year**, and a ☑ icon pill at the right end for **Reminders** (`TodayLens` in `HomeView`; the row hides while a reminders list is pushed). All lenses share one day: Week, Month and Year start from it and tapping a day there opens it in Day. The last lens survives a restart. The dock at the bottom is a floating Liquid Glass capsule with **+** and an "Ask or add…" field, and a separate glass circle at the far right, **Today** (☀), which returns to Day, today and Now; a dot on it means another lens or another day is shown. **+** opens New Reminder / New Event / New Alarm, then Timer; the field opens chat, also available by pulling down. A rightward swipe opens the sidebar (content that can still scroll right, like the week strip, keeps its own swipe). Day shows the month and year above the week strip; Month names the committed page with month and year, and Year the top visible year (`MonthLabel` in TodayCore). **Clock** is not a lens: it opens as a sheet and closes by pulling down. +One page with a row of lens pills at the top: **Day · Week · Month · Year**, and a **+** pill at the right end (`TodayLens` in `HomeView`; the row hides while a reminders list is pushed). **Reminders** is the fifth lens and opens from the sidebar. All lenses share one day: Week, Month and Year start from it and tapping a day there opens it in Day. The last lens survives a restart. The dock at the bottom is a floating Liquid Glass capsule with an "Ask or add…" field, and a separate glass circle at the far right, **Today** (☀), which returns to Day, today and Now; a dot on it means another lens or another day is shown. **+** opens New Reminder / New Event / New Alarm, then Timer; the field opens chat, also available by pulling down. A rightward swipe opens the sidebar (content that can still scroll right, like the week strip, keeps its own swipe). Day shows the month and year above the week strip; Month names the committed page with month and year, and Year the top visible year (`MonthLabel` in TodayCore). **Clock** is not a lens: it opens as a sheet and closes by pulling down. - **Day** — one day, with Month's week strip above it (the same `MonthCalendar`, starting folded and remembered per scene: tap any day, swipe sideways one week at a time, drag or tap the grab handle down for the month grid and up to fold back; first day of the week follows Settings): a red "N overdue" line above the timeline (tap to show the rows; **Tidy** beside it opens the Tidy overdue preview in a sheet, Apply with Undo), all-day events, due today, and the timeline with a "now" line. The timeline is one flat, time-ordered list with no day-part sections. It scrolls normally (with the month grid open, `MonthFold` insets the agenda by the grid's extra height so its end clears the bottom buttons); entering Today starts at the top and nothing scrolls by itself. On today a time ribbon (`FeatureToday/DayRibbon.swift`, `today.ribbon`) sits under the week strip as a read-only whole-day overview that works as a scrollbar: a tinted box marks the time range of the rows on screen and follows the list's scrolling; tap or drag it to scroll the list to that time (detent and settle haptics). The `today.ribbon.now` chip scrolls to the Now line. On today, completed reminders, ended events and passed alarms disappear at once from the list and the ribbon (they do not go to `Settled (N)`, which holds only what the user settled); open past-due reminders keep a red time in the list and never leave by themselves (`TodayCore/TodayTimeline.swift`, tested in `TodayTimelineTests`). Rows are one line. Tapping a Week day header or a day in Month opens it here; the dock's **Today** circle always returns to Day on today, from any lens or day. Overdue always shows (never hidden or moved silently); Settings can hide alarms. On today, a quiet health line sits on top ("6,240 steps · slept 7 hr 12 min", read-only from Apple Health; Settings → Today → Health summary; HealthKit access is asked the first time it would show, for the metrics the line uses; sample data under `-uiTesting` and on the simulator). Tap it for the **Health sheet**: a compact list of the metrics you chose in your order, each row the latest value (a quiet date only when it isn't today's) and a grey 7-day sparkline with the latest reading in colour; tap a row for a 7 / 30 / 90 day chart with average, low, high and the change against the days before (facts only, no generated text). Defaults are steps, sleep and weight; the sheet's **···** menu holds **Browse Health Records** and **Manage Metrics**, which lists every supported metric with a visibility toggle (shown metrics start on, hidden metrics off); Done or dismissing the sheet saves the choice, preserving existing row order and asking Health only for newly shown types; swipe a row to **Hide** it (nothing is deleted from Health), long-press for Hide / Move Up / Move Down; Customize in Manage Metrics drags any metric to any position. The choice and order is the only thing saved (`today.health.metrics`); Health values stay in memory. If steps or sleep is hidden, the Today line uses the first two shown metrics. Settings → Today → Health metrics opens the same sheet. Today is the simplest entry, not a replacement: the sheet, every metric detail, Manage Metrics and Settings → Today each have a quiet **Open Health** button (`health.open`) that opens Apple's Health app (`HealthLauncher.url`, `x-apple-health://`, its home page; no per-metric deep link exists); if iOS refuses, the label says "Couldn't open Health" for a moment. UI tests: `-uiTestingHealthMetrics steps,weight` seeds the choice, `-uiTestingKeepHealthMetrics` keeps it across a relaunch. Free rows are tappable (`today.freeRow`): a sheet (`FeatureToday/FreeTimeSheet.swift`) lists open, non-repeating reminders that could go there, from `TodayCore/GapFit.swift` (stated lengths fit or count as too long; the 25-minute default is unknown; overdue, then nearest deadline, then undated; never a gap after the deadline), and a tap makes the reminder due at the gap start through `TaskActions.place` (Apple Reminders commit, `.redated` ledger row, exact Undo). On today a quiet conclusion line (`today.deadlineLine`) covers reminders due today with no time: the next opening for a stated length, or the free time left; it opens the same sheet. Opening either records `ui.screen.open` usage (`today.freeRow` / `today.deadlineLine`). Tests: `GapFitTests`. To view tomorrow, select its day in the week strip, Week or Month; there is no Tomorrow disclosure in the Today timeline. A reminder on Today has the usual long-press menu (Flag / Today / Tomorrow / Unschedule) plus Settle, and a Tomorrow swipe. Settle exists only on the current day (`SettleGate` in TodayCore): it hides an item from today's timeline into the final `Settled (N)` section (`focus.settled`), collapsed by default and expandable in place (Unsettle, Ask AI, Delete); its source is unchanged and the choice ends with the local day. Past and future days have no Settle action and no Settled section and show every row, including one settled earlier (a past day as `DayHistory` shows it). Settings → Today → "Show Settle" (on) hides the action and section. Store: `TodayFocus` / `TodayFocusStore`, a small JSON file next to the Activity store (`docs/engineering/today-focus.md`). Files: `TodayHealthLine.swift`, `HealthView.swift`, `OpenHealthButton.swift` (+ `HealthLauncher.swift`), `HealthMetricDetail.swift`, `HealthMetricPicker.swift`, `HealthSparkline.swift`, `HealthModel.swift`, `HealthSource.swift` (+ `HealthKitSource.swift`), `HealthMetrics.swift` (catalog, selection, formatting, sparkline and range math, unit-tested), `HealthSampleSeries.swift`, `HealthLogic.swift`. Tests: `HealthReviewTests`, `HealthMetricsTests`; design note `docs/health/metrics-and-density.md`; screenshots in `docs/qa/health-review/` (`TEST_RUNNER_HEALTH_SHOTS=1`). - **Week / Month / Year** — lenses modeled on Apple Calendar (`CalendarView`): Week (a time grid of the seven days of the shared day's week, one week per swipe), Month (grid above a continuous, compact agenda of day sections in the style of Fantastical: a coloured dot for events, a square for reminders, the alarm symbol for alarms, a small time line over a title of up to two lines and a one-line location; scrolling the agenda selects the day at its top and moves the grid to its month, and tapping a grid day scrolls the agenda to it; `MonthAgendaList`, `MonthAgenda`; a grab handle under the grid folds it, with a spring, into the selected day's week (`MonthWeekStrip`): swipe the handle up for the week strip, down for the month, tap it to toggle; the strip swipes sideways one week at a time and keeps the selected weekday, and the choice is kept per scene across lens switches) and Year. Tapping any day in Year opens Month with that exact date selected and its items below the grid; tapping a month title keeps the usual landing day (today in the current month, otherwise the first). Week headers and a second tap on a selected Month day open that day in Day. Which calendars show is chosen in Settings. With Calendar access on, + opens Apple's own event editor and system events open in Apple's viewer. Events are fixed, and nothing is dragged in Week. Events are blocks: ones that start together share the width, one that starts while another is on is indented and drawn over it (Apple's stagger). Reminders with a time and alarm rings are one-line chips at their time (circle or alarm symbol and the title; tap opens, long-press has the usual menu); on a crowded hour the extra ones fold into a "+N" menu, and beside an event the chip takes the right half (`CalendarLayout.timedDay`, unit-tested). Days that are over show in light grey in Month and Week (and the agenda fades finished events) unless Settings → Calendar → Dim past days is off. Weekends have no tint or colour of their own. First day of the week follows the iPhone's region unless Settings picks Sunday or Monday (`Calendar.app`, used by `CalendarMath`); Show week numbers adds a column in Month and "W43" in the Week gutter, under a globe button that opens Second Time Zone. -- **Reminders** (the ☑ lens) — modeled on Apple Reminders: small wrapping pills for the smart lists (Today, Scheduled, All, Flagged, Completed) with counts, then pinned lists (long-press a pill: Hide, or the list menu); My Lists with color and symbol, Add List. No Edit button: press and hold a list for Rename / Color & Icon / Pin / Delete, press, hold and drag to reorder, swipe from the right for Delete / Info / Pin. Settings picks and orders the smart lists (a pill's long-press menu can also hide one). A list screen has a big colored title, a collapsed Completed section and an inline **New Reminder** row (note, date, flag and repeat buttons, suggestions). Two-way sync with Apple Reminders through EventKit (`RemindersSync`): Apple wins on conflict, nothing is written before you connect, a pass never deletes more than 10 Apple items, planned time stays local. +- **Reminders** (the lens opened from the sidebar) — modeled on Apple Reminders: small wrapping pills for the smart lists (Today, Scheduled, All, Flagged, Completed) with counts, then pinned lists (long-press a pill: Hide, or the list menu); My Lists with color and symbol, Add List. No Edit button: press and hold a list for Rename / Color & Icon / Pin / Delete, press, hold and drag to reorder, swipe from the right for Delete / Info / Pin. Settings picks and orders the smart lists (a pill's long-press menu can also hide one). A list screen has a big colored title, a collapsed Completed section and an inline **New Reminder** row (note, date, flag and repeat buttons, suggestions). Two-way sync with Apple Reminders through EventKit (`RemindersSync`): Apple wins on conflict, nothing is written before you connect, a pass never deletes more than 10 Apple items, planned time stays local. - **Clock** (a sheet, opened from the sidebar's Clock row, + → Timer, a running timer row or Day's Next alarm line; its first section is Alarms, then World Clock, Stopwatch, Timer) — the Alarms section is modeled on the Alarms tab of Apple Clock: big light times with AM/PM, green switches, "Next alarm in …", Add/Edit Alarm sheet (wheel, Repeat, Label, Sound from 16 bundled alarm tones, Snooze, Snooze Duration). Every alarm is a real AlarmKit alarm that rings through Silent and Focus; items you marked "Ring as alarm" follow in their own section. AlarmKit only shows alarms this app scheduled: Apple's own Clock alarms cannot be read. The first time Alarms opens, a card says alarms are set in Today now (+, "Hey Siri, set an alarm in Today", the chat) and how to bring Clock alarms over once: the user's own Shortcut runs Clock's "Get All Alarms" and Today's **Import Alarm** (`AlarmImportIntent.swift`), which only stages them (`AlarmImport`, unit-tested); they show under "From the Clock app" to Add one by one or all, or Skip. Shown once (`Preferences.alarmIntroSeenKey`; UI tests opt in with `-uiTestingAlarmIntro` and seed staged alarms with `-uiTestingStagedClockAlarms`). Nothing syncs with Clock afterwards. A switcher at the top splits the sheet like Clock: **Alarms · World Clock · Stopwatch · Timer**; the selected section shows its icon and name, the others only their icon, and a + at the right adds an alarm (Alarms) or a city (World Clock). The last section is kept across restarts. **World Clock** is modeled on the app Overlap: home (the device's time zone, starred) first, then your cities as cards tinted by the time of day there (night indigo, morning/evening blue, working hours 9–18 green) with "+N hrs · weekday, date"; drag sideways to move every clock in one-minute steps without haptic feedback (the capsule at the bottom says "3 hours from now", tap it for Now); Overlap shows a wave of who is working and the hours everyone overlaps; no Edit button: long-press a city for Move Up / Move Down / Delete, or press, hold and drag to reorder; + adds a city from a searchable list. **Stopwatch** like Clock's (Lap/Reset, Start/Stop, best lap green, worst red) keeps running when the sheet closes and across relaunches (it stores its start date). **Timer** uses Apple-style Timers with three wheels, Recents and running timer rings. Logic: `ClockLogic.swift` (unit-tested). - **Timers** — the Timer section of the Clock sheet: a large Timers title, hours/minutes/seconds wheels (timer limit 23 h 59 min), round Clear and Start buttons, Label and Sound, Recents (tap a row to load its duration, play to start immediately, swipe to delete), and running timers with Pause / Resume and Cancel. Multiple timers run side by side. Before you have your own recents, Focus 25 / Short break 5 / Long break 15 appear as presets; a matching Focus countdown counts a round only when it runs out. One Focus/break timer runs at a time alongside other timers. A quiet "Focus rounds today" caption appears after a completed round and resets at midnight. The Pomodoro dial, chips and next-step controls are replaced by these rows. Logic: `TimerRecents.swift`, `TimerList.swift`, `Pomodoro.swift` (unit-tested). - **+ (in the dock)** — the same menu on every lens: New Reminder / New Event / New Alarm, then Timer (opens Clock → Timer). New reminder opens a new chat with Reminder selected: type what, set when with one tap on the time panel above the composer (times of day, +/− nudges, or the date picker behind the date bar), Send adds it with Undo. Editing a reminder opens the full editor. diff --git a/ios/Sources/TodayShell/HomeView.swift b/ios/Sources/TodayShell/HomeView.swift index 5dba3946..e3fb56e9 100644 --- a/ios/Sources/TodayShell/HomeView.swift +++ b/ios/Sources/TodayShell/HomeView.swift @@ -153,6 +153,10 @@ PerformanceTrace.shared.beginPage("search") showsSearch = true }, + onReminders: { + select(.lists) + drawer.set(open: false) + }, onClock: { openClock(clockSection) }, onSettings: { PerformanceTrace.shared.beginPage("settings") @@ -574,7 +578,7 @@ } } - /// Day · Week · Month · Year, and Reminders as a checklist pill at the right end. + /// Day · Week · Month · Year, and + at the right end. Reminders opens from the sidebar. private var lensRow: some View { ViewThatFits(in: .horizontal) { lensPills(fixed: true) @@ -593,28 +597,21 @@ ) { select(item) } } if fixed { Spacer(minLength: 0) } - listsPill + addPill } .padding(.horizontal, 20) } - private var listsPill: some View { - let selected = lens == .lists - return Button { - select(.lists) - } label: { - Image(systemName: "checklist") + private var addPill: some View { + plusButton { + Image(systemName: "plus") .font(PillStyle.Control.font) .frame(width: PillStyle.Control.height + 10, height: PillStyle.Control.height) - .background(PillStyle.fill(selected: selected), in: Capsule()) - .foregroundStyle(PillStyle.text(selected: selected)) + .background(PillStyle.fill(selected: false), in: Capsule()) + .foregroundStyle(PillStyle.text(selected: false)) .frame(minHeight: PillStyle.tapHeight) .contentShape(Rectangle()) } - .buttonStyle(PressScale()) - .accessibilityLabel(TodayLens.lists.title) - .accessibilityAddTraits(selected ? .isSelected : []) - .accessibilityIdentifier("today.lens.lists") } private var main: some View { @@ -794,17 +791,14 @@ } } - /// + and the "Ask or add…" field share one glass capsule; the Today circle sits beside it. + /// The "Ask or add…" field in a glass capsule; the Today circle sits beside it. private var dock: some View { GlassEffectContainer(spacing: 10) { HStack(spacing: 10) { - HStack(spacing: 0) { - plusButton - askField - } - .padding(.horizontal, 5) - .frame(height: 56) - .glassEffect(.regular, in: Capsule()) + askField + .padding(.horizontal, 5) + .frame(height: 56) + .glassEffect(.regular, in: Capsule()) todayButton .glassEffect(.regular.interactive(), in: Circle()) @@ -855,7 +849,7 @@ .font(.body) .foregroundStyle(.secondary) .lineLimit(1) - .padding(.leading, 4) + .padding(.leading, 14) .frame( maxWidth: .infinity, minHeight: ButtonConfiguration.minimumHitSize, alignment: .leading ) @@ -927,7 +921,7 @@ } /// + is the same menu everywhere: a reminder, an event or an alarm, then Timer in Clock. - private var plusButton: some View { + private func plusButton(@ViewBuilder label: () -> PlusLabel) -> some View { Menu { Button { newReminder() @@ -951,12 +945,7 @@ Label("Timer", systemImage: "timer") } } label: { - Image(systemName: "plus") - .font(ButtonConfiguration.Icon.font) - .frame( - width: ButtonConfiguration.minimumHitSize, height: ButtonConfiguration.minimumHitSize - ) - .contentShape(Rectangle()) + label() } .tint(.primary) .accessibilityIdentifier("New") diff --git a/ios/Sources/TodayShell/Sidebar.swift b/ios/Sources/TodayShell/Sidebar.swift index dd9d9c3f..3e147e49 100644 --- a/ios/Sources/TodayShell/Sidebar.swift +++ b/ios/Sources/TodayShell/Sidebar.swift @@ -13,13 +13,14 @@ /// Left drawer, like the ChatGPT / Claude iOS apps: most of the screen, with the page peeking out on the right, the list of /// past conversations with the AI (newest first, grouped by day), Search at the top, and New chat and Settings at the bottom. - /// Clock (Alarms · World Clock · Timer) opens from here as a sheet; Day, Week, Month, Year and Reminders are on the page's top row. + /// Reminders and Clock (Alarms · World Clock · Timer, as a sheet) open from here; Day, Week, Month and Year are on the page's top row. struct Sidebar: View { let drawer: DrawerModel let width: CGFloat var onNewChat: () -> Void var onOpen: (ChatThread) -> Void var onSearch: () -> Void + var onReminders: () -> Void var onClock: () -> Void var onSettings: () -> Void /// Opens Activity (the ledger of changes) over the sidebar, like Settings. @@ -38,6 +39,9 @@ var body: some View { VStack(alignment: .leading, spacing: 0) { header + SidebarRow(icon: "checklist", title: "Reminders", action: onReminders) + .accessibilityIdentifier("sidebar.reminders") + .modifier(DrawerDrag(model: drawer, width: width)) SidebarRow( icon: "clock", title: "Clock", subtitle: "Alarms · World Clock · Timer", action: onClock )