Skip to content

Commit 524816a

Browse files
authored
General: Release 1.3.0 (#175)
2 parents b0082ff + eca0a18 commit 524816a

File tree

43 files changed

+1700
-756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1700
-756
lines changed

.whitesource

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"scanSettings": {
3+
"baseBranches": []
4+
},
5+
"checkRunSettings": {
6+
"vulnerableCheckRunConclusionLevel": "failure",
7+
"displayMode": "diff",
8+
"useMendCheckNames": true
9+
},
10+
"issueSettings": {
11+
"minSeverityLevel": "LOW",
12+
"issueType": "DEPENDENCY"
13+
}
14+
}

Artemis.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 6 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Artemis/Supporting/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundlePackageType</key>
2222
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>1.2.0</string>
24+
<string>1.3.0</string>
2525
<key>CFBundleVersion</key>
2626
<string>1</string>
2727
<key>LSRequiresIPhoneOS</key>

ArtemisKit/Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ let package = Package(
1818
])
1919
],
2020
dependencies: [
21-
// Starscream 4.0.6 does not build
22-
.package(url: "https://github.com/daltoniam/Starscream.git", exact: "4.0.4"),
2321
.package(url: "https://github.com/Kelvas09/EmojiPicker.git", from: "1.0.0"),
2422
.package(url: "https://github.com/ls1intum/apollon-ios-module", .upToNextMajor(from: "1.0.2")),
25-
.package(url: "https://github.com/ls1intum/artemis-ios-core-modules", .upToNextMajor(from: "14.0.3")),
23+
.package(url: "https://github.com/ls1intum/artemis-ios-core-modules", .upToNextMajor(from: "14.4.0")),
2624
.package(url: "https://github.com/mac-cain13/R.swift.git", from: "7.0.0")
2725
],
2826
targets: [
@@ -116,6 +114,9 @@ let package = Package(
116114
.product(name: "SharedModels", package: "artemis-ios-core-modules"),
117115
.product(name: "SharedServices", package: "artemis-ios-core-modules"),
118116
.product(name: "UserStore", package: "artemis-ios-core-modules")
117+
],
118+
plugins: [
119+
.plugin(name: "RswiftGeneratePublicResources", package: "R.swift")
119120
]),
120121
.target(
121122
name: "Notifications",

ArtemisKit/Sources/ArtemisKit/RootView.swift

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,21 @@ public struct RootView: View {
2626
} else {
2727
if viewModel.isLoggedIn {
2828
if viewModel.didSetupNotifications {
29-
NavigationStack(path: $navigationController.path) {
30-
DashboardView()
31-
.modifier(NavigationDestinationRootViewModifier())
32-
}
33-
.onChange(of: navigationController.path) {
34-
log.debug("NavigationController count: \(navigationController.path.count)")
35-
}
36-
.environmentObject(navigationController)
37-
.onOpenURL { url in
38-
DeeplinkHandler.shared.handle(url: url)
39-
}
40-
.environment(\.openURL, OpenURLAction { url in
41-
if DeeplinkHandler.shared.handle(url: url) {
42-
return .handled
43-
} else {
44-
return .systemAction
29+
contentView
30+
.onChange(of: navigationController.outerPath) {
31+
log.debug("NavigationController count: \(navigationController.outerPath.count)")
4532
}
46-
})
33+
.environmentObject(navigationController)
34+
.onOpenURL { url in
35+
DeeplinkHandler.shared.handle(url: url)
36+
}
37+
.environment(\.openURL, OpenURLAction { url in
38+
if DeeplinkHandler.shared.handle(url: url) {
39+
return .handled
40+
} else {
41+
return .systemAction
42+
}
43+
})
4744
} else {
4845
PushNotificationSetupView()
4946
}
@@ -65,8 +62,35 @@ public struct RootView: View {
6562
}
6663
}
6764

68-
private struct NavigationDestinationRootViewModifier: ViewModifier {
69-
func body(content: Content) -> some View {
65+
extension RootView {
66+
@ViewBuilder var contentView: some View {
67+
ZStack {
68+
NavigationStack {
69+
DashboardView()
70+
}
71+
.zIndex(0)
72+
73+
if let selectedCourse = navigationController.selectedCourse {
74+
CoursePathView(path: selectedCourse)
75+
.transition(.move(edge: .trailing))
76+
.id(selectedCourse.id)
77+
.zIndex(1)
78+
}
79+
80+
NavigationStack(path: $navigationController.outerPath) {
81+
Color.clear
82+
.modifier(NavigationDestinationRootViewModifier())
83+
}
84+
.toolbarBackground(.hidden)
85+
.opacity(navigationController.outerPath.isEmpty ? 0 : 1)
86+
.zIndex(2)
87+
}
88+
.animation(.easeOut(duration: 0.3), value: navigationController.selectedCourse)
89+
}
90+
}
91+
92+
public struct NavigationDestinationRootViewModifier: ViewModifier {
93+
public func body(content: Content) -> some View {
7094
content
7195
.navigationDestination(for: CoursePath.self, destination: CoursePathView.init)
7296
.navigationDestination(for: ExercisePath.self) { exercisePath in
@@ -84,7 +108,6 @@ private struct NavigationDestinationRootViewModifier: ViewModifier {
84108
LectureDetailView(courseId: lecturePath.coursePath.id, lectureId: lecturePath.id)
85109
}
86110
}
87-
.navigationDestination(for: ConversationPath.self, destination: ConversationPathView.init)
88-
.modifier(NavigationDestinationThreadViewModifier())
111+
.modifier(NavigationDestinationMessagesModifier())
89112
}
90113
}

ArtemisKit/Sources/CourseView/CourseView.swift

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@ public struct CourseView: View {
1818

1919
public var body: some View {
2020
TabView(selection: $navigationController.courseTab) {
21-
ExerciseListView(viewModel: viewModel, searchText: $searchText)
22-
.tabItem {
23-
Label(R.string.localizable.exercisesTabLabel(), systemImage: "list.bullet.clipboard.fill")
24-
}
25-
.tag(TabIdentifier.exercise)
21+
FixBlankScreenView {
22+
ExerciseListView(viewModel: viewModel, searchText: $searchText)
23+
}
24+
.tabItem {
25+
Label(R.string.localizable.exercisesTabLabel(), systemImage: "list.bullet.clipboard.fill")
26+
}
27+
.tag(TabIdentifier.exercise)
2628

27-
LectureListView(viewModel: viewModel, searchText: $searchText)
28-
.tabItem {
29-
Label(R.string.localizable.lectureTabLabel(), systemImage: "character.book.closed.fill")
30-
}
31-
.tag(TabIdentifier.lecture)
29+
FixBlankScreenView {
30+
LectureListView(viewModel: viewModel, searchText: $searchText)
31+
}
32+
.tabItem {
33+
Label(R.string.localizable.lectureTabLabel(), systemImage: "character.book.closed.fill")
34+
}
35+
.tag(TabIdentifier.lecture)
3236

3337
if viewModel.isMessagesVisible {
3438
MessagesTabView(course: viewModel.course, searchText: $searchText)
@@ -49,6 +53,21 @@ public struct CourseView: View {
4953
.onChange(of: navigationController.courseTab) {
5054
searchText = ""
5155
}
56+
.onDisappear {
57+
if navigationController.outerPath.count < 2 {
58+
// Reset selection if navigating back
59+
navigationController.selectedPath = nil
60+
}
61+
}
62+
.onAppear {
63+
// On iPad, always make Tab Bar opaque
64+
// This prevents an issue where the tab bar has content behind it but is transparent
65+
if UIDevice.current.userInterfaceIdiom == .pad {
66+
let appearance = UITabBarAppearance()
67+
appearance.configureWithDefaultBackground()
68+
UITabBar.appearance().scrollEdgeAppearance = appearance
69+
}
70+
}
5271
}
5372
}
5473

ArtemisKit/Sources/CourseView/ExerciseTab/ExerciseDetailView.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public struct ExerciseDetailView: View {
5252
.refreshable {
5353
await viewModel.refreshExercise()
5454
}
55+
.navigationBarTitleDisplayMode(.inline)
5556
}
5657
}
5758

@@ -220,15 +221,24 @@ private extension ExerciseDetailView {
220221
}
221222
}
222223

224+
// Communication
223225
if let channel = viewModel.channel.value {
224226
Divider()
225227
.frame(height: 1.0)
226228
.overlay(Color.Artemis.artemisBlue)
227229

228230
ExerciseDetailCell(descriptionText: R.string.localizable.communication() + ":") {
229-
NavigationLink(value: ConversationPath(conversation: .channel(conversation: channel),
230-
coursePath: .init(id: viewModel.courseId))) {
231-
Text("\(channel.conversationName) \(Image(systemName: "chevron.forward"))")
231+
Button {
232+
navigationController.outerPath = NavigationPath()
233+
navigationController.tabPath.append(
234+
ConversationPath(conversation: .channel(conversation: channel),
235+
coursePath: .init(id: viewModel.courseId))
236+
)
237+
} label: {
238+
let name = channel.conversationName
239+
let displayName = name
240+
.suffix(name.starts(with: "exercise-") ? name.count - 9 : name.count)
241+
Text("\(String(displayName)) \(Image(systemName: "chevron.forward"))")
232242
}
233243
}
234244
}

0 commit comments

Comments
 (0)