Skip to content

Implement Skyline tvOS navigation redesign - #5

Closed
Quick104 wants to merge 33 commits into
mainfrom
feature/skyline-phase-3
Closed

Quick104 wants to merge 33 commits into
mainfrom
feature/skyline-phase-3

Conversation

@Quick104

@Quick104 Quick104 commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds Skyline redesign documentation, implementation prompts, rendered mockups, and a real-time updates spec for Apple clients.
  • Reworks tvOS root navigation around content-type tabs, Home-first browsing, persistent library scope, and the cascading library selector.
  • Introduces the tvOS focus marquee, shared Skyline section feed, refreshed hero backdrop behavior, collection fan cards, and refined Browse/Collections/A-Z library surfaces.
  • Stabilizes tvOS focus handoff, poster row layout, marquee crossfades, top-menu dropdown focus, and reduce-motion behavior.

Testing

  • Not run; PR content was generated from the provided commit list and diff stat.

Summary by CodeRabbit

  • New Features

    • Added real-time home updates for Apple TV and iOS while app is idle.
    • Introduced Skyline redesign for tvOS and Android TV with improved navigation and content browsing.
    • Added focus marquee display for tvOS showing currently focused content details.
  • Bug Fixes

    • Improved audio playback resumption after system interruptions and hardware changes.
    • Enhanced video frame buffering with byte-size backpressure management.
  • Documentation

    • Added comprehensive specifications and design guides for real-time updates and Skyline UI redesign.
    • Created interactive mockups showcasing new navigation patterns.

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 3 commits June 13, 2026 22:17
- Reserve detail-line height during enrichment to prevent marquee reflow
- Tighten dense poster sizing and truncate card titles for consistent rows
- 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

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR implements the Skyline tvOS navigation redesign: replaces the modal library picker and featured carousel with a content-type-first top bar, focus-driven cascade selector, passive focus marquee, and paged section feed. It also rewrites TVTopMenuBar, TVMainTabView, library sub-screens, refactors HomeView, and adds independent player stability fixes (audio interruption/engine-reconfiguration handling, deferred FFmpeg teardown, byte-based video backpressure). Design docs, mockups, and a separate real-time Home updates spec are also included.

Changes

Skyline tvOS Redesign

Layer / File(s) Summary
Design docs and mockups
docs/skyline-design-guide.md, docs/skyline-implementation-prompt.md, docs/tvos-redesign-mockups/*
Adds the Skyline design guide (navigation model, tokens, components, screen layouts, acceptance checklist), Phase 2 implementation prompt, mockup README, six HTML mockup screens (Rail A/B/C variants), and shared tv.css design system.
Theme tokens and cache key
iosApp/iosApp/Theme/Colors.swift, iosApp/iosApp/Theme/ContinuumTheme.swift, iosApp/iosApp/Networking/ResponseCache.swift
Adds Skyline chrome/glass/scrim colors, the tvOS-only ContinuumTheme.Skyline enum with all layout/animation/grid token constants, and a userLibraries cache key with "user:" prefix invalidation on profile switch.
Focus marquee and hero backdrop
iosApp/iosApp/tvOS/Components/TVFocusMarquee.swift, iosApp/iosApp/tvOS/Components/TVRootHeroBackdrop.swift
Adds TVFocusMarqueeModel (150 ms debounce, enrichment cache, tint sampling), TVFocusMarquee view (240 ms crossfade, Reduce Motion snap, VoiceOver), and TVMarqueeBlock. Refactors TVRootHeroBackdrop to geometry-fraction artwork sizing, two-ramp corner-fade mask, top chrome scrim, and crossfadeDuration property.
Skyline section feed and card/row primitives
iosApp/iosApp/tvOS/Components/TVSkylineSectionFeed.swift, iosApp/iosApp/Components/MediaCard.swift, iosApp/iosApp/Components/MediaRow.swift, iosApp/iosApp/Screens/Home/SectionRow.swift, iosApp/iosApp/tvOS/Screens/Components/TVCollectionPosterCard.swift
Adds TVSkylineSectionFeed (paged bottom band, monotonic entry-focus tokens, marquee wiring). Updates MediaCard (cardWidthOverride, single-line tvOS title), MediaRow (onItemFocus, cardWidth, onMoveDown, TVRowMoveHandler, applyFocusRequest dedup), SectionRow (forwards new callbacks). Adds TVCollectionPosterCard (2:3 poster tile, focus routing, deterministic placeholder gradient).
Top menu bar rewrite
iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift
Rewrites TVTopMenuBar with menu-vs-panel focus model, cancellable dwell scheduling, spurious nil-drop repair via lastBarFocus, TVLibraryTabType/TVRootDestination domain types, TVTopMenuDownHandler/TVTopMenuAnchorPublisher modifiers, and TVProfileDropdown replacing fullscreen modal.
Cascade selector and scope store
iosApp/iosApp/tvOS/Navigation/TVCascadeSelector.swift, iosApp/iosApp/tvOS/Navigation/TVLibraryScopeStore.swift
Adds TVCascadeSelector (two-level libraries→sections panel, flyout geometry alignment via TVCascadeRowAnchorKey, debounced flyout-follow, row label views with focus inversion). Adds TVLibraryScopeStore (per-profile/per-server library id persistence via SharedDefaults).
Main tab view orchestration
iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift, iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift
Refactors TVMainTabView to dynamic roots from library types, anchored panel overlay system, dwell/enter/commit/close state machine, concurrent startup loading, server-switch state reset, visibleRoots/pillSelection derivation, and TVPanelOpenTransition modifier. Removes Settings Library section.
Library sub-destination screens
iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryTypeTabView.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryPillRow.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/TVAlphabetRail.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibrariesTabView.swift, iosApp/iosApp/tvOS/Screens/Libraries/TVLibraryLandingView.swift
Adds TVLibraryTypeTabView (pill routing, asymmetric reduce-motion transition), TVLibraryPillRow (pill enum), TVLibraryBrowseView (sections feed, featured filtering), TVLibraryCollectionsView (grouped grid, one-shot focus, TVCollectionCard). Updates TVLibraryGridView (header/rail/inset configurability), TVLibraryGridViewModel (optional mediaType for audio/music). Updates TVAlphabetRail (Skyline sizing, chip styling, reduce-motion). Removes TVLibrariesTabView and TVLibraryLandingView.
HomeView refactor and startup cleanup
iosApp/iosApp/Screens/Home/HomeView.swift, iosApp/iosApp/Screens/Home/FeaturedCarousel.swift, iosApp/iosApp/Startup/StartupContentPrefetcher.swift
Refactors HomeView to render TVSkylineSectionFeed on tvOS (merged sections + recommendations) and a dedicated scrollContent on non-tvOS; removes tvOS scroll/focus plumbing. Updates FeaturedCarousel with reduce-motion auto-advance guard and extraTopInset sizing. Adds tvOS-specific artwork prefetch path in StartupContentPrefetcher.

Player Stability Fixes

Layer / File(s) Summary
AudioOutput engine reconfiguration
iosApp/iosApp/Screens/Player/CoreMedia/AudioOutput.swift
Adds intendedRunning state and AVAudioEngineConfigurationChange observer; rebuilds audio graph on hardware reconfiguration and conditionally resumes; updates play/pause/stop to track intent under stateLock.
PlayerCore interruption, teardown, and seek safety
iosApp/iosApp/Screens/Player/CoreMedia/PlayerCore.swift, iosApp/iosApp/Screens/Player/CoreMedia/VideoFrameScheduler.swift
Adds AVAudioSession interruption observer (pause on .began, conditional resume on .ended), display-layer recovery on play(), .oldDeviceUnavailable flush-and-pause, deferred FFmpeg context frees on controlQueue, seek dispose-guard, and resetCancellation no-op when disposed. VideoFrameScheduler gains byte-based backpressure via feedBackpressureBytes and queuedBytes.

Real-Time Home Updates Spec

Layer / File(s) Summary
Real-time updates specification
docs/realtime-updates-spec.md
Spec covering two-layer refresh (scenePhase pull + EventsRealtimeClient WebSocket push), RealtimeCoordinator lifecycle, debounced HomeViewModel.refreshFromRealtime, reconnect/backoff/circuit-breaker, Codable models, edge cases, testing plan, rollout phases, and implementation checklist.

Sequence Diagram(s)

sequenceDiagram
  participant User as tvOS Remote
  participant TVTopMenuBar
  participant TVMainTabView
  participant TVCascadeSelector
  participant TVLibraryTypeTabView
  participant TVSkylineSectionFeed
  participant TVFocusMarqueeModel

  User->>TVTopMenuBar: focus library tab (dwell 400ms)
  TVTopMenuBar->>TVMainTabView: onDwell(target: .libraryType)
  TVMainTabView->>TVMainTabView: openPanelPreview() — shows panel without focus
  User->>TVTopMenuBar: d-pad down
  TVTopMenuBar->>TVMainTabView: onEnterPanel()
  TVMainTabView->>TVCascadeSelector: entersPanel=true, focusEntryToken++
  TVCascadeSelector->>TVCascadeSelector: applyEntryToken — set initial library/section focus
  User->>TVCascadeSelector: select section pill (press)
  TVCascadeSelector->>TVMainTabView: onCommitSection(library, pill)
  TVMainTabView->>TVMainTabView: commitScope — persist + closePanel
  TVMainTabView->>TVLibraryTypeTabView: selectedRoot=.libraryType, selectedPill updated
  TVLibraryTypeTabView->>TVSkylineSectionFeed: sections loaded, focusRequest++
  TVSkylineSectionFeed->>TVFocusMarqueeModel: onItemFocus fires → preview(content)
  TVFocusMarqueeModel-->>TVSkylineSectionFeed: tintColor + content after 150ms debounce
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • Silo-Server/silo-apple#1: Directly related at the tvOS navigation/focus handoff layer — both PRs touch TVMainTabView focus-request/token logic and SectionRow focus wiring for how library/home content receives d-pad focus after mounting.
✨ 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 feature/skyline-phase-3
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feature/skyline-phase-3

@Quick104

Copy link
Copy Markdown
Contributor Author

Superseded by #6 — branch renamed from feature/skyline-phase-3 to tvos-skyline-redesign (same commits, fresh PR).

@Quick104 Quick104 closed this Jun 14, 2026
@Quick104 Quick104 mentioned this pull request Jun 14, 2026
3 tasks
@Quick104
Quick104 deleted the feature/skyline-phase-3 branch June 14, 2026 03:44

@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 +76 to +78
.onChange(of: sections.map(\.id)) { _, _ in
if let pending = pendingFocusRequest { requestEntryFocus(pending) }
}

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 Clamp the paged row index after section refreshes

When the section list changes after a refresh, pageIndex is left untouched. If the user is on a later page and the refreshed data has fewer non-empty sections (for example Continue Watching disappears after playback/removal), sections.indices.contains(pageIndex) becomes false and pagedBand renders an empty ZStack with no row to hold focus. Clamp or reset pageIndex in this sections.map(\.id) change handler before handling pending focus.

Useful? React with 👍 / 👎.


private func loadLibraries() async {
if libraries.isEmpty,
let cached: LibrariesResponse = ResponseCache.shared.get(CacheKey.userLibraries) {

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 to the active server

This cache key is process-global, but the server switch path clears libraries and does not clear ResponseCache. After switching to another saved server, this branch can immediately repopulate the Skyline tabs from the previous server's /user/libraries response while the new fetch is slow or fails, exposing wrong library-type tabs and cascade entries that route to invalid library IDs on the active server. Include the active server/profile in the key or clear this entry when switching servers.

Useful? React with 👍 / 👎.

Comment on lines +82 to +86
TVLibraryGridView(
libraryId: library.id,
libraryName: library.name,
libraryType: library.type,
initialFilter: .none,

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 Pass the content focus request into Browse

The .recommended and .collections branches consume focusRequest and provide an Up handoff back to the top menu, but the new .browse branch instantiates TVLibraryGridView without any focus handoff. When the cascade commits Browse, selectRoot suppresses top-menu focus and increments contentFocusRequest; the focused cascade row is then removed, but the grid never receives that token and TVCatalogGrid defaults prefersDefaultFocusOnFirstItem to false, so this entry path has no reliable focused item or Up-to-menu route.

Useful? React with 👍 / 👎.

// identical. For You recommendation rows are folded into
// `displayedSections` right after Continue Watching (§6.1).
Group {
if viewModel.sections.isEmpty {

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 Render recommendations when home sections are empty

This tvOS branch gates the entire Home feed on viewModel.sections, but recommendations are loaded independently and then merged by displayedSections. On a new or empty profile where /home returns no rows while /recommendations/discover returns sections, this condition remains true and Home stays blank (or shows the home error) instead of rendering the folded-in For You rows.

Useful? React with 👍 / 👎.

func matches(_ library: Library) -> Bool {
switch self {
case .movies: return library.type == "movies"
case .series: return library.isSeriesLibrary

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 Match all supported series library aliases

The new top-level tabs are derived solely from TVLibraryTabType.matches. Here the Series tab delegates to Library.isSeriesLibrary, which only matches type == "series", while the grid model still accepts "shows" and "tv" as series aliases. For servers returning either alias, visibleRoots never adds the Series tab, making those libraries unreachable from the Skyline navigation.

Useful? React with 👍 / 👎.

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