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 artist page opens again, with more left in Spotify's row and drawn by the redesign in the top corner

Vojtěch Škopek48b7ebaaf212
diff --git a/tweak/Sources/Redesigned/Artist/ArtistField.x b/tweak/Sources/Redesigned/Artist/ArtistField.x
index f40e77f4..ad9c8201 100644
--- a/tweak/Sources/Redesigned/Artist/ArtistField.x
+++ b/tweak/Sources/Redesigned/Artist/ArtistField.x
@@ -124,12 +124,11 @@ static void hideStrip(UIView *strip) {
%end
%ctor {
- // Registered whatever the switch says: the flag rows elsewhere lock to these while it is on.
- SGRedesignForceFlags(@"artist", @{
- // Spotify's own way of moving more up into the navigation bar, as the playlist and album pages do: the
- // row under the photo is shuffle, Play and Follow.
- @"ios-creator-impl.context_menu_in_navigation_bar_enabled_artist": @YES,
- });
+ // No flags forced here. `ios-creator-impl.context_menu_in_navigation_bar_enabled_artist` moves more out of
+ // the header's row, and with it gone Spotify's OverflowStackView force-unwraps the tallest view of a line
+ // that has none and traps as the page opens (device crash 2026-09-18 19:09, SIGTRAP in -[OverflowStackView
+ // updateConstraints], OverflowStackViewLayoutBuilder.Line.tallestView nil). The row stays Spotify's, and
+ // ArtistHeader.x draws more itself.
if (!SGRedesignedUI()) return;
%init;
SGRequireClasses(@[
diff --git a/tweak/Sources/Redesigned/Artist/ArtistHeader.x b/tweak/Sources/Redesigned/Artist/ArtistHeader.x
index 1ce18dcc..0afa298a 100644
--- a/tweak/Sources/Redesigned/Artist/ArtistHeader.x
+++ b/tweak/Sources/Redesigned/Artist/ArtistHeader.x
@@ -25,7 +25,8 @@
// Explore, and the headline go with it -- the headline's pre-save is also the list's own Release Countdown
// section. The Kit's SGRHeaderInfo reads the name and the listeners off Spotify's concealed labels and draws
// and fires Spotify's shuffle, play and Follow, whose word ("Follow", "Following") is its state in the app's
-// language. More is moved up into the navigation bar by a flag (ArtistField.x).
+// language. More stays in Spotify's row, where the row needs it (ArtistField.x), and is drawn by a glass
+// button of the redesign's in the top trailing corner, level with the back button, firing it.
#import "Core/SGCore.h"
#import "Redesigned/Kit/SGRKit.h"
#import "Artist.h"
@@ -39,7 +40,10 @@ static const CGFloat kMinCover = 80, kMinHero = 120;
static const CGFloat kBar = 100, kFade = 150;
static char kInfoKey, kHeroKey, kHeroHeightKey, kContainerHeightKey, kCoverWatchedKey, kRowWatchedKey;
-static char kTitleKey, kMetaKey, kShuffleKey, kPlayKey, kFollowKey, kArtworkKey, kBarKey;
+static char kTitleKey, kMetaKey, kShuffleKey, kPlayKey, kFollowKey, kArtworkKey, kBarKey, kMoreKey, kMoreButtonKey;
+
+// The back button's glass sits this far under the top of the safe area; more lines up with it.
+static const CGFloat kCornerTop = 2, kCornerSide = 12;
#pragma mark - Spotify's views
@@ -243,7 +247,6 @@ static void applyHeader(UIView *header) {
objc_setAssociatedObject(container, &kInfoKey, info, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
if (info.superview != container) [container addSubview:info];
- else if (container.subviews.lastObject != info) [container bringSubviewToFront:info];
setFrame(info, container.bounds);
UIView *title = SGRFindByIdentifier(header, @"Encore.AdaptiveTitle", &kTitleKey);
@@ -257,10 +260,27 @@ static void applyHeader(UIView *header) {
[info showShuffle:shuffle play:play trailing:follow trailingFallback:[UIImage systemImageNamed:@"person.badge.plus"]
playColor:SGRArtistFieldColor(container)];
+ // More, in the top trailing corner of the page. It scrolls away with the photo; collapsed, the page is a
+ // list and its rows carry their own more.
+ UIView *more = SGRFindByIdentifier(header, @"Components.UI.ContextMenuButton*", &kMoreKey);
+ SGRMirrorButton *moreButton = objc_getAssociatedObject(container, &kMoreButtonKey);
+ if (!moreButton) {
+ moreButton = [[SGRMirrorButton alloc] initWithFrame:CGRectZero];
+ moreButton.fallbackGlyph = [UIImage systemImageNamed:@"ellipsis"];
+ objc_setAssociatedObject(container, &kMoreButtonKey, moreButton, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+ }
+ if (moreButton.superview != container) [container addSubview:moreButton];
+ else if (container.subviews.lastObject != moreButton) [container bringSubviewToFront:moreButton];
+ if (more) [moreButton feedFrom:more];
+ moreButton.hidden = more == nil;
+ CGFloat top = container.window.safeAreaInsets.top + kCornerTop;
+ setFrame(moreButton, CGRectMake(container.bounds.size.width - kCornerSide - SGRActionHeight, top, SGRActionHeight, SGRActionHeight));
+
// Collapsing, the text would pass over Spotify's bar with the name in it: it goes over the last kFade of
// the collapse, from the header's own height, which this pass runs on every step of.
CGFloat alpha = MAX(0, MIN(1, (header.bounds.size.height - kBar) / kFade));
if (fabs(info.alpha - alpha) > 0.01) info.alpha = alpha;
+ if (fabs(moreButton.alpha - alpha) > 0.01) moreButton.alpha = alpha;
// The picture reaches to where the content's top is at rest, plus the name. The container keeps its
// height as the header collapses, and only ever grows as the page loads.
@@ -284,9 +304,9 @@ static void applyHeader(UIView *header) {
static BOOL logged;
if (!logged && header.window && name) {
logged = YES;
- SGLog(@"redesign artist: own block \"%@\", \"%@\"; shuffle %@, play %@, follow %@", name,
+ SGLog(@"redesign artist: own block \"%@\", \"%@\"; shuffle %@, play %@, follow %@, more %@", name,
firstText(listeners) ?: @"no listeners", shuffle ? @"found" : @"missing", play ? @"found" : @"missing",
- follow ? firstText(follow) ?: @"found" : @"missing");
+ follow ? firstText(follow) ?: @"found" : @"missing", more ? @"found" : @"missing");
}
}