Skip to content

Fix timeline panel not populating on session restore#234

Open
throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
throb:fix/session-restore-timeline
Open

Fix timeline panel not populating on session restore#234
throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
throb:fix/session-restore-timeline

Conversation

@throb
Copy link

@throb throb commented Mar 17, 2026

Summary

  • Race condition in SessionModel: updateViewportCurrentMediaContainerIndexFromBackend() ran before the model tree was fully built. The async requestData(childrenRole) populates playlists and their timeline children progressively, but the container lookup executed before timeline nodes existed in the tree. Added a re-trigger of both container index lookups at the end of processChildren() when the parent type is Session, Container List, or Playlist.
  • QML timeline panel only handled typeRole=="Timeline": When the restored viewed container is a Playlist (common — the session stores the Playlist UUID, not the Timeline UUID), the timeline panel did nothing. Added a Playlist handler that finds the first Timeline child in the Playlist's Container List and switches the viewed container to it, with async retry if children haven't loaded yet.

This fixes the "Saved sessions might not restore media correctly (Windows only)" known issue from the README — though the timing bug in processChildren affects all platforms, not just Windows.

Test plan

  • Save a session with a timeline visible, close and re-open — timeline panel should auto-populate
  • Save a session with a playlist (containing a timeline) as the active view — timeline should still appear
  • Verify normal interactive timeline switching still works (click playlist → click timeline within it)
  • Test on both Windows and Linux

🤖 Generated with Claude Code

Two issues prevented the timeline panel from displaying after loading
a saved session:

1. Race condition in SessionModel: updateViewportCurrentMediaContainer-
   IndexFromBackend() was called before the model tree was fully built.
   The async requestData(childrenRole) populates playlists and their
   children (timelines) progressively, but the container lookup ran
   before the timeline nodes existed. Added a re-trigger of both
   container index lookups at the end of processChildren() when the
   parent type is Session, Container List, or Playlist.

2. QML timeline panel only handled typeRole=="Timeline" in
   viewedMediaSetChanged(). When the restored viewed container is a
   Playlist (which is common — the session stores the Playlist UUID),
   the timeline panel did nothing. Added a Playlist handler that finds
   the first Timeline child in the Playlist's Container List and
   switches the viewed container to it, with async retry if the
   children haven't loaded yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant