@@ -28,6 +28,9 @@ struct ChatSettingsGeneralSectionView: View {
2828 @AppStorage (
2929 \. disableFloatOnTopWhenTheChatPanelIsDetached
3030 ) var disableFloatOnTopWhenTheChatPanelIsDetached
31+ @AppStorage ( \. openChatMode) var openChatMode
32+ @AppStorage ( \. openChatInBrowserURL) var openChatInBrowserURL
33+ @AppStorage ( \. openChatInBrowserInInAppBrowser) var openChatInBrowserInInAppBrowser
3134
3235 init ( ) { }
3336 }
@@ -39,6 +42,8 @@ struct ChatSettingsGeneralSectionView: View {
3942
4043 var body : some View {
4144 VStack {
45+ openChatSettingsForm
46+ SettingsDivider ( " Conversation " )
4247 chatSettingsForm
4348 SettingsDivider ( " UI " )
4449 uiForm
@@ -47,6 +52,45 @@ struct ChatSettingsGeneralSectionView: View {
4752 }
4853 }
4954
55+ @ViewBuilder
56+ var openChatSettingsForm : some View {
57+ Form {
58+ Picker (
59+ " Open Chat Mode " ,
60+ selection: $settings. openChatMode
61+ ) {
62+ ForEach ( OpenChatMode . allCases, id: \. rawValue) { mode in
63+ switch mode {
64+ case . chatPanel:
65+ Text ( " Open chat panel " ) . tag ( mode)
66+ case . browser:
67+ Text ( " Open web page in browser " ) . tag ( mode)
68+ }
69+ }
70+ }
71+
72+ if settings. openChatMode == . browser {
73+ TextField (
74+ " Chat web page URL " ,
75+ text: $settings. openChatInBrowserURL,
76+ prompt: Text ( " https:// " )
77+ )
78+ . textFieldStyle ( . roundedBorder)
79+ . disableAutocorrection ( true )
80+ . autocorrectionDisabled ( true )
81+
82+ #if canImport(ProHostApp)
83+ WithFeatureEnabled ( \. browserTab) {
84+ Toggle (
85+ " Open web page in chat panel " ,
86+ isOn: $settings. openChatInBrowserInInAppBrowser
87+ )
88+ }
89+ #endif
90+ }
91+ }
92+ }
93+
5094 @ViewBuilder
5195 var chatSettingsForm : some View {
5296 Form {
0 commit comments