Skip to content

Commit f98880c

Browse files
authored
[UX] Update HTML CSS effect and add more toolbar item (#64)
1 parent 8b74af5 commit f98880c

File tree

13 files changed

+459
-49
lines changed

13 files changed

+459
-49
lines changed

Forumate.xcodeproj/project.pbxproj

+39
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@
171171
27F4340D2AAC15840042F681 /* PlusManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F4340B2AAC15840042F681 /* PlusManager.swift */; };
172172
27F4340F2AAC1A940042F681 /* AppViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F4340E2AAC1A940042F681 /* AppViewModifier.swift */; };
173173
27F434102AAC1A940042F681 /* AppViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F4340E2AAC1A940042F681 /* AppViewModifier.swift */; };
174+
27FDBEA22AADDC3500A3448C /* styleSheet.css in Resources */ = {isa = PBXBuildFile; fileRef = 27FDBE9D2AADDC3500A3448C /* styleSheet.css */; };
175+
27FDBEA32AADDC3500A3448C /* styleSheet.css in Resources */ = {isa = PBXBuildFile; fileRef = 27FDBE9D2AADDC3500A3448C /* styleSheet.css */; };
176+
27FDBEA62AADE9B600A3448C /* LoremSwiftum in Frameworks */ = {isa = PBXBuildFile; productRef = 27FDBEA52AADE9B600A3448C /* LoremSwiftum */; };
177+
27FDBEA82AADE9C400A3448C /* LoremSwiftum in Frameworks */ = {isa = PBXBuildFile; productRef = 27FDBEA72AADE9C400A3448C /* LoremSwiftum */; };
174178
/* End PBXBuildFile section */
175179

176180
/* Begin PBXContainerItemProxy section */
@@ -291,6 +295,7 @@
291295
27F434092AAC131E0042F681 /* ContributorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContributorView.swift; sourceTree = "<group>"; };
292296
27F4340B2AAC15840042F681 /* PlusManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusManager.swift; sourceTree = "<group>"; };
293297
27F4340E2AAC1A940042F681 /* AppViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppViewModifier.swift; sourceTree = "<group>"; };
298+
27FDBE9D2AADDC3500A3448C /* styleSheet.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = styleSheet.css; sourceTree = "<group>"; };
294299
/* End PBXFileReference section */
295300

296301
/* Begin PBXFrameworksBuildPhase section */
@@ -307,6 +312,7 @@
307312
files = (
308313
275482A12AAD8DA00050E65D /* SDWebImageSwiftUI in Frameworks */,
309314
27CDD3832A1BAEAC003E3D00 /* Flow in Frameworks */,
315+
27FDBEA82AADE9C400A3448C /* LoremSwiftum in Frameworks */,
310316
27DFFCF92A2B35B3005661BD /* DiscourseKit in Frameworks */,
311317
27AFDC972AADB23E0040C4F1 /* SDWebImageSVGCoder in Frameworks */,
312318
27C00A302A2CC10F00CA9ACD /* HtmlText in Frameworks */,
@@ -321,6 +327,7 @@
321327
files = (
322328
2754829F2AAD8D980050E65D /* SDWebImageSwiftUI in Frameworks */,
323329
273AFBDE2A1A8CF100DD08F5 /* AcknowKit in Frameworks */,
330+
27FDBEA62AADE9B600A3448C /* LoremSwiftum in Frameworks */,
324331
27DFFCF72A2B35AB005661BD /* DiscourseKit in Frameworks */,
325332
27AFDC952AADB2380040C4F1 /* SDWebImageSVGCoder in Frameworks */,
326333
27C00A2C2A2CC10700CA9ACD /* HtmlText in Frameworks */,
@@ -559,6 +566,7 @@
559566
278E53E32A18E83000DCD159 /* ViewModel */,
560567
277C15C22A18F021007940C7 /* Extension */,
561568
274C4CA22A3F85350018BFA4 /* Store */,
569+
27FDBE9A2AADDC3500A3448C /* Web */,
562570
2726057E2A1A12360018B908 /* PreviewData */,
563571
278E54142A18E85300DCD159 /* Other */,
564572
278E53E72A18E83000DCD159 /* Preview Content */,
@@ -768,6 +776,14 @@
768776
name = Products;
769777
sourceTree = "<group>";
770778
};
779+
27FDBE9A2AADDC3500A3448C /* Web */ = {
780+
isa = PBXGroup;
781+
children = (
782+
27FDBE9D2AADDC3500A3448C /* styleSheet.css */,
783+
);
784+
path = Web;
785+
sourceTree = "<group>";
786+
};
771787
/* End PBXGroup section */
772788

773789
/* Begin PBXNativeTarget section */
@@ -810,6 +826,7 @@
810826
270CD67C2AA2294C004DBD1D /* SimpleToast */,
811827
275482A02AAD8DA00050E65D /* SDWebImageSwiftUI */,
812828
27AFDC962AADB23E0040C4F1 /* SDWebImageSVGCoder */,
829+
27FDBEA72AADE9C400A3448C /* LoremSwiftum */,
813830
);
814831
productName = "ForumateWatch Watch App";
815832
productReference = 273AFBE72A1A94E100DD08F5 /* ForumateWatch.app */;
@@ -838,6 +855,7 @@
838855
270CD67A2AA22945004DBD1D /* SimpleToast */,
839856
2754829E2AAD8D980050E65D /* SDWebImageSwiftUI */,
840857
27AFDC942AADB2380040C4F1 /* SDWebImageSVGCoder */,
858+
27FDBEA52AADE9B600A3448C /* LoremSwiftum */,
841859
);
842860
productName = Forumate;
843861
productReference = 27EEA08629EFCD1B00ADA5BE /* Forumate.app */;
@@ -883,6 +901,7 @@
883901
270CD6792AA228D5004DBD1D /* XCRemoteSwiftPackageReference "SimpleToast" */,
884902
2754829D2AAD8D980050E65D /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */,
885903
27AFDC932AADB22A0040C4F1 /* XCRemoteSwiftPackageReference "SDWebImageSVGCoder" */,
904+
27FDBEA42AADE9B600A3448C /* XCRemoteSwiftPackageReference "LoremSwiftum" */,
886905
);
887906
productRefGroup = 27EEA08729EFCD1B00ADA5BE /* Products */;
888907
projectDirPath = "";
@@ -911,6 +930,7 @@
911930
271808CB2A324995008B1970 /* InfoPlist.xcstrings in Resources */,
912931
270808FC2A9FA3D50089E5DC /* Assets.xcassets in Resources */,
913932
271808C72A32496D008B1970 /* Localizable.xcstrings in Resources */,
933+
27FDBEA32AADDC3500A3448C /* styleSheet.css in Resources */,
914934
);
915935
runOnlyForDeploymentPostprocessing = 0;
916936
};
@@ -922,6 +942,7 @@
922942
278E54042A18E83000DCD159 /* Assets.xcassets in Resources */,
923943
271808CA2A324995008B1970 /* InfoPlist.xcstrings in Resources */,
924944
271808C62A32496D008B1970 /* Localizable.xcstrings in Resources */,
945+
27FDBEA22AADDC3500A3448C /* styleSheet.css in Resources */,
925946
);
926947
runOnlyForDeploymentPostprocessing = 0;
927948
};
@@ -1542,6 +1563,14 @@
15421563
minimumVersion = 0.2.0;
15431564
};
15441565
};
1566+
27FDBEA42AADE9B600A3448C /* XCRemoteSwiftPackageReference "LoremSwiftum" */ = {
1567+
isa = XCRemoteSwiftPackageReference;
1568+
repositoryURL = "https://github.com/lukaskubanek/LoremSwiftum.git";
1569+
requirement = {
1570+
branch = master;
1571+
kind = branch;
1572+
};
1573+
};
15451574
/* End XCRemoteSwiftPackageReference section */
15461575

15471576
/* Begin XCSwiftPackageProductDependency section */
@@ -1613,6 +1642,16 @@
16131642
package = 27DFFCF32A2B3574005661BD /* XCRemoteSwiftPackageReference "DiscourseKit" */;
16141643
productName = DiscourseKit;
16151644
};
1645+
27FDBEA52AADE9B600A3448C /* LoremSwiftum */ = {
1646+
isa = XCSwiftPackageProductDependency;
1647+
package = 27FDBEA42AADE9B600A3448C /* XCRemoteSwiftPackageReference "LoremSwiftum" */;
1648+
productName = LoremSwiftum;
1649+
};
1650+
27FDBEA72AADE9C400A3448C /* LoremSwiftum */ = {
1651+
isa = XCSwiftPackageProductDependency;
1652+
package = 27FDBEA42AADE9B600A3448C /* XCRemoteSwiftPackageReference "LoremSwiftum" */;
1653+
productName = LoremSwiftum;
1654+
};
16161655
/* End XCSwiftPackageProductDependency section */
16171656
};
16181657
rootObject = 27EEA07E29EFCD1B00ADA5BE /* Project object */;

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

+9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
"version" : "1.1.8"
2828
}
2929
},
30+
{
31+
"identity" : "loremswiftum",
32+
"kind" : "remoteSourceControl",
33+
"location" : "https://github.com/lukaskubanek/LoremSwiftum.git",
34+
"state" : {
35+
"branch" : "master",
36+
"revision" : "8942e732e50458cde5dccf9996afa16f29372853"
37+
}
38+
},
3039
{
3140
"identity" : "sdwebimage",
3241
"kind" : "remoteSourceControl",

Forumate/ForumateApp.swift

+10-4
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,29 @@ struct ForumateApp: App {
4141
.modifier(AppViewModifier())
4242
}
4343
.environmentObject(appState)
44+
.environment(plusManager)
45+
.modelContainer(container)
4446
#if os(iOS) || os(macOS)
4547
.environment(themeManager)
48+
.commands {
49+
ToolbarCommands()
50+
}
4651
#endif
47-
.environment(plusManager)
48-
.modelContainer(container)
4952

5053
#if os(iOS) || os(visionOS) || os(macOS)
5154
WindowGroup("Topic Detail", id: "topic", for: TopicDetailWindowModel.self) { $detailModel in
5255
DetailWindowView(detailModel: detailModel)
5356
.modifier(AppViewModifier())
5457
}
5558
.environmentObject(appState)
59+
.environment(plusManager)
60+
.modelContainer(container)
5661
#if os(iOS) || os(macOS)
5762
.environment(themeManager)
63+
.commands {
64+
ToolbarCommands()
65+
}
5866
#endif
59-
.environment(plusManager)
60-
.modelContainer(container)
6167
#endif
6268
}
6369
}

Forumate/Other/Localizable.xcstrings

+13-3
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@
517517
}
518518
}
519519
},
520-
"Mark as read" : {
520+
"Mark As Read" : {
521521
"localizations" : {
522522
"zh-Hans" : {
523523
"stringUnit" : {
@@ -667,6 +667,16 @@
667667
}
668668
}
669669
},
670+
"Open Topic's Link" : {
671+
"localizations" : {
672+
"zh-Hans" : {
673+
"stringUnit" : {
674+
"state" : "translated",
675+
"value" : "打开话题链接"
676+
}
677+
}
678+
}
679+
},
670680
"Other" : {
671681
"localizations" : {
672682
"zh-Hans" : {
@@ -907,12 +917,12 @@
907917
}
908918
}
909919
},
910-
"Unimplemented" : {
920+
"Unimplemented Feature" : {
911921
"localizations" : {
912922
"zh-Hans" : {
913923
"stringUnit" : {
914924
"state" : "translated",
915-
"value" : "未实现"
925+
"value" : "未实现的功能"
916926
}
917927
}
918928
}

Forumate/View/Tab/Settings/SettingsTab.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import SwiftUI
99

1010
struct SettingsTab: View {
11-
@State private var tabState = SettingsTabState()
11+
@StateObject private var tabState = SettingsTabState()
1212

1313
var body: some View {
1414
NavigationSplitView(columnVisibility: .constant(.all)) {
@@ -27,7 +27,7 @@ struct SettingsTab: View {
2727
case .theme: ThemeSection()
2828
#endif
2929
case .general: GeneralSection()
30-
case .notification: Text("Unimplemented")
30+
case .notification: Text("Unimplemented Feature")
3131
case .support: SupportSection()
3232
case .privacy: PrivacyPolicySection()
3333
case .acknowledgement: AcknowSection()
@@ -44,7 +44,7 @@ struct SettingsTab: View {
4444
}
4545
}
4646
.navigationSplitViewStyleType(SplitViewStyleTypeSetting.value)
47-
.environment(tabState)
47+
.environmentObject(tabState)
4848
}
4949
}
5050

Forumate/View/Tab/Settings/SettingsTabRoot.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftUI
1010

1111
struct SettingsTabRoot: View {
1212
@EnvironmentObject private var appState: AppState
13-
@Environment(SettingsTabState.self) private var tabState
13+
@EnvironmentObject private var tabState: SettingsTabState
1414
@State private var showStarterIntro = false
1515
#if os(iOS) || os(visionOS) || os(macOS)
1616
@State private var showPasteToast = false
@@ -26,7 +26,6 @@ struct SettingsTabRoot: View {
2626
}
2727

2828
var body: some View {
29-
@Bindable var tabState = tabState
3029
List(selection: $tabState.destination) {
3130
Section {
3231
navigationItem(destination: .forumatePlus, text: "Forumate+") {
@@ -125,6 +124,6 @@ struct SettingsTabRoot: View {
125124
NavigationStack {
126125
SettingsTabRoot()
127126
}
128-
.environment(SettingsTabState())
127+
.environmentObject(SettingsTabState())
129128
.environmentObject(AppState())
130129
}

Forumate/View/Tab/Settings/ViewModel/SettingsTabState.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// Created by Kyle on 2023/5/21.
66
//
77

8-
import Observation
8+
import SwiftUI
99

10-
@Observable
11-
class SettingsTabState {
12-
var destination: SettingsTabDestination?
10+
// FIXME: If we change this to use Observable Macro, we'll get a stable crash.
11+
class SettingsTabState: ObservableObject {
12+
@Published var destination: SettingsTabDestination?
1313
}

Forumate/View/Tab/Topics/Community/View/CommunityDetail/CommunityDetail.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct CommunityDetail: View {
2727
LatestTopicsView(showCategory: true)
2828
default:
2929
Section {
30-
Text("Unimplemented")
30+
Text("Unimplemented Feature")
3131
} header: {
3232
CommunitySectionHeader(text: state.viewByType.rawValue.uppercased())
3333
}

0 commit comments

Comments
 (0)