Skip to content

Robust multi-skeleton handling across frontend workflows #99

Description

@talmo

Tracking work to make the frontend robust against Labels containing multiple skeletons.

Layer context

  • Data layer (sleap-io.js) — already plural-first: Labels exposes skeletons: Skeleton[] only, with no singular skeleton accessor. No equivalent of the Python Labels.skeleton ValueError footgun. Good baseline.
  • Frontend (this repo) — picks "the" skeleton per workflow. All decisions about which skeleton to use, how to surface multi-skeleton state, and how to remediate it live here.

If a generic dedup or validation utility would help, it could live in sleap-io.js (reusable across consumers) — happy to spin out a companion issue there.

Background

Legacy talmolab/sleap (Python/Qt) had several GUI codepaths that called labels.skeleton (singular) and crashed with ValueError: Labels.skeleton can only be used when there is only a single skeleton... on multi-skeleton projects. Root cause was the old "Load Skeleton" button (talmolab/sleap#713, fixed 2023) silently appending skeletons. Some symptom paths got ad-hoc try/except patches; others didn't.

Legacy .slp files in the wild still carry redundant skeletons. The frontend should handle these gracefully and not let user workflows recreate that state.

Required frontend behaviour

  1. Detect multi-skeleton state on project load and offer a one-click dedup of unused skeletons (port of @roomrys's script — could live in sleap-io.js if useful elsewhere).
  2. Prevent creation of multi-skeleton state during normal workflows (e.g. loading a different skeleton template should replace not append when no instances depend on the old one; explicit confirmation otherwise).
  3. Surface the state — clear UI indicator when multiple skeletons exist, with affordance to pick a primary or dedup.
  4. Validate before launching any workflow that effectively picks a single skeleton, with an actionable error/CTA — not a silent fallback.

Workflows that need explicit multi-skeleton handling

Drawn from where legacy sleap assumed single-skeleton (file refs are for historical context — sleap-app will reimplement these UIs):

Related legacy sleap issues

Acceptance criteria

  • Project-open path detects multi-skeleton state and offers dedup
  • Load/replace-skeleton path cannot silently produce multi-skeleton state
  • Merge path handles or refuses multi-skeleton on either side with a clear message
  • Training launch / export validates a single chosen skeleton before proceeding
  • (Optional) If a generic dedup/validation helper emerges, file it on sleap-io.js

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions