Skip to content

Comments

Style/#96 선택한 시술 그라디언트 추가#97

Merged
y-eonee merged 3 commits intodevelopfrom
style/#96-그라디언트추가
Jan 19, 2026

Hidden character warning

The head ref may contain hidden characters: "style/#96-\uadf8\ub77c\ub514\uc5b8\ud2b8\ucd94\uac00"
Merged

Style/#96 선택한 시술 그라디언트 추가#97
y-eonee merged 3 commits intodevelopfrom
style/#96-그라디언트추가

Conversation

@y-eonee
Copy link
Contributor

@y-eonee y-eonee commented Jan 18, 2026

🔗 연결된 이슈

📄 작업 내용

  • 선택한 시술 그라디언트 추가했습니다
  • 캘린더 때 사용했던 걸 그대로 사용한거라 따로 설명은 안할게여
구현 내용 IPhone 16 pro
GIF

@y-eonee y-eonee requested a review from a team January 18, 2026 16:06
@y-eonee y-eonee self-assigned this Jan 18, 2026
@y-eonee y-eonee requested review from soseoyo12, sum130 and wotjs020708 and removed request for a team January 18, 2026 16:06
@y-eonee y-eonee linked an issue Jan 18, 2026 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

SelectedTreatmentView에 스크롤 위치 추적 기능을 추가하여 상단과 하단의 그라디언트 오버레이 표시 여부를 동적으로 제어합니다. TabBarCoordinatorView의 environmentObject 주입을 제거하고 onChange 핸들러를 간소화합니다.

Changes

Cohort / File(s) 변경 사항
스크롤 기반 그라디언트 UI
SelectedTreatmentView.swift
GeometryReader와 PreferenceKey를 통해 스크롤 위치 추적 마커 추가; 스크롤 상태 추적 변수(topGlobalY, initialTopGlobalY, bottomOffsetY) 도입; shouldShowGradientTop/Bottom 계산 속성으로 조건부 그라디언트 표시; coordinateSpace 및 onPreferenceChange 핸들러 추가
TabBar 상태 관리 최적화
TabBarCoordinatorView.swift
environmentObject 주입 제거; onChange 핸들러에서 oldTab 파라미터 제거

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • wotjs020708
  • soseoyo12
  • sum130
🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning TabBarCoordinatorView.swift의 수정이 주요 목표인 그라디언트 추가와 무관해 보이며, PR 설명에도 언급되지 않아 범위를 벗어난 변경으로 보입니다. TabBarCoordinatorView.swift의 변경 사항이 이슈 #96과 어떻게 관련되는지 설명하거나 별도 이슈로 분리하세요.
Linked Issues check ❓ Inconclusive 이슈 #96에는 구체적인 To-Do 항목이 없어('세부적으로 적어주세요') 코딩 요구사항 검증이 불가능합니다. 다만 코드 변경은 그라디언트 추가 목표와 일치하는 것으로 보입니다. 이슈 #96의 To-Do 체크리스트를 구체적으로 작성하여 요구사항을 명확히 하면 검증이 가능합니다.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 '선택한 시술 그라디언트 추가'로 주요 변경 사항을 명확하게 요약하며, 연결된 이슈 #96의 목표와 일치합니다.
Description check ✅ Passed PR 설명은 그라디언트 추가 작업을 언급하고 iPhone 16 Pro에서의 동작 이미지를 포함하여 변경 사항과 관련이 있습니다.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch style/#96-그라디언트추가

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
Contributor

@wotjs020708 wotjs020708 left a comment

Choose a reason for hiding this comment

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

매우 빠르네욤 고생하셔습니다!

Copy link
Contributor

@sum130 sum130 left a comment

Choose a reason for hiding this comment

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

깔끔함미다요!!! 복복드립니다ㅎㅎ 🫳🫳

image

Copy link
Contributor

@soseoyo12 soseoyo12 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다
image

@y-eonee y-eonee force-pushed the style/#96-그라디언트추가 branch from e564c7c to 47988a2 Compare January 19, 2026 13:27
Copy link

@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.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift`:
- Around line 24-26: The SwiftLint warning is caused by the redundant optional
initialization on the `@State` property initialTopGlobalY; remove the explicit "=
nil" so it reads "@State private var initialTopGlobalY: CGFloat?" to satisfy the
redundant_optional_initialization rule, leaving topGlobalY and bottomOffsetY
unchanged and ensure no other code relies on the explicit "= nil" initializer
for initialTopGlobalY.
- Around line 131-133: shouldShowGradientBottom currently reapplies adjustedH
and lacks a non-scroll guard, causing the bottom gradient to appear even when
content isn't scrollable; update the computed property
(shouldShowGradientBottom) to use scrollViewHeight as-is (remove the extra
.adjustedH application) and add a guard that the content is actually scrollable
(e.g., check contentHeight > scrollViewHeight or an isScrollable flag) before
computing remaining = bottomOffsetY - scrollViewHeight, then return remaining >
1; reference the bottomOffsetY, scrollViewHeight, adjustedH and
shouldShowGradientBottom symbols when making the change.

Comment on lines +24 to +26
@State private var topGlobalY: CGFloat = .zero
@State private var initialTopGlobalY: CGFloat? = nil
@State private var bottomOffsetY: CGFloat = .zero
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

옵셔널 nil 초기화 제거로 린트 경고 해소

SwiftLint의 redundant_optional_initialization 경고가 나옵니다. = nil을 제거해도 동작은 동일합니다.

♻️ 제안 변경
-    `@State` private var initialTopGlobalY: CGFloat? = nil
+    `@State` private var initialTopGlobalY: CGFloat?
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@State private var topGlobalY: CGFloat = .zero
@State private var initialTopGlobalY: CGFloat? = nil
@State private var bottomOffsetY: CGFloat = .zero
`@State` private var topGlobalY: CGFloat = .zero
`@State` private var initialTopGlobalY: CGFloat?
`@State` private var bottomOffsetY: CGFloat = .zero
🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 25-25: Initializing an optional variable with nil is redundant

(redundant_optional_initialization)

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift`
around lines 24 - 26, The SwiftLint warning is caused by the redundant optional
initialization on the `@State` property initialTopGlobalY; remove the explicit "=
nil" so it reads "@State private var initialTopGlobalY: CGFloat?" to satisfy the
redundant_optional_initialization rule, leaving topGlobalY and bottomOffsetY
unchanged and ensure no other code relies on the explicit "= nil" initializer
for initialTopGlobalY.

Comment on lines +131 to +133
private var shouldShowGradientBottom: Bool {
let remaining = bottomOffsetY - scrollViewHeight.adjustedH
return remaining > 1
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

하단 그라디언트가 비스크롤 상태에서도 노출될 수 있습니다

scrollViewHeight는 이미 adjustedH가 반영된 값인데 다시 adjustedH를 적용하고, 비스크롤 상태 가드가 없어 패딩 차이로 하단 그라디언트가 항상 보일 수 있습니다. 조건을 보강해 주세요.

🐛 제안 변경
-    private var shouldShowGradientBottom: Bool {
-        let remaining = bottomOffsetY - scrollViewHeight.adjustedH
-        return remaining > 1
-    }
+    private var shouldShowGradientBottom: Bool {
+        guard selectedTreatments.count > maxVisibleCount else { return false }
+        let remaining = bottomOffsetY - scrollViewHeight
+        return remaining > 1
+    }
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift`
around lines 131 - 133, shouldShowGradientBottom currently reapplies adjustedH
and lacks a non-scroll guard, causing the bottom gradient to appear even when
content isn't scrollable; update the computed property
(shouldShowGradientBottom) to use scrollViewHeight as-is (remove the extra
.adjustedH application) and add a guard that the content is actually scrollable
(e.g., check contentHeight > scrollViewHeight or an isScrollable flag) before
computing remaining = bottomOffsetY - scrollViewHeight, then return remaining >
1; reference the bottomOffsetY, scrollViewHeight, adjustedH and
shouldShowGradientBottom symbols when making the change.

@y-eonee y-eonee merged commit 94cb9d7 into develop Jan 19, 2026
1 check passed
@y-eonee y-eonee deleted the style/#96-그라디언트추가 branch January 19, 2026 14:33
Kimgyuilli pushed a commit that referenced this pull request Jan 21, 2026
Style/#96 선택한 시술 그라디언트 추가
y-eonee added a commit that referenced this pull request Jan 21, 2026
Style/#96 선택한 시술 그라디언트 추가
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.

[Style] 선택된 시술 스크롤뷰에 그라디언트 추가

4 participants