Watch: review fixes for action errors that vanished, feed refreshes dropped or overwritten around a change, a fresh thread screen per route, errors cleared on sign out, notification actions only while paired, cache writes off the main thread and capped at 30 threads, Ask before acting and Load earlier races, two-letter search, C# headings, and strictly encoded query values
This commit is contained in:
1 parent
99b300855e
commit
25be69fa30
14 files changed
+591
-94
No files matched your search
@@ -172,11 +172,25 @@ struct SearchView: View {
|
||||
}
|
||||
|
||||
/// The field at the top of All threads. Tapping it opens dictation or the keyboard, as any watchOS
|
||||
/// text field does, and submitting opens the results.
|
||||
/// text field does, and submitting opens the results. A search under two letters stays here with a
|
||||
/// hint, since the gateway needs two.
|
||||
private struct SearchField: View {
|
||||
@Environment(AppModel.self) private var model
|
||||
@State private var tooShort = false
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
field
|
||||
if tooShort {
|
||||
Text("Search for at least two letters.")
|
||||
.font(.system(size: 11))
|
||||
.foregroundStyle(Theme.secondaryText)
|
||||
.padding(.horizontal, 8)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var field: some View {
|
||||
TextFieldLink(prompt: Text("Search threads")) {
|
||||
HStack(spacing: 7) {
|
||||
Image(systemName: "magnifyingglass")
|
||||
@@ -195,7 +209,8 @@ private struct SearchField: View {
|
||||
} onSubmit: { text in
|
||||
let query = text.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard !query.isEmpty else { return }
|
||||
model.path.append(.search(query: query))
|
||||
tooShort = query.count < Route.minimumSearch
|
||||
if !tooShort { model.path.append(.search(query: query)) }
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel("Search threads")
|
||||
|
||||
Reference in new issue
Block a user