Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C

fix: the playlist ⋯ sheet reads Mix off the curation row on screen

My-Name-Is-Jeff7cafcb5f48ad
diff --git a/harness/playlist/README.md b/harness/playlist/README.md
index c3aece55..d98e05e1 100644
--- a/harness/playlist/README.md
+++ b/harness/playlist/README.md
@@ -50,3 +50,8 @@ identifier and in a mock of the Encore object behind it (`currentState`, `progre
None, waiting, downloading (held at 50%), downloaded, shuffle on, removed with shuffle off, error, each held a
few seconds and announced with a `[harness] state:` line to take a screenshot on. Nothing in it lays anything
out, as on the phone.
+
+`rebuilt` on the launch line rebuilds the curation row at 4.5 s, before the ⋯ sheet opens at 5 s: the row the page
+was handed leaves the window and a new one, in a cell the redesign never hears about, takes its place. The sheet's
+log line has to read "Mix (rebuilt)" and the fired pill has to be "still on screen: yes". Before the sheet looked
+again, it fired the old row's Mix ("still on screen: no").
diff --git a/harness/playlist/build.sh b/harness/playlist/build.sh
index 646efe39..94411c6e 100755
--- a/harness/playlist/build.sh
+++ b/harness/playlist/build.sh
@@ -13,11 +13,11 @@ SDK=$(xcrun --sdk iphonesimulator --show-sdk-path)
xcrun -sdk iphonesimulator clang -target arm64-apple-ios17.0-simulator -fobjc-arc -g -O0 \
-I"$SRC" -I"$SRC/Redesigned/Playlist" -I"$OUT/gen" -isysroot "$SDK" \
-Wno-deprecated-declarations \
- "$(dirname "$0")/main.m" "$(dirname "$0")/stubs.m" \
+ "$(dirname "$0")/main.m" "$(dirname "$0")/../scene.m" "$(dirname "$0")/stubs.m" \
"$OUT"/gen/*.m \
"$SRC"/Core/SGLog.m "$SRC"/Core/SGPrefs.m "$SRC"/Core/SGViewTree.m "$SRC"/Core/SGGlass.m \
"$SRC"/Core/SGBackdrop.m "$SRC"/Core/SGFlagForce.m "$SRC"/Core/SGUIMode.m \
- "$SRC"/Redesigned/Kit/SGRTokens.m "$SRC"/Redesigned/Kit/SGRPalette.m "$SRC"/Redesigned/Kit/SGRField.m "$SRC"/Redesigned/Kit/SGRFlow.m \
+ "$SRC"/Redesigned/Kit/SGRTokens.m "$SRC"/Redesigned/Kit/SGRPalette.m "$SRC"/Redesigned/Kit/SGRField.m "$SRC"/Redesigned/Kit/SGRFlow.m "$SRC"/Redesigned/Kit/SGRFluid.m \
"$SRC"/Redesigned/Kit/SGRGlass.m "$SRC"/Redesigned/Kit/SGRGlyph.m "$SRC"/Redesigned/Kit/SGRRestyle.m \
"$SRC"/Redesigned/Kit/SGRActionRow.m "$SRC"/Redesigned/Kit/SGRDownload.m "$SRC"/Redesigned/Kit/SGRHeaderInfo.m \
"$SRC"/Redesigned/Kit/SGRedesign.m \
@@ -37,6 +37,12 @@ cat > "$OUT/PlaylistHarness.app/Info.plist" <<'PLIST'
<key>UILaunchScreen</key><dict/>
<key>UIApplicationSceneManifest</key><dict>
<key>UIApplicationSupportsMultipleScenes</key><false/>
+ <key>UISceneConfigurations</key><dict>
+ <key>UIWindowSceneSessionRoleApplication</key><array><dict>
+ <key>UISceneConfigurationName</key><string>Default</string>
+ <key>UISceneDelegateClassName</key><string>SGRHarnessScene</string>
+ </dict></array>
+ </dict>
</dict>
</dict></plist>
PLIST
diff --git a/harness/playlist/main.m b/harness/playlist/main.m
index 76eaaaa1..693634d1 100644
--- a/harness/playlist/main.m
+++ b/harness/playlist/main.m
@@ -473,6 +473,23 @@ static void buildLikedSongs(UIViewController *page, CGFloat W) {
pillX += width + 8;
}
+ // `rebuilt` on the launch line: Spotify rebuilds the header's cells before the sheet opens. The row the
+ // page was handed leaves the window and a new one takes its place in a cell the redesign's hook never
+ // sees, so the sheet has to read Mix off the new row: the log has to say "Mix (rebuilt)".
+ if ([NSProcessInfo.processInfo.arguments containsObject:@"rebuilt"]) {
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ CGRect frame = curation.frame;
+ [curation removeFromSuperview];
+ UIView *cell = box(list, UICollectionViewCell.class, frame, nil);
+ UIView *row = box(cell, UIView.class, cell.bounds, @"PlaylistCuration.Row.CurationActionsToolbar");
+ UIButton *mix = (UIButton *)box(row, UIButton.class, CGRectMake(0, 10, 60, 32), @"ListPlatform.ToolbarActions.MixButton");
+ mix.accessibilityLabel = @"Mix (rebuilt)";
+ [mix addTarget:page action:@selector(sgr_pillFired:) forControlEvents:UIControlEventTouchUpInside];
+ label(mix, CGRectMake(8, 8, 44, 16), @"Mix (rebuilt)", 11, UIColor.whiteColor, @"Encore.Label");
+ NSLog(@"[harness] the curation row rebuilt");
+ });
+ }
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// Cleared means an alpha of 0, whether the colour was taken off the layer or the view: the clear
// colour lands on both and reads back with no alpha at all.
diff --git a/tweak/Sources/Redesigned/Playlist/PlaylistMenu.x b/tweak/Sources/Redesigned/Playlist/PlaylistMenu.x
index 60b259be..2807105c 100644
--- a/tweak/Sources/Redesigned/Playlist/PlaylistMenu.x
+++ b/tweak/Sources/Redesigned/Playlist/PlaylistMenu.x
@@ -130,8 +130,8 @@ void SGRPlaylistTakeSort(UIView *page, UIView *button) {
// The cell that carries the curation row, as it lays out. Held from the page rather than from the cell: the
// list reuses the cell once it has scrolled past, and the sheet is opened from the top of a page one is
-// usually well down. Held strongly for the same reason -- the element view Spotify binds to the toolbar is
-// the toolbar's own, so it goes on answering wherever the cell it was in ends up.
+// usually well down. Held strongly for the same reason, so there is still a row to fire once the cell is gone;
+// but a row Spotify has rebuilt since is a stale one, which is why the sheet asks curationIn first.
void SGRPlaylistTakeCuration(UIView *cell) {
UIView *toolbar = SGRFindByIdentifier(cell, SGRPlaylistCurationIdentifier, &kToolbarKey);
UIView *page = toolbar ? SGRPlaylistPageOf(cell) : nil;
@@ -296,17 +296,19 @@ static UITableView *tableIn(UIView *root, int depth) {
return nil;
}
-// The curation row of the page, held from the cell's own pass where there has been one, and looked for on
-// the page where there has not: the row is a cell closed up to nothing, and a collection view lays out
-// what it has to draw, so a page opened and left alone can reach the sheet before that cell has ever run
-// a pass. It was the only thing keeping Mix off the sheet, and the sheet only came right after the menu
-// had been opened and closed a few times (device 2026-09-20). The walk is the page's live views, which is
-// the cells on screen and no more, and it is done once per sheet.
+// The curation row of the page: the one held from the cell's own pass while it is still in a window, and
+// otherwise the one on the page now. A page opened and left alone can reach the sheet before the cell has
+// ever run a pass, since a collection view lays out only what it has to draw, and that kept Mix off the sheet
+// until the menu had been opened a few times (device 2026-09-20). And once Spotify rebuilds the header's
+// cells, the held row is out of the window and its Mix pill reads and fires nothing: the row went missing,
+// or stayed and did nothing. The walk is the page's live views, the cells on screen and no more, and only
+// when the held row is out of the window; the held row is what is left when the walk finds none.
static UIView *curationIn(UIView *page) {
UIView *held = objc_getAssociatedObject(page, &kToolbarKey);
- if (held) return held;
+ if (held.window) return held;
UIView *found = SGRFindByIdentifier(page, SGRPlaylistCurationIdentifier, NULL);
- if (found) objc_setAssociatedObject(page, &kToolbarKey, found, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+ if (!found) return held;
+ if (found != held) objc_setAssociatedObject(page, &kToolbarKey, found, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
return found;
}
@@ -317,7 +319,6 @@ static UIView *pageFor(UIViewController *menu) {
id decided = objc_getAssociatedObject(menu, &kDecidedKey);
if (decided) return decided == NSNull.null ? nil : decided;
UIView *page = SGRPinnedMoreRecentPage();
- if (page) curationIn(page);
objc_setAssociatedObject(menu, &kDecidedKey, page ?: (id)NSNull.null, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
return page;
}
@@ -350,7 +351,7 @@ static void install(UIViewController *menu) {
// reused -- and the curation pill only where it has not, which is how it was found before the header's
// button was (device 2026-09-20: the pill's glyph did not answer and the row went missing).
UIView *sort = nil, *mix = nil;
- pillsIn(objc_getAssociatedObject(page, &kToolbarKey), &sort, &mix);
+ pillsIn(curationIn(page), &sort, &mix);
sort = objc_getAssociatedObject(page, &kSortKey) ?: sort;
[block showSort:sort mix:mix];
// Nothing to show yet is not an answer: the page fills in as it lays out, and the next pass is asked