Record Editor

Unified editor for both running timers and completed records.

Modes

Running Timer Mode

  • Live ticking duration via TimelineView
  • Blue circle stop button
  • Tag selector (sorted by last usage — see below)
  • Comment text field
  • Auto-saves on edit (no Save button)
  • Tags created only when stopped

Tag Sort Order

The tag selector lists active (non-archived) tags sorted by most recent usage. “Last usage” is the most recent startTime of any record that references the tag; never-used tags fall to the bottom alphabetically (case-insensitive). The map is built once on loadData from a full loadAllRecords() scan and updated incrementally on startTimer and updateRecord. Computed via AppState.activeTagsByLastUsage. The history Tag Filter view continues to use unsorted activeTags.

Completed Record Mode

  • Start/End date pickers
  • Duration display (calculated)
  • Tag selector
  • Multiline comment (TextEditor, 60-120pt)
  • Image gallery with add/remove
  • Cancel/Save buttons
  • Close (X) button at top

Image Support

Uses RecordImageViews components:

  • Thumbnail gallery
  • “Add photo” link (opens picker)
  • “Browse files” link (document picker on Mac)
  • Full-screen viewer with pinch-to-zoom
  • Context menu: View, Share, Delete

Validation

  • End time must be after start time
  • Shows error if invalid range

Callbacks

var onDismissEdit: (() -> Void)?
var onRecordUpdated: ((TimeRecord) -> Void)?
var startInEditMode: Bool = false

Related