Skip to content

fix: tighten header spacing, center dial, mute manual IP caret#32

Merged
ng merged 1 commit intomainfrom
fix/ui-polish-header-loading
Mar 22, 2026
Merged

fix: tighten header spacing, center dial, mute manual IP caret#32
ng merged 1 commit intomainfrom
fix/ui-polish-header-loading

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Mar 22, 2026

Summary

  • Remove excess padding between header toolbar and side selector
  • Vertically center dial + controls in the remaining scroll area
  • Mute the DisclosureGroup chevron color on the loading screen to match "Enter IP manually" label

Test plan

  • Verify temp screen header → side selector gap is tighter
  • Verify dial + controls are vertically centered below side selector
  • Verify "Enter IP manually" chevron is greyed out, matching label text
  • Verify expanding the disclosure group still reveals IP input field

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Refined styling and color consistency for the manual IP entry control, ensuring improved visual presentation
    • Optimized vertical spacing and layout on the temperature screen, repositioning controls for better visual balance and content hierarchy

- Remove bottom padding from header, tighten side selector top padding
- Vertically center dial + controls in remaining scroll area with Spacers
- Reduce dial-to-controls spacing from 32 to 28
- Set DisclosureGroup chevron to Theme.textMuted via tint + accentColor
  so the caret matches the "Enter IP manually" label color
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

📝 Walkthrough

Walkthrough

The PR updates UI styling and layout across two files. SleepypodApp.swift modifies the disconnected tab view's disclosure group appearance by restructuring the label with an HStack and adjusting accent colors. TempScreen.swift reorganizes the layout using spacers to vertically center the dial controls within the scrollable area.

Changes

Cohort / File(s) Summary
Disclosure Group Styling
Sleepypod/SleepypodApp.swift
Restructured "Enter IP manually" label by wrapping Text in an HStack and moving muted color styling to the container. Added .accentColor() modifier to keep label/control accent muted until accordion expansion.
TempScreen Layout Adjustments
Sleepypod/Views/Temp/TempScreen.swift
Repositioned dial/control section by replacing fixed padding with spacer-based vertical centering. Removed toolbar bottom padding, adjusted SideSelectorView padding, and reduced container minHeight to accommodate spacers above and below the control stack.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through views so bright,
With spacers placed and colors right,
The UI dance, a gentle sway,
Centered controls now have their way!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: tightening header spacing, centering the dial, and muting the manual IP caret, all of which are reflected in the detailed changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 fix/ui-polish-header-loading

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
Sleepypod/SleepypodApp.swift (1)

485-486: Remove redundant .accentColor() modifier.

Lines 485-486 apply both .tint(Theme.textMuted) and .accentColor(Theme.textMuted) to the same control. With iOS 26.0 as the deployment target, .tint() alone is sufficient. The .accentColor() modifier is deprecated overlap and should be removed.

♻️ Simplification
                 .tint(Theme.textMuted)
-                .accentColor(Theme.textMuted)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sleepypod/SleepypodApp.swift` around lines 485 - 486, In SleepypodApp.swift,
remove the redundant deprecated modifier by deleting the
.accentColor(Theme.textMuted) call applied alongside .tint(Theme.textMuted) so
the control only uses .tint(Theme.textMuted); keep the .tint modifier as the
single source of truth for theming and ensure no other uses of .accentColor are
left paired with .tint in the same view.
Sleepypod/Views/Temp/TempScreen.swift (2)

61-74: Consider restoring a small gap between the selector and alerts.

Sleepypod/Views/Temp/SideSelectorView.swift:9-32 only gives the selector card internal padding, so with VStack(spacing: 0) here an active AlarmBanner will now sit directly against it. A small bottom inset on SideSelectorView() or a conditional top inset on the alerts block would keep the two cards from visually merging.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sleepypod/Views/Temp/TempScreen.swift` around lines 61 - 74, The selector and
alert cards are touching because there’s no vertical gap between
SideSelectorView() and the alerts VStack; update the layout to add a small gap
when an AlarmBanner can appear by either adding a bottom inset to
SideSelectorView (e.g., padding(.bottom, 8)) or applying a conditional top
padding to the alerts VStack (e.g., if deviceManager.isAlarmActive then
padding(.top, 8)) so AlarmBanner doesn’t visually merge with the selector;
adjust the change around SideSelectorView, VStack(spacing: 8), and the
AlarmBanner usage.

75-98: Don’t tie the centering math to a hard-coded 60pt subtraction.

Line 93 sizes the spacer layout from geo.size.height - 60, but the header above this ScrollView is not fixed-height (sideName, PrimingIndicator(), UserSelectorView(), Dynamic Type). That desynchronizes the centering from the real viewport, and it’s also worth re-checking with .refreshable + .scrollBounceBehavior(.basedOnSize). Please verify this on small/tall devices and with larger text, or derive minHeight from the actual scroll viewport instead of a constant.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sleepypod/Views/Temp/TempScreen.swift` around lines 75 - 98, The layout
currently forces centering using a hard-coded subtraction (geo.size.height - 60)
inside TempScreen which breaks when the header (sideName, PrimingIndicator,
UserSelectorView, dynamic type) changes size; replace this magic constant by
computing the actual available viewport height and subtracting the measured
header height instead. Measure the header height (e.g., with a ViewPreferenceKey
or a background GeometryReader) and use that headerHeight to set the
ScrollView/VStack minHeight (instead of 60) so
TemperatureDialView/TempControlsView/EnvironmentInfoView remain vertically
centered across Dynamic Type, small/tall devices, and with
.refreshable/.scrollBounceBehavior(.basedOnSize). Ensure the code references
TempScreen, the GeometryReader that provides geo, and the header view(s) used to
derive headerHeight when implementing the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Sleepypod/SleepypodApp.swift`:
- Around line 485-486: In SleepypodApp.swift, remove the redundant deprecated
modifier by deleting the .accentColor(Theme.textMuted) call applied alongside
.tint(Theme.textMuted) so the control only uses .tint(Theme.textMuted); keep the
.tint modifier as the single source of truth for theming and ensure no other
uses of .accentColor are left paired with .tint in the same view.

In `@Sleepypod/Views/Temp/TempScreen.swift`:
- Around line 61-74: The selector and alert cards are touching because there’s
no vertical gap between SideSelectorView() and the alerts VStack; update the
layout to add a small gap when an AlarmBanner can appear by either adding a
bottom inset to SideSelectorView (e.g., padding(.bottom, 8)) or applying a
conditional top padding to the alerts VStack (e.g., if
deviceManager.isAlarmActive then padding(.top, 8)) so AlarmBanner doesn’t
visually merge with the selector; adjust the change around SideSelectorView,
VStack(spacing: 8), and the AlarmBanner usage.
- Around line 75-98: The layout currently forces centering using a hard-coded
subtraction (geo.size.height - 60) inside TempScreen which breaks when the
header (sideName, PrimingIndicator, UserSelectorView, dynamic type) changes
size; replace this magic constant by computing the actual available viewport
height and subtracting the measured header height instead. Measure the header
height (e.g., with a ViewPreferenceKey or a background GeometryReader) and use
that headerHeight to set the ScrollView/VStack minHeight (instead of 60) so
TemperatureDialView/TempControlsView/EnvironmentInfoView remain vertically
centered across Dynamic Type, small/tall devices, and with
.refreshable/.scrollBounceBehavior(.basedOnSize). Ensure the code references
TempScreen, the GeometryReader that provides geo, and the header view(s) used to
derive headerHeight when implementing the fix.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0b105d6-62a4-414c-b770-f5722546a810

📥 Commits

Reviewing files that changed from the base of the PR and between a65e6fb and fdbcd28.

📒 Files selected for processing (2)
  • Sleepypod/SleepypodApp.swift
  • Sleepypod/Views/Temp/TempScreen.swift

@ng ng merged commit 25507c3 into main Mar 22, 2026
2 checks passed
@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