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
Expand Up @@ -39,7 +39,7 @@ public struct GoalCreateView: View {
.safeAreaInset(edge: .top, spacing: 0) {
GoalCreateTopBar(
isSaving: store.isSaving,
onClose: dismiss.callAsFunction
onClose: { dismiss() }
)
}
.safeAreaInset(edge: .bottom, spacing: 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public struct RecordDetailView: View {
onCompletion: finishEditing
)
}
.navigationDestination(isPresented: $isHistoryPresented) {
.navigationDestination(isPresented: $isHistoryPresented, interactivePop: true) {
RecordVersionHistoryView(store: store)
}
.overlay {
Expand All @@ -95,7 +95,7 @@ public struct RecordDetailView: View {

private var topBar: some View {
HStack {
NavigationBackButton(action: dismiss.callAsFunction)
NavigationBackButton(action: { dismiss() })
.disabled(store.isRestoring)
Spacer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,24 @@ public struct GoalDetailView: View {

private var mainContent: some View {
ScrollView {
LazyVStack(spacing: 12, pinnedViews: [.sectionHeaders]) {
Section {
GoalDescriptionCard(
description: store.goal?.description ?? "",
isLoading: !store.hasLoaded && store.isLoading
)
timelineCard
GoalLinkedTodoCard(
todos: store.linkedTodos,
isLoading: store.isTodoLoading,
hasLoadFailure: store.hasTodoLoadFailure,
allowsManagement: store.hasLoaded && store.allowsTodoLinkMutation,
onManage: { store.send(.view(.manageTodos)) },
onRetry: { store.send(.view(.retryTodos)) },
onSelect: { store.send(.view(.selectTodo($0))) }
)
} header: {
titleBar
}
.padding(.horizontal)
LazyVStack(spacing: 12) {
titleBar
GoalDescriptionCard(
description: store.goal?.description ?? "",
isLoading: !store.hasLoaded && store.isLoading
)
timelineCard
GoalLinkedTodoCard(
todos: store.linkedTodos,
isLoading: store.isTodoLoading,
hasLoadFailure: store.hasTodoLoadFailure,
allowsManagement: store.hasLoaded && store.allowsTodoLinkMutation,
onManage: { store.send(.view(.manageTodos)) },
onRetry: { store.send(.view(.retryTodos)) },
onSelect: { store.send(.view(.selectTodo($0))) }
)
}
.padding(.horizontal)
}
.safeAreaInset(edge: .top, spacing: 0) { topBar }
.safeAreaInset(edge: .bottom, spacing: 0) { recordActionBar }
Expand All @@ -79,7 +76,10 @@ public struct GoalDetailView: View {
.sheet(item: $store.scope(state: \.todoLinkSheet, action: \.todoLinkSheet)) {
GoalTodoLinkSheet(store: $0)
}
.navigationDestination(item: $store.scope(state: \.recordDetail, action: \.recordDetail)) { destination in
.navigationDestination(
item: $store.scope(state: \.recordDetail, action: \.recordDetail),
interactivePop: true
) { destination in
RecordDetailView(
goalTitle: store.goalTitle,
record: destination.record,
Expand All @@ -104,13 +104,13 @@ public struct GoalDetailView: View {
private var topBar: some View {
HStack {
if #available(iOS 26.0, *) {
Button(action: dismiss.callAsFunction) {
Button(action: { dismiss() }) {
Image(systemName: "xmark")
}
.topBarButtonStyle(tint: Color.accent)
.disabled(store.isTransitioning)
} else {
Button(action: dismiss.callAsFunction) {
Button(action: { dismiss() }) {
Text(RecordPresentation.text("common_close"))
}
.topBarButtonStyle(tint: Color.accent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct RecordVersionDetailView: View {

private var topBar: some View {
HStack {
NavigationBackButton(action: dismiss.callAsFunction)
NavigationBackButton(action: { dismiss() })
.disabled(store.isRestoring)
Spacer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct RecordVersionHistoryView: View {
.safeAreaInset(edge: .bottom, spacing: 0) { footer }
.background(Color.appBackground)
.toolbarVisibility(.hidden, for: .navigationBar)
.navigationDestination(item: $destination) { destination in
.navigationDestination(item: $destination, interactivePop: true) { destination in
RecordVersionDetailView(
store: store,
version: destination.version
Expand All @@ -47,7 +47,7 @@ struct RecordVersionHistoryView: View {

private var topBar: some View {
HStack {
NavigationBackButton(action: dismiss.callAsFunction)
NavigationBackButton(action: { dismiss() })
Spacer()
}
.padding(.horizontal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,11 @@ struct GoalDetailDestinationTests {
await store.send(.view(.selectRecord(item))) {
$0.recordDetail = RecordDetailDestination(record: record)
}
await store.send(.recordDetail(.dismiss)) {
$0.recordDetail = nil
}
await store.send(.view(.selectRecord(item))) {
$0.recordDetail = RecordDetailDestination(record: record)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ struct DevelopmentGoalSection: View {
.font(.subheadline.weight(.semibold))
.foregroundStyle(Color.textSecondary)
}
.accessibilityLabel(
String(localized: "development_goal_create_title", bundle: PresentationResources.bundle)
)
}
.accessibilityElement(children: .combine)
}
}

Expand Down Expand Up @@ -160,7 +156,6 @@ private struct DevelopmentGoalCard: View {
.padding(18)
.background(Color.surface, in: .rect(cornerRadius: 24))
.contentShape(.rect)
.accessibilityElement(children: .combine)
}
}

Expand Down Expand Up @@ -212,7 +207,6 @@ struct DevelopmentTodoProgressView: View {
}
.frame(height: 8)
}
.accessibilityElement(children: .combine)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ struct DevelopmentSummaryCard: View {
}
.padding(20)
.background(Color.surface, in: .rect(cornerRadius: 28))
.accessibilityElement(children: .combine)
}

@ViewBuilder
Expand Down
25 changes: 11 additions & 14 deletions Application/Presentation/HomeTab/Sources/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,14 @@ public struct HomeView: View {
public var body: some View {
NavigationStack(path: $path) {
ScrollView {
LazyVStack(alignment: .leading, spacing: 16, pinnedViews: [.sectionHeaders]) {
Section {
DevelopmentSummaryCard(
items: store.developmentGoalItems,
isLoading: store.isDevelopmentGoalsLoading,
hasLoaded: store.hasDevelopmentGoalsLoaded,
hasLoadFailure: store.hasDevelopmentGoalsLoadFailure
)
todoSection
} header: {
topBar
.toolbarBackground(Color.appBackground)
}
LazyVStack(alignment: .leading, spacing: 16) {
DevelopmentSummaryCard(
items: store.developmentGoalItems,
isLoading: store.isDevelopmentGoalsLoading,
hasLoaded: store.hasDevelopmentGoalsLoaded,
hasLoadFailure: store.hasDevelopmentGoalsLoadFailure
)
todoSection
DevelopmentGoalSection(
items: store.developmentGoalItems,
isLoading: store.isDevelopmentGoalsLoading,
Expand All @@ -71,6 +66,7 @@ public struct HomeView: View {
}
.padding(.horizontal, 16)
}
.safeAreaInset(edge: .top, spacing: 0) { topBar }
.background(Color.appBackground)
.toolbarVisibility(.hidden, for: .navigationBar)
.navigationDestination(for: HomeRoute.self, destination: destinationView)
Expand Down Expand Up @@ -158,8 +154,10 @@ public struct HomeView: View {
.disabled(!store.isNetworkConnected)
}
}
.padding(.horizontal, 16)
.padding(.bottom, 8)
.background(Color.appBackground)
.toolbarBackground(Color.appBackground)
}

@ViewBuilder
Expand Down Expand Up @@ -347,7 +345,6 @@ public struct HomeView: View {
color: item.color,
in: RoundedRectangle(cornerRadius: 20)
)
.accessibilityHidden(true)
Text(item.localizedName)
.font(.subheadline)
.foregroundStyle(Color.textSecondary)
Expand Down
36 changes: 19 additions & 17 deletions Application/Presentation/HomeTab/Sources/Search/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,29 @@ struct SearchView: View {
var body: some View {
NavigationStack(path: $router.path) {
ScrollView {
LazyVStack(alignment: .leading, spacing: 16, pinnedViews: [.sectionHeaders]) {
Section {
if !store.searchQuery.isEmpty {
SearchResults(
store: store,
onSelectTodo: { router.push(.todo($0)) }
)
.padding(.bottom, 8)
}
RecentSearchQuries(store: store)
.padding(.bottom, 8)
instruction
} header: {
tipCard
.padding(.bottom, 8)
.background(Color.appBackground)
LazyVStack(alignment: .leading, spacing: 16) {
if !store.searchQuery.isEmpty {
SearchResults(
store: store,
onSelectTodo: { router.push(.todo($0)) }
)
.padding(.bottom, 8)
}
RecentSearchQuries(store: store)
.padding(.bottom, 8)
instruction
}
.padding(.horizontal)
}
.safeAreaInset(edge: .top, spacing: 0) { topBar }
.safeAreaInset(edge: .top, spacing: 0) {
VStack(spacing: 0) {
topBar
tipCard
.padding(.horizontal)
.padding(.bottom, 8)
}
.background(Color.appBackground)
}
.background(Color.appBackground.ignoresSafeArea())
.prominentAlert(store, state: \.alert, action: \.alert)
.navigationDestination(for: Path.self) { path in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,20 @@ public struct PushNotificationListView: View {
let sections = store.query.sortOrder == .latest ? [recent, previous] : [previous, recent]

ScrollView {
LazyVStack(alignment: .leading, spacing: 20, pinnedViews: [.sectionHeaders]) {
Section {
if notifications.isEmpty {
Text(String(localized: "push_notifications_empty", bundle: PresentationResources.bundle))
.font(.callout)
.foregroundStyle(Color.textSecondary)
.frame(maxWidth: .infinity)
.padding(.vertical, 32)
.background(Color.surface, in: .rect(cornerRadius: 16))
} else {
ForEach(sections.indices, id: \.self) { index in
let items = sections[index]
let isRecent = (index == 0) == (store.query.sortOrder == .latest)
if !items.isEmpty {
VStack(alignment: .leading, spacing: 12) {
LazyVStack(alignment: .leading, spacing: 20) {
if notifications.isEmpty {
Text(String(localized: "push_notifications_empty", bundle: PresentationResources.bundle))
.font(.callout)
.foregroundStyle(Color.textSecondary)
.frame(maxWidth: .infinity)
.padding(.vertical, 32)
.background(Color.surface, in: .rect(cornerRadius: 16))
} else {
ForEach(sections.indices, id: \.self) { index in
let items = sections[index]
let isRecent = (index == 0) == (store.query.sortOrder == .latest)
if !items.isEmpty {
VStack(alignment: .leading, spacing: 12) {
HStack(spacing: 8) {
Text(String(
localized: isRecent ? "push_notifications_new" : "push_notifications_previous",
Expand Down Expand Up @@ -181,28 +180,32 @@ public struct PushNotificationListView: View {
}
}
}
}
}
}
}
} header: {
VStack(alignment: .leading, spacing: 12) {
Text(String(localized: "nav_push_notifications", bundle: PresentationResources.bundle))
.font(.largeTitle.bold())
.padding(.bottom, 8)
ScrollView(.horizontal) {
headerContent
}
.scrollIndicators(.hidden)
.padding(.horizontal, -16)
.contentMargins(.horizontal, 16, for: .scrollContent)
}
}
}
.padding(.horizontal, 16)
}
.safeAreaInset(edge: .top, spacing: 0) {
VStack(alignment: .leading, spacing: 12) {
Text(String(localized: "nav_push_notifications", bundle: PresentationResources.bundle))
.font(.largeTitle.bold())
.padding(.bottom, 8)
.background(Color.appBackground)
.toolbarBackground(Color.appBackground)

ScrollView(.horizontal) {
headerContent
}
.scrollIndicators(.hidden)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, -16)
.contentMargins(.horizontal, 16, for: .scrollContent)
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal, 16)
.padding(.bottom, 8)
.background(Color.appBackground)
.toolbarBackground(Color.appBackground)
}
.scrollDisabled(notifications.isEmpty || store.isLoading)
}
Expand Down
Loading
Loading