Skip to content

Commit

Permalink
Merge pull request #524 from pennlabs/jon0/penn-mobile-AI-FINAL
Browse files Browse the repository at this point in the history
Added Penn Mobile AI, the greatest innovation in the history of Penn Labs
  • Loading branch information
JHawk0224 authored Mar 31, 2024
2 parents 1e4db57 + ea1abda commit 718c1a5
Show file tree
Hide file tree
Showing 10 changed files with 664 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
LABS_OAUTH_CLIENT_ID = ${{ secrets.LABS_OAUTH_CLIENT_ID }}
APP_NAME = Penn Mobile
APP_BUNDLE_ID = org.pennlabs.PennMobile
OPENAI_API_KEY = ${{ secrets.OPENAI_API_KEY }}
EOF
- name: CREATE GoogleService-Info.plist
run: |
Expand Down
28 changes: 28 additions & 0 deletions PennMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
42D9237529E0CCFB00E9E18E /* FitnessView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42D9237429E0CCFB00E9E18E /* FitnessView.swift */; };
42ECD8B92B8CB6A000CE77E5 /* BadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42ECD8B82B8CB6A000CE77E5 /* BadgeView.swift */; };
56D74230B1B43DAF260BCCBE /* Pods_PennMobile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED8AA4945D67F0ED89FA9B0 /* Pods_PennMobile.framework */; };
6788845A2BB9D0C100BA2E70 /* AIChatModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678884552BB9D0C100BA2E70 /* AIChatModel.swift */; };
6788845B2BB9D0C100BA2E70 /* AIChatViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678884562BB9D0C100BA2E70 /* AIChatViewModel.swift */; };
6788845C2BB9D0C100BA2E70 /* ChatMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678884572BB9D0C100BA2E70 /* ChatMessageView.swift */; };
6788845D2BB9D0C100BA2E70 /* AIChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678884582BB9D0C100BA2E70 /* AIChatView.swift */; };
6788845E2BB9D0C100BA2E70 /* ChatMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678884592BB9D0C100BA2E70 /* ChatMessage.swift */; };
6C11C08026F842CF00407C04 /* HomeUpdateCellItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C11C07F26F842CF00407C04 /* HomeUpdateCellItem.swift */; };
6C1991BB27B5C73800BBB402 /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C1991BA27B5C73800BBB402 /* Environment.swift */; };
6C23AF9526E57903002F60F0 /* (null) in Sources */ = {isa = PBXBuildFile; };
Expand Down Expand Up @@ -564,6 +569,11 @@
42D9237229E0C9AF00E9E18E /* FitnessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FitnessViewController.swift; sourceTree = "<group>"; };
42D9237429E0CCFB00E9E18E /* FitnessView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FitnessView.swift; sourceTree = "<group>"; };
42ECD8B82B8CB6A000CE77E5 /* BadgeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeView.swift; sourceTree = "<group>"; };
678884552BB9D0C100BA2E70 /* AIChatModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AIChatModel.swift; sourceTree = "<group>"; };
678884562BB9D0C100BA2E70 /* AIChatViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AIChatViewModel.swift; sourceTree = "<group>"; };
678884572BB9D0C100BA2E70 /* ChatMessageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatMessageView.swift; sourceTree = "<group>"; };
678884582BB9D0C100BA2E70 /* AIChatView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AIChatView.swift; sourceTree = "<group>"; };
678884592BB9D0C100BA2E70 /* ChatMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatMessage.swift; sourceTree = "<group>"; };
6C11C07F26F842CF00407C04 /* HomeUpdateCellItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeUpdateCellItem.swift; sourceTree = "<group>"; };
6C1991BA27B5C73800BBB402 /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = "<group>"; };
6C1991BC27B5CA4D00BBB402 /* NotificationDevelopment.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = NotificationDevelopment.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1007,6 +1017,7 @@
216640621EBADADA00746B8E /* PennMobile */ = {
isa = PBXGroup;
children = (
678884542BB9D09900BA2E70 /* Penn Mobile AI */,
E49D3B8C2B66C6D20022AB71 /* Subletting */,
211B11A41F2995AD00A22C8A /* PennMobile.entitlements */,
89DF550829CE499B00EF03F7 /* Banners */,
Expand Down Expand Up @@ -1343,6 +1354,18 @@
path = Auth;
sourceTree = "<group>";
};
678884542BB9D09900BA2E70 /* Penn Mobile AI */ = {
isa = PBXGroup;
children = (
678884552BB9D0C100BA2E70 /* AIChatModel.swift */,
678884582BB9D0C100BA2E70 /* AIChatView.swift */,
678884562BB9D0C100BA2E70 /* AIChatViewModel.swift */,
678884592BB9D0C100BA2E70 /* ChatMessage.swift */,
678884572BB9D0C100BA2E70 /* ChatMessageView.swift */,
);
path = "Penn Mobile AI";
sourceTree = "<group>";
};
6C11C07E26F841CB00407C04 /* Update */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2486,6 +2509,7 @@
2189C0AA2027CE4B00771C1F /* TextLayer.swift in Sources */,
6CAA4B4C27A7639700473CC6 /* PollsNetworkManager.swift in Sources */,
21640FD7204A5309008DB6E8 /* LaundryMachineCellTappable.swift in Sources */,
6788845C2BB9D0C100BA2E70 /* ChatMessageView.swift in Sources */,
217A7838204D2E2B004F1227 /* HomeGSRCellItem.swift in Sources */,
89EA262E290F9411008F26CF /* Intents.intentdefinition in Sources */,
2119D26722529A0600693CDB /* HomeGSRLocationsCellItem.swift in Sources */,
Expand Down Expand Up @@ -2557,6 +2581,7 @@
6C84D9E526293E680039C57F /* UIKit Views.swift in Sources */,
21B649242236FFD300AC5B7F /* BuildingMapWebviewController.swift in Sources */,
89459B9428E7935E00CE1638 /* CoursesView.swift in Sources */,
6788845B2BB9D0C100BA2E70 /* AIChatViewModel.swift in Sources */,
426A0B52299034910066C7B7 /* DiningAnalyticsGraphBox.swift in Sources */,
F212BE7F23B6ACF100ED46A1 /* PrivacyTableViewController.swift in Sources */,
89E37E102B6F5BD2000A86B7 /* NewListingForm.swift in Sources */,
Expand All @@ -2581,6 +2606,7 @@
B62875ED2115433100FB2873 /* PennCoordinate.swift in Sources */,
EFE2D6F6239B11050020F6BF /* GSRColorCell.swift in Sources */,
6CC88D6227B1BF51006896F6 /* PredictionsGraphView+SmoothedData.swift in Sources */,
6788845E2BB9D0C100BA2E70 /* ChatMessage.swift in Sources */,
890D15022AB74F0700672FFE /* LoggedOutView.swift in Sources */,
F212BE8823B71C7100ED46A1 /* NotificationsTableViewController.swift in Sources */,
6CC88D6527B1BF51006896F6 /* PredictionsGraphView+AxisLabels.swift in Sources */,
Expand Down Expand Up @@ -2661,7 +2687,9 @@
216640C41EBADC9300746B8E /* GenericControllers.swift in Sources */,
EFE2D6F4239B11050020F6BF /* GroupCell.swift in Sources */,
C1D90F1D2220A25700DAB8EE /* NoReservationsCell.swift in Sources */,
6788845A2BB9D0C100BA2E70 /* AIChatModel.swift in Sources */,
217A7834204D2DF5004F1227 /* HomeDiningCellItem.swift in Sources */,
6788845D2BB9D0C100BA2E70 /* AIChatView.swift in Sources */,
C11DFA31219F90E5000FC573 /* CalendarEvent.swift in Sources */,
42CC49D02AAE38C6008C41EE /* PollsViewController.swift in Sources */,
6CC88D6B27B1BF51006896F6 /* DiningVenueView.swift in Sources */,
Expand Down
36 changes: 35 additions & 1 deletion PennMobile/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import SwiftUI
struct HomeView<Model: HomeViewModel>: View {
@State var showTitle = false
@State var splashText: String?
@State var showSheet: Bool = false
@State var sheet: AIChatView? = AIChatView()

@Environment(\.colorScheme) var colorScheme
@EnvironmentObject var viewModel: Model
Expand All @@ -24,7 +26,7 @@ struct HomeView<Model: HomeViewModel>: View {
}

var body: some View {
Group {
ZStack {
NavigationStack {
ScrollView {
TimelineView(.periodic(from: Date.midnightYesterday, by: 24 * 60 * 60)) { context in
Expand Down Expand Up @@ -97,11 +99,43 @@ struct HomeView<Model: HomeViewModel>: View {
try? await viewModel.fetchData(force: true)
}
}

VStack {
Spacer()
HStack {
Spacer()
Button {
sheet = sheet != nil ? sheet : AIChatView()
showSheet = true
} label: {
ZStack {
RoundedRectangle(cornerRadius: 32)
.foregroundStyle(.blue)
.overlay {
RoundedRectangle(cornerRadius: 32)
.stroke(.white)
}
Text("Check out Penn Mobile AI")
.font(.headline)
.foregroundStyle(.white)
}
.frame(width: 175, height: 100)
.shadow(radius: 2)
}.padding()
}
}

}.onAppear {
Task {
try? await viewModel.fetchData(force: false)
}
}
.sheet(isPresented: $showSheet, onDismiss: {
showSheet = false
sheet = nil
}) {
sheet
}
}

func chooseSplashText(data: HomeViewData, for date: Date) {
Expand Down
Loading

0 comments on commit 718c1a5

Please sign in to comment.