Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
feat: a What's new sheet on the first launch after an update, and again from the Mod page
My-Name-Is-Jeffc21cbcc6dd0c
diff --git a/.gitignore b/.gitignoreindex d7561408..46661cda 100644--- a/.gitignore+++ b/.gitignore@@ -13,6 +13,7 @@ tweak/.theos/tweak/obj/tweak/packages/tweak/Sources/Shared/Flags/SGFlagList.m+tweak/Sources/App/Onboarding/SGWhatsNewNotes.h/trees/continuous/trees/cleanharness/*/build/diff --git a/docs/tweaks.md b/docs/tweaks.mdindex af33af63..e67b6a78 100644--- a/docs/tweaks.md+++ b/docs/tweaks.md@@ -53,8 +53,8 @@ blur and the redesign runs untested against an older UIKit (issue #37, an iOS 17Below 26 the Redesigned UI switch stores `SGKeyRedesignUntested` instead, and turning it on shows whatthe redesign risks there and restarts Spotify from the alert; the tour offers the redesign card too, Legacypicked, with the same warning under the cards. `SGRedesignedUIStored()` answers YES below 26 only with-that key set. A launch with the redesign below 26 leaves a mark that the main queue takes off after 15 s,-so a launch that hung is followed by one in the native look, with both switches off. The stored key+that key set. A launch with the redesign below 26 leaves a mark that the main queue takes off after 15 s+or as Spotify first leaves the front, so a launch that hung is followed by one in the native look, with both switches off. The stored keyis left alone on iOS 26, so a phone that updates gets its redesign back.The two looks never run together, so each hooks the same Spotify class in its own way, and a part of@@ -380,7 +380,11 @@ App:the changelog of every release newer than the build, a line per commit) and the sheet a newerrelease brings up on its own a few seconds after Spotify opens, once per release; backup, thesigning warning and the Mod page with the reset- Onboarding/ the welcome page over Home on the first launch, with Redesigned UI, offered again from the Mod page+ Onboarding/ the welcome page over Home on the first launch, opening on the logo in glass, with Redesigned UI;+ on the first launch of a new version instead, What's new (WhatsNew.m), this version's section of+ CHANGELOG.md, which scripts/whats-new.sh writes into a gitignored header at each make (a section+ that came over from upstream is left out, so a build without its own has no sheet). The Mod+ page offers both again. Laid out on the simulator by harness/onboarding/Every key a feature stores starts with `spotifyglass.`, whatever it holds: Reset all settings onthe Mod page removes by that prefix and has no list to keep up to date. It leaves `SGKeyStock` behind,@@ -473,7 +477,7 @@ Auto / Off / On control per flag (a text field for the number and text ones), an(the row reads out where the build stands and opens the changelog of everything newer than it, readfrom the releases Release Please cuts, with Check now, the release to get, all the releases and Tellme when one is out, the sheet a newer release brings up a few seconds after Spotify opens), the-build and Spotify's version, the site and the repo, the welcome tour again and Reset all+build and Spotify's version, the site and the repo, What's New and the welcome tour again, and Reset allsettings. A flag switch on a page forces that one flag and off leaves Spotify's own value, so the Allflags page is where a flag goes back to Auto. Spotify ships its newer design behind several flags atonce, and the redesign is built on it (the glass navigation bar, the new player slider, the sheet stylediff --git a/harness/onboarding/README.md b/harness/onboarding/README.mdnew file mode 100644index 00000000..6fe8e340--- /dev/null+++ b/harness/onboarding/README.md@@ -0,0 +1,15 @@+# Onboarding harness++The welcome tour (`App/Onboarding/Tour.m`) and the What's new sheet (`WhatsNew.m`) on the simulator, over a+plain screen standing in for Home. `build.sh` writes CHANGELOG.md's section for the version it builds+(0.20.0 by default, upstream's sections allowed) into the generated notes header, so the sheet has lines;+the tweak's next make writes its own version's back.++ ./build.sh [version]+ xcrun simctl install <udid> build/OnboardingHarness.app+ xcrun simctl launch <udid> com.vitrine.onboardingharness [tour | old | whatsnew] [pick]++`tour` is a first launch on iOS 26 and up: the logo lands, then the page comes in with Redesigned picked.+`old` fakes an OS below 26: Legacy picked, the redesign card untested. `pick` taps the other card three+seconds in, which shows the note under the cards: what Legacy goes without, or below 26 what the redesign+risks. `whatsnew` puts the sheet up instead.diff --git a/harness/onboarding/build.sh b/harness/onboarding/build.shnew file mode 100755index 00000000..a4f5a6ee--- /dev/null+++ b/harness/onboarding/build.sh@@ -0,0 +1,47 @@+#!/bin/sh+# Builds the onboarding harness for the simulator: the welcome tour (Tour.m) and the What's new sheet+# (WhatsNew.m, with App/About/Update.m's parser). The sheet needs notes, so this writes CHANGELOG.md's+# section for VERSION into the generated header first, upstream's sections included; the tweak's next+# make writes its own version's back.+set -e+cd "$(dirname "$0")"+SRC=$(cd ../../tweak/Sources && pwd)+OUT=build+VERSION=${1:-0.20.0}+rm -rf "$OUT"; mkdir -p "$OUT/OnboardingHarness.app"+ALLOW_UPSTREAM=1 ../../scripts/whats-new.sh "$VERSION" ../../CHANGELOG.md "$SRC/App/Onboarding/SGWhatsNewNotes.h"++SDK=$(xcrun --sdk iphonesimulator --show-sdk-path)+xcrun -sdk iphonesimulator clang -target arm64-apple-ios17.0-simulator -fobjc-arc -g -O0 \+ -I"$SRC" -isysroot "$SDK" -Wno-deprecated-declarations -DSG_VERSION="\"$VERSION\"" \+ main.m "$SRC"/App/Onboarding/Tour.m "$SRC"/App/Onboarding/WhatsNew.m "$SRC"/App/About/Update.m \+ "$SRC"/Settings/SGPage.m "$SRC"/Settings/SGPageStyle.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 \+ -framework UIKit -framework QuartzCore -framework CoreGraphics -framework CoreImage -framework Foundation \+ -o "$OUT/OnboardingHarness.app/OnboardingHarness"++cat > "$OUT/OnboardingHarness.app/Info.plist" <<'PLIST'+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0"><dict>+<key>CFBundleExecutable</key><string>OnboardingHarness</string>+<key>CFBundleIdentifier</key><string>com.vitrine.onboardingharness</string>+<key>CFBundleName</key><string>OnboardingHarness</string>+<key>CFBundleVersion</key><string>1</string>+<key>CFBundleShortVersionString</key><string>1.0</string>+<key>UIUserInterfaceStyle</key><string>Dark</string>+<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>Scene</string>+ </dict></array>+ </dict>+</dict>+</dict></plist>+PLIST+codesign -f -s - "$OUT/OnboardingHarness.app" >/dev/null 2>&1+echo "built $OUT/OnboardingHarness.app"diff --git a/harness/onboarding/main.m b/harness/onboarding/main.mnew file mode 100644index 00000000..f17d9722--- /dev/null+++ b/harness/onboarding/main.m@@ -0,0 +1,89 @@+// The welcome tour and the What's new sheet on the simulator, over a plain screen standing in for Home:+// Tour.m and WhatsNew.m as the tweak builds them, the notes being a CHANGELOG.md section build.sh wrote.+//+// tour the tour, as on a first launch (the default)+// old the tour as below iOS 26: the redesign card untested, Legacy picked+// whatsnew the What's new sheet+// pick taps the other look's card two seconds in, to see the note change+#import <UIKit/UIKit.h>+#import "App/Onboarding/Onboarding.h"+#import "Core/SGPrefs.h"++static BOOL sg_old;++// Core/SGUIMode.m, with the OS the tour believes it runs on taken from the arguments.+BOOL SGRedesignAvailable(void) { return !sg_old; }+BOOL SGRedesignFellBack(void) { return NO; }+BOOL SGRedesignedUIStored(void) { return NO; }+BOOL SGRedesignedUI(void) { return NO; }+BOOL SGNativeUI(void) { return YES; }++// App/Pages.m and App/About/Signing.m, which bring the rest of the tweak with them.+void SGSetRedesignedUI(BOOL on) { NSLog(@"harness: redesign %@", on ? @"on" : @"off"); }+NSString *SGRedesignUntestedWarning(void) {+ return [NSString stringWithFormat:@"The redesign is built on iOS 26's Liquid Glass. iOS %@ draws a blur in its place, and nobody has tested the redesign there: pages can be laid out wrongly, and Spotify can freeze as it starts. If Spotify does not start with it, the next launch goes back to Legacy.", @"17.5"];+}+void SGShowSigningFixIfPending(void) {}++@interface Delegate : UIResponder <UIApplicationDelegate>+@end+@implementation Delegate+@end++@interface Scene : UIResponder <UIWindowSceneDelegate>+@property (nonatomic, strong) UIWindow *window;+@end++@implementation Scene++- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)options {+ NSArray<NSString *> *arguments = NSProcessInfo.processInfo.arguments;+ sg_old = [arguments containsObject:@"old"];+ [NSUserDefaults.standardUserDefaults removeObjectForKey:SGKeyOnboardingSeen];++ UIViewController *home = [UIViewController new];+ home.view.backgroundColor = [UIColor colorWithRed:0.12 green:0.2 blue:0.16 alpha:1];+ UILabel *label = [UILabel new];+ label.text = @"Home";+ label.textColor = UIColor.whiteColor;+ label.font = [UIFont systemFontOfSize:34 weight:UIFontWeightBold];+ label.frame = CGRectMake(20, 120, 300, 44);+ [home.view addSubview:label];+ self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];+ self.window.rootViewController = home;+ [self.window makeKeyAndVisible];++ BOOL whatsNew = [arguments containsObject:@"whatsnew"];+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ NSLog(@"harness: %lu changes in the notes", (unsigned long)SGWhatsNewChanges().count);+ if (whatsNew) SGShowWhatsNew();+ else SGShowOnboarding();+ });+ if ([arguments containsObject:@"pick"]) {+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ UIViewController *tour = home.presentedViewController;+ NSMutableArray<UIControl *> *cards = [NSMutableArray array];+ NSMutableArray<UIView *> *queue = [NSMutableArray arrayWithObject:tour.view];+ while (queue.count) {+ UIView *view = queue.firstObject;+ [queue removeObjectAtIndex:0];+ if ([NSStringFromClass(view.class) isEqualToString:@"SGLookCard"]) [cards addObject:(UIControl *)view];+ [queue addObjectsFromArray:view.subviews];+ }+ for (UIControl *card in cards) {+ if (!card.selected) {+ [card sendActionsForControlEvents:UIControlEventTouchUpInside];+ break;+ }+ }+ });+ }+}++@end++int main(int argc, char *argv[]) {+ @autoreleasepool {+ return UIApplicationMain(argc, argv, nil, NSStringFromClass(Delegate.class));+ }+}diff --git a/scripts/whats-new.sh b/scripts/whats-new.shnew file mode 100755index 00000000..2bfa2550--- /dev/null+++ b/scripts/whats-new.sh@@ -0,0 +1,36 @@+#!/bin/sh+# Writes the What's new sheet's text (App/Onboarding/WhatsNew.m) as an Objective-C header: the section+# of CHANGELOG.md that Release Please wrote for VERSION, as it stands, for App/About/Update.m's parser.+# The sections that came over with the fork are upstream's releases, not this one's, and are left out+# (their heading links to skopevoj/spoti.pw); a build with no section of its own gets an empty string.+# ALLOW_UPSTREAM=1 takes them anyway, for the harness.+#+# scripts/whats-new.sh 0.22.0 [CHANGELOG.md [OUT]]+#+# With OUT, the header is written there only when it changed, so a build that runs this on every make+# does not compile WhatsNew.m again for nothing.+set -e+version=$1+changelog=${2:-$(dirname "$0")/../CHANGELOG.md}+if [ -n "$3" ]; then+ "$0" "$version" "$changelog" > "$3.tmp"+ if cmp -s "$3.tmp" "$3"; then rm "$3.tmp"; else mv "$3.tmp" "$3"; fi+ exit 0+fi+printf '// Generated by scripts/whats-new.sh from CHANGELOG.md for %s. Do not edit.\n' "$version"+printf 'static NSString *const SGWhatsNewNotes = @""\n'+[ -f "$changelog" ] && awk -v version="$version" -v upstream="${ALLOW_UPSTREAM:-0}" '+ /^## / {+ heading = $0+ sub(/^## \[?/, "", heading)+ inside = index(heading, version "]") == 1 || index(heading, version " ") == 1+ if (inside && upstream != 1 && index($0, "skopevoj/spoti.pw")) inside = 0+ next+ }+ inside {+ gsub(/\\/, "\\\\")+ gsub(/"/, "\\\"")+ printf " \"%s\\n\"\n", $0+ }+' "$changelog"+printf ' ;\n'diff --git a/tweak/Makefile b/tweak/Makefileindex e32bf4e1..30652ea5 100644--- a/tweak/Makefile+++ b/tweak/Makefile@@ -10,6 +10,12 @@ PACKAGE_VERSION := $(SG_VERSION)include $(THEOS)/makefiles/common.mk+# The What's new sheet's text, this version's section of CHANGELOG.md, as a gitignored header that+# App/Onboarding/WhatsNew.m reads. A copy of tweak/ without the scripts beside it builds without it.+ifneq ($(wildcard ../scripts/whats-new.sh),)+$(shell ../scripts/whats-new.sh $(SG_VERSION) ../CHANGELOG.md Sources/App/Onboarding/SGWhatsNewNotes.h)+endif+TWEAK_NAME := spotifyglass# Every source under Sources/, so a new feature needs no Makefile edit. Shared/Flags/SGFlagList.mdiff --git a/tweak/Sources/App/About/About.h b/tweak/Sources/App/About/About.hindex ae5c657c..b202237e 100644--- a/tweak/Sources/App/About/About.h+++ b/tweak/Sources/App/About/About.h@@ -26,6 +26,8 @@ extern NSString *const SGUpdateCheckedNotification; // on the main thread, aft@endNSArray<SGUpdateRelease *> *SGUpdateReleases(void); // newest first, empty until a check lands+// The lines of a release body as Release Please writes it, also what the What's new sheet reads.+NSArray<SGUpdateChange *> *SGUpdateChangesIn(NSString *body);SGUpdateRelease *SGUpdateNewestRelease(void);NSString *SGUpdateVersion(void); // nil unless GitHub has a release newer than this buildBOOL SGUpdateIsNewer(NSString *version); // whether that release is newer than the build runningdiff --git a/tweak/Sources/App/About/AboutSettings.m b/tweak/Sources/App/About/AboutSettings.mindex 7b560867..ecaf7dc8 100644--- a/tweak/Sources/App/About/AboutSettings.m+++ b/tweak/Sources/App/About/AboutSettings.m@@ -47,6 +47,7 @@ UIViewController *SGAboutPage(void) {withSymbol(SGPageRow(@"Licenses", ^UIViewController *{ return SGLicensesPage(); }), @"doc.text"),withSymbol(SGActionRow(@"Welcome tour", nil, ^{ SGShowOnboarding(); }), @"map"),]];+ if (SGWhatsNewChanges().count) [links insertObject:withSymbol(SGActionRow(@"What's New", nil, ^{ SGShowWhatsNew(); }), @"sparkles") atIndex:links.count - 1];return [[SGModPage alloc] initWithTitle:@"Mod" intro:nil sections:@[SGSection(nil, @[updates,diff --git a/tweak/Sources/App/About/Update.m b/tweak/Sources/App/About/Update.mindex 087289cd..7b3e7603 100644--- a/tweak/Sources/App/About/Update.m+++ b/tweak/Sources/App/About/Update.m@@ -76,7 +76,7 @@ static NSString *takeCommitURL(NSString **line) {// A release body into its lines: "### Features" names what follows, "* …" is a line of it, and a// line that wraps onto the next one is joined back together. Anything else -- the "## [0.19.0](…)"// heading release-please leads with, blank lines -- is dropped, the version being known already.-static NSArray<SGUpdateChange *> *changesIn(NSString *body) {+NSArray<SGUpdateChange *> *SGUpdateChangesIn(NSString *body) {NSMutableArray<SGUpdateChange *> *changes = [NSMutableArray array];NSString *kind = @"Changes";SGUpdateChange *open = nil;@@ -121,7 +121,7 @@ NSArray<SGUpdateRelease *> *SGUpdateReleases(void) {release.version = version;release.date = stringOr(entry[@"date"], @"");release.url = stringOr(entry[@"url"], nil);- release.changes = changesIn(stringOr(entry[@"notes"], @""));+ release.changes = SGUpdateChangesIn(stringOr(entry[@"notes"], @""));[releases addObject:release];}return releases;diff --git a/tweak/Sources/App/Onboarding/Onboarding.h b/tweak/Sources/App/Onboarding/Onboarding.hindex 19732dce..949777da 100644--- a/tweak/Sources/App/Onboarding/Onboarding.h+++ b/tweak/Sources/App/Onboarding/Onboarding.h@@ -1,15 +1,25 @@// Onboarding: a welcome page over Home the first time this build runs, in glass: Vitrine's logo landing,// then a pick between the redesign (offered first on iOS 26) and Spotify's own look, and a line on// holding Home for Mod Settings. The look is picked at launch, so a changed pick ends the welcome in a-// restart. The Mod page offers it again.+// restart. After an update instead, a What's new sheet lists what the version brought. The Mod page+// offers both again.#import <UIKit/UIKit.h>#define SGKeyOnboardingSeen @"spotifyglass.onboarding.seen"+// The version whose What's new was last shown, or skipped because the tour came first.+#define SGKeyWhatsNewSeen @"spotifyglass.whatsnew.seen"// Presents the tour over the top of the app; does nothing while it is already up.void SGShowOnboarding(void);-// The tour holds the screen; other sheets wait for it (App/About).+// The tour or What's new holds the screen; other sheets wait for it (App/About).BOOL SGOnboardingShowing(void);-// The tour's prominent glass button.+// WhatsNew.m: this build's section of CHANGELOG.md, read through App/About/Update.m's parser; empty for a+// build with no section of its own, which then has no sheet and no row.+@class SGUpdateChange;+NSArray<SGUpdateChange *> *SGWhatsNewChanges(void);+void SGShowWhatsNew(void);+BOOL SGWhatsNewShowing(void);++// The tour's prominent glass button, also What's new's Continue.UIButton *SGOnboardingButton(NSString *title);diff --git a/tweak/Sources/App/Onboarding/Onboarding.x b/tweak/Sources/App/Onboarding/Onboarding.xindex 6e4f4625..33e95ddb 100644--- a/tweak/Sources/App/Onboarding/Onboarding.x+++ b/tweak/Sources/App/Onboarding/Onboarding.x@@ -1,22 +1,31 @@// The tour goes up the first time Home appears, not at launch: a fresh sideload lands on the login-// screen first, and a tour over that is wrong. A moment after, so Home has drawn under the glass.+// screen first, and a tour over that is wrong. A moment after, so Home has drawn under the glass. A+// build that has had its tour and runs a version for the first time shows What's new there instead;+// a fresh install's tour counts as this version's What's new.#import "Core/SGCore.h"#import "Onboarding.h"+static BOOL newVersion(void) {+ return ![[NSUserDefaults.standardUserDefaults stringForKey:SGKeyWhatsNewSeen] isEqualToString:@(SG_VERSION)];+}+%hook _TtC19Home_FunkisPageImpl20FunkisViewController- (void)viewDidAppear:(BOOL)animated {%orig;static dispatch_once_t once;dispatch_once(&once, ^{dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{+ BOOL fresh = newVersion();+ [NSUserDefaults.standardUserDefaults setObject:@(SG_VERSION) forKey:SGKeyWhatsNewSeen];if (!SGFlag(SGKeyOnboardingSeen, NO)) SGShowOnboarding();+ else if (fresh) SGShowWhatsNew();});});}%end%ctor {- if (SGFlag(SGKeyOnboardingSeen, NO)) return;+ if (SGFlag(SGKeyOnboardingSeen, NO) && !newVersion()) return;%init;SGRequireClasses(@[@"_TtC19Home_FunkisPageImpl20FunkisViewController"]);}diff --git a/tweak/Sources/App/Onboarding/Tour.m b/tweak/Sources/App/Onboarding/Tour.mindex f48ea49e..39285ab5 100644--- a/tweak/Sources/App/Onboarding/Tour.m+++ b/tweak/Sources/App/Onboarding/Tour.m@@ -206,10 +206,6 @@ static const CGFloat kLogoRadius = 22;- (void)layoutSubviews {[super layoutSubviews];_pane.frame = self.bounds;- // Glass draws a little past its own bounds, which clipsToBounds lets through; a mask does not.- CAShapeLayer *mask = [CAShapeLayer layer];- mask.path = [UIBezierPath bezierPathWithRoundedRect:_pane.bounds cornerRadius:kLogoRadius].CGPath;- _pane.layer.mask = mask;[CATransaction begin];[CATransaction setDisableActions:YES];_glow.frame = _pane.bounds;@@ -503,7 +499,7 @@ static const CGFloat kLogoRadius = 22;static __weak SGOnboardingController *sg_tour;BOOL SGOnboardingShowing(void) {- return sg_tour != nil;+ return sg_tour != nil || SGWhatsNewShowing();}void SGShowOnboarding(void) {diff --git a/tweak/Sources/App/Onboarding/WhatsNew.m b/tweak/Sources/App/Onboarding/WhatsNew.mnew file mode 100644index 00000000..eeed2b10--- /dev/null+++ b/tweak/Sources/App/Onboarding/WhatsNew.m@@ -0,0 +1,162 @@+#import "Core/SGCore.h"+#import "Settings/SGPageStyle.h"+#import "Onboarding.h"+#import "App/About/About.h"++// This build's section of CHANGELOG.md, written by scripts/whats-new.sh when tweak/Makefile runs.+#if __has_include("SGWhatsNewNotes.h")+#import "SGWhatsNewNotes.h"+#else+static NSString *const SGWhatsNewNotes = @"";+#endif++NSArray<SGUpdateChange *> *SGWhatsNewChanges(void) {+ static NSArray<SGUpdateChange *> *changes;+ static dispatch_once_t once;+ dispatch_once(&once, ^{ changes = SGUpdateChangesIn(SGWhatsNewNotes); });+ return changes;+}++// A symbol a kind of change wears down the sheet, as Release Please names the kinds (release-please-config.json).+static NSString *symbolFor(NSString *kind) {+ NSDictionary<NSString *, NSString *> *symbols = @{+ @"Features": @"sparkles",+ @"Fixes": @"wrench.and.screwdriver",+ @"Performance": @"gauge.with.dots.needle.67percent",+ @"Reverts": @"arrow.uturn.backward",+ };+ return symbols[kind] ?: @"circle.fill";+}++static UILabel *label(NSString *text, UIFontTextStyle style, UIFontWeight weight, UIColor *color) {+ UILabel *view = [UILabel new];+ view.text = text;+ UIFont *font = [UIFont systemFontOfSize:[UIFont preferredFontForTextStyle:style].pointSize weight:weight];+ view.font = [[UIFontMetrics metricsForTextStyle:style] scaledFontForFont:font];+ view.adjustsFontForContentSizeCategory = YES;+ view.textColor = color;+ view.numberOfLines = 0;+ return view;+}++#pragma mark - the sheet++// What this version brought, the way the system's apps say it after an update: a large title, the+// changes under their kind with a symbol each, and Continue. A page sheet, so a swipe down closes it too.+@interface SGWhatsNewController : UIViewController+@end++@implementation SGWhatsNewController++- (instancetype)init {+ if (!(self = [super initWithNibName:nil bundle:nil])) return nil;+ self.modalPresentationStyle = UIModalPresentationPageSheet;+ self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ self.sheetPresentationController.prefersGrabberVisible = YES;+ return self;+}++- (UIView *)rowFor:(SGUpdateChange *)change {+ UIImageView *icon = SGSymbolView(symbolFor(change.kind), 20, UIImageSymbolWeightSemibold, 30);+ icon.tintColor = SGGreen();+ // Commit titles start in lower case; a sentence on a sheet does not.+ NSString *line = change.text.length ? [[change.text substringToIndex:1].uppercaseString stringByAppendingString:[change.text substringFromIndex:1]] : @"";+ UILabel *text = label(line, UIFontTextStyleBody, UIFontWeightRegular, UIColor.whiteColor);+ [text setContentHuggingPriority:UILayoutPriorityDefaultLow - 1 forAxis:UILayoutConstraintAxisHorizontal];+ UIStackView *row = [[UIStackView alloc] initWithArrangedSubviews:@[icon, text]];+ row.alignment = UIStackViewAlignmentFirstBaseline;+ row.spacing = 14;+ [NSLayoutConstraint activateConstraints:@[[icon.widthAnchor constraintEqualToConstant:30]]];+ return row;+}++- (void)viewDidLoad {+ [super viewDidLoad];+ // iOS 26 gives a sheet its own material; before it the sheet takes the mod's page colour.+ if (@available(iOS 26.0, *)) {} else self.view.backgroundColor = SGPageBackground();++ UILabel *title = label(@"What's New in Vitrine", UIFontTextStyleLargeTitle, UIFontWeightBold, UIColor.whiteColor);+ title.textAlignment = NSTextAlignmentCenter;+ title.accessibilityTraits = UIAccessibilityTraitHeader;+ UILabel *version = label([NSString stringWithFormat:@"Version %s", SG_VERSION], UIFontTextStyleSubheadline, UIFontWeightRegular, SGGrey());+ version.textAlignment = NSTextAlignmentCenter;++ UIStackView *column = [[UIStackView alloc] initWithArrangedSubviews:@[title, version]];+ column.axis = UILayoutConstraintAxisVertical;+ column.spacing = 6;+ [column setCustomSpacing:32 afterView:version];+ NSString *kind = nil;+ for (SGUpdateChange *change in SGWhatsNewChanges()) {+ if (![change.kind isEqualToString:kind]) {+ kind = change.kind;+ UILabel *heading = label(kind, UIFontTextStyleTitle3, UIFontWeightSemibold, UIColor.whiteColor);+ heading.accessibilityTraits = UIAccessibilityTraitHeader;+ if (column.arrangedSubviews.count > 2) [column setCustomSpacing:28 afterView:column.arrangedSubviews.lastObject];+ [column addArrangedSubview:heading];+ [column setCustomSpacing:14 afterView:heading];+ }+ UIView *row = [self rowFor:change];+ [column addArrangedSubview:row];+ [column setCustomSpacing:16 afterView:row];+ }+ column.translatesAutoresizingMaskIntoConstraints = NO;++ UIScrollView *scroll = [UIScrollView new];+ scroll.alwaysBounceVertical = YES;+ scroll.translatesAutoresizingMaskIntoConstraints = NO;+ [scroll addSubview:column];+ [self.view addSubview:scroll];++ UIButton *done = SGOnboardingButton(@"Continue");+ [done addAction:[UIAction actionWithHandler:^(UIAction *action) {+ [self dismissViewControllerAnimated:YES completion:nil];+ }] forControlEvents:UIControlEventTouchUpInside];+ [self.view addSubview:done];++ const CGFloat margin = 32;+ UILayoutGuide *safe = self.view.safeAreaLayoutGuide;+ UILayoutGuide *frame = scroll.frameLayoutGuide, *content = scroll.contentLayoutGuide;+ [NSLayoutConstraint activateConstraints:@[+ [scroll.topAnchor constraintEqualToAnchor:self.view.topAnchor],+ [scroll.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],+ [scroll.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],+ [scroll.bottomAnchor constraintEqualToAnchor:done.topAnchor constant:-12],+ [column.topAnchor constraintEqualToAnchor:content.topAnchor constant:56],+ [column.bottomAnchor constraintEqualToAnchor:content.bottomAnchor constant:-16],+ [column.leadingAnchor constraintEqualToAnchor:content.leadingAnchor constant:margin],+ [column.trailingAnchor constraintEqualToAnchor:content.trailingAnchor constant:-margin],+ [column.widthAnchor constraintEqualToAnchor:frame.widthAnchor constant:-2 * margin],+ [done.leadingAnchor constraintEqualToAnchor:safe.leadingAnchor constant:24],+ [done.trailingAnchor constraintEqualToAnchor:safe.trailingAnchor constant:-24],+ [done.bottomAnchor constraintEqualToAnchor:safe.bottomAnchor constant:-16],+ ]];+}++// Continue and a swipe down both end here; the signing sheet waits for whatever held the screen.+- (void)viewDidDisappear:(BOOL)animated {+ [super viewDidDisappear:animated];+ if (self.isBeingDismissed) SGShowSigningFixIfPending();+}++@end++#pragma mark - entry++static __weak SGWhatsNewController *sg_sheet;++BOOL SGWhatsNewShowing(void) {+ return sg_sheet != nil;+}++void SGShowWhatsNew(void) {+ if (sg_sheet || !SGWhatsNewChanges().count) return;+ UIViewController *top = SGTopController();+ // Presenting from an alert lands nowhere; the sheet waits for it to go.+ if (!top || [top isKindOfClass:UIAlertController.class]) {+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ SGShowWhatsNew(); });+ return;+ }+ SGWhatsNewController *sheet = [SGWhatsNewController new];+ sg_sheet = sheet;+ [top presentViewController:sheet animated:YES completion:nil];+}diff --git a/tweak/Sources/Core/SGUIMode.h b/tweak/Sources/Core/SGUIMode.hindex 7af6fc64..7c40baaa 100644--- a/tweak/Sources/Core/SGUIMode.h+++ b/tweak/Sources/Core/SGUIMode.h@@ -16,8 +16,8 @@// fall back to a blur, and the redesign runs untested against an older UIKit (issue #37, iOS 17: a// scene-update watchdog hang). So below 26 it runs only after a warning has been accepted, which stores// SGKeyRedesignUntested (App/Pages.m's SGSetRedesignedUI does it), and only while it starts: a launch-// whose main queue did not run for 15 s is followed by one in the native look, with both switches off-// and SGRedesignFellBack() answering YES for the App layer to say so.+// whose main queue neither ran for 15 s nor saw Spotify leave the front is followed by one in the native+// look, with both switches off and SGRedesignFellBack() answering YES for the App layer to say so.#define SGKeyRedesignUntested @"spotifyglass.redesign.untested"// Whether this OS has the redesign's material: iOS 26 and up.diff --git a/tweak/Sources/Core/SGUIMode.m b/tweak/Sources/Core/SGUIMode.mindex 7c4106cd..5e74eaee 100644--- a/tweak/Sources/Core/SGUIMode.m+++ b/tweak/Sources/Core/SGUIMode.m@@ -1,3 +1,4 @@+#import <UIKit/UIKit.h>#import "SGUIMode.h"#import "SGLog.h"#import "SGPrefs.h"@@ -16,9 +17,10 @@ BOOL SGRedesignFellBack(void) {}// Below iOS 26 a launch with the redesign leaves a mark that the main queue takes off once it has run-// for a while; a launch that hung (the watchdog of #37) never gets there, so the next one finds the-// mark and starts native. ponytail: a quit inside the first 15 s also counts as a launch that hung, and-// turns the redesign off; a hang later on is not caught.+// for a while, or as Spotify first leaves the front, which only a main thread that answers is told of. A+// launch that hung (the watchdog of #37) gets to neither, so the next one finds the mark and starts+// native. ponytail: a force quit from the switcher in the first 15 s, with Spotify still in front until+// then, counts as a hang; a hang later on is not caught.static BOOL startsUntested(void) {NSUserDefaults *store = NSUserDefaults.standardUserDefaults;if ([store boolForKey:kStarting]) {@@ -34,6 +36,11 @@ static BOOL startsUntested(void) {dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kStarted * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{[store removeObjectForKey:kStarting];});+ __block id token = [NSNotificationCenter.defaultCenter addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:nil+ usingBlock:^(NSNotification *note) {+ [NSNotificationCenter.defaultCenter removeObserver:token];+ [store removeObjectForKey:kStarting];+ }];return YES;}