Skip to content

tvOS Skyline Redesign - #6

Merged
Quick104 merged 34 commits into
mainfrom
tvos-skyline-redesign
Jun 14, 2026
Merged

Quick104 merged 34 commits into
mainfrom
tvos-skyline-redesign

Conversation

@Quick104

@Quick104 Quick104 commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reworks the Apple TV (tvOS) experience around the Skyline navigation design — a Home-first, content-type-driven layout with a focus-following marquee, persistent library scope, and a cascading selector. This is the Apple side of the cross-platform Skyline direction and replaces the prior Libraries / For You root split.

Navigation

  • Type-derived top tabs replace the Libraries / For You roots; For You folds into Home.
  • Sub-destination pill row replaces the mode slider; the "Featured" landing is renamed to "Browse".
  • Cascading library selector with dwell trigger and scope caption; library scope state persists across sessions.
  • Expanded profile dropdown; the top menu keeps tab focus when its dropdown opens.

Surfaces & components

  • New TVFocusMarquee — focus drives a crossfading hero marquee with richer metadata (§5.4/§5.5).
  • Shared TVSkylineSectionFeed across Home and library Browse surfaces; the hero backdrop follows card focus.
  • Collection fan cards + Collections grid; refreshed Browse, Collections, and A–Z (mono font + current-letter chip) library views.
  • Refined TVRootHeroBackdrop layout/readability; new Continuum theme tokens.

Stability & polish

  • Stabilized focus handoff, poster-row layout, marquee crossfades, and top-menu dropdown focus.
  • Full reduce-motion pass; page sections instead of scrolling to kill focus jitter.

Also in this diff

  • Minor playback/CoreMedia adjustments (PlayerCore, AudioOutput, VideoFrameScheduler) committed alongside Phase 2.
  • Skyline design guide, implementation prompts, rendered HTML mockups + screenshots, and a real-time updates spec under docs/.

Test plan

  • ✅ xcodebuild build -scheme SiloTV -destination 'generic/platform=tvOS Simulator' — BUILD SUCCEEDED (app + Top Shelf extension).
  • Manual focus walkthrough on the Apple TV simulator: Home marquee, type tabs, cascade selector, A–Z rail, Collections grid.
  • Verify reduce-motion behavior.
  • Sanity-check playback given the CoreMedia changes.

Supersedes #5 (branch renamed from feature/skyline-phase-3 to tvos-skyline-redesign).

Summary by CodeRabbit

  • New Features
    • Expanded tvOS Skyline redesign: new top-bar navigation, focus marquee for Home/library browsing, and a cascading library selector.
    • Added real-time update specification describing an idle-triggered refresh approach.
    • Remembered tvOS library scope selections across sessions.
  • Bug Fixes
    • Improved media playback stability (audio interruptions and route changes).
    • Refined video frame scheduling using stricter backpressure limits.
    • Improved Reduce Motion behavior across carousel and UI transitions.
  • Documentation
    • Added Skyline design guides, implementation prompt, and tvOS redesign mockups.
    • Added a detailed real-time updates spec for iOS/tvOS Home refresh behavior.

Quick104 and others added 30 commits June 12, 2026 18:00
Replace the static tvOS root set (Home / Search / Libraries / For You /
Calendar) with content-type-first tabs per the Skyline guide §3.1:
Home · Movies · Series · Music · Audiobooks · Calendar, where a library
type's tab appears only if the profile can see at least one library of
that type. TVMainTabView now owns the visible-library fetch (cached under
user:libraries so warm starts paint the full tab set immediately).

The top bar adopts the §5.1 chrome: SILO wordmark left, tabs centered as
capsules (resting 62% white label, selected = white 14% capsule, focused
= inverted white), search icon + 52pt avatar right at the 88pt safe-area
inset, no background band, and the bar dims to 70% while focus is in
content. New chrome tokens live in ContinuumTheme.Skyline and Colors.

The Libraries tab machinery is deleted: full-screen library picker
(TVLibraryActionsModal/Panel), the library switcher accessory, the
Recommended/Collections mode slider trigger state, and the For You root.
Each type tab scopes to its first library by sortOrder for now
(// Skyline Phase 2: scope dropdown). The profile menu becomes an
anchored dropdown under the avatar; tab presses still commit on press
with the existing focus hand-down, and Menu chains content → bar →
Home → system unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
Library tabs gain the §5.2 pill row 30pt under the top bar: Featured ·
Collections · Genres · A–Z · Recently Added for movies/series, with
reduced sets for music and audiobooks until their type-specific browse
surfaces exist (Phase 2/3 markers). Pills commit on press only — moving
focus across them never swaps content — and the selected pill keeps the
inverted "you are here" capsule when focus leaves the row.

TVLibraryLandingView and its TVLibraryLandingMode state are gone, split
into per-pill content views: TVLibraryFeaturedView (hero + recommended
rows, hero grown by the pill-row clearance), TVLibraryCollectionsView
(collections grid + fan-out card), and TVLibraryGenresView (a §6.4 chip
cloud; picking a genre pushes the existing filtered-grid route so the
focused chip is never torn down mid-transition). A–Z and Recently Added
embed TVLibraryGridView inline under the pills via new showsHeader /
showsAlphabetRail / topContentInset parameters; the catalog query now
omits its video-only `type` param for audiobook/music libraries, matching
the iOS browse path.

Focus zones follow §7: bar → pills → content, with the pill row handing
Up to the bar at its boundary and content falling back to an imperative
pill-row kick when the engine can't reach it. Pill switches crossfade
200ms with focus parked on the pressed pill; per-type pill selection is
session-scoped in the shell. Featured/Collections defer entry focus
claims until their data arrives instead of gating on menu state, and the
hero carousel now respects Reduce Motion by disabling auto-advance.

Co-Authored-By: Claude Fable 5 <[email protected]>
Home now loads the recommendations feed alongside its sections and
splices the For You rows in right after Continue Watching (guide §6.1,
§4.1), reusing RecommendationsViewModel and SectionRow unchanged.
Recommendation rows are re-keyed ("rec:" prefix) so they can never
collide with a home section id, and home rows are identified by section
id alone so the late-arriving insert can't rebuild — and defocus — rows
the user is already on. iOS/macOS keep their dedicated Recommendations
tab; the tvOS For You root was removed with the type-derived tabs.

Co-Authored-By: Claude Fable 5 <[email protected]>
The anchored profile dropdown gains Watchlist, Favorites, and History
rows above the Settings group, routing to the existing screens, plus an
Admin Dashboard row gated on /api/v1/user/me's isAdmin flag and the
active server's name in the mono header style. Switch Server stays —
the guide marks it Android-only, but tvOS already ships multi-server
switching and dropping it would regress existing users.

Co-Authored-By: Claude Fable 5 <[email protected]>
Passive billboard for tvOS root surfaces: eyebrow (marquee.tick + source
row title), text-first title with cached-logo swap-in capped 880×200,
codec/HDR badge chips + meta line (year·genre·runtime or episode
position), 2-line synopsis that clamps to 1 when the title wraps. Never
focusable, no buttons. TVFocusMarqueeModel debounces card-focus reports
150 ms before the 240 ms crossfade (snap under Reduce Motion) and
samples the backdrop tint. Marquee/rhythm tokens join
ContinuumTheme.Skyline; marquee.tick joins Colors.

Co-Authored-By: Claude Fable 5 <[email protected]>
MediaRow reports the focused item through a new optional onItemFocus
callback observed off the row's existing @focusstate — focus gain only,
so the marquee retains the last item while focus is in chrome.
SectionRow forwards it; iOS/macOS pass nothing and are unaffected.
TVRootHeroBackdrop gains a crossfadeDuration parameter (marquee hosts
pass the §4.2 240 ms) and snaps instead of crossfading under Reduce
Motion. Calendar and Recommendations call sites are unchanged via the
defaults.

Co-Authored-By: Claude Fable 5 <[email protected]>
The tvOS rendering of HomeView drops the Featured carousel (no hero
stop, no dots, no auto-advance) and mounts TVFocusMarquee at Home scale
over a rows-only scroll whose viewport starts at the §5.7 row slot —
rows scrolling up vanish under the marquee instead of colliding with
it. Entry focus claims the first Continue Watching card (deferred while
sections load, dropped if the user moved up into the menu), the marquee
previews it immediately, and the backdrop tracks the debounced focused
item. Up from row 1 reaches the top bar in one press.

The scrollTo-based hero focus targets and hero-height mirroring are now
iOS-only; the iOS/macOS carousel path renders exactly as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
TVLibraryFeaturedView drops the hero carousel and ignores the server's
featured section (§9). The library-scale marquee sits between the pill
row and row 1; rows scroll in a viewport starting at the §5.7 slot.
Row 1 is an items row in dense 208×312 posters (new card-width
override threaded through SectionRow → MediaRow → MediaCard), entry
focus claims its first card, and Up hands to the pill row. An inline
Collections shelf follows row 1 per §6.2 — top 8 by item count with a
trailing See All card that commits the Collections pill while parking
focus on the pill row; focused collection cards preview name/count/
poster in the marquee. Fan cards remain Phase 4.

Co-Authored-By: Claude Fable 5 <[email protected]>
Guide Rev 2 renames the first pill: TVLibraryPill.featured becomes
.browse ("Browse"), per-type pill sets follow, and
TVLibraryFeaturedView becomes TVLibraryBrowseView. Pill selection is
session-only state, so no persistence migration. The stale "Skyline
Phase 2" scope-dropdown markers now point at Phase 3, where that work
moved.

Co-Authored-By: Claude Fable 5 <[email protected]>
The tvOS path of StartupContentPrefetcher now warms the first content
row's card art and backdrops (plus the first item's logo) instead of
the featured-hero images the carousel used to need — entry focus lands
on that row's first card and the marquee previews it immediately.
iOS keeps the featured-first ordering unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
The entry-focus handlers were attached to the scroll content, which
doesn't exist until sections load — a cold-start token was never
recorded as pending, and a claim issued while only recommendations had
arrived landed on unmounted rows and was lost. The handlers now live on
the tvOS root, watch the displayed row set, and only claim once rows
are actually mounted; deferred claims still drop while the menu holds
focus.

Co-Authored-By: Claude Fable 5 <[email protected]>
The model swaps content outside any animation transaction, so a
transition-attached animation wouldn't reliably fire. Move the §4.2
240 ms crossfade to a container .animation keyed on the item id; Reduce
Motion passes a nil animation so the swap snaps.

Co-Authored-By: Claude Fable 5 <[email protected]>
The marquee was a pinned overlay sharing the full-screen coordinate
space with the rows' scroll view, positioned by a top padding. Neither
a plain .padding(.top) nor a top .safeAreaInset constrains the tvOS
focus engine's scroll-to-visible, so focusing the first card
overscrolled the row up under the marquee — its header collided with
the 2-line synopsis on both Home and the Browse landing (verified in
the simulator).

Restructure instead of inset: the rows now live in a VStack below a
fixed-height clear spacer the size of the §5.7 row slot, so the scroll
view's frame physically begins below the marquee band and its content
cannot render into it. The marquee floats over the reserved band only.
Applied to both Home and the library Browse landing.

Co-Authored-By: Claude Fable 5 <[email protected]>
Simulator measurement showed the remaining marquee/row collision was
the logo title slot, not row position: a full 200 pt logo plus the meta
line and a 2-line synopsis stacks ~350 pt tall and crosses the row
slot. The guide's 880×200 logo cap (§5.4) is inconsistent with the §5.7
rhythm, so each scale now caps the logo at its 2-line text-title height
(Home 165, library 120) and a displayed logo clamps the synopsis to one
line — the same rule a wrapped title applies. Text-title layouts were
already within budget and are unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
…er meta

Iterated on simulator feedback:
- Remove the source-row eyebrow + marquee.tick from the marquee; the
  row's own header already names the source, so the block now leads
  with the title.
- Rows page one section at a time: each fills a viewport-sized,
  bottom-aligned slot (containerRelativeFrame), with .fixedSize so the
  row keeps its natural height and the header hugs its cards instead of
  being stranded at the slot top. Moving focus down scrolls exactly one
  section in. Home poster rows go dense (208 wide) like the landing.
- Expand the marquee: Home logo cap back to the full 200, synopsis up
  to 3 lines (2 under a logo/wrapped title).
- Add air date + top-3 cast (§9 backfill) and content-rating badge +
  episode/movie length to the meta. Air date and cast come from a
  cached, low-priority item-detail fetch (TVMarqueeEnrichment) that
  never blocks the marquee and fades in when it lands.

Co-Authored-By: Claude Fable 5 <[email protected]>
…jitter

The row sat in a viewport-tall scroll slot, bottom-aligned, so the tvOS
focus engine scrolled it up to center the focused card on the first
focus change (row lower on load, then jumped up ~38px). No inset tuning
fixes that — a focus-driven scroll view will always reposition.

Replace it with an explicit one-section-at-a-time pager: only the
focused section's row renders, pinned to the bottom band, with no scroll
view — so the focus engine cannot move it when navigating across cards.
Up/Down page sections (MediaRow gains onMoveDown; the row claims focus
on appear via a per-token guard so each page swap lands focus on the new
row's first card), and the swap crossfades (snaps under Reduce Motion).
Applied to Home and the library Browse landing (whose pages interleave
the inline Collections shelf per §6.2).

Co-Authored-By: Claude Fable 5 <[email protected]>
Updated HomeView and TVLibraryBrowseView to use .fixedSize for rows, ensuring they maintain their natural height and align properly with headers. This change prevents the rows from stretching and enhances layout consistency across the views.
Updated the TVRootHeroBackdrop component to improve visual alignment and accessibility. Increased the horizontal bleed from 320 to 380 for better art positioning, added an artHorizontalShift to push the focal mass away from the leading text column, and introduced a leadingReadabilityScrim to enhance text legibility against the background. These changes ensure a more cohesive and user-friendly viewing experience.
… prompts

Per user decision (2026-06-12): the merged "All <Type>" scope is removed.
Multi-library types scope to a single library chosen via the cascade selector;
no server- or client-side merge. Records the design docs and mockups referenced
by the implementation.

Co-Authored-By: Claude Fable 5 <[email protected]>
Add per-profile, per-type library scope persistence (§3.1, §8) and the
cascade/flyout/scrim design tokens it builds on.

- TVLibraryScopeStore: persists the selected library per profile + type
  via SharedDefaults, keyed by server + profile id. Resolves the
  effective scope (persisted choice, else first by sort order). Library
  scope is the one Skyline nav state kept across launches.
- ContinuumTheme.Skyline: cascade dwell (250 ms), open timing, level-1
  row + flyout metrics, flyout follow debounce (150 ms), notch sizes.
- Colors: add glass.regular token alongside the existing glass.strong.

No behavior change yet — these are consumed by the cascade selector and
shell wiring in the next commit.

Co-Authored-By: Claude Fable 5 <[email protected]>
The anchored cascading library selector (§5.3) and the focus-dwell that
opens it, replacing the implicit activeLibrary = libraries.first.

- TVCascadeSelector (new): two-level panel — level-1 libraries (real
  libraries only; no merged All<Type> per Rev 3) with ✓/› glyphs and a
  count column, level-2 sections flyout mirroring the type's pill set.
  Single-library tabs collapse to a single-level sections panel. Flyout
  follows focus with a 150 ms debounce and aligns its top to the focused
  row via a row-anchor preference (a custom VerticalAlignment can't cross
  the panel's ScrollView). Rows are .disabled until focus is handed in so
  d-pad down lands deterministically on the current-scope row.
- TVTopMenuBar: 250 ms focus-dwell opens a library tab's cascade (or the
  profile panel) without stealing focus; sweeping never opens it. Down
  enters the panel; sideways closes it; Menu closes a dwell-open panel
  instead of exiting. Profile dropdown converted from fullScreenCover to
  the same anchored panel (dwell OR press to open). Bar publishes each
  panel element's bounds for anchoring; focus returns to the panel's own
  tab on Menu-out.
- TVMainTabView: hosts the panel as a scrimmed overlay (not a route/modal)
  anchored under its element via overlayPreferenceValue; owns per-type
  scope state, commits scope (persisted) + pill on selection and swaps the
  page in place; disables the scrimmed page so down can't reach a card
  under it; fetches best-effort per-library item counts.
- TVLibraryTypeTabView / TVLibraryPillRow: take the resolved active
  library; scope caption gains the item-count suffix (e.g. "1,284 films"),
  omitted gracefully when no count is available; pills gain SF Symbols for
  the flyout.

Co-Authored-By: Claude Fable 5 <[email protected]>
Add TVCollectionFanCard (§5.6): 430×234 landscape tile, left cluster of
three fanned mini posters at −8°/−1°/+7°, right block with name (25/700)
and caps item count (17, tertiary). Vertical #2E3036→#121316 @ ~90%
surface + hairline; focus = scale 1.05 + drop shadow + 2 px white border,
matching TVMediaCard grammar (no outline ring) and honoring reduce-motion.

The collection model carries only a single posterUrl (no member-item
posters), so the three minis fan from that one poster; a missing poster
fans generated gradient tiles. Long names truncate (3 lines), counts use
a type-aware noun (MOVIES/SHOWS/…/ITEMS). Accessibility label reads
"<name>, collection, <count> items".

Additive tokens only: fan-card geometry + grid (3 col @ 430, gap 26) in
ContinuumTheme.Skyline; surface gradient stops in Colors. iOS/macOS
shared values untouched.

Co-Authored-By: Claude Fable 5 <[email protected]>
Browse Collections row (§6.2): swap the dense poster cards for
TVCollectionFanCard, keeping the ≤8-by-item-count-desc selection, the
marquee publish on focus, and the trailing See All card — now restyled to
the 430×234 fan-card surface + focus grammar so the row reads as one
family. Remove the now-dead TVCollectionsRowCard.

Collections pill grid (§6.3): replace the 6-column 220-wide poster grid
with a 3-column grid at 430 width / gap 26 within the safe area, rendering
TVCollectionFanCard. Group headers become mono caps (the cascade/dropdown
header grammar at grid scale). TVCollectionCard is now a thin focus wrapper
(entry kick, first-card hand-up, recycle guard) around the shared fan card,
preserving grid focus memory and the collection-detail push.

Add fanGridGroupHeaderSize token. Marquee collection previews unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
Gate every remaining Skyline-chrome animation behind
accessibilityReduceMotion so focus inversions, the bar dim/restore,
the avatar/chip focus scales, the A–Z rail expand, and the cascade
row inversions snap instead of springing/drifting (§4.2 acceptance:
"marquee and backdrop updates snap; no drift animations").

Sites gated: TVLibraryGenresView chip spring + scale; TVAlphabetRail
expand ease + letter focus eases; TVLibraryPillRow pill inversion
spring; TVTopMenuBar bar-dim ease, avatar focus spring + scale, tab
capsule spring/ease, profile-menu row spring/ease; TVCascadeSelector
library + section row inversion springs; TVMainTabView top-menu
focus re-arm springs. The cascade open/close, scrim, flyout-follow,
marquee, and backdrop were already gated.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sub-pill content switch (§4.2 "200 ms crossfade + 12 px upward
drift of incoming content"): the pill content is keyed on the
selected pill and given an asymmetric transition — incoming content
fades in while drifting up by the new Skyline.pillDriftY (12) token,
outgoing content fades without sliding. Reduce Motion → opacity only.

Tab content switch (§4.2 "200 ms crossfade; outgoing content does
not slide"): selectedRootContent now carries an explicit
.id(selectedRoot) + .transition(.opacity) crossfade instead of
relying on implicit animation; Reduce Motion snaps via .identity.

Both reuse the shared normalDuration (0.20) token; pillDriftY is
additive to ContinuumTheme.Skyline (no existing values changed).

Co-Authored-By: Claude Fable 5 <[email protected]>
§6.4 alphabet rail fixes:
- Letters now render in SF Mono (design: .monospaced) at the §6.4
  size (new Skyline.alphabetRailLetterSize = 15) when expanded, with
  a slim mono peek when collapsed — even advance widths read as a
  true rail. Expanded chip frame tightened to suit the mono size.
- The current/selected letter inverts to a white rounded chip (was
  white @ 15%); the focused letter keeps its inversion, so focused
  and current both read clearly. Rounded-rect chip shape replaces the
  capsule for the §6.4 "rounded chip" read. Prefix-jump unchanged.

alphabetRailLetterSize is additive to ContinuumTheme.Skyline.

Co-Authored-By: Claude Fable 5 <[email protected]>
§6.7: the tvOS Settings "Library" quick-links section (Watchlist /
Favorites / History / Collections) is now redundant — the profile
dropdown carries Watchlist/Favorites/History and the library
Collections pill carries Collections. Remove the section and its
Form mount; no routes are orphaned (all four destinations remain
reachable) and the shared iOS SettingsView is untouched.

Co-Authored-By: Claude Fable 5 <[email protected]>
Opening or closing a library tab's cascade dropdown inserts/removes an
anchored overlay, which perturbs the tvOS focus graph: the engine drops the
focused tab's @focusstate and repairs to the Home tab — the menu flashed and
focus reset to Home. The first library tab reached from Home hit only the
open-perturbation, so Movies appeared to work, while the next tab also hit the
close-perturbation of the previous panel and bounced (Series/Audiobooks).

The bar now defends its own focus: it remembers the tab focus last settled on
and re-pins to it whenever focus drops to nil while a preview panel is open or
a sideways-move just closed one. A legit leave (down into the page, Menu out)
has neither condition and is left alone. D-pad down still hands focus into the
panel rows; page content only leaves the focus graph once focus is actually in
the panel (panelHasFocus), not on mere preview.

Verified on the tvOS simulator across Movies, Series, and Audiobooks: focus
stays on each tab and its dropdown opens underneath, with no flash to Home.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Added logging functionality to track focus changes and entry tokens in the TVCascadeSelector, TVMainTabView, TVTopMenuBar, and TVLibraryPillRow. This includes the introduction of a Logger for each component to facilitate debugging focus behavior during navigation. The logs will help identify issues related to focus transitions and panel interactions. Ensure to remove debug logs before finalizing the release.
- Anchor marquee content above the row band and reduce bottom overscan spacing
- Render crisp top-right artwork with sampled page tint and top scrim
- Dismiss open top-menu panels before handing focus to selected content
Quick104 added 2 commits June 13, 2026 23:35
- Add a shared Skyline section feed for tvOS landing rows
- Replace collection fan cards with poster-grid collection cards
- Default library scope entry to Recommended
- Remove obsolete Rail design docs and tvOS mockups
- Add Apple client realtime update plan for Home refreshes
@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c4978f4-c519-460f-a43f-12e56bc61c07

📥 Commits

Reviewing files that changed from the base of the PR and between c76cdf8 and a67fe91.

📒 Files selected for processing (1)
  • iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift

📝 Walkthrough

Walkthrough

This PR implements the Skyline Phase 2 tvOS navigation redesign: the old Libraries tab, landing view, and mode slider are removed and replaced with type-derived top-bar tabs, an anchored cascading library/section selector panel, a focus marquee billboard, and new library screen views (Browse, Collections, type-tab router). Concurrently, the player receives audio-session interruption handling, deferred FFmpeg/VT teardown to prevent seek-race deadlocks, and byte-based video backpressure in VideoFrameScheduler.

Changes

Skyline tvOS Navigation Redesign

Layer / File(s) Summary
Skyline design tokens, colors, and documentation
iosApp/iosApp/Theme/Colors.swift, iosApp/iosApp/Theme/ContinuumTheme.swift, docs/skyline-design-guide.md, docs/skyline-implementation-prompt.md, docs/tvos-redesign-mockups/*, docs/realtime-updates-spec.md
Adds ContinuumTheme.Skyline token namespace with layout/animation constants, 7 new chrome/glass/scrim color constants, and the full set of design documents (guide, implementation prompt, mockups, realtime spec).
Focus marquee system
iosApp/iosApp/tvOS/Components/TVFocusMarquee.swift, iosApp/iosApp/tvOS/Components/TVRootHeroBackdrop.swift, iosApp/iosApp/tvOS/Components/TVSkylineSectionFeed.swift
Introduces TVMarqueeContent/TVMarqueeEnrichment/TVFocusMarqueeModel for debounced focus-to-billboard updates with async enrichment and tint sampling; redesigns TVRootHeroBackdrop with fractional-art corner-fade mask and top chrome scrim; adds TVSkylineSectionFeed as the paged bottom-band feed that drives marquee preview, backdrop, and entry-focus hand-down.
Top bar navigation models
iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift, iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift, iosApp/iosApp/tvOS/Navigation/TVLibraryScopeStore.swift
Rewrites TVTopMenuBar with TVTopMenuAnchorKey panel anchoring, dwell mechanics, TVProfileDropdown, and TVTopMenuCapsuleChrome; introduces TVLibraryTabType/TVRootDestination; adds TVCascadeSelector two-level library→sections panel with flyout anchoring; adds TVLibraryScopeStore for persisted per-profile library scope.
Main tab view orchestration
iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift
Refactors TVMainTabView to use anchored overlay panels, concurrent startup loading (profile/libraries/admin flag), opacity-crossfaded root switching, per-type pill/scope session state, panelOverlay geometry placement, panel open/close/commit lifecycle, TVPanelOpenTransition, and server-switch state clearing.
Library screens
iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryTypeTabView.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryBrowseView.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryCollectionsView.swift, iosApp/iosApp/tvOS/Screens/Components/TVCollectionPosterCard.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryPillRow.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibrary{GridView,GridViewModel,TabView,LandingView}.swift, iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVAlphabetRail.swift
Removes TVLibrariesTabView, TVLibraryLandingView, and the Settings library section; adds TVLibraryPill enum, TVLibraryTypeTabView pill router, TVLibraryBrowseView section feed, TVLibraryCollectionsView grid with focus hand-down, TVCollectionPosterCard; updates TVLibraryGridView with configurable header/rail/inset and TVLibraryGridViewModel with optional mediaType; updates TVAlphabetRail reduce-motion and styling.
Shared component updates
iosApp/iosApp/Components/MediaCard.swift, iosApp/iosApp/Components/MediaRow.swift, iosApp/iosApp/Screens/Home/SectionRow.swift, iosApp/iosApp/Screens/Home/HomeView.swift, iosApp/iosApp/Screens/Home/FeaturedCarousel.swift, iosApp/iosApp/Networking/ResponseCache.swift, iosApp/iosApp/Startup/StartupContentPrefetcher.swift
Adds cardWidthOverride to MediaCard; adds onItemFocus/cardWidth/onMoveDown to MediaRow and SectionRow; rewrites HomeView tvOS body to use TVSkylineSectionFeed with merged recommendation sections; updates FeaturedCarousel reduce-motion gating and tvOS extraTopInset metrics; adds user:libraries cache key; adds tvOS-specific artwork warmup path.

Player Stability

Layer / File(s) Summary
VideoFrameScheduler byte backpressure
iosApp/iosApp/Screens/Player/CoreMedia/VideoFrameScheduler.swift, iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift (backpressure wiring)
Extends VideoFrameScheduler with feedBackpressureBytes, tracks queuedBytes, blocks the feed loop on byte threshold alongside frame count, and adds approximateBytes(of:) using CVPixelBufferGetDataSize.
AudioEngineAudioOutput configuration-change handling
iosApp/iosApp/Screens/Player/CoreMedia/AudioOutput.swift
Adds intendedRunning flag tracked under stateLock, registers AVAudioEngineConfigurationChange observer in init/deinit, and adds handleEngineConfigurationChange to rebuild and conditionally resume the audio graph; updates play/pause/stop to maintain the flag.
PlayerCore interruption handling and deferred teardown
iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift
Adds AVAudioSession.interruptionNotification observer with wasPlayingWhenInterrupted tracking and conditional resume on .ended; reworks route-change handling to pause on .oldDeviceUnavailable; introduces dispose(deferringFrees:) and teardownMedia(deferFrees:) to serialize FFmpeg/VT context freeing on controlQueue; hardens resetCancellation to guard on _isDisposed; adds recoverDisplayLayerIfFailed on play().

Sequence Diagram

sequenceDiagram
  participant User as User (d-pad)
  participant TVTopMenuBar
  participant TVMainTabView
  participant TVCascadeSelector
  participant TVLibraryScopeStore
  participant TVLibraryTypeTabView

  User->>TVTopMenuBar: focus dwells on library tab
  TVTopMenuBar->>TVMainTabView: onDwell(libraryType panel)
  TVMainTabView->>TVMainTabView: openPanelPreview()
  TVTopMenuBar->>TVMainTabView: TVTopMenuAnchorKey rect published
  TVMainTabView->>TVCascadeSelector: render with focusEntryToken=0
  User->>TVTopMenuBar: press down
  TVTopMenuBar->>TVMainTabView: onEnterPanel()
  TVMainTabView->>TVCascadeSelector: entersPanel=true, focusEntryToken++
  TVCascadeSelector->>TVCascadeSelector: applyEntryToken → focus library row
  TVCascadeSelector->>TVCascadeSelector: scheduleFlyoutFollow 150ms debounce
  User->>TVCascadeSelector: select section pill
  TVCascadeSelector->>TVMainTabView: onCommitSection(Library, TVLibraryPill)
  TVMainTabView->>TVLibraryScopeStore: setSelectedLibraryId
  TVMainTabView->>TVMainTabView: closePanel() → commitScope()
  TVMainTabView->>TVLibraryTypeTabView: activeLibrary + selectedPill updated
  TVLibraryTypeTabView->>TVLibraryTypeTabView: crossfade to pillContent
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • Silo-Server/silo-apple#3: Modifies the same tvOS home/media UI components (FeaturedCarousel, HomeView, SectionRow), so changes in this PR's focus/layout refactor may overlap with that PR's tvOS tile layout and audiobook UI handling.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tvos-skyline-redesign

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c76cdf8a61

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +82 to +89
TVLibraryGridView(
libraryId: library.id,
libraryName: library.name,
libraryType: library.type,
initialFilter: .none,
showsHeader: false,
showsAlphabetRail: true,
topContentInset: ContinuumTheme.Skyline.libraryContentTopInset

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hand focus into Browse content

When a user chooses Browse from the cascade, selectRoot suppresses the top menu and increments focusRequest, but this branch drops that token while the Recommended and Collections branches pass it through. Since TVLibraryGridView/TVCatalogGrid are not given a default-focus request here, the Browse grid can mount after the panel closes with no focused element, leaving remote navigation stranded until the user backs out via Menu.

Useful? React with 👍 / 👎.

Comment on lines +524 to +525
let cached: LibrariesResponse = ResponseCache.shared.get(CacheKey.userLibraries) {
libraries = cached.libraries

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the libraries cache by server/profile

This cache key is global even though /api/v1/user/libraries is scoped by the active server and profile. After switching profiles or servers, switchToServer clears libraries and then calls loadLibraries, so this hydration can repopulate the Skyline tabs with the previous account's libraries before the refresh completes; if the refresh fails, those stale tabs remain visible for the new account.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift (1)

542-591: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Unregister long-lived audio observers in dispose(), not only in deinit.

dispose() tears the core down immediately, but these AVAudioSession observers remain active until deallocation. A later route-change or mediaServicesWereReset notification can still hit this disposed instance, mutate torn-down state, and even call reportError(...) after playback was already dismissed. Move removeAudioSessionObservers() into dispose(deferringFrees:), and use the same disposal boundary to shut down AudioEngineAudioOutput's configuration-change observer as well.

Suggested direction
 private func dispose(deferringFrees: Bool) {
     guard claimDisposed() else { return }
+    removeAudioSessionObservers()
+    audioOutput.shutdown()
     Self.logger.info("PlayerCore.dispose()")

Also applies to: 1505-1615

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift` around lines 542 -
591, The audio session observers registered in installAudioSessionObservers
(audioRouteChangeObserver, audioMediaServicesResetObserver,
audioInterruptionObserver) are only being cleaned up in deinit, but dispose()
tears down the core immediately, leaving these observers active and vulnerable
to receiving notifications on a disposed instance. Add a call to
removeAudioSessionObservers() within the dispose(deferringFrees:) method to
ensure observers are unregistered when disposal happens, not just at
deallocation. Additionally, locate and apply the same disposal pattern to
AudioEngineAudioOutput's configuration-change observer in the 1505-1615 line
range to ensure consistent cleanup at the dispose boundary.
🧹 Nitpick comments (6)
iosApp/iosApp/Screens/Player/CoreMedia/VideoFrameScheduler.swift (1)

107-114: 💤 Low value

Consider caching computed bytes in the Frame tuple.

approximateBytes(of:) is called twice per frame lifecycle (insert and removal). While CVPixelBufferGetDataSize should return consistent values, caching the computed byte count in the Frame tuple would eliminate any theoretical drift risk if the API ever behaves inconsistently (e.g., GPU-only buffers).

-typealias Frame = (imageBuffer: CVImageBuffer, pts: CMTime)
+typealias Frame = (imageBuffer: CVImageBuffer, pts: CMTime, bytes: Int)

This would require updating insertSorted, dropHead, popHead, and the overflow loop to use the stored value. Current approach is acceptable since VT buffers reliably report size, but storing once would be more robust.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/Screens/Player/CoreMedia/VideoFrameScheduler.swift` around
lines 107 - 114, The `approximateBytes(of:)` method is called twice per frame
lifecycle, which could theoretically cause drift if buffer size reporting
becomes inconsistent. Cache the computed byte count directly in the Frame tuple
instead of recalculating it. Update the Frame tuple definition to include a
field for the cached byte count, then modify the methods `insertSorted`,
`dropHead`, `popHead`, and the overflow loop to compute this value once when the
Frame is created and reuse the stored value instead of calling
`approximateBytes(of:)` each time.
docs/skyline-design-guide.md (1)

62-84: 💤 Low value

Add language specifier to the IA code block.

Markdown linters expect fenced code blocks to declare a language. For plain-text blocks like this IA tree, use text or leave the specifier empty after the triple backticks.

📝 Suggested fix
-```
+```text
 TOP BAR (persistent on all root screens)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/skyline-design-guide.md` around lines 62 - 84, The fenced code block in
the IA tree documentation does not include a language specifier after the
opening triple backticks, which causes markdown linters to raise warnings. Add
the language specifier `text` immediately after the opening triple backticks
(changing ``` to ```text) for the code block that contains the TOP BAR and
LIBRARY TAB structure diagram to comply with markdown linting standards.

Source: Linters/SAST tools

iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift (1)

3-6: 💤 Low value

Strip TVFOCUS-DEBUG logging across navigation files.

Both files include temporary focus-tracing infrastructure (import os, Logger instances) marked for removal before finalizing. A single cleanup pass can strip both.

  • iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift#L3-L6: Remove import os and tvFocusBarLog Logger.
  • iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift#L3-L6: Remove import os and tvFocusCascadeLog Logger.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift` around lines 3 - 6, Strip
temporary focus-tracing debug infrastructure marked for removal. In
iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift (lines 3-6), remove the import
os statement and the tvFocusBarLog Logger instance declaration. In
iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift (lines 3-6), remove the
import os statement and the tvFocusCascadeLog Logger instance declaration. This
cleanup removes all TVFOCUS-DEBUG markers and associated logging infrastructure
across both navigation files in a single pass.
iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift (1)

1-7: 💤 Low value

Strip debug logging before finalizing.

Same TVFOCUS-DEBUG Logger pattern as TVTopMenuBar.swift — strip before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift` around lines 1 - 7,
Remove the temporary debug logging code from the TVCascadeSelector.swift file
before finalizing. Delete the import os statement that is only used for
debugging, remove the TVFOCUS-DEBUG comment, and remove the private
tvFocusCascadeLog Logger initialization. This debug pattern should be stripped
entirely as indicated by the temporary markers, similar to the approach used
elsewhere in the codebase.
iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryPillRow.swift (1)

34-36: 💤 Low value

The type parameter in set(for:) is currently unused.

The method signature accepts a TVLibraryTabType parameter but always returns allCases regardless of the type. If different library types are expected to have different pill sets in the future, this is appropriate future-proofing. Otherwise, the parameter could be removed to simplify the signature.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryPillRow.swift` around lines 34
- 36, The `type` parameter in the `set(for:)` method is not being used in the
function body, as the method always returns `allCases` regardless of the value
passed. Remove the unused `type: TVLibraryTabType` parameter from the method
signature and update the call site accordingly by removing the argument when
calling `set(for:)`. If the type parameter is intended to be used in the future
to return different pill sets based on the library type, keep it and implement
the appropriate logic; otherwise, simplify the method signature by removing the
parameter entirely.
iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift (1)

3-6: ⚡ Quick win

Temporary debug instrumentation should be removed before finalizing.

The os import and tvFocusLog logger are marked as "TVFOCUS-DEBUG: temporary focus tracing (strip before finalizing)". Ensure these debug artifacts are removed in the final release build.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift` around lines 3 - 6, Remove
the temporary debug instrumentation from TVMainTabView.swift: delete the import
os statement and the private let tvFocusLog logger declaration that are marked
with "TVFOCUS-DEBUG: temporary focus tracing". Additionally, search the file for
any usage of the tvFocusLog variable and remove those calls as well to ensure no
orphaned references remain after removing the logger declaration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift`:
- Around line 542-591: The audio session observers registered in
installAudioSessionObservers (audioRouteChangeObserver,
audioMediaServicesResetObserver, audioInterruptionObserver) are only being
cleaned up in deinit, but dispose() tears down the core immediately, leaving
these observers active and vulnerable to receiving notifications on a disposed
instance. Add a call to removeAudioSessionObservers() within the
dispose(deferringFrees:) method to ensure observers are unregistered when
disposal happens, not just at deallocation. Additionally, locate and apply the
same disposal pattern to AudioEngineAudioOutput's configuration-change observer
in the 1505-1615 line range to ensure consistent cleanup at the dispose
boundary.

---

Nitpick comments:
In `@docs/skyline-design-guide.md`:
- Around line 62-84: The fenced code block in the IA tree documentation does not
include a language specifier after the opening triple backticks, which causes
markdown linters to raise warnings. Add the language specifier `text`
immediately after the opening triple backticks (changing ``` to ```text) for the
code block that contains the TOP BAR and LIBRARY TAB structure diagram to comply
with markdown linting standards.

In `@iosApp/iosApp/Screens/Player/CoreMedia/VideoFrameScheduler.swift`:
- Around line 107-114: The `approximateBytes(of:)` method is called twice per
frame lifecycle, which could theoretically cause drift if buffer size reporting
becomes inconsistent. Cache the computed byte count directly in the Frame tuple
instead of recalculating it. Update the Frame tuple definition to include a
field for the cached byte count, then modify the methods `insertSorted`,
`dropHead`, `popHead`, and the overflow loop to compute this value once when the
Frame is created and reuse the stored value instead of calling
`approximateBytes(of:)` each time.

In `@iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift`:
- Around line 1-7: Remove the temporary debug logging code from the
TVCascadeSelector.swift file before finalizing. Delete the import os statement
that is only used for debugging, remove the TVFOCUS-DEBUG comment, and remove
the private tvFocusCascadeLog Logger initialization. This debug pattern should
be stripped entirely as indicated by the temporary markers, similar to the
approach used elsewhere in the codebase.

In `@iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift`:
- Around line 3-6: Remove the temporary debug instrumentation from
TVMainTabView.swift: delete the import os statement and the private let
tvFocusLog logger declaration that are marked with "TVFOCUS-DEBUG: temporary
focus tracing". Additionally, search the file for any usage of the tvFocusLog
variable and remove those calls as well to ensure no orphaned references remain
after removing the logger declaration.

In `@iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift`:
- Around line 3-6: Strip temporary focus-tracing debug infrastructure marked for
removal. In iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift (lines 3-6), remove
the import os statement and the tvFocusBarLog Logger instance declaration. In
iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift (lines 3-6), remove the
import os statement and the tvFocusCascadeLog Logger instance declaration. This
cleanup removes all TVFOCUS-DEBUG markers and associated logging infrastructure
across both navigation files in a single pass.

In `@iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryPillRow.swift`:
- Around line 34-36: The `type` parameter in the `set(for:)` method is not being
used in the function body, as the method always returns `allCases` regardless of
the value passed. Remove the unused `type: TVLibraryTabType` parameter from the
method signature and update the call site accordingly by removing the argument
when calling `set(for:)`. If the type parameter is intended to be used in the
future to return different pill sets based on the library type, keep it and
implement the appropriate logic; otherwise, simplify the method signature by
removing the parameter entirely.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cb5cd999-9cb7-4000-b8a7-f424e0226458

📥 Commits

Reviewing files that changed from the base of the PR and between cedba1b and c76cdf8.

⛔ Files ignored due to path filters (12)
  • docs/tvos-redesign-mockups/shots/a1-skyline-home.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/a2-skyline-movies.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/a3-skyline-switcher.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/a4-skyline-home-marquee.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/a5-skyline-movies-marquee.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/a6-skyline-cascade.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/b1-rail-home.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/b2-rail-expanded.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/b3-rail-library.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/c1-stage-home.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/c2-stage-dock.png is excluded by !**/*.png
  • docs/tvos-redesign-mockups/shots/c3-stage-spaces.png is excluded by !**/*.png
📒 Files selected for processing (41)
  • docs/realtime-updates-spec.md
  • docs/skyline-design-guide.md
  • docs/skyline-implementation-prompt.md
  • docs/tvos-redesign-mockups/README.md
  • docs/tvos-redesign-mockups/b1-rail-home.html
  • docs/tvos-redesign-mockups/b2-rail-expanded.html
  • docs/tvos-redesign-mockups/b3-rail-library.html
  • docs/tvos-redesign-mockups/c1-stage-home.html
  • docs/tvos-redesign-mockups/c2-stage-dock.html
  • docs/tvos-redesign-mockups/c3-stage-spaces.html
  • docs/tvos-redesign-mockups/tv.css
  • iosApp/iosApp/Components/MediaCard.swift
  • iosApp/iosApp/Components/MediaRow.swift
  • iosApp/iosApp/Networking/ResponseCache.swift
  • iosApp/iosApp/Screens/Home/FeaturedCarousel.swift
  • iosApp/iosApp/Screens/Home/HomeView.swift
  • iosApp/iosApp/Screens/Home/SectionRow.swift
  • iosApp/iosApp/Screens/Player/CoreMedia/AudioOutput.swift
  • iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift
  • iosApp/iosApp/Screens/Player/CoreMedia/VideoFrameScheduler.swift
  • iosApp/iosApp/Startup/StartupContentPrefetcher.swift
  • iosApp/iosApp/Theme/Colors.swift
  • iosApp/iosApp/Theme/ContinuumTheme.swift
  • iosApp/iosApp/tvOS/Components/TVFocusMarquee.swift
  • iosApp/iosApp/tvOS/Components/TVRootHeroBackdrop.swift
  • iosApp/iosApp/tvOS/Components/TVSkylineSectionFeed.swift
  • iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift
  • iosApp/iosApp/tvOS/Navigation/TVLibraryScopeStore.swift
  • iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift
  • iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift
  • iosApp/iosApp/tvOS/Screens/Components/TVCollectionPosterCard.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVAlphabetRail.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibrariesTabView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryBrowseView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryCollectionsView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryGridView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryGridViewModel.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryLandingView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryPillRow.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryTypeTabView.swift
  • iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift
💤 Files with no reviewable changes (3)
  • iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryLandingView.swift
  • iosApp/iosApp/tvOS/Screens/Libraries/TVLibrariesTabView.swift

main refactored tvOS settings into native-style drill-in menus
(TVSettingsComponents + TVPlaybackSettingsView/TVSubtitleSettingsView, plus
preferences/library sections). The only conflict was in TVSettingsView.swift.

Resolution: take main's settings architecture wholesale, then re-apply the
Skyline intent from a453a47 -- drop the redundant "Library" quick-links section
(Watchlist/Favorites/History/Collections). Those destinations stay reachable via
the expanded profile dropdown and the library Collections pill. Our old inline
playback/subtitles/cardOverlays sections are superseded by main's drill-in views;
no Skyline-specific setting was lost.

SiloTV builds green (xcodebuild -scheme SiloTV, generic tvOS Simulator).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Quick104
Quick104 merged commit 7f44803 into main Jun 14, 2026
1 check was pending
@Quick104
Quick104 deleted the tvos-skyline-redesign branch June 14, 2026 04:01
Quick104 added a commit that referenced this pull request Jul 21, 2026
- Clear cached/persisted status and breadcrumb consent context when purging
  a signed-out binding, so a later capture can't recreate default-Ask consent
  and resume diagnostics for the old account (#1)
- Gate persistent capture on server availability, not just consent != Never,
  so a disabled/storage-unavailable server never stores crash reports (#2)
- Persist the binding (and profile) in abnormal-exit markers and attribute the
  report to it; drop markers whose account no longer matches, keeping legacy
  markers' best-effort behavior (#3)
- Default breadcrumb capture to disabled until stored consent loads, bootstrapping
  from the last-known status so a Never account's fresh launch writes nothing (#4)
- Treat a status-refresh failure during upload as retryable instead of a
  destination mismatch (wrong message + 24h retry suppression) (#5)
- Suppress declined prompts for the report's lifetime via a per-report flag;
  declined reports stay manually sendable but never re-prompt or auto-upload (#6)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh
Quick104 added a commit that referenced this pull request Jul 21, 2026
…sent, and upload (#96)

* feat(diagnostics): Apple client diagnostics slice (iOS + tvOS)

Implements the Apple slice of the client-diagnostics spec (silo-server
docs/design/2026-07-19-client-diagnostics.md): vendored contract models
with fixture tests, DiagLog safe-logging facade with collection-time
redaction and an always-on memory ring, breadcrumb journal, tar.gz bundle
builder + multipart upload via DiagnosticsAPI, MetricKit crash/hang capture
(iOS), abnormal-exit sentinel (tvOS) with consent gating, server+account-
bound consent and pending-report stores with sign-out purge, device
snapshot with hashed route identifiers, Diagnostics settings + consent
prompts on both platforms, and a curated cmpLog tee into the ring.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XppCCycoaskCsW7ja1fZct

* feat(diagnostics): consent prompts, pending-report review, and settings UX (iOS + tvOS)

Adds the user-facing layer over the diagnostics slice: the crash/hang
pending-report prompt flow with a review sheet before anything uploads,
per-fingerprint suppression and child-profile gating via
DiagnosticsPromptPolicy, an automatic upload path for always-on consent,
report summary and detail screens, Diagnostics settings panes on both
platforms, and pending-report notifications posted from MetricKit
capture so an active session can surface the prompt.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* feat(debug): auto-login launch arguments for simulator E2E runs

-debugServer/-debugUsername/-debugPassword sign in through the real
checkServer -> login -> selectProfile flow and land on Home, so
simulator-driven end-to-end runs (paired with -debugPlayFirst) need no
UI input. DEBUG builds only.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): redact server hosts, emails, and identity key-values in logs

A captured report leaked the server domain three ways: HTTPClient error
lines with full URLs, wss:// URLs inside NSError descriptions (the URL
regex only matched http/https), and the potential for bare hostnames
outside URL syntax. Now:

- URL normalization hashes the host to a stable [host:<sha256-12>]
  token (ws/wss included), keeping lines correlatable without exposing
  the domain; loopback hosts stay literal for playback debugging.
- Every remembered server hostname from ServerRegistry is registered
  with the redactor and replaced even when it appears as bare text —
  known-string matching avoids the false positives a generic domain
  regex would hit (bundle ids, file names).
- Email addresses are redacted, and username/login/email key-values
  join the token key-value redaction (= and : separators).

Verified on a live report: zero domain occurrences in the bundle,
hashed tokens in place, loopback URLs intact.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address PR #96 review findings

- Move DiagnosticsSHA256 into its own file so the SiloTVTopShelf target
  (which compiles the logging/redaction slice) links DiagLog.hostToken
- Refresh the stored manifest consent notice_version at upload time so a
  report captured under an older notice isn't rejected as stale_consent forever
- Classify too_large uploads as a permanent local failure (new report state)
  instead of retrying the same oversized bundle indefinitely
- Preserve crash capture when the status refresh is offline by falling back to
  the last-known-good status/binding (in-memory, then persisted per server)
- Gate persistent capture for child profiles, mirroring the prompt policy
- Filter breadcrumbs.jsonl to the crashed run's lines for abnormal-exit reports
- Snapshot logs at capture time and prefer the frozen snapshot when building an
  old crash/hang/abnormal-exit bundle (manual reports still use the live ring)
- Distinguish a token rotation from a real identity change by comparing the
  server id + account id rather than raw access-token fingerprints
- Skip reports marked needsServerUpdate/tooLarge in auto-upload and prompting
- Scope recorded playback session IDs to the active binding so another
  server/account's sessions can't leak into a report bound elsewhere
- Truncate MetricKit stack_excerpt by UTF-8 bytes, not characters
- Drop the redundant named-keys frame traversal that duplicated stack frames
- Note the MetricKit delivery-time binding limitation at the capture site
- Hold BreadcrumbJournal's lock across readAll() so reads can't race rotation
- Disable decline/delete buttons while the view model isWorking (iOS + tvOS)
- Register the legacy host for redaction during ServerRegistry migration
- Serialize ExitSentinel.captureEnabled writes with its lock via setCaptureEnabled
- Coalesce overlapping foreground refreshes in DiagnosticsViewModel
- Gate verbose 1 Hz [CMP-DIAG] player traces behind the Debug Logging toggle
- Tests: use failable String(bytes:encoding:) and XCTUnwrap in redaction tests;
  add focused tests for consent refresh, permanent-failure state, session
  scoping, and byte-safe stack truncation

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-2 review findings on PR #96

- Clear cached/persisted status and breadcrumb consent context when purging
  a signed-out binding, so a later capture can't recreate default-Ask consent
  and resume diagnostics for the old account (#1)
- Gate persistent capture on server availability, not just consent != Never,
  so a disabled/storage-unavailable server never stores crash reports (#2)
- Persist the binding (and profile) in abnormal-exit markers and attribute the
  report to it; drop markers whose account no longer matches, keeping legacy
  markers' best-effort behavior (#3)
- Default breadcrumb capture to disabled until stored consent loads, bootstrapping
  from the last-known status so a Never account's fresh launch writes nothing (#4)
- Treat a status-refresh failure during upload as retryable instead of a
  destination mismatch (wrong message + 24h retry suppression) (#5)
- Suppress declined prompts for the report's lifetime via a per-report flag;
  declined reports stay manually sendable but never re-prompt or auto-upload (#6)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-3 review findings on PR #96

- DiagnosticsCoordinator: drop abnormal-exit markers captured under a
  child profile by re-checking the marker's own profile at capture, not
  just the profile active now (an unknown status keeps the marker for a
  later retry).
- DiagnosticsCoordinator: rotate the breadcrumb journal when the active
  server/account binding changes mid-run so a new binding can't bundle
  the previous one's breadcrumbs; the first establish of a launch still
  keeps the prior run's trail for abnormal-exit capture.
- DiagnosticsCoordinator: restrict the last-known-status offline fallback
  to genuine network/status failures; identityChanged (signed out / no
  token) and missing-account no longer capture against a stale binding.
- DiagnosticsCoordinator: gate breadcrumb capture on server availability
  so disabled/storage_unavailable status no longer arms capture,
  consistent with the persistent-capture gate.
- DiagnosticsCoordinator: fail closed when the active profile's child
  status can't be resolved during persistent capture (getProfiles()
  failed offline) instead of proceeding.
- PendingReportStore: refresh consent.mode as well as notice_version from
  the current consent record at upload so a demoted Always->Ask report
  can't still claim mode=always (manual reports stay manual).
- MetricKitCapture: cap crash.summary to 8192 UTF-8 bytes after prefixing
  the first frame, reusing the byte-safe truncation.
- DiagLog: redact HTTPClient's camelCase/wrapper header forms harvested
  from OSLog (profileId=, auth(...), profileToken(...), accessToken /
  refreshToken key-values).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-4 review findings on PR #96

- Restrict the offline capture fallback to genuinely transient failures:
  only network/offline errors and 5xx server errors fall back to the
  last-known snapshot; auth/permission (401/403), missing endpoint (404),
  other 4xx, malformed responses, and identity-level errors now fail closed
  so a capture is never queued against a signed-out or unavailable binding.
- Back-fill the tvOS exit-sentinel marker binding the moment diagnostics
  first resolves it (coordinator refresh completion), not only on a later
  foreground, so a first-run crash before any status refresh is still
  attributed to the right account instead of a legacy/unbound marker.
- Re-verify the active destination immediately before posting a diagnostics
  bundle; the bundle build (OSLog harvest + gzip) can outlast an account
  switch, and a same-server switch keeps server_instance_id, so keep the
  report retryable rather than upload it to the newly active account.
- Drop the access-token fingerprint from the view model's RuntimeIdentity so
  a transparent token refresh during load() is no longer misread as an
  identity change and reset(); the stable identity is server registry id plus
  profile id, with sign-out still detected via token presence and generation.
- Always run the registry-wide diagnostics purge on sign-out (it clears
  reports/consent under older server_instance_ids for the same URL); the
  current-binding purge only skips its own duplicate work, never the
  registry-wide purge.
- Gate uploads on the captured profile: the server rejects an upload whose
  X-Profile-Id header (the currently active profile) disagrees with the
  manifest's report.profile_id (HTTP 400 profile_mismatch). Hold a report
  captured under another profile as retryable — before the bundle build and
  again right before the POST — so it uploads next time the capturing profile
  is active, mirroring the server's resolveProfileID trim-and-compare rule.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-5 review findings on PR #96

- DiagnosticsCoordinator: verify a *stable* destination identity (server
  registry id + selected profile, plus a token-presence sign-out check)
  before posting a bundle, not the access-token value. A transparent token
  refresh during buildBundle no longer trips the pre-POST check and defers
  the Always-path auto-upload for 24h; a genuine same-server account switch
  still fails closed (it clears the token and lands on a different profile).
- DiagLog/LogRing: clear the process-wide log ring when the active
  diagnostics binding changes, mirroring the breadcrumb-journal purge at the
  same trigger, so a new binding's manual report or crash snapshot can't
  include the previous binding's CMP/playback log lines. Adds LogRing.clear().
- DiagnosticsCoordinator: re-evaluate the breadcrumb gate on profile change
  (and status refresh) so an adult->child profile switch disarms breadcrumb
  and exit-sentinel capture, consistent with the persistent-capture child
  gate; fails closed immediately on switch until the async child check lands.
- PlaybackSessionBridge: gate RecentSessionTracker recording on the same
  capture-enabled signal (isDiagnosticsCaptureEnabled) as breadcrumbs, so
  session IDs aren't accumulated while collection is off (Never / disabled /
  storage-unavailable) and later surfaced in a report after re-enable.
- DiagLog.replaceKnownHosts: rewrite as a single forward pass that never
  rescans replaced output, fixing an infinite loop when a registered host is
  a substring of its replacement token (e.g. "host" vs "[host:...]"). Adds a
  pathological-host regression test plus a LogRing.clear() test.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Quick104 added a commit that referenced this pull request Jul 22, 2026
…98)

* feat(diagnostics): Apple client diagnostics slice (iOS + tvOS)

Implements the Apple slice of the client-diagnostics spec (silo-server
docs/design/2026-07-19-client-diagnostics.md): vendored contract models
with fixture tests, DiagLog safe-logging facade with collection-time
redaction and an always-on memory ring, breadcrumb journal, tar.gz bundle
builder + multipart upload via DiagnosticsAPI, MetricKit crash/hang capture
(iOS), abnormal-exit sentinel (tvOS) with consent gating, server+account-
bound consent and pending-report stores with sign-out purge, device
snapshot with hashed route identifiers, Diagnostics settings + consent
prompts on both platforms, and a curated cmpLog tee into the ring.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XppCCycoaskCsW7ja1fZct

* feat(diagnostics): consent prompts, pending-report review, and settings UX (iOS + tvOS)

Adds the user-facing layer over the diagnostics slice: the crash/hang
pending-report prompt flow with a review sheet before anything uploads,
per-fingerprint suppression and child-profile gating via
DiagnosticsPromptPolicy, an automatic upload path for always-on consent,
report summary and detail screens, Diagnostics settings panes on both
platforms, and pending-report notifications posted from MetricKit
capture so an active session can surface the prompt.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* feat(debug): auto-login launch arguments for simulator E2E runs

-debugServer/-debugUsername/-debugPassword sign in through the real
checkServer -> login -> selectProfile flow and land on Home, so
simulator-driven end-to-end runs (paired with -debugPlayFirst) need no
UI input. DEBUG builds only.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): redact server hosts, emails, and identity key-values in logs

A captured report leaked the server domain three ways: HTTPClient error
lines with full URLs, wss:// URLs inside NSError descriptions (the URL
regex only matched http/https), and the potential for bare hostnames
outside URL syntax. Now:

- URL normalization hashes the host to a stable [host:<sha256-12>]
  token (ws/wss included), keeping lines correlatable without exposing
  the domain; loopback hosts stay literal for playback debugging.
- Every remembered server hostname from ServerRegistry is registered
  with the redactor and replaced even when it appears as bare text —
  known-string matching avoids the false positives a generic domain
  regex would hit (bundle ids, file names).
- Email addresses are redacted, and username/login/email key-values
  join the token key-value redaction (= and : separators).

Verified on a live report: zero domain occurrences in the bundle,
hashed tokens in place, loopback URLs intact.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address PR #96 review findings

- Move DiagnosticsSHA256 into its own file so the SiloTVTopShelf target
  (which compiles the logging/redaction slice) links DiagLog.hostToken
- Refresh the stored manifest consent notice_version at upload time so a
  report captured under an older notice isn't rejected as stale_consent forever
- Classify too_large uploads as a permanent local failure (new report state)
  instead of retrying the same oversized bundle indefinitely
- Preserve crash capture when the status refresh is offline by falling back to
  the last-known-good status/binding (in-memory, then persisted per server)
- Gate persistent capture for child profiles, mirroring the prompt policy
- Filter breadcrumbs.jsonl to the crashed run's lines for abnormal-exit reports
- Snapshot logs at capture time and prefer the frozen snapshot when building an
  old crash/hang/abnormal-exit bundle (manual reports still use the live ring)
- Distinguish a token rotation from a real identity change by comparing the
  server id + account id rather than raw access-token fingerprints
- Skip reports marked needsServerUpdate/tooLarge in auto-upload and prompting
- Scope recorded playback session IDs to the active binding so another
  server/account's sessions can't leak into a report bound elsewhere
- Truncate MetricKit stack_excerpt by UTF-8 bytes, not characters
- Drop the redundant named-keys frame traversal that duplicated stack frames
- Note the MetricKit delivery-time binding limitation at the capture site
- Hold BreadcrumbJournal's lock across readAll() so reads can't race rotation
- Disable decline/delete buttons while the view model isWorking (iOS + tvOS)
- Register the legacy host for redaction during ServerRegistry migration
- Serialize ExitSentinel.captureEnabled writes with its lock via setCaptureEnabled
- Coalesce overlapping foreground refreshes in DiagnosticsViewModel
- Gate verbose 1 Hz [CMP-DIAG] player traces behind the Debug Logging toggle
- Tests: use failable String(bytes:encoding:) and XCTUnwrap in redaction tests;
  add focused tests for consent refresh, permanent-failure state, session
  scoping, and byte-safe stack truncation

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-2 review findings on PR #96

- Clear cached/persisted status and breadcrumb consent context when purging
  a signed-out binding, so a later capture can't recreate default-Ask consent
  and resume diagnostics for the old account (#1)
- Gate persistent capture on server availability, not just consent != Never,
  so a disabled/storage-unavailable server never stores crash reports (#2)
- Persist the binding (and profile) in abnormal-exit markers and attribute the
  report to it; drop markers whose account no longer matches, keeping legacy
  markers' best-effort behavior (#3)
- Default breadcrumb capture to disabled until stored consent loads, bootstrapping
  from the last-known status so a Never account's fresh launch writes nothing (#4)
- Treat a status-refresh failure during upload as retryable instead of a
  destination mismatch (wrong message + 24h retry suppression) (#5)
- Suppress declined prompts for the report's lifetime via a per-report flag;
  declined reports stay manually sendable but never re-prompt or auto-upload (#6)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-3 review findings on PR #96

- DiagnosticsCoordinator: drop abnormal-exit markers captured under a
  child profile by re-checking the marker's own profile at capture, not
  just the profile active now (an unknown status keeps the marker for a
  later retry).
- DiagnosticsCoordinator: rotate the breadcrumb journal when the active
  server/account binding changes mid-run so a new binding can't bundle
  the previous one's breadcrumbs; the first establish of a launch still
  keeps the prior run's trail for abnormal-exit capture.
- DiagnosticsCoordinator: restrict the last-known-status offline fallback
  to genuine network/status failures; identityChanged (signed out / no
  token) and missing-account no longer capture against a stale binding.
- DiagnosticsCoordinator: gate breadcrumb capture on server availability
  so disabled/storage_unavailable status no longer arms capture,
  consistent with the persistent-capture gate.
- DiagnosticsCoordinator: fail closed when the active profile's child
  status can't be resolved during persistent capture (getProfiles()
  failed offline) instead of proceeding.
- PendingReportStore: refresh consent.mode as well as notice_version from
  the current consent record at upload so a demoted Always->Ask report
  can't still claim mode=always (manual reports stay manual).
- MetricKitCapture: cap crash.summary to 8192 UTF-8 bytes after prefixing
  the first frame, reusing the byte-safe truncation.
- DiagLog: redact HTTPClient's camelCase/wrapper header forms harvested
  from OSLog (profileId=, auth(...), profileToken(...), accessToken /
  refreshToken key-values).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-4 review findings on PR #96

- Restrict the offline capture fallback to genuinely transient failures:
  only network/offline errors and 5xx server errors fall back to the
  last-known snapshot; auth/permission (401/403), missing endpoint (404),
  other 4xx, malformed responses, and identity-level errors now fail closed
  so a capture is never queued against a signed-out or unavailable binding.
- Back-fill the tvOS exit-sentinel marker binding the moment diagnostics
  first resolves it (coordinator refresh completion), not only on a later
  foreground, so a first-run crash before any status refresh is still
  attributed to the right account instead of a legacy/unbound marker.
- Re-verify the active destination immediately before posting a diagnostics
  bundle; the bundle build (OSLog harvest + gzip) can outlast an account
  switch, and a same-server switch keeps server_instance_id, so keep the
  report retryable rather than upload it to the newly active account.
- Drop the access-token fingerprint from the view model's RuntimeIdentity so
  a transparent token refresh during load() is no longer misread as an
  identity change and reset(); the stable identity is server registry id plus
  profile id, with sign-out still detected via token presence and generation.
- Always run the registry-wide diagnostics purge on sign-out (it clears
  reports/consent under older server_instance_ids for the same URL); the
  current-binding purge only skips its own duplicate work, never the
  registry-wide purge.
- Gate uploads on the captured profile: the server rejects an upload whose
  X-Profile-Id header (the currently active profile) disagrees with the
  manifest's report.profile_id (HTTP 400 profile_mismatch). Hold a report
  captured under another profile as retryable — before the bundle build and
  again right before the POST — so it uploads next time the capturing profile
  is active, mirroring the server's resolveProfileID trim-and-compare rule.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-5 review findings on PR #96

- DiagnosticsCoordinator: verify a *stable* destination identity (server
  registry id + selected profile, plus a token-presence sign-out check)
  before posting a bundle, not the access-token value. A transparent token
  refresh during buildBundle no longer trips the pre-POST check and defers
  the Always-path auto-upload for 24h; a genuine same-server account switch
  still fails closed (it clears the token and lands on a different profile).
- DiagLog/LogRing: clear the process-wide log ring when the active
  diagnostics binding changes, mirroring the breadcrumb-journal purge at the
  same trigger, so a new binding's manual report or crash snapshot can't
  include the previous binding's CMP/playback log lines. Adds LogRing.clear().
- DiagnosticsCoordinator: re-evaluate the breadcrumb gate on profile change
  (and status refresh) so an adult->child profile switch disarms breadcrumb
  and exit-sentinel capture, consistent with the persistent-capture child
  gate; fails closed immediately on switch until the async child check lands.
- PlaybackSessionBridge: gate RecentSessionTracker recording on the same
  capture-enabled signal (isDiagnosticsCaptureEnabled) as breadcrumbs, so
  session IDs aren't accumulated while collection is off (Never / disabled /
  storage-unavailable) and later surfaced in a report after re-enable.
- DiagLog.replaceKnownHosts: rewrite as a single forward pass that never
  rescans replaced output, fixing an infinite loop when a registered host is
  a substring of its replacement token (e.g. "host" vs "[host:...]"). Adds a
  pathological-host regression test plus a LogRing.clear() test.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address round-6 review findings on PR #96

- AuthService: move diagnostics profile invalidation into the profileId
  setter (and the ServerRegistry switchTo/remove profile-restore paths) so
  every active-profile change fails the breadcrumb/session/exit-sentinel gate
  closed, not just the selectProfile path.
- DiagnosticsConsentStore: purge the tvOS ExitSentinel marker when Crash
  Reports is set to Never, so an armed marker can't later surface as an
  abnormal-exit report after collection was turned off.
- ExitSentinel: preserve an unclean previous run's marker in a distinct
  leftover slot before arming the current run, so a crash marker survives a
  failed captureLeftoverIfNeeded and a subsequent background/terminate;
  decode stays backward-compatible. Extracted ExitSentinelMarkerStore for
  the (now unit-tested) slot bookkeeping.
- MetricKitCapture: filter attached breadcrumbs to the payload's reporting
  window (with margin) so post-incident/relaunch and older-segment lines
  don't ride along with a crash/hang report.
- Tests: leftover-preservation round-trip and breadcrumb-window filtering.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh

* fix(diagnostics): address PR review feedback

* fix(diagnostics): address automated review follow-ups

* fix(diagnostics): close evidence isolation gaps

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant