File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Core/Sources/HostApp/FeatureSettings Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ struct ChatSettingsView: View {
44 class Settings : ObservableObject {
55 @AppStorage ( \. chatFontSize) var chatFontSize
66 @AppStorage ( \. chatCodeFontSize) var chatCodeFontSize
7+ @AppStorage ( \. embedFileContentInChatContextIfNoSelection)
8+ var embedFileContentInChatContextIfNoSelection
9+ @AppStorage ( \. maxEmbeddableFileInChatContextLineCount)
10+ var maxEmbeddableFileInChatContextLineCount
711 init ( ) { }
812 }
913
@@ -36,6 +40,33 @@ struct ChatSettingsView: View {
3640
3741 Text ( " pt " )
3842 }
43+
44+ Divider ( )
45+
46+ Toggle ( isOn: $settings. embedFileContentInChatContextIfNoSelection) {
47+ Text ( " Embed file content in chat context if no code is selected. " )
48+ }
49+
50+ HStack {
51+ TextField ( text: . init( get: {
52+ " \( Int ( settings. maxEmbeddableFileInChatContextLineCount) ) "
53+ } , set: {
54+ settings. maxEmbeddableFileInChatContextLineCount = Int ( $0) ?? 0
55+ } ) ) {
56+ Text ( " Max embeddable file " )
57+ }
58+ . textFieldStyle ( . roundedBorder)
59+
60+ Text ( " lines " )
61+ }
3962 }
4063 }
4164}
65+
66+ // MARK: - Preview
67+
68+ struct ChatSettingsView_Previews : PreviewProvider {
69+ static var previews : some View {
70+ ChatSettingsView ( )
71+ }
72+ }
You can’t perform that action at this time.
0 commit comments