-
Notifications
You must be signed in to change notification settings - Fork 0
Design/#38 - Sidebar UI 및 SidebarFeature 구현 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0bcd150
[#38] fix: DVCategory, DVProjectContainer 컴포넌트 수정
dlguszoo d60da2c
[#38] feat: SidebarFeature 구현
dlguszoo dfcb8d0
[#38] feat: MainFeature에 SidebarFeature 자식 reducer 연결
dlguszoo 713316e
[#38] feat: SidebarView 구현
dlguszoo 9b5f61e
[#38] fix: trash 아이콘 변경
dlguszoo 801a973
[#38] fix: gray300 컬러 오류 수정 및 DVCategory 수정
dlguszoo c9585c1
[#38] fix: navigationSplitViewColumnWidth 수정
dlguszoo 9ed5491
[#38] feat: SidebarFeature State 프로퍼티 접근 제어자 public internal(set) 적용
dlguszoo 82d13e7
[#38] fix: SidebarView PR 리뷰 반영 및 레이아웃 버그 수정
dlguszoo 58ff27f
[#38] fix: DVCategory isPressed 추가
dlguszoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
Projects/DVPresentation/Sources/Features/Sidebar/SidebarFeature.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| // Copyright © 2026 Devault. All rights reserved | ||
|
|
||
| import Foundation | ||
|
|
||
| import ComposableArchitecture | ||
|
|
||
| // MARK: - SidebarFilter | ||
|
|
||
| public enum SidebarFilter: Equatable, CaseIterable, Hashable { | ||
| case all | ||
| case starred | ||
| case expired | ||
| case deleted | ||
|
|
||
| var title: String { | ||
| switch self { | ||
| case .all: "All" | ||
| case .starred: "Star" | ||
| case .expired: "Expired" | ||
| case .deleted: "Deleted" | ||
| } | ||
|
Comment on lines
+15
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 로컬라이제이션: "All", "Star", "Project", "Rename" 등 모든 사용자 노출 문자열이 하드코딩. 후속 이슈로 관리하고 있는지 확인 |
||
| } | ||
|
|
||
| var icon: String { | ||
| switch self { | ||
| case .all: "square.grid.2x2.fill" | ||
| case .starred: "star.fill" | ||
| case .expired: "exclamationmark" | ||
| case .deleted: "trash" | ||
| } | ||
|
dlguszoo marked this conversation as resolved.
|
||
| } | ||
| } | ||
|
|
||
| // MARK: - SidebarSelection | ||
|
|
||
| public enum SidebarSelection: Equatable { | ||
| case filter(SidebarFilter) | ||
| case project(Int) | ||
| } | ||
|
|
||
| // MARK: - SidebarFeature | ||
|
|
||
| @Reducer | ||
| public struct SidebarFeature { | ||
|
|
||
| // MARK: - State | ||
|
|
||
| @ObservableState | ||
| public struct State: Equatable { | ||
| public internal(set) var selection: SidebarSelection = .filter(.all) | ||
| public internal(set) var isProjectSectionExpanded: Bool = true | ||
|
|
||
| public init() {} | ||
| } | ||
|
|
||
| // MARK: - Action | ||
|
|
||
| public enum Action: Equatable { | ||
|
|
||
| // MARK: - View | ||
|
|
||
| case task | ||
| case didSelect(SidebarSelection) | ||
| case didTapAddButton | ||
| case didTapSettingsButton | ||
| case didTapAddProject | ||
| case didToggleProjectSection | ||
|
|
||
| // MARK: - Delegate | ||
|
|
||
| case delegate(Delegate) | ||
|
|
||
| public enum Delegate: Equatable { | ||
| case selectionChanged(SidebarSelection) | ||
| case addButtonTapped | ||
| case settingsButtonTapped | ||
| case addProjectTapped | ||
| } | ||
| } | ||
|
|
||
| // MARK: - Init | ||
|
|
||
| public init() {} | ||
|
|
||
| // MARK: - Body | ||
|
|
||
| public var body: some ReducerOf<Self> { | ||
| Reduce { state, action in | ||
| switch action { | ||
| case .task: | ||
| return .none | ||
|
|
||
| case .didSelect(let selection): | ||
| state.selection = selection | ||
| return .send(.delegate(.selectionChanged(selection))) | ||
|
|
||
| case .didTapAddButton: | ||
| return .send(.delegate(.addButtonTapped)) | ||
|
|
||
| case .didTapSettingsButton: | ||
| return .send(.delegate(.settingsButtonTapped)) | ||
|
|
||
| case .didTapAddProject: | ||
| return .send(.delegate(.addProjectTapped)) | ||
|
|
||
| case .didToggleProjectSection: | ||
| state.isProjectSectionExpanded.toggle() | ||
| return .none | ||
|
|
||
| case .delegate: | ||
| return .none | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.