Skip to content

Redesign iOS Calendar UX: Trakt-style glass nav card - #24

Merged
Quick104 merged 2 commits into
mainfrom
feature/ios-calendar-ux
Jun 25, 2026
Merged

Quick104 merged 2 commits into
mainfrom
feature/ios-calendar-ux

Conversation

@Quick104

@Quick104 Quick104 commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

What & why

The iOS Calendar tab's controls were cramped and heavy. The Following/Trending/All segmented control read as cut-off loose text against the black background (its glass capsule was invisible there), and the filter + week strip were both pinned on top of the title bar — three frozen bands that ate the top of the screen and left almost nothing scrolling.

This reworks the phone layout around a single Trakt-inspired floating glass calendar card plus a contained scope control. The tvOS focus paths are deliberately left untouched.

Changes

  • CalendarFilterBar — iOS now renders a contained segmented control: a visible track with a near-white pill that slides between segments (matchedGeometryEffect), so it no longer looks clipped. tvOS keeps its glass + focus chrome.
  • CalendarView — removed the standalone "Calendar" title bar and folded its search / profile actions (and the iPad sidebar toggle) into the floating card's top row to reclaim that vertical space. The card uses Liquid Glass (.siloGlass) and rides the scroll view's top safe-area inset, so the agenda refracts under it as it scrolls. The scope control scrolls away with the content; only the card pins.
  • CalendarWeekStrip — iOS week cells are now Trakt-style: weekday / boxed day number / event-count badge (selected fills the box, today outlines it), flanked by prev/next chevrons. tvOS strip unchanged.
  • Fix "Today" — from another week it now awaits the current-week reload and scrolls to today's shelf (mirroring a day-strip tap) instead of dumping the user at the top of the week. goToToday() is now async.

Reviewer notes

  • Monochrome by design: there's no brand accent, so Trakt's purple "today" highlight becomes a near-white outline; the card uses continuumSurfaceElevated/Liquid Glass.
  • The "Today" scroll uses a 50ms beat after reload to let the new week's shelves lay out before scrollTo — flagged in case it needs tuning on slow loads.
  • Scope: only the four Screens/Calendar/ files. Built green on the Silo (iOS) and SiloTV (tvOS) schemes; not yet verified on macOS (SiloMac shares the iOS layout path).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Refreshed the calendar UI with a pinned “glass” week strip and a smoother, more space-efficient agenda layout.
    • Added a Trakt-style week navigator on iOS/macOS with rich day cells and event-count badges.
  • Bug Fixes
    • Improved the “Today” action to reliably navigate and scroll to the current day after data loads.
    • Enhanced TV focus behavior and consistent week-strip interaction styling across platforms.

The Calendar tab's controls were cramped and heavy: the Following/Trending/All
segmented control read as cut-off loose text against the black background (its
glass capsule was invisible there), and the filter + week strip were both pinned
on top of the title bar — three frozen bands that ate the top of the screen and
left almost nothing scrolling.

This reworks the phone layout around a single Trakt-inspired floating calendar
card and a contained scope control, keeping the tvOS focus paths untouched.

- CalendarFilterBar: iOS now renders a contained segmented control — a visible
  track with a near-white pill that slides between segments (matchedGeometry) —
  so it no longer looks clipped. tvOS keeps its glass + focus chrome.
- CalendarView: removed the standalone "Calendar" title bar; folded its search /
  profile actions (and the iPad sidebar toggle) into the floating card's top row
  to reclaim that vertical space. The card uses Liquid Glass (.siloGlass) and
  rides the scroll view's top safe-area inset, so the agenda refracts under it as
  it scrolls. The scope control scrolls away with the content; only the card pins.
- CalendarWeekStrip: iOS week cells are now Trakt-style — weekday / boxed day
  number / event-count badge (selected fills the box, today outlines it), flanked
  by prev/next chevrons. tvOS strip unchanged.
- Fix "Today": from another week it now awaits the current-week reload and
  scrolls to today's shelf (mirroring a day-strip tap) instead of leaving the
  user at the top of the week. goToToday() is now async.

Builds green on the Silo (iOS) and SiloTV (tvOS) schemes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cda1a393-9bf4-4781-b826-2b7b16d197c4

📥 Commits

Reviewing files that changed from the base of the PR and between 0e7ea3d and 0eade24.

📒 Files selected for processing (3)
  • iosApp/iosApp/Screens/Calendar/CalendarView.swift
  • iosApp/iosApp/Screens/Calendar/CalendarWeek.swift
  • iosApp/iosApp/Screens/Calendar/CalendarWeekStrip.swift
🚧 Files skipped from review as they are similar to previous changes (2)
  • iosApp/iosApp/Screens/Calendar/CalendarView.swift
  • iosApp/iosApp/Screens/Calendar/CalendarWeekStrip.swift

📝 Walkthrough

Walkthrough

The calendar screen now uses separate iOS/macOS and tvOS navigation layouts. On phone, the week strip is pinned above the agenda, and Today reloads the current week before scrolling to the selected day. CalendarViewModel.goToToday is now async.

Changes

Calendar screen platform split

Layer / File(s) Summary
Week strip contract and rendering
iosApp/iosApp/Screens/Calendar/CalendarWeek.swift, iosApp/iosApp/Screens/Calendar/CalendarWeekStrip.swift
CalendarWeek adds month labeling, and CalendarWeekStrip now accepts phone navigation callbacks and event counts, renders separate phone and tvOS bodies, adds rich day cells with badges on phone, and keeps tvOS focus and day-button behavior in the tvOS branch.
Pinned week strip and Today flow
iosApp/iosApp/Screens/Calendar/CalendarView.swift, iosApp/iosApp/Screens/Calendar/CalendarViewModel.swift
CalendarView replaces the top title bar with a pinned week-strip region on phone, adds returnToToday(proxy:) to await goToToday(), select today, and scroll to it, and wraps the tvOS Today action in a Task. goToToday is now async and awaits load().
Filter bar split
iosApp/iosApp/Screens/Calendar/CalendarFilterBar.swift
CalendarFilterBar now renders separate phone and tvOS segment bodies, uses a matched-geometry pill on phone, keeps tvOS focus styling, and updates the non-tvOS spacing, padding, and height constants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Silo-Server/silo-apple#4: Introduces the calendar screen codepaths that this PR restructures, including CalendarViewModel.goToToday and the calendar navigation UI.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main iOS Calendar redesign and the Trakt-style glass navigation card.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ios-calendar-ux

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
iosApp/iosApp/Screens/Calendar/CalendarView.swift (2)

161-165: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

monthLabel is duplicated.

This Thursday-anchored monthLabel is identical to the one in CalendarWeekStrip (lines 177-181). Consider extracting it (e.g., a CalendarWeek computed property) to keep the two in sync.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/Screens/Calendar/CalendarView.swift` around lines 161 - 165,
The Thursday-anchored monthLabel logic is duplicated between
CalendarView.monthLabel and CalendarWeekStrip, so update the shared month
formatting in one place. Extract the anchor-based month label computation into a
common CalendarWeek computed property or helper, then have both CalendarView and
CalendarWeekStrip use that shared symbol to keep the label behavior in sync.

171-183: 🩺 Stability & Availability | 🔵 Trivial

Remove the fixed 50 ms delay before scrollTo.

goToToday() already waits for the week load, and each day shelf has a stable .id(day), so the extra sleep is just a magic timing assumption. If a layout beat is still needed, use a next-runloop retry or an explicit “week rendered” signal instead of a hard-coded timeout.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/Screens/Calendar/CalendarView.swift` around lines 171 - 183,
The returnToToday(proxy:) flow in CalendarView.swift should no longer rely on a
hard-coded 50 ms sleep before scrolling. Since viewModel.goToToday() already
awaits the week load and the day shelves use stable identifiers via .id(day),
remove the fixed Task.sleep delay and make the scroll happen only after the
today day is selected and the week is ready; if layout timing is still an issue,
replace the timeout with a next-runloop retry or an explicit render-ready signal
around returnToToday and viewModel.goToToday.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@iosApp/iosApp/Screens/Calendar/CalendarView.swift`:
- Around line 161-165: The Thursday-anchored monthLabel logic is duplicated
between CalendarView.monthLabel and CalendarWeekStrip, so update the shared
month formatting in one place. Extract the anchor-based month label computation
into a common CalendarWeek computed property or helper, then have both
CalendarView and CalendarWeekStrip use that shared symbol to keep the label
behavior in sync.
- Around line 171-183: The returnToToday(proxy:) flow in CalendarView.swift
should no longer rely on a hard-coded 50 ms sleep before scrolling. Since
viewModel.goToToday() already awaits the week load and the day shelves use
stable identifiers via .id(day), remove the fixed Task.sleep delay and make the
scroll happen only after the today day is selected and the week is ready; if
layout timing is still an issue, replace the timeout with a next-runloop retry
or an explicit render-ready signal around returnToToday and viewModel.goToToday.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5aa1f3a-9cac-4a9e-9ac8-bdf26da337a2

📥 Commits

Reviewing files that changed from the base of the PR and between b2d0d25 and 0e7ea3d.

📒 Files selected for processing (4)
  • iosApp/iosApp/Screens/Calendar/CalendarFilterBar.swift
  • iosApp/iosApp/Screens/Calendar/CalendarView.swift
  • iosApp/iosApp/Screens/Calendar/CalendarViewModel.swift
  • iosApp/iosApp/Screens/Calendar/CalendarWeekStrip.swift

- Extract the Thursday-anchored month label to CalendarWeek.monthLabel so
  CalendarView and CalendarWeekStrip share one source of truth.
- Replace returnToToday's hard-coded 50ms Task.sleep with a one-runloop
  DispatchQueue.main.async defer (the same hand-off CalendarDayShelf uses),
  so the scroll waits for the reloaded week to render without a magic timeout.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Quick104

Copy link
Copy Markdown
Contributor Author

Thanks @coderabbitai — both nitpicks addressed in 0eade24:

  • Duplicate monthLabel (CalendarView.swift 161-165 ↔ CalendarWeekStrip): extracted the Thursday-anchored label to a shared CalendarWeek.monthLabel computed property; both views now use it.
  • Hard-coded 50 ms sleep (returnToToday, CalendarView.swift 171-183): removed the magic timeout. The defer is still needed — scrolling inline targets the previous week's shelves before SwiftUI re-renders the reloaded week — so it now uses a one-runloop DispatchQueue.main.async hand-off, matching the existing pattern in CalendarDayShelf.

Both schemes (Silo / SiloTV) build green.

🤖 Addressed by Claude Code

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@Quick104 Thanks for the update — that all sounds good. Centralizing the Thursday-anchored label in CalendarWeek.monthLabel and replacing the fixed sleep with the next-runloop DispatchQueue.main.async hand-off both make sense, especially with the existing CalendarDayShelf timing pattern. Appreciate the follow-up and confirmation that both Silo and SiloTV are green.


✏️ Learnings added
Learnt from: Quick104
URL: https://github.com/Silo-Server/silo-apple/pull/24

Timestamp: 2026-06-25T16:39:59.688Z
Learning: In the SwiftUI calendar implementation, the Thursday-anchored month label logic used by `iosApp/iosApp/Screens/Calendar/CalendarView.swift` and `iosApp/iosApp/Screens/Calendar/CalendarWeekStrip.swift` is centralized in the shared computed property `CalendarWeek.monthLabel`.

Learnt from: Quick104
URL: https://github.com/Silo-Server/silo-apple/pull/24

Timestamp: 2026-06-25T16:39:59.688Z
Learning: In `iosApp/iosApp/Screens/Calendar/CalendarView.swift`, the `returnToToday` flow must defer scrolling by one main-runloop tick using `DispatchQueue.main.async` after reloading the current week, because inline scrolling can target the previous week's shelves before SwiftUI rerenders. This matches the existing pattern in `CalendarDayShelf`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@Quick104
Quick104 merged commit cc4d339 into main Jun 25, 2026
1 check passed
@Quick104
Quick104 deleted the feature/ios-calendar-ux branch June 25, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant