Today Fibich crosses an important line for playlists: they can now persist.
Recently, the app gained multiple playlists, playlist tabs, renaming, adjustable headers, and better playlist interaction. That made the playlist area more useful, but one piece was missing. If a playlist disappears when the app closes, it is only a temporary queue.
So today's work focuses on making playlists durable with SwiftData.
Persistence requires more than saving an array of tracks. Fibich needs to remember playlist names, playlist items, playlist order, the selected playlist, and enough identity information to connect stored playlist entries back to real library items and files. That is where the code becomes more delicate.
A playlist is not the same thing as the library. The library represents the music collection. A playlist represents a user's chosen listening context. It may contain tracks from the library, files opened from Finder, or tracks added by drag and drop. The app needs to preserve that distinction without losing track of what each playlist item points to.
That led to a new playlist persistence layer, separate fetchers, persistence coordination, and a small store for playlist ordering. There is also a draft model now, which helps keep the data being prepared separate from the stored model. This is useful because saving something too early, or in the wrong shape, can create awkward bugs later.
One of the main obstacles is identity.
If a user creates several playlists, renames them, switches between them, and later reopens the app, Fibich needs to know which playlist is which. If two items have the same title, that is not enough. If a track moves in the UI, the app needs to know whether it is the same item in a new position or a different item entirely. Durable playlists require stable identifiers rather than visible text alone.
The interface also gets a small but important addition: an add-tab view for playlists. That makes the playlist section feel more complete. The user can create new listening spaces instead of only working with what already exists.
A temporary queue works for quick listening. A persisted playlist can hold an album sequence, a test list, a mood, or a long session and still be there next time.
That expectation is basic for a serious music player, but getting it right takes care.
Fibich now combines playback and library browsing with playlists that survive beyond the current session.