Skip to content

Schedule: phase blocks as horizontal scroller#21

Merged
ng merged 1 commit intomainfrom
fix/schedule-phase-layout
Mar 19, 2026
Merged

Schedule: phase blocks as horizontal scroller#21
ng merged 1 commit intomainfrom
fix/schedule-phase-layout

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Mar 19, 2026

Summary

Replace the vertical stack of full-width phase blocks with a compact horizontal ScrollView behind a disclosure toggle.

Before

  • Phase blocks always visible, stacked vertically — takes up most of the screen
  • "Manual Set Points" button disconnected from the blocks

After

  • "Set Points (N)" disclosure — collapsed by default
  • Tap to reveal horizontal scroller of compact phase cards
  • Each card: 100pt wide, shows icon + name + time + temp with +/- controls
  • Color-coded border per phase temperature
  • Clear Schedule also behind disclosure

Test plan

  • Tap "Set Points" to expand/collapse
  • Scroll horizontally through phase cards
  • Tap +/- to adjust temperature on a phase
  • Clear schedule button visible when expanded

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Introduced compact phase cards with temperature adjustment controls (+/- buttons).
    • Added horizontal scrolling layout for phase cards with phase count display.
    • Implemented temperature-dependent color styling for visual feedback.
    • Added haptic feedback when adjusting temperatures.

Replace vertical stack of phase blocks with a compact horizontal
ScrollView behind a "Set Points (N)" disclosure toggle. Each phase
card shows icon, name, time, and temp +/- controls in a compact
100pt-wide card with color-coded border. Clear Schedule button also
moves behind the disclosure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ng ng merged commit 69751ab into main Mar 19, 2026
1 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0a4e29e-43de-4450-9bdb-9d83cf5ce22d

📥 Commits

Reviewing files that changed from the base of the PR and between 3cb789f and 88603bd.

📒 Files selected for processing (2)
  • Sleepypod/Views/Schedule/PhaseBlockView.swift
  • Sleepypod/Views/Schedule/ScheduleScreen.swift

📝 Walkthrough

Walkthrough

This PR introduces a new PhaseBlockCompactView component for displaying phase information in a compact card format, and refactors ScheduleScreen to replace the vertical phase-block layout with a horizontally scrollable phase-card strip using the new component. It also adjusts visibility conditions for phase details and clear-schedule functionality.

Changes

Cohort / File(s) Summary
New Compact Phase Card Component
Sleepypod/Views/Schedule/PhaseBlockView.swift
Added PhaseBlockCompactView struct with icon, name, formatted time (HH:MM → 12-hour AM/PM), temperature display, and ±1 temperature adjustment buttons. Includes haptic feedback and async temperature updates via scheduleManager. Uses TempColor.forOffset() for temperature-dependent styling.
Schedule Screen Refactoring
Sleepypod/Views/Schedule/ScheduleScreen.swift
Replaced vertical "Manual Set Points" disclosure with horizontal "Set Points" button (displaying phase count) and ScrollView(.horizontal) containing PhaseBlockCompactView cards. Adjusted phase-detail section visibility and "Clear Schedule" button rendering logic based on schedule state and showAdvanced flag.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Compact cards in a horizontal row,
Temperature tweaks with a haptic glow,
Phases scroll smoothly, left and right,
The schedule screen now feels just right!

✨ 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 fix/schedule-phase-layout
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ng ng deleted the fix/schedule-phase-layout branch March 19, 2026 06:43
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant