From 40d00930a19b0458b7fe2686094500af41c982ed Mon Sep 17 00:00:00 2001 From: opficdev Date: Sat, 28 Nov 2026 23:15:40 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=B5=9C=EA=B7=BC=20=ED=99=9C=EB=8F=99=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=97=B0=20Todo=EB=A5=BC=20=ED=8E=B8=EC=A7=91=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=97=86=EC=9D=B4=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Profile/ActivityCard.swift | 3 +-- .../Sources/Profile/ProfileFeature.swift | 10 ++++----- .../Sources/Profile/ProfileView.swift | 21 +++++++++---------- .../Sources/Profile/RecentActivityCard.swift | 3 +-- .../Tests/Profile/ProfileFeatureTests.swift | 9 ++++---- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Application/Presentation/ProfileTab/Sources/Profile/ActivityCard.swift b/Application/Presentation/ProfileTab/Sources/Profile/ActivityCard.swift index 827b9221..37ed1cdd 100644 --- a/Application/Presentation/ProfileTab/Sources/Profile/ActivityCard.swift +++ b/Application/Presentation/ProfileTab/Sources/Profile/ActivityCard.swift @@ -183,8 +183,7 @@ struct ActivityCard: View { // 행 배치를 바꾸지 않고 선택한 행 배경만 바깥으로 넓힘 // 선택 표시는 다른 목록 행과 같은 회색 .background { - if usesPaneLayout && store.showsDetailInPane - && store.detail?.todoId == activity.todoId && store.detail?.showEditButton == false { + if usesPaneLayout && store.showsDetailInPane && store.detail?.todoId == activity.todoId { RoundedRectangle(cornerRadius: CornerRadius.control) .fill(Color.fill) .padding(.horizontal, -8) diff --git a/Application/Presentation/ProfileTab/Sources/Profile/ProfileFeature.swift b/Application/Presentation/ProfileTab/Sources/Profile/ProfileFeature.swift index eaec6a40..74d354e9 100644 --- a/Application/Presentation/ProfileTab/Sources/Profile/ProfileFeature.swift +++ b/Application/Presentation/ProfileTab/Sources/Profile/ProfileFeature.swift @@ -34,7 +34,7 @@ struct ProfileFeature { @ObservableState struct State: Equatable { @Presents var alert: AlertState? - // 활동 기록이나 최근 Todo에서 연 Todo 상세, 활동 기록 Todo는 고칠 수 없어 편집 버튼 없이 표시 + // 활동 기록이나 최근 Todo에서 연 Todo 상세, 프로필은 보기만 하는 요약이라 편집 버튼 없이 표시 // 좁은 창은 내비게이션에 쌓고 사이드바가 있는 창은 상세 판이나 오른쪽 칸에 표시 @Presents var detail: TodoDetailFeature.State? var name = "" @@ -68,7 +68,7 @@ struct ProfileFeature { case detail(PresentationAction) case binding(BindingAction) // 사이드바가 있는 창은 연 곳(상세 판이나 오른쪽 칸)의 내용을 바꿈 - case selectTodo(String, isEditable: Bool) + case selectTodo(String) case startObserving case fetchData case refresh @@ -128,10 +128,10 @@ struct ProfileFeature { state.showsDetailInPane = false case .detail: break - case .selectTodo(let todoId, let isEditable): + case .selectTodo(let todoId): // 이미 연 Todo는 불러온 상세와 열어 둔 시트를 그대로 둠 - if state.detail?.todoId != todoId || state.detail?.showEditButton != isEditable { - state.detail = TodoDetailFeature.State(todoId: todoId, showEditButton: isEditable) + if state.detail?.todoId != todoId { + state.detail = TodoDetailFeature.State(todoId: todoId, showEditButton: false) } case .binding(\.isCreatedActivitySelected): return updateHeatmapActivityKindsEffectIfNeeded(.created, state: state) diff --git a/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift b/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift index e86897b8..8f1a6cc2 100644 --- a/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift +++ b/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift @@ -45,11 +45,11 @@ public struct ProfileView: View { LazyVStack(alignment: .leading, spacing: 0) { UserInfoCard(store: store, isSelected: isSelected) ActivityCard(store: store) { todoId in - store.send(.selectTodo(todoId, isEditable: false)) + store.send(.selectTodo(todoId)) } ProfileGoalSummary(store: store) RecentActivityCard(store: store) { todoId in - store.send(.selectTodo(todoId, isEditable: true)) + store.send(.selectTodo(todoId)) } } .padding(.bottom, 24) @@ -74,20 +74,20 @@ public struct ProfileView: View { inPane: store.showsDetailInPane, isActive: isSelected ) { detailStore, onClose in - // 활동 기록 Todo는 고칠 수 없어 편집 결과를 받을 창 이벤트 없이 표시 + // 프로필에서 연 Todo는 고칠 수 없어 편집 결과를 받을 창 이벤트 없이 표시 TodoDetailView( store: detailStore, - windowEvent: detailStore.showEditButton ? windowEvent : nil, + windowEvent: nil, isPaneDetail: onClose != nil, onClose: onClose ) - // 칸 안에서 다른 Todo로 바꾸거나 같은 Todo를 다른 목록에서 다시 고르면 그 Todo를 조회 - .id([AnyHashable(detailStore.todoId), detailStore.showEditButton]) + // 칸 안에서 다른 Todo로 바꾸면 그 Todo를 조회 + .id(detailStore.todoId) } panel: { detailStore in TodoDetailPanel( store: detailStore, location: Text("nav_profile", bundle: PresentationResources.bundle), - windowEvent: detailStore.showEditButton ? windowEvent : nil, + windowEvent: nil, onMoveToPane: { store.send(.binding(.set(\.showsDetailInPane, true))) } @@ -98,11 +98,10 @@ public struct ProfileView: View { if let detail = store.detail { TodoDetailSideBarView( todoId: detail.todoId, - isEditable: detail.showEditButton, - windowEvent: windowEvent + isEditable: false, + windowEvent: nil ) - // 같은 Todo도 편집할 수 있는지가 바뀌면 다시 만듦 - .id([AnyHashable(detail.todoId), detail.showEditButton]) + .id(detail.todoId) } } // 좁은 창은 설정 목록과 고른 항목 화면을 프로필 위에 쌓고, 사이드바가 있는 창은 창 전체 설정 화면에 그려 쌓지 않음 diff --git a/Application/Presentation/ProfileTab/Sources/Profile/RecentActivityCard.swift b/Application/Presentation/ProfileTab/Sources/Profile/RecentActivityCard.swift index fb147da7..3ad929cd 100644 --- a/Application/Presentation/ProfileTab/Sources/Profile/RecentActivityCard.swift +++ b/Application/Presentation/ProfileTab/Sources/Profile/RecentActivityCard.swift @@ -36,8 +36,7 @@ struct RecentActivityCard: View { } label: { RecentTodoRow( todo: todo, - isSelected: usesPaneLayout && store.showsDetailInPane - && store.detail?.todoId == todo.id && store.detail?.showEditButton == true + isSelected: usesPaneLayout && store.showsDetailInPane && store.detail?.todoId == todo.id ) .todoDetailPreview(todoId: todo.id) } diff --git a/Application/Presentation/ProfileTab/Tests/Profile/ProfileFeatureTests.swift b/Application/Presentation/ProfileTab/Tests/Profile/ProfileFeatureTests.swift index 754b0741..c1c557ef 100644 --- a/Application/Presentation/ProfileTab/Tests/Profile/ProfileFeatureTests.swift +++ b/Application/Presentation/ProfileTab/Tests/Profile/ProfileFeatureTests.swift @@ -230,15 +230,16 @@ struct ProfileFeatureTests { ProfileFeature() } - await store.send(.selectTodo("activity", isEditable: false)) { + await store.send(.selectTodo("activity")) { $0.detail = TodoDetailFeature.State(todoId: "activity", showEditButton: false) } await store.send(.binding(.set(\.showsDetailInPane, true))) { $0.showsDetailInPane = true } - // 같은 Todo도 최근 Todo에서 고르면 편집할 수 있는 상세로 바꿈 - await store.send(.selectTodo("activity", isEditable: true)) { - $0.detail = TodoDetailFeature.State(todoId: "activity", showEditButton: true) + // 다른 목록에서 같은 Todo를 고르면 연 상세를 그대로 둠 + await store.send(.selectTodo("activity")) + await store.send(.selectTodo("recent")) { + $0.detail = TodoDetailFeature.State(todoId: "recent", showEditButton: false) } await store.send(.detail(.dismiss)) { $0.detail = nil From 4769e4785f9199cbf57abcae8204d64734177503 Mon Sep 17 00:00:00 2001 From: opficdev Date: Sat, 28 Nov 2026 23:15:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20ProfileView=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=93=B0=EC=A7=80=20=EC=95=8A=EB=8A=94=20windowEvent=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Entry/Sources/Composition/TabScreen.swift | 3 +-- .../ProfileTab/Sources/Profile/ProfileView.swift | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Application/Presentation/Entry/Sources/Composition/TabScreen.swift b/Application/Presentation/Entry/Sources/Composition/TabScreen.swift index 956707ac..305d435d 100644 --- a/Application/Presentation/Entry/Sources/Composition/TabScreen.swift +++ b/Application/Presentation/Entry/Sources/Composition/TabScreen.swift @@ -64,8 +64,7 @@ struct TabScreen: View { case .profile: ProfileView( isSelected: isSelected, - settingsStore: store.scope(state: \.settings, action: \.settings), - windowEvent: windowEvent + settingsStore: store.scope(state: \.settings, action: \.settings) ) } } diff --git a/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift b/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift index 8f1a6cc2..a8499c13 100644 --- a/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift +++ b/Application/Presentation/ProfileTab/Sources/Profile/ProfileView.swift @@ -20,12 +20,10 @@ public struct ProfileView: View { @State private var store: StoreOf @Bindable private var settingsStore: StoreOf private let isSelected: Bool - private let windowEvent: TodoEditorWindowEvent public init( isSelected: Bool, - settingsStore: StoreOf, - windowEvent: TodoEditorWindowEvent + settingsStore: StoreOf ) { let store = Store(initialState: ProfileFeature.State()) { ProfileFeature() @@ -33,7 +31,6 @@ public struct ProfileView: View { self._store = State(initialValue: store) self.settingsStore = settingsStore self.isSelected = isSelected - self.windowEvent = windowEvent } public var body: some View {