Skip to content

Commit 3fdf2e4

Browse files
Partial conversion of SessionDetails to SwiftUI
1 parent d86a9a9 commit 3fdf2e4

13 files changed

+247
-235
lines changed

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ opt_in_rules:
2121

2222
excluded:
2323
- Carthage
24+
- Packages/ConfCore/.build
2425

2526
force_cast:
2627
severity: warning

WWDC.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
9104BDFE2A25165A00860C08 /* Combine+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9104BDFD2A25165A00860C08 /* Combine+UI.swift */; };
2929
911C72C92A52169A00CB3757 /* CombineLatestMany.swift in Sources */ = {isa = PBXBuildFile; fileRef = 911C72C82A52169A00CB3757 /* CombineLatestMany.swift */; };
3030
914367202A4C6B0E004E4392 /* Sequence+GroupedBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9143671F2A4C6B0E004E4392 /* Sequence+GroupedBy.swift */; };
31+
914C83B42E1ECBFF001AEE5C /* SessionDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 914C83B32E1ECBFF001AEE5C /* SessionDetailsView.swift */; };
3132
91C2A0BC2A4DE9B60049B6B7 /* OrderedCollections in Frameworks */ = {isa = PBXBuildFile; productRef = 91C2A0BB2A4DE9B60049B6B7 /* OrderedCollections */; };
3233
91EF6A2A2A33FBF8003A71A3 /* Realm+Combine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91EF6A292A33FBF8003A71A3 /* Realm+Combine.swift */; };
3334
DD0159A71ECFE26200F980F1 /* DeepLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD0159A61ECFE26200F980F1 /* DeepLink.swift */; };
@@ -313,6 +314,7 @@
313314
9104BDFD2A25165A00860C08 /* Combine+UI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Combine+UI.swift"; sourceTree = "<group>"; };
314315
911C72C82A52169A00CB3757 /* CombineLatestMany.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombineLatestMany.swift; sourceTree = "<group>"; };
315316
9143671F2A4C6B0E004E4392 /* Sequence+GroupedBy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Sequence+GroupedBy.swift"; sourceTree = "<group>"; };
317+
914C83B32E1ECBFF001AEE5C /* SessionDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionDetailsView.swift; sourceTree = "<group>"; };
316318
91EF6A292A33FBF8003A71A3 /* Realm+Combine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Realm+Combine.swift"; sourceTree = "<group>"; };
317319
DD0159A61ECFE26200F980F1 /* DeepLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeepLink.swift; sourceTree = "<group>"; };
318320
DD0159A81ED09F5D00F980F1 /* AppCoordinator+Bookmarks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AppCoordinator+Bookmarks.swift"; sourceTree = "<group>"; };
@@ -1102,6 +1104,7 @@
11021104
DDFA10C71EBFD897001DCF66 /* Detail */ = {
11031105
isa = PBXGroup;
11041106
children = (
1107+
914C83B32E1ECBFF001AEE5C /* SessionDetailsView.swift */,
11051108
DD7F38771EAC0C98002D8C00 /* ShelfViewController.swift */,
11061109
DD7F38631EABD6DF002D8C00 /* SessionDetailsViewController.swift */,
11071110
DD6E06F91EDBC636000EAEA4 /* Tabs */,
@@ -1538,6 +1541,7 @@
15381541
DD0159A71ECFE26200F980F1 /* DeepLink.swift in Sources */,
15391542
DDA60E1720A9083E002EECF5 /* RelatedSessionsViewController.swift in Sources */,
15401543
F44C82312A2285AC00FDE980 /* OffsetObservingScrollView.swift in Sources */,
1544+
914C83B42E1ECBFF001AEE5C /* SessionDetailsView.swift in Sources */,
15411545
DDA60E1520A907B6002EECF5 /* SessionCollectionViewItem.swift in Sources */,
15421546
DD7F38881EAC2275002D8C00 /* PathUtil.swift in Sources */,
15431547
DDB352821EC7C55300254815 /* DateProvider.swift in Sources */,

WWDC/AppCoordinator+Shelf.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ extension AppCoordinator: ShelfViewControllerDelegate {
1919
var shelfViewController: ShelfViewController?
2020
switch tab {
2121
case .schedule:
22-
shelfViewController = scheduleController.splitViewController.detailViewController.shelfController
22+
shelfViewController = scheduleController.splitViewController.detailViewController.detailsViewModel.shelfController
2323
case .videos:
24-
shelfViewController = videosController.detailViewController.shelfController
24+
shelfViewController = videosController.detailViewController.detailsViewModel.shelfController
2525
default: ()
2626
}
2727

WWDC/GeneralPreferencesViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ final class GeneralPreferencesViewController: WWDCWindowContentViewController {
236236

237237
var rootFileCount = 0
238238

239-
while enumerator.nextObject() as? String != nil {
239+
while enumerator.nextObject() is String {
240240
rootFileCount += 1
241241
}
242242

WWDC/SessionDetailsView.swift

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
//
2+
// SessionDetailsView.swift
3+
// WWDC
4+
//
5+
// Created by Allen Humphreys on 7/9/25.
6+
// Copyright © 2025 Guilherme Rambo. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
/**
12+
View for displaying session details with video player and tabbed content.
13+
14+
This view is the right hand side of the split views for each of schedule and sessions app-level tabs.
15+
16+
Visual Structure:
17+
┌─────────────────────────────────────────────────┐
18+
│ │
19+
│ ShelfViewControllerWrapper │
20+
│ (Video Player) │
21+
│ │
22+
└─────────────────────────────────────────────────┘
23+
24+
┌─────────────────────────────────────────────────┐
25+
│ [Overview] [Transcript] [Bookmarks] │
26+
│ ─────────────────────────────────────────────── │
27+
│ │
28+
│ Tab Content Area │
29+
│ │
30+
│ • Overview: SessionSummaryViewControllerWrapper│
31+
│ • Transcript: SessionTranscriptViewController │
32+
│ • Bookmarks: Placeholder text │
33+
│ │
34+
└─────────────────────────────────────────────────┘
35+
*/
36+
struct SessionDetailsView: View {
37+
@ObservedObject var detailsViewModel: SessionDetailsViewModel
38+
39+
var body: some View {
40+
VStack(spacing: 0) {
41+
ShelfViewControllerWrapper(controller: detailsViewModel.shelfController)
42+
.layoutPriority(1)
43+
.frame(minHeight: 280, maxHeight: .infinity)
44+
.padding(.top, 22)
45+
46+
VStack(spacing: 0) {
47+
if detailsViewModel.isTranscriptAvailable || detailsViewModel.isBookmarksAvailable {
48+
tabButtons
49+
}
50+
51+
Divider()
52+
53+
tabContent
54+
.padding(.top, 16)
55+
}
56+
}
57+
.padding([.bottom, .horizontal], 46)
58+
}
59+
60+
private var tabButtons: some View {
61+
HStack(spacing: 32) {
62+
Button("Overview") {
63+
detailsViewModel.selectedTab = .overview
64+
}
65+
.buttonStyle(WWDCTextButtonStyle(isSelected: detailsViewModel.selectedTab == .overview))
66+
67+
if detailsViewModel.isTranscriptAvailable {
68+
Button("Transcript") {
69+
detailsViewModel.selectedTab = .transcript
70+
}
71+
.buttonStyle(WWDCTextButtonStyle(isSelected: detailsViewModel.selectedTab == .transcript))
72+
}
73+
74+
if detailsViewModel.isBookmarksAvailable {
75+
Button("Bookmarks") {
76+
detailsViewModel.selectedTab = .bookmarks
77+
}
78+
.buttonStyle(WWDCTextButtonStyle(isSelected: detailsViewModel.selectedTab == .bookmarks))
79+
}
80+
}
81+
.frame(maxWidth: .infinity)
82+
.padding(.vertical, 12)
83+
}
84+
85+
@ViewBuilder
86+
private var tabContent: some View {
87+
switch detailsViewModel.selectedTab {
88+
case .overview:
89+
SessionSummaryViewControllerWrapper(controller: detailsViewModel.summaryController)
90+
case .transcript:
91+
SessionTranscriptViewControllerWrapper(controller: detailsViewModel.transcriptController)
92+
case .bookmarks:
93+
Text("Bookmarks view coming soon")
94+
.foregroundColor(.secondary)
95+
}
96+
}
97+
}

0 commit comments

Comments
 (0)