Skip to content

🛠 - Cue-point management: service, commands, memory-cue flag, editor surface #172

Description

@maxwellmattryan

Problem

For a DJ to stop using Rekordbox for prep, Crate must be where they set hot cues, memory cues, and loops. Today the cues table exists (and is already cloud-synced with _hlc), and models/cue.rs defines Cue/CueType, but nothing else exists: no cue service, no Tauri commands, no shared/api wrapper, no store, no UI. Only backup restore and duplicate cleanup touch the table. Both #5 (waveform editor) and #174 (cue sync to Rekordbox) are blocked on this.

Solution

The data + IPC layer for cues, independent of the waveform UI so it can land first.

Schema (append migration)

  • cues.is_memory INTEGER NOT NULL DEFAULT 0 — per-cue "also a memory cue" flag needed by 🛠 - [Epic] Library syncing with Rekordbox (master.db) #39's cue-destination options
  • cues.created_at TEXT, cues.updated_at TEXT if not present
  • Rekordbox allows 8 hot cues (A–H): enforce hot_cue_index in 0..8 and uniqueness per track at the service layer
  • Register the new column with the cloud-sync row serializer (cloud_sync/pipeline/rows.rs) so it syncs like the rest of the row

Backend

  • services/cue.rs (promote to services/cue/ if it grows): list_for_track, list_for_tracks (batch, for track-list badges), create, update (position, loop end, name, color, hot index, memory flag), delete, reorder_hot_cues, delete_all_for_track
  • Dirty-marking for cloud sync on every write (same pattern as tags/playlists)
  • commands/cue.rs + registration in lib.rs
  • Cue colors constrained to the 8-color palette Crate already uses for tracks so 🛠 - [Epic] Library syncing with Rekordbox (master.db) #39's color mapping is 1:1

Frontend

  • shared/types: extend Cue with is_memory; shared/api/cues.ts
  • shared/stores/cues.ts (cross-platform; mobile may read cues later) keyed by track id
  • Minimal desktop surface without a waveform: a Cues section in TrackEditor listing cues with editable name/color/hot slot/memory toggle and delete, plus "Set cue at current position" and "Set loop from current position" actions in the player's context menu, using the existing player position. The waveform editor (️🛠 - Add complex waveform player with beatgrid #5) replaces this as the primary surface but this keeps cues usable before it lands.

Acceptance criteria

  • Cues can be created, edited, and deleted via commands; hot-cue slots are unique per track and ≤ 8
  • is_memory flag persists, cloud-syncs, and is included in backup/restore
  • Cue list visible and editable in the track editor; set-cue / set-loop from the player
  • Deleting a track deletes its cues (verify the FK cascade or add explicit cleanup)
  • New strings in all 15 locale files

Relation

Prerequisite for #5 and #174. Independent of the Rekordbox master.db work, so it can run in parallel with #169.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions