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 Gemini key prompt explains sharing and the meanings sheet uses glass

My-Name-Is-Jeffaa056fdc1445
diff --git a/docs/tweaks.md b/docs/tweaks.md
index 2fd6e679..df1e55c6 100644
--- a/docs/tweaks.md
+++ b/docs/tweaks.md
@@ -100,8 +100,8 @@ Shared:
source won, Spotify's own included: matched by the line's folded text, as copies kept in place of the
lines (KaraokeSource.x), which the view picks up
LyricsTranslation/ a song's lines translated by Gemini on the user's own key (Keychain), from the lyrics' corner
- menu, for the lines no source translated; the reply read and checked on the Mac against
- harness/lyrics-translation/
+ menu, for the lines no source translated; the key's prompt and the menu item say the lyrics go to
+ Google. The reply read and checked on the Mac against harness/lyrics-translation/
LockScreenLyrics/ the line being sung in the system's now playing, and on iOS 26 the lyrics as the lock screen's
full-screen artwork (LyricsArtwork.x): a new artwork ID per line, its 3:4 H.264 clip (the line and the
next one dimmed over the blurred cover, SGLyricsClip.m) written only when the lock screen asks for it,
diff --git a/tweak/Sources/Redesigned/Lyrics/MeaningSheet.m b/tweak/Sources/Redesigned/Lyrics/MeaningSheet.m
index 1b82b814..ecbe8f21 100644
--- a/tweak/Sources/Redesigned/Lyrics/MeaningSheet.m
+++ b/tweak/Sources/Redesigned/Lyrics/MeaningSheet.m
@@ -4,6 +4,8 @@
#import "Redesigned/Kit/SGRTokens.h"
static const CGFloat kSide = 24, kTop = 28, kGap = 12;
+// The footer's row is drawn 22pt tall; its buttons take touches over 44, centred on it.
+static const CGFloat kRow = 22, kTouch = 44;
static NSString *authorName(SGLyricsMeaningAuthor author) {
switch (author) {
@@ -75,7 +77,12 @@ static NSString *authorSymbol(SGLyricsMeaningAuthor author) {
- (void)viewDidLoad {
[super viewDidLoad];
- self.view.backgroundColor = UIColor.systemBackgroundColor;
+ // From iOS 26 a sheet short of full height is Liquid Glass, which the system draws and turns opaque
+ // itself at the large detent and under Reduce Transparency; a fill here would cover it.
+ if (@available(iOS 26.0, *)) {
+ } else {
+ self.view.backgroundColor = UIColor.systemBackgroundColor;
+ }
_scroll = [[UIScrollView alloc] initWithFrame:self.view.bounds];
_scroll.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_scroll.alwaysBounceVertical = YES;
@@ -129,18 +136,18 @@ static NSString *authorSymbol(SGLyricsMeaningAuthor author) {
y = CGRectGetMaxY(_author.frame) + kGap + 4;
_body.frame = CGRectMake(left, y, width, [_body sizeThatFits:CGSizeMake(width, CGFLOAT_MAX)].height);
y = CGRectGetMaxY(_body.frame) + kGap * 2;
- _count.frame = CGRectMake(left, y, [_count sizeThatFits:CGSizeMake(width, 22)].width, 22);
- CGFloat right = left + width;
+ _count.frame = CGRectMake(left, y, [_count sizeThatFits:CGSizeMake(width, kRow)].width, kRow);
+ CGFloat right = left + width, touchTop = y - (kTouch - kRow) / 2;
if (!_next.hidden) {
- CGSize size = [_next sizeThatFits:CGSizeZero];
- _next.frame = CGRectMake(right - size.width, y, size.width, 22);
+ CGFloat side = MAX(kTouch, [_next sizeThatFits:CGSizeZero].width);
+ _next.frame = CGRectMake(right - side, touchTop, side, kTouch);
right = CGRectGetMinX(_next.frame) - 20;
}
if (!_open.hidden) {
- CGSize size = [_open sizeThatFits:CGSizeZero];
- _open.frame = CGRectMake(right - size.width, y, size.width, 22);
+ CGFloat side = MAX(kTouch, [_open sizeThatFits:CGSizeZero].width);
+ _open.frame = CGRectMake(right - side, touchTop, side, kTouch);
}
- _scroll.contentSize = CGSizeMake(self.view.bounds.size.width, y + 22 + kTop + self.view.safeAreaInsets.bottom);
+ _scroll.contentSize = CGSizeMake(self.view.bounds.size.width, touchTop + kTouch + kTop + self.view.safeAreaInsets.bottom);
}
- (void)showNext {
diff --git a/tweak/Sources/Shared/LyricsTranslation/LyricsTranslation.m b/tweak/Sources/Shared/LyricsTranslation/LyricsTranslation.m
index 3fd86c57..ce4acd4a 100644
--- a/tweak/Sources/Shared/LyricsTranslation/LyricsTranslation.m
+++ b/tweak/Sources/Shared/LyricsTranslation/LyricsTranslation.m
@@ -153,19 +153,29 @@ void SGLyricsTranslateWithGemini(NSString *trackID, NSArray<SGKaraokeLine *> *li
#pragma mark - the row
static void askForKey(void) {
+ // Says what leaves the phone, not only where the key stays: each song translated goes to Google whole.
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Gemini API key"
- message:@"Lyrics translate into any language with your own key, from Google AI Studio. It stays on this iPhone."
+ message:@"Translate with Gemini sends the song's lyrics to Google, on your own key from Google AI Studio. The key stays on this iPhone."
preferredStyle:UIAlertControllerStyleAlert];
+ // An empty field would store nothing and take the key away, which only Remove is for: Save waits for text.
+ __weak UIAlertController *weakAlert = alert;
+ UIAlertAction *save = [UIAlertAction actionWithTitle:@"Save" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+ NSString *key = [weakAlert.textFields.firstObject.text stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
+ if (key.length) storeKey(key);
+ }];
+ save.enabled = NO;
+ __weak UIAlertAction *weakSave = save;
[alert addTextFieldWithConfigurationHandler:^(UITextField *field) {
field.placeholder = @"API key";
field.secureTextEntry = YES;
field.autocorrectionType = UITextAutocorrectionTypeNo;
field.autocapitalizationType = UITextAutocapitalizationTypeNone;
+ __weak UITextField *weakField = field; // the field keeps its actions, and the alert both
+ [field addAction:[UIAction actionWithHandler:^(UIAction *action) {
+ weakSave.enabled = [weakField.text stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet].length > 0;
+ }] forControlEvents:UIControlEventEditingChanged];
}];
- [alert addAction:[UIAlertAction actionWithTitle:@"Save" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
- NSString *key = [alert.textFields.firstObject.text stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
- storeKey(key);
- }]];
+ [alert addAction:save];
if (SGGeminiKeySet()) {
[alert addAction:[UIAlertAction actionWithTitle:@"Remove" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
storeKey(nil);