File tree Expand file tree Collapse file tree 9 files changed +39
-3
lines changed
components/profileSettings Expand file tree Collapse file tree 9 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 70
70
{/ snippet }
71
71
</SectionCard >
72
72
73
+ <SectionCard labelFor ="single-branch" roundedTop ={false } orientation =" row" >
74
+ {#snippet title ()}
75
+ Single-branch mode
76
+ {/ snippet }
77
+ {#snippet caption ()}
78
+ Stay in the workspace view when leaving the gitbutler/workspace branch.
79
+ {/ snippet }
80
+ {#snippet actions ()}
81
+ <Toggle
82
+ id =" rules"
83
+ checked ={$settingsStore ?.featureFlags .singleBranch }
84
+ onclick ={() =>
85
+ settingsService .updateFeatureFlags ({
86
+ singleBranch: ! $settingsStore ?.featureFlags .singleBranch
87
+ })}
88
+ />
89
+ {/ snippet }
90
+ </SectionCard >
91
+
73
92
{#if $user ?.role === ' admin' }
74
93
<Spacer margin ={20 } />
75
94
{#if $settingsStore ?.featureFlags .actions }
Original file line number Diff line number Diff line change @@ -76,8 +76,11 @@ export function formatMessages(events: ClaudeMessage[]): Message[] {
76
76
if ( Array . isArray ( content ) && content [ 0 ] ! . type === 'tool_result' ) {
77
77
const result = content [ 0 ] ! ;
78
78
const foundToolCall = toolCalls [ result . tool_use_id ] ;
79
- if ( ! foundToolCall || ! result . content ) throw new Error ( "Ahh! I can't handle this" ) ;
80
- if ( typeof result . content === 'string' ) {
79
+ if ( ! foundToolCall ) {
80
+ return [ ] ;
81
+ } else if ( ! result . content ) {
82
+ foundToolCall . result = undefined ;
83
+ } else if ( typeof result . content === 'string' ) {
81
84
foundToolCall . result = result . content ;
82
85
} else if ( result . content [ 0 ] ! . type === 'text' ) {
83
86
foundToolCall . result = result . content [ 0 ] ! . text ;
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ export type FeatureFlags = {
123
123
butbot : boolean ;
124
124
/** Enable processing of workspace rules. */
125
125
rules : boolean ;
126
+ /** Enable single-branch mode. */
127
+ singleBranch : boolean ;
126
128
} ;
127
129
128
130
export type Fetch = {
Original file line number Diff line number Diff line change 29
29
// / Enable the usage of the butbot chat.
30
30
"butbot" : false ,
31
31
// / Enable processing of workspace rules.
32
- "rules" : false
32
+ "rules" : false ,
33
+ // / Enable single branch mode.
34
+ "singleBranch" : false
33
35
},
34
36
// Allows for additional "connect-src" hosts to be included. Requires app restart.
35
37
"extraCsp" : {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub struct FeatureFlagsUpdate {
19
19
pub actions : Option < bool > ,
20
20
pub butbot : Option < bool > ,
21
21
pub rules : Option < bool > ,
22
+ pub single_branch : Option < bool > ,
22
23
}
23
24
24
25
/// Mutation, immediately followed by writing everything to disk.
@@ -56,6 +57,7 @@ impl AppSettingsWithDiskSync {
56
57
actions,
57
58
butbot,
58
59
rules,
60
+ single_branch,
59
61
} : FeatureFlagsUpdate ,
60
62
) -> Result < ( ) > {
61
63
let mut settings = self . get_mut_enforce_save ( ) ?;
@@ -71,6 +73,9 @@ impl AppSettingsWithDiskSync {
71
73
if let Some ( rules) = rules {
72
74
settings. feature_flags . rules = rules;
73
75
}
76
+ if let Some ( single_branch) = single_branch {
77
+ settings. feature_flags . single_branch = single_branch;
78
+ }
74
79
settings. save ( )
75
80
}
76
81
}
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ pub struct FeatureFlags {
47
47
pub butbot : bool ,
48
48
/// Enable processing of workspace rules.
49
49
pub rules : bool ,
50
+ /// Enable single branch mode.
51
+ pub single_branch : bool ,
50
52
}
51
53
52
54
fn default_true ( ) -> bool {
Original file line number Diff line number Diff line change @@ -347,6 +347,7 @@ pub mod stacks {
347
347
actions : false ,
348
348
butbot : false ,
349
349
rules : false ,
350
+ single_branch : false ,
350
351
} ,
351
352
..AppSettings :: default ( )
352
353
} ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ pub fn create_stack_with_branch(
36
36
actions : false ,
37
37
butbot : false ,
38
38
rules : false ,
39
+ single_branch : false ,
39
40
} ,
40
41
..AppSettings :: load_from_default_path_creating ( ) ?
41
42
} ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ pub fn project_status(project_dir: &Path) -> anyhow::Result<but_tools::workspace
16
16
actions : false ,
17
17
butbot : false ,
18
18
rules : false ,
19
+ single_branch : false ,
19
20
} ,
20
21
..AppSettings :: load_from_default_path_creating ( ) ?
21
22
} ;
You can’t perform that action at this time.
0 commit comments