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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Destructive queries (DROP, TRUNCATE, DELETE without WHERE) now always ask for confirmation, even with Safe Mode off. (#1481)
- Table structure changes, table creation, maintenance, column reorder, and saved data-grid edits now follow the connection's Safe Mode and read-only setting. (#1481)
- AI assistant and MCP queries now follow the same Safe Mode confirmation, read-only, and authentication rules as the editor. (#1481)
- iOS: sheet close, cancel, and confirm buttons use the native iOS 26 button roles, matching system apps like Mail. iOS 18 keeps titled buttons. (#1524)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct FKPreviewView: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .confirmationAction) {
Button("Done") { dismiss() }
CloseButton { dismiss() }
}
}
.task { await loadReferencedRow() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ struct FilterSheetView: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { dismiss() }
CancelButton { dismiss() }
}
ToolbarItem(placement: .confirmationAction) {
Button("Apply") {
ConfirmButton(title: "Apply") {
filters = draft
logicMode = draftLogicMode
onApply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ struct GroupFormSheet: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { dismiss() }
CancelButton { dismiss() }
}
ToolbarItem(placement: .confirmationAction) {
Button("Save") {
ConfirmButton(title: "Save") {
var group = existingGroup ?? ConnectionGroup()
group.name = name
group.color = color
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import SwiftUI

struct CloseButton: View {
let action: () -> Void

var body: some View {
if #available(iOS 26.0, *) {
Button(role: .close, action: action)
} else {
Button(String(localized: "Done"), action: action)
}
}
}

struct CancelButton: View {
let action: () -> Void

var body: some View {
if #available(iOS 26.0, *) {
Button(role: .cancel, action: action)
} else {
Button("Cancel", role: .cancel, action: action)
}
}
}

struct ConfirmButton: View {
let title: LocalizedStringKey
var isInProgress = false
let action: () -> Void

var body: some View {
if isInProgress {
ProgressView()
.controlSize(.small)
} else if #available(iOS 26.0, *) {
Button(role: .confirm, action: action)
} else {
Button(title, action: action)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ struct TagFormSheet: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { dismiss() }
CancelButton { dismiss() }
}
ToolbarItem(placement: .confirmationAction) {
Button("Save") {
ConfirmButton(title: "Save") {
var tag = existingTag ?? ConnectionTag()
tag.name = name
tag.color = color
Expand Down
2 changes: 1 addition & 1 deletion TableProMobile/TableProMobile/Views/ConnectedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct ConnectedView: View {
Text(String(format: String(localized: "Connecting to %@..."),
connection.name.isEmpty ? connection.host : connection.name))
}
Button(String(localized: "Cancel")) {
Button(String(localized: "Cancel"), role: .cancel) {
dismiss()
}
.buttonStyle(.bordered)
Expand Down
4 changes: 2 additions & 2 deletions TableProMobile/TableProMobile/Views/ConnectionFormView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ struct ConnectionFormView: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { dismiss() }
CancelButton { dismiss() }
}
ToolbarItem(placement: .confirmationAction) {
Button("Save", action: handleSave)
ConfirmButton(title: "Save", action: handleSave)
.disabled(!viewModel.canSave)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct ConnectionListView: View {
SettingsView()
.toolbar {
ToolbarItem(placement: .confirmationAction) {
Button(String(localized: "Done")) {
CloseButton {
showingSettings = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct GroupManagementView: View {
} label: {
Image(systemName: "plus")
}
Button("Done") { dismiss() }
CloseButton { dismiss() }
}
}
.sheet(isPresented: $showingAddGroup) {
Expand Down
11 changes: 2 additions & 9 deletions TableProMobile/TableProMobile/Views/InsertRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,12 @@ struct InsertRowView: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { dismiss() }
CancelButton { dismiss() }
.disabled(isSaving)
}
ToolbarItem(placement: .confirmationAction) {
Button {
ConfirmButton(title: "Save", isInProgress: isSaving) {
Task { await insertRow() }
} label: {
if isSaving {
ProgressView()
.controlSize(.small)
} else {
Text("Save")
}
}
.disabled(isSaving)
}
Expand Down
11 changes: 2 additions & 9 deletions TableProMobile/TableProMobile/Views/RowDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,8 @@ struct RowDetailView: View {
ToolbarItem(placement: .primaryAction) {
if viewModel.canEdit {
if viewModel.isEditing {
Button {
ConfirmButton(title: "Save", isInProgress: viewModel.isSaving) {
Task { await handleSave() }
} label: {
if viewModel.isSaving {
ProgressView()
.controlSize(.small)
} else {
Text("Save")
}
}
.disabled(viewModel.isSaving)
} else {
Expand All @@ -143,7 +136,7 @@ struct RowDetailView: View {

if viewModel.isEditing {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { viewModel.cancelEditing() }
CancelButton { viewModel.cancelEditing() }
.disabled(viewModel.isSaving)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct TagManagementView: View {
} label: {
Image(systemName: "plus")
}
Button("Done") { dismiss() }
CloseButton { dismiss() }
}
}
.sheet(isPresented: $showingAddTag) {
Expand Down
Loading