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 @@ -13,10 +13,6 @@ public struct GoalCreateView: View {
@Environment(\.dismiss) private var dismiss
@State private var store: StoreOf<GoalCreateFeature>
@FocusState private var focusedField: GoalCreateField?
@ScaledMetric(relativeTo: .title) private var iconSize = UIFont.preferredFont(
forTextStyle: .title2,
compatibleWith: UITraitCollection(preferredContentSizeCategory: .large)
).lineHeight
private let onCompletion: (DevelopmentGoal) -> Void

public init(onCompletion: @escaping (DevelopmentGoal) -> Void = { _ in }) {
Expand All @@ -42,7 +38,6 @@ public struct GoalCreateView: View {
}
.safeAreaInset(edge: .top, spacing: 0) {
GoalCreateTopBar(
iconSize: iconSize,
isSaving: store.isSaving,
onClose: dismiss.callAsFunction
)
Expand Down Expand Up @@ -76,7 +71,6 @@ public struct GoalCreateView: View {
}

private struct GoalCreateTopBar: View {
let iconSize: CGFloat
let isSaving: Bool
let onClose: () -> Void

Expand All @@ -89,13 +83,11 @@ private struct GoalCreateTopBar: View {
Button(action: onClose) {
if #available(iOS 26.0, *) {
Image(systemName: "xmark")
.frame(width: iconSize, height: iconSize)
.font(.title)
} else {
Text(RecordPresentation.text("common_close"))
}
}
.topBarButtonStyle()
.topBarButtonStyle(tint: Color.accent)
.disabled(isSaving)

Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import PresentationShared

struct GoalCreateTodoSelectionSheet: View {
@Bindable var store: StoreOf<GoalCreateTodoSelectionFeature>
@ScaledMetric(relativeTo: .title) private var iconSize = UIFont.preferredFont(
forTextStyle: .title2,
compatibleWith: UITraitCollection(preferredContentSizeCategory: .large)
).lineHeight

var body: some View {
ScrollView {
Expand Down Expand Up @@ -94,28 +90,23 @@ struct GoalCreateTodoSelectionSheet: View {
} label: {
if #available(iOS 26.0, *) {
Image(systemName: "xmark")
.frame(width: iconSize, height: iconSize)
.font(.title)
} else {
Text(RecordPresentation.text("common_close"))
}
}
.topBarButtonStyle(color: Color.surface)
.topBarButtonStyle()
Spacer()
Button {
store.send(.view(.save))
} label: {
if #available(iOS 26.0, *) {
Image(systemName: "checkmark")
.frame(width: iconSize, height: iconSize)
.foregroundStyle(Color.primary)
.font(.title)
} else {
Text(RecordPresentation.text("development_goal_todo_done"))
.foregroundStyle(Color.accent)
}
}
.topBarButtonStyle(color: Color.surface)
.topBarButtonStyle()
}
}
.padding(.horizontal, 16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public struct RecordDetailView: View {
Spacer()
}
.padding(.horizontal)
.padding(.vertical, 12)
.background(Color.appBackground, ignoresSafeAreaEdges: .top)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ public struct RecordEditorView: View {
@Environment(\.dismiss) private var dismiss
@State private var store: StoreOf<RecordEditorFeature>
@FocusState private var focusedField: Field?
@ScaledMetric(relativeTo: .title) private var iconSize = UIFont.preferredFont(
forTextStyle: .title2,
compatibleWith: UITraitCollection(preferredContentSizeCategory: .large)
).lineHeight
private let onCompletion: () -> Void

public init(
Expand Down Expand Up @@ -71,8 +67,6 @@ public struct RecordEditorView: View {
} label: {
if #available(iOS 26.0, *) {
Image(systemName: "xmark")
.frame(width: iconSize, height: iconSize)
.font(.title)
} else {
Text(RecordPresentation.text("common_close"))
}
Expand All @@ -93,15 +87,12 @@ public struct RecordEditorView: View {
} label: {
if #available(iOS 26.0, *) {
Image(systemName: "checkmark")
.frame(width: iconSize, height: iconSize)
.foregroundStyle(Color.primary)
.font(.title)
} else {
Text(RecordPresentation.text("development_record_save"))
.foregroundStyle(Color.accent)
}
}
.topBarButtonStyle(color: Color.surface)
.topBarButtonStyle()
.disabled(!store.isReadyToSave)
}
.padding(.horizontal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ public struct GoalDetailView: View {
}

public var body: some View {
presentedContent
.overlay {
if store.isTransitioning {
LoadingView()
NavigationStack {
presentedContent
.overlay {
if store.isTransitioning {
LoadingView()
}
}
}
}
}

private var mainContent: some View {
Expand Down Expand Up @@ -101,28 +103,50 @@ public struct GoalDetailView: View {

private var topBar: some View {
HStack {
RecordBackButton(action: dismiss.callAsFunction)
if #available(iOS 26.0, *) {
Button(action: dismiss.callAsFunction) {
Image(systemName: "xmark")
}
.topBarButtonStyle(tint: Color.accent)
.disabled(store.isTransitioning)
} else {
Button(action: dismiss.callAsFunction) {
Text(RecordPresentation.text("common_close"))
}
.topBarButtonStyle(tint: Color.accent)
.disabled(store.isTransitioning)
}
Spacer()
if let status = store.goalStatus {
Image(systemName: "ellipsis")
.font(.title3.weight(.semibold))
.frame(width: 28, height: 28)
.prominentMenu(
items: statusMenuItems(status),
isEnabled: !store.isLoading && !store.isTransitioning
) { status in
store.send(.view(.selectStatus(status)))
}
.adaptiveButtonStyle(
shape: .circle,
color: .surface,
glassEffect: .enabled
)
if #available(iOS 26.0, *) {
Image(systemName: "ellipsis")
.prominentMenu(
items: statusMenuItems(status),
isEnabled: !store.isLoading && !store.isTransitioning
) { status in
store.send(.view(.selectStatus(status)))
}
.topBarButtonStyle()
} else {
Image(systemName: "ellipsis")
.font(.title3.weight(.semibold))
.frame(width: 28, height: 28)
.prominentMenu(
items: statusMenuItems(status),
isEnabled: !store.isLoading && !store.isTransitioning
) { status in
store.send(.view(.selectStatus(status)))
}
.adaptiveButtonStyle(
shape: .circle,
color: .surface,
glassEffect: .enabled
)
}
}
}
.padding(.horizontal)
.padding(.bottom, 12)
.padding(.vertical, 12)
.background(Color.appBackground, ignoresSafeAreaEdges: .top)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import Domain
import PresentationShared

struct GoalTodoLinkSheet: View {
@Bindable var store: StoreOf<GoalTodoLinkFeature>
@ScaledMetric(relativeTo: .title) private var iconSize = UIFont.preferredFont(
forTextStyle: .title2,
compatibleWith: UITraitCollection(preferredContentSizeCategory: .large)
).lineHeight
@Bindable var store: StoreOf<GoalTodoLinkFeature>

var body: some View {
ScrollView {
Expand Down Expand Up @@ -53,40 +53,46 @@ struct GoalTodoLinkSheet: View {
} label: {
if #available(iOS 26.0, *) {
Image(systemName: "xmark")
.frame(width: iconSize, height: iconSize)
.font(.title)
} else {
Text(RecordPresentation.text("common_close"))
}
}
.topBarButtonStyle(color: Color.surface)
.topBarButtonStyle()
.disabled(store.isUpdating)
Spacer()
HStack(spacing: 8) {
Image(systemName: "ellipsis")
.font(.title3.weight(.semibold))
.frame(width: iconSize, height: iconSize)
.prominentMenu(
items: clearSelectionMenuItems,
isEnabled: store.canClearSelection
) { _ in
store.send(.view(.clearSelection))
}
.topBarButtonStyle(color: Color.surface)
if #available(iOS 26.0, *) {
Image(systemName: "ellipsis")
.prominentMenu(
items: clearSelectionMenuItems,
isEnabled: store.canClearSelection
) { _ in
store.send(.view(.clearSelection))
}
.topBarButtonStyle()
} else {
Image(systemName: "ellipsis")
.font(.title3.weight(.semibold))
.frame(width: iconSize, height: iconSize)
.prominentMenu(
items: clearSelectionMenuItems,
isEnabled: store.canClearSelection
) { _ in
store.send(.view(.clearSelection))
}
.topBarButtonStyle()
}
Button {
store.send(.view(.save))
} label: {
if #available(iOS 26.0, *) {
Image(systemName: "checkmark")
.frame(width: iconSize, height: iconSize)
.foregroundStyle(Color.primary)
.font(.title)
} else {
Text(RecordPresentation.text("development_goal_todo_done"))
.foregroundStyle(Color.accent)
}
}
.topBarButtonStyle(color: Color.surface)
.topBarButtonStyle()
.disabled(!store.canSave)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct RecordVersionHistoryView: View {
Spacer()
}
.padding(.horizontal)
.padding(.bottom, 12)
.padding(.vertical, 12)
.background(Color.appBackground, ignoresSafeAreaEdges: .top)
}

Expand Down Expand Up @@ -268,12 +268,19 @@ struct RecordBackButton: View {
let action: () -> Void

var body: some View {
Button(action: action) {
Image(systemName: "chevron.left")
.font(.title3.weight(.semibold))
.frame(width: 28, height: 28)
if #available(iOS 26.0, *) {
Button(action: action) {
Image(systemName: "chevron.left")
}
.topBarButtonStyle()
} else {
Button(action: action) {
Image(systemName: "chevron.left")
.font(.title3.weight(.semibold))
.frame(width: 28, height: 28)
}
.adaptiveButtonStyle(shape: .circle, color: .surface, glassEffect: .enabled)
}
.adaptiveButtonStyle(shape: .circle, color: .surface, glassEffect: .enabled)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ struct LoginButton: View {
.tint(Color.accent)
} else {
Text(text)
.foregroundStyle(.primary)
.foregroundStyle(Color.textSecondary)
}
}
.font(.system(.body))
.contentShape(.rect(cornerRadius: 12))
.frame(width: 300, height: height + 24)
.background {
RoundedRectangle(cornerRadius: 12)
.stroke(Color.border, lineWidth: 3)
.stroke(Color.border, lineWidth: 1)
.fill(Color.surface)
}
.overlay(alignment: .leading) {
Expand Down
Loading
Loading