Skip to content
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
99b8bb6
feat(home): add in-place Home and library section customization and c…
Quick104 Nov 24, 2026
b192011
refactor(tvos): keep Home section customization in Settings only
Quick104 Nov 24, 2026
1508d8d
fix(home): address PR review findings and wire string catalog keys
Quick104 Nov 24, 2026
e466fd8
fix(home): harden async fencing, drag reconciliation, and collection …
Quick104 Nov 24, 2026
576aed7
fix(home): lock stale refresh edits, fence initial layout load, and m…
Quick104 Nov 24, 2026
8161430
fix(home): scope preference write tracking per identity, localize gro…
Quick104 Nov 24, 2026
1d33ac2
fix(home): harden reset/held-write reconciliation, library pin failur…
Quick104 Nov 24, 2026
1d7a2fd
fix(home): restrict Hero Banner to Home, invalidate library fetches, …
Quick104 Nov 24, 2026
15bdd4b
fix(home): reconcile uncertain PUT/create outcomes, pass requestIdent…
Quick104 Nov 24, 2026
353583e
fix(home): preserve queued edits, reconcile uncertain writes, and ref…
Quick104 Nov 24, 2026
004ac5e
fix(home): preserve shared collections, deferred writes across profil…
Quick104 Nov 24, 2026
effb7d5
fix(home): harden picker invalidation, break deferred-write retain cy…
Quick104 Nov 24, 2026
a9d1f11
fix(home): refresh open collection detail on membership edits and nor…
Quick104 Nov 24, 2026
1a94f5f
fix(collections): coalesce detail refreshes, surface refresh errors, …
Quick104 Nov 24, 2026
95216b1
fix(home): harden quick-action loads, preference Done waits, library …
Quick104 Nov 24, 2026
03b0817
fix(collections): fence detail invalidations, register sheet mutation…
Quick104 Nov 24, 2026
77b22cf
fix(home): harden preference recovery waits, library refresh scoping,…
Quick104 Nov 24, 2026
beec8cb
fix(collections): fence scheduled mutation dispatch, title resolution…
Quick104 Nov 24, 2026
2dd01f7
fix(home): fence library refresh invalidations, collection cache writ…
Quick104 Nov 24, 2026
182a3d9
fix(collections): fence collection read/error paths and preserve Sett…
Quick104 Nov 24, 2026
2a3826f
fix(home): lock Settings Done scope switching, settle Reset preferenc…
Quick104 Nov 24, 2026
b84b218
fix(collections): fence overlapping title reads, retry invalidated li…
Quick104 Nov 24, 2026
25d5d81
fix(collections): gate sharing and membership on server capabilities,…
Quick104 Nov 24, 2026
d14efb8
fix(home,collections): map episode cards to series, keep mutation err…
Quick104 Nov 24, 2026
9ac9956
fix(collections,home): model unknown membership as add-only, fence sh…
Quick104 Nov 24, 2026
ea2da38
fix(home,collections): update surviving custom-row positions on delet…
Quick104 Nov 24, 2026
cfddbd1
fix(collections,home): tighten invalidation/rollback guards, preserve…
Quick104 Nov 24, 2026
7a152a0
fix(collections,home): fence count refresh against cache invalidation…
Quick104 Nov 24, 2026
a9688bf
fix(collections,home): keep pin state and empty-page loads alive, deg…
Quick104 Nov 24, 2026
7a90779
fix(collections,home): keep mutated missing libraries unloaded, prese…
Quick104 Nov 24, 2026
c76c1c1
fix(collections,settings): preserve serverUpgradeRequired after retri…
Quick104 Nov 24, 2026
4bf5482
fix(home,collections,settings): defer feed refresh while collection s…
Quick104 Nov 24, 2026
be960af
fix(home): invalidate media-scoped library section caches when refres…
Quick104 Nov 24, 2026
5db2232
fix(settings,collections,home): fence prefs reconciliation, bound pag…
Quick104 Nov 24, 2026
df2cdd0
fix(settings): scope reconciliation holds by request identity and gen…
Quick104 Nov 24, 2026
b8addb4
fix(home,tvos,settings): fallback to surviving drag crossings, sample…
Quick104 Nov 24, 2026
60fe2d1
fix(collections,settings,tvos): preserve overlapping confirmed rows, …
Quick104 Nov 24, 2026
e96fb57
fix(collections,home,settings): retain confirmed membership across me…
Quick104 Nov 24, 2026
2736470
fix(collections,home,settings,tvos): guard pin rollback generations, …
Quick104 Nov 24, 2026
bd17620
fix(tvos): stop superseded library refills per page and fence library…
Quick104 Nov 24, 2026
d719cd9
fix(tvos): drive TVLibraryBrowseView loading, error, and invalidated …
Quick104 Nov 24, 2026
d501d0e
fix(collections,home,settings): clear unavailable 404 collection grid…
Quick104 Nov 24, 2026
a324faa
fix(collections,home,settings,tvos): expose tvOS customize VoiceOver …
Quick104 Nov 24, 2026
3197108
fix(home): localize tvOS customization UI and tighten collection reco…
Quick104 Nov 24, 2026
f29f895
fix(home): preserve continuation progress, key-checked pref reconcili…
Quick104 Nov 24, 2026
ff7f0a9
fix(home): fence Add Row picker catalog by captured userLibrariesRevi…
Quick104 Nov 24, 2026
7cbc15e
fix(home): harden collection reloads, drag reversal rebase, and tvOS …
Quick104 Nov 24, 2026
8524116
fix(startup): pair userLibraries response and revision in SharedFetch…
Quick104 Nov 24, 2026
0fc677b
fix(collections): surface inline pin load errors and discard obsolete…
Quick104 Nov 24, 2026
afdd446
fix(home): validate prefetch generation, fence collection resets, and…
Quick104 Nov 24, 2026
16da742
fix(home): gate Add Row submission on editor writable state
Quick104 Nov 24, 2026
d568195
fix(home): recreate pin bar per collection, decode multi-library ids,…
Quick104 Nov 24, 2026
8ee23f8
fix(collections): propagate discovery failure to retry and clear inva…
Quick104 Nov 24, 2026
62904c7
refactor(home): trim the PR back to Home and collection customization
Quick104 Nov 25, 2026
0fb2b7b
fix(home): keep collection actions on empty collections and fence rec…
Quick104 Nov 25, 2026
da76c96
fix(home): keep a valid recipe catalog across repeated picker failures
Quick104 Nov 25, 2026
fa107fd
fix(tvos): make the Home Sections editor readable and stop clipping c…
Quick104 Nov 25, 2026
fe4a094
feat(tvos): customize library rows from Apple TV Settings
Quick104 Nov 25, 2026
3aff552
fix(home): keep custom row positions in line with the web client
Quick104 Nov 25, 2026
84c192d
fix(home): close orphaned tvOS row options and settle satisfied edits
Quick104 Nov 25, 2026
6dfb2f2
chore(i18n): pin translations 2026.11.25-e8c81d0
Quick104 Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .silo-translations
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
platform=apple
version=2026.11.23-73e6a54
sha256=0518c0e876e7e74af99ae02ba981c261054d5623536fd7129a2b89e0aee83449
version=local-635fb62bc2bd
sha256=-
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
1,865 changes: 1,865 additions & 0 deletions iosApp/Tests/ProfileHomeLayoutTests.swift

Large diffs are not rendered by default.

50 changes: 40 additions & 10 deletions iosApp/Tests/Support/APIv2TestStub.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import XCTest
@testable import Silo

/// Scenario wrapper over the shared `StubURLProtocol.Handler` for the API v2
Expand Down Expand Up @@ -38,7 +39,8 @@ final class APIv2TestStub: @unchecked Sendable {
private var holdPath: String?
private var gate: StubURLProtocol.Gate?
private var heldArrived = false
private var heldWaiters: [CheckedContinuation<Void, Never>] = []
private var nextWaiterId = 0
private var heldWaiters: [(id: Int, continuation: CheckedContinuation<Bool, Never>)] = []

init(fallback: Reply = .json(200, "{}")) {
self.fallback = fallback
Expand All @@ -63,7 +65,7 @@ final class APIv2TestStub: @unchecked Sendable {
heldArrived = true
let waiters = heldWaiters
heldWaiters.removeAll()
for waiter in waiters { waiter.resume() }
for waiter in waiters { waiter.continuation.resume(returning: true) }
return (reply, gate)
}
if let gate { await gate.wait() }
Expand Down Expand Up @@ -116,15 +118,43 @@ final class APIv2TestStub: @unchecked Sendable {
}
}

/// Suspends until the parked request has arrived at the stub.
func waitUntilHeld() async {
await withCheckedContinuation { continuation in
let resumeNow = lock.withLock { () -> Bool in
if heldArrived { return true }
heldWaiters.append(continuation)
return false
/// Suspends until the parked request has arrived at the stub or `timeout`
/// expires. Fails the test with the expected path on timeout and resumes
/// the continuation exactly once even when arrival and timeout race.
func waitUntilHeld(
timeout: Duration = .seconds(5),
file: StaticString = #filePath,
line: UInt = #line
) async {
let expectedPath = lock.withLock { holdPath }
var timeoutTask: Task<Void, Never>?
let arrived = await withCheckedContinuation { (continuation: CheckedContinuation<Bool, Never>) in
let waiterId: Int? = lock.withLock {
if heldArrived { return nil }
nextWaiterId += 1
let id = nextWaiterId
heldWaiters.append((id: id, continuation: continuation))
return id
}
if resumeNow { continuation.resume() }
guard let waiterId else {
continuation.resume(returning: true)
return
}
timeoutTask = Task {
try? await Task.sleep(for: timeout)
let timedOut: CheckedContinuation<Bool, Never>? = self.lock.withLock {
guard let idx = self.heldWaiters.firstIndex(where: { $0.id == waiterId }) else {
return nil
}
return self.heldWaiters.remove(at: idx).continuation
}
timedOut?.resume(returning: false)
}
}
timeoutTask?.cancel()
if !arrived {
let target = expectedPath.map { " to \($0)" } ?? ""
XCTFail("Timed out waiting for held request\(target)", file: file, line: line)
}
}

Expand Down
28 changes: 26 additions & 2 deletions iosApp/iosApp/Components/MediaCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ struct MediaCard: View {
/// An episode card's series and episode. When set, a tap opens the
/// series on that episode instead of loading the episode first.
var seriesContext: SeriesDetailContext? = nil
var collectionTargetTitle: String? = nil
/// The item behind the card. A tap offers it to the page it opens,
/// which draws from it until its own detail loads.
var detailSeedSource: DetailSeedSource? = nil
Expand Down Expand Up @@ -137,6 +138,7 @@ struct MediaCard: View {
@State private var personalState = MediaCardPersonalState()
@EnvironmentObject private var overlayStore: OverlayPrefsStore
#if !os(tvOS)
@State private var isShowingAddToCollection = false
@Environment(AppRouter.self) private var router
@Environment(\.browseLibraryId) private var browseLibraryId
#endif
Expand Down Expand Up @@ -208,6 +210,14 @@ struct MediaCard: View {
.onChange(of: userState) { _, _ in
personalState.reset()
}
.sheet(isPresented: $isShowingAddToCollection) {
if let targetId = addToCollectionTargetId {
IOSAddToCollectionSheet(
contentId: targetId,
itemTitle: seriesContext != nil ? collectionTargetTitle : title
)
}
}
.frame(width: cardWidth)
#endif
}
Expand Down Expand Up @@ -293,8 +303,21 @@ struct MediaCard: View {

private var hasStateActions: Bool { hasPersonalActions || canSetWatched }

private var addToCollectionTargetId: String? {
guard hasPersonalActions else { return nil }
if let mediaType, SiloMediaType.isEpisode(mediaType) {
return seriesContext?.seriesContentId
}
return seriesContext?.seriesContentId ?? contentId
}

private var stateMenu: MediaStateMenuItems {
MediaStateMenuItems(
#if !os(tvOS)
let addToCollectionAction: (() -> Void)? = addToCollectionTargetId != nil ? { isShowingAddToCollection = true } : nil
#else
let addToCollectionAction: (() -> Void)? = nil
#endif
return MediaStateMenuItems(
isWatched: isPlayed,
isFavorite: isFavorite,
inWatchlist: isInWatchlist,
Expand All @@ -303,7 +326,8 @@ struct MediaCard: View {
onToggleWatched: canSetWatched ? toggleWatched : nil,
onToggleFavorite: hasPersonalActions ? togglePersonalFavorite : nil,
onToggleWatchlist: hasPersonalActions ? togglePersonalWatchlist : nil,
onToggleNotInterested: offersNotInterested ? toggleNotInterested : nil
onToggleNotInterested: offersNotInterested ? toggleNotInterested : nil,
onAddToCollection: addToCollectionAction
)
}

Expand Down
7 changes: 7 additions & 0 deletions iosApp/iosApp/Components/MediaStateMenuItems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ struct MediaStateMenuItems: View {
var onToggleWatchlist: (() -> Void)? = nil
/// Movies and series only; see `MediaCardPersonalState.offersNotInterested`.
var onToggleNotInterested: (() -> Void)? = nil
/// Opens the personal collection picker for this item.
var onAddToCollection: (() -> Void)? = nil

var body: some View {
Group {
Expand All @@ -38,6 +40,11 @@ struct MediaStateMenuItems: View {
)
}
}
if let onAddToCollection {
Button(action: onAddToCollection) {
Label(.collectionsAddToMenuAction, systemImage: "folder.badge.plus")
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
NotInterestedMenuButton(isNotInterested: isNotInterested, action: onToggleNotInterested)
}
.disabled(isUpdating)
Expand Down
26 changes: 24 additions & 2 deletions iosApp/iosApp/Components/TabTopBarActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ struct TabTopBarActions: View {
let onOpenRequests: () -> Void
let onSwitchProfile: () -> Void
let onSignOut: () -> Void
/// Optional in-place page customization action placed inside the Profile menu
/// (e.g. "Customize Home" on Home, "Customize Movies" on a Library page).
var customizePageTitle: String? = nil
var onCustomizePage: (() -> Void)? = nil
/// Vertical in the iPhone Duo's status column (`StatusColumnBar`).
var axis: Axis = .horizontal
/// The page's chrome scroll state. With one, the cluster sits in a glass
Expand Down Expand Up @@ -81,7 +85,9 @@ struct TabTopBarActions: View {
onOpenSettings: onOpenSettings,
onOpenRequests: onOpenRequests,
onSwitchProfile: onSwitchProfile,
onSignOut: onSignOut
onSignOut: onSignOut,
customizePageTitle: customizePageTitle,
onCustomizePage: onCustomizePage
)
}
.pageChromePill(scrollState: axis == .horizontal ? chromeScrollState : nil)
Expand Down Expand Up @@ -138,6 +144,8 @@ struct ProfileAvatarMenu: View {
let onOpenRequests: () -> Void
let onSwitchProfile: () -> Void
let onSignOut: () -> Void
var customizePageTitle: String? = nil
var onCustomizePage: (() -> Void)? = nil
private let directory = AccountDirectory.shared

#if os(iOS)
Expand All @@ -164,6 +172,13 @@ struct ProfileAvatarMenu: View {
#if !os(iOS)
@ViewBuilder
private var featureActions: some View {
if let customizePageTitle, let onCustomizePage {
Button {
onCustomizePage()
} label: {
Label(customizePageTitle, systemImage: "slider.horizontal.3")
}
}
if requestsEnabled {
Button {
onOpenRequests()
Expand Down Expand Up @@ -299,7 +314,7 @@ struct ProfileAvatarMenu: View {
// the account actions, then Sign Out on its own. The header titles
// whichever group comes first.
Menu {
if requestsEnabled || showsWatchParty {
if customizePageTitle != nil || requestsEnabled || showsWatchParty {
titledSection { featureActions }
Section { accountActions }
} else {
Expand Down Expand Up @@ -355,6 +370,13 @@ struct ProfileAvatarMenu: View {
/// The panel's rows, in the same order and groups as the system menu.
private var panelSections: [[ProfileMenuPanel.Row]] {
var features: [ProfileMenuPanel.Row] = []
if let customizePageTitle, let onCustomizePage {
features.append(.init(
title: .verbatim(customizePageTitle),
systemImage: "slider.horizontal.3",
action: onCustomizePage
))
}
if requestsEnabled {
features.append(.init(
title: .menuRequests,
Expand Down
Loading