Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
fix: a playlist Spotify makes shows its picture again instead of a black hero
Vojtěch Škopek419d9ddb41f7
diff --git a/harness/playlist/README.md b/harness/playlist/README.mdindex a962decd..d5a5e7b0 100644--- a/harness/playlist/README.md+++ b/harness/playlist/README.md@@ -33,6 +33,12 @@ subview of HeaderActionsRow, which lays out nothing above the row. At 3 s the loright: "Like" once `PlaylistHeader.x` watches the row, "Download" before it did (issue #19). The scripted statesfrom 4 s on lay the header out and would hide the difference, so read it before then.+`mix` on the launch line builds a playlist Spotify makes (Indie Rock Mix), from `trees/continuous/4.txt`+(2026-09-20): no cover square anywhere, and in its place a `HeaderFullbleedCentralView` holding the picture,+the fade under it and Spotify's own 45pt title. Before any other pass it runs the one the page opens with,+where the block has no width yet and that view is the only child of the layout wide enough to be taken for+it — which is what used to conceal the picture for good and leave the hero black.+`liked` on the launch line (`xcrun simctl launch booted com.vojta.playlistharness liked`) builds Liked Songsinstead, from `trees/continuous/1.txt` (2026-09-18): no cover, a 238pt header, the count in a stack of its own,the play button 80x48, and `LiquidGlass.gradientContainer`, which it fades in at 3 s as a scroll does.diff --git a/harness/playlist/main.m b/harness/playlist/main.mindex 5c2d11f5..a38a74c4 100644--- a/harness/playlist/main.m+++ b/harness/playlist/main.m@@ -35,6 +35,8 @@if ([args containsObject:@"liked"]) {model.playlistName = @"Liked Songs";model.formatListType = @"liked-songs";+ } else if ([args containsObject:@"mix"]) {+ model.playlistName = @"Indie Rock Mix";} else if ([args containsObject:@"other"]) {model.playlistName = @"Barre Beats";model.playlistDescription = @"All music for beat-driven barre classes. Some cool-downs too! I'm always adding to the list";@@ -54,6 +56,10 @@@interface _TtC28EncoreConsumerMobile_BaseKit19HeaderContentLayout : UIView @end@implementation _TtC28EncoreConsumerMobile_BaseKit19HeaderContentLayout @end+// What a mix Spotify makes gets instead of the cover square (trees/continuous/4.txt:1066).+@interface _TtC28EncoreConsumerMobile_BaseKit26HeaderFullbleedCentralView : UIView @end+@implementation _TtC28EncoreConsumerMobile_BaseKit26HeaderFullbleedCentralView @end+@interface _TtC19LegacyUI_ECMCoreKit19AutoLayoutStackView : UIView @end@implementation _TtC19LegacyUI_ECMCoreKit19AutoLayoutStackView @end@@ -210,7 +216,7 @@ static void buildLikedSongs(UIViewController *page, CGFloat W) {NSMutableArray *stack = [NSMutableArray arrayWithObject:page.view];while (stack.count) {UIView *v = stack.lastObject; [stack removeLastObject];- if ([NSStringFromClass(v.class) isEqualToString:@"SGRPlaylistInfo"]) infos++;+ if ([NSStringFromClass(v.class) isEqualToString:@"SGRHeaderInfo"]) infos++;[stack addObjectsFromArray:v.subviews];}NSLog(@"[harness] liked: after loading, %lu redesign blocks on the page", (unsigned long)infos);@@ -381,13 +387,36 @@ static void buildLikedSongs(UIViewController *page, CGFloat W) {UIView *contentView = box(contentContainer, UIView.class, CGRectMake(0, 134, W, 505.33), @"_contentViewContainer");UIView *layout = box(contentView, _TtC28EncoreConsumerMobile_BaseKit19HeaderContentLayout.class, contentView.bounds, nil);- // the cover square- UIView *cover = box(layout, UIView.class, CGRectMake(round((W - 182) / 2), 68, 182, 182), @"Components.Header.UI.ArtworkImage");- UIView *coverImage = box(cover, UIView.class, cover.bounds, @"Encore.ImageView");- UIImageView *coverPicture = [[UIImageView alloc] initWithFrame:coverImage.bounds];- coverPicture.image = artwork();- coverPicture.contentMode = UIViewContentModeScaleAspectFill;- [coverImage addSubview:coverPicture];+ // The cover: a mix's full bleed picture, or a playlist's square. `mix` on the launch line builds the+ // header a playlist Spotify makes gets (trees/continuous/4.txt:1066): no Components.Header.UI.ArtworkImage+ // anywhere, and in its place a HeaderFullbleedCentralView holding the picture, the fade under it and+ // Spotify's own big title. It is the layout's first child and as wide as the page, which is what the+ // block used to be taken for.+ BOOL mix = [NSProcessInfo.processInfo.arguments containsObject:@"mix"];+ UIView *cover = nil, *fullbleed = nil;+ if (mix) {+ fullbleed = box(layout, _TtC28EncoreConsumerMobile_BaseKit26HeaderFullbleedCentralView.class,+ CGRectMake(0, 0, W, 311), nil);+ fullbleed.clipsToBounds = YES;+ UIView *slot = box(fullbleed, UIView.class, CGRectMake(-10, 0, W + 20, W + 20), nil);+ UIView *slotImage = box(slot, UIView.class, slot.bounds, @"Encore.ImageView");+ UIImageView *slotPicture = [[UIImageView alloc] initWithFrame:slotImage.bounds];+ slotPicture.image = artwork();+ slotPicture.contentMode = UIViewContentModeScaleAspectFill;+ [slotImage addSubview:slotPicture];+ UIView *fade = box(fullbleed, _TtC19LegacyUI_ECMCoreKit13GradientView.class, CGRectMake(0, 225, W, 86), nil);+ fade.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];+ UIView *titleStack = box(fullbleed, _TtC19LegacyUI_ECMCoreKit19AutoLayoutStackView.class,+ CGRectMake(16, 249, W - 32, 54), nil);+ label(titleStack, titleStack.bounds, @"Indie Rock Mix", 45, UIColor.whiteColor, @"Encore.Label");+ } else {+ cover = box(layout, UIView.class, CGRectMake(round((W - 182) / 2), 68, 182, 182), @"Components.Header.UI.ArtworkImage");+ UIView *coverImage = box(cover, UIView.class, cover.bounds, @"Encore.ImageView");+ UIImageView *coverPicture = [[UIImageView alloc] initWithFrame:coverImage.bounds];+ coverPicture.image = artwork();+ coverPicture.contentMode = UIViewContentModeScaleAspectFill;+ [coverImage addSubview:coverPicture];+ }// the block: the column, then the action rowUIView *block = box(layout, UIView.class, CGRectMake(0, 266.67, W - 16, 178.33), nil);@@ -476,6 +505,21 @@ static void buildLikedSongs(UIViewController *page, CGFloat W) {disc.clipsToBounds = YES;[condensed addSubview:disc];+ // The pass that used to lose the picture: while Spotify is still measuring, the block has no width of+ // its own, and the full bleed view is then the only child of the layout wide enough to be taken for it.+ // Taken for the block, everything it holds -- the picture with it -- was concealed, and concealing does+ // not come undone, so the hero stayed black for as long as the page was open (trees/continuous/3.txt+ // against 4.txt, 2026-09-20). The mix runs that pass before any other, so a regression shows here too.+ if (mix) {+ CGRect settled = block.frame;+ block.frame = CGRectMake(0, 266.67, 0, 0);+ [layout setNeedsLayout];+ [layout layoutIfNeeded];+ block.frame = settled;+ NSLog(@"[harness] the measuring pass is done: the full bleed view is %@",+ fullbleed.layer.hidden ? @"concealed" : @"still drawn");+ }+[self.window makeKeyAndVisible];// The header collapsing, and the page pulled down past the top, with the frames Spotify sets in each@@ -496,12 +540,17 @@ static void buildLikedSongs(UIViewController *page, CGFloat W) {contentView.frame = CGRectMake(0, 134, W, collapsed ? 110 : 474);layout.frame = CGRectMake(0, 0, W, collapsed ? 110 : 474);cover.frame = collapsed ? CGRectMake(148.67, 68, 104.67, 104.67) : CGRectMake(round((W - 243) / 2), 68, 243, 243);+ // The full bleed picture is clipped away rather than shrunk: collapsed it is the width of the page+ // and no height at all, with the picture inside it still at its own size (trees/continuous/3.txt:1066).+ fullbleed.frame = collapsed ? CGRectMake(0, 0, W, 0) : CGRectMake(0, 0, W, 311);block.frame = collapsed ? CGRectMake(0, -26.33, W - 16, 136.33) : CGRectMake(0, 327, W - 16, 178.33);[layout setNeedsLayout];[layout layoutIfNeeded];UIView *hero = wash.subviews.firstObject;- NSLog(@"[harness] state %@: hero %@ in the plane, %@ in the window", state,- NSStringFromCGRect(hero.frame), NSStringFromCGRect([wash convertRect:hero.frame toView:nil]));+ UIImageView *picture = (UIImageView *)hero.subviews.firstObject;+ NSLog(@"[harness] state %@: hero %@ in the plane, %@ in the window, picture %@", state,+ NSStringFromCGRect(hero.frame), NSStringFromCGRect([wash convertRect:hero.frame toView:nil]),+ [picture isKindOfClass:UIImageView.class] && picture.image ? @"drawn" : @"EMPTY");};for (NSUInteger i = 0; i < 3; i++) {NSString *state = @[@"rest", @"collapsed", @"pulled"][i];diff --git a/tweak/Sources/Redesigned/Playlist/PlaylistHeader.x b/tweak/Sources/Redesigned/Playlist/PlaylistHeader.xindex 84a696e3..96386db1 100644--- a/tweak/Sources/Redesigned/Playlist/PlaylistHeader.x+++ b/tweak/Sources/Redesigned/Playlist/PlaylistHeader.x@@ -10,6 +10,11 @@// the block a plain UIView at {0, 327} 386x178: a column of title, description,// creator row and length, and under it the action row//+// A mix Spotify makes (Indie Rock Mix, Discover Weekly) is laid out the same way but draws its cover+// differently: there is no artwork square, and in its place a HeaderFullbleedCentralView holds the picture+// full bleed with Spotify's own big title over the bottom of it (trees/continuous/4.txt:1066). So the cover+// is whichever of the two the layout has, and the block is the one thing that is neither.+//// Nothing is measured from what the header shows: -[SPTFreeTierPlaylistEncoreHeaderViewController update]// counts a stored fullHeaderHeight and pins headerViewHeightConstraint to it. So the redesign changes no// height: the cover's square is where the full bleed picture goes, and the block keeps its place, its size@@ -454,15 +459,31 @@ static UIView *applyBackground(UIView *layout) {return plane;}+// The full bleed picture a mix is given instead of the artwork square: a child of the layout, as wide as the+// page and at the top of it.+static UIView *fullbleedIn(UIView *layout) {+ static Class fullbleed;+ if (!fullbleed) fullbleed = NSClassFromString(@"_TtC28EncoreConsumerMobile_BaseKit26HeaderFullbleedCentralView");+ for (UIView *sub in layout.subviews) {+ if ([sub isKindOfClass:fullbleed]) return sub;+ }+ return nil;+}+// The layout holds the cover square and, under it, the block of text and controls: the one child nearly as// wide as the page. Taken by width, not by being lowest: Liked Songs' layout also holds a 45pt slot for its// icon, which while the page loads sits below the block, and taken for it the header was drawn twice, once// in the slot and once in the block (device, 2026-09-18).-static UIView *blockIn(UIView *layout, UIView *cover) {+//+// A mix's full bleed picture is as wide as the page too, and while the block is still unmeasured it is the+// only child wide enough to be taken for it -- which drew the redesign inside it and concealed the picture+// along with the rest of what it holds, leaving a black hero for good, since concealing does not come undone+// (trees/continuous/3.txt against 4.txt, 2026-09-20). It is never the block, so it is skipped like the cover.+static UIView *blockIn(UIView *layout, UIView *cover, UIView *fullbleed) {UIView *block = nil;CGFloat wide = layout.bounds.size.width * 0.6;for (UIView *sub in layout.subviews) {- if (sub == cover || [sub isKindOfClass:SGRPlaylistHero.class] || sub.bounds.size.width < wide) continue;+ if (sub == cover || sub == fullbleed || [sub isKindOfClass:SGRPlaylistHero.class] || sub.bounds.size.width < wide) continue;if (!block || CGRectGetMinY(sub.frame) > CGRectGetMinY(block.frame)) block = sub;}return block;@@ -473,8 +494,11 @@ static void applyHeader(UIView *layout) {UIView *headerRoot = headerVC.viewIfLoaded;if (!headerRoot) return;- UIView *cover = SGRFindByIdentifier(layout, @"Components.Header.UI.ArtworkImage", &kCoverKey);- UIView *block = blockIn(layout, cover);+ // A playlist's artwork square, or a mix's full bleed picture where there is no square. Either way it is+ // the view the picture is read from and the view that is concealed once the hero is drawing it.+ UIView *fullbleed = fullbleedIn(layout);+ UIView *cover = SGRFindByIdentifier(layout, @"Components.Header.UI.ArtworkImage", &kCoverKey) ?: fullbleed;+ UIView *block = blockIn(layout, cover, fullbleed);if (!block) return;UIView *plane = applyBackground(layout);