Skip to content

Pattern editor dialog closes unexpectedly and custom tunes lost on edit #146

@lezardsemelle

Description

@lezardsemelle

Description

Two related bugs occur when creating and editing custom tunes:

Bug A — Editor dialog closes on edit

When a user creates a new tune and edits its pattern, the pattern editor dialog closes unexpectedly as soon as a stroke is modified. This makes it very difficult to edit custom patterns.

Bug B — Custom tunes disappear from current state

After creating custom tunes, they can disappear from the current view. Users have to navigate back through the history picker to recover them.

Root cause

Both bugs are caused by a feedback loop in src/services/history.ts. The storage watcher (line 50) triggers loadHistoricState() after every saveCurrentState() call. This can replace the entire state.value object, which disrupts the modal lifecycle and can cause data loss.

Steps to reproduce

  1. Go to the Compose tab
  2. Click New tune, enter a name, confirm
  3. In the pattern editor that opens, try to edit strokes → dialog closes (Bug A)
  4. Create multiple tunes, refresh the page → some tunes are missing (Bug B)

Fix

See PR #145

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions