Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CategoryManageFeature.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/11/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CategoryManageView.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/16/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CheckBox.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/17/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
//
// WebItemRow.swift
// Presentation
// HomeTab
//
// Created by 최윤진 on 2/24/26.
//

import SwiftUI

public struct WebItemRow: View {
struct WebItemRow: View {
@ScaledMetric(relativeTo: .largeTitle) private var labelWidth = CGFloat(34)
let item: WebPageItem
let showsChevron: Bool

public init(
init(
item: WebPageItem,
showsChevron: Bool
) {
self.item = item
self.showsChevron = showsChevron
}

public var body: some View {
var body: some View {
HStack {
thumbnail
.frame(width: labelWidth, height: labelWidth)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeature+Dependencies.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/14/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeature+Effects.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/14/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeature.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/14/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeView.swift
// Presentation
// HomeTab
//
// Created by opfic on 5/7/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeViewCoordinator.swift
// Presentation
// HomeTab
//
// Created by opfic on 5/10/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
//
// SearchFeature.swift
// Presentation
// HomeTab
//
// Created by opfic on 6/12/26.
//

import ComposableArchitecture
import Foundation
import OrderedCollections
import Core
import Domain
import PresentationShared
Comment thread
opficdev marked this conversation as resolved.

@Reducer
public struct SearchFeature {
struct SearchFeature {
@ObservableState
public struct State: Equatable {
@Presents public var alert: AlertState<Never>?
public var loading = LoadingFeature.State()
public var isSearching = false
public var searchQuery = ""
public var webPages: [WebPageItem] = []
public var todos: [TodoListItem] = []
public var recentQueries = OrderedSet<String>()
public var showAllTodos = false
public var showAllWebPages = false
struct State: Equatable {
@Presents var alert: AlertState<Never>?
var loading = LoadingFeature.State()
var isSearching = false
var searchQuery = ""
var webPages: [WebPageItem] = []
var todos: [TodoListItem] = []
var recentQueries = OrderedSet<String>()
var showAllTodos = false
var showAllWebPages = false
let contentsLimit = 5

public init(recentQueries: [String] = []) {
init(recentQueries: [String] = []) {
self.recentQueries = OrderedSet(recentQueries)
}

public var isLoading: Bool {
var isLoading: Bool {
loading.isLoading
}

public var visibleTodos: [TodoListItem] {
var visibleTodos: [TodoListItem] {
if showAllTodos {
return todos
}

return Array(todos.prefix(contentsLimit))
}

public var visibleWebPages: [WebPageItem] {
var visibleWebPages: [WebPageItem] {
if showAllWebPages {
return webPages
}

return Array(webPages.prefix(contentsLimit))
}

public var shouldShowMoreTodos: Bool {
var shouldShowMoreTodos: Bool {
!showAllTodos && contentsLimit < todos.count
}

public var shouldShowMoreWebPages: Bool {
var shouldShowMoreWebPages: Bool {
!showAllWebPages && contentsLimit < webPages.count
}

public var isHashOnlyQuery: Bool {
var isHashOnlyQuery: Bool {
searchQuery.trimmingCharacters(in: .whitespacesAndNewlines) == "#"
}
}

public enum Action: BindableAction, Equatable {
enum Action: BindableAction, Equatable {
case onAppear
case alert(PresentationAction<Never>)
case binding(BindingAction<State>)
Expand All @@ -75,7 +74,7 @@ public struct SearchFeature {
case store(StoreAction)
case loading(LoadingFeature.Action)

public enum StoreAction: Equatable {
enum StoreAction: Equatable {
case fetchWebPage([WebPageItem])
case fetchTodos([TodoListItem])
case applySearchQuery(String)
Expand All @@ -96,9 +95,7 @@ public struct SearchFeature {
private let maxRecentQueries = 20
private let searchDebounceDelay = Duration.seconds(0.4)

public init() { }

public var body: some ReducerOf<Self> {
var body: some ReducerOf<Self> {
Scope(state: \.loading, action: \.loading) {
LoadingFeature()
}
Expand Down Expand Up @@ -179,7 +176,7 @@ public struct SearchFeature {
}
}

public extension DependencyValues {
extension DependencyValues {
var searchFetchTodosUseCase: FetchTodosUseCase {
get { self[SearchFetchTodosUseCaseKey.self] }
set { self[SearchFetchTodosUseCaseKey.self] = newValue }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
//
// SearchView.swift
// Presentation
// HomeTab
//
// Created by 최윤진 on 2/12/26.
//

import SwiftUI
import ComposableArchitecture
import Core
import Domain
import PresentationShared
Comment thread
opficdev marked this conversation as resolved.

public struct SearchView: View {
struct SearchView: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.diContainer) private var container: DIContainer
@State private var router = NavigationRouter<Path>()
@State var store: StoreOf<SearchFeature>

public init(store: StoreOf<SearchFeature>) {
init(store: StoreOf<SearchFeature>) {
self.store = store
}

public var body: some View {
var body: some View {
NavigationStack(path: $router.path) {
searchableContent
.navigationDestination(for: Path.self) { path in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//
// RecentTodoItem.swift
// Presentation
// HomeTab
//
// Created by opfic on 3/6/26.
//

import Foundation
import Domain

public struct RecentTodoItem: Identifiable, Hashable {
public let id: String
public let number: Int
public let title: String
public let isPinned: Bool
public let updatedAt: Date
public let tags: [String]
public var category: TodoCategory
struct RecentTodoItem: Identifiable, Hashable {
let id: String
let number: Int
let title: String
let isPinned: Bool
let updatedAt: Date
let tags: [String]
var category: TodoCategory

public init?(from todo: Todo) {
init?(from todo: Todo) {
self.id = todo.id
self.number = todo.number
self.title = todo.title
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// WebPageItem.swift
// Presentation
// HomeTab
//
// Created by 최윤진 on 2/9/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CategoryManageFeatureTests.swift
// PresentationTests
// HomeTabTests
//
// Created by opfic on 6/11/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeatureTestAssertions.swift
// PresentationTests
// HomeTabTests
//
// Created by opfic on 6/14/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeatureTestSpies.swift
// PresentationTests
// HomeTabTests
//
// Created by opfic on 7/2/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeatureTestSupport.swift
// PresentationTests
// HomeTabTests
//
// Created by opfic on 6/14/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HomeFeatureTests.swift
// PresentationTests
// HomeTabTests
//
// Created by opfic on 6/14/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
//
// SearchFeatureTestDoubles.swift
// PresentationSharedTests
// HomeTabTests
//
// Created by opfic on 6/12/26.
//

import Foundation
import Core
import Domain
@testable import PresentationShared
import PresentationShared
@testable import HomeTab
Comment thread
opficdev marked this conversation as resolved.

@MainActor
struct SearchStoreTestAdapter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SearchFeatureTests.swift
// PresentationSharedTests
// HomeTabTests
//
// Created by opfic on 6/12/26.
//
Expand All @@ -9,7 +9,8 @@ import Testing
import Foundation
import Core
import Domain
@testable import PresentationShared
import PresentationShared
@testable import HomeTab
Comment thread
opficdev marked this conversation as resolved.

@MainActor
struct SearchFeatureTests {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PushNotificationItem.swift
// Presentation
// NotificationTab
//
// Created by 최윤진 on 2/27/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PushNotificationListFeature.swift
// Presentation
// NotificationTab
//
// Created by opfic on 6/12/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PushNotificationListFeatureDependencies.swift
// Presentation
// NotificationTab
//
// Created by opfic on 6/12/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PushNotificationListView.swift
// Presentation
// NotificationTab
//
// Created by opfic on 5/14/25.
//
Expand Down
Loading
Loading