Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions DevLog/UI/Home/TodoListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ struct TodoListView: View {
@Environment(NavigationRouter.self) var router
@Environment(\.diContainer) var container: DIContainer
@Environment(\.colorScheme) private var colorScheme
@State private var headerOffset: CGFloat = 0
@State private var headerHeight: CGFloat = .pi
@State private var headerOffset: CGFloat = .zero
@State private var isScrollTrackingEnabled = false

var body: some View {
Expand Down Expand Up @@ -298,20 +297,11 @@ struct TodoListView: View {
sortMenu
filterMenu
}
// iOS 26.4부터 헤더의 높이가 달라져서 리스트에서 필터링된 Todo가 없으면 사라지는 현상 해결
.background {
GeometryReader { geometry in
Color.clear
.onChange(of: geometry.size.height, initial: true) { _, height in
headerHeight = height.rounded()
}
}
}
}
.scrollIndicators(.never)
.scrollDisabled(!isScrollTrackingEnabled)
.contentMargins(.leading, 16, for: .scrollContent)
.frame(height: headerHeight)
.frame(height: UIFont.preferredFont(forTextStyle: .body).lineHeight.rounded(.up) + 20)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

하드코딩된 값 20은 헤더의 높이를 결정하는 중요한 값입니다. 이 값은 adaptiveButtonStyle의 패딩(상하 8pt씩 총 16pt)과 추가 여백(4pt)으로 계산된 것으로 보입니다. 가독성과 유지보수성을 위해 이 값을 headerVerticalPadding과 같은 이름의 상수로 정의하고, 주석으로 산출 근거를 남기는 것을 권장합니다.

.onAppear {
headerOffset = 0
isScrollTrackingEnabled = false
Expand Down