Skip to content

Commit 1bb338c

Browse files
authored
fix(ios): P3 HIG polish — final batch (#682)
* fix(ios): P3 polish — font sizes, picker styles, clear confirmation * feat(ios): P3 polish — leading swipe, elapsed timer, reconnect indicator
1 parent ea4476b commit 1bb338c

7 files changed

Lines changed: 61 additions & 11 deletions

File tree

TableProMobile/TableProMobile/Views/ConnectedView.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ struct ConnectedView: View {
9191
}
9292
}
9393
.animation(.default, value: isSwitching)
94+
.overlay(alignment: .top) {
95+
if isReconnecting {
96+
HStack(spacing: 6) {
97+
ProgressView()
98+
.controlSize(.mini)
99+
Text(String(localized: "Reconnecting..."))
100+
.font(.caption)
101+
}
102+
.padding(.horizontal, 12)
103+
.padding(.vertical, 6)
104+
.background(.regularMaterial, in: Capsule())
105+
.transition(.move(edge: .top).combined(with: .opacity))
106+
.padding(.top, 4)
107+
}
108+
}
109+
.animation(.default, value: isReconnecting)
94110
}
95111
}
96112
.sensoryFeedback(.success, trigger: hapticSuccess)

TableProMobile/TableProMobile/Views/ConnectionFormView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ struct ConnectionFormView: View {
167167
Text(level.displayName).tag(level)
168168
}
169169
}
170+
.pickerStyle(.menu)
170171
}
171172

172173
if type == .sqlite {
@@ -379,6 +380,7 @@ struct ConnectionFormView: View {
379380
Text("Password").tag(SSHConfiguration.SSHAuthMethod.password)
380381
Text("Private Key").tag(SSHConfiguration.SSHAuthMethod.privateKey)
381382
}
383+
.pickerStyle(.segmented)
382384
}
383385

384386
if sshAuthMethod == .password {

TableProMobile/TableProMobile/Views/ConnectionListView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ struct ConnectionListView: View {
348348
ConnectionRow(connection: connection, tag: appState.tag(for: connection.tagId))
349349
}
350350
.hoverEffect()
351+
.swipeActions(edge: .leading) {
352+
Button {
353+
editingConnection = connection
354+
} label: {
355+
Label("Edit", systemImage: "pencil")
356+
}
357+
.tint(.blue)
358+
}
351359
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
352360
Button {
353361
connectionToDelete = connection

TableProMobile/TableProMobile/Views/DataBrowserView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ private struct RowCard: View {
888888
ForEach(Array(detailPairs.enumerated()), id: \.offset) { _, pair in
889889
HStack(spacing: 6) {
890890
Text(pair.name)
891-
.font(.caption2)
891+
.font(.caption)
892892
.foregroundStyle(.tertiary)
893893
Text(verbatim: pair.value)
894894
.font(.caption)

TableProMobile/TableProMobile/Views/QueryEditorView.swift

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct QueryEditorView: View {
2323
@State private var isExecuting = false
2424
@State private var executionTime: TimeInterval?
2525
@State private var executeTask: Task<Void, Never>?
26+
@State private var executionStartTime: Date?
2627
@Binding var queryHistory: [QueryHistoryItem]
2728
let connectionId: UUID
2829
let historyStorage: QueryHistoryStorage
@@ -31,6 +32,7 @@ struct QueryEditorView: View {
3132
@State private var showWriteConfirmation = false
3233
@State private var showWriteBlockedAlert = false
3334
@State private var pendingWriteQuery = ""
35+
@State private var showClearConfirmation = false
3436
@State private var showShareSheet = false
3537
@State private var shareText = ""
3638
@State private var hapticSuccess = false
@@ -63,6 +65,20 @@ struct QueryEditorView: View {
6365
ActivityViewController(items: [shareText])
6466
}
6567
.sheet(isPresented: $showHistory) { historySheet }
68+
.confirmationDialog(
69+
String(localized: "Clear Query"),
70+
isPresented: $showClearConfirmation,
71+
titleVisibility: .visible
72+
) {
73+
Button(String(localized: "Clear"), role: .destructive) {
74+
query = ""
75+
result = nil
76+
appError = nil
77+
executionTime = nil
78+
}
79+
} message: {
80+
Text("Query text and results will be cleared.")
81+
}
6682
}
6783

6884
// MARK: - Editor
@@ -72,9 +88,16 @@ struct QueryEditorView: View {
7288
SQLHighlightTextView(text: $query)
7389
.frame(minHeight: 80, maxHeight: result != nil || appError != nil ? 120 : 250)
7490

75-
if executionTime != nil || result != nil {
91+
if isExecuting || executionTime != nil || result != nil {
7692
HStack {
77-
if let time = executionTime {
93+
if isExecuting, let startTime = executionStartTime {
94+
TimelineView(.periodic(from: startTime, by: 0.1)) { context in
95+
let elapsed = context.date.timeIntervalSince(startTime)
96+
Label(String(format: "%.1fs", elapsed), systemImage: "clock")
97+
.font(.caption2)
98+
.foregroundStyle(.secondary)
99+
}
100+
} else if let time = executionTime {
78101
Label(String(format: "%.1fms", time * 1000), systemImage: "clock")
79102
.font(.caption2)
80103
.foregroundStyle(.secondary)
@@ -290,10 +313,7 @@ struct QueryEditorView: View {
290313
Divider()
291314

292315
Button(role: .destructive) {
293-
query = ""
294-
result = nil
295-
appError = nil
296-
executionTime = nil
316+
showClearConfirmation = true
297317
} label: {
298318
Label("Clear", systemImage: "trash")
299319
}
@@ -398,7 +418,11 @@ struct QueryEditorView: View {
398418

399419
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
400420
isExecuting = true
401-
defer { isExecuting = false }
421+
executionStartTime = Date()
422+
defer {
423+
isExecuting = false
424+
executionStartTime = nil
425+
}
402426
appError = nil
403427
result = nil
404428

TableProMobile/TableProMobile/Views/RowDetailView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ struct RowDetailView: View {
247247
} label: {
248248
HStack(spacing: 4) {
249249
Image(systemName: "arrow.right.circle.fill")
250-
.font(.caption2)
250+
.font(.footnote)
251251
Text("\(fk.referencedTable).\(fk.referencedColumn)")
252-
.font(.caption2)
252+
.font(.footnote)
253253
}
254254
.foregroundStyle(.blue)
255255
}

TableProMobile/TableProMobile/Views/TagManagementView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct TagManagementView: View {
3131

3232
if tag.isPreset {
3333
Image(systemName: "lock.fill")
34-
.font(.caption2)
34+
.font(.caption)
3535
.foregroundStyle(.secondary)
3636
}
3737

0 commit comments

Comments
 (0)