fix: window session reset, model-row locking, startup order, hotkey release, counter, history gate, dictionary editor and search polish
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -95,6 +95,7 @@ struct DictionaryView: View {
|
||||
selection = nil
|
||||
}
|
||||
}
|
||||
.onChange(of: model.searchFocusTick) { _, _ in searchFocused = true }
|
||||
.onChange(of: list.rows) { _, rows in
|
||||
if let s = selection, !rows.contains(where: { $0.id == s }) { selection = nil }
|
||||
}
|
||||
@@ -215,7 +216,9 @@ private struct EntryEditor: View {
|
||||
HStack(spacing: Space.s3) {
|
||||
Spacer()
|
||||
Button(Strings.cancel, action: onClose).buttonStyle(KeyButtonStyle())
|
||||
.keyboardShortcut(.cancelAction)
|
||||
Button(Strings.save, action: save).buttonStyle(KeyButtonStyle(kind: .record)).disabled(!canSave)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
}
|
||||
}
|
||||
.padding(Layout.panelPadding)
|
||||
@@ -246,6 +249,11 @@ private struct EntryEditor: View {
|
||||
|
||||
private func save() {
|
||||
if let id = editingID {
|
||||
guard list.rows.contains(where: { $0.id == id }) else {
|
||||
list.errorMessage = Strings.entryGone
|
||||
onClose()
|
||||
return
|
||||
}
|
||||
list.update(id: id, to: kind)
|
||||
} else {
|
||||
list.add(kind)
|
||||
|
||||
Reference in New Issue
Block a user