@@ -105,15 +105,22 @@ function isSameKeybindingRule(left: KeybindingRule, right: KeybindingRule): bool
105105}
106106
107107// Default rules added to a command after startup sync had already persisted
108- // that command. Backfill skips commands a config already has, so startup
109- // appends each rule here once per config and records its id. A user who later
110- // removes the rule keeps it removed.
108+ // that command. Backfill skips commands a config already has, so startup adds
109+ // each rule once per config, only next to the untouched earlier default
110+ // (`alongside`), and records its id. Customized commands and later removals
111+ // stay as the user set them.
111112const LATE_DEFAULT_KEYBINDINGS : ReadonlyArray < {
112113 readonly id : string ;
114+ readonly alongside : KeybindingRule ;
113115 readonly rule : KeybindingRule ;
114116} > = [
115117 {
116118 id : "composer.sendBackground:mod+enter" ,
119+ alongside : {
120+ key : "mod+alt+enter" ,
121+ command : "composer.sendBackground" ,
122+ when : "composerFocus && draftThreadRoute" ,
123+ } ,
117124 rule : {
118125 key : "mod+enter" ,
119126 command : "composer.sendBackground" ,
@@ -551,10 +558,10 @@ const make = Effect.gen(function* () {
551558 missingDefaults . push ( defaultRule ) ;
552559 }
553560 // The loop above backfills whole missing commands. Late defaults join
554- // commands the config already has , when their shortcut is still free.
555- for ( const { rule } of pendingLateDefaults ) {
561+ // an untouched earlier default , when their shortcut is still free.
562+ for ( const { alongside , rule } of pendingLateDefaults ) {
556563 if (
557- existingCommands . has ( rule . command ) &&
564+ customConfig . some ( ( entry ) => isSameKeybindingRule ( entry , alongside ) ) &&
558565 ! customConfig . some ( ( entry ) => hasSameShortcutContext ( entry , rule ) )
559566 ) {
560567 missingDefaults . push ( rule ) ;
0 commit comments