2024-12-09: Record Editing, Deletion & Data Access

Completed

Soft Delete with Undo

  • Delete buttons now use soft delete with 60-second undo window
  • PendingDeletion struct tracks deleted records with countdown
  • PendingDeletionRow component shows “Deleted” with timer and Undo button
  • Records deleted immediately from storage, restored on undo
  • Cleanup timer auto-removes expired pending deletions

Open Data Folder

  • macOS: “Open Data Folder” button in sidebar opens ~/Documents/Minuta/ in Finder
  • iOS: Settings shows data folder path with copy-to-clipboard button
  • Added public storageURL property to LocalFileStorageService

TagComboBox Component

  • Replaced simple Picker with combobox-style tag selector
  • Type to filter existing tags
  • Type new name + click “Create” to add new tag inline
  • Auto-selects on exact match
  • Dropdown with color indicators and checkmark for selected
  • Works on both macOS and iOS

Record Editing

  • Added updateRecord() to AppState on both platforms
  • Running timers now editable inline (tag + comment)
  • Completed records have pencil icon to open editor
  • macOS: Inline editing with Save/Cancel
  • iOS: Sheet-based editing (RecordEditorSheet)
  • Start/end time editing via DatePicker (both platforms)
  • Duration updates dynamically when editing times

New Components

  • TagComboBox.swift - Combobox-style tag selector
  • RecordEditor.swift - Contains:
    • PendingDeletionRow - Shows deleted record with countdown and Undo button
    • RunningTimerEditor - Inline editor for running timers
    • EditableRecordRow - Completed record with edit button
    • RecordEditorSheet (iOS) - Modal editor for completed records

Files Changed

Shared

  • FileStorageService.swift - Added public storageURL property

macOS

  • TimeTrackerMacApp.swift - Added updateRecord(), createTag(), softDeleteRecord(), undoDelete(), pendingDeletions
  • TodayView.swift - Uses RunningTimerEditor, EditableRecordRow, PendingDeletionRow
  • TagComboBox.swift - New combobox component
  • RecordEditor.swift - New editor components with PendingDeletionRow
  • ContentView.swift - Added “Open Data Folder” button in sidebar

iOS

  • TimeTrackerIOSApp.swift - Added updateRecord(), createTag(), softDeleteRecord(), undoDelete(), pendingDeletions
  • TodayView.swift - Uses RunningTimerEditor, EditableRecordRow, PendingDeletionRow
  • TagComboBox.swift - New combobox component (iOS-adapted)
  • RecordEditor.swift - New editor components with sheet and PendingDeletionRow
  • SettingsView.swift - Added data folder path display with copy button

Development Notes

  • User preference: Always sync changes between macOS and iOS apps simultaneously
  • TagComboBox uses platform-specific background colors (#if os(iOS))
  • Running timer keeps updating duration while in edit mode
  • Soft delete uses 60-second undo window with auto-cleanup timer