Service Layer medium complexity mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Business logic layer for the Note Editor that manages note creation and update operations. Debounces user input and triggers auto-save writes to the local Drift database to ensure no data is lost during backgrounding or power loss. Coordinates navigation back to the Notes List after save confirmation.

Feature: Note Editor

note-editor-controller

Sources & reasoning

Same matrix evidence as Notes List - all organizations, Phase 2 (v1.0). The Note Editor is the companion write screen; the two features are split per the blueprint's explicit decomposition of the Notes area into separate list and editor features, each with a distinct component set.

Responsibilities

  • Load an existing note from the Drift database by ID or initialise a blank note for creation
  • Debounce title and body change events and persist the current note state via auto-save
  • Expose save status to the UI layer so the screen can show appropriate feedback
  • Handle back-navigation by ensuring any pending save completes before popping the route
  • Propagate database errors to the UI as non-blocking status updates

Interfaces

loadNote(noteId: String?): Future<Note>
onTitleChanged(title: String): void
onBodyChanged(body: String): void
saveNow(): Future<SaveResult>
navigateBack(): void