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
- 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).
- 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).
- Surface the state — clear UI indicator when multiple skeletons exist, with affordance to pick a primary or dedup.
- 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
Tracking work to make the frontend robust against
Labelscontaining multiple skeletons.Layer context
sleap-io.js) — already plural-first:Labelsexposesskeletons: Skeleton[]only, with no singularskeletonaccessor. No equivalent of the PythonLabels.skeletonValueError footgun. Good baseline.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 calledlabels.skeleton(singular) and crashed withValueError: 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-hoctry/exceptpatches; others didn't.Legacy
.slpfiles in the wild still carry redundant skeletons. The frontend should handle these gracefully and not let user workflows recreate that state.Required frontend behaviour
sleap-io.jsif useful elsewhere).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):
sleap/gui/app.py:1742. Legacy report: Error occurs during creation of subsequent training configurations and merging predictions in SLEAP GUI sleap#1090.sleap/gui/dialogs/merge.py:50, 63-64. Legacy report: Error occurs during creation of subsequent training configurations and merging predictions in SLEAP GUI sleap#1090 (second traceback).sleap/gui/commands.py:3034(# Assumes single skeleton).sleap/gui/commands.py:3120(# Assume single skeleton).Related legacy sleap issues
Acceptance criteria
sleap-io.js