listless

A simple list app for Apple platforms
Log | Files | Refs | README | LICENSE

commit c068367cd2ccb2e8b2f1fe3e307ae2c456fb522a
parent 04a23f1982f8771de5dde84ceb8cd2cbe402f175
Author: Michael Camilleri <[email protected]>
Date:   Thu,  5 Mar 2026 08:26:13 +0900

Tweak display of toast notification

Diffstat:
MAGENTS.md | 1+
MListlessiOS/Extensions/TaskListView+Undo.swift | 6+++---
MListlessiOS/Views/UndoToast.swift | 8++++----
3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md @@ -52,6 +52,7 @@ - `TaskStore.createTask(title:atBeginning:)` accepts an `atBeginning` flag (default `false`); when `true` assigns `minSortOrder - 1000` to prepend the task before all existing active tasks. `createTask` does **not** save — callers must call `store.save()` explicitly when they want to persist. This keeps empty placeholder tasks (from background tap or Return) in-memory only until the user types, avoiding iCloud sync of transient objects. - Completed tasks display below active ones; never reorder or edit them in-place. - For selection state in ForEach contexts, use computed Bool values + callbacks rather than passing @Binding to children (avoids SwiftUI update issues). +- The codebase uses "task" internally (e.g. `TaskItem`, `TaskStore`, `deleteTask`) but user-facing text (labels, toast messages, menu items) should use "item" instead. ## Sync & Data Guidelines - Core Data with `NSPersistentCloudKitContainer` handles persistence and iCloud sync; configured in `PersistenceController` within `Listless/Sync`. diff --git a/ListlessiOS/Extensions/TaskListView+Undo.swift b/ListlessiOS/Extensions/TaskListView+Undo.swift @@ -4,7 +4,7 @@ extension TaskListView { func deleteTaskWithUndo(_ task: TaskItem) { deleteTask(task) - showUndoToast(message: "Task deleted") + showUndoToast(message: "Item deleted") } func deleteSelectedTaskWithUndo() -> KeyPress.Result { @@ -34,8 +34,8 @@ extension TaskListView { return } managedObjectContext.undoManager?.endUndoGrouping() - let noun = count == 1 ? "task" : "tasks" - showUndoToast(message: "\(count) completed \(noun) cleared") + let noun = count == 1 ? "item" : "items" + showUndoToast(message: "\(count) \(noun) cleared") } func showUndoToast(message: String) { diff --git a/ListlessiOS/Views/UndoToast.swift b/ListlessiOS/Views/UndoToast.swift @@ -13,16 +13,16 @@ struct UndoToastView: View { var body: some View { HStack(spacing: 12) { Text(data.message) - .font(.subheadline) + .font(.body) .foregroundStyle(.white) Button(action: onUndo) { Text("Undo") - .font(.subheadline.weight(.semibold)) + .font(.body.weight(.semibold)) .foregroundStyle(.yellow) } } - .padding(.horizontal, 16) - .padding(.vertical, 12) + .padding(.horizontal, 20) + .padding(.vertical, 14) .background( RoundedRectangle(cornerRadius: 12) .fill(Color(white: 0.2))